From 4e3a1257ab0f09e88d33d4f03ad6e9528c23155e Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 8 Nov 2023 21:20:07 -0500 Subject: [PATCH] second: fix apple iigs detection there were actually quite a few bugs here in the detection --- demos/second/TODO | 38 +++++++----------- demos/second/part00_boot/fake_bios.s | 41 ++++--------------- demos/second/pt3_lib_detect_model.s | 60 +++++++++++++++++++++------- 3 files changed, 68 insertions(+), 71 deletions(-) diff --git a/demos/second/TODO b/demos/second/TODO index 148d3310..91536a6b 100644 --- a/demos/second/TODO +++ b/demos/second/TODO @@ -1,39 +1,34 @@ TODO OVERALL + See if can squeeze into 64k RAM - -TODO MUSIC -+ be sure to mute channels when pausing - - DISK I +BIOS - - - get it working - if it is, remove other detection code + - fix detection code (AUXMEM?) + Intro - - title cards - - scrolling - - credits at bottom? - - - Sprites / explosion + - title cards somehow? + - scrolling with page flipping? + - better Sprites / explosion + - better sound sync + chessboard - - falling effect + - better falling effect - moving / bouncing object have it reverse course? + - tunnel (for real) + - cirles / interference pattern (for real) scroll off to right at end + gorilla - scroll on, better TV effect - + better scroll on + + leaves - better animation? + better animation + Lens / Rotozoom - make lens do actual light bending effect @@ -43,8 +38,6 @@ DISK I - for rotozoom, wrap around note, this might mean 32x32 - - hook up sound file - + Plasma - do the weird vertical wipe while still running @@ -58,13 +51,12 @@ DISK I + Transmission / Spheres - - switch to lo-res version even though it doesn't look as good - - the actual transmission - 45 degree sprite? + - fix pause on disk load + - switch back to hi-res + ocean / voxels - - at end, scroll back off screen + - maybe better scroll off at end + polar @@ -82,7 +74,7 @@ DISK II + nuts - - sprite animation of ship + - better sprite animation of ship + credits (thumbnail) diff --git a/demos/second/part00_boot/fake_bios.s b/demos/second/part00_boot/fake_bios.s index 18f9de32..cc599203 100644 --- a/demos/second/part00_boot/fake_bios.s +++ b/demos/second/part00_boot/fake_bios.s @@ -23,17 +23,16 @@ bios_test: lda #0 sta FAKE_KEY_COUNT -; jsr build_tables - ;======================= ; Hardware Detect Model ;======================= ; Yes Michaelangel007 I will eventually update linux_logo 6502 - jsr detect_appleii_model + ; we did this earlier? +; jsr detect_appleii_model lda APPLEII_MODEL - cmp 'g' + cmp #'g' bne not_iigs is_a_iigs: @@ -435,7 +434,7 @@ cpu_patch_2: ; +2 .byte "Memory Test: 0B OK",13,0 bios_message_1a: .byte "Press ",$17,"-D to enter SETUP",13,0 - .byte "02/13/78-6502-564D57",0 + .byte "02/13/78-6502-564D57 V1.1",0 bios_message_2: @@ -507,28 +506,6 @@ slot_patch1: .byte "a",0 .byte "l",13,0 -.if 0 -bios_message5: - .byte 13,0 -slot_patch2: - .byte "S6D1>",0 ; 112 - .byte "d",0 - .byte "i",0 - .byte "r",0 - .byte " ",0 - .byte "/",0 - .byte "w",13,0 - -bios_message_6: - .byte "Directory of s6d1:\games\lemmings\.",13,0 ; 128 - .byte "[.] [..] QBOOT QLOAD",13,0 - .byte "LEVEL1 LEVEL2 LEVEL3 LEVEL4",13,0 - .byte "LEVEL5 LEVEL6 LEVEL7 LEVEL8",13,0 - .byte "LEVEL9 LEVEL10 LEMM",13,0 - .byte " 13 File(s) 90,624 Bytes.",13,0 - .byte " 2 Dir(s) 52,736 Bytes free.",13,13,0 -.endif - bios_message7: slot_patch3: .byte "S6D1>",0 ; 184 @@ -536,6 +513,8 @@ slot_patch3: .byte "2",0 .byte "r",0 + +font_data: .include "font_console_1x8.s" .include "fonts/a2_cga_thin.inc" @@ -544,12 +523,6 @@ graphics_data: .include "../wait_keypress.s" -;wait_until_keypress: -; lda KEYPRESS ; 4 -; bpl wait_until_keypress ; 3 -; bit KEYRESET ; clear the keyboard buffer -; rts ; 6 - memcount: .byte $00,$00,$00 @@ -780,12 +753,12 @@ early_out: .include "../hgr_clear_screen.s" -;.include "pt3_lib_detect_model.s" .include "aux_detect.s" .include "65c02_detect.s" .include "pt3_lib_mockingboard_setup.s" +;.include "pt3_lib_detect_model.s" ;.include "../lc_detect.s" ;.include "../pt3_lib_mockingboard_detect.s" ;.include "../wait.s" diff --git a/demos/second/pt3_lib_detect_model.s b/demos/second/pt3_lib_detect_model.s index 31c1b8dc..ac30fd4e 100644 --- a/demos/second/pt3_lib_detect_model.s +++ b/demos/second/pt3_lib_detect_model.s @@ -4,30 +4,54 @@ ; this is mostly for IIc support ; as it does interrupts differently - ; ' ' ($20) = Apple II - ; '+' ($2B) = Apple II+ - ; 'E' ($45) = Apple IIe - ; 'C' ($43) = Apple IIc - ; 'G' ($47) = Apple IIgs + ; some of this info from the document: + ; Apple II Family Identification Routines 2.2 + ; + ; ' ' = Apple II + ; '+' = Apple II+ + ; 'e' = Apple IIe + ; 'c' = Apple IIc + ; 'g' = Apple IIgs + ; 'm' = mac L/C with board + ; 'j' = jplus + ; '3' = Apple III detect_appleii_model: lda #' ' ldx $FBB3 + ; II is $38 ; J-plus is $C9 ; II+ is $EA (so is III) ; IIe and newer is $06 - cpx #$38 + cpx #$38 ; ii beq done_apple_detect - lda #'+' + + ; ii+ is EA FB1E=AD + ; iii is EA FB1E=8A 00 + cpx #$EA + bne not_ii_iii +ii_or_iii: + + lda #'+' ; ii+/iii + + ldx $FB1E + cpx #$AD + beq done_apple_detect ; ii+ + + lda #'3' + bne done_apple_detect ; bra iii + +not_ii_iii: + lda #'j' ; jplus + cpx #$C9 beq done_apple_detect - ; TODO: check for J-plus or III? cpx #$06 bne done_apple_detect @@ -44,19 +68,27 @@ apple_iie_or_newer: beq apple_iic - lda #'E' + lda #'e' cpx #$EA beq done_apple_detect - cpx #$E0 - beq done_apple_detect +; cpx #$E0 +; beq done_apple_detect - ; assume GS? + ; should do something if not $E0 - lda #'G' + ; GS and IIe enhanced are the same, need to check + + sec ; set carry + jsr $FE1F + bcs done_apple_detect ;If carry then IIe enhanced + + ; get here we're a IIgs? + + lda #'g' bne done_apple_detect apple_iic: - lda #'C' + lda #'c' done_apple_detect: sta APPLEII_MODEL