1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

fixed problem with I/O access on C64

git-svn-id: svn://svn.cc65.org/cc65/trunk@2333 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2003-08-15 22:17:13 +00:00
parent d697ff8030
commit 5b3230c65f

View File

@ -38,6 +38,10 @@ only40: ldx #0 ; COLUMNS40
tvmode: ; PAL/NTSC check here, result in A
php
sei ; disable interrupts
lda CPU_DATA ; this is for C64
pha
lda #IO_IN ; enable access to I/O
sta CPU_DATA
bit rasreg
bpl tvmode ; wait for rasterline 127<x<256
lda #24 ; (rasterline now >=256!)
@ -51,6 +55,10 @@ ntsc: lda #$80 ; NTSC
modeend: stx tmp1
ora tmp1
sta tmp1
ldx #0
pla
sta CPU_DATA ; restore memory config
plp ; restore interrupt state
lda tmp1
rts