text4x4 optimised

This commit is contained in:
2022-11-20 12:29:59 -05:00
parent f4213a7cf4
commit 38b6af6720
8 changed files with 59 additions and 117 deletions
+12 -12
View File
@@ -78,7 +78,7 @@ L73 dta d"OH MAN!"
L74 dta d"DOOUGH!" L74 dta d"DOOUGH!"
L75 dta d"ANOTHER DAY, ANOTHER BOMB." L75 dta d"ANOTHER DAY, ANOTHER BOMB."
L76 dta d"THIS IS THE END, MY ONLY FRIEND." L76 dta d"THIS IS THE END, MY ONLY FRIEND."
L77 dta d"IT'S ALL OVER." L77 dta d"VERY FUNNY."
L78 dta d"THE FAT LADY SANG." L78 dta d"THE FAT LADY SANG."
L79 dta d"WHY DOES EVERYTHING HAPPEN TO ME?" L79 dta d"WHY DOES EVERYTHING HAPPEN TO ME?"
L80 dta d"I'M GOING DOWN." L80 dta d"I'M GOING DOWN."
@@ -89,7 +89,7 @@ L84 dta d"BIF!"
L85 dta d"BAM!" L85 dta d"BAM!"
L86 dta d"ZONK!" L86 dta d"ZONK!"
L87 dta d"I SHOULD'VE LISTENED TO MY MOTHER..." L87 dta d"I SHOULD'VE LISTENED TO MY MOTHER..."
L88 dta d"NO... A BUD LIGHT!" L88 dta d"I WALK THROUGH THE VALLEY OF THE SHADOW..."
L89 dta d"WHAT WAS THAT NOISE?" L89 dta d"WHAT WAS THAT NOISE?"
L90 dta d"MAMA SAID THERE'D BE DAYS LIKE THIS." L90 dta d"MAMA SAID THERE'D BE DAYS LIKE THIS."
L91 dta d"ITS JUST ONE OF THOSE DAYS..." L91 dta d"ITS JUST ONE OF THOSE DAYS..."
@@ -105,16 +105,16 @@ L100 dta d"IT WASN'T JUST A JOB IT WAS AN ADVENTURE!"
L101 dta d"I DIDN'T LIKE VIOLENCE ANYWAY!" L101 dta d"I DIDN'T LIKE VIOLENCE ANYWAY!"
L102 dta d"I THOUGHT YOU LIKED ME?" L102 dta d"I THOUGHT YOU LIKED ME?"
L103 dta d"CTO XYEB" L103 dta d"CTO XYEB"
L104 ;dta d"I THINK THIS GUY'S A LITTLE CRAZY." L104 dta d"I THINK THIS GUY'S A LITTLE CRAZY."
L105 ;dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE." L105 dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE."
L106 ;dta d"HEY! KILLIN' AIN'T COOL." L106 dta d"HEY! KILLIN' AIN'T COOL."
L107 ;dta d"GEE... THANKS." L107 dta d"GEE... THANKS."
L108 ;dta d"I'VE FALLEN AND I CAN'T GET UP!" L108 dta d"I'VE FALLEN AND I CAN'T GET UP!"
L109 ;dta d"911?" L109 dta d"911?"
L110 ;dta d"OH NO! HERE I BLOW AGAIN!" L110 dta d"OH NO! HERE I BLOW AGAIN!"
L111 ;dta d"I'LL BE BACK..." L111 dta d"I'LL BE BACK..."
L112 ;dta d"HEY - I'VE GOT LAWYERS." L112 dta d"HEY - I'VE GOT LAWYERS."
L113 ;dta d"TIME TO CALL 1-900-SUE-TANK." L113 dta d"TIME TO CALL 1-900-SUE-TANK."
LEND LEND
OffensiveTextTableL OffensiveTextTableL
dta <L0,<L1,<L2,<L3,<L4,<L5,<L6,<L7,<L8,<L9,<L10,<L11,<L12,<L13,<L14,<L15,<L16,<L17,<L18,<L19,<L20,<L21,<L22,<L23,<L24,<L25,<L26,<L27,<L28,<L29,<L30,<L31,<L32,<L33,<L34,<L35,<L36,<L37,<L38,<L39,<L40,<L41,<L42,<L43,<L44,<L45,<L46,<L47,<L48,<L49,<L50,<L51,<L52 dta <L0,<L1,<L2,<L3,<L4,<L5,<L6,<L7,<L8,<L9,<L10,<L11,<L12,<L13,<L14,<L15,<L16,<L17,<L18,<L19,<L20,<L21,<L22,<L23,<L24,<L25,<L26,<L27,<L28,<L29,<L30,<L31,<L32,<L33,<L34,<L35,<L36,<L37,<L38,<L39,<L40,<L41,<L42,<L43,<L44,<L45,<L46,<L47,<L48,<L49,<L50,<L51,<L52
+9 -29
View File
@@ -18,27 +18,7 @@ initialvaluesCount = *-initialvaluesstart ; MAX 128 bytes !
;=================================================================================== ;===================================================================================
;==========================CONSTANT TABLES, do not erase!=========================== ;==========================CONSTANT TABLES, do not erase!===========================
;=================================================================================== ;===================================================================================
TankColoursTable .BYTE $58,$2a,$96,$ca,$7a,$ed
;TankStatusColoursTable .BYTE $54,$24,$92,$c4,$74,$e4 ; standard order
;TanksPMOrder .BYTE 4,3,1,5,0,2 ; 0-3 = P0-P3 , 4 = M0+M1 , 5 = M2+M3
TankStatusColoursTable .BYTE $74,$c4,$24,$e4,$54,$94 ; Adam's order
TanksPMOrder .BYTE 4,3,1,5,0,2 ; 0-3 = P0-P3 , 4 = M0+M1 , 5 = M2+M3
TankShapesTable .BYTE char_tank1___________,char_tank2___________,char_tank3___________
.BYTE char_tank1___________,char_tank2___________,char_tank3___________
dliColorsBack
:10 .by $02,$00
dliColorsFore
.by $0a
CashOptionL ;(one zero less than on the screen)
.by 0,<200,<800,<1200,<2000
CashOptionH
.by 0,>200,>800,>1200,>2000
GravityTable .by 10,20,25,30,40
MaxWindTable .by 5,20,40,70,99
RoundsTable .by 10,20,30,40,50
AIForceTable .wo 375,470,630,720,820 ; starting shoot forces for different gravity
flyDelayTable .by 255,150,75,35,1
seppukuTable .by 255, 45,25,15,9
mountainsDeltaTableH .by 0,1,3,5,7 mountainsDeltaTableH .by 0,1,3,5,7
mountainsDeltaTableL .by $1f, $7f, $ff, $7f, $ff mountainsDeltaTableL .by $1f, $7f, $ff, $7f, $ff
;------------------------------------------------ ;------------------------------------------------
@@ -62,22 +42,22 @@ XtankOffsetGO_H
.by 0,0,0,0,0,1 .by 0,0,0,0,0,1
;-----4x4 texts----- ;-----4x4 texts-----
LineTop LineTop
dta d"(%%%%%%%%%%%%)", $ff dta d"(%%%%%%%%%%%%)"
;# - vertical, () * +, % - horizontal ;# - vertical, () * +, % - horizontal
LineBottom LineBottom
dta d"*%%%%%%%%%%%%+", $ff dta d"*%%%%%%%%%%%%+"
LineEmpty LineEmpty
dta d"# #", $ff dta d"# #"
LineHeader2 LineHeader2
dta d"# RESULTS #", $ff dta d"# RESULTS #"
LineGameOver LineGameOver
dta d"# GAME OVER #", $ff dta d"# GAME OVER #"
seppukuText seppukuText
dta d"# SEPPUKU! #", $ff dta d"# SEPPUKU! #"
areYouSureText areYouSureText
dta d"# SURE? Y/N #", $ff dta d"# SURE? Y/N #"
lineClear lineClear
dta d" ", $ff dta d" "
;----------- ;-----------
pmtableL ; addressess of the P/M memory for 6 tanks pmtableL ; addressess of the P/M memory for 6 tanks
+6 -2
View File
@@ -129,7 +129,7 @@ FirstZpageVariable = $60
;* RMT ZeroPage addresses in artwork/sfx/rmtplayr.a65 ;* RMT ZeroPage addresses in artwork/sfx/rmtplayr.a65
displayposition = modify displayposition = modify
LineAddress4x4 = temp LineAddress4x4 = xcircle
;----------------------------------------------- ;-----------------------------------------------
; libraries ; libraries
@@ -1961,7 +1961,7 @@ TankFont
font4x4 font4x4
ins 'artwork/font4x4s.bmp',+62 ins 'artwork/font4x4s.bmp',+62
;---------------------------------------------- ;----------------------------------------------
;RMT PLAYER and song loading shenaningans ;RMT PLAYER loading shenaningans
icl 'artwork/sfx/rmtplayr_modified.asm' icl 'artwork/sfx/rmtplayr_modified.asm'
;------------------------------------------------- ;-------------------------------------------------
.proc CheckTankCheat .proc CheckTankCheat
@@ -2038,6 +2038,10 @@ MODUL
ins "artwork/sfx/scorch_str9-NTSC.rmt",+6 ;include music RMT module ins "artwork/sfx/scorch_str9-NTSC.rmt",+6 ;include music RMT module
MODULEND MODULEND
;---------------------------------------------- ;----------------------------------------------
icl 'constants_top.asm'
;----------------------------------------------
.ECHO "Bytes on top left: ",$bfe8-* ;ROM_SETTINGS-*
.IF target = 5200 .IF target = 5200
.IF * > ROM_SETTINGS-1 .IF * > ROM_SETTINGS-1
.ERROR 'Code and RMT song too long to fit in 5200' .ERROR 'Code and RMT song too long to fit in 5200'
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+22 -53
View File
@@ -1507,7 +1507,7 @@ displayloop
cpx #0 cpx #0
bne noleading0 bne noleading0
cpy #4 cpy #4
beq noleading0 ; if 00000 - last 0 must be beq noleading0 ; if 00000 - last 0 must stay
cmp zero cmp zero
bne noleading0 bne noleading0
lda #space lda #space
@@ -1579,7 +1579,7 @@ displayloop1
;parameters are: ;parameters are:
;Y - number of tank above which text is displayed ;Y - number of tank above which text is displayed
;fx - length of text ;fx - length of text
;textAddress - address of the text ;LineAddress4x4 - address of the text
;lets calculate position of the text first! ;lets calculate position of the text first!
;that's easy because we have number of tank ;that's easy because we have number of tank
@@ -1651,7 +1651,7 @@ DOTNnotLessThanZero
DOTNnoOverflow DOTNnoOverflow
;here in temp we have really good x position of text ;here in temp we have really good x position of text
mwa temp TextPositionX mwa temp LineXdraw
;now let's get y position ;now let's get y position
;we will try to put text as low as possible ;we will try to put text as low as possible
@@ -1681,58 +1681,29 @@ DOTOldLowestValue
cpy #$ff cpy #$ff
bne DOTLowestMountainValueLoop bne DOTLowestMountainValueLoop
sec sec
lda temp2 lda temp2
sbc #(4+9) ;9 pixels above ground (and tanks...) sbc #(4+9) ;9 pixels above ground (and tanks...)
sta TextPositionY sta LineYdraw
mva #0 TextCounter jmp TypeLine4x4.noLengthNoColor ; rts
mwa TextAddress temp
DOTNcharloop
ldy TextCounter
lda (temp),y
and #$3f ;always CAPITAL letters
sta CharCode4x4
lda TextCounter
asl
asl
clc
adc TextPositionX
sta dx
lda #0
adc TextPositionX+1
sta dx+1
lda TextPositionY
sta dy
mva #0 dy+1 ; dy is 2 bytes value
jsr PutChar4x4
inc TextCounter
lda fx
cmp TextCounter
bne DOTNcharloop
rts
.endp .endp
;-------------------------------------------------------- ;--------------------------------------------------------
.proc DisplayOffensiveTextNr ; .proc DisplayOffensiveTextNr ;
ldx TextNumberOff ldx TextNumberOff
lda talk.OffensiveTextTableL,x lda talk.OffensiveTextTableL,x
sta TextAddress sta LineAddress4x4
lda talk.OffensiveTextTableH,x lda talk.OffensiveTextTableH,x
sta TextAddress+1 sta LineAddress4x4+1
inx ; the next text inx ; the next text
lda talk.OffensiveTextTableH,x lda talk.OffensiveTextTableH,x
sta temp+1 sta temp+1
lda talk.OffensiveTextTableL,x lda talk.OffensiveTextTableL,x
sta temp ; opty possible sta temp ; opty possible
; substract address of the next text from previous to get text length ; substract address of the next text from previous to get text length
sbw temp TextAddress temp2 sbw temp LineAddress4x4 temp2
mva temp2 fx mva temp2 fx
jsr Display4x4AboveTank jsr Display4x4AboveTank
@@ -1749,7 +1720,7 @@ DOTNcharloop
lda #0 lda #0
adc #>Tanksnames adc #>Tanksnames
sta temp+1 ; TextAddress+1 sta temp+1 ; TextAddress+1
mwa temp TextAddress mwa temp LineAddress4x4
;find length of the tank's name ;find length of the tank's name
ldy #7 ldy #7
@@ -1770,15 +1741,19 @@ end_found
;------------------------------- ;-------------------------------
.proc TypeLine4x4 ; .proc TypeLine4x4 ;
;------------------------------- ;-------------------------------
;this routine prints line ending with $ff ;this routine prints line of length `fx`
;address in LineAddress4x4 (it is the same as `temp`) ;address in LineAddress4x4
;starting from LineXdraw, LineYdraw ;starting from LineXdraw, LineYdraw
lda #$ff lda #14 ; default length of 4x4 texts
sta fx
variableLength
lda #$ff ; $ff - visible characters, $00 - clearing
staplot4x4color staplot4x4color
sta plot4x4color sta plot4x4color
noLengthNoColor
ldy #0 ldy #0
sty LineCharNr sty LineCharNr
@@ -1786,19 +1761,17 @@ staplot4x4color
TypeLine4x4Loop TypeLine4x4Loop
ldy LineCharNr ldy LineCharNr
;mwa LineAddress4x4 temp ; LineAddress4x4 === temp lda (LineAddress4x4),y
lda (temp),y and #$3f ;always CAPITAL letters
cmp #$ff
beq EndOfTypeLine4x4
sta CharCode4x4 sta CharCode4x4
mwa LineXdraw dx mwa LineXdraw dx
mva LineYdraw dy mva LineYdraw dy
mva #0 dy+1 ; dy is 2 bytes value mva #0 dy+1 ; dy is 2 bytes value
jsr PutChar4x4 ;type empty pixels as well! jsr PutChar4x4 ;type empty pixels as well!
adw LineXdraw #4 adw LineXdraw #4
inc LineCharNr inc:lda LineCharNr
jmp TypeLine4x4Loop cmp fx
bne TypeLine4x4Loop
EndOfTypeLine4x4 EndOfTypeLine4x4
rts rts
@@ -2023,10 +1996,6 @@ TankNameCopyLoop
;it means | ;it means |
mva #$3 ResultLineBuffer+13 mva #$3 ResultLineBuffer+13
;it means end of line
mva #$ff ResultLineBuffer+14
;result line display ;result line display
mwa #ResultLineBuffer LineAddress4x4 mwa #ResultLineBuffer LineAddress4x4
mwa #((ScreenWidth/2)-(8*4)) LineXdraw mwa #((ScreenWidth/2)-(8*4)) LineXdraw
+2 -17
View File
@@ -39,10 +39,10 @@ mountainDeltaL .ds 1 ;.by $ff
LineHeader1 LineHeader1
.ds 9 ;dta d"# ROUND: " .ds 9 ;dta d"# ROUND: "
RoundNrDisplay RoundNrDisplay
.ds 7 ;dta d" #", $ff .ds 5 ;dta d" #", $ff
; 4x4 text buffer ; 4x4 text buffer
ResultLineBuffer ResultLineBuffer
.ds 19 ;dta d" ", $ff .ds 14 ;dta d" ", $ff
linetableL ; = PMGraph + $0300 - (screenHeight+1)*2 linetableL ; = PMGraph + $0300 - (screenHeight+1)*2
.ds (screenHeight+1) .ds (screenHeight+1)
linetableH ; = PMGraph + $0300 - (screenHeight+1) linetableH ; = PMGraph + $0300 - (screenHeight+1)
@@ -363,10 +363,6 @@ mountaintable2 ;table of mountains (size=screenwidth)
.DS 1 ; additional byte for fallout (sometimes 1 pixel) .DS 1 ; additional byte for fallout (sometimes 1 pixel)
MountaintableEnd ;good for table clearing MountaintableEnd ;good for table clearing
;---------------------------------------------------- ;----------------------------------------------------
TextPositionX .DS 2
TextPositionY .DS 1
TextAddress .DS 2
TextCounter .DS 1
TextNumberOff .DS 1 TextNumberOff .DS 1
;-------------- ;--------------
TankTempY TankTempY
@@ -383,10 +379,6 @@ CurrentResult
;-------------- ;--------------
AngleTable ;Angle of the barrel of each tank during the round AngleTable ;Angle of the barrel of each tank during the round
.DS MaxPlayers .DS MaxPlayers
;NewAngle ; used in AI
.DS 1
;previousBarrelAngle
; .DS MaxPlayers
EndOfTheBarrelX EndOfTheBarrelX
.ds 2 .ds 2
EndOfTheBarrelY EndOfTheBarrelY
@@ -416,19 +408,12 @@ LineCharNr .DS 1
;LineYdraw .DS 1 ;LineYdraw .DS 1
;----------- ;-----------
ResultX
.DS 2
;ResultY .DS 1
ResultOfTankNr ResultOfTankNr
.DS 1 .DS 1
;---------------------------------------------------- ;----------------------------------------------------
;PutChar4x4 ;PutChar4x4
;---------------------------------------------------- ;----------------------------------------------------
LoopCounter4x4 .DS 1
y4x4 .DS 1
StoreA4x4 .DS 1
Xcounter4x4 .DS 1
nibbler4x4 .DS 1 nibbler4x4 .DS 1
CharCode4x4 .DS 1 CharCode4x4 .DS 1
;plot4x4color .DS 1 ;1-white, 0-background ;plot4x4color .DS 1 ;1-white, 0-background
+8 -4
View File
@@ -2531,11 +2531,13 @@ StoreMaxAlt
mwa #hoverFull LineAddress4x4 mwa #hoverFull LineAddress4x4
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
mva #hoverFullEnd-hoverFull-1 fx ; length
sec sec
lda FloatingAlt lda FloatingAlt
sbc #12 sbc #12
sta LineYdraw sta LineYdraw
jsr TypeLine4x4 jsr TypeLine4x4.variableLength
ldx TankNr ldx TankNr
; TankNr in X reg. ; TankNr in X reg.
@@ -2578,6 +2580,7 @@ ReachSky
; display text 4x4 - fuel full (clear text) ; display text 4x4 - fuel full (clear text)
mwa #hoverFull LineAddress4x4 mwa #hoverFull LineAddress4x4
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
mva #(hoverFullEnd-hoverFull-1) fx ; length
sec sec
lda FloatingAlt lda FloatingAlt
sbc #12 sbc #12
@@ -2622,14 +2625,14 @@ KeyboardAndJoyCheck
; display text 4x4 - low fuel ; display text 4x4 - low fuel
mwa #hoverEmpty LineAddress4x4 mwa #hoverEmpty LineAddress4x4
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
mva #hoverEmptyEnd-hoverEmpty-1 fx ; length
sec sec
lda FloatingAlt lda FloatingAlt
sbc #12 sbc #12
sta LineYdraw sta LineYdraw
;lda #0 jsr TypeLine4x4.variableLength
jsr TypeLine4x4 ;.staplot4x4color
ldx TankNr
ldx TankNr
notpressed notpressed
; let's animate "engine" ; let's animate "engine"
@@ -2741,6 +2744,7 @@ pressedSpace
; display text 4x4 - low fuel (clear text) ; display text 4x4 - low fuel (clear text)
mwa #hoverEmpty LineAddress4x4 mwa #hoverEmpty LineAddress4x4
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
mva #hoverEmptyEnd-hoverEmpty-1 fx ; length
sec sec
lda FloatingAlt lda FloatingAlt
sbc #12 sbc #12