distinguish between SC-01 and SSI-263

This commit is contained in:
Peter Ferrie 2022-04-25 15:09:50 -07:00
parent fbc7179dd6
commit 0c12457e69
12 changed files with 79 additions and 82 deletions

View File

@ -169,9 +169,11 @@ iLoadFileDirect = $FFEF ; note: you really want LC RAM 2 banked in before ca
WaitForVBL = $FFF2
UnwaitForVBL = $FFF5
MockingboardStuff = $FFF8 ; bit 7 = 1 if speech chip present (Mockingboard "C")
; bit 6 = 1 if Mockingboard "B" (stereo) found (else Mockingboard "A")
; bit 4-5 unused
MockingboardStuff = $FFF8 ; bit 7 = 1 if SC-01 speech chip present (Speech I)
; bit 6 = 1 if SSI-263 speech chip present (Mockingboard "B"-"D")
; bit 5 = 1 if two AY-3-8910s present (Sound II / Mockingboard "A"-"D")
; bit 5 = 0 if only AY-3-8910 present (Sound I)
; bit 4 unused
; bits 0-3: slot number
MachineStatus = $FFF9

View File

@ -18,9 +18,10 @@
; (zp$81 will contain the slot in form $Cx)
; /!\ ALL ACCELERATORS MUST BE OFF OR SET TO 1 MHZ
; out: if card was found, X = #$?n where n is the slot number of the card, otherwise #$00
; and bit 6 = 0 if Mockingboard Sound I found
; or bit 6 = 1 if Mockingboard Sound II or "A" found
; and bit 7 = 1 if Mockingboard Sound/Speech I or "C" found
; and bit 5 = 0 if Mockingboard Sound I found
; or bit 5 = 1 if Mockingboard Sound II or "A"-"D" found
; and bit 6 = 1 if SSI-263 speech chip found
; or bit 7 = 1 if SC-01 speech chip found
; flags clobbered
; zp $80-$82 clobbered
; A/Y clobbered
@ -127,11 +128,13 @@ GetMockingboardStuff
@wait_irq
lda $80
bne @got_irq
bne +
iny
bne @wait_irq
inx
bne @wait_irq
clc
+ ror $82
; detect speech - SC-01
;based on S/S I demo dsk
@ -159,24 +162,22 @@ GetMockingboardStuff
bne -
inx
bne -
clc ; not found
bcc @got_irq
beq @got_irq
@mb_smc21
+ sta $c40d ; ifr, clear flag
lda #$00 ; turn off cb2 pulse mode to disable false writes to sc01
@mb_smc22
sta $c40c ; pcr
sec ; found, we have an S/S I
sec ; found, we have an SC-01
ror $82
ldy #$ff
bcc @ssI
bne @ssI
@got_irq
sei
clc ; not found
ror $82
@onlyI
ldy #$ff
@mb_smc6
sty $c403 ; 6522#1 ddra
@ -190,16 +191,16 @@ GetMockingboardStuff
sta ($80),y ; 6522#1 orb
lda #4
sta ($80),y ; 6522#1 orb
dey
@ssI
ldy #$ff
@mb_smc8
sty $c483 ; 6522#2 ddra
lda #7
@mb_smc9
sta $c482 ; 6522#2 ddrb
iny
tya
lda #0
ldy #$80
sta ($80),y ; 6522#2 orb
lda #4

View File

@ -209,7 +209,7 @@
; various language card configurations
!macro READ_RAM1_NO_WRITE {
bit $C088
sta $C088
}
!macro READ_RAM1_WRITE_RAM1 {
@ -218,7 +218,7 @@
}
!macro READ_RAM2_NO_WRITE {
bit $C080
sta $C080
}
!macro READ_RAM2_WRITE_RAM2 {
@ -237,7 +237,7 @@
}
!macro READ_ROM_NO_WRITE {
bit $C082
sta $C082
}
!macro READ_AUX {
@ -314,18 +314,16 @@
+READ_ROM_NO_WRITE
}
!macro GET_MOCKINGBOARD_SPEECH { ;carry set if present
!macro GET_MOCKINGBOARD_SPEECH { ;sign set if SC-01, overflow set if SSI-263
+READ_RAM2_NO_WRITE
lda MockingboardStuff
asl
bit MockingboardStuff
+READ_ROM_NO_WRITE
}
!macro GET_MOCKINGBOARD_SPEECH_AND_MACHINE_STATUS { ;carry set if present
!macro GET_MOCKINGBOARD_SPEECH_AND_MACHINE_STATUS { ;sign set if SC-01, overflow set if SSI-263
+READ_RAM2_NO_WRITE
lda MockingboardStuff
asl
lda MachineStatus
bit MockingboardStuff
+READ_ROM_NO_WRITE
}
@ -333,6 +331,7 @@
+READ_RAM2_NO_WRITE
lda MockingboardStuff
cmp #1
and #7
ora #$C0
+READ_ROM_NO_WRITE
}
@ -341,6 +340,7 @@
+READ_RAM2_NO_WRITE
lda MockingboardStuff
cmp #1
and #7
ora #$C0
tax
lda MachineStatus

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2021 by qkumba
;(c) 2021-2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/APE.ESCAPE",plain
@ -26,11 +26,9 @@
jsr $94E4 ; decompress game
lda MockingboardStuff
cmp #1
ora #$C0
bcc no_speech
ldx MockingboardStuff
bpl no_speech
and #7
ora #$C0
ldy #0
- ldx $1300,Y ;find #$C4s

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2020 by qkumba
;(c) 2020, 2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/BATTLE.CRUISER",plain
@ -13,7 +13,7 @@
jsr $2000 ; decompress
+GET_MOCKINGBOARD_SPEECH_AND_MACHINE_STATUS
bcs +
bmi +
ldy #0
sty $868
sty $9486

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2020 by qkumba
;(c) 2020, 2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH/BERZAP.MB",plain
@ -93,21 +93,20 @@ setopt
lda $65AB
cmp #3
bne ++
+READ_RAM2_NO_WRITE
lda MockingboardStuff
ldx #3 ; MB/A
ldy #0
sty $382 ; joystick
asl
bpl +
ldx #1 ; Sound2
+ bcc +
txa
eor #2
adc #0
tax ; Sound/Speech or MB/C
lsr
tay ; Speech1 or Speech2
ldx #2
iny ; Sound/Speech I
+READ_RAM2_NO_WRITE
bit MockingboardStuff
bmi + ; SC-01
ldx #0
dey ; Sound II
bvc + ; no speech
ldx #4
ldy #2 ; Mockingboard "C"
+ stx $380
sty $381
lda #$0D

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2021 by qkumba
;(c) 2021-2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH/KAMUNGAS.MB",plain
@ -30,22 +30,20 @@
+
lda MockingboardStuff
+READ_ROM_NO_WRITE
cmp #1
bcc ++
beq ++
tax
and #7
ora #$C0
sta mbslot+1
txa
ldy #$0e ; sound/speech
asl
and #$80
ora #2 ; sound i
bpl +
eor #$88 ; sound ii
+
bcc +
ora #4 ; +speech
+
sta mbtype+1
bcs +
ldy #$0a ; sound ii
asl
bmi +
ldy #2 ; sound i
+ sty mbtype+1
lda #$4C
sta $BD00
lda #<callback

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2019-2020 by 4am and qkumba
;(c) 2019-2020, 2022 by 4am and qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/LADY.TUT",plain
@ -39,6 +39,7 @@ patch
asl
ror $AD
lsr
and #7
ora #$C0
sta $AC
lda #$4B

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2020 by qkumba
;(c) 2020, 2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH/RESQ.RAIDERS.MB",plain
@ -17,7 +17,7 @@
lda #$4C
sta $4047
+GET_MOCKINGBOARD_SPEECH
bcs +
bmi +
lda #$60
sta $40FB ; no speech chip, pretend no MB
+

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2019-2020 by 4am, qkumba
;(c) 2019-2020, 2022 by 4am, qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/S2",plain
@ -20,15 +20,15 @@
sta $6AE7 ; patch - don't decrease lives
sta $87EE ; patch - don't increase lives
+
ldy #2 ; sound / speech
lda MockingboardStuff
asl
bpl skipmb
lsr
and #7
beq skipmb
bmi +
iny ; sound
+ and #7
ora #$30
sta $8F33
lda #3
sta $8FEC
sty $8FEC
skipmb
jsr DisableAccelerator

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2019 by Frank M.
;(c) 2019 by Frank M., 2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/THUNDER.BOMBS",plain
@ -28,22 +28,21 @@
+READ_RAM2_NO_WRITE
lda MockingboardStuff
+READ_ROM_NO_WRITE
cmp #1
bcc ++
beq ++
tax
and #7
ora #$C0
sta $341
txa
ldy #6 ; sound/speech
asl
and #$80
ora #1 ; sound i
bpl +
eor #$85 ; sound ii
bcs +
ldy #4 ; sound ii
asl
bmi +
dey ; sound i
+
bcc +
lda #6 ; +speech
+
sta $340
sty $340
jsr $7CB4
++
+DISABLE_ACCEL

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2021 by qkumba
;(c) 2021-2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/ZOO.MASTER",plain
@ -18,12 +18,11 @@
+READ_RAM2_NO_WRITE
jsr DisableAccelerator
lda MockingboardStuff
pha
+READ_ROM_NO_WRITE
pla
bmi +
jmp $8C0
+
and #7
ora #$C0
ldx #0
- ldy $9A00, x