6502 command stream player, part 6
preparing NES test player
This commit is contained in:
parent
543b99e353
commit
3a04b5b18d
BIN
src/asm/6502/nes/chr.bin
Normal file
BIN
src/asm/6502/nes/chr.bin
Normal file
Binary file not shown.
BIN
src/asm/6502/nes/chr.gif
Normal file
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
23
src/asm/6502/nes/nes.i
Normal 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
6
src/asm/6502/nes/test.s
Normal 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
BIN
src/asm/6502/seq.bin
Normal file
Binary file not shown.
|
@ -194,18 +194,19 @@ fcsOptPlaceholder:
|
|||
rts
|
||||
|
||||
fcsCallI:
|
||||
jsr fcsPushCall
|
||||
; get address
|
||||
jsr fcsReadNext
|
||||
tay
|
||||
pha
|
||||
jsr fcsReadNext
|
||||
pha
|
||||
; ignore next two bytes
|
||||
jsr fcsIgnoreNext
|
||||
jsr fcsIgnoreNext
|
||||
; a has high byte
|
||||
; y has low byte
|
||||
sty chanPC,x
|
||||
jsr fcsPushCall
|
||||
pla
|
||||
sta chanPC+1,x
|
||||
pla
|
||||
sta chanPC,x
|
||||
rts
|
||||
|
||||
fcsOffWait:
|
||||
|
@ -221,21 +222,44 @@ fcsFullCmd:
|
|||
rts
|
||||
|
||||
fcsCall:
|
||||
jsr fcsPushCall
|
||||
; get address
|
||||
jsr fcsReadNext
|
||||
tay
|
||||
pha
|
||||
jsr fcsReadNext
|
||||
; a has high byte
|
||||
; y has low byte
|
||||
sty chanPC,x
|
||||
pha
|
||||
jsr fcsPushCall
|
||||
pla
|
||||
sta chanPC+1,x
|
||||
pla
|
||||
sta chanPC,x
|
||||
rts
|
||||
|
||||
; push channel PC to stack
|
||||
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
|
||||
|
||||
; retrieve channel PC from stack
|
||||
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
|
||||
|
||||
fcsJump:
|
||||
|
|
Loading…
Reference in a new issue