gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 9bcc90820f18cc942ad86125c96f73dea1fe7d45 parent e8e0138c279230f3fcb44b3d71fef59c4a0c417b Author: Toxa <56631470+untoxa@users.noreply.github.com> Date: Sun, 19 May 2024 22:16:50 +0300 Merge pull request #673 from michel-iwaniec/nes_fix_sprite_palette_indexing NES: Fix bug with set_sprite_palette indexing. Sprite palettes are now indexed from 0..3 instead of 4..7 Diffstat:
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/gbdk-lib/examples/cross-platform/metasprites/src/metasprites.c b/gbdk-lib/examples/cross-platform/metasprites/src/metasprites.c @@ -167,10 +167,10 @@ void main(void) { set_sprite_palette(OAMF_CGB_PAL2, 1, cyan_pal); set_sprite_palette(OAMF_CGB_PAL3, 1, green_pal); #elif defined(NINTENDO_NES) - set_sprite_palette(4, 1, gray_pal); - set_sprite_palette(5, 1, pink_pal); - set_sprite_palette(6, 1, cyan_pal); - set_sprite_palette(7, 1, green_pal); + set_sprite_palette(0, 1, gray_pal); + set_sprite_palette(1, 1, pink_pal); + set_sprite_palette(2, 1, cyan_pal); + set_sprite_palette(3, 1, green_pal); #endif // Fill the screen background with a single tile pattern diff --git a/gbdk-lib/examples/cross-platform/platformer_template/src/player.c b/gbdk-lib/examples/cross-platform/platformer_template/src/player.c @@ -33,13 +33,7 @@ uint8_t threeFrameCounter=0; uint16_t playerX, playerY; int16_t playerXVelocity, playerYVelocity; - // Flip horizontally, if we aren't facing right - -#if defined(NINTENDO_NES) - const uint8_t baseProp=4; -#else - const uint8_t baseProp=0; -#endif +const uint8_t baseProp=0; #if defined(SEGA) #define PLAYER_PALETTES_BANK CURRENT_BANK diff --git a/gbdk-lib/libc/targets/mos6502/nes/nes_palettes.s b/gbdk-lib/libc/targets/mos6502/nes/nes_palettes.s @@ -34,8 +34,8 @@ _set_sprite_palette:: pla asl asl - tax adc #16 + tax ; jmp .set_palette_impl .set_palette_impl:
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.