Game Over and Credits - but RTM problems

This commit is contained in:
Pecusx
2022-08-08 21:18:47 +02:00
parent 2d274b05d0
commit 2f57c1f774
6 changed files with 148 additions and 10 deletions
+36 -1
View File
@@ -676,5 +676,40 @@ zero
digits dta d"0123456789" digits dta d"0123456789"
nineplus dta d"9"+1 nineplus dta d"9"+1
space dta d" " space dta d" "
;------credits
CreditsStart
dta d" "*
dta d"You were playin",d"g"*
dta d"Scorc",d"h"*
dta d"Warsaw, Miam",d"i"*
dta d"2000-202",d"2"*
dta d" "*
dta d"B",d"y"*
dta d" "*
dta d"Programmin",d"g"*
dta d"Tomasz 'Pecus' Peck",d"o"*
dta d"Pawel 'pirx' Kalinowsk",d"i"*
dta d" "*
dta d"SFX and Music",d"c"*
dta d"Michal 'Miker' Szpilowsk",d"i"*
dta d" "*
dta d"Additional musi",d"c"*
dta d"Mario 'Emkay' Kri",d"x"*
dta d" "*
dta d"Code Optimizatio",d"n"*
dta d"Piotr '0xF' Fusi",d"k"*
dta d" "*
dta d"Ar",d"t"*
dta d"Adam Wachowsk",d"i"*
dta d"Krzysztof 'Kaz' Ziembi",d"k"*
dta d" "*
dta d"Ideas and Q",d"A"*
dta d"Bocianu, Probabilitydragon, KrzysRog",d","*
dta d"Beeblebrox, EnderDude, lopezpb, Dracon",d","*
dta d"brad-colbert, archon800",d","*
dta d"Shaggy the Ataria",d"n"*
dta d" "*
dta d"Stay tuned for the FujiNet version",d"!"*
dta d" "*
CreditsEnd
.endif .endif
+10 -2
View File
@@ -128,7 +128,7 @@ MoreDown
ListOfWeapons ListOfWeapons
:36 dta d" " :36 dta d" "
ListOfWeapons1End ListOfWeapons1End
GameOverResults ; reuse after game (remember to clear on start new) ;GameOverResults ; reuse after game (remember to clear on start new)
ListOfDefensiveWeapons ListOfDefensiveWeapons
:16 dta d" " :16 dta d" "
ListOfDefensiveWeaponsEnd ;constant useful when clearing ListOfDefensiveWeaponsEnd ;constant useful when clearing
@@ -148,6 +148,9 @@ EmptyLine
; ------------------------------------------------- ; -------------------------------------------------
.ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!! .ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!!
;----------------------------------------------- ;-----------------------------------------------
GameOverResults = display+$0ff0 ; reuse after game
Credits = GameOverResults +(6*40)
CreditsLastLine = Credits + (41*40)
GameOverDL GameOverDL
.byte $70,$40 .byte $70,$40
.byte $47 ; 16 gr8 lines .byte $47 ; 16 gr8 lines
@@ -170,7 +173,12 @@ GameOverDL
.byte $42 .byte $42
.word GameOverResults .word GameOverResults
:5 .byte $00+$80,$02 :5 .byte $00+$80,$02
.byte $70 .byte $70+$80
.byte $42+$20 ; VSCRL
DLCreditsAddr
.word Credits
:6 .byte $02+$20
.byte $02
.byte $41 .byte $41
.word GameOverDL .word GameOverDL
+4 -3
View File
@@ -905,6 +905,7 @@ tankflash_loop
jsr SetupXYdraw.X jsr SetupXYdraw.X
jsr TypeChar jsr TypeChar
ToHighToParachute ToHighToParachute
ldx TankNr
rts rts
.endp .endp
@@ -948,7 +949,7 @@ NoFallingSound
jsr DrawTankParachute jsr DrawTankParachute
DoNotClearParachute DoNotClearParachute
mva #0 Erase mva #0 Erase
ldx TankNr ; ldx TankNr
lda EndOfTheFallFlag ; We only get byte below the tank if still falling lda EndOfTheFallFlag ; We only get byte below the tank if still falling
bne NoGroundCheck bne NoGroundCheck
; coordinates of the first pixel under the tank ; coordinates of the first pixel under the tank
@@ -1097,7 +1098,7 @@ DoNotDrawParachute
; the horizontal coordinate is even. ; the horizontal coordinate is even.
; If it is odd then it must be corrected because otherwise ; If it is odd then it must be corrected because otherwise
; P/M graphics background would not look OK ; P/M graphics background would not look OK
ldx TankNr ; ldx TankNr
lda XtanksTableL,x lda XtanksTableL,x
and #$01 and #$01
beq EndOfFall ; if it is even then it is the end beq EndOfFall ; if it is even then it is the end
@@ -1133,7 +1134,7 @@ NoParachuteWeapon
jsr DrawTankParachute jsr DrawTankParachute
ThereWasNoParachute ThereWasNoParachute
mva #0 Erase mva #0 Erase
ldx TankNr ; ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) ) jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
+24 -2
View File
@@ -60,6 +60,7 @@
.zpvar xtempDRAW .word ;same as above for XDRAW routine .zpvar xtempDRAW .word ;same as above for XDRAW routine
.zpvar ytempDRAW .word ;same as above for XDRAW routine .zpvar ytempDRAW .word ;same as above for XDRAW routine
.zpvar tempor2 .byte .zpvar tempor2 .byte
.zpvar CreditsVScrol .byte
;--------------temps used in circle routine ;--------------temps used in circle routine
.zpvar xi .word ;X (word) in draw routine .zpvar xi .word ;X (word) in draw routine
.zpvar fx .byte .zpvar fx .byte
@@ -111,7 +112,7 @@
icl 'lib/macro.hea' icl 'lib/macro.hea'
;splash screen and musix ;splash screen and musix
icl 'artwork/HIMARS14.asm' ;icl 'artwork/HIMARS14.asm'
;Game loading address ;Game loading address
ORG $3000 ORG $3000
WeaponFont WeaponFont
@@ -267,7 +268,7 @@ eskipzeroing
lda GameIsOver lda GameIsOver
beq NoGameOverYet beq NoGameOverYet
;jsr GameOverScreen jsr GameOverScreen
jmp START jmp START
NoGameOverYet NoGameOverYet
inc CurrentRoundNr inc CurrentRoundNr
@@ -1031,12 +1032,33 @@ EndofPMG
sta gtictl sta gtictl
bne EndOfDLI_GO bne EndOfDLI_GO
ColoredLines ColoredLines
cmp #9
beq CreditsScroll
tay tay
lda GameOverColoursTable-3,y ; -2 becouse this is DLI nr 2 and -1 (labels line) lda GameOverColoursTable-3,y ; -2 becouse this is DLI nr 2 and -1 (labels line)
ldy #$0a ; text colour (brightnes) ldy #$0a ; text colour (brightnes)
STA WSYNC STA WSYNC
sta COLPF2 sta COLPF2
sty COLPF1 sty COLPF1
bne EndOfDLI_GO
CreditsScroll
lda #$00
sta COLPF2
inc CreditsVScrol
lda CreditsVScrol
cmp #16 ;not to fast
beq nextlinedisplay
lsr ;not to fast
sta VSCROL
jmp EndOfDLI_GO
nextlinedisplay
lda #0
sta CreditsVScrol
sta VSCROL
adw DLCreditsAddr #40
cpw DLCreditsAddr #CreditsLastLine
bne EndOfDLI_GO
mwa #Credits DLCreditsAddr
EndOfDLI_GO EndOfDLI_GO
inc dliCounter inc dliCounter
ply ply
BIN
View File
Binary file not shown.
+74 -2
View File
@@ -1822,8 +1822,10 @@ FinishResultDisplay
;-------------------------------------------------- ;--------------------------------------------------
.proc GameOverScreen .proc GameOverScreen
;-------------------------------------------------- ;--------------------------------------------------
jsr WaitForKeyRelease
jsr ClearScreen jsr ClearScreen
jsr ClearPMmemory jsr ClearPMmemory
jsr PrepareCredits
jsr GameOverResultsClear jsr GameOverResultsClear
mwa #GameOverDL dlptrs mwa #GameOverDL dlptrs
lda #%00111110 ; normal screen width, DL on, P/M on lda #%00111110 ; normal screen width, DL on, P/M on
@@ -1833,6 +1835,7 @@ FinishResultDisplay
jsr SetPMWidth jsr SetPMWidth
jsr ColorsOfSprites jsr ColorsOfSprites
mva #0 colpf1s mva #0 colpf1s
sta CreditsVScrol
mva #TextForegroundColor colpf2s mva #TextForegroundColor colpf2s
VDLI DLIinterruptGameOver ; jsr SetDLI for Game Over screen VDLI DLIinterruptGameOver ; jsr SetDLI for Game Over screen
; make text and color lines for each tank ; make text and color lines for each tank
@@ -1949,10 +1952,14 @@ AllTanksFloatingDown
NoEraseTank NoEraseTank
ldx TankNr ldx TankNr
inc Ytankstable,x inc Ytankstable,x
lda ActiveDefenceWeapon,x
beq NotFastTank
:3 inc Ytankstable,x
NotFastTank
lda Ytankstable,x lda Ytankstable,x
; cmp #32 ; tank over screen - not visible ; cmp #32 ; tank over screen - not visible
cmp #80 ; tank under screen - new tank randomize cmp #80 ; tank under screen - new tank randomize
beq TankUnderScreen bcs TankUnderScreen
cmp #72 ; tank under screen but.... parachute cmp #72 ; tank under screen but.... parachute
bcs DrawOnlyParachute bcs DrawOnlyParachute
bcc TankOnScreen bcc TankOnScreen
@@ -1961,8 +1968,11 @@ TankUnderScreen
TankOnScreen TankOnScreen
jsr DrawTankNr jsr DrawTankNr
DrawOnlyParachute DrawOnlyParachute
lda ActiveDefenceWeapon,x
bne FastTank
jsr DrawTankParachute jsr DrawTankParachute
ldx TankNr FastTank
; ldx TankNr
dex dex
bpl AllTanksFloatingDown bpl AllTanksFloatingDown
lda kbcode lda kbcode
@@ -1983,6 +1993,15 @@ RandomizeTankPos
lda XtankOffsetGO_H,x lda XtankOffsetGO_H,x
adc #0 adc #0
sta XtankstableH,x sta XtankstableH,x
lda random
cmp #8 ; like 1:32
bcc NowFastTank
lda #0
sta ActiveDefenceWeapon,x
rts
NowFastTank
lda #1
sta ActiveDefenceWeapon,x
rts rts
GameOverResultsClear GameOverResultsClear
lda #$00 lda #$00
@@ -1992,6 +2011,59 @@ GameOverResultsClear
cpx #(6*40)+1 cpx #(6*40)+1
bne @- bne @-
rts rts
PrepareCredits
; Rewrites credits and places it in the middle of each line.
mwa #CreditsStart temp ; from
mwa #Credits temp2 ; to
MainRewriteLoop
ldy #0
cpw temp #CreditsEnd
beq EndOfCredits
; count characters in this line
@ lda (temp),y
bmi LastCharFound
iny
bne @-
LastCharFound
; in Y number of characters reduced by 1
; let's count how many spaces add before the text
sec
sty magic
lda #40
sbc magic
lsr ; now in A we have number of spaces in front
sta magic
ldy #0
tya
tax
FirstSpaces
sta (temp2),y ; fill the area in front of the text with spaces
iny
cpy magic
bne FirstSpaces
MainText
lda (temp,x)
sta (temp2),y ; rewrite the text to a new place
bmi LastCharWritten
inw temp
iny
bne MainText
LastCharWritten
inw temp
and #%01111111 ; remove inverse
sta (temp2),y
iny
txa ; space to A (0)
LastSpaces
sta (temp2),y ; fill the area behind the text with spaces
iny
cpy #40
bne LastSpaces
NextLine
adw temp2 #40
jmp MainRewriteLoop
EndOfCredits
rts
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
.proc DisplayStatus .proc DisplayStatus