o add mmio to trigger cart irq

o add snes irq handlers
o add inline printf asm
This commit is contained in:
David Voswinkel
2009-05-20 00:16:30 +02:00
parent aa649c89ee
commit 5dd4904f9c
7 changed files with 199 additions and 299 deletions

View File

@@ -1,22 +1,34 @@
.define debug_pointer $0080
.define debug_pointer $080
.MACRO printf
ldy.w #\1 ; load add of the string
.MACRO printdb
ldy.w #\1 ; load addr of the marco arg string
sty.w debug_pointer ; store address in defined mem area
ldy #0 ; zero y
ldy #0 ; zero y index
jsr do_printf
.ENDM
.MACRO prints
ldy.w #++ ; load addr of the marco arg string
sty.w debug_pointer ; store address in defined mem area
ldy #0 ; zero y index
jsr do_printf
jmp +++
++:
.db \1,10,0
+++:
.ENDM
.BANK 0
.SECTION "debug" SEMIFREE
do_printf:
lda (debug_pointer),y ; get address of string
sta $3000 ; write to MMIO debug reg
iny
cmp #0 ; len 5
bne do_printf
lda (debug_pointer),y ; get address of string via indirect mem area
sta $3000 ; write to MMIO debug reg
iny ; inc index
cmp #0 ; look for null byte
bne do_printf
rts
.ENDs

View File

@@ -34,19 +34,19 @@
.ENDSNES
.SNESNATIVEVECTOR ; Define Native Mode interrupt vector table
COP EmptyHandler
BRK EmptyHandler
ABORT EmptyHandler
NMI EmptyHandler
IRQ EmptyHandler
COP COPHandler
BRK BRKHandler
ABORT ABRTHandler
NMI NMIHandler
IRQ IRQHandler
.ENDNATIVEVECTOR
.SNESEMUVECTOR ; Define Emulation Mode interrupt vector table
COP EmptyHandler
ABORT EmptyHandler
NMI EmptyHandler
RESET Start
IRQBRK EmptyHandler
COP EmptyHandler
ABORT EmptyHandler
NMI EmptyHandler
RESET Start
IRQBRK EmptyHandler
.ENDEMUVECTOR
.BANK 0 SLOT 0 ; Defines the ROM bank and the slot it is inserted in memory.

View File

@@ -45,23 +45,17 @@ Start_do:
; Setup Video modes and other stuff, then turn on the screen
jsr SetupVideo
sei
cop
prints "Init done"
stz $3001
lda #65
sta $3000
lda #66
sta $3000
lda #67
sta $3000
printf str_COP
lda #65
sta $3000
lda #66
sta $3000
lda #67
sta $3000
cop
lda #$81
sta $4200
Infinity:
jmp Infinity ; bwa hahahahaha
@@ -98,6 +92,28 @@ SetupVideo:
plp
rts
;.ENDS
;.SECTION "IRQHandlers"
COPHandler:
prints "COPHandler"
rti
BRKHandler:
prints "BRKHandler"
rti
ABRTHandler:
prints "ABRTHandler"
rti
NMIHandler:
;prints "NMIHandler"
rti
IRQHandler:
prints "IRQHandler"
rti
str_COP:
.db "COP",10,0