diff --git a/bitsy.boot.s b/bitsy.boot.s index 5991600..75a4136 100644 --- a/bitsy.boot.s +++ b/bitsy.boot.s @@ -18,6 +18,7 @@ MLI_ENTRY := $BF00 DEVNUM := $BF30 DEVCNT := $BF31 DEVLST := $BF32 +MACHID := $BF98 KBD := $C000 CLR80VID := $C00C @@ -67,7 +68,7 @@ L2036: dey ; display splash screen jsr HOME - ldx #(END_SPLASH - SPLASH_SCREEN) ;#$9D + ldx #(END_SPLASH - SPLASH_SCREEN) L203E: lda SPLASH_SCREEN-1,x bmi L204A jsr BASCALC @@ -92,7 +93,7 @@ L205A: txa lda #$10 sta $29 sta KBDSTRB ; clear keyboard strobe - bne MAIN_LOOP ; branch-always to MAIN_LOOP + bne MAIN_LOOP ; branch-always to MAIN_LOOP ; get keypress and process @@ -100,27 +101,39 @@ MAIN_LOOP_WITH_BEEP: jsr ROM_BELL MAIN_LOOP: jsr RDKEY -.ifndef PLUS_FIX - bit RDBTN0 ; open-apple -- this fries the franklin? - bmi QUIT -.endif - cmp #$B8 ; >= 8? - bcs QUIT - cmp #$B1 ; >= 1? - bcs SET_SLOT_AND_BOOT cmp #$9B ; ESC? - beq L209B + beq DO_MLI_BOOT cmp #$8D ; CR? beq BOOT_RECENT cmp #$A0 ; space? -.ifndef PLUS_FIX - bne MAIN_LOOP -.else beq BOOT_RECENT - bit RDBTN0 ; open-apple -- this fries the franklin? - bmi QUIT + cmp #$B8 ; >= 8? + bcs GSOS_QUIT + cmp #$B1 ; >= 1? + bcs SET_SLOT_AND_BOOT +GSOS_QUIT: + ldx MACHID + cpx #$b3 ; IIgs (or //e with clock card) + bne MAIN_LOOP_WITH_BEEP + bit RDBTN0 ; safe to check O-A now bpl MAIN_LOOP -.endif + and #$DF + cmp #$D1 ; Q? (GS/OS only) + bne MAIN_LOOP_WITH_BEEP + +; 65816 GS/OS gunk here ... +.setcpu "65816" + rep #$80 ; reset processor status bits + bmi MAIN_LOOP_WITH_BEEP + lda $E100BD ; OS_BOOT (byte) + dec + bne MAIN_LOOP_WITH_BEEP + clc + xce ; swap carry and emulation flags (clear E) + lda LCBANK1 ; rw:LCBANK1 + jmp $E0D000 +.setcpu "6502" + BOOT_RECENT: jsr GET_SLOT @@ -130,39 +143,15 @@ SET_SLOT_AND_BOOT: ora #$C0 ; this becomes $C100-$C700 sta BOOTVEC+2 ; and put it into boot vector -L209B: jsr HOME +DO_MLI_BOOT: + jsr HOME BOOTVEC: jsr MLI_ENTRY ; but overwritten to slot entry point .byte $65 .word * + 2 .byte $04 ; it's apparently okay to have garbage for $65 -QUIT: - cmp #$9B ; key ESC? - beq L20AF - and #$DF - cmp #$D1 ; key Q? - bne MAIN_LOOP_WITH_BEEP -L20AF: bit RDBTN0 ; is open-apple pressed? - bpl MAIN_LOOP_WITH_BEEP ; if not, restart loop - -; 65816 GS/OS gunk here ... - -.setcpu "65816" - REP #$80 - BMI MAIN_LOOP_WITH_BEEP - LDA $E100BD ; OS_BOOT (byte) - DEC - BNE MAIN_LOOP_WITH_BEEP - CLC - XCE - LDA LCBANK1 ; rw:LCBANK1 - JMP $E0D000 - -.setcpu "6502" - ; get last-accessed slot - GET_SLOT: lda DEVNUM lsr a