loader screen upgrades

This commit is contained in:
4am 2020-03-05 12:38:53 -05:00
parent 76ba708434
commit 2593949713
4 changed files with 176 additions and 83 deletions

View File

@ -138,9 +138,9 @@ SwitchToBank2
; | | | | | | | +- bit 0 reserved ; | | | | | | | +- bit 0 reserved
; | | | | | | +--- bit 1 reserved ; | | | | | | +--- bit 1 reserved
; | | | | | +----- bit 2 reserved ; | | | | | +----- bit 2 reserved
; | | | | +------- bit 3 reserved ; | | | | +------- bit 3 = 1 if cheats are enabled
; | | | +--------- bit 4 = 1 if cheats are enabled ; | | | +--------- bit 4 = 1 if VidHD
; | | +----------- bit 5 = 1 if VidHD or IIgs ; | | +----------- bit 5 = 1 if IIgs
; | +------------- bit 6 = 1 if 128K ; | +------------- bit 6 = 1 if 128K
; +--------------- bit 7 = 1 if joystick ; +--------------- bit 7 = 1 if joystick
; Use the bit masks defined in constants.a ; Use the bit masks defined in constants.a

View File

@ -43,16 +43,20 @@
sec sec
jsr $FE1F ; check for IIgs (allows super hi-res artwork) jsr $FE1F ; check for IIgs (allows super hi-res artwork)
bcs @NotGS bcs @NotGS
lda #$80 +HIDE_NEXT_BYTE
sta zpMachineStatus @NotGS clc
@NotGS jsr Has128K ; check for 128K (allows DHGR slideshows and 128K games) ror zpMachineStatus
jsr Has128K ; check for 128K (allows DHGR slideshows and 128K games)
ror zpMachineStatus ror zpMachineStatus
jsr HasJoystick ; check for joystick (absence is OK but we filter out some games that require a joystick) jsr HasJoystick ; check for joystick (absence is OK but we filter out some games that require a joystick)
ror zpMachineStatus ; now bit 5 = 1 if VidHD or IIgs ror zpMachineStatus
; now bit 4 = 1 if VidHD
; bit 5 = 1 if IIgs
; bit 6 = 1 if 128K ; bit 6 = 1 if 128K
; bit 7 = 1 if joystick ; bit 7 = 1 if joystick
; and all other bits are 0 (we'll set bit 4 after copying it to LC RAM) ; and all other bits are 0 (we'll set bit 3 after copying it to LC RAM)
; accomodate uppercase-only machines (64K ][+ is supported)
lda ROM_MACHINEID lda ROM_MACHINEID
cmp #$06 cmp #$06
beq + beq +
@ -61,6 +65,7 @@
+ lda #$FF + lda #$FF
sta zpCharMask sta zpCharMask
; print text title in same place as graphical title will appear
ldy #8 ldy #8
- lda TOTAL,y - lda TOTAL,y
ora #$80 ora #$80
@ -74,51 +79,66 @@
dey dey
bpl - bpl -
ldy LoaderVersion ; increase text window width so we can print to the edge of the screen without scrolling
- lda LoaderVersion,y inc $21
ora #$80 ; print version or build number in lower right corner
+FORCE_UPPERCASE_IF_REQUIRED ldx #30
sta $07CF,y ldy #23
dey jsr SetCursorPosition
bne - +LDADDR LoadingVersion
jsr LoadingPrint
!ifndef RELEASE { !ifndef RELEASE {
lda #$D6 lda LoadingBuild
sta $28 ldx LoadingBuild+1
lda #$07
sta $29
lda LoaderBuild
ldx LoaderBuild+1
ldy #0 ldy #0
jsr PrintAsDecimal jsr PrintAsDecimal
} }
bit zpMachineStatus ; set up text window so it only covers lower left corner
bvc ++ lda #30
bpl + sta $21
+LDADDR Loader128KAndJoystick lda #19
bne @ShowLoadScreen sta $22
; print machine configuration in lower left corner
ldx #0
ldy #23
jsr SetCursorPosition
; if zpMachineStatus AND IS_IIGS then print 'IIgs'
; else if zpMachineStatus AND HAS_128K then print '128K'
; else print '64K'
lda zpMachineStatus
and #IS_IIGS
beq +
+LDADDR LoadingIIgs
bne @printMem
+ lda zpMachineStatus
and #HAS_128K
beq +
+LDADDR Loading128K
bne @printMem
+ +
+LDADDR Loader128K +LDADDR Loading64K
bne @ShowLoadScreen @printMem
++ jsr LoadingPrint
bpl +
+LDADDR Loader64KAndJoystick ; if zpMachineStatus AND HAS_JOYSTICK then CR & print 'joystick'
bne @ShowLoadScreen lda zpMachineStatus
and #HAS_JOYSTICK
beq +
jsr LoadingCR
+LDADDR LoadingJoystick
jsr LoadingPrint
+
; if zpMachineStatus AND HAS_VIDHD then CR & print 'VidHD'
lda zpMachineStatus
and #HAS_VIDHD
beq +
jsr LoadingCR
+LDADDR LoadingVidHD
jsr LoadingPrint
+ +
+LDADDR Loader64K
@ShowLoadScreen
+STAY PTR
ldy #0
lda (PTR),y
tay
- lda (PTR),y
ora #$80
+FORCE_UPPERCASE_IF_REQUIRED
@load sta $07F7
dec @load+1
dey
bne -
@Relocate @Relocate
+READ_ROM_WRITE_RAM2 +READ_ROM_WRITE_RAM2
@ -167,11 +187,24 @@
dex dex
bpl - bpl -
jsr DisableAccelerator ; cycle counting requires 1MHz jsr DisableAccelerator ; cycle counting in Mockingboard detection requires 1MHz
+READ_ROM_WRITE_RAM2
+LDADDR FoundMockingboardCallback
jsr GetMockingboardStuff jsr GetMockingboardStuff
stx MockingboardStuff ; save mockingboard slot and type in LC RAM stx MockingboardStuff ; save mockingboard slot and type in LC RAM
jsr EnableAccelerator
; if Mockingboard AND HAS_SPEECH then print CR & '...and it talks!'
txa
and #HAS_SPEECH
beq +
jsr LoadingCR
+LDADDR LoadingMockingboardSpeech
jsr LoadingPrint
+
+READ_RAM2_WRITE_RAM2
jsr EnableAccelerator
jmp OneTimeSetup jmp OneTimeSetup
; ProRWTS2 has its own function to relocate itself ; ProRWTS2 has its own function to relocate itself
@ -183,43 +216,89 @@ ProRWTSBuffer
!source "src/hw.joystick.a" !source "src/hw.joystick.a"
!source "src/hw.mockingboard.a" !source "src/hw.mockingboard.a"
SetCursorPosition
stx HTAB
sty VTAB
jmp $FC22
LoadingPrint
+STAY PTR
ldy #0
lda (PTR),y
sta @max
sty i
- inc i
ldy i
lda (PTR),y
ora #$80
+FORCE_UPPERCASE_IF_REQUIRED
jsr ROM_COUT
ldy i
@max=*+1
cpy #$FD ; SMC
bne -
rts
LoadingCR
lda #$8D
jmp ROM_COUT
FoundMockingboardCallback
; in: zp$81 contains slot number in form $Cx
jsr LoadingCR
+LDADDR LoadingMockingboard
jsr LoadingPrint
lda $81
and #$0F
ora #$B0
jmp ROM_COUT
TOTAL TOTAL
!text "T O T A L" !text "T O T A L"
REPLAY REPLAY
!text "R E P L A Y" !text "R E P L A Y"
!ifndef RELEASE { !ifndef RELEASE {
LoaderVersion LoadingVersion
!byte 5 !byte 6
!text "build" !text "build "
LoaderBuild LoadingBuild
!word BUILDNUMBER !word BUILDNUMBER
} else { } else {
LoaderVersion LoadingVersion
!byte 4 !byte 10
!text "v3.0" !text " v3.0"
} }
Loader64K Loading64K
!byte 3 !byte 3
!text "64K" !text "64K"
Loader64KAndJoystick Loading128K
!byte 14 !byte 4
!text "joystick + 64K" !text "128K"
Loader128K LoadingIIgs
!byte 4 !byte 4
!text "128K" !text "IIgs"
Loader128KAndJoystick LoadingJoystick
!byte 15 !byte 8
!text "joystick + 128K" !text "joystick"
LoadingVidHD
!byte 5
!text "VidHD"
LoadingMockingboard
!byte 21
!text "Mockingboard in slot "
LoadingMockingboardSpeech
!byte 16
!text "...and it talks!"
!ifndef RELEASE { !ifndef RELEASE {
PrintAsDecimal PrintAsDecimal
jsr $FF4A jsr $FF4A
lda $FDE2 lda $FDE2
cmp #$EA cmp #$EA
bne @go bne +
dec @addr+1 ; fix for Laser dec @addr+1 ; fix for Laser
@go +
-- lda #$00 -- lda #$00
clv clv
ldx #$18 ldx #$18
@ -297,10 +376,9 @@ CopyDevs
and #1 ; A = #$01 or #$00 and #1 ; A = #$01 or #$00
asl asl
asl asl
asl asl ; A = #$08 or #$00
asl ; A = #$10 or #$00
ora MachineStatus ora MachineStatus
sta MachineStatus ; set bit 4 of MachineStatus sta MachineStatus ; set bit 3 of MachineStatus
; calculate and update visible game count (3-digit decimal number as ASCII string) ; calculate and update visible game count (3-digit decimal number as ASCII string)
dey ; Y = 0 dey ; Y = 0

View File

@ -53,6 +53,7 @@ ROM_TEXT2COPY =$F962 ; turn on alternate display mode on IIgs
ROM_TEXT = $FB2F ROM_TEXT = $FB2F
ROM_MACHINEID =$FBB3 ROM_MACHINEID =$FBB3
ROM_HOME = $FC58 ROM_HOME = $FC58
ROM_COUT = $FDED
ROM_NORMAL = $FE84 ; NORMAL text (instead of INVERSE or FLASH) ROM_NORMAL = $FE84 ; NORMAL text (instead of INVERSE or FLASH)
ROM_IN0 = $FE89 ; SETKBD ROM_IN0 = $FE89 ; SETKBD
ROM_PR0 = $FE93 ; SETVID ROM_PR0 = $FE93 ; SETVID
@ -119,6 +120,14 @@ MachineStatus = $FFF9
DisableAccelerator = $DBAF DisableAccelerator = $DBAF
EnableAccelerator = DisableAccelerator+3 EnableAccelerator = DisableAccelerator+3
; AND masks for MockingboardStuff
MOCKINGBOARD_SLOT = %00001111
HAS_SPEECH = %10000000
; AND masks for MachineStatus ; AND masks for MachineStatus
SUPPORTS_SHR = %00100000 HAS_JOYSTICK = %10000000
CHEATS_ENABLED = %00010000 HAS_128K = %01000000
IS_IIGS = %00100000 ; /!\ do not use this to gate SHR, use SUPPORTS_SHR instead
HAS_VIDHD = %00010000
SUPPORTS_SHR = %00110000
CHEATS_ENABLED = %00001000

View File

@ -14,10 +14,11 @@
; with optimisation from deater/french touch ; with optimisation from deater/french touch
; also takes into account FastChip //e clock difference ; also takes into account FastChip //e clock difference
; ;
; in: none ; in: A/Y contains address of callback to call if card was found
; accelerators should be off ; (this will be called before the speech detection routine, and
; out: ; (zp$81 will contain the slot in form $Cx)
; if card was found, X = #$?n where n is the slot number of the card, otherwise #$00 ; /!\ 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 ; and bit 6 = 0 if Mockingboard Sound I found
; or bit 6 = 1 if Mockingboard Sound II or "A" 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 7 = 1 if Mockingboard Sound/Speech I or "C" found
@ -26,6 +27,7 @@
; A/Y clobbered ; A/Y clobbered
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
GetMockingboardStuff GetMockingboardStuff
+STAY @callback+1
lda #$00 lda #$00
sta $80 sta $80
sta $82 ; type sta $82 ; type
@ -44,6 +46,7 @@ GetMockingboardStuff
rts rts
@foundI ; sound I or better @foundI ; sound I or better
jsr @callback
ldy #$84 ; 6522 #2 $Cx84 ldy #$84 ; 6522 #2 $Cx84
jsr @timercheck jsr @timercheck
beq @foundII beq @foundII
@ -166,3 +169,6 @@ GetMockingboardStuff
sta $c402 sta $c402
lda $45 lda $45
rti rti
@callback
jmp $FDFD ; SMC