mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-20 17:29:28 +00:00
outline: demo: support Apple IIc
there were multiple things going wrong here should probably merge changes back to pt3_lib
This commit is contained in:
parent
95e9dbfc1d
commit
adbd7e2817
|
@ -64,6 +64,7 @@ OUTLINE: outline.o
|
||||||
ld65 -o OUTLINE outline.o -C apple2_5000.inc
|
ld65 -o OUTLINE outline.o -C apple2_5000.inc
|
||||||
|
|
||||||
outline.o: outline.s zp.inc \
|
outline.o: outline.s zp.inc \
|
||||||
|
pt3_lib_mockingboard_setup.s \
|
||||||
shimmer.s a2_inside.s drops.s wires.s \
|
shimmer.s a2_inside.s drops.s wires.s \
|
||||||
rotoplasma_tiny.s rocket_away.s anothermist.s \
|
rotoplasma_tiny.s rocket_away.s anothermist.s \
|
||||||
flying_dir.inc tfv_flying.s flying_mode7.s credits.s
|
flying_dir.inc tfv_flying.s flying_mode7.s credits.s
|
||||||
|
|
|
@ -34,6 +34,8 @@ outline_demo:
|
||||||
lda #1
|
lda #1
|
||||||
sta LOOP
|
sta LOOP
|
||||||
|
|
||||||
|
jsr detect_appleii_model
|
||||||
|
|
||||||
jsr mockingboard_detect
|
jsr mockingboard_detect
|
||||||
bcc mockingboard_not_found
|
bcc mockingboard_not_found
|
||||||
setup_interrupt:
|
setup_interrupt:
|
||||||
|
@ -102,6 +104,7 @@ forever:
|
||||||
jmp forever
|
jmp forever
|
||||||
|
|
||||||
|
|
||||||
|
.include "pt3_lib_detect_model.s"
|
||||||
.include "pt3_lib_core.s"
|
.include "pt3_lib_core.s"
|
||||||
.include "pt3_lib_init.s"
|
.include "pt3_lib_init.s"
|
||||||
.include "pt3_lib_mockingboard_setup.s"
|
.include "pt3_lib_mockingboard_setup.s"
|
||||||
|
|
37
demos/outline2021/demo/pt3_lib_detect_model.s
Normal file
37
demos/outline2021/demo/pt3_lib_detect_model.s
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
;===========================
|
||||||
|
; Check for Apple IIc
|
||||||
|
;===========================
|
||||||
|
|
||||||
|
|
||||||
|
; ' ' ($20) = Apple II
|
||||||
|
; '+' ($2B) = Apple II+
|
||||||
|
; 'E' ($45) = Apple IIe
|
||||||
|
; 'C' ($43) = Apple IIc
|
||||||
|
; 'G' ($47) = Apple IIgs
|
||||||
|
|
||||||
|
; it does interrupts differently
|
||||||
|
detect_appleii_model:
|
||||||
|
lda #' '
|
||||||
|
sta APPLEII_MODEL
|
||||||
|
|
||||||
|
lda $FBB3 ; IIe and newer is $06
|
||||||
|
cmp #6
|
||||||
|
beq apple_iie_or_newer
|
||||||
|
|
||||||
|
; TODO: check for II+
|
||||||
|
|
||||||
|
jmp done_apple_detect
|
||||||
|
|
||||||
|
apple_iie_or_newer:
|
||||||
|
|
||||||
|
; TODO: check for IIe
|
||||||
|
|
||||||
|
lda $FBC0 ; 0 on a IIc
|
||||||
|
bne done_apple_detect
|
||||||
|
apple_iic:
|
||||||
|
lda #'C'
|
||||||
|
sta APPLEII_MODEL
|
||||||
|
|
||||||
|
done_apple_detect:
|
||||||
|
|
||||||
|
rts
|
|
@ -33,6 +33,24 @@
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
mockingboard_detect:
|
mockingboard_detect:
|
||||||
|
|
||||||
|
; activate IIc mockingboard?
|
||||||
|
; this might only be necessary to allow detection
|
||||||
|
; I get the impression the Mockingboard 4c activates
|
||||||
|
; when you access any of the 6522 ports in Slot 4
|
||||||
|
|
||||||
|
lda APPLEII_MODEL
|
||||||
|
cmp #'C'
|
||||||
|
bne not_iic
|
||||||
|
|
||||||
|
lda #$ff
|
||||||
|
|
||||||
|
; don't bother patching these, IIc mockingboard always slot 4?
|
||||||
|
|
||||||
|
sta MOCK_6522_DDRA1
|
||||||
|
sta MOCK_6522_T1CL
|
||||||
|
|
||||||
|
not_iic:
|
||||||
lda #$00
|
lda #$00
|
||||||
sta MB_ADDR_L
|
sta MB_ADDR_L
|
||||||
ldx #$C7 ; start at slot #7
|
ldx #$C7 ; start at slot #7
|
||||||
|
|
|
@ -170,47 +170,56 @@ clear_ay_end:
|
||||||
;=============================
|
;=============================
|
||||||
mockingboard_setup_interrupt:
|
mockingboard_setup_interrupt:
|
||||||
|
|
||||||
;===========================
|
lda APPLEII_MODEL
|
||||||
; Check for Apple IIc
|
cmp #'C'
|
||||||
;===========================
|
bne done_iic_hack
|
||||||
; it does interrupts differently
|
|
||||||
|
|
||||||
lda $FBB3 ; IIe and newer is $06
|
|
||||||
cmp #6
|
|
||||||
beq apple_iie_or_newer
|
|
||||||
|
|
||||||
jmp done_apple_detect
|
|
||||||
apple_iie_or_newer:
|
|
||||||
lda $FBC0 ; 0 on a IIc
|
|
||||||
bne done_apple_detect
|
|
||||||
apple_iic:
|
|
||||||
; activate IIc mockingboard?
|
|
||||||
; this might only be necessary to allow detection
|
|
||||||
; I get the impression the Mockingboard 4c activates
|
|
||||||
; when you access any of the 6522 ports in Slot 4
|
|
||||||
lda #$ff
|
|
||||||
|
|
||||||
; don't bother patching these, IIc mockingboard always slot 4?
|
|
||||||
|
|
||||||
sta MOCK_6522_DDRA1
|
|
||||||
sta MOCK_6522_T1CL
|
|
||||||
|
|
||||||
; bypass the firmware interrupt handler
|
; bypass the firmware interrupt handler
|
||||||
; should we do this on IIe too? probably faster
|
; should we do this on IIe too? probably faster
|
||||||
|
|
||||||
|
; first we have to copy the ROM to the language card
|
||||||
|
|
||||||
sei ; disable interrupts
|
sei ; disable interrupts
|
||||||
lda $c08b ; disable ROM (enable language card)
|
|
||||||
lda $c08b
|
|
||||||
|
|
||||||
|
copy_rom_loop:
|
||||||
|
lda $c089 ; read ROM, write RAM1
|
||||||
|
lda $c089
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
read_rom_loop:
|
||||||
|
lda $D000,Y
|
||||||
|
sta $400,Y
|
||||||
|
iny
|
||||||
|
bne read_rom_loop
|
||||||
|
|
||||||
|
lda $c08B ; read/write RAM1
|
||||||
|
lda $c08B ;
|
||||||
|
|
||||||
|
write_rom_loop:
|
||||||
|
lda $400,Y
|
||||||
|
sta $D000,Y
|
||||||
|
iny
|
||||||
|
bne write_rom_loop
|
||||||
|
|
||||||
|
inc read_rom_loop+2
|
||||||
|
inc write_rom_loop+5
|
||||||
|
bne copy_rom_loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lda #<interrupt_handler
|
lda #<interrupt_handler
|
||||||
sta $fffe
|
sta $fffe
|
||||||
lda #>interrupt_handler
|
lda #>interrupt_handler
|
||||||
sta $ffff
|
sta $ffff
|
||||||
|
|
||||||
lda #$EA ; nop out the "lda $45" in the irq hand
|
lda #$EA ; nop out the "lda $45" in the irq handler
|
||||||
sta interrupt_smc
|
sta interrupt_smc
|
||||||
sta interrupt_smc+1
|
sta interrupt_smc+1
|
||||||
|
|
||||||
done_apple_detect:
|
done_iic_hack:
|
||||||
|
|
||||||
|
|
||||||
;=========================
|
;=========================
|
||||||
|
|
|
@ -4,6 +4,7 @@ INTRO_LOOPER = $01
|
||||||
INTRO_LOOPL = $02
|
INTRO_LOOPL = $02
|
||||||
INTRO_LOOPH = $03
|
INTRO_LOOPH = $03
|
||||||
WHICH_LOAD = $05
|
WHICH_LOAD = $05
|
||||||
|
APPLEII_MODEL = $08
|
||||||
NIBCOUNT = $09 ; lzsa
|
NIBCOUNT = $09 ; lzsa
|
||||||
|
|
||||||
; Zero page monitor routines addresses
|
; Zero page monitor routines addresses
|
||||||
|
|
Loading…
Reference in New Issue
Block a user