diff --git a/pt3_lib/interrupt_handler.s b/pt3_lib/interrupt_handler.s index 25dc329d..d8a4a80f 100644 --- a/pt3_lib/interrupt_handler.s +++ b/pt3_lib/interrupt_handler.s @@ -13,7 +13,7 @@ TIME_OFFSET EQU 13 interrupt_handler: -; pha ; save A ; 3 + pha ; save A ; 3 ; A is saved in $45 by firmware txa pha ; save X @@ -145,8 +145,12 @@ exit_interrupt: tay ; restore Y pla tax ; restore X + pla ; restore a ; 4 + + + ; on II+/IIe (but not IIc) we need to do this? +interrupt_smc: lda $45 ; restore A -; pla ; restore a ; 4 rti ; return from interrupt ; 6 diff --git a/pt3_lib/pt3_test.s b/pt3_lib/pt3_test.s index 479510b6..ef732a71 100644 --- a/pt3_lib/pt3_test.s +++ b/pt3_lib/pt3_test.s @@ -27,11 +27,39 @@ pt3_setup: lda $FBB3 ; IIe and newer is $06 cmp #6 - beq apple_iie + beq apple_iie_or_newer lda #1 ; set if older than a IIe sta apple_ii -apple_iie: + 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 + sta $C403 + sta $C404 + + ; bypass the firmware interrupt handler + ; should we do this on IIe too? probably faster + + sei ; disable interrupts + lda $c08b ; disable ROM (enable language card) + lda $c08b + lda #interrupt_handler + sta $ffff + + lda #$EA ; nop out the "lda $45" in the irq hand + sta interrupt_smc + sta interrupt_smc+1 + +done_apple_detect: ;=============== ; init variables diff --git a/pt3_player/interrupt_handler.s b/pt3_player/interrupt_handler.s index e48d7716..6f059cc8 100644 --- a/pt3_player/interrupt_handler.s +++ b/pt3_player/interrupt_handler.s @@ -288,14 +288,12 @@ quiet_exit: done_key: exit_interrupt: -; pla ; restore a ; 4 - pla tay ; restore Y pla tax ; restore X lda $45 ; restore A - +; pla ; restore a ; 4 rti ; return from interrupt ; 6