minor updates

This commit is contained in:
mgcaret 2021-07-31 11:09:01 -07:00
parent b37d301c36
commit 74e7fedc9a
2 changed files with 41 additions and 49 deletions

View File

@ -44,6 +44,8 @@
; Reduce emulator detection to actual emulator for those supporting ; Reduce emulator detection to actual emulator for those supporting
; EMUBYTE, or "probable" if no floating bus detected. If you want more ; EMUBYTE, or "probable" if no floating bus detected. If you want more
; specific identification, see idemu program. ; specific identification, see idemu program.
; 10-Feb-19 MAG => v1.4
; Detect VidHD
;.segment "CODE_9000" ;.segment "CODE_9000"
@ -76,7 +78,7 @@ sptREAD = 8
sptWRITE = 9 sptWRITE = 9
; ;
;********************************************* ;*********************************************
MyVersion = $13 MyVersion = $14
MinVersion = $11 MinVersion = $11
;********************************************* ;*********************************************
rts rts
@ -105,12 +107,14 @@ totalmem = scratch+1 ;ds.b 4
emubyte = totalmem+4 emubyte = totalmem+4
emuver = emubyte+1 emuver = emubyte+1
scratch2 = emuver+1 scratch2 = emuver+1
checkemu = scratch2+1 checkemu = scratch2+1 ; zero = need to check for emulator
iie_flag = checkemu+1 ; zero = running on Apple IIe
; dend ; dend
; ;
start: start:
lda #$80 lda #$00
sta checkemu sta checkemu
sta iie_flag
jsr xgetnump jsr xgetnump
beq do_all beq do_all
lda #'t'+$80 ;system Type lda #'t'+$80 ;system Type
@ -271,9 +275,7 @@ Not2e1: cmp #$e0
jsr xmess jsr xmess
asc ")" asc ")"
.byte $00 .byte $00
.pc02 dec checkemu
stz checkemu
.p02
rts rts
NotLC: NotLC:
@ -435,8 +437,8 @@ brokec02:
rts rts
;**************************************************** ;****************************************************
emulation: emulation:
lda checkemu ; skip if we positively identified hardware (LC PDS card) bit checkemu ; skip if we positively identified hardware (LC PDS card)
beq noemu1 bmi noemu1
sta $c04f ; get emubyte sta $c04f ; get emubyte
lda $c04f ; Emulator ID lda $c04f ; Emulator ID
ldy $c04f ; The GS emulators (except Gus) all do version # here ldy $c04f ; The GS emulators (except Gus) all do version # here
@ -530,6 +532,7 @@ ss1: jsr scan1
lda slot lda slot
cmp #8 cmp #8
bcc ss1 bcc ss1
rts rts
; ;
scan1: jsr xmess scan1: jsr xmess
@ -659,10 +662,6 @@ PrSlotDesc:
lda bitpos,y lda bitpos,y
and sltbyt and sltbyt
beq SlotEmpty beq SlotEmpty
ldy #5
lda (rom),y
cmp #$38
bne notPasc0
ldy #7 ldy #7
lda (rom),y lda (rom),y
cmp #$18 cmp #$18
@ -671,7 +670,18 @@ PrSlotDesc:
lda (rom),y lda (rom),y
cmp #$1 cmp #$1
bne notPasc0 bne notPasc0
iny ldy #5
lda (rom),y
cmp #$38
beq :+
cmp #$2C
bne notPasc0
; ViDHD
jsr xmess
asc "VidHD"
.byte $00
rts
: ldy #$0c
lda (rom),y lda (rom),y
pha pha
jsr xmess jsr xmess

54
idemu.s
View File

@ -19,9 +19,7 @@ temp0 = xczpage
DX_end_ptab DX_end_ptab
DX_desc "Identify emulator." DX_desc "Identify emulator."
DX_main DX_main
;rts
jsr idemu jsr idemu
; bcs noemu
stx temp0 stx temp0
jsr xprint_path jsr xprint_path
lda temp0 lda temp0
@ -44,17 +42,17 @@ temp0 = xczpage
sta emuver sta emuver
sec sec
jsr $fe1f jsr $fe1f
bcc doemub ; skip the BS if it claims to be a GS bcc :+ ; skip to checking emubute if it's a IIgs
; okay, let's check for some obvious things first ; okay, let's check for some obvious things first
lda $fbb3 lda $fbb3
cmp #$06 ; Apple IIe or better cmp #$06 ; Apple IIe or better
bne :+ bne :+
lda $fbdd lda $fbdd
cmp #$02 ; PDS card or IIe for classic MacOS cmp #$02 ; LC PDS card or "IIe" for classic MacOS
bne :+ bne :+
lda $fbde lda $fbde
cmp #$40 ; IIe for classic MacOS cmp #$40 ; IIe for classic MacOS
bne iiecard bne iiecard ; If not, it's Apple IIe Card for Mac.
ldy #<emIIe ldy #<emIIe
lda #>emIIe lda #>emIIe
bne foundemu1 bne foundemu1
@ -63,50 +61,34 @@ iiecard: lda $fbbe
ldy #<emPDS ldy #<emPDS
lda #>emPDS lda #>emPDS
bne foundemu1 bne foundemu1
: jmp doemub ; fall back to emubyte ; Identify by emubyte value if possible
; : jsr getemub
; Routine to handle emulator detected, but emubyte=$00 bne noemu ; floating bus, not emu or a really good one
zeroid: sec cmp #$00 ; yes this is needed
bne ckcatak ; if not zero, go check for Catakig
sta emuver ; zero out the version
sec
jsr $fe1f ; is GS? jsr $fe1f ; is GS?
bcs :+ bcs :+ ; nope, skip forward
ldy #<emGus ; assume Gus if GS and ID 0 ldy #<emGus ; assume Gus if GS and ID 0
lda #>emGus lda #>emGus
bne foundemu1 bne foundemu1
; check for Virtual II
: ldy #$00
ldx #$10 ; loop to check for Virtual ][
viilp: lda $c04f
and #$b0
cmp #$b0 ; VII has mostly this here
bne :+
iny
: dex
bne viilp
cpy #$0d ; more than 14 $Bx?
bcc :+ ; nope
stx emuver ; zero version
ldy #<emVII
lda #>emVII
bne foundemu1
; check for Apple IIjs or jse ; check for Apple IIjs or jse
; which always have zeros from $c001-$c00f ; which always have zeros from $c001-$c00f
: lda #$00 : lda #$00
ldx #$0f ldx #$0f
jslp: lda $c000,x jslp: lda $c000,x
bne :+ bne :+ ; find nonzero, move on
dex dex
bne jslp bne jslp
stx emuver stx emuver ; zero emuver
ldy #<emJS ldy #<emJS
lda #>emJS lda #>emJS
bne foundemu1 bne foundemu1
: jmp unkemu : ldy #<emVII ; Not one of those, just assume Virtual ][
; Routine to identify by emubyte value if possible lda #>emVII
doemub: jsr getemub bne foundemu1
bne noemu ckcatak: cmp #$ad ; Catakig always has this in $c04f
cmp #$00 ; yes this is needed
beq zeroid ; do zero identification
cmp #$ad ; Catakig always has this in $c04f
bne :+ bne :+
lda #$00 lda #$00
sta emuver ; catakig doesn't have a version byte sta emuver ; catakig doesn't have a version byte
@ -199,7 +181,7 @@ emNone: pstr_hi "None identified"
emUnk: pstr_hi "Unknown, emubyte = $XX" emUnk: pstr_hi "Unknown, emubyte = $XX"
unkemub = *-2 unkemub = *-2
emPDS: pstr_hi "Apple IIe Card" emPDS: pstr_hi "Apple IIe Card"
emVII: pstr_hi "Virtual ][" emVII: pstr_hi "Virtual ][ (probably)"
emIIe: pstr_hi "IIe" emIIe: pstr_hi "IIe"
emGus: pstr_hi "Gus (probably)" emGus: pstr_hi "Gus (probably)"
emCatak: pstr_hi "Catakig" emCatak: pstr_hi "Catakig"