multiple texts improved, tabs elliminated

This commit is contained in:
2023-05-19 23:16:49 -04:00
parent 8486645bc8
commit d0e1dc6f18
23 changed files with 4918 additions and 4928 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ DLPurTitleAddr
.byte $50
.byte $42
.word purchaseTextBuffer
.byte $00+$80
.byte $00+$80
.byte $20+$80,$10+$80,$42
MoreUpdl
.word EmptyLine
+29 -29
View File
@@ -13,7 +13,7 @@ OptionsScreen
.IF TARGET = 800
dta d" Please select option with "
dta $fe,$dc,$dd,$ff ; cursors in inverse
dta $fe,$dc,$dd,$ff ; cursors in inverse
dta d" and "
dta d"Tab"*
dta d" "
@@ -40,7 +40,7 @@ NameScreen5
.IF TARGET = 800
dta d"TAB"*
dta d" - Port nr "
dta $fe,$dc,$dd,$ff ; cursors in inverse
dta $fe,$dc,$dd,$ff ; cursors in inverse
dta d" - Difficulty"
dta d" "
dta d"INV"*
@@ -182,19 +182,19 @@ dl ; MAIN game display list
;-----------------------------------------------
OptionsDL
.byte $70
.byte $47
.word OptionsTitle
.byte $47
.word OptionsTitle
.byte $70,$70
.byte $42
.word OptionsScreen
.byte $30,$02,$02,$70
.byte $42
.word OptionsHere
.byte $10
.byte $42
.word OptionsHere
.byte $10
:maxOptions-1 .by $02,$10
:(9-maxOptions) .by $70,$10
.byte $80
.byte $60 ; to match moved sprites
:(9-maxOptions) .by $70,$10
.byte $80
.byte $60 ; to match moved sprites
.byte $4f
.word (display+140*40)
:21 .by $0f ;76
@@ -204,25 +204,25 @@ OptionsDL
;Enter names of tanks DL
NameDL
.byte $70
.byte $47
.word DifficultyTitle
.byte $70,$70 ; 16 empty lines
.byte $47
.word DifficultyTitle
.byte $70,$70 ; 16 empty lines
.byte $42
.word NameScreen
.byte $30 ; 4 empty lines
.byte $42
.word NameScreen2
.byte $30+$80 ; 4 empty lines + DLI
.byte $42
.word NameScreen3
.byte $10 ; 2 empty lines
.byte $42
.word NameScreen4
.byte $02,$02
.byte $30 ; 4 empty lines
.byte $42
.word NameScreen5
.byte $02
.byte $30 ; 4 empty lines
.byte $42
.word NameScreen2
.byte $30+$80 ; 4 empty lines + DLI
.byte $42
.word NameScreen3
.byte $10 ; 2 empty lines
.byte $42
.word NameScreen4
.byte $02,$02
.byte $30 ; 4 empty lines
.byte $42
.word NameScreen5
.byte $02
.byte $41
.word NameDL
; -------------------------------------------------
@@ -252,8 +252,8 @@ GameOverDL
.byte $42
.word GameOverResults
:5 .byte $00+$80,$02
.byte $01
.word DLCreditsFragm
.byte $01
.word DLCreditsFragm
; ---------------
; end of "constants" (ROM)
;-----------------------------------------------
+175 -175
View File
@@ -41,7 +41,7 @@ MakeUnPlot
;---
tay
ldx WhichUnPlot
tya
tya
sta oldply,x
ldx ydraw
@@ -194,43 +194,43 @@ ClearPlot
;--------------------------------------------------
mwa #0 xdraw
mwa #mountaintable modify
mva #1 color
mva #1 color
drawmountainsloop
ldy #0
lda (modify),y
cmp #screenheight
beq NoMountain
cmp #screenheight
beq NoMountain
sta ydraw
sty ydraw+1
sty ydraw+1
.IF FASTER_GRAF_PROCS = 1
; there was Drawline proc
; there was Drawline proc
lda #screenheight
sec
sbc ydraw
sta tempbyte01
jsr plot.MakePlot
; after plot we have: (xbyte),y - addres of screen byte; X - index in bittable (number of bit)
; after plot we have: (xbyte),y - addres of screen byte; X - index in bittable (number of bit)
; jmp IntoDraw ; jumps inside Draw routine
; because one pixel is already plotted (and who cares? :) )
@
lda (xbyte),y
and bittable2,x
sta (xbyte),y
lda (xbyte),y
and bittable2,x
sta (xbyte),y
;IntoDraw
adw xbyte #screenBytes
dec tempbyte01
bne @-
; end of Drawline proc
adw xbyte #screenBytes
dec tempbyte01
bne @-
; end of Drawline proc
.ELSE
; there was Drawline proc
; there was Drawline proc
drawline
jsr plot.MakePlot
inc ydraw
lda ydraw
cmp #screenheight
bne drawline
; end of Drawline proc
inc ydraw
lda ydraw
cmp #screenheight
bne drawline
; end of Drawline proc
.ENDIF
NoMountain
inw modify
@@ -261,7 +261,7 @@ NoMountain
ldy #7
CopyChar
lda (fontind),y
eor #$ff
eor #$ff
sta char1,y
lda #$ff
sta char2,y
@@ -272,7 +272,7 @@ CopyChar
ldy #7
CopyMask
lda (fontind),y
eor #$ff
eor #$ff
sta mask1,y
lda #$00
sta mask2,y
@@ -312,7 +312,7 @@ MakeMask00
.endr
sec
.rept 8
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char2+#
.endr
dex
@@ -331,12 +331,12 @@ EmptyChar
ldx #0
CharLoopi
lda (xbyte),y
ora mask1,x
ora mask1,x
and char1,x
sta (xbyte),y
iny
lda (xbyte),y
ora mask2,x
ora mask2,x
and char2,x
sta (xbyte),y
dey
@@ -345,42 +345,42 @@ CharLoopi
cpx #8
bne CharLoopi
.ELSE
mvx #7 temp ; line counter (Y)
mvx #7 temp ; line counter (Y)
CharLoop1
mva #7 temp+1 ; pixel counter (X)
mva #7 temp+1 ; pixel counter (X)
CharLoop2
mva #0 color
rol mask1,x
bcc NoMaskNoPlot
rol char1,x
bcs NoPlot
mva #0 color
rol mask1,x
bcc NoMaskNoPlot
rol char1,x
bcs NoPlot
MakeCharPlot
lda Erase
bne ErasingChar
inc color
lda Erase
bne ErasingChar
inc color
ErasingChar
NoPlot
jsr plot.MakePlot
jsr plot.MakePlot
AfterCharPlot
inw xdraw
ldx temp
dec temp+1
bpl CharLoop2
sec
sbw xdraw #8
dec ydraw
ldx temp
dex
stx temp
bpl CharLoop1
clc
lda ydraw
adc #8
sta ydraw
bne EndPutChar
inw xdraw
ldx temp
dec temp+1
bpl CharLoop2
sec
sbw xdraw #8
dec ydraw
ldx temp
dex
stx temp
bpl CharLoop1
clc
lda ydraw
adc #8
sta ydraw
bne EndPutChar
NoMaskNoPlot
rol char1,x
jmp AfterCharPlot
rol char1,x
jmp AfterCharPlot
.ENDIF
EndPutChar
rts
@@ -397,16 +397,16 @@ EndPutChar
;--------------------------------------------------
cpw dy #(screenheight-1)
jcs TypeChar.EndPutChar ;nearest RTS
cpw dy #(4)
jcc TypeChar.EndPutChar ;nearest RTS
cpw dy #(4)
jcc TypeChar.EndPutChar ;nearest RTS
cpw dx #(screenwidth-4)
jcs TypeChar.EndPutChar ;nearest RTS
; checks ommited.
; checks ommited.
; char to the table
lda CharCode4x4
and #%00000001
beq Upper4bits
lda #$ff ; better option to check (nibbler4x4 = $00 or $ff)
beq Upper4bits
lda #$ff ; better option to check (nibbler4x4 = $00 or $ff)
Upper4bits
sta nibbler4x4
lda CharCode4x4
@@ -414,28 +414,28 @@ Upper4bits
sta fontind
lda #$00
sta fontind+1
adw fontind #font4x4
; and 4 bytes to the table
ldy #0
ldy #0
ldx #3
CopyChar
lda (fontind),y ; Y must be 0 !!!!
bit nibbler4x4
bpl GetUpper4bits
:4 rol
lda (fontind),y ; Y must be 0 !!!!
bit nibbler4x4
bpl GetUpper4bits
:4 rol
GetUpper4bits
ora #$0f
ora #$0f
sta char1,x
lda #$ff
sta char2,x
; and 4 bytes as a mask
lda #$f0
lda #$f0
sta mask1,x
lda #$00
sta mask2,x
adw fontind #32 ; next byte of 4x4 font
adw fontind #32 ; next byte of 4x4 font
dex
bpl CopyChar
@@ -451,7 +451,7 @@ GetUpper4bits
; rorw xbyte
; rorw xbyte
;---
ldy xbyte ; horizontal byte offet stored in Y
ldy xbyte ; horizontal byte offet stored in Y
lda dy ; y = y - 3 because left lower.
sec
sbc #3
@@ -471,75 +471,75 @@ MakeMask01
.endr
sec
.rept 4
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char2+#
.endr
dex
bne MakeMask01
MaskOK01
ldx #0
ldx #0
CharLoopi4x4
lda (xbyte),y
ora mask1,x
bit plot4x4color
bpl PutInColor0_1 ; only mask - no char
ora mask1,x
bit plot4x4color
bpl PutInColor0_1 ; only mask - no char
and char1,x
PutInColor0_1
sta (xbyte),y
iny
lda (xbyte),y
ora mask2,x
bit plot4x4color
bpl PutInColor0_2 ; only mask - no char
ora mask2,x
bit plot4x4color
bpl PutInColor0_2 ; only mask - no char
and char2,x
PutInColor0_2
sta (xbyte),y
dey
adw xbyte #screenBytes
inx
cpx #4
cpx #4
bne CharLoopi4x4
.ELSE
mwa xdraw char2
mwa ydraw mask2
mva color mask2+2
mwa dx xdraw
mwa dy ydraw
mvx #3 temp ; line counter (Y)
mwa xdraw char2
mwa ydraw mask2
mva color mask2+2
mwa dx xdraw
mwa dy ydraw
mvx #3 temp ; line counter (Y)
CharLoop1
mva #3 temp+1 ; pixel counter (X)
mva #3 temp+1 ; pixel counter (X)
CharLoop2
mva #0 color
rol mask1,x
bcc NoMaskNoPlot
rol char1,x
bcs NoPlot
mva #0 color
rol mask1,x
bcc NoMaskNoPlot
rol char1,x
bcs NoPlot
MakeCharPlot
lda plot4x4color
beq ErasingChar
inc color
lda plot4x4color
beq ErasingChar
inc color
ErasingChar
NoPlot
jsr plot.MakePlot
jsr plot.MakePlot
AfterCharPlot
inw xdraw
ldx temp
dec temp+1
bpl CharLoop2
sec
sbw xdraw #4
dec ydraw
ldx temp
dex
stx temp
bpl CharLoop1
mwa char2 xdraw
mwa mask2 ydraw
mva mask2+2 color
bpl EndPut4x4
inw xdraw
ldx temp
dec temp+1
bpl CharLoop2
sec
sbw xdraw #4
dec ydraw
ldx temp
dex
stx temp
bpl CharLoop1
mwa char2 xdraw
mwa mask2 ydraw
mva mask2+2 color
bpl EndPut4x4
NoMaskNoPlot
rol char1,x
jmp AfterCharPlot
rol char1,x
jmp AfterCharPlot
.ENDIF
EndPut4x4
rts
@@ -573,7 +573,7 @@ EndPut4x4
iny
cpy #screenheight+1
bne @-
rts
rts
.endp
;--------------------------------------------------
.proc SetMainScreen
@@ -584,7 +584,7 @@ EndPut4x4
; and #$fc
; ora #$02 ; 2=normal, 3 = wide screen width
sta dmactls
mva WallsType COLBAKS ; set color of background
mva WallsType COLBAKS ; set color of background
jsr WaitOneFrame
rts
.endp
@@ -601,79 +601,79 @@ EndPut4x4
; -------------------------------------------------
mva #sfx_sandhog sfx_effect
.IF FASTER_GRAF_PROCS = 1
ldy #0 ; byte counter (from 0 to 39)
ldy #0 ; byte counter (from 0 to 39)
NextColumn
; big loop - we repat internal loops for each column of bytes
sty magic
ldx #120 ; line counter (from 0 to 60 )
; first loop - inverse column of bytes for a while
ldy magic
; big loop - we repat internal loops for each column of bytes
sty magic
ldx #120 ; line counter (from 0 to 60 )
; first loop - inverse column of bytes for a while
ldy magic
NextLine1
jsr InverseScreenByte
dex
dex
bpl NextLine1
;
jsr WaitOneFrame ; wait uses A only
; second loop - inverse again and put random "snow" to column of bytes
ldx #120
ldy magic
mva #$55 magic+1
jsr InverseScreenByte
dex
dex
bpl NextLine1
;
jsr WaitOneFrame ; wait uses A only
; second loop - inverse again and put random "snow" to column of bytes
ldx #120
ldy magic
mva #$55 magic+1
NextLine2
jsr InverseScreenByte
lda random
ora magic+1
and (temp),y
sta (temp),y
lda magic+1
eor #$ff
sta magic+1
dex
dex
bpl NextLine2
; and go to next column
iny
cpy #40
bne NextColumn
jsr InverseScreenByte
lda random
ora magic+1
and (temp),y
sta (temp),y
lda magic+1
eor #$ff
sta magic+1
dex
dex
bpl NextLine2
; and go to next column
iny
cpy #40
bne NextColumn
.ELSE
mva #1 color
mwa #120 ydraw
mva #1 color
mwa #120 ydraw
NextLineSlow
lda #0
sta xdraw
sta xdraw+1
lda #0
sta xdraw
sta xdraw+1
NextPixelSlow
bit random
bpl NoPlot
bvc NoPlot
jsr plot.MakePlot
bit random
bpl NoPlot
bvc NoPlot
jsr plot.MakePlot
NoPlot
inw xdraw
cpw xdraw #screenwidth
bne NextPixelSlow
dec ydraw
dec ydraw
bpl NextLineSlow
inw xdraw
cpw xdraw #screenwidth
bne NextPixelSlow
dec ydraw
dec ydraw
bpl NextLineSlow
.ENDIF
; and we have "snow" :)
lda #0
ldx TankNr
sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter
jsr SetFullScreenSoilRange
; and we have "snow" :)
lda #0
ldx TankNr
sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter
jsr SetFullScreenSoilRange
jsr SoilDown2.NoClearTanks
rts
rts
; in order to optimize the fragment repeated in both internal loops
; we save 15 bytes :)
; in order to optimize the fragment repeated in both internal loops
; we save 15 bytes :)
InverseScreenByte
lda LineTableL,x
sta temp
lda LineTableH,x
sta temp+1
lda (temp),y
eor #$ff
sta (temp),y
rts
lda LineTableL,x
sta temp
lda LineTableH,x
sta temp+1
lda (temp),y
eor #$ff
sta (temp),y
rts
.endp
.ENDIF
+139 -139
View File
@@ -1,114 +1,114 @@
; @com.wudsn.ide.asm.mainsourcefile=scorch.asm
; @com.wudsn.ide.asm.mainsourcefile=scorch.asm
.IF *>0 ;this is a trick that prevents compiling this file alone
;--------------------------------------------------
.proc DLIinterruptGraph
pha
phy
ldy dliCounter
lda dliColorsBack,y
pha
phy
ldy dliCounter
lda dliColorsBack,y
.IF TARGET = 800
nop ; necessary on 800 because DLIs take less time, jitter visible without it
nop
nop
nop ; necessary on 800 because DLIs take less time, jitter visible without it
nop
nop
.ENDIF
nop
nop
nop
nop
sta COLPF1
lda GradientNr
bne GoGradient
ldy #$ff ; one mauntain color
lda GradientNr
bne GoGradient
ldy #$ff ; one mauntain color
GoGradient
iny
lda (GradientColors),y ; mountains colors array
sta COLPF2
inc dliCounter
iny
lda (GradientColors),y ; mountains colors array
sta COLPF2
inc dliCounter
ply
pla
rti
.endp
;--------------------------------------------------
.proc DLIinterruptOptions
pha
phy
lda #0 ; background color
pha
phy
lda #0 ; background color
sta COLPF1
ldy GradientNr
beq @+
ldy #1
@ lda (GradientColors),y ; mountains colors array
sta COLPF2
ply
ldy GradientNr
beq @+
ldy #1
@ lda (GradientColors),y ; mountains colors array
sta COLPF2
ply
pla
rti
.endp
;--------------------------------------------------
.proc DLIinterruptGameOver
pha
phy
lda dliCounter
bne EndofPMG
lda #%00100001 ; playfield after P/M - prior=1
;STA WSYNC
pha
phy
lda dliCounter
bne EndofPMG
lda #%00100001 ; playfield after P/M - prior=1
;STA WSYNC
sta PRIOR
bne EndOfDLI_GO
bne EndOfDLI_GO
EndofPMG
cmp #1
bne ColoredLines
lda #%00100100 ; playfield before P/M
;STA WSYNC
cmp #1
bne ColoredLines
lda #%00100100 ; playfield before P/M
;STA WSYNC
sta PRIOR
bne EndOfDLI_GO
bne EndOfDLI_GO
ColoredLines
cmp #9
beq CreditsScroll
tay
lda GameOverColoursTable-3,y ; -2 because this is DLI nr 2 and -1 (labels line)
ldy #$0a ; text colour (brightnes)
;STA WSYNC
sta COLPF2
sty COLPF1
bne EndOfDLI_GO
cmp #9
beq CreditsScroll
tay
lda GameOverColoursTable-3,y ; -2 because 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
lda #$00
sta COLPF2
EndOfDLI_GO
inc dliCounter
ply
pla
rti
inc dliCounter
ply
pla
rti
.endp
;--------------------------------------------------
.proc DLIinterruptText
pha
lda dliCounter
bne MoreBarsColorChange
lda dliCounter
bne MoreBarsColorChange
lda #TextBackgroundColor
;sta WSYNC
;sta WSYNC
sta COLPF2
mva #TextForegroundColor COLPF3
bne EndOfDLI_Text
bne EndOfDLI_Text
MoreBarsColorChange
and #%00000001
rol
sta COLPF2
and #%00000001
rol
sta COLPF2
EndOfDLI_Text
inc dliCounter
inc dliCounter
pla
DLIinterruptNone
rti
rti
.endp
;--------------------------------------------------
.proc VBLinterrupt
mva #0 dliCounter
mva #$02 DliColorBack
lda PAL
and #%00001110
beq itsPAL
;it is NTSC here
mva #0 dliCounter
mva #$02 DliColorBack
lda PAL
and #%00001110
beq itsPAL
;it is NTSC here
dec NTSCcounter
bne itsPAL
mva #6 NTSCcounter
@@ -118,13 +118,13 @@ DLIinterruptNone
itsPAL
; pressTimer is trigger tick counter. always 50 ticks / s
bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s
SkippedIfNTSC
bit RMT_blocked
bmi SkipRMTVBL
bit RMT_blocked
bmi SkipRMTVBL
; ------- RMT -------
lda sfx_effect
lda sfx_effect
bmi lab2
asl @ ; * 2
tay ;Y = 2,4,..,16 instrument number * 2 (0,2,4,..,126)
@@ -138,53 +138,53 @@ SkippedIfNTSC
lab2
jsr RASTERMUSICTRACKER+3 ;1 play
; ------- RMT -------
SkipRMTVBL
bit ScrollFlag
bpl EndOfCreditsVBI
SkipRMTVBL
bit ScrollFlag
bpl EndOfCreditsVBI
CreditsVBI
inc CreditsVScrol
lda CreditsVScrol
cmp #32 ;not too fast
beq nextlinedisplay
:2 lsr ;not too fast
sta VSCROL
jmp EndOfCreditsVBI
inc CreditsVScrol
lda CreditsVScrol
cmp #32 ;not too fast
beq nextlinedisplay
:2 lsr ;not too fast
sta VSCROL
jmp EndOfCreditsVBI
nextlinedisplay
lda #0
sta CreditsVScrol
sta VSCROL
clc
lda DLCreditsAddr
adc #40
sta DLCreditsAddr
bcc @+
inc DLCreditsAddr+1
lda #0
sta CreditsVScrol
sta VSCROL
clc
lda DLCreditsAddr
adc #40
sta DLCreditsAddr
bcc @+
inc DLCreditsAddr+1
@
cmp #<CreditsLastLine
bne EndOfCreditsVBI
lda DLCreditsAddr+1
cmp #>CreditsLastLine
bne EndOfCreditsVBI
; adw DLCreditsAddr #40
; cpw DLCreditsAddr #CreditsLastLine
; bne EndOfCreditsVBI
mwa #Credits DLCreditsAddr
cmp #<CreditsLastLine
bne EndOfCreditsVBI
lda DLCreditsAddr+1
cmp #>CreditsLastLine
bne EndOfCreditsVBI
; adw DLCreditsAddr #40
; cpw DLCreditsAddr #CreditsLastLine
; bne EndOfCreditsVBI
mwa #Credits DLCreditsAddr
EndOfCreditsVBI
.IF TARGET = 5200
lda SkStatSimulator
bmi @+
inc SkStatSimulator
.IF TARGET = 5200
lda SkStatSimulator
bmi @+
inc SkStatSimulator
@
lda JoystickNumber ; select port
ora #%00000100 ; Speaker off, Pots enabled
lda JoystickNumber ; select port
ora #%00000100 ; Speaker off, Pots enabled
sta CONSOL5200
center = 114 ;Read analog stick and make it look like a digital stick
threshold = 60
lda JoystickNumber
asl
tax
lda JoystickNumber
asl
tax
lda paddl0,x ;Read POT0 value (horizontal position)
cmp #center+threshold ;Compare with right threshold
rol stick0 ;Feed carry into digital stick value
@@ -201,14 +201,14 @@ EndOfCreditsVBI
eor #2+8
and #$0f
sta stick0
ldx JoystickNumber
; check shift key (5200 second fire button)
lda SKSTAT
:3 lsr ; third bit
and trig0,x ; and first button
;lda trig0,x
sta strig0 ;Move hardware to shadow
ldx JoystickNumber
; check shift key (5200 second fire button)
lda SKSTAT
:3 lsr ; third bit
and trig0,x ; and first button
;lda trig0,x
sta strig0 ;Move hardware to shadow
mva chbas chbase
@@ -224,21 +224,21 @@ EndOfCreditsVBI
pla
tax
pla
rti
.ELSE
; support for joysticks :)
ldx JoystickNumber
lda STICK0,x
sta STICK0
lda STRIG0,x
sta STRIG0
jmp XITVBV
.ENDIF
rti
.ELSE
; support for joysticks :)
ldx JoystickNumber
lda STICK0,x
sta STICK0
lda STRIG0,x
sta STRIG0
jmp XITVBV
.ENDIF
.endp
.IF TARGET = 5200
.proc kb_continue
sta kbcode ;Store key code in shadow.
mva #0 SkStatSimulator
mva #0 SkStatSimulator
exit pla
tay
pla
@@ -250,18 +250,18 @@ exit pla
;--------------------------------------------------
.macro SetDLI
; SetDLI #WORD
; Initialises Display List Interrupts
; SetDLI #WORD
; Initialises Display List Interrupts
LDY # <:1
LDX # >:1
jsr _SetDLIproc
jsr _SetDLIproc
.endm
.proc _SetDLIproc
LDA #$C0
STY VDSLST
STX VDSLST+1
STA NMIEN
rts
LDA #$C0
STY VDSLST
STX VDSLST+1
STA NMIEN
rts
.endp
.ENDIF
+490 -506
View File
File diff suppressed because it is too large Load Diff