diff --git a/src/desk_acc/res/this.apple.res.bg b/src/desk_acc/res/this.apple.res.bg index 56159c5c..5c1222f0 100644 --- a/src/desk_acc/res/this.apple.res.bg +++ b/src/desk_acc/res/this.apple.res.bg @@ -53,6 +53,7 @@ .define res_string_card_type_storage "u-wo za zapis na danni" .define res_string_card_type_network "mrevowa karta" .define res_string_card_type_mockingboard "MOCKINGBOARD" +.define res_string_card_type_phasor "PHASOR" .define res_string_card_type_z80 "Z-80 SOFTCARD" .define res_string_card_type_uthernet2 "UTHERNET II" .define res_string_card_type_passport "PASSPORT MIDI" diff --git a/src/desk_acc/res/this.apple.res.da b/src/desk_acc/res/this.apple.res.da index 2c04b6da..daeb7fb6 100644 --- a/src/desk_acc/res/this.apple.res.da +++ b/src/desk_acc/res/this.apple.res.da @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Masselagring" .define res_string_card_type_network "Netv{rkskort" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Z-80 SoftCard" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.de b/src/desk_acc/res/this.apple.res.de index dbcf67c7..a6b7f867 100644 --- a/src/desk_acc/res/this.apple.res.de +++ b/src/desk_acc/res/this.apple.res.de @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Massenspeicher" .define res_string_card_type_network "Netzwerkkarte" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Z-80 SoftCard" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.en b/src/desk_acc/res/this.apple.res.en index 13fd40a9..b740404c 100644 --- a/src/desk_acc/res/this.apple.res.en +++ b/src/desk_acc/res/this.apple.res.en @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Mass Storage" .define res_string_card_type_network "Network Card" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Z-80 SoftCard" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.es b/src/desk_acc/res/this.apple.res.es index ea6fd67c..912d7130 100644 --- a/src/desk_acc/res/this.apple.res.es +++ b/src/desk_acc/res/this.apple.res.es @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Dispositivo de Almacenamiento" .define res_string_card_type_network "Tarjeta de Red" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Tarjeta Z-80" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.fr b/src/desk_acc/res/this.apple.res.fr index 245b95bb..04bc721b 100644 --- a/src/desk_acc/res/this.apple.res.fr +++ b/src/desk_acc/res/this.apple.res.fr @@ -53,6 +53,7 @@ .define res_string_card_type_storage "M{moire de masse" .define res_string_card_type_network "Carte r{seau" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Carte Z-80" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.it b/src/desk_acc/res/this.apple.res.it index 207656df..bc9a3747 100644 --- a/src/desk_acc/res/this.apple.res.it +++ b/src/desk_acc/res/this.apple.res.it @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Memoria di massa" .define res_string_card_type_network "Scheda di rete" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Scheda Z-80" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.nl b/src/desk_acc/res/this.apple.res.nl index 84fcba87..0c1b0f82 100644 --- a/src/desk_acc/res/this.apple.res.nl +++ b/src/desk_acc/res/this.apple.res.nl @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Massa-opslag" .define res_string_card_type_network "Netwerk kaart" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Z-80 SoftCard" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.pt b/src/desk_acc/res/this.apple.res.pt index 8d2782f0..176a0eba 100644 --- a/src/desk_acc/res/this.apple.res.pt +++ b/src/desk_acc/res/this.apple.res.pt @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Dispositivo de armazenamento" .define res_string_card_type_network "Placa de Rede" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Placa Z-80" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/res/this.apple.res.sv b/src/desk_acc/res/this.apple.res.sv index 2d31cb42..b4fd7722 100644 --- a/src/desk_acc/res/this.apple.res.sv +++ b/src/desk_acc/res/this.apple.res.sv @@ -53,6 +53,7 @@ .define res_string_card_type_storage "Masslagring" .define res_string_card_type_network "N{tverkskort" .define res_string_card_type_mockingboard "Mockingboard" +.define res_string_card_type_phasor "Phasor" .define res_string_card_type_z80 "Z-80 Kort" .define res_string_card_type_uthernet2 "Uthernet II" .define res_string_card_type_passport "Passport MIDI" diff --git a/src/desk_acc/this.apple.s b/src/desk_acc/this.apple.s index 037cdf99..840ca3b8 100644 --- a/src/desk_acc/this.apple.s +++ b/src/desk_acc/this.apple.s @@ -743,6 +743,7 @@ str_audio: PASCAL_STRING res_string_card_type_audio str_storage: PASCAL_STRING res_string_card_type_storage str_network: PASCAL_STRING res_string_card_type_network str_mockingboard: PASCAL_STRING res_string_card_type_mockingboard +str_phasor: PASCAL_STRING res_string_card_type_phasor str_z80: PASCAL_STRING res_string_card_type_z80 str_uthernet2: PASCAL_STRING res_string_card_type_uthernet2 str_passport: PASCAL_STRING res_string_card_type_passport @@ -1700,7 +1701,12 @@ sigtable_xdrive: .byte 4, $07, $3C, $0B, $B0, $0C, $01, $F0, $CA CALL WithInterruptsDisabled, AX=#DetectMockingboard IF CS - RETURN AX=#str_mockingboard + CALL WithInterruptsDisabled, AX=#DetectPhasor + IF CS + RETURN AX=#str_phasor + END_IF + + RETURN C=1, AX=#str_mockingboard END_IF CALL WithInterruptsDisabled, AX=#DetectZ80 @@ -1927,6 +1933,7 @@ write: sta $C080,x ; self-modified to $C0n0 .endproc ; DetectPassportMIDI .include "../lib/detect_mockingboard.s" + .include "../lib/detect_phasor.s" .include "../lib/detect_thecricket.s" ;;; ============================================================ diff --git a/src/lib/detect_phasor.s b/src/lib/detect_phasor.s new file mode 100644 index 00000000..c45fdca7 --- /dev/null +++ b/src/lib/detect_phasor.s @@ -0,0 +1,82 @@ +;;; ============================================================ +;;; Detect Phasor +;;; +;;; A Phasor will also be detected as a Mockingboard, so first +;;; detect the Mockingboard, and if successful detect the Phasor +;;; +;;; Inputs: $06 points at $Cs00 +;;; Outputs: C=1 if detected, C=0 otherwise +;;; Assert: Interrupts disabled +;;; ============================================================ + +.proc DetectPhasor + ptr := $06 + + txa + pha ; preserve caller's X + + lda ptr+1 ; $Cs00 high byte + and #$07 ; slot + asl + asl + asl + asl ; X offset = slot * 16 + tax + + ;; Force Phasor native mode: $C0(8+s)D + lda $C08D,X + + ;; In native mode, $Cs04 should no longer be VIA0. + ldy #$04 + jsr ProbeViaTimerPreserveX + bcs fail_restore + + ;; In native mode, VIA0 timer-low appears at $Cs14. + ldy #$14 + jsr ProbeViaTimerPreserveX + bcc fail_restore + + ;; Restore Mockingboard-compatible mode: $C0(8+s)8 + lda $C088,X + + pla + tax + RETURN C=1 + +fail_restore: + lda $C088,X + + pla + tax + RETURN C=0 +.endproc + +.proc ProbeViaTimerPreserveX + ptr := $06 + tmp := $08 + + txa + pha + + ldx #2 + +loop: lda (ptr),Y + sta tmp + lda (ptr),Y + + sec + sbc tmp + cmp #($100 - 8) + bne fail + + dex + bne loop + + pla + tax + RETURN C=1 + +fail: pla + tax + RETURN C=0 +.endproc