Merge pull request #83 from pkali/develop

build 142
This commit is contained in:
2022-05-30 09:05:04 -04:00
committed by GitHub
19 changed files with 410 additions and 416 deletions
+2
View File
@@ -0,0 +1,2 @@
*.bak
Executable → Regular
View File
Executable → Regular
+9
View File
@@ -47,6 +47,15 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin
## Changes: ## Changes:
###### Build 142
2022-05-30
Late build. The bugs we tried to squelch turned out to be more difficult than usual. Some progress has been made though even if it is not yet visible.
- 4x4 font rewritten by @Pecusx as a prep for Y standarization. It makes the messages to appear faster. This is a good change.
- https://github.com/pkali/scorch_src/issues/5 and #80 fixed (again) - no funkybomb traces staying on the screen
- https://github.com/pkali/scorch_src/issues/70 too strong Shooters fixed
- https://github.com/pkali/scorch_src/issues/63 - tank say goodbye when (mostly) visible
- several other small changes and improvements that will pay off in the following releases.
###### Build 141 ###### Build 141
2022-05-22 2022-05-22
Debug build. Thanks to all testers for finding numerous bugs. We tried to fix some of them and we have introduced some new for your enjoyment. Debug build. Thanks to all testers for finding numerous bugs. We tried to fix some of them and we have introduced some new for your enjoyment.
Executable → Regular
+15 -16
View File
@@ -33,7 +33,7 @@ loop
ArtificialIntelligence .proc ; ArtificialIntelligence .proc ;
; A - skill of the TankNr ; A - skill of the TankNr
; returns shoot energy and angle in ; returns shoot energy and angle in
; EnergyTable/L/H and AngleTable ; ForceTable/L/H and AngleTable
;---------------------------------------------- ;----------------------------------------------
asl asl
tax tax
@@ -77,24 +77,22 @@ Shooter .proc
lda PreviousAngle,x lda PreviousAngle,x
clc clc
adc #5 adc #5
bmi leftQuadrant bmi @+
cmp #90 cmp #90
bcc continue bcc @+
lda #(-90) lda #(-90)
bne continue @
leftQuadrant
continue
sta NewAngle sta NewAngle
sec
lda PreviousEnergyL,x lda PreviousEnergyL,x
sta EnergyTableL,x sbc #5
sta ForceTableL,x
lda PreviousEnergyH,x lda PreviousEnergyH,x
sta EnergyTableH,x sbc #0
sta ForceTableH,x
jmp endo jmp endo
firstShoot firstShoot
; compare the x position with the middle of the screen ; compare the x position with the middle of the screen
lda xTanksTableL,x lda xTanksTableL,x
@@ -108,7 +106,6 @@ firstShoot
and #$1F and #$1F
clc clc
adc #5 adc #5
;lda #45
sta NewAngle sta NewAngle
jmp forceNow jmp forceNow
@@ -123,15 +120,17 @@ tankIsOnTheRight
forceNow forceNow
mwa #100 RandBoundaryLow mwa #100 RandBoundaryLow
mwa #800 RandBoundaryHigh mwa #800 RandBoundaryHigh
ldx TankNr ;this is possibly not necessary
jsr RandomizeForce jsr RandomizeForce
endo endo
;ldx TankNr ;this is possibly not necessary ldx TankNr ;this is possibly not necessary
jsr RandomizeForce.LimitForce
lda NewAngle lda NewAngle
sta PreviousAngle,x sta PreviousAngle,x
lda EnergyTableL,x lda ForceTableL,x
sta PreviousEnergyL,x sta PreviousEnergyL,x
lda EnergyTableH,x lda ForceTableH,x
sta PreviousEnergyH,x sta PreviousEnergyH,x
; choose the best weapon ; choose the best weapon
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
+23 -18
View File
@@ -18,7 +18,7 @@ CashOptionL ;(one zero less than on the screen)
CashOptionH CashOptionH
.by 0,>200,>500,>800,>1000 .by 0,>200,>500,>800,>1000
GravityTable .by 10,20,25,30,40 GravityTable .by 10,20,25,30,40
MaxWindTable .by 5,20,40,60,80 MaxWindTable .by 5,20,40,70,99
RoundsTable .by 10,20,30,40,50 RoundsTable .by 10,20,30,40,50
flyDelayTable .by 255,150,75,35,1 flyDelayTable .by 255,150,75,35,1
seppukuTable .by 255, 45,25,15,9 seppukuTable .by 255, 45,25,15,9
@@ -483,6 +483,7 @@ WhereToSlideTable
.BY %000 ; 11111111 .BY %000 ; 11111111
EndOfTheBarrelX EndOfTheBarrelX
; right angles from 0 (vertically up) to 90 (horizontally to the right)
.by 4,4,4,4,4,4,4,4,4,4,4 .by 4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5 .by 5,5,5,5,5,5,5,5,5,5
.by 6,6,6,6,6,6,6,6,6 .by 6,6,6,6,6,6,6,6,6
@@ -492,15 +493,16 @@ EndOfTheBarrelX
.by 7,7,7,7,7,7,7,7,7,7,7,7,7 .by 7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7 .by 7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0 .by 0,0,0,0 ; not used
; left angles from 90 (horizontally to the left) to 1 (vertically up)
.by 0,0,0,0,0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0,0,0,0
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0
@@ -511,6 +513,7 @@ EndOfTheBarrelX
.by 3,3,3,3,3,3,3,3,3,3,3 .by 3,3,3,3,3,3,3,3,3,3,3
EndOfTheBarrelY EndOfTheBarrelY
; right angles from 0 (vertically up) to 90 (horizontally to the right)
.by 7,7,7,7,7,7,7,7,7,7,7 .by 7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7 .by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7 .by 7,7,7,7,7,7,7,7,7
@@ -520,15 +523,16 @@ EndOfTheBarrelY
.by 4,4,4,4,4,4,4,4,4,4,4,4,4 .by 4,4,4,4,4,4,4,4,4,4,4,4,4
.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3 .by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0 .by 0,0,0,0 ; not used
; left angles from 90 (horizontally to the left) to 1 (vertically up)
.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3 .by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 4,4,4,4,4,4,4,4,4,4,4,4,4 .by 4,4,4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5 .by 5,5,5,5,5,5,5,5,5,5
@@ -884,7 +888,8 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"Contact Trigger " ; 62 dta d"Contact Trigger " ; 62
dta d"White Flag " ; 63 dta d"White Flag " ; 63
weaponsOfDeath weaponsOfDeath
dta 0,1,2,3,7,8,9,15,16,17,18,19,20,21,22,23,24,25,26,27 dta 1,2,3,7,15,16,17,18,19,20,21,22,23,24,25,26,27
weaponsOfDeathEnd
joyToKeyTable joyToKeyTable
; .by 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15 ; .by 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15
.by $ff,$ff,$ff,$ff,$ff,$ff,$ff,$07,$ff,$ff,$ff,$06,$ff,$0f,$0e,$ff .by $ff,$ff,$ff,$ff,$ff,$ff,$ff,$07,$ff,$ff,$ff,$06,$ff,$0f,$0e,$ff
Executable → Regular
View File
Executable → Regular
+177 -222
View File
@@ -214,37 +214,20 @@ LineGoesLeft
; line goes left - we are reversing X ; line goes left - we are reversing X
sbw xtempDRAW temp xdraw ; XI sbw xtempDRAW temp xdraw ; XI
PutPixelinDraw PutPixelinDraw
jsr DrawJumpPad
; end of the special PLOT for DRAW
; XI=XI+1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
; UNTIL XI=XK bit drawFunction
inw XI bpl @+
cpw XI XK
jne DrawLoop
EndOfDraw
mwa xtempDRAW xdraw
mva ytempDRAW ydraw
rts
.endp
;-------------JumpPad-------------
DrawJumpPad
jmp (DrawJumpAddr)
Drawplot
jmp plot
DrawLen
inw LineLength inw LineLength
rts bne ContinueDraw ; ==jmp
;-------------JumpPad------------- @
bvc @+
DrawCheck .proc DrawCheck
lda tracerflag lda tracerflag
ora SmokeTracerFlag ora SmokeTracerFlag
yestrace yestrace
beq notrace beq notrace
jsr plot jsr plot
notrace notrace
;aftertrace ;aftertrace
lda HitFlag lda HitFlag
@@ -267,17 +250,34 @@ CheckCollisionDraw
cmp (temp),y cmp (temp),y
bcc StopHitChecking bcc StopHitChecking
mva #1 HitFlag
mwa xdraw XHit mwa xdraw XHit
mwa ydraw YHit lda (temp),y
sec
sbc #1
sta YHit
mva #0 YHit+1
;mwa ydraw YHit
mva #1 HitFlag
StopHitChecking StopHitChecking
jmp ContinueDraw
@
jsr plot
ContinueDraw
; XI=XI+1
; UNTIL XI=XK
inw XI
cpw XI XK
jne DrawLoop
EndOfDraw
mwa xtempDRAW xdraw
mva ytempDRAW ydraw
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
circle .proc ;fxxxing good circle drawing :) .proc circle ;fxxxing good circle drawing :)
;-------------------------------------------------- ;--------------------------------------------------
;Turbo Basic source ;Turbo Basic source
; R=30 ; R=30
@@ -560,11 +560,10 @@ UnequalTanks
bpl CheckNextTank bpl CheckNextTank
rts rts
.endp .endp
;-------------------------------------------------
drawtanks
;-------------------------------------------------
;-------------------------------------------------
.proc drawtanks
;-------------------------------------------------
lda tanknr lda tanknr
pha pha
ldx #$00 ldx #$00
@@ -581,8 +580,9 @@ DrawNextTank
sta tankNr sta tankNr
rts rts
.endp
;--------- ;---------
drawtanknr .proc DrawTankNr
ldx tanknr ldx tanknr
; let's check the energy ; let's check the energy
lda eXistenZ,x lda eXistenZ,x
@@ -670,11 +670,11 @@ ZeroesToGo
NoPlayerMissile NoPlayerMissile
DoNotDrawTankNr DoNotDrawTankNr
rts rts
.endp
;-------------------------------------------------- ;--------------------------------------------------
drawmountains .proc .proc drawmountains
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
mwa #mountaintable modify mwa #mountaintable modify
mva #1 color mva #1 color
@@ -691,7 +691,6 @@ NoMountain
inw xdraw inw xdraw
cpw xdraw #screenwidth cpw xdraw #screenwidth
bne drawmountainsloop bne drawmountainsloop
rts rts
;-------------------------------------------------- ;--------------------------------------------------
drawmountainspixel drawmountainspixel
@@ -713,7 +712,7 @@ drawmountainspixelloop
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
SoilDown2 .proc .proc SoilDown2
;-------------------------------------------------- ;--------------------------------------------------
; how it is supposed to work: ; how it is supposed to work:
@@ -841,8 +840,9 @@ ColumnIsReady
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
calculatemountains .proc .proc calculatemountains
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
@@ -944,7 +944,7 @@ EndDrawing
.endp .endp
; **************************************************** ; ****************************************************
;-------------------------------------------------- ;--------------------------------------------------
calculatemountains0 .proc .proc calculatemountains0
; Only for testing - makes ground flat (0 pixels) ; Only for testing - makes ground flat (0 pixels)
; and places tanks on it ; and places tanks on it
; remember to remove in final compilation :) ; remember to remove in final compilation :)
@@ -968,8 +968,9 @@ SetYofNextTank
rts rts
.endp .endp
; **************************************************** ; ****************************************************
; ----------------------------------------- ; -----------------------------------------
unPlot .proc .proc unPlot
; plots a point and saves the plotted byte, reverts the previous plot. ; plots a point and saves the plotted byte, reverts the previous plot.
; ----------------------------------------- ; -----------------------------------------
ldx #0 ; only one pixel ldx #0 ; only one pixel
@@ -1072,8 +1073,9 @@ SkipThisPlot
EndOfUnPlot EndOfUnPlot
rts rts
.endp .endp
; ----------------------------------------- ; -----------------------------------------
plot .proc ;plot (xdraw, ydraw, color) .proc plot ;plot (xdraw, ydraw, color)
; color == 1 --> put pixel ; color == 1 --> put pixel
; color == 0 --> erase pixel ; color == 0 --> erase pixel
; this is one of the most important routines in the whole ; this is one of the most important routines in the whole
@@ -1106,11 +1108,7 @@ MakePlot
lsr lsr
lsr lsr
tay ;save tay ;save
;--- ;---
ldx ydraw ldx ydraw
lda linetableL,x lda linetableL,x
sta xbyte sta xbyte
@@ -1132,17 +1130,16 @@ ClearPlot
sta (xbyte),y sta (xbyte),y
rts rts
.endp .endp
; ----------------------------------------- ; -----------------------------------------
point .proc .proc point
; ----------------------------------------- ; -----------------------------------------
; checks state of the pixel (coordinates in xdraw and ydraw) ; checks state of the pixel (coordinates in xdraw and ydraw)
; result is in A (zero or appropriate bit is set) ; result is in A (zero or appropriate bit is set)
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
mwa xdraw xbyte mwa xdraw xbyte
lda xbyte lda xbyte
and #$7 and #$7
sta ybit sta ybit
@@ -1154,9 +1151,7 @@ point .proc
lsr lsr
lsr lsr
tay ;save tay ;save
;---
;---
ldx ydraw ldx ydraw
lda linetableL,x lda linetableL,x
sta xbyte sta xbyte
@@ -1172,7 +1167,7 @@ point .proc
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
DrawLine .proc .proc DrawLine
;-------------------------------------------------- ;--------------------------------------------------
mva #0 ydraw+1 mva #0 ydraw+1
lda #screenheight lda #screenheight
@@ -1182,23 +1177,21 @@ DrawLine .proc
jsr plot.MakePlot jsr plot.MakePlot
;rts ;rts
jmp IntoDraw ; jumps inside Draw routine jmp IntoDraw ; jumps inside Draw routine
; because one pixel is already plotted ; because one pixel is already plotted
@
loopdraw lda (xbyte),y
and bittable2,x
lda (xbyte),y sta (xbyte),y
and bittable2,x IntoDraw
sta (xbyte),y adw xbyte #screenBytes
IntoDraw adw xbyte #screenBytes dec tempbyte01
bne @-
dec tempbyte01
bne loopdraw
rts rts
.endp .endp
;
; ------------------------------------------ ; ------------------------------------------
TypeChar .proc .proc TypeChar
; puts char on the graphics screen ; puts char on the graphics screen
; in: CharCode ; in: CharCode
; in: left LOWER corner of the char coordinates (xdraw, ydraw) ; in: left LOWER corner of the char coordinates (xdraw, ydraw)
@@ -1247,7 +1240,6 @@ CopyMask
lsrw xbyte ; div 8 lsrw xbyte ; div 8
rorw xbyte rorw xbyte
rorw xbyte rorw xbyte
;--- ;---
ldy xbyte ldy xbyte
@@ -1264,46 +1256,15 @@ CopyMask
ldx ybit ldx ybit
beq MaskOK00 beq MaskOK00
MakeMask00 MakeMask00
lsr mask1 .rept 8
ror mask2 lsr mask1+#
lsr mask1+1 ror mask2+#
ror mask2+1 .endr
lsr mask1+2 .rept 8
ror mask2+2 sec
lsr mask1+3 ror char1+#
ror mask2+3 ror char2+#
lsr mask1+4 .endr
ror mask2+4
lsr mask1+5
ror mask2+5
lsr mask1+6
ror mask2+6
lsr mask1+7
ror mask2+7
sec
ror char1
ror char2
sec
ror char1+1
ror char2+1
sec
ror char1+2
ror char2+2
sec
ror char1+3
ror char2+3
sec
ror char1+4
ror char2+4
sec
ror char1+5
ror char2+5
sec
ror char1+6
ror char2+6
sec
ror char1+7
ror char2+7
dex dex
bne MakeMask00 bne MakeMask00
MaskOK00 MaskOK00
@@ -1333,132 +1294,126 @@ CharLoopi
inx inx
cpx #8 cpx #8
bne CharLoopi bne CharLoopi
EndPutChar
rts rts
.endp .endp
; ------------------------------------------ ; ------------------------------------------
PutChar4x4 .proc ;puts 4x4 pixels char on the graphics screen .proc PutChar4x4
; in: xdraw, ydraw (upper left corner of the char) ; puts 4x4 pixels char on the graphics screen
; in: xdraw, ydraw (LOWER left corner of the char)
; in: CharCode4x4 (.sbyte) ; in: CharCode4x4 (.sbyte)
; in: plot4x4color (0/1)
; all pixels are being drawn
; (empty and not empty)
;-------------------------------------------------- ;--------------------------------------------------
lda plot4x4color ; cpw ydraw #(screenheight-4)
sta color ; jcs TypeChar.EndPutChar ;nearest RTS
; cpw xdraw #(screenwidth-4)
; jcs TypeChar.EndPutChar ;nearest RTS
; calculating address of the first byte ; checks ommited.
mva #4 LoopCounter4x4 lda plot4x4color
beq FontColor0
lda #$ff ; better option to check (plot4x4color = $00 or $ff)
sta plot4x4color
FontColor0
; char to the table
lda CharCode4x4 lda CharCode4x4
and #1 and #1
beq Upper4bits
lda #$ff ; better option to check (nibbler4x4 = $00 or $ff)
Upper4bits
sta nibbler4x4 sta nibbler4x4
lda CharCode4x4 lda CharCode4x4
ror lsr
; in carry there is which nibble of the byte is to be taken sta fontind
clc lda #$00
adc #(3*32) sta fontind+1
sta y4x4
nextline4x4
mva #4 Xcounter4x4
ldy y4x4
lda font4x4,y ;there was a problem with OMC here, but it works now
ldx nibbler4x4 adw fontind #font4x4
beq uppernibble
asl ; and 4 bytes to the table
asl ldy #0
asl ldx #3
asl CopyChar
uppernibble lda (fontind),y ; Y must be 0 !!!!
rol bit nibbler4x4
sta StoreA4x4 bpl GetUpper4bits
bcs EmptyPixel ; the font I drawn is in inverse ... :4 rol
;lda plot4x4color ;these lines are not necessary GetUpper4bits
;sta color ;if a plots are one color only ora #$0f
jsr plot sta char1,x
;jmp Loop4x4Continued lda #$ff
EmptyPixel sta char2,x
;lda #1 ;reverse color (color==1-color) ; and 4 bytes as a mask
;sec lda #$f0
;sbc plot4x4color sta mask1,x
;sta color lda #$00
;jsr plot sta mask2,x
;this is turned off for speed adw fontind #32 ; next byte of 4x4 font
;anyway we assume the text is being drawn dex
;over an empty space bpl CopyChar
Loop4x4Continued
inw xdraw
lda StoreA4x4
dec Xcounter4x4
ldx Xcounter4x4
bne uppernibble
; here we have on screen one line of the char
inw ydraw
sbw xdraw #4
sbw y4x4 #32
dec:lda LoopCounter4x4
bne nextline4x4
rts ; calculating coordinates from xdraw and ydraw
.endp mwa xdraw xbyte
; ------------------------------------------
PutChar4x4FULL .proc;
;this routine works just like PutChar4x4,
;but this time all pixels are being drawn
;(empty and not empty)
;--------------------------------------------------
; calculating address of the first byte lda xbyte
mva #4 LoopCounter4x4 and #$7
lda CharCode4x4 sta ybit
and #1
sta nibbler4x4
lda CharCode4x4
ror
; in carry there is which nibble of the byte is to be taken clc
clc
adc #(3*32)
sta y4x4
nextline4x4FULL
mva #4 Xcounter4x4
ldy y4x4
lda font4x4,y
ldx nibbler4x4 lsrw xbyte ; div 8
beq uppernibbleFULL rorw xbyte
rorw xbyte
asl ;---
asl ldy xbyte
asl lda ydraw ; y = y - 3 because left lower.
asl
uppernibbleFULL
rol
sta StoreA4x4
bcs EmptyPixelFULL
lda plot4x4color ;these lines are not necessary
sta color ;if a plots are one color only
jsr plot
jmp Loop4x4ContinuedFULL
EmptyPixelFULL
lda #1 ;reverse color (color==1-color)
sec sec
sbc plot4x4color sbc #3
sta color tax
jsr plot
;this is turned on now
;of course it is slower
Loop4x4ContinuedFULL
inw xdraw
lda StoreA4x4
dec Xcounter4x4
ldx Xcounter4x4
bne uppernibbleFULL
; here we have on screen one line of the char
inw ydraw
sbw xdraw #4
sbw y4x4 #32 ; why? possibly because of width of the 4x4 font
dec:lda LoopCounter4x4
bne nextline4x4FULL
lda linetableL,x
sta xbyte
lda linetableH,x
sta xbyte+1
; mask preparation and character shifting
ldx ybit
beq MaskOK01
MakeMask01
.rept 4
lsr mask1+#
ror mask2+#
.endr
.rept 4
sec
ror char1+#
ror char2+#
.endr
dex
bne MakeMask01
MaskOK01
ldx #0
CharLoopi4x4
lda (xbyte),y
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
and char2,x
PutInColor0_2
sta (xbyte),y
dey
adw xbyte #screenBytes
inx
cpx #4
bne CharLoopi4x4
EndPut4x4
rts rts
.endp .endp
+71 -49
View File
@@ -36,7 +36,7 @@
;we decided it must go in 'English' to let other people work on it ;we decided it must go in 'English' to let other people work on it
.macro build .macro build
dta d"141" ; number of this build (3 bytes) dta d"142" ; number of this build (3 bytes)
.endm .endm
icl 'definitions.asm' icl 'definitions.asm'
@@ -252,12 +252,12 @@ skipzeroing
lda #0 lda #0
tax tax
@ @
sta previousAngle,x sta singleRoundVars,x
inx inx
cpx #(singleRoundVarsEnd-PreviousAngle) cpx #(singleRoundVarsEnd-singleRoundVars)
bne @- bne @-
ldx #5 ldx #(MaxPlayers-1)
SettingEnergies SettingEnergies
lda #$00 lda #$00
sta gainL,x sta gainL,x
@@ -271,13 +271,13 @@ SettingEnergies
; anything in eXistenZ table means that this tank exist ; anything in eXistenZ table means that this tank exist
; in the given round ; in the given round
lda #<1000 lda #<1000
sta MaxEnergyTableL,x sta MaxForceTableL,x
lda #>1000 lda #>1000
sta MaxEnergyTableH,x sta MaxForceTableH,x
lda #<350 lda #<350
sta EnergyTableL,x sta ForceTableL,x
lda #>350 lda #>350
sta EnergyTableH,x sta ForceTableH,x
;lda #(255-45) ;lda #(255-45)
;it does not look good when all tanks have ;it does not look good when all tanks have
@@ -474,13 +474,13 @@ missed
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
NextPlayerShoots NextPlayerShoots
mva #1 Erase ;mva #1 Erase
jsr drawtanks ;jsr drawtanks
;before it shoots, the eXistenZ table must be ;before it shoots, the eXistenZ table must be
;updated accordingly to actual energy (was forgotten, sorry to ourselves) ;updated accordingly to actual energy (was forgotten, sorry to ourselves)
ldx #5 ldx #(MaxPlayers-1)
SeteXistenZ SeteXistenZ
lda Energy,x lda Energy,x
sta eXistenZ,x sta eXistenZ,x
@@ -500,25 +500,23 @@ LP0
ROR L1 ROR L1
BCC B0 BCC B0
CLC CLC
ADC #10 ; multiplication by 10 (L2) ADC #10 ; (L2) multiplication by 10
B0 DEY B0 DEY
BNE LP0 BNE LP0
ror ror
ROR L1 ROR L1
STA MaxEnergyTableH,x STA MaxForceTableH,x
lda L1 lda L1
sta MaxEnergyTableL,x sta MaxForceTableL,x
dex dex
bpl SeteXistenZ bpl SeteXistenZ
;was setup of maximum energy for players ;was setup of maximum energy for players
mva #0 Erase ;mva #0 Erase
jsr drawtanks ;jsr drawtanks
;inc TankNr
;lda TankNr
inc:lda TankSequencePointer inc:lda TankSequencePointer
cmp NumberOfPlayers cmp NumberOfPlayers
bne PlayersAgain bne PlayersAgain
@@ -562,12 +560,21 @@ NoPlayerNoDeath
lda #0 lda #0
sta FallDown1 sta FallDown1
sta FallDown2 sta FallDown2
sta ydraw+1
; get position of the tank
ldx TankNr
lda xtankstableL,x
sta xdraw
lda xtankstableH,x
sta xdraw+1
lda yTanksTable,x
sta ydraw
lda #1 ; Missile lda #1 ; Missile
jsr ExplosionDirect jsr ExplosionDirect
jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku
.endp .endp
;--------------------------------- ;---------------------------------
PlayerXdeath .proc PlayerXdeath
; this tank should not explode anymore: ; this tank should not explode anymore:
; there is 0 in A, and Tank Number in X, so... ; there is 0 in A, and Tank Number in X, so...
@@ -591,7 +598,6 @@ PlayerXdeath
sta ResultsTable,x sta ResultsTable,x
inc CurrentResult inc CurrentResult
mva #sfx_death_begin sfx_effect mva #sfx_death_begin sfx_effect
;RandomizeDeffensiveText ;RandomizeDeffensiveText
randomize talk.NumberOfOffensiveTexts (talk.NumberOfDeffensiveTexts+talk.NumberOfOffensiveTexts-1) randomize talk.NumberOfOffensiveTexts (talk.NumberOfDeffensiveTexts+talk.NumberOfOffensiveTexts-1)
@@ -607,8 +613,6 @@ PlayerXdeath
mva #0 plot4x4color mva #0 plot4x4color
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
; calculate position of the explosion (the post-death one) ; calculate position of the explosion (the post-death one)
ldx TankTempY ldx TankTempY
clc clc
@@ -641,7 +645,7 @@ PlayerXdeath
MetodOfDeath MetodOfDeath
lda random lda random
and #%00011111 ; range 0-31 and #%00011111 ; range 0-31
cmp #20 ; we have 20 weapons in table (from 0 to 19) cmp #(weaponsOfDeathEnd-weaponsOfDeath) ; we have 20 weapons in table (from 0 to 19)
bcs MetodOfDeath bcs MetodOfDeath
tay tay
lda weaponsOfDeath,y lda weaponsOfDeath,y
@@ -656,6 +660,7 @@ MetodOfDeath
jmp MainRoundLoop.AfterExplode jmp MainRoundLoop.AfterExplode
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc DecreaseEnergyX .proc DecreaseEnergyX
@@ -808,20 +813,20 @@ SetunPlots
sta gtictls sta gtictls
jsr PMoutofScreen jsr PMoutofScreen
lda TankColoursTable ; temporary colours of sprites under tanks lda TankColoursTable ; temporary colours of sprites under tanks
sta $2c0 sta COLPM0S
lda TankColoursTable+1 lda TankColoursTable+1
sta $2c1 sta COLPM1S
lda TankColoursTable+2 lda TankColoursTable+2
sta $2c2 sta COLPM2S
lda TankColoursTable+3 lda TankColoursTable+3
sta $2c3 sta COLPM3S
LDA TankColoursTable+4 LDA TankColoursTable+4
STA COLPF3S ; joined missiles (5th tank) STA COLPF3S ; joined missiles (5th tank)
mva #0 hscrol mva #0 hscrol
;let the tanks be visible! ;let the tanks be visible!
ldx #5 ldx #(maxPlayers-1)
lda #1 ; tank is visible lda #1 ; tank is visible
MakeTanksVisible MakeTanksVisible
sta eXistenZ,x sta eXistenZ,x
@@ -909,7 +914,19 @@ lab2
jmp SYSVBV jmp SYSVBV
.endp .endp
;---------------------------------------------- ;----------------------------------------------
RandomizeSequence .proc .proc RandomizeSequence0
ldx #0
@ txa
sta TankSequence,x
inx
cpx #MaxPlayers
bne @-
rts
.endp
.proc RandomizeSequence
; in: NumberOfPlayers ; in: NumberOfPlayers
; out: TankSequence ; out: TankSequence
; how: get random number lower than NumberOfPlayers ; how: get random number lower than NumberOfPlayers
@@ -982,7 +999,7 @@ RandomizeAngle .proc ;
.endp .endp
;---------------------------------------------- ;----------------------------------------------
RandomizeForce .proc RandomizeForce .proc
; routine returns in EnergyTable/L/H ; routine returns in ForceTable/L/H
; valid force of shooting for TankNr ; valid force of shooting for TankNr
; in X must be TankNr ; in X must be TankNr
; low and high randomize boundary passed as word value ; low and high randomize boundary passed as word value
@@ -990,36 +1007,41 @@ RandomizeForce .proc
; RandBoundaryHigh ; RandBoundaryHigh
;---------------------------------------------- ;----------------------------------------------
lda MaxEnergyTableL,x
sta temp
lda MaxEnergyTableH,x
sta temp+1
GetRandomAgain
lda RANDOM lda RANDOM
; gets values in range(256,765)
sta temp2 sta temp2
lda RANDOM ; :) lda RANDOM
and #%00000011 ;(0..1023) and #%00000011 ;(0..1023)
sta temp2+1 sta temp2+1
cpw RandBoundaryLow temp2 cpw RandBoundaryLow temp2
bcs GetRandomAgain bcs RandomizeForce
cpw RandBoundaryHigh temp2 cpw RandBoundaryHigh temp2
bcc GetRandomAgain bcc RandomizeForce
cpw temp temp2
bcs EnergyInRange
mwa temp temp2
EnergyInRange
lda temp2 lda temp2
sta EnergyTableL,x sta ForceTableL,x
lda temp2+1 lda temp2+1
sta EnergyTableH,x sta ForceTableH,x
;---------
LimitForce
; in X must be TankNr
; cuts force to MaxForceTable
lda MaxForceTableH,x
cmp ForceTableH,x
bne @+
lda MaxForceTableL,x
cmp ForceTableL,x
@ bcs @+
lda MaxForceTableL,x
sta ForceTableL,x
lda MaxForceTableH,x
sta ForceTableH,x
@
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
@@ -1041,14 +1063,14 @@ rotateRight;older is lower
bne MoveBarrelToNewPosition bne MoveBarrelToNewPosition
mva #$30 CharCode ; if angle goes through 0 we clear the barrel mva #$30 CharCode ; if angle goes through 0 we clear the barrel
jsr drawtankNrX jsr DrawTankNr.drawtankNrX
jmp MoveBarrelToNewPosition jmp MoveBarrelToNewPosition
rotateLeft rotateLeft
dec angleTable,x dec angleTable,x
bpl MoveBarrelToNewPosition bpl MoveBarrelToNewPosition
mva #$2e CharCode mva #$2e CharCode
jsr drawtankNrX jsr DrawTankNr.drawtankNrX
jmp MoveBarrelToNewPosition jmp MoveBarrelToNewPosition
BIN
View File
Binary file not shown.
Executable → Regular
+18 -14
View File
@@ -1355,7 +1355,8 @@ TypeLine4x4Loop
sta CharCode4x4 sta CharCode4x4
mwa LineXdraw Xdraw mwa LineXdraw Xdraw
mva LineYdraw Ydraw mva LineYdraw Ydraw
jsr PutChar4x4FULL ;type empty pixels as well! mva #1 plot4x4color
jsr PutChar4x4 ;type empty pixels as well!
adw LineXdraw #4 adw LineXdraw #4
inc LineCharNr inc LineCharNr
jmp TypeLine4x4Loop jmp TypeLine4x4Loop
@@ -1373,11 +1374,12 @@ EndOfTypeLine4x4
mwa Xdraw xk mwa Xdraw xk
mva Ydraw yc mva Ydraw yc
mva #15 fs ; temp, how many times blink the billboard mva #20 fs ; temp, how many times blink the billboard
@ seppuku_loop
lda fs lda CONSOL ; turbo mode
and #$01 cmp #6 ; START
sta plot4x4color sne:mva #1 fs ; finish it
mva #4 ResultY ; where seppuku text starts Y-wise on the screen mva #4 ResultY ; where seppuku text starts Y-wise on the screen
;top frame ;top frame
@@ -1400,11 +1402,9 @@ EndOfTypeLine4x4
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TypeLine4x4 jsr TypeLine4x4
dec fs
bne @-
;clean seppuku ;clean seppuku
mva #3 fs
mva #3 dx
mva #4 ResultY mva #4 ResultY
@ @
mva #1 plot4x4color mva #1 plot4x4color
@@ -1414,9 +1414,13 @@ EndOfTypeLine4x4
jsr TypeLine4x4 jsr TypeLine4x4
adb ResultY #4 ;next line adb ResultY #4 ;next line
dec fs dec dx
bne @- bne @-
dec fs
jne seppuku_loop
quit_seppuku
;restore vars ;restore vars
mva yc Ydraw mva yc Ydraw
mwa xk Xdraw mwa xk Xdraw
@@ -1664,9 +1668,9 @@ FinishResultDisplay
;display Force ;display Force
;========================= ;=========================
ldx TankNr ldx TankNr
lda EnergyTableL,x lda ForceTableL,x
sta decimal sta decimal
lda EnergyTableH,x lda ForceTableH,x
sta decimal+1 sta decimal+1
mwa #textbuffer+40+34 displayposition mwa #textbuffer+40+34 displayposition
jsr displaydec jsr displaydec
Executable → Regular
+9 -7
View File
@@ -33,6 +33,8 @@ RoundNrDisplay
.byte $ff .byte $ff
variablesStart ; zeroing starts here variablesStart ; zeroing starts here
drawFunction .ds 1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
;--------------
escFlag .ds 1 escFlag .ds 1
;-------------- ;--------------
sfx_effect .ds 1 sfx_effect .ds 1
@@ -82,14 +84,14 @@ TempResults
CurrentResult CurrentResult
.DS 1 .DS 1
;----------------------------------- ;-----------------------------------
EnergyTableL ;shooting Force of the tank during the round ForceTableL ;shooting Force of the tank during the round
.DS [MaxPlayers] .DS [MaxPlayers]
EnergyTableH ForceTableH
.DS [MaxPlayers] ;maxplayers=6 .DS [MaxPlayers] ;maxplayers=6
MaxEnergyTableL ;Energy of the tank during the round MaxForceTableL ;Energy of the tank during the round
;(limes superior force of the Shoot) ;(limes superior force of the Shoot)
.DS [MaxPlayers] ;1000 is the default .DS [MaxPlayers] ;1000 is the default
MaxEnergyTableH MaxForceTableH
.DS [MaxPlayers] .DS [MaxPlayers]
;----------------------------------- ;-----------------------------------
@@ -126,11 +128,11 @@ xtankstableH
.DS [MaxPlayers] .DS [MaxPlayers]
ytankstable ;Y positions of tanks (lower left point) ytankstable ;Y positions of tanks (lower left point)
.DS [MaxPlayers] .DS [MaxPlayers]
LowResDistances ; coarse stank positions divided by 4 (to be in just one byte) LowResDistances ; coarse tank positions divided by 4 (to be in just one byte)
.DS [MaxPlayers] .DS [MaxPlayers]
;----------------------------------- ;-----------------------------------
Erase .DS 1 ; if 1 only mask of the character is printed Erase .DS 1 ; if 1 only mask of the character is printed
; on the graphics screen. if 0 character is printed normally ; on the graphics screen. if 0 character is printed normally
;----------------------------------- ;-----------------------------------
RangeLeft .DS 2 ;range of the soil to be fallen down RangeLeft .DS 2 ;range of the soil to be fallen down
@@ -159,7 +161,6 @@ sandhogflag .DS 1 ; (0 digger, 8 sandhog)
;ofdirt ;ofdirt
magic .DS 2 ; was tempor2, but it was not compiling!!! (bug in OMC65) magic .DS 2 ; was tempor2, but it was not compiling!!! (bug in OMC65)
;draw ;draw
DrawJumpAddr .DS 2
HowToDraw .DS 1 HowToDraw .DS 1
; bits here mean ; bits here mean
; 0 - negative X (go up) ; 0 - negative X (go up)
@@ -333,6 +334,7 @@ TextNumberOff .DS 1
TankTempY TankTempY
.DS 1 .DS 1
;-------------- single round variables -------------- ;-------------- single round variables --------------
singleRoundVars
previousAngle previousAngle
.DS [MaxPlayers] .DS [MaxPlayers]
previousEnergyL previousEnergyL
Executable → Regular
+78 -82
View File
@@ -13,7 +13,7 @@
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
.endp .endp
ExplosionDirect .proc .proc ExplosionDirect
asl asl
tax tax
lda ExplosionRoutines+1,x lda ExplosionRoutines+1,x
@@ -214,9 +214,7 @@ FunkyBombLoop
lda random lda random
lsr lsr
and #%00011111 and #%00011111
bcc DoNotEor scc:eor #$ff
eor #$ff
DoNotEor
sta Angle sta Angle
lda #0 lda #0
@@ -231,6 +229,7 @@ DoNotEor
lda HitFlag lda HitFlag
beq NoExplosionInFunkyBomb beq NoExplosionInFunkyBomb
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
mva #11 ExplosionRadius
jsr xmissile jsr xmissile
NoExplosionInFunkyBomb NoExplosionInFunkyBomb
dec FunkyBombCounter dec FunkyBombCounter
@@ -545,7 +544,7 @@ DiggerCharacter
sbc EndOfTheBarrelY,y sbc EndOfTheBarrelY,y
sta ybyte sta ybyte
mva #0 ybyte+1 mva #0 ybyte+1
mwa #Drawplot DrawJumpAddr mva #0 drawFunction
mwa xdraw LaserCoordinate mwa xdraw LaserCoordinate
mwa ydraw LaserCoordinate+2 mwa ydraw LaserCoordinate+2
mwa xbyte LaserCoordinate+4 mwa xbyte LaserCoordinate+4
@@ -616,7 +615,7 @@ ExplosionLoop2
;check tanks' distance from the centre of the explosion ;check tanks' distance from the centre of the explosion
mwa #DrawLen DrawJumpAddr mva #%10000000 drawFunction
;the above switches Draw to measuring length ;the above switches Draw to measuring length
;trick is easy - how many pixels does it take to draw ;trick is easy - how many pixels does it take to draw
;a line from one point to another ;a line from one point to another
@@ -658,9 +657,7 @@ DistanceCheckLoop
;multiply difference by 8 ;multiply difference by 8
clc clc
adc #1 adc #1
asl :3 asl
asl
asl
tay tay
jsr DecreaseEnergyX jsr DecreaseEnergyX
@@ -978,17 +975,17 @@ ToHighFill
ldx TankNr ldx TankNr
;Checking the maximal force ;Checking the maximal force
lda MaxEnergyTableH,x lda MaxForceTableH,x
cmp EnergyTableH,x cmp ForceTableH,x
bne ContinueToCheckMaxForce2 bne ContinueToCheckMaxForce2
lda MaxEnergyTableL,x lda MaxForceTableL,x
cmp EnergyTableL,x cmp ForceTableL,x
ContinueToCheckMaxForce2 ContinueToCheckMaxForce2
bcs @+ bcs @+
lda MaxEnergyTableH,x lda MaxForceTableH,x
sta EnergyTableH,x sta ForceTableH,x
lda MaxEnergyTableL,x lda MaxForceTableL,x
sta EnergyTableL,x sta ForceTableL,x
@ @
jsr StatusDisplay ;all digital values like force, angle, wind, etc. jsr StatusDisplay ;all digital values like force, angle, wind, etc.
jsr PutTankNameOnScreen jsr PutTankNameOnScreen
@@ -1059,36 +1056,36 @@ notpressedJoy
pressedUp pressedUp
;force increaseeee! ;force increaseeee!
ldx TankNr ldx TankNr
inc EnergyTableL,x inc ForceTableL,x
bne CheckingMaxForce bne CheckingMaxForce
inc EnergyTableH,x inc ForceTableH,x
CheckingMaxForce CheckingMaxForce
mva #sfx_set_power_1 sfx_effect mva #sfx_set_power_1 sfx_effect
lda MaxEnergyTableH,x lda MaxForceTableH,x
cmp EnergyTableH,x cmp ForceTableH,x
bne FurtherCheckMaxForce bne FurtherCheckMaxForce
lda MaxEnergyTableL,x lda MaxForceTableL,x
cmp EnergyTableL,x cmp ForceTableL,x
FurtherCheckMaxForce FurtherCheckMaxForce
jcs BeforeFire jcs BeforeFire
lda MaxEnergyTableH,x lda MaxForceTableH,x
sta EnergyTableH,x sta ForceTableH,x
lda MaxEnergyTableL,x lda MaxForceTableL,x
sta EnergyTableL,x sta ForceTableL,x
jmp BeforeFire jmp BeforeFire
CTRLPressedUp CTRLPressedUp
ldx TankNr ldx TankNr
lda EnergyTableL,x lda ForceTableL,x
clc clc
adc #10 adc #10
sta EnergyTableL,x sta ForceTableL,x
bcc CheckingMaxForce bcc CheckingMaxForce
inc EnergyTableH,x inc ForceTableH,x
jmp CheckingMaxForce jmp CheckingMaxForce
@@ -1096,16 +1093,16 @@ pressedDown
mva #sfx_set_power_1 sfx_effect mva #sfx_set_power_1 sfx_effect
ldx TankNr ldx TankNr
dec EnergyTableL,x dec ForceTableL,x
lda EnergyTableL,x lda ForceTableL,x
cmp #$ff cmp #$ff
bne @+ bne @+
dec EnergyTableH,x dec ForceTableH,x
bpl @+ bpl @+
ForceGoesZero ForceGoesZero
lda #0 lda #0
sta EnergyTableH,x sta ForceTableH,x
sta EnergyTableL,x sta ForceTableL,x
@ @
jmp BeforeFire jmp BeforeFire
@@ -1114,11 +1111,11 @@ CTRLPressedDown
ldx TankNr ldx TankNr
sec sec
lda EnergyTableL,x lda ForceTableL,x
sbc #10 sbc #10
sta EnergyTableL,x sta ForceTableL,x
jcs BeforeFire jcs BeforeFire
dec EnergyTableH,x dec ForceTableH,x
bmi ForceGoesZero bmi ForceGoesZero
jmp BeforeFire jmp BeforeFire
@@ -1130,7 +1127,7 @@ pressedLeft
cmp #$ff ; if angle goes through 0 we clear the barrel cmp #$ff ; if angle goes through 0 we clear the barrel
bne NotThrough90DegreesLeft bne NotThrough90DegreesLeft
mva #$2e CharCode mva #$2e CharCode
jsr drawtankNrX jsr DrawTankNr.drawtankNrX
NotThrough90DegreesLeft NotThrough90DegreesLeft
cmp #(255-91) cmp #(255-91)
jne BeforeFire jne BeforeFire
@@ -1145,7 +1142,7 @@ pressedRight
lda AngleTable,x lda AngleTable,x
bne NotThrough90DegreesRight bne NotThrough90DegreesRight
mva #$30 CharCode ; if angle goes through 0 we clear the barrel mva #$30 CharCode ; if angle goes through 0 we clear the barrel
jsr drawtankNrX jsr DrawTankNr.drawtankNrX
NotThrough90DegreesRight NotThrough90DegreesRight
cmp #91 cmp #91
jne BeforeFire jne BeforeFire
@@ -1222,9 +1219,9 @@ RandomizeOffensiveText
sta Force+1 sta Force+1
bne AfterStrongShoot bne AfterStrongShoot
NotStrongShoot NotStrongShoot
lda EnergyTableL,x lda ForceTableL,x
sta Force sta Force
lda EnergyTableH,x lda ForceTableH,x
sta Force+1 sta Force+1
AfterStrongShoot AfterStrongShoot
lda #$0 lda #$0
@@ -1536,7 +1533,7 @@ noSmokeTracer
RepeatIfSmokeTracer RepeatIfSmokeTracer
mwa ytraj+1 Ytrajold+1 mwa ytraj+1 Ytrajold+1
mwa xtraj+1 Xtrajold+1 mwa xtraj+1 Xtrajold+1
mwa #DrawCheck DrawJumpAddr mva #%01000000 drawFunction
lda #0 lda #0
sta Result sta Result
@@ -1556,7 +1553,7 @@ RepeatIfSmokeTracer
stx LeapFrogAngle ; we will need it later stx LeapFrogAngle ; we will need it later
;Angle works like this: ;Angle works like this:
;0 'degrees' is sraight up ;0 'degrees' is straight up
;90 'degrees' is horizontally right ;90 'degrees' is horizontally right
;255 is straight up (same as 0) ;255 is straight up (same as 0)
;255-90 (165) horizontally left ;255-90 (165) horizontally left
@@ -1734,13 +1731,13 @@ FlightLeft
lda goleft lda goleft
bne FlightsLeft ;blow on bullet flighting left bne FlightsLeft ;blow on bullet flighting left
lda WindOrientation lda WindOrientation
bne WindToLeft bne LWindToRight
beq LWindToLeft beq LWindToLeft
FlightsLeft FlightsLeft
lda WindOrientation lda WindOrientation
beq LWindToRight beq LWindToRight
LWindToLeft
LWindToLeft
; here Wind to right, bullet goes right as well, so vx=vx+Wind ; here Wind to right, bullet goes right as well, so vx=vx+Wind
; here Wind to left, bullet goes left as well, so vx=vx+Wind ; here Wind to left, bullet goes left as well, so vx=vx+Wind
clc clc
@@ -1757,23 +1754,23 @@ LWindToLeft
adc #0 adc #0
sta vx+3 sta vx+3
jmp @+ jmp @+
WindToLeft
LWindToRight LWindToRight
;Wind to left, bullet right, so vx=vx-Wind ;Wind to left, bullet right, so vx=vx-Wind
;Wind to right, bullet left, so vx=vx-Wind ;Wind to right, bullet left, so vx=vx-Wind
sec sec
lda vx lda vx
sbc Wind sbc Wind
sta vx sta vx
lda vx+1 lda vx+1
sbc Wind+1 sbc Wind+1
sta vx+1 sta vx+1
lda vx+2 lda vx+2
sbc #0 sbc #0
sta vx+2 sta vx+2
lda vx+3 lda vx+3
sbc #0 sbc #0
sta vx+3 sta vx+3
@ @
mwa xtrajold+1 xdraw mwa xtrajold+1 xdraw
mwa ytrajold+1 ydraw mwa ytrajold+1 ydraw
@@ -1813,25 +1810,24 @@ SkipCollisionCheck
jsr UnPlot jsr UnPlot
NoUnPlot NoUnPlot
; jsr PlotPointer
jmp Loopi jmp Loopi
Hit Hit
mwa XHit xdraw mwa XHit xdraw
mva YHit ydraw ; one byte now mwa YHit ydraw
jsr unPlot jsr unPlot
EndOfFlight EndOfFlight
; mwa xdraw xcircle ; we must store for a little while mwa xdraw xcircle ; we must store for a little while
; mva ydraw ycircle ; xdraw and ydraw .... but this values are in YHit and XHit !!! mva ydraw ycircle ; xdraw and ydraw .... but this values are in YHit and XHit !!!
mwa #0 xdraw mwa #0 xdraw
mva #screenheight-1 ydraw mva #screenheight-1 ydraw
jsr unPlot jsr unPlot
; mwa xcircle xdraw mwa xcircle xdraw
; mva ycircle ydraw mva ycircle ydraw
mwa XHit xdraw ; mwa XHit xdraw
mva YHit ydraw ; mva YHit ydraw
ldy SmokeTracerFlag ldy SmokeTracerFlag
beq EndOfFlight2 beq EndOfFlight2
@@ -1847,9 +1843,9 @@ SecondFlight .proc
; ---------------- copied code fragment from before firing. not too elegant. ; ---------------- copied code fragment from before firing. not too elegant.
; ---------------- get fire parameters again ; ---------------- get fire parameters again
ldx TankNr ldx TankNr
lda EnergyTableL,x lda ForceTableL,x
sta Force sta Force
lda EnergyTableH,x lda ForceTableH,x
sta Force+1 sta Force+1
lda #$0 lda #$0
sta Force+2 sta Force+2
@@ -1886,7 +1882,7 @@ SecondFlight .proc
sbc #0 sbc #0
sta ytraj+2 sta ytraj+2
ldy #100 ldy #100 ; ???
mva #1 tracerflag ; I do not know (I mean I think I know ;) ) mva #1 tracerflag ; I do not know (I mean I think I know ;) )
; 10 years later - I do not know!!! ; 10 years later - I do not know!!!
; 20 years later - still do not know :] ; 20 years later - still do not know :]
@@ -1975,12 +1971,10 @@ MIRVcopyParameters
ldx #$FF ; it will turn 0 in a moment anyway ldx #$FF ; it will turn 0 in a moment anyway
stx MirvMissileCounter stx MirvMissileCounter
mrLoopi mrLoopi
inc MirvMissileCounter inc:lda MirvMissileCounter
lda MirvMissileCounter
cmp #5 cmp #5
bne mrLoopix sne:mva #0 MirvMissileCounter
mva #0 MirvMissileCounter
mrLoopix
ldx MirvMissileCounter ldx MirvMissileCounter
; Y changes only for bullet number 0 ; Y changes only for bullet number 0
; because rest of the bullets have the same Y (height) ; because rest of the bullets have the same Y (height)
@@ -2142,7 +2136,7 @@ MIRVcheckCollision
lda xtraj02,x lda xtraj02,x
adc #>mountaintable adc #>mountaintable
sta temp+1 sta temp+1
; adw mountaintable --- it does not work!!!!!!!! and should! (OMC bug?) #temp
ldy #0 ldy #0
lda ytraj+1 lda ytraj+1
cmp (temp),y cmp (temp),y
@@ -2169,7 +2163,7 @@ mrHit
; we have to make unPlot over the screen (to initialise it) ; we have to make unPlot over the screen (to initialise it)
; before actual explosion ; before actual explosion
mwa #0 xdraw mwa #0 xdraw
mva #screenheight-1 ydraw mwa #screenheight-1 ydraw
jsr unPlot.unPlotAfterX jsr unPlot.unPlotAfterX
ldx MirvMissileCounter ldx MirvMissileCounter
ldy #0 ldy #0
@@ -2184,6 +2178,8 @@ mrHit
adc #>mountaintable adc #>mountaintable
sta temp+1 sta temp+1
lda (temp),y lda (temp),y
sec
sbc #1
sta ydraw sta ydraw
sty ydraw+1 ;we know that y=0 sty ydraw+1 ;we know that y=0
jsr missile ; explode .... jsr missile ; explode ....
@@ -2290,9 +2286,9 @@ CalculateExplosionRange0
lda #0 lda #0
sta RangeRight sta RangeRight
sta RangeRight+1 sta RangeRight+1
mva #11 ExplosionRadius mva #11 ExplosionRadius ; what is this magic value?
;-------------------------------------------------- ;--------------------------------------------------
CalculateExplosionRange .proc .proc CalculateExplosionRange
;-------------------------------------------------- ;--------------------------------------------------
;calculates total horizontal range of explosion by ;calculates total horizontal range of explosion by
;"summing up" ranges of all separate explosions ;"summing up" ranges of all separate explosions