Skip to content

Commit

Permalink
[MC] Save some IRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
darthcloud committed Aug 22, 2023
1 parent fd1bdaa commit 1510a52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main/adapter/memory_card.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Jacques Gagnon
* Copyright (c) 2021-2023, Jacques Gagnon
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -164,11 +164,11 @@ void mc_storage_update(void) {
}

/* Assume r/w size will never cross blocks boundary */
void mc_read(uint32_t addr, uint8_t *data, uint32_t size) {
void IRAM_ATTR mc_read(uint32_t addr, uint8_t *data, uint32_t size) {
memcpy(data, mc_buffer[addr >> 12] + (addr & 0xFFF), size);
}

void mc_write(uint32_t addr, uint8_t *data, uint32_t size) {
void IRAM_ATTR mc_write(uint32_t addr, uint8_t *data, uint32_t size) {
struct raw_fb fb_data = {0};
uint32_t block = addr >> 12;

Expand All @@ -181,6 +181,6 @@ void mc_write(uint32_t addr, uint8_t *data, uint32_t size) {
adapter_q_fb(&fb_data);
}

uint8_t *mc_get_ptr(uint32_t addr) {
uint8_t IRAM_ATTR *mc_get_ptr(uint32_t addr) {
return mc_buffer[addr >> 12] + (addr & 0xFFF);
}
1 change: 0 additions & 1 deletion main/linker.lf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ entries:
pce_io (noflash)
jag_io (noflash)
wii_i2c (noflash)
memory_card (noflash)
devcrypto (noflash)

0 comments on commit 1510a52

Please sign in to comment.