diff --git a/src/asm/6502/nes/chr.bin b/src/asm/6502/nes/chr.bin new file mode 100644 index 000000000..160679aaa Binary files /dev/null and b/src/asm/6502/nes/chr.bin differ diff --git a/src/asm/6502/nes/chr.gif b/src/asm/6502/nes/chr.gif new file mode 100644 index 000000000..960b64c2a Binary files /dev/null and b/src/asm/6502/nes/chr.gif differ diff --git a/src/asm/6502/nes/nes.i b/src/asm/6502/nes/nes.i new file mode 100644 index 000000000..cf161934a --- /dev/null +++ b/src/asm/6502/nes/nes.i @@ -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 diff --git a/src/asm/6502/nes/test.s b/src/asm/6502/nes/test.s new file mode 100644 index 000000000..c7f2433d9 --- /dev/null +++ b/src/asm/6502/nes/test.s @@ -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: diff --git a/src/asm/6502/seq.bin b/src/asm/6502/seq.bin new file mode 100644 index 000000000..d88a8e3e8 Binary files /dev/null and b/src/asm/6502/seq.bin differ diff --git a/src/asm/6502/stream.s b/src/asm/6502/stream.s index c46d3e6a5..1dadeb1b0 100644 --- a/src/asm/6502/stream.s +++ b/src/asm/6502/stream.s @@ -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: