Skip to content

Commit

Permalink
Use .noinit instead of .ram for neslib/nesdoug buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
cogwheel committed Sep 26, 2023
1 parent 0eaab42 commit 84ee820
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mos-platform/nes/nesdoug/vram_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// version 1.2, 1/1/2022

__attribute__((section(".zp.vram_index"))) char VRAM_INDEX;
__attribute__((weak, aligned(128), section(".ram.vram_buf"))) char VRAM_BUF[128];
__attribute__((weak, aligned(128), section(".noinit.vram_buf"))) char VRAM_BUF[128];

void __post_vram_update() {
VRAM_BUF[0] = 0xff;
Expand Down
2 changes: 1 addition & 1 deletion mos-platform/nes/neslib/oam_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// information.

__attribute__((section(".zp.sprid"))) unsigned SPRID;
__attribute__((weak, aligned(256), section(".ram.oam_buf"))) char OAM_BUF[256];
__attribute__((weak, aligned(256), section(".noinit.oam_buf"))) char OAM_BUF[256];

void oam_set(char index) { SPRID = index & 0xfc; }

Expand Down
2 changes: 1 addition & 1 deletion mos-platform/nes/neslib/pal_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// information.

__attribute__((section(".zp.pal_update"))) volatile char PAL_UPDATE;
__attribute__((weak, aligned(32), section(".ram.pal_buf"))) volatile char PAL_BUF[32];
__attribute__((weak, aligned(32), section(".noinit.pal_buf"))) volatile char PAL_BUF[32];

void pal_col(char index, char color) {
PAL_BUF[index & 0x1f] = color;
Expand Down

0 comments on commit 84ee820

Please sign in to comment.