mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-20 22:34:21 +02:00
text4x4 optimised
This commit is contained in:
+12
-12
@@ -78,7 +78,7 @@ L73 dta d"OH MAN!"
|
||||
L74 dta d"DOOUGH!"
|
||||
L75 dta d"ANOTHER DAY, ANOTHER BOMB."
|
||||
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."
|
||||
L79 dta d"WHY DOES EVERYTHING HAPPEN TO ME?"
|
||||
L80 dta d"I'M GOING DOWN."
|
||||
@@ -89,7 +89,7 @@ L84 dta d"BIF!"
|
||||
L85 dta d"BAM!"
|
||||
L86 dta d"ZONK!"
|
||||
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?"
|
||||
L90 dta d"MAMA SAID THERE'D BE DAYS LIKE THIS."
|
||||
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!"
|
||||
L102 dta d"I THOUGHT YOU LIKED ME?"
|
||||
L103 dta d"CTO XYEB"
|
||||
L104 ;dta d"I THINK THIS GUY'S A LITTLE CRAZY."
|
||||
L105 ;dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE."
|
||||
L106 ;dta d"HEY! KILLIN' AIN'T COOL."
|
||||
L107 ;dta d"GEE... THANKS."
|
||||
L108 ;dta d"I'VE FALLEN AND I CAN'T GET UP!"
|
||||
L109 ;dta d"911?"
|
||||
L110 ;dta d"OH NO! HERE I BLOW AGAIN!"
|
||||
L111 ;dta d"I'LL BE BACK..."
|
||||
L112 ;dta d"HEY - I'VE GOT LAWYERS."
|
||||
L113 ;dta d"TIME TO CALL 1-900-SUE-TANK."
|
||||
L104 dta d"I THINK THIS GUY'S A LITTLE CRAZY."
|
||||
L105 dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE."
|
||||
L106 dta d"HEY! KILLIN' AIN'T COOL."
|
||||
L107 dta d"GEE... THANKS."
|
||||
L108 dta d"I'VE FALLEN AND I CAN'T GET UP!"
|
||||
L109 dta d"911?"
|
||||
L110 dta d"OH NO! HERE I BLOW AGAIN!"
|
||||
L111 dta d"I'LL BE BACK..."
|
||||
L112 dta d"HEY - I'VE GOT LAWYERS."
|
||||
L113 dta d"TIME TO CALL 1-900-SUE-TANK."
|
||||
LEND
|
||||
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
|
||||
|
||||
+9
-29
@@ -18,27 +18,7 @@ initialvaluesCount = *-initialvaluesstart ; MAX 128 bytes !
|
||||
;===================================================================================
|
||||
;==========================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
|
||||
mountainsDeltaTableL .by $1f, $7f, $ff, $7f, $ff
|
||||
;------------------------------------------------
|
||||
@@ -62,22 +42,22 @@ XtankOffsetGO_H
|
||||
.by 0,0,0,0,0,1
|
||||
;-----4x4 texts-----
|
||||
LineTop
|
||||
dta d"(%%%%%%%%%%%%)", $ff
|
||||
dta d"(%%%%%%%%%%%%)"
|
||||
;# - vertical, () * +, % - horizontal
|
||||
LineBottom
|
||||
dta d"*%%%%%%%%%%%%+", $ff
|
||||
dta d"*%%%%%%%%%%%%+"
|
||||
LineEmpty
|
||||
dta d"# #", $ff
|
||||
dta d"# #"
|
||||
LineHeader2
|
||||
dta d"# RESULTS #", $ff
|
||||
dta d"# RESULTS #"
|
||||
LineGameOver
|
||||
dta d"# GAME OVER #", $ff
|
||||
dta d"# GAME OVER #"
|
||||
seppukuText
|
||||
dta d"# SEPPUKU! #", $ff
|
||||
dta d"# SEPPUKU! #"
|
||||
areYouSureText
|
||||
dta d"# SURE? Y/N #", $ff
|
||||
dta d"# SURE? Y/N #"
|
||||
lineClear
|
||||
dta d" ", $ff
|
||||
dta d" "
|
||||
|
||||
;-----------
|
||||
pmtableL ; addressess of the P/M memory for 6 tanks
|
||||
|
||||
+6
-2
@@ -129,7 +129,7 @@ FirstZpageVariable = $60
|
||||
;* RMT ZeroPage addresses in artwork/sfx/rmtplayr.a65
|
||||
|
||||
displayposition = modify
|
||||
LineAddress4x4 = temp
|
||||
LineAddress4x4 = xcircle
|
||||
|
||||
;-----------------------------------------------
|
||||
; libraries
|
||||
@@ -1961,7 +1961,7 @@ TankFont
|
||||
font4x4
|
||||
ins 'artwork/font4x4s.bmp',+62
|
||||
;----------------------------------------------
|
||||
;RMT PLAYER and song loading shenaningans
|
||||
;RMT PLAYER loading shenaningans
|
||||
icl 'artwork/sfx/rmtplayr_modified.asm'
|
||||
;-------------------------------------------------
|
||||
.proc CheckTankCheat
|
||||
@@ -2038,6 +2038,10 @@ MODUL
|
||||
ins "artwork/sfx/scorch_str9-NTSC.rmt",+6 ;include music RMT module
|
||||
MODULEND
|
||||
;----------------------------------------------
|
||||
icl 'constants_top.asm'
|
||||
;----------------------------------------------
|
||||
|
||||
.ECHO "Bytes on top left: ",$bfe8-* ;ROM_SETTINGS-*
|
||||
.IF target = 5200
|
||||
.IF * > ROM_SETTINGS-1
|
||||
.ERROR 'Code and RMT song too long to fit in 5200'
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+22
-53
@@ -1507,7 +1507,7 @@ displayloop
|
||||
cpx #0
|
||||
bne noleading0
|
||||
cpy #4
|
||||
beq noleading0 ; if 00000 - last 0 must be
|
||||
beq noleading0 ; if 00000 - last 0 must stay
|
||||
cmp zero
|
||||
bne noleading0
|
||||
lda #space
|
||||
@@ -1579,7 +1579,7 @@ displayloop1
|
||||
;parameters are:
|
||||
;Y - number of tank above which text is displayed
|
||||
;fx - length of text
|
||||
;textAddress - address of the text
|
||||
;LineAddress4x4 - address of the text
|
||||
|
||||
;lets calculate position of the text first!
|
||||
;that's easy because we have number of tank
|
||||
@@ -1651,7 +1651,7 @@ DOTNnotLessThanZero
|
||||
DOTNnoOverflow
|
||||
;here in temp we have really good x position of text
|
||||
|
||||
mwa temp TextPositionX
|
||||
mwa temp LineXdraw
|
||||
|
||||
;now let's get y position
|
||||
;we will try to put text as low as possible
|
||||
@@ -1681,58 +1681,29 @@ DOTOldLowestValue
|
||||
cpy #$ff
|
||||
bne DOTLowestMountainValueLoop
|
||||
|
||||
|
||||
|
||||
sec
|
||||
lda temp2
|
||||
sbc #(4+9) ;9 pixels above ground (and tanks...)
|
||||
sta TextPositionY
|
||||
sta LineYdraw
|
||||
|
||||
mva #0 TextCounter
|
||||
mwa TextAddress temp
|
||||
DOTNcharloop
|
||||
ldy TextCounter
|
||||
jmp TypeLine4x4.noLengthNoColor ; rts
|
||||
|
||||
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
|
||||
|
||||
;--------------------------------------------------------
|
||||
.proc DisplayOffensiveTextNr ;
|
||||
ldx TextNumberOff
|
||||
lda talk.OffensiveTextTableL,x
|
||||
sta TextAddress
|
||||
sta LineAddress4x4
|
||||
lda talk.OffensiveTextTableH,x
|
||||
sta TextAddress+1
|
||||
sta LineAddress4x4+1
|
||||
inx ; the next text
|
||||
lda talk.OffensiveTextTableH,x
|
||||
sta temp+1
|
||||
lda talk.OffensiveTextTableL,x
|
||||
sta temp ; opty possible
|
||||
; substract address of the next text from previous to get text length
|
||||
sbw temp TextAddress temp2
|
||||
sbw temp LineAddress4x4 temp2
|
||||
mva temp2 fx
|
||||
|
||||
jsr Display4x4AboveTank
|
||||
@@ -1749,7 +1720,7 @@ DOTNcharloop
|
||||
lda #0
|
||||
adc #>Tanksnames
|
||||
sta temp+1 ; TextAddress+1
|
||||
mwa temp TextAddress
|
||||
mwa temp LineAddress4x4
|
||||
|
||||
;find length of the tank's name
|
||||
ldy #7
|
||||
@@ -1770,15 +1741,19 @@ end_found
|
||||
;-------------------------------
|
||||
.proc TypeLine4x4 ;
|
||||
;-------------------------------
|
||||
;this routine prints line ending with $ff
|
||||
;address in LineAddress4x4 (it is the same as `temp`)
|
||||
;this routine prints line of length `fx`
|
||||
;address in LineAddress4x4
|
||||
;starting from LineXdraw, LineYdraw
|
||||
|
||||
lda #$ff
|
||||
lda #14 ; default length of 4x4 texts
|
||||
sta fx
|
||||
|
||||
variableLength
|
||||
lda #$ff ; $ff - visible characters, $00 - clearing
|
||||
|
||||
staplot4x4color
|
||||
sta plot4x4color
|
||||
|
||||
noLengthNoColor
|
||||
|
||||
ldy #0
|
||||
sty LineCharNr
|
||||
@@ -1786,19 +1761,17 @@ staplot4x4color
|
||||
TypeLine4x4Loop
|
||||
ldy LineCharNr
|
||||
|
||||
;mwa LineAddress4x4 temp ; LineAddress4x4 === temp
|
||||
lda (temp),y
|
||||
cmp #$ff
|
||||
beq EndOfTypeLine4x4
|
||||
|
||||
lda (LineAddress4x4),y
|
||||
and #$3f ;always CAPITAL letters
|
||||
sta CharCode4x4
|
||||
mwa LineXdraw dx
|
||||
mva LineYdraw dy
|
||||
mva #0 dy+1 ; dy is 2 bytes value
|
||||
jsr PutChar4x4 ;type empty pixels as well!
|
||||
adw LineXdraw #4
|
||||
inc LineCharNr
|
||||
jmp TypeLine4x4Loop
|
||||
inc:lda LineCharNr
|
||||
cmp fx
|
||||
bne TypeLine4x4Loop
|
||||
|
||||
EndOfTypeLine4x4
|
||||
rts
|
||||
@@ -2023,10 +1996,6 @@ TankNameCopyLoop
|
||||
;it means |
|
||||
mva #$3 ResultLineBuffer+13
|
||||
|
||||
|
||||
;it means end of line
|
||||
mva #$ff ResultLineBuffer+14
|
||||
|
||||
;result line display
|
||||
mwa #ResultLineBuffer LineAddress4x4
|
||||
mwa #((ScreenWidth/2)-(8*4)) LineXdraw
|
||||
|
||||
+2
-17
@@ -39,10 +39,10 @@ mountainDeltaL .ds 1 ;.by $ff
|
||||
LineHeader1
|
||||
.ds 9 ;dta d"# ROUND: "
|
||||
RoundNrDisplay
|
||||
.ds 7 ;dta d" #", $ff
|
||||
.ds 5 ;dta d" #", $ff
|
||||
; 4x4 text buffer
|
||||
ResultLineBuffer
|
||||
.ds 19 ;dta d" ", $ff
|
||||
.ds 14 ;dta d" ", $ff
|
||||
linetableL ; = PMGraph + $0300 - (screenHeight+1)*2
|
||||
.ds (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)
|
||||
MountaintableEnd ;good for table clearing
|
||||
;----------------------------------------------------
|
||||
TextPositionX .DS 2
|
||||
TextPositionY .DS 1
|
||||
TextAddress .DS 2
|
||||
TextCounter .DS 1
|
||||
TextNumberOff .DS 1
|
||||
;--------------
|
||||
TankTempY
|
||||
@@ -383,10 +379,6 @@ CurrentResult
|
||||
;--------------
|
||||
AngleTable ;Angle of the barrel of each tank during the round
|
||||
.DS MaxPlayers
|
||||
;NewAngle ; used in AI
|
||||
.DS 1
|
||||
;previousBarrelAngle
|
||||
; .DS MaxPlayers
|
||||
EndOfTheBarrelX
|
||||
.ds 2
|
||||
EndOfTheBarrelY
|
||||
@@ -416,19 +408,12 @@ LineCharNr .DS 1
|
||||
;LineYdraw .DS 1
|
||||
|
||||
;-----------
|
||||
ResultX
|
||||
.DS 2
|
||||
;ResultY .DS 1
|
||||
ResultOfTankNr
|
||||
.DS 1
|
||||
|
||||
;----------------------------------------------------
|
||||
;PutChar4x4
|
||||
;----------------------------------------------------
|
||||
LoopCounter4x4 .DS 1
|
||||
y4x4 .DS 1
|
||||
StoreA4x4 .DS 1
|
||||
Xcounter4x4 .DS 1
|
||||
nibbler4x4 .DS 1
|
||||
CharCode4x4 .DS 1
|
||||
;plot4x4color .DS 1 ;1-white, 0-background
|
||||
|
||||
+8
-4
@@ -2531,11 +2531,13 @@ StoreMaxAlt
|
||||
|
||||
mwa #hoverFull LineAddress4x4
|
||||
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
|
||||
mva #hoverFullEnd-hoverFull-1 fx ; length
|
||||
sec
|
||||
lda FloatingAlt
|
||||
sbc #12
|
||||
sta LineYdraw
|
||||
jsr TypeLine4x4
|
||||
jsr TypeLine4x4.variableLength
|
||||
|
||||
ldx TankNr
|
||||
|
||||
; TankNr in X reg.
|
||||
@@ -2578,6 +2580,7 @@ ReachSky
|
||||
; display text 4x4 - fuel full (clear text)
|
||||
mwa #hoverFull LineAddress4x4
|
||||
mwa #((ScreenWidth/2)-((hoverFullEnd-hoverFull)*2)) LineXdraw ; centering
|
||||
mva #(hoverFullEnd-hoverFull-1) fx ; length
|
||||
sec
|
||||
lda FloatingAlt
|
||||
sbc #12
|
||||
@@ -2622,15 +2625,15 @@ KeyboardAndJoyCheck
|
||||
; display text 4x4 - low fuel
|
||||
mwa #hoverEmpty LineAddress4x4
|
||||
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
|
||||
mva #hoverEmptyEnd-hoverEmpty-1 fx ; length
|
||||
sec
|
||||
lda FloatingAlt
|
||||
sbc #12
|
||||
sta LineYdraw
|
||||
;lda #0
|
||||
jsr TypeLine4x4 ;.staplot4x4color
|
||||
jsr TypeLine4x4.variableLength
|
||||
|
||||
ldx TankNr
|
||||
|
||||
|
||||
notpressed
|
||||
; let's animate "engine"
|
||||
jsr DrawTankEngine
|
||||
@@ -2741,6 +2744,7 @@ pressedSpace
|
||||
; display text 4x4 - low fuel (clear text)
|
||||
mwa #hoverEmpty LineAddress4x4
|
||||
mwa #((ScreenWidth/2)-((hoverEmptyEnd-hoverEmpty)*2)) LineXdraw ; centering
|
||||
mva #hoverEmptyEnd-hoverEmpty-1 fx ; length
|
||||
sec
|
||||
lda FloatingAlt
|
||||
sbc #12
|
||||
|
||||
Reference in New Issue
Block a user