diff --git a/pt3_player/interrupt_handler.s b/pt3_player/interrupt_handler.s index 6f059cc8..800a8ab4 100644 --- a/pt3_player/interrupt_handler.s +++ b/pt3_player/interrupt_handler.s @@ -13,7 +13,8 @@ TIME_OFFSET EQU 13 interrupt_handler: -; pha ; save A ; 3 + php + pha ; save A ; 3 ; A is saved in $45 by firmware txa pha ; save X @@ -292,8 +293,13 @@ exit_interrupt: tay ; restore Y pla tax ; restore X + + pla ; restore a ; 4 + + ; this is needed on II+/IIe not not IIc +interrupt_smc: lda $45 ; restore A -; pla ; restore a ; 4 + plp rti ; return from interrupt ; 6 diff --git a/pt3_player/pt3_player.s b/pt3_player/pt3_player.s index 31060b00..515485df 100644 --- a/pt3_player/pt3_player.s +++ b/pt3_player/pt3_player.s @@ -27,18 +27,47 @@ pt3_setup: jsr clear_screens - ;======================= - ; Check for Apple II/II+ - ;======================= + ;=============================== + ; Check for Apple II/II+/IIe/IIc + ;=============================== ; this is used to see if we have lowecase support 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 disk code diff --git a/pt3_player/qkumba_rts.s b/pt3_player/qkumba_rts.s index 26c3f9f2..20ca1879 100644 --- a/pt3_player/qkumba_rts.s +++ b/pt3_player/qkumba_rts.s @@ -73,8 +73,9 @@ rts_init: sta mlsmc04+1 sta mlsmc05+1 - jsr $fe93 ; clear COUT - jsr $fe89 ; clear KEYIN + ; Are these needed? they break on iic as we have ROM turned off +; jsr $fe93 ; clear COUT +; jsr $fe89 ; clear KEYIN ;======================== ; Create nibble table