Merge pull request #7 from JettMonstersGoBoom/main

neslib.c fixes
This commit is contained in:
drmortalwombat 2023-03-23 13:35:14 +01:00 committed by GitHub
commit 55a2c25b44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,24 @@ int main(void)
ppu.scroll = 0x00; ppu.scroll = 0x00;
ppu.oamaddr = 0x00; ppu.oamaddr = 0x00;
// detech PAL or NTSC based on Blarg code.
ppu_wait_nmi();
__asm {
ldx #52
ldy #24
system_check_wait:
dex
bne system_check_wait
dey
bne system_check_wait
lda $2002
and #$80
sta NTSC_MODE
}
nes_game(); nes_game();
return 0; return 0;
@ -266,7 +284,7 @@ void oam_clear(void)
{ {
char i = 0; char i = 0;
do { do {
OAM_BUF[i] = 0; OAM_BUF[i] = 255; // off screen not top corner.
i += 4; i += 4;
} while (i); } while (i);
} }