From 1de8a7f7abdacae5ab2f7bb0c68c712a3802568b Mon Sep 17 00:00:00 2001 From: Alex Duchesne Date: Mon, 5 Feb 2024 16:27:22 -0500 Subject: [PATCH] NES: Removes some unnecessary IRAM_ATTR attributes Functions are called only once per frame AND don't do any intense computation do not belong in IRAM --- retro-core/components/nofrendo/nes/apu.c | 2 +- retro-core/components/nofrendo/nes/ppu.c | 7 +------ retro-core/components/nofrendo/nes/ppu.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/retro-core/components/nofrendo/nes/apu.c b/retro-core/components/nofrendo/nes/apu.c index 643af05fc..66d5617bf 100644 --- a/retro-core/components/nofrendo/nes/apu.c +++ b/retro-core/components/nofrendo/nes/apu.c @@ -76,7 +76,7 @@ static const int dmc_clocks[16] = static const int duty_flip[4] = { 2, 4, 8, 12 }; -IRAM_ATTR void apu_fc_advance(int cycles) +void apu_fc_advance(int cycles) { // https://wiki.nesdev.com/w/index.php/APU_Frame_Counter const int int_period = 4 * 7457; diff --git a/retro-core/components/nofrendo/nes/ppu.c b/retro-core/components/nofrendo/nes/ppu.c index ac7062924..3d976cfb7 100644 --- a/retro-core/components/nofrendo/nes/ppu.c +++ b/retro-core/components/nofrendo/nes/ppu.c @@ -636,12 +636,7 @@ bool ppu_enabled(void) return (ppu.bg_on || ppu.obj_on); } -bool ppu_inframe(void) -{ - return (ppu.scanline < 240); -} - -IRAM_ATTR void ppu_endline() +void ppu_endline(void) { /* modify vram address at end of scanline */ if (ppu.scanline < 240 && (ppu.bg_on || ppu.obj_on)) diff --git a/retro-core/components/nofrendo/nes/ppu.h b/retro-core/components/nofrendo/nes/ppu.h index 829c04a05..655f30e4e 100644 --- a/retro-core/components/nofrendo/nes/ppu.h +++ b/retro-core/components/nofrendo/nes/ppu.h @@ -148,7 +148,6 @@ void ppu_refresh(void); void ppu_reset(void); void ppu_shutdown(void); bool ppu_enabled(void); -bool ppu_inframe(void); void ppu_setopt(ppu_option_t n, uint8_t val); uint8_t ppu_getopt(ppu_option_t n);