sync recent code changes with 4cade

This commit is contained in:
4am 2025-01-04 16:51:06 -05:00
parent 204465f87b
commit b03088e299
11 changed files with 377 additions and 218 deletions

View File

@ -1,7 +1,7 @@
# Master game list
#
# Format:
# ABCDE,directory=name/year
# ABCDEF,directory=name/year
#
# A=1 if game requires joystick, 0 if playable on keyboard
# B=1 if game requires 128K, 0 if playable on 64K
@ -16,98 +16,99 @@
# 6=invincibility
# 7=has in-game cheats
# E=1 if game is single-load and can be stored in TOTAL.DATA
# F=1 if game has SHR box art that we should display during launch
#
# Lines beginning with hash character are ignored
# Blank lines are also ignored
#
11100,SLICKS=8bit-Slicks/2020
00001,ACEY.DEUCEY=Acey Deucey/1982
01000,ANCHORMAN=Anchorman/1988
01100,ADVANCE=Advance to Boardwalk/1990
00001,AUTOBAHN=Autobahn/1981
01100,BATTLE.CHESS=Battle Chess/1990
00000,BLACK.BELT=Black Belt/1984
00000,BOP.N.WRESTLE=Bop'n Wrestle/1986
01100,CALI.GAMES=California Games/1987
01100,CARD.SHARKS=Card Sharks/1988
11000,BASEBALL=Championship Baseball/1986
11000,CHAMP.BSKETBALL=Championship Basketball/1986
00000,CHAMP.BOXING=Sierra Championship Boxing/1985
01000,CHAMP.WRESTLE=Championship Wrestling/1986
00001,CHECKERS=Checkers/1982
10000,CHUCK.YEAGER=Chuck Yeager's Flight Sim/1987
10001,CMPTR.FOOSBALL=Computer Foosball/1981
10000,DIVE.BOMBER=Dive Bomber/1988
00001,DRAW.POKER=Draw Poker/1981
10000,F15.STRK.EGL=F-15 Strike Eagle/1985
01100,FAMILY.FEUD=Family Feud/1989
10000,FIGHT.NIGHT=Fight Night/1985
00000,FS2=Flight Simulator II/1984
10001,FORMULA.1.RACER=Formula 1 Racer/1983
00001,FOX.AND.GEESE=Fox & Geese/1988
10001,FUJI.SPEED.WAY=Fuji Crowded Speedway/1983
10000,GFL.FOOTBALL=GFL Championship Football/1987
00001,GO=Go/1982
00001,GO.FOUR.IT=Go Four It/1988
10001,HARDBALL=Hardball/1985
10001,HIRES.FOOTBALL=Hi-Res Football/1980
10001,HIRES.SOCCER=Hi-Res Soccer/1980
10001,INTL.GRAN.PRIX=International Gran Prix/1981
10000,INTL.HOCKEY=International Hockey/1987
00001,JUMP.PIT=Jump Pit/1989
10000,KARATE.CHAMP=Karate Champ/1985
00001,KONO=Kono/1988
00001,MAGNET.MADNESS=Magnet Madness/1989
00001,MICROGOLF=Micro Golf/1981
00001,MICROCHESS=MicroChess/1978
00000,MPL=Million Perfect Letters/2022
00000,MPT=Million Perfect Tiles/2024
00001,MIX.MATCHER=Mix Matcher/1988
00001,MU.TORERE=Mu Torere/1988
00001,NIMWIT=Nimwit/1988
00001,NINE.MENS=Nine Men's Morris/1988
00001,ODIN=Odin/1982
10001,ONE.ON.ONE=One on One/1983
01100,PAY.DAY=Pay Day/1990
00001,PENSATE=Pensate/1983
00001,PITSTOP.II=Pitstop II/1984
00001,PLACE.BALL=Place Ball/1989
10001,POOL=Pool/1981
01100,PRESS.YOUR.LK=Press Your Luck/1988
00001,REVERSI=Reversi/1981
00001,ROCK.N.SCROLL=Rock & Scroll/1987
00001,SEEGA=Seega/1988
00001,SHUFFLEBOARD=Shuffleboard/1981
10000,SILENT.SERVICE=Silent Service/1985
00000,SKI.CRAZED=Ski Crazed/1987
10000,SOLO.FLIGHT=Solo Flight/1984
00000,SPDWAY.CLASSIC=Speedway Classic/1984
01100,SS.BASEBALL=Street Sports Baseball/1987
01100,SS.BASKETBALL=Street Sports Basketball/1987
01100,SS.FOOTBALL=Street Sports Football/1988
01100,SS.SOCCER=Street Sports Soccer/1988
10000,STUNT.CAR.RACER=Stunt Car Racer/2023
00000,SUDOKU=Sudoku/2018
00000,SUMMER.GAMES=Summer Games/1984
00000,SUMMER.GAMES.II=Summer Games II/1985
00001,SUPER.HUEY=Super Huey/1985
01000,SUPER.ICEHOCKEY=Superstar Ice Hockey/1988
01100,SUPER.PASSWD=Super Password/1988
00001,TAG.TEAM=Tag Team Wrestling/1984
11110,TEST.DRIVE=Test Drive/1988
00000,AMER.CHALLENGE=The American Challenge/1986
10000,THE.DAM.BUSTERS=The Dam Busters/1985
01100,SUMMER.EDITION=The Games: Summer Edition/1988
01100,WINTER.EDITION=The Games: Winter Edition/1988
11100,TSN.BASEBALL=The Sporting News Baseball/1988
10001,TOMAHAWK=Tomahawk/1987
00000,TRACK.AND.FIELD=Track & Field/1984
00001,ULTRACHECKERS=Ultracheckers/1980
00000,VIDEO.VEGAS=Video Vegas/1985
00001,WARI=Wari/1988
00000,WINTER.GAMES=Winter Games/1985
01100,WORLD.GAMES=World Games/1987
01100,WIPEOUT=Wipeout/1989
00000,WORLD.KARATE=World Karate Championship/1986
00001,ZZFS=Zig Zag Flag Shag/1989
111000,SLICKS=8bit-Slicks/2020
000010,ACEY.DEUCEY=Acey Deucey/1982
010000,ANCHORMAN=Anchorman/1988
011000,ADVANCE=Advance to Boardwalk/1990
000010,AUTOBAHN=Autobahn/1981
011000,BATTLE.CHESS=Battle Chess/1990
000000,BLACK.BELT=Black Belt/1984
000000,BOP.N.WRESTLE=Bop'n Wrestle/1986
011000,CALI.GAMES=California Games/1987
011000,CARD.SHARKS=Card Sharks/1988
110000,BASEBALL=Championship Baseball/1986
110000,CHAMP.BSKETBALL=Championship Basketball/1986
000000,CHAMP.BOXING=Sierra Championship Boxing/1985
010000,CHAMP.WRESTLE=Championship Wrestling/1986
000010,CHECKERS=Checkers/1982
100000,CHUCK.YEAGER=Chuck Yeager's Flight Sim/1987
100010,CMPTR.FOOSBALL=Computer Foosball/1981
100000,DIVE.BOMBER=Dive Bomber/1988
000010,DRAW.POKER=Draw Poker/1981
100000,F15.STRK.EGL=F-15 Strike Eagle/1985
011000,FAMILY.FEUD=Family Feud/1989
100000,FIGHT.NIGHT=Fight Night/1985
000000,FS2=Flight Simulator II/1984
100010,FORMULA.1.RACER=Formula 1 Racer/1983
000010,FOX.AND.GEESE=Fox & Geese/1988
100010,FUJI.SPEED.WAY=Fuji Crowded Speedway/1983
100000,GFL.FOOTBALL=GFL Championship Football/1987
000010,GO=Go/1982
000010,GO.FOUR.IT=Go Four It/1988
100010,HARDBALL=Hardball/1985
100010,HIRES.FOOTBALL=Hi-Res Football/1980
100010,HIRES.SOCCER=Hi-Res Soccer/1980
100010,INTL.GRAN.PRIX=International Gran Prix/1981
100000,INTL.HOCKEY=International Hockey/1987
000010,JUMP.PIT=Jump Pit/1989
100000,KARATE.CHAMP=Karate Champ/1985
000010,KONO=Kono/1988
000010,MAGNET.MADNESS=Magnet Madness/1989
000010,MICROGOLF=Micro Golf/1981
000010,MICROCHESS=MicroChess/1978
000000,MPL=Million Perfect Letters/2022
000000,MPT=Million Perfect Tiles/2024
000010,MIX.MATCHER=Mix Matcher/1988
000010,MU.TORERE=Mu Torere/1988
000010,NIMWIT=Nimwit/1988
000010,NINE.MENS=Nine Men's Morris/1988
000010,ODIN=Odin/1982
100010,ONE.ON.ONE=One on One/1983
011000,PAY.DAY=Pay Day/1990
000010,PENSATE=Pensate/1983
000010,PITSTOP.II=Pitstop II/1984
000010,PLACE.BALL=Place Ball/1989
100010,POOL=Pool/1981
011000,PRESS.YOUR.LK=Press Your Luck/1988
000010,REVERSI=Reversi/1981
000010,ROCK.N.SCROLL=Rock & Scroll/1987
000010,SEEGA=Seega/1988
000010,SHUFFLEBOARD=Shuffleboard/1981
100000,SILENT.SERVICE=Silent Service/1985
000000,SKI.CRAZED=Ski Crazed/1987
100000,SOLO.FLIGHT=Solo Flight/1984
000000,SPDWAY.CLASSIC=Speedway Classic/1984
011000,SS.BASEBALL=Street Sports Baseball/1987
011000,SS.BASKETBALL=Street Sports Basketball/1987
011000,SS.FOOTBALL=Street Sports Football/1988
011000,SS.SOCCER=Street Sports Soccer/1988
100000,STUNT.CAR.RACER=Stunt Car Racer/2023
000000,SUDOKU=Sudoku/2018
000000,SUMMER.GAMES=Summer Games/1984
000000,SUMMER.GAMES.II=Summer Games II/1985
000010,SUPER.HUEY=Super Huey/1985
010000,SUPER.ICEHOCKEY=Superstar Ice Hockey/1988
011000,SUPER.PASSWD=Super Password/1988
000010,TAG.TEAM=Tag Team Wrestling/1984
111100,TEST.DRIVE=Test Drive/1988
000000,AMER.CHALLENGE=The American Challenge/1986
100000,THE.DAM.BUSTERS=The Dam Busters/1985
011000,SUMMER.EDITION=The Games: Summer Edition/1988
011000,WINTER.EDITION=The Games: Winter Edition/1988
111000,TSN.BASEBALL=The Sporting News Baseball/1988
100010,TOMAHAWK=Tomahawk/1987
000000,TRACK.AND.FIELD=Track & Field/1984
000010,ULTRACHECKERS=Ultracheckers/1980
000000,VIDEO.VEGAS=Video Vegas/1985
000010,WARI=Wari/1988
000000,WINTER.GAMES=Winter Games/1985
011000,WORLD.GAMES=World Games/1987
011000,WIPEOUT=Wipeout/1989
000000,WORLD.KARATE=World Karate Championship/1986
000010,ZZFS=Zig Zag Flag Shag/1989

View File

@ -52,6 +52,11 @@ Reenter
sta $C000 ; Turn 80STORE switch off
ldx #$ff
txs ; so that we never trash the reset vector
inx ; phoneme=000000 (pause)
SilenceIsGolden
stx $bf40 ; C = SSI reg 0, S/S I or A = 6522#1 port b data
; SMC to MB slot by init code, if appropriate
jsr SwitchToBank2
jsr DisableAccelerator ; back to 1 MHz (especially important on IIgs
; which restores default speed on Ctrl-Reset)

View File

@ -239,20 +239,34 @@
stx MockingboardStuff ; save mockingboard slot and type
txa ; requires RAM1 write
php
bmi @mb_speech
asl
bpl @no_speech
lsr
@mb_speech
and #7
ora #$C0
sta SilenceIsGolden + 2
@no_speech
jsr BuildVBLFunction ; requires ROM read, RAM1 write
plp
beq @done_with_mb
+READ_RAM1_NO_WRITE
lda MockingboardStuff ; requires RAM1 read
+READ_ROM_NO_WRITE
and #HAS_STEREO
beq @mb_mono
+LDADDR LoadingMockingboardStereo
bne @mb_print
bne @mb_print ; always branches
@mb_mono
+LDADDR LoadingMockingboardStereo
+LDADDR LoadingMockingboardMono
@mb_print
jsr LoadingPrint ; requires ROM read
; if Mockingboard AND HAS_SPEECH then print CR & '...and it talks!'
txa
+READ_RAM1_NO_WRITE
lda MockingboardStuff ; requires RAM1 read
+READ_ROM_NO_WRITE
and #HAS_SPEECH
beq @done_with_mb
+LDADDR LoadingMockingboardSpeech

View File

@ -139,6 +139,7 @@ HTAB = $24 ; byte
VTAB = $25 ; byte
RNDSEED = $4E ; word
PrelaunchInit= $EA
HideLaunchArtwork = $1BA
; textrank
BestMatchIndex = $E5 ; word
tmpx = $E7 ; byte
@ -358,9 +359,10 @@ HAS_SPEECH = %11000000
; AND masks for game info bitfield (after game display name in gSearchStore)
HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE
IS_SINGLE_LOAD = %01000000
HAS_LAUNCH_ARTWORK= %00100000
CHEAT_CATEGORY = %00001111
; ^^
; ++-- your bits here!
; ^
; +-- your bit here! last one!
; AND masks for MachineStatus
HAS_JOYSTICK = %10000000

View File

@ -663,65 +663,6 @@ ReverseCoordinates3Bit
bcc -- ; always branches
++ rts
RippleCoordinates3Bit
ldx #$1B
- lda @ripplezp, x
sta $e0, x
dex
bpl -
--- ldx #$0c
-- ldy $ee, x
lda $ef, x
jsr @aslmod
sty $ee, x
sta $ef, x
sty $ec
clc
adc #>Coordinates3Bit
sta $ed
ldy #0
!byte $24
- sec
lda ($ec), y
pha
lda $de, x
sta ($ec), y
pla
sta $de, x
inx
iny
bcc -
dex
dex
dex
dex
bne --
dec $ee
bne ---
dec $ef
bpl ---
bmi @exit ; always branches
@aslmod jsr +
+ cmp #$28
bcc +
iny
+ pha
tya
asl
tay
pla
rol
cmp #$50
bcc @exit
sbc #$50
@exit rts
@ripplezp
!byte $1F,$F3,$20,$F3,$20,$14,$20,$D3
!byte $1E,$F3,$1F,$54,$00,$00,$AA,$06
!byte $02,$00,$04,$00,$06,$00,$0C,$00
!byte $16,$00,$1A,$00
!zone {
RippleCoordinates1Bit4
lda #<aslmod4
@ -820,3 +761,62 @@ aslmod cmp #$1A
sbc #$34
exit rts
}
RippleCoordinates3Bit
ldx #$1B
- lda @ripplezp, x
sta $e0, x
dex
bpl -
--- ldx #$0c
-- ldy $ee, x
lda $ef, x
jsr @aslmod
sty $ee, x
sta $ef, x
sty $ec
clc
adc #>Coordinates3Bit
sta $ed
ldy #0
!byte $24
- sec
lda ($ec), y
pha
lda $de, x
sta ($ec), y
pla
sta $de, x
inx
iny
bcc -
dex
dex
dex
dex
bne --
dec $ee
bne ---
dec $ef
bpl ---
bmi @exit ; always branches
@aslmod jsr +
+ cmp #$28
bcc +
iny
+ pha
tya
asl
tay
pla
rol
cmp #$50
bcc @exit
sbc #$50
@exit rts
@ripplezp
!byte $1F,$F3,$20,$F3,$20,$14,$20,$D3
!byte $1E,$F3,$1F,$54,$00,$00,$AA,$06
!byte $02,$00,$04,$00,$06,$00,$0C,$00
!byte $16,$00,$1A,$00

View File

@ -14,25 +14,28 @@ DECRUNCH = $0314 ; decrunch entry point
;------------------------------------------------------------------------------
; DecompressSHR
;
; in: compressed SHR loaded to $1FF8+
; in: compressed SHR loaded to $1FF8+/main
; file size in sizelo2/sizehi2 as set by ProRWTS2
; out: decompressed SHR at $2000..$9FFF
; out: decompressed SHR at $2000..$9FFF/main
; $00A7..$00A8 clobbered by decompressor
; $00AE..$00AF clobbered by decompressor
; $00FC..$00FF clobbered by decompressor
; $0200..$03CB clobbered by decompressor
;------------------------------------------------------------------------------
DecompressAuxSHR
bit SHRRTS
!byte $A9
DecompressSHR
clv
lda #$1F
+HIDE_NEXT_2_BYTES
; /!\ execution falls through here
bne DecompressInternal ; alwyas branches
;------------------------------------------------------------------------------
; DecompressHGR
;
; in: compressed HGR loaded to $3FF8+
; in: compressed HGR loaded to $3FF8+/main
; file size in sizelo2/sizehi2 as set by ProRWTS2
; out: decompressed HGR at $4000..$5FFF
; out: decompressed HGR at $4000..$5FFF/main
; $00A7..$00A8 clobbered by decompressor
; $00AE..$00AF clobbered by decompressor
; $00FC..$00FF clobbered by decompressor
@ -40,35 +43,47 @@ DecompressSHR
;------------------------------------------------------------------------------
DecompressHGR
lda #$3F
clv
; execution falls through here
DecompressInternal
pha
php
jsr SwitchToBank2
jsr EnableAccelerator
plp
ldx #0
bvc +
inx
+ stx auxreq
lda sizehi2
pha
lda sizelo2
pha
lda #>(@loaddecrunch - 1)
lda #>(@params - 1)
pha
lda #<(@loaddecrunch - 1)
lda #<(@params - 1)
pha
lda auxreq
bne +
bvs +
jmp LoadIndexedFile ; load decompression code to $200
+ jmp LoadAuxIndexedFile ; load decompression code to $200/aux
@loaddecrunch
!word $200
@params !word $200
!word kDecrunchRecord
ldx auxreq
sta READMAINMEM,x ; X = 0 or 1, so this will be READMAINMEM or READAUXMEM
sta WRITEMAINMEM,x ; X = 0 or 1, so this will be WRITEMAINMEM or WRITEAUXMEM
jsr DECRUNCH ; loaded from separate file
sta READMAINMEM
sta WRITEMAINMEM
jsr SwitchToBank2
lda #0
sta auxreq
jmp DisableAcceleratorAndSwitchToBank1
;------------------------------------------------------------------------------
; DecompressDHGR
;
; in: compressed DHGR loaded to aux $3FF8+
; in: compressed DHGR loaded to $3FF8+/aux
; file size in sizelo2/sizehi2 as set by ProRWTS2
; out: decompressed HGR at $4000..$5FFF/main and $4000..$5FFF/aux
; $6000..$7FFF/aux clobbered by decompressor

View File

@ -125,6 +125,7 @@ PlayGameInAY
+ST16 SAVE
+ST16 @pfile
+ST16 xfile
+ST16 IndexedSHRFilename
jsr okvs_next_field
jsr okvs_next_field_PTR_is_already_set
; (PTR) -> length-prefixed game info bitfield
@ -132,11 +133,40 @@ PlayGameInAY
iny ; Y = 1
lda (PTR), y ; A = game info bitfield
and #IS_SINGLE_LOAD
php
php ; Z=0 if game is single-load (stored in TOTAL.DATA)
;
; possibly show box art before launch
;
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
and #SUPPORTS_SHR
beq @noLaunchArtwork
lda (PTR), y ; A = game info bitfield
and #HAS_LAUNCH_ARTWORK
bne @showLaunchArtwork ; Z=0 if game has artwork to display during launch
@noLaunchArtwork
jsr ClearScreens ; avoid seeing code load into the HGR page
; (clobbers $106, must do now before loading prelaunch code)
; don't have to do this if we're displaying launch artwork
; since SHR video mode will be active instead of HGR
beq @postArtwork ; always branches because Z=1 coming out of ClearScreens
@showLaunchArtwork
jsr Home
lda MachineStatus
and #HAS_128K
bne @showLaunchArtwork128K
jsr LoadIndexedSHRFile ; requires IndexedSHRFilename (set earlier)
jsr DecompressSHR
jsr PreSHRMode
jsr CopySHR
jsr SHRMode
jsr ReloadSearchIndexOnly
jmp @postArtwork
@showLaunchArtwork128K
jsr LoadAuxIndexedSHRFile
jsr PreSHRMode
jsr DecompressAuxSHR
jsr SHRMode
@postArtwork
jsr LoadIndexedFile ; load prelaunch index file
- !word gSearchCache ; clobber gSearchCache which we no longer need
!word kPrelaunchIndexRecord
@ -151,7 +181,7 @@ PlayGameInAY
@prelaunchIndexRecordPtr
!word $FDFD ; SMC
plp
plp ; Z=0 if game is single-load (stored in TOTAL.DATA)
beq @loadFromSubdirectory
jsr LoadXSingle_NameIsAlreadySet

View File

@ -24,6 +24,11 @@ LaunchInternal
sta PrelaunchInit-1, x
dex
bne -
ldx #(HideLaunchArtworkInternal_e-HideLaunchArtworkInternal+1)
- lda HideLaunchArtworkInternal-1, x
sta HideLaunchArtwork-1, x
dex
bne -
;X=0
txa
ldy #$18
@ -48,7 +53,12 @@ LaunchInternal
sta CLR80VID
sta PRIMARYCHARSET
bit CLEARKBD
jmp iPrelaunchInit
lda MachineStatus
and #SUPPORTS_SHR
bne +
lda #$60
sta HideLaunchArtwork
+ jmp iPrelaunchInit
PrelaunchInitInternal
!pseudopc PrelaunchInit {
@ -66,3 +76,11 @@ AnimationPrelaunchInit
}
}
PrelaunchInitInternal_e
HideLaunchArtworkInternal
!pseudopc HideLaunchArtwork {
lda #1
sta NEWVIDEO
rts
}
HideLaunchArtworkInternal_e

View File

@ -56,8 +56,22 @@ GetMockingboardStuff
sta MAGIC_Z80_LOCATION, x
dex
bpl -
stx $C403 ; enable Mockingboard 4C support
lda $C405
cmp #$38
bne @not_mouse
lda $C407
cmp #$18
beq @use_slot5 ; looks like the mouse
@not_mouse
stx $C403 ; enable Mockingboard 4C support in slot 4
stx $C404
bne @not_iic ; always
@use_slot5
stx $C503 ; try enable Mockingboard 4C support in slot 5 instead
stx $C504
@not_iic
lda #$00
@ -119,6 +133,8 @@ GetMockingboardStuff
sta @mb_smc20 + 2
sta @mb_smc21 + 2
sta @mb_smc22 + 2
sta @mb_smc23 + 2
sta @mb_smc24 + 2
; detect speech - SSI263
@ -152,6 +168,8 @@ GetMockingboardStuff
lda #$82 ; enable CA1 interrupt
@mb_smc5
sta $c48e ; interrupt enable register 6522#2
@mb_smc24
sta $c48d ; interrupt flag register 6522#2
ldx #$80 ; 0= ~650ms, 80 = ~325ms
ldy #0
@ -184,6 +202,10 @@ GetMockingboardStuff
lda #$3f ; stop
@mb_smc19
sta $c400 ; orb, write phoneme & pitch
lda #$10
@mb_smc23
bit $c40d ; ifr, check for cb1 interrupt flag
bne @got_irq ; work around A2FPGA bug that does not clear cb1
ldx #$D0 ; wait ~120ms, stop takes 47ms
- lda #$10

View File

@ -7,6 +7,10 @@
; - AllSHRSlideshow
; - SHRSlideshow
; - SHRSingle
; - DisplaySHR
; - DisplayAuxSHR
; - LoadIndexedSHRFile
; - LoadAuxIndexedSHRFile
;
;------------------------------------------------------------------------------
@ -69,13 +73,78 @@ SHRSingle
and #SUPPORTS_SHR
beq SHRRTS
jsr BlankSHR
jsr LoadIndexedSHRFile
jsr LoadIndexedSHRFile ; requires IndexedSHRFilename (set earlier)
jsr DecompressSHR
jsr LoadSHRTransition
jsr ExecuteTransitionAtA000AndWait
jmpblank
jmp BlankHGR
;------------------------------------------------------------------------------
; LoadAuxIndexedSHRFile/LoadIndexedSHRFile
; load compressed SHR data from disk
;
; in: caller has populated IndexedSHRFilename
; out: all flags & registers clobbered
; $2000+ clobbered
;------------------------------------------------------------------------------
LoadAuxIndexedSHRFile
bit SHRRTS
!byte $A9
LoadIndexedSHRFile
clv
php
jsr LoadIndexedFile ; load index file into $2000
- !word $2000
!word kSHRArtworkIndexRecord
jsr okvs_find
!word -
IndexedSHRFilename
!word $FDFD ; SMC
+ST16 @indexRecordPtr
plp ; V=1 if loading into auxmem, 0 if mainmem
lda #>(@params - 1)
pha
lda #<(@params - 1)
pha
bvs +
jmp LoadIndexedFile ; load compressed SHR artwork at $1FF8/main
+ jmp LoadAuxIndexedFile ; load compressed SHR artwork at $1FF8/aux
@params
!word $1FF8
@indexRecordPtr
!word $FDFD ; SMC
SHRRTS rts
;------------------------------------------------------------------------------
; CopySHR
; copy $8000 bytes from $2000/main to $2000/aux
;
; in: none
; out: all flags & registers clobbered
; SRC clobbered
;------------------------------------------------------------------------------
CopySHR
sta WRITEAUXMEM ; $0200..$BFFF only, does not affect zero page
lda #$20
sta SRC+1
ldy #$00
sty SRC
ldx #$80
@loop lda (SRC), y
sta (SRC), y
iny
bne @loop
inc SRC+1
dex
bne @loop
sta WRITEMAINMEM
rts
;------------------------------------------------------------------------------
; LoadSHRTransition [private]
; looks up name of next SHR transition effect in SFX.CONF and loads that file
@ -107,7 +176,7 @@ LoadSHRTransition
!word $A000 ; load actual transition effect code into $A000
@indexRecordPtr
!word $FDFD ; SMC
SHRRTS rts
rts
;------------------------------------------------------------------------------
; SHRArtworkCallback [private]
@ -135,29 +204,10 @@ SHRArtworkCallback
bcs SHRRTS
jsr BlankSHR
jsr LoadIndexedSHRFile
jsr LoadIndexedSHRFile ; requires IndexedSHRFilename (set earlier)
jsr DecompressSHR
jmp ExecuteTransitionAtA000AndWait
LoadIndexedSHRFile
; in: caller has populated IndexedSHRFilename
; out: all flags & registers clobbered
jsr LoadIndexedFile ; load index file into $2000
- !word $2000
!word kSHRArtworkIndexRecord
jsr okvs_find
!word -
IndexedSHRFilename
!word $FDFD ; SMC
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed SHR artwork at $1FF8/main (not aux)
!word $1FF8
@indexRecordPtr
!word $FDFD ; SMC
rts
;------------------------------------------------------------------------------
; BlankSHR [private]
; clear and show SHR mode without flickering
@ -172,15 +222,26 @@ IndexedSHRFilename
;------------------------------------------------------------------------------
BlankSHR
jsr Home
lda #%01000001 ; set GS NEWVIDEO mode to turn on linearize
sta NEWVIDEO
jsr PreSHRMode
;A=0
sta ClearColor ; clear SHR screen to black, not green
lda #$20 ; clear $2000..$9FFF in auxmem
ldx #$80
sta WRITEAUXMEM ; writes go to auxmem
jsr ClearMem
sta WRITEMAINMEM ; writes go to main memory
lda #$80
sta ClearColor
SHRMode
lda #%11000001 ; set GS NEWVIDEO mode to turn on SHR mode
sta NEWVIDEO
rts
ldx #$00 ; enable auxmem-to-bank-E1 shadowing on IIgs
stx SHADOW
PreSHRMode
lda #%01000001 ; set GS NEWVIDEO mode to turn on linearize
sta NEWVIDEO ; (see notes in Home)
lda #$00 ; enable auxmem-to-bank-E1 shadowing on IIgs
sta SHADOW
; VIDHD-SPECIFIC HACK HERE!
; On the II/II+/IIe, all $C03x addresses are aliases for $C030, i.e. the speaker.
; Any single access of the speaker register requires a second access within a short
@ -189,15 +250,5 @@ BlankSHR
; 8-bit machines, which VidHD interprets as invalid graphic modes and crashes hard),
; we instead balance the speaker access with a second write to the same speaker-
; aliased softswitch. Do not remove.
stx SHADOW
lsr ; clear $2000..$9FFF in auxmem
ldx #$80
jsr ClearMem
sta WRITEMAINMEM ; writes go to main memory
lda #%11000001 ; set GS NEWVIDEO mode to turn on SHR mode
sta NEWVIDEO
sta SHADOW
rts

View File

@ -198,8 +198,8 @@ OFFSCREENRTS
ClearScreens
jsr Home
lda #$20 ; clear both hi-res pages
ldx #$40 ; to flash previous bits of the launcher UI)
bne ClearMem ; always
ldx #$40 ; $2000..$5FFF
bne ClearMem ; always branches
;------------------------------------------------------------------------------
; ClearOffscreen
@ -222,7 +222,7 @@ ClearHGR1
ldx #$20
ClearMem
ldy #$2C ; BIT
bne + ; always
bne + ; always branches
;------------------------------------------------------------------------------
; CopyHGR
@ -237,7 +237,8 @@ CopyHGR
+ sty PageFrom
sta PageTo+2
ClearToBlack
lda #$00
ClearColor=*+1
lda #$80 ; clear to BLACK2 (SMC by BlankSHR)
ClearGR
ldy #0
PageFrom lda $FD00,y ; SMC address high byte, also SMC opcode (might be BIT)