Guys,
can you have a look:
http://www.atariage.com/forums/index.ph … p;id=91812
I have implemented own IRQ but it now crashes when DLI + Key is pressed. I know that it will jump directly to $cxxx as the vectors are still set to that adress space but maybe you can help me what i am doing wrong
;switch off OS rom routine by Hiassoft
switch_off_os_rom:
sei
ldy #0
sty $d400
sty $d40e
sty si
lda #$c0
sta si+1
ROMMV lda (si),Y
dec $d301
sta (si),Y
inc $d301
iny
bne ROMMV
inc si+1
lda si+1
beq ROMOK
cmp #$d0
bne ROMMV
lda #$d8
sta si+1
bne ROMMV
ROMOK dec $d301;switch off ROM
lda #<nmi
sta $fffa
lda #>nmi
sta $fffb
lda #<null_irq
sta $fffc
lda #>null_irq
sta $fffd
; inc $d301;exit with ROM/OS on
lda #$40
sta $d40e
cli
rts
;NMI routine
;^4f==#$5f if VBLKI
;^4f==#$9f if DLI
nmi: bit $d40f
bpl sys_vbl
;DLI routine, e.g.
jmp (dliv)
;VBL routine, e.g.
sys_vbl: pha
txa:pha
tya:pha
dec 540 ;just a simple counter
lda 559
sta $d400
lda 560
sta $d402
lda 561
sta $d403
lda 756
sta $d409
lda $d409
sta 764
lda 704
sta $d012
lda 705
sta $d013
lda 706
sta $d014
lda 707
sta $d015
lda 708
sta $d016
lda 709
sta $d017
lda 710
sta $d018
lda 711
sta $d019
lda 712
sta $d01a
lda $d300 ;prepare joystick
and #$0f
sta stick0
jsr vbl
pla:tay
pla:tax
pla
null_irq: rti