mirror of
https://github.com/cc65/cc65.git
synced 2025-08-15 06:27:36 +00:00
move macros to enable and disable the ROM into a separate include file
This commit is contained in:
@@ -222,7 +222,7 @@ _exit: jsr donelib ; Run module destructors
|
|||||||
.bss
|
.bss
|
||||||
|
|
||||||
SP_save: .res 1
|
SP_save: .res 1
|
||||||
SHFLOK_save .res 1
|
SHFLOK_save: .res 1
|
||||||
LMARGN_save: .res 1
|
LMARGN_save: .res 1
|
||||||
.ifndef __ATARIXL__
|
.ifndef __ATARIXL__
|
||||||
APPMHI_save: .res 2
|
APPMHI_save: .res 2
|
||||||
|
@@ -40,40 +40,38 @@
|
|||||||
|
|
||||||
.export _get_ostype
|
.export _get_ostype
|
||||||
|
|
||||||
|
.include "atari.inc"
|
||||||
|
.include "romswitch.inc"
|
||||||
|
|
||||||
.ifdef __ATARIXL__
|
.ifdef __ATARIXL__
|
||||||
|
|
||||||
.include "atari.inc"
|
|
||||||
.import __CHARGEN_START__
|
.import __CHARGEN_START__
|
||||||
.segment "LOWCODE"
|
.segment "LOWCODE"
|
||||||
.macro disable_rom
|
|
||||||
|
.macro disable_rom_save_a
|
||||||
pha
|
pha
|
||||||
lda PORTB
|
disable_rom
|
||||||
and #$fe
|
pla
|
||||||
sta PORTB
|
|
||||||
lda #>__CHARGEN_START__
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
pla
|
|
||||||
.endmacro
|
|
||||||
.macro enable_rom
|
|
||||||
lda PORTB
|
|
||||||
ora #1
|
|
||||||
sta PORTB
|
|
||||||
lda #$E0
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
.else ; above atarixl, below atari
|
.else ; above atarixl, below atari
|
||||||
|
|
||||||
.macro disable_rom
|
.macro disable_rom_save_a
|
||||||
.endmacro
|
|
||||||
.macro enable_rom
|
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
.endif
|
.endif ; .ifdef __ATARIXL__
|
||||||
|
|
||||||
.proc _get_ostype
|
|
||||||
|
; unknown ROM
|
||||||
|
|
||||||
|
_unknown:
|
||||||
|
lda #0
|
||||||
|
tax
|
||||||
|
disable_rom_save_a
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
_get_ostype:
|
||||||
|
|
||||||
enable_rom
|
enable_rom
|
||||||
lda $fcd8
|
lda $fcd8
|
||||||
@@ -97,15 +95,7 @@
|
|||||||
and #%00111000
|
and #%00111000
|
||||||
ora #%11
|
ora #%11
|
||||||
_fin: ldx #0
|
_fin: ldx #0
|
||||||
disable_rom
|
disable_rom_save_a
|
||||||
rts
|
|
||||||
|
|
||||||
; unknown ROM
|
|
||||||
|
|
||||||
_unknown:
|
|
||||||
lda #0
|
|
||||||
tax
|
|
||||||
disable_rom
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; 1200XL ROM
|
; 1200XL ROM
|
||||||
@@ -184,5 +174,3 @@ _400800_3:
|
|||||||
|
|
||||||
lda #%00010001
|
lda #%00010001
|
||||||
bne _fin
|
bne _fin
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
73
libsrc/atari/romswitch.inc
Normal file
73
libsrc/atari/romswitch.inc
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
;
|
||||||
|
; Macros to disable and enable the ROM on Atari XL systems.
|
||||||
|
;
|
||||||
|
; Christian Groessler, chris@groessler.org, 19-Sep-2013
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
.ifdef __ATARIXL__
|
||||||
|
|
||||||
|
USEWSYNC= 1
|
||||||
|
|
||||||
|
.if USEWSYNC
|
||||||
|
.macro wsync
|
||||||
|
sta WSYNC
|
||||||
|
.endmacro
|
||||||
|
.else
|
||||||
|
.macro wsync
|
||||||
|
.endmacro
|
||||||
|
.endif
|
||||||
|
|
||||||
|
|
||||||
|
.macro disable_rom
|
||||||
|
lda PORTB
|
||||||
|
and #$fe
|
||||||
|
wsync
|
||||||
|
sta PORTB
|
||||||
|
lda #>__CHARGEN_START__
|
||||||
|
sta CHBAS
|
||||||
|
sta CHBASE
|
||||||
|
.endmacro
|
||||||
|
.macro disable_rom_quick
|
||||||
|
lda PORTB
|
||||||
|
and #$fe
|
||||||
|
sta PORTB
|
||||||
|
lda #>__CHARGEN_START__
|
||||||
|
sta CHBAS
|
||||||
|
sta CHBASE
|
||||||
|
.endmacro
|
||||||
|
.macro disable_rom_val val
|
||||||
|
lda val
|
||||||
|
wsync
|
||||||
|
sta PORTB
|
||||||
|
lda #>__CHARGEN_START__
|
||||||
|
sta CHBAS
|
||||||
|
sta CHBASE
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.macro enable_rom
|
||||||
|
lda PORTB
|
||||||
|
ora #1
|
||||||
|
wsync
|
||||||
|
sta PORTB
|
||||||
|
lda #$E0
|
||||||
|
sta CHBAS
|
||||||
|
sta CHBASE
|
||||||
|
.endmacro
|
||||||
|
.macro enable_rom_quick
|
||||||
|
lda PORTB
|
||||||
|
ora #1
|
||||||
|
sta PORTB
|
||||||
|
lda #$E0
|
||||||
|
sta CHBAS
|
||||||
|
sta CHBASE
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.else ; above __ATARIXL__, below not
|
||||||
|
|
||||||
|
.macro disable_rom
|
||||||
|
.endmacro
|
||||||
|
.macro enable_rom
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.endif
|
@@ -5,7 +5,6 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
DEBUG = 1
|
DEBUG = 1
|
||||||
USEWSYNC= 1
|
|
||||||
CHKBUF = 1 ; check if bounce buffering is needed (bounce buffering is always done if set to 0)
|
CHKBUF = 1 ; check if bounce buffering is needed (bounce buffering is always done if set to 0)
|
||||||
|
|
||||||
.ifdef __ATARIXL__
|
.ifdef __ATARIXL__
|
||||||
@@ -14,6 +13,8 @@ CHKBUF = 1 ; check if bounce buffering is needed (bounce buffering is always don
|
|||||||
.include "atari.inc"
|
.include "atari.inc"
|
||||||
.include "save_area.inc"
|
.include "save_area.inc"
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
.include "romswitch.inc"
|
||||||
|
|
||||||
.import __CHARGEN_START__
|
.import __CHARGEN_START__
|
||||||
|
|
||||||
.export sram_init
|
.export sram_init
|
||||||
@@ -25,56 +26,6 @@ CHKBUF = 1 ; check if bounce buffering is needed (bounce buffering is always don
|
|||||||
BUFSZ = 128 ; bounce buffer size
|
BUFSZ = 128 ; bounce buffer size
|
||||||
BUFSZ_SIO = 256
|
BUFSZ_SIO = 256
|
||||||
|
|
||||||
.macro wsync
|
|
||||||
.if USEWSYNC
|
|
||||||
sta WSYNC
|
|
||||||
.endif
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro disable_rom
|
|
||||||
lda PORTB
|
|
||||||
and #$fe
|
|
||||||
wsync
|
|
||||||
sta PORTB
|
|
||||||
lda #>__CHARGEN_START__
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
|
||||||
.macro disable_rom_quick
|
|
||||||
lda PORTB
|
|
||||||
and #$fe
|
|
||||||
sta PORTB
|
|
||||||
lda #>__CHARGEN_START__
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
|
||||||
.macro disable_rom_val val
|
|
||||||
lda val
|
|
||||||
wsync
|
|
||||||
sta PORTB
|
|
||||||
lda #>__CHARGEN_START__
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro enable_rom
|
|
||||||
lda PORTB
|
|
||||||
ora #1
|
|
||||||
wsync
|
|
||||||
sta PORTB
|
|
||||||
lda #$E0
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
|
||||||
.macro enable_rom_quick
|
|
||||||
lda PORTB
|
|
||||||
ora #1
|
|
||||||
sta PORTB
|
|
||||||
lda #$E0
|
|
||||||
sta CHBAS
|
|
||||||
sta CHBASE
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.segment "INIT"
|
.segment "INIT"
|
||||||
|
|
||||||
; Turn off ROMs, install system and interrupt wrappers, set new chargen pointer
|
; Turn off ROMs, install system and interrupt wrappers, set new chargen pointer
|
||||||
|
Reference in New Issue
Block a user