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"
nineplus dta d"9"+1
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
+10 -2
View File
@@ -128,7 +128,7 @@ MoreDown
ListOfWeapons
:36 dta d" "
ListOfWeapons1End
GameOverResults ; reuse after game (remember to clear on start new)
;GameOverResults ; reuse after game (remember to clear on start new)
ListOfDefensiveWeapons
:16 dta d" "
ListOfDefensiveWeaponsEnd ;constant useful when clearing
@@ -148,6 +148,9 @@ EmptyLine
; -------------------------------------------------
.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
.byte $70,$40
.byte $47 ; 16 gr8 lines
@@ -170,7 +173,12 @@ GameOverDL
.byte $42
.word GameOverResults
: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
.word GameOverDL
+4 -3
View File
@@ -905,6 +905,7 @@ tankflash_loop
jsr SetupXYdraw.X
jsr TypeChar
ToHighToParachute
ldx TankNr
rts
.endp
@@ -948,7 +949,7 @@ NoFallingSound
jsr DrawTankParachute
DoNotClearParachute
mva #0 Erase
ldx TankNr
; ldx TankNr
lda EndOfTheFallFlag ; We only get byte below the tank if still falling
bne NoGroundCheck
; coordinates of the first pixel under the tank
@@ -1097,7 +1098,7 @@ DoNotDrawParachute
; the horizontal coordinate is even.
; If it is odd then it must be corrected because otherwise
; P/M graphics background would not look OK
ldx TankNr
; ldx TankNr
lda XtanksTableL,x
and #$01
beq EndOfFall ; if it is even then it is the end
@@ -1133,7 +1134,7 @@ NoParachuteWeapon
jsr DrawTankParachute
ThereWasNoParachute
mva #0 Erase
ldx TankNr
; ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
mva #sfx_silencer sfx_effect
rts
+24 -2
View File
@@ -60,6 +60,7 @@
.zpvar xtempDRAW .word ;same as above for XDRAW routine
.zpvar ytempDRAW .word ;same as above for XDRAW routine
.zpvar tempor2 .byte
.zpvar CreditsVScrol .byte
;--------------temps used in circle routine
.zpvar xi .word ;X (word) in draw routine
.zpvar fx .byte
@@ -111,7 +112,7 @@
icl 'lib/macro.hea'
;splash screen and musix
icl 'artwork/HIMARS14.asm'
;icl 'artwork/HIMARS14.asm'
;Game loading address
ORG $3000
WeaponFont
@@ -267,7 +268,7 @@ eskipzeroing
lda GameIsOver
beq NoGameOverYet
;jsr GameOverScreen
jsr GameOverScreen
jmp START
NoGameOverYet
inc CurrentRoundNr
@@ -1031,12 +1032,33 @@ EndofPMG
sta gtictl
bne EndOfDLI_GO
ColoredLines
cmp #9
beq CreditsScroll
tay
lda GameOverColoursTable-3,y ; -2 becouse this is DLI nr 2 and -1 (labels line)
ldy #$0a ; text colour (brightnes)
STA WSYNC
sta COLPF2
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
inc dliCounter
ply
BIN
View File
Binary file not shown.
+74 -2
View File
@@ -1822,8 +1822,10 @@ FinishResultDisplay
;--------------------------------------------------
.proc GameOverScreen
;--------------------------------------------------
jsr WaitForKeyRelease
jsr ClearScreen
jsr ClearPMmemory
jsr PrepareCredits
jsr GameOverResultsClear
mwa #GameOverDL dlptrs
lda #%00111110 ; normal screen width, DL on, P/M on
@@ -1833,6 +1835,7 @@ FinishResultDisplay
jsr SetPMWidth
jsr ColorsOfSprites
mva #0 colpf1s
sta CreditsVScrol
mva #TextForegroundColor colpf2s
VDLI DLIinterruptGameOver ; jsr SetDLI for Game Over screen
; make text and color lines for each tank
@@ -1949,10 +1952,14 @@ AllTanksFloatingDown
NoEraseTank
ldx TankNr
inc Ytankstable,x
lda ActiveDefenceWeapon,x
beq NotFastTank
:3 inc Ytankstable,x
NotFastTank
lda Ytankstable,x
; cmp #32 ; tank over screen - not visible
cmp #80 ; tank under screen - new tank randomize
beq TankUnderScreen
bcs TankUnderScreen
cmp #72 ; tank under screen but.... parachute
bcs DrawOnlyParachute
bcc TankOnScreen
@@ -1961,8 +1968,11 @@ TankUnderScreen
TankOnScreen
jsr DrawTankNr
DrawOnlyParachute
lda ActiveDefenceWeapon,x
bne FastTank
jsr DrawTankParachute
ldx TankNr
FastTank
; ldx TankNr
dex
bpl AllTanksFloatingDown
lda kbcode
@@ -1983,6 +1993,15 @@ RandomizeTankPos
lda XtankOffsetGO_H,x
adc #0
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
GameOverResultsClear
lda #$00
@@ -1992,6 +2011,59 @@ GameOverResultsClear
cpx #(6*40)+1
bne @-
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
;-------------------------------------------------
.proc DisplayStatus