6502 command stream player, part 6

preparing NES test player
This commit is contained in:
tildearrow 2025-04-18 04:57:13 -05:00
parent 543b99e353
commit 3a04b5b18d
6 changed files with 63 additions and 10 deletions

BIN
src/asm/6502/nes/chr.bin Normal file

Binary file not shown.

BIN
src/asm/6502/nes/chr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

23
src/asm/6502/nes/nes.i Normal file
View file

@ -0,0 +1,23 @@
; this is a definition file for a NES ROM.
.MEMORYMAP
DEFAULTSLOT 1
; 2KB RAM
SLOT 0 START $0000 SIZE $800
; 32KB ROM
SLOT 1 START $8000 SIZE $8000
.ENDME
.ROMBANKMAP
BANKSTOTAL 2
; iNES header
BANKSIZE $10
; program ROM data
BANKSIZE $8000
BANKS 1
; character ROM data
.ENDRO
.BANK 1 SLOT 1
.ORGA $8000

6
src/asm/6502/nes/test.s Normal file
View file

@ -0,0 +1,6 @@
; command stream player test - NES version
; NES because it's what I am most familiar with, besides Atari 2600
.include "nes.i"
main:

BIN
src/asm/6502/seq.bin Normal file

Binary file not shown.

View file

@ -194,18 +194,19 @@ fcsOptPlaceholder:
rts rts
fcsCallI: fcsCallI:
jsr fcsPushCall
; get address ; get address
jsr fcsReadNext jsr fcsReadNext
tay pha
jsr fcsReadNext jsr fcsReadNext
pha
; ignore next two bytes ; ignore next two bytes
jsr fcsIgnoreNext jsr fcsIgnoreNext
jsr fcsIgnoreNext jsr fcsIgnoreNext
; a has high byte jsr fcsPushCall
; y has low byte pla
sty chanPC,x
sta chanPC+1,x sta chanPC+1,x
pla
sta chanPC,x
rts rts
fcsOffWait: fcsOffWait:
@ -221,21 +222,44 @@ fcsFullCmd:
rts rts
fcsCall: fcsCall:
jsr fcsPushCall
; get address ; get address
jsr fcsReadNext jsr fcsReadNext
tay pha
jsr fcsReadNext jsr fcsReadNext
; a has high byte pha
; y has low byte jsr fcsPushCall
sty chanPC,x pla
sta chanPC+1,x sta chanPC+1,x
pla
sta chanPC,x
rts rts
; push channel PC to stack
fcsPushCall: fcsPushCall:
lda chanStackPtr,x
tay
lda chanPC,x
sta fcsGlobalStack,y
iny
lda chanPC+1,x
sta fcsGlobalStack,y
iny
tya
sta chanStackPtr,x
rts rts
; retrieve channel PC from stack
fcsRet: fcsRet:
lda chanStackPtr,x
tay
dey
lda fcsGlobalStack,y
sta chanPC+1,x
dey
lda fcsGlobalStack,y
sta chanPC,x
tya
sta chanStackPtr,x
rts rts
fcsJump: fcsJump: