Compare commits

...

68 Commits

Author SHA1 Message Date
Pirx 18f88705e5 Merge pull request #95 from pkali/develop
new xex
2022-06-19 20:05:32 -04:00
Pirx fe6bd17a66 new xex 2022-06-19 20:04:08 -04:00
Pirx 1d8f26d562 Merge pull request #94 from pkali/develop
inflation and supply chains distuption causes weapon price increase
2022-06-19 20:01:20 -04:00
Pirx 2bb8a743e1 inflation and supply chains distuption causes weapon price increase 2022-06-19 20:00:54 -04:00
Pirx 708a7b4aa9 Merge pull request #93 from pkali/develop
Develop
2022-06-19 14:43:03 -04:00
Pirx 8153670711 build 144 2022-06-19 14:42:24 -04:00
Pirx ab140ed5ca short fire - inventory, long fire - fire #75 2022-06-19 14:22:54 -04:00
Pirx cc3e2d1845 power timer 1/2s to speed up #75 2022-06-19 12:02:48 -04:00
Pirx 98e866abdd elaborate fix of a simple issue... #92 2022-06-18 20:17:16 -04:00
Pirx ffa748fb68 font update #26 2022-06-18 11:22:04 -04:00
Pirx de047779ce looks like inventory works... #26 2022-06-18 10:40:00 -04:00
Pirx 3c685b2811 infinite money when purchasing Baby Missile fix #26 2022-06-18 07:07:24 -04:00
Pecusx c86dcd7c59 cosmetics 2022-06-16 18:34:00 +02:00
Pecusx f924868459 Better (not best) collision with tank check
.... and corrected two defensive weapon numbers - Mag Deflector and Auto Defence are working.
2022-06-16 17:52:34 +02:00
Pirx 2992bd40b3 no shoot after inventory select #26 2022-06-15 07:48:57 -04:00
Pirx b19d218670 decrease activated defensives #26 2022-06-15 00:11:01 -04:00
Pirx 8ab450ff48 WIP: almost working... #26 2022-06-14 10:33:01 -04:00
Pirx 5e2ab7f206 defensives activate #26 2022-06-14 09:26:38 -04:00
Pecusx cd69bf22db Shield energy table added.
... for easier activation.
Defensive weapon numbering revised.
2022-06-13 09:18:05 +02:00
Pirx ff8c4d9329 number of shells in inventory #26 2022-06-13 01:35:57 -04:00
Pirx 83e128a1b5 no prices in inventory #26 2022-06-13 01:21:27 -04:00
Pirx cc8688263a Purchase/Activate texts in shop #26 2022-06-12 10:18:13 -04:00
Pirx b5bf6ecc30 joy left change offensive/deffensive #26 2022-06-12 09:48:10 -04:00
Pirx e2c85c98c2 inventory offensive weapons selection #26 2022-06-12 00:39:19 -04:00
Pirx c47a22a833 wip: purchase does not show active weapon #26 2022-06-11 20:08:25 -04:00
Pirx cd4275226a wip: inventory shows active weapon #26 2022-06-11 18:08:25 -04:00
Pirx cb270be865 wip: inventory shows weapons #26 2022-06-11 14:53:28 -04:00
Pirx 7df1d5eff9 isInventory var 2022-06-11 13:08:49 -04:00
Pirx c3f6e2399d to be as it was 2022-06-11 10:04:29 -04:00
Pirx 598860b7d0 infinite purchases fix #26 2022-06-11 09:43:08 -04:00
Pirx c1aa177767 WIP: press I for inventory #26 2022-06-11 05:51:13 -04:00
Pecusx eb7f6369de Collision with tank now checks the shield
We must rewvite CheckCollisionWithTank procedure !!!!
In future :)
2022-06-10 19:37:52 +02:00
Pecusx 41900d7671 Mag Deflector added
Only for test.
Now all players has active Mag Deflector with energy (99) before game.
2022-06-10 18:48:19 +02:00
Pecusx 6a6689b9b7 Auto Defence added
Only for test.
Now all players has active Auto Defence with energy (99) before game.
2022-06-10 11:13:20 +02:00
Pecusx 836c67afcf cosmetics 2022-06-09 20:32:37 +02:00
Pecusx 1b983b8d92 Index of hit tank in HitFlag
For future use.
Easier to check whether the hit tank or ground.
2022-06-09 18:06:31 +02:00
Pecusx 53e9f89012 Shield "horns" drawing.
For future use (defensive but aggressive :) ) weapons.
2022-06-09 14:40:48 +02:00
Pecusx cf40bf905d Slight change. 2022-06-09 12:57:50 +02:00
Pecusx 91b613f166 Shield witch parachute added
Only for test.
Now all players has active Shield with energy (99) and witch parachute before game.
Alo added display name of active defensive weapon on statusbar, and some fixes.
2022-06-09 09:46:09 +02:00
Pecusx eace9eb5cf Shield with energy added
Only for test.
Now all players has active Shield with energy (99) before game.
2022-06-08 21:52:19 +02:00
Pecusx 4c6b56a1e2 Now shield is displayed on a tank without PM
Small bugfix.
2022-06-08 14:40:29 +02:00
Pecusx 7b86fc98cd Simple shield added
Only for test.
Now all players has active Shield before game.
2022-06-08 11:14:03 +02:00
Pecusx 186cacf5ba The first attempt at handling defensive weapons
Only for test.
Now all players has active Parachute berore round.
2022-06-07 10:25:23 +02:00
Pecusx 031416b8e6 "Underground" shot fixed. 2022-06-06 17:59:43 +02:00
Pecusx 1394524a26 FunkyBomb and LeapFrog bugfix #89
Problem was due to the better accuracy of the collision with tank check procedure.
2022-06-06 09:42:22 +02:00
Pirx ea6c621d79 Merge pull request #90 from pkali/develop
build 143
2022-06-06 00:23:46 -04:00
Pirx afd81c08c3 build 143 2022-06-06 00:23:02 -04:00
Pirx a9703609b6 bad tanksequence fix #47 2022-06-06 00:01:02 -04:00
Pirx d8bfda28a0 code size opts 2022-06-05 21:36:38 -04:00
Pirx 743114fd0d some code size optimizations 2022-06-05 09:33:28 -04:00
Pirx 079abc062f done for now #74 2022-06-05 03:17:34 -04:00
Pirx 853a597daf almost done #74 2022-06-05 02:40:07 -04:00
Pirx 1eadc7f63e minor edits 2022-06-04 17:54:15 -04:00
Pirx 081cf282c8 forgot about MIRV #82 2022-06-04 16:15:43 -04:00
Pirx 4c3203854c letting winds #82 2022-06-04 16:07:01 -04:00
Pecusx bf11a9967f Atract mode only for human players 2022-06-03 21:46:04 +02:00
Pecusx 0d7403d1c0 Laser is working properly.
But why!!!
Where do xdraw and ydraw come from in laser procedure!
2022-06-03 11:59:11 +02:00
Pecusx 777f5c341a Additional check for 0 bullets in DecreaseWeapon proc #56 2022-06-03 10:48:08 +02:00
Pecusx 8f0bd8ca81 Liquid Dirt bug and little optimization 2022-06-03 10:30:02 +02:00
Pecusx c12049d0d7 Sometimes no explosion - solved!
A small change after a long analysis of the procedures "Fly" and "draw" - very hard work :)
2022-06-02 23:38:52 +02:00
Pecusx 6013986e51 Minor changes 2022-06-02 21:40:09 +02:00
Pecusx 0fbe3de569 Improved checking collision with the tank.
And other optimizations.
2022-06-02 15:01:49 +02:00
Pecusx 9569b3365a First attempt to 2 bytes Y
Not everywhere yet, but in the most important procedures.
2022-06-02 10:01:06 +02:00
Pecusx 6d9b2907c5 Flight procedure optimization
3 bytes variable (Result) now is unnecessary.
The code is a bit shorter.
2022-06-02 09:12:00 +02:00
Pecusx 94e6caebed MIRV bullets over the screen now are visible 2022-06-01 11:44:53 +02:00
Pecusx 532ee7dc88 MIRV hit procedure completely rewritten.
Now wthout bugs :) and much clearer.
2022-06-01 11:19:14 +02:00
Pecusx 17e653b37d Flashing before tank explodes #84 2022-05-31 10:44:47 +02:00
Pecusx bef3c0f080 MIRV bugfix #66
I think so.
2022-05-30 22:41:45 +02:00
13 changed files with 1429 additions and 833 deletions
+25
View File
@@ -47,6 +47,31 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin
## Changes:
###### Build 144
2022-06-19
Juneteenth release is coming with the most anticipated new feature: defensive weapons. Thanks to @Pecusx we have 5 completely new weapons and more reasonably working parachute. The stub of instruction manual describing these weapons is available here: https://github.com/pkali/scorch_src/wiki/Instruction-manual.
The new inventory system has been added. Call it by pressing "I" key or short-pressing fire. Select weapon to use by moving joystick or cursor keys right. Switch between offensive and deffensive weapons by moving joystick left. Fire/escape to quit inventory.
Other significant playability change is https://github.com/pkali/scorch_src/issues/54 - it is not finished yet, but keeping joystick up or down makes force to increase / decrease faster.
Also - short press of fire calls Inventory, long press fires the shell. The timings are experimental, please let me know it this needs a modification / improvement.
Tickets closed:
* https://github.com/pkali/scorch_src/issues/92 - less unnecessary cleaning of the offensive texts
* https://github.com/pkali/scorch_src/issues/89 - improved collisions with tank
* https://github.com/pkali/scorch_src/issues/71 - ditto
* https://github.com/pkali/scorch_src/issues/11, https://github.com/pkali/scorch_src/issues/26, https://github.com/pkali/scorch_src/issues/8, https://github.com/pkali/scorch_src/issues/20 - new inventory system
###### Build 143
2022-06-05
Rewrite build. We redone several important parts of the game to allow for bug fixes and requested features. Generally it was a great success, but some new bugs appeared. This build is nice for the eye, but beware, no mercy for testers again :)
Only visible changes listed, because you are possibly not as excited as we are for the new Flight routine and ground collisions by @Pecusx.
- https://github.com/pkali/scorch_src/issues/84, https://github.com/pkali/scorch_src/issues/63 - tanks now say good bye properly!
- https://github.com/pkali/scorch_src/issues/74 - Press [ESC] to quit the game at any point, with a confirmation when the round has already started. Please note the keyboard is not checked all the time, so press it for a while, especially when AI tanks are ru(i/n)ning the show.
- https://github.com/pkali/scorch_src/issues/56 - there should be no occurrences of frivolous weapon purchases. Please report all tanks getting their munitions from uncertified sources!
- https://github.com/pkali/scorch_src/issues/47 - It seems that the bad sequence of turns has been ameliorated. Fix is trivial, finding the culprit - far from it. Please pay special attention to fairness of shooting in case the fix is still longing for the fjords.
- ATTRACT mode works how it should - screensaver saves screen only when HUMAN should input something.
###### 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.
+2 -2
View File
@@ -73,7 +73,7 @@ pmg .ds $0300
eif
song_data
ins 'mmm_16.lzs'
ins 'mmm_16.lzs'
song_end
POKEY = $D200
@@ -456,7 +456,7 @@ quit
ini main
; ---
opt l-
;opt l-
.MACRO SPRITES
missiles
+58 -47
View File
@@ -14,16 +14,15 @@ dliColorsFore
TextBackgroundColor = $02 ; REAL constans - use: LDA #TextBackgroundColor
TextForegroundColor = $0c
CashOptionL ;(one zero less than on the screen)
.by 0,<200,<500,<800,<1000
.by 0,<200,<800,<1200,<2000
CashOptionH
.by 0,>200,>500,>800,>1000
.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
flyDelayTable .by 255,150,75,35,1
seppukuTable .by 255, 45,25,15,9
;------------------------------------------------
LevelNameBeginL ; begins of level names
.by <NamesOfLevels,<(NamesOfLevels+10),<(NamesOfLevels+20)
.by <(NamesOfLevels+32),<(NamesOfLevels+42),<(NamesOfLevels+52)
@@ -37,31 +36,25 @@ TanksWeaponsTableL
.by <TanksWeapon1,<TanksWeapon2,<TanksWeapon3,<TanksWeapon4,<TanksWeapon5,<TanksWeapon6
TanksWeaponsTableH
.by >TanksWeapon1,>TanksWeapon2,>TanksWeapon3,>TanksWeapon4,>TanksWeapon5,>TanksWeapon6
;-----4x4 texts-----
;-----4x4 texts-----
LineTop
dta d"(%%%%%%%%%%%%)"
.byte $ff
dta d"(%%%%%%%%%%%%)", $ff
;# - vertical, () * +, % - horizontal
LineBottom
dta d"*%%%%%%%%%%%%+"
.byte $ff
dta d"*%%%%%%%%%%%%+", $ff
LineEmpty
dta d"# #"
.byte $ff
dta d"# #", $ff
LineHeader2
dta d"# RESULTS #"
.byte $ff
dta d"# RESULTS #", $ff
LineGameOver
dta d"# GAME OVER #"
.byte $ff
dta d"# GAME OVER #", $ff
seppukuText
dta d"# SEPPUKU! #"
.byte $ff
dta d"# SEPPUKU! #", $ff
areYouSureText
dta d"# SURE? Y/N #", $ff
lineClear
dta d" "
.byte $ff
dta d" ", $ff
;-----------
pmtableL ; addressess of the P/M memory for 5 tanks (6th is without P/M background)
@@ -521,7 +514,8 @@ EndOfTheBarrelY
.by 6,6,6,6,6,6,6,6,6
.by 5,5,5,5,5,5,5,5,5,5
.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 4,4,4,4,4,4,4,4,4,4,4,4,4,4 ; one pixel Up for fix problems with colision check
; .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 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
@@ -533,7 +527,8 @@ EndOfTheBarrelY
.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,4 ; one pixel Up for fix problems with colision check
.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 6,6,6,6,6,6,6,6,6
@@ -541,8 +536,8 @@ EndOfTheBarrelY
.by 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,7
;-------------------------------------------------
;-------------------------------------------------
TanksNamesDefault
dta d"1st.Tank"
dta d"2nd.Tank"
@@ -551,7 +546,6 @@ TanksNamesDefault
dta d"5th.Tank"
dta d"6th.Tank"
WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_Baby_Missile___
.by >price_Missile________
@@ -601,6 +595,7 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price______________45
.by >price______________46
.by >price______________47
.by >price_White_Flag_____
.by >price_Heat_Guidance__
.by >price_Bal_Guidance___
.by >price_Horz_Guidance__
@@ -616,7 +611,6 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_Auto_Defense___
.by >price_Fuel_Tank______
.by >price_Contact_Trigger
.by >price_White_Flag_____
WeaponPriceL
.by <price_Baby_Missile___
@@ -667,6 +661,7 @@ WeaponPriceL
.by <price______________45
.by <price______________46
.by <price______________47
.by <price_White_Flag_____
.by <price_Heat_Guidance__
.by <price_Bal_Guidance___
.by <price_Horz_Guidance__
@@ -682,7 +677,6 @@ WeaponPriceL
.by <price_Auto_Defense___
.by <price_Fuel_Tank______
.by <price_Contact_Trigger
.by <price_White_Flag_____
;-------------------------------------------------
; how many units (bulletd) of a given weapon we get for a given price
@@ -739,6 +733,7 @@ WeaponUnits
.by 0 ;_____________45
.by 0 ;_____________46
.by 0 ;_____________47
.by 1 ;White_Flag___48
.by 6 ;Heat_Guidance__
.by 2 ;Bal_Guidance___
.by 5 ;Horz_Guidance__
@@ -754,7 +749,6 @@ WeaponUnits
.by 1 ;Auto_Defense___
.by 10 ;Fuel_Tank______
.by 25 ;Contact_Trigger
.by 1 ;_____________63
PurchaseMeTable ;weapons good to be purchased by the robot
;the comment is an index in the tables
@@ -817,8 +811,8 @@ WeaponSymbols
.by $58,$59,$5a,$5b,$60,$7b,$7c,$7d
.by $20,$00,$00,$00,$00,$00,$00,$00
.by $00,$00,$00,$00,$00,$00,$00,$00
.by $02,$03,$06,$1d,$0a,$1b,$1c,$1e
.by $3b,$3c,$3d,$3e,$3f,$5e,$5f,$00
.by $5f,$02,$03,$06,$1d,$0a,$1b,$1c ; defensives
.by $1e,$3b,$3c,$3d,$3e,$3f,$5e,$00
; Names of weapons (16 chars long)
NamesOfWeapons ;the comment is an index in the tables
@@ -869,27 +863,44 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"----------------" ; 44
dta d"----------------" ; 45
dta d"----------------" ; 46
dta d"----------------" ; 47
dta d" " ; 47 ; special (no weapon) name to simplify display
dta d"Heat Guidance " ; 48 ($30)
dta d"Bal Guidance " ; 49
dta d"Horz Guidance " ; 50
dta d"Vert Guidance " ; 51
dta d"Lazy Boy " ; 52
dta d"Parachute " ; 53
dta d"Battery " ; 54
dta d"Mag Deflector " ; 55
dta d"Shield " ; 56
dta d"Force Shield " ; 57
dta d"Heavy Shield " ; 58
dta d"Super Mag " ; 59
dta d"Auto Defense " ; 60
dta d"Fuel Tank " ; 61
dta d"Contact Trigger " ; 62
dta d"White Flag " ; 63
dta d"White Flag " ; 48 ($30)
dta d"Heat Guidance " ; 49
dta d"Bal Guidance " ; 50
dta d"Horz Guidance " ; 51
dta d"Vert Guidance " ; 52
dta d"Lazy Boy " ; 53
dta d"Parachute " ; 54 - no energy
dta d"Battery " ; 55
dta d"Mag Deflector " ; 56 - with shield and energy
dta d"Shield " ; 57 - shield for one shot - no energy
dta d"Force Shield " ; 58 - shield with energy and parachute
dta d"Heavy Shield " ; 59 - shield with energy
dta d"Super Mag " ; 60
dta d"Auto Defense " ; 61 - with shield and energy
dta d"Fuel Tank " ; 62
dta d"Contact Trigger " ; 63
DefensiveEnergy = * - 48
.by 00 ; White Flag
.by 00 ; Heat Guidance
.by 00 ; Bal Guidance
.by 00 ; Horz Guidance
.by 00 ; Vert Guidance
.by 00 ; Lazy Boy
.by 00 ; Parachute
.by 00 ; Battery
.by 90 ; Mag Deflector
.by 00 ; Shield
.by 99 ; Force Shield
.by 99 ; Heavy Shield
.by 00 ; Super Mag
.by 99 ; Auto Defense
.by 00 ; Fuel Tank
.by 00 ; Contact Trigger
weaponsOfDeath
dta 1,2,3,7,15,16,17,18,19,20,21,22,23,24,25,26,27
weaponsOfDeathEnd
dta 1,2,3,7,17,18,19,20,21,22,23,24,25,26,27
weaponsOfDeathEnd
joyToKeyTable
; .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
+16 -16
View File
@@ -59,22 +59,22 @@ price______________44 = 0
price______________45 = 0
price______________46 = 0
price______________47 = 0
price_Heat_Guidance__ = $ffff ;_48_($30)
price_Bal_Guidance___ = $ffff ;_49
price_Horz_Guidance__ = $ffff ;_50
price_Vert_Guidance__ = $ffff ;_51
price_Lazy_Boy_______ = $ffff ;_52
price_Parachute______ = 1100 ;_53
price_Battery________ = $ffff ;_54
price_Mag_Deflector__ = $ffff ;_55
price_Shield_________ = $ffff ;_56
price_Force_Shield___ = $ffff ;_57
price_Heavy_Shield___ = $ffff ;_58
price_Super_Mag______ = $ffff ;_59
price_Auto_Defense___ = $ffff ;_60
price_Fuel_Tank______ = $ffff ;_61
price_Contact_Trigger = $ffff ;_62
price_White_Flag_____ = $0 ;_63
price_White_Flag_____ = $0 ;_48_($30)
price_Heat_Guidance__ = $ffff ;_49
price_Bal_Guidance___ = $ffff ;_50
price_Horz_Guidance__ = $ffff ;_51
price_Vert_Guidance__ = $ffff ;_52
price_Lazy_Boy_______ = $ffff ;_53
price_Parachute______ = 234 ;_54
price_Battery________ = $ffff ;_55
price_Mag_Deflector__ = 245 ;_56
price_Shield_________ = 112 ;_57
price_Force_Shield___ = 268 ;_58
price_Heavy_Shield___ = 375 ;_59
price_Super_Mag______ = $ffff ;_60
price_Auto_Defense___ = 512 ;_61
price_Fuel_Tank______ = $ffff ;_62
price_Contact_Trigger = $ffff ;_63
;--------------------------------
; names of RMT instruments (sfx)
;--------------------------------
+14 -6
View File
@@ -104,7 +104,7 @@ OptionsScreen
OptionsHere
; 0123456789012345678901234567890123456789
dta d"Players : 2 3 4 5 6 "
dta d"Cash : none 2K 5K 8K 10K "
dta d"Cash : none 2K 8K 12K 20K "
dta d"Gravity : 0.2G 0.5G 1G 2G 4G "
dta d"Wind : 1B 3B 5B 7B 9B "
dta d"Rounds : 10 20 30 40 50 "
@@ -136,7 +136,9 @@ WeaponsDescription
dta d" - Defensive/Offensive weapon "
dta d" "
dta d"Space"*
dta d" - Purchase "
dta d" - "
purchaseActivate
dta d"Purchase "
dta d"Return"*
dta d" - Finish "
EmptyLine
@@ -166,11 +168,17 @@ NamesOfLevels
textbuffer
; 0123456789012345678901234567890123456789
dta d"Player: "
dta d"Energy: Angle: Force: "
dta d" Round: Wind: "
dta d"Energy: Angle: Force: "
dta d"Round: Wind: "
textbuffer2
dta d"Player: Cash: "
dta d"Player: Cash: 0 " ; ZERO TO MAKE YOU RICHER ON THE SCREEN
dta d"----------------------------------------"
;---------------------------------------------------
activateText
dta d"Activate"
activateTextEnd
purchaseText
dta d"Purchase"
purchaseTextEnd
.endif
+186 -25
View File
@@ -4,7 +4,7 @@
;--------------------------------------------------
draw .proc ;;fuxxing good draw :)
.proc draw ;;fuxxing good draw :)
;--------------------------------------------------
;creditz to Dr Jankowski / MIM U.W.
; (xi,yi)-----(xk,yk)
@@ -43,9 +43,9 @@ draw .proc ;;fuxxing good draw :)
;cpw ybyte #screenheight
;bcc DrawOnTheScreen
lda ydraw+1
bne DrawOutOfTheScreen
bmi DrawOutOfTheScreen
lda ybyte+1
beq DrawOnTheScreen
bpl DrawOnTheScreen
DrawOutOfTheScreen
;jsr DrawJumpPad
rts
@@ -230,20 +230,26 @@ yestrace
jsr plot
notrace
;aftertrace
;key
lda HitFlag
bne StopHitChecking
CheckCollisionDraw
; checking collision!
lda ydraw+1
bne StopHitChecking
bmi StopHitChecking
jsr CheckCollisionWithTank
lda HitFlag
bne StopHitChecking
mwa xdraw temp
adw temp #mountaintable
clc
lda xdraw
adc #<mountaintable
sta temp
lda xdraw+1
adc #>mountaintable
sta temp+1
ldy #0
lda ydraw
@@ -255,9 +261,8 @@ CheckCollisionDraw
sec
sbc #1
sta YHit
mva #0 YHit+1
;mwa ydraw YHit
mva #1 HitFlag
sty YHit+1
mva #$ff HitFlag
StopHitChecking
jmp ContinueDraw
@
@@ -272,7 +277,7 @@ ContinueDraw
EndOfDraw
mwa xtempDRAW xdraw
mva ytempDRAW ydraw
mwa ytempDRAW ydraw
rts
.endp
@@ -298,7 +303,7 @@ EndOfDraw
; splot8
mwa xdraw xcircle
mva ydraw ycircle
mwa ydraw ycircle
mwa #0 xc
mva radius yc
@@ -354,11 +359,11 @@ endcircleloop
jsr splot8
mwa xcircle xdraw
mva ycircle ydraw
mwa ycircle ydraw
rts
.endp
;----
splot8 .proc
.proc splot8
; plot xcircle+XC,ycircle+YC
; plot xcircle+XC,ycircle-YC
; plot xcircle-XC,ycircle-YC
@@ -381,12 +386,19 @@ splot8 .proc
adc YC
sta ydraw
sta tempcir
lda ycircle+1
adc #$00
sta ydraw+1
sta tempcir+1
jsr plot
sec
lda ycircle
sbc YC
sta ydraw
lda ycircle+1
sbc #$00
sta ydraw+1
jsr plot
sec
@@ -400,6 +412,8 @@ splot8 .proc
lda tempcir
sta ydraw
lda tempcir+1
sta ydraw+1
jsr plot
;---
clc
@@ -414,12 +428,19 @@ splot8 .proc
adc xC
sta ydraw
sta tempcir
lda ycircle+1
adc #$00
sta ydraw+1
sta tempcir+1
jsr plot
sec
lda ycircle
sbc xC
sta ydraw
lda ycircle+1
sbc #$00
sta ydraw+1
jsr plot
sec
@@ -433,13 +454,15 @@ splot8 .proc
lda tempcir
sta ydraw
lda tempcir+1
sta ydraw+1
jsr plot
RTS
.endp
;--------------------------------------------------
clearscreen .proc
.proc clearscreen
;--------------------------------------------------
lda #$ff
@@ -453,7 +476,7 @@ clearscreen .proc
rts
.endp
;-------------------------------*------------------
placetanks .proc
.proc placetanks
;--------------------------------------------------
ldx #(MaxPlayers-1) ;maxNumberOfPlayers-1
lda #0
@@ -583,7 +606,7 @@ DrawNextTank
.endp
;---------
.proc DrawTankNr
ldx tanknr
ldx tankNr
; let's check the energy
lda eXistenZ,x
bne SkipRemovigPM ; if energy=0 then no tank
@@ -618,6 +641,7 @@ DrawTankNrX
sta xdraw+1
lda ytankstable,x
sta ydraw
mva #0 ydraw+1
jsr TypeChar
@@ -666,10 +690,134 @@ ZeroesToGo
sta (xbyte),y
dey
bne ClearPM
NoPlayerMissile
; draw defensive weapons like shield ( tank number in X )
; in xdraw, ydraw we have coordinates left LOWER corner of Tank char
lda ActiveDefenceWeapon,x
cmp #57 ; one shot shield activation
beq ShieldDraw
cmp #58 ; shield with energy and parachute activation
beq ShieldDraw
cmp #59 ; shield with energy activation
beq ShieldDraw
cmp #61 ; Auto Defence
beq DrawTankShieldWihHorns
cmp #56 ; Mag Deflector
beq DrawTankShieldWihHorns
bne NoShieldDraw
ShieldDraw
jsr DrawTankShield.DrawInPosition
NoShieldDraw
DoNotDrawTankNr
rts
DrawTankShieldWihHorns
jsr DrawTankShield.DrawInPosition
jsr DrawTankShieldHorns
rts
.endp
; -------------------------------------
.proc FlashTank
; -------------------------------------
; number of blinking tank in TankNr
mva #18 fs ; temp, how many times flash the tank
tankflash_loop
lda CONSOL ; turbo mode
cmp #6 ; START
sne:mva #1 fs ; finish it
mva #1 Erase
ldx TankNr
jsr DrawTankNr.SkipRemovigPM ; it's necessary becouse DrawTankNr skips tanks with no energy !
PAUSE 2
mva #0 Erase
ldx TankNr
jsr DrawTankNr.SkipRemovigPM
PAUSE 2
dec fs
jne tankflash_loop
rts
.endp
;--------------------------------------------------
.proc DrawTankShield
; X - tank number
; if use DrawInPosition entry point then:
; xdraw, ydraw - coordinates left LOWER corner of Tank char
; values remain there after a DrawTankNr proc.
;
; this proc change xdraw, ydraw and temp!
;--------------------------------------------------
lda xtankstableL,x
sta xdraw
lda xtankstableH,x
sta xdraw+1
lda ytankstable,x
sta ydraw
mva #0 ydraw+1
DrawInPosition
mva #1 color
lda erase
beq ShieldVisible
dec color
ShieldVisible
sbw xdraw #$03 ; 3 pixels to left
; draw left vertical line of shield ( | )
mva #6 temp ; strange !!!
@
jsr plot
.nowarn dew ydraw
dec temp
bne @-
; draw left oblique line of shield ( / )
mva #4 temp
@
jsr plot
.nowarn dew ydraw
inw xdraw
dec temp
bne @-
; draw top horizontal line of shield ( _ )
mva #5 temp
@
jsr plot
inw xdraw
dec temp
bne @-
; draw right oblique line of shield ( \ )
mva #4 temp
@
jsr plot
inw ydraw
inw xdraw
dec temp
bne @-
; draw right vertical line of shield ( | )
mva #7 temp
@
jsr plot
inw ydraw
dec temp
bne @-
rts
.endp
;--------------------------------------------------
.proc DrawTankShieldHorns
; use only directly after DrawTankShield
; this proc draws a little "horns" on shield.
; Symbol of defensive but aggressive :) weapon
;--------------------------------------------------
.nowarn dew xdraw ; 1 pixel left
sbw ydraw #$0a ; 10 pixels up
jsr plot
.nowarn dew ydraw
inw xdraw
jsr plot
sbw xdraw #$0d ; 13 pixels left
jsr plot
inw xdraw
inw ydraw
jsr plot
rts
.endp
;--------------------------------------------------
@@ -685,6 +833,7 @@ drawmountainsloop
cmp #screenheight
beq NoMountain
sta ydraw
sty ydraw+1
jsr DrawLine
NoMountain
inw modify
@@ -703,6 +852,7 @@ drawmountainspixelloop
ldy #0
lda (modify),y
sta ydraw
sty ydraw+1
jsr plot
inw modify
inw xdraw
@@ -749,7 +899,7 @@ drawmountainspixelloop
adw RangeLeft #mountaintable2 tempor2
NextColumn1
mva #0 ydraw
mwa #0 ydraw
NextPoint1
jsr point
beq StillNothing
@@ -1260,9 +1410,9 @@ MakeMask00
lsr mask1+#
ror mask2+#
.endr
.rept 8
sec
ror char1+#
.rept 8
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char2+#
.endr
dex
@@ -1301,7 +1451,7 @@ EndPutChar
; ------------------------------------------
.proc PutChar4x4
; puts 4x4 pixels char on the graphics screen
; in: xdraw, ydraw (LOWER left corner of the char)
; in: dx, dy (LOWER left corner of the char)
; in: CharCode4x4 (.sbyte)
; in: plot4x4color (0/1)
; all pixels are being drawn
@@ -1355,7 +1505,7 @@ GetUpper4bits
bpl CopyChar
; calculating coordinates from xdraw and ydraw
mwa xdraw xbyte
mwa dx xbyte
lda xbyte
and #$7
@@ -1366,7 +1516,7 @@ GetUpper4bits
rorw xbyte
;---
ldy xbyte
lda ydraw ; y = y - 3 because left lower.
lda dy ; y = y - 3 because left lower.
sec
sbc #3
tax
@@ -1383,9 +1533,9 @@ MakeMask01
lsr mask1+#
ror mask2+#
.endr
.rept 4
sec
ror char1+#
.rept 4
ror char1+# ; in second (and next) lines we have C=1 - one SEC enough
ror char2+#
.endr
dex
@@ -1417,4 +1567,15 @@ EndPut4x4
rts
.endp
.proc SetMainScreen
mva #0 dmactl
VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen
mwa #dl dlptrs ; issue #72 (glitches when switches)
lda dmactls
and #$fc
ora #$02 ; 2=normal, 3 = wide screen width
sta dmactls
rts
.endp
.endif
+1
View File
@@ -147,6 +147,7 @@ NMIST = $D40F ; rejestr statusu przerwa NMI
;-------------------------------------
;additional system variables
;-------------------------------------
ATRACT = $004D
COLPM0S = $02C0 ;- - shadow register COLPM0
COLPM1S = $02C1 ;- - shadow register COLPM1
COLPM2S = $02C2 ;- - shadow register COLPM2
+227 -150
View File
@@ -36,7 +36,7 @@
;we decided it must go in 'English' to let other people work on it
.macro build
dta d"142" ; number of this build (3 bytes)
dta d"144" ; number of this build (3 bytes)
.endm
icl 'definitions.asm'
@@ -55,26 +55,33 @@
.zpvar xc .word
.zpvar temp .word ;temporary word for the most embeded loops only
.zpvar temp2 .word ;same as above
.zpvar modify .word ;origially used to replace self-modyfying code
.zpvar tempXROLLER .word ;same as above for XROLLER routine (used also in result display routine)
.zpvar xtempDRAW .word ;same as above for XDRAW routine
.zpvar ytempDRAW .word ;same as above for XDRAW routine
.zpvar tempor2 .byte
;--------------temps used in circle routine
.zpvar xi .word ;X (word) in draw routine
.zpvar fx .byte ;circle drawing variables
.zpvar fx .byte
.zpvar yi .word ;Y (word) in draw routine
.zpvar fy .byte
.zpvar xk .word
.zpvar fs .byte
.zpvar yc .byte ;ycircle - temporary for circle
.zpvar dx .word
.zpvar tempor2 .byte
.zpvar dy .word
.zpvar dd .word
.zpvar di .word
.zpvar dp .word
.zpvar modify .word
;----------------------------
.zpvar weaponPointer .word
.zpvar dliCounter .byte
.zpvar pressTimer .byte
.zpvar NTSCcounter .byte
;.zpvar dliA .byte
;.zpvar dliX .byte
;.zpvar dliY .byte
;* RMT ZeroPage addresses
.zpvar p_tis .word
.zpvar p_trackslbstable .word
@@ -98,11 +105,12 @@
icl 'lib/atari.hea'
icl 'lib/macro.hea'
;splash screen and musix
icl 'artwork/HIMARS14.asm'
;Game loading address
ORG $3000
WeaponFont
ins 'artwork/weapons_AW5.fnt' ; 'artwork/weapons.fnt'
ins 'artwork/weapons_AW5_mod.fnt' ; 'artwork/weapons.fnt'
;-----------------------------------------------
;Screen displays go here to avoid crossing 4kb barrier
;-----------------------------------------------
@@ -117,33 +125,42 @@ START
; Startup sequence
jsr Initialize
jsr Options ;startup screen
lda escFlag
bne START
jsr EnterPlayerNames
lda escFlag
bne START
jsr RandomizeSequence
; for the round #1 shooting sequence is random
; activate mag deflector for all players (test)
; ldx numberOfPlayers
; dex
;@
; mva #56 ActiveDefenceWeapon,x
; tay
; lda DefensiveEnergy,y
; sta ShieldEnergy,x ; set energy of shield
; dex
; bpl @-
; mag deflector activated! (test)
MainGameLoop
VDLI DLIinterruptText ; jsr SetDLI for text (purchase) screen
jsr CallPurchaseForEveryTank
; issue #72 (glitches when switches)
mva #0 dmactl
lda dmactls
and #$fc
;ora #$02 ; 2=normal, 3 = wide screen width, 0 = no screen
sta dmactls
jsr GetRandomWind
jsr RoundInit
jsr MainRoundLoop
lda escFlag
bne START
mva #0 TankNr ;
jsr SortSequence
@@ -248,51 +265,46 @@ skipzeroing
; the shooting angle is randomized
; of course gains an looses are zeroed
;jsr StatusDisplay
lda #0
tax
@
sta singleRoundVars,x
inx
cpx #(singleRoundVarsEnd-singleRoundVars)
@ sta singleRoundVars,x
inx
cpx #(singleRoundVarsEnd-singleRoundVars)
bne @-
ldx #(MaxPlayers-1)
SettingEnergies
lda #$00
sta gainL,x
sta gainH,x
sta looseL,x
sta looseH,x
lda #99
sta Energy,x
sta eXistenZ,x
sta LASTeXistenZ,x
; anything in eXistenZ table means that this tank exist
; in the given round
lda #<1000
sta MaxForceTableL,x
lda #>1000
sta MaxForceTableH,x
lda #<350
sta ForceTableL,x
lda #>350
sta ForceTableH,x
;lda #(255-45)
;it does not look good when all tanks have
;barrels pointing the same direction
;so it would be nice to have more or less random
;angles
jsr RandomizeAngle
sta AngleTable,x
dex
lda #$00
sta gainL,x
sta gainH,x
sta looseL,x
sta looseH,x
lda #99
sta Energy,x
sta eXistenZ,x
sta LASTeXistenZ,x
; anything in eXistenZ table means that this tank exist
; in the given round
lda #<1000
sta MaxForceTableL,x
lda #>1000
sta MaxForceTableH,x
lda #<350
sta ForceTableL,x
lda #>350
sta ForceTableH,x
;lda #(255-45)
;it does not look good when all tanks have
;barrels pointing the same direction
;so it would be nice to have more or less random
;angles
jsr RandomizeAngle
sta AngleTable,x
dex
bpl SettingEnergies
mva #0 CurrentResult
;generating the new landscape
jsr PMoutofScreen ;let P/M disappear
jsr clearscreen ;let the screen be clean
@@ -300,13 +312,7 @@ SettingEnergies
jsr calculatemountains ;let mountains be easy for the eye
;jsr calculatemountains0 ;only for tests - makes mountains flat and 0 height
VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen
mwa #dl dlptrs ; issue #72 (glitches when switches)
lda dmactls
and #$fc
ora #$02 ; 2=normal, 3 = wide screen width
sta dmactls
jsr SetMainScreen
jsr drawmountains ;draw them
jsr drawtanks ;finally draw tanks
@@ -322,6 +328,7 @@ SettingEnergies
; tank with energy greater than 0 left
ldy #0 ; in Y - number of tanks with energy greater than zero
sty ATRACT ; reset atract mode
ldx NumberOfPlayers
dex
CheckingIfRoundIsFinished
@@ -343,8 +350,7 @@ WhichTankWonLoop
bne ThisOneWon
dex
bpl WhichTankWonLoop
;error here!!!
;stop
;error was here!!!
; somehow I believed program will be never here
; but it was a bad assumption
; god knows when there is such a situation
@@ -354,7 +360,6 @@ WhichTankWonLoop
; second tank explodes and kills the first one.
; and code lands here...
; looks like no one won!
rts
ThisOneWon
@@ -376,7 +381,6 @@ DoNotFinishTheRound
jsr DisplaySeppuku
jmp Seppuku
;ldx TankNr
@
ldx TankSequencePointer
lda TankSequence,x
@@ -394,12 +398,20 @@ DoNotFinishTheRound
lda SkillTable,x
beq ManualShooting
RoboTanks
RoboTanks
; robotanks shoot here
jsr ArtificialIntelligence
jsr MoveBarrelToNewPosition
jsr StatusDisplay ;all digital values like force, angle, wind, etc.
jsr DisplayStatus ;all digital values like force, angle, wind, etc.
jsr PutTankNameOnScreen
lda kbcode
cmp #28 ; ESC
bne @+
jsr AreYouSure
lda escFlag
seq:rts
@
; let's move the tank's barrel so it points the right
; direction
jmp AfterManualShooting
@@ -408,18 +420,24 @@ ManualShooting
jsr WaitForKeyRelease
jsr BeforeFire
lda escFlag
seq:rts
AfterManualShooting
inc noDeathCounter
jsr DecreaseWeaponBeforeShoot
jsr StatusDisplay
jsr DisplayStatus
ldx TankNr
dec Energy,x ; lower energy to eventually let tanks commit suicide
ShootNow
jsr Shoot
;here we clear offensive text (after a shoot)
ldy TankNr
mva #0 plot4x4color
jsr DisplayOffensiveTextNr
lda HitFlag ;0 if missed
beq missed
@@ -431,12 +449,13 @@ ShootNow
continueMainRoundLoopAfterSeppuku
;here we clear offensive text (after a shoot)
ldy TankNr
mva #0 plot4x4color
jsr DisplayOffensiveTextNr
;ldy TankNr
;mva #0 plot4x4color
;jsr DisplayOffensiveTextNr
AfterExplode
; TODO: IS IT OK??? possibly a fix here needed for #56
ldy WeaponDepleted
bne @+
ldx TankNr
@@ -474,11 +493,8 @@ missed
jsr DisplayOffensiveTextNr
NextPlayerShoots
;mva #1 Erase
;jsr drawtanks
;before it shoots, the eXistenZ table must be
;updated accordingly to actual energy (was forgotten, sorry to ourselves)
;before it shoots, the eXistenZ table must be updated
;accordingly to actual energy (was forgotten, sorry to ourselves)
ldx #(MaxPlayers-1)
SeteXistenZ
@@ -489,7 +505,7 @@ SeteXistenZ
;DATA L1,L2
;Multiplication 8bit*8bit,
;result 16bit
;this algiorithm is a little longer than in Ruszczyc 6502 book
;this algiorithm is a little longer than one in Ruszczyc 6502 book
;but it is faster
LDy #8
@@ -514,13 +530,6 @@ B0 DEY
;was setup of maximum energy for players
;mva #0 Erase
;jsr drawtanks
inc:lda TankSequencePointer
cmp NumberOfPlayers
bne PlayersAgain
mva #0 TankSequencePointer
PlayersAgain
@@ -552,27 +561,14 @@ NoPlayerNoDeath
dex
bpl CheckingPlayersDeath
; if processor is here it means there are no more explosions
inc:lda TankSequencePointer
cmp NumberOfPlayers
sne:mva #0 TankSequencePointer
jmp MainRoundLoop
.endp
;---------------------------------
.proc Seppuku
lda #0
sta FallDown1
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
jsr ExplosionDirect
jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku
.endp
;---------------------------------
.proc PlayerXdeath
@@ -605,8 +601,13 @@ NoPlayerNoDeath
ldy TankTempY
mva #1 plot4x4color
jsr DisplayOffensiveTextNr
; tank flash
ldy TankTempY
mva TankNr temp2 ; not elegant, and probably unnecessary
sty TankNr
jsr FlashTank ; blinking and pausing (like PAUSE 72 - 18x(2+2) )
mva temp2 TankNr
PAUSE 75
;Deffensive text cleanup
;here we clear Deffensive text (after a shoot)
ldy TankTempY
@@ -627,7 +628,7 @@ NoPlayerNoDeath
sbc #4
sta ydraw
lda #0
sta ydraw+1 ; there is 0 left in A, so... TODO: bad code above. revisit when transitioning ydraw to byte
sta ydraw+1 ; there is 0 left in A, so... TODO: bad code above. revisit
;cleanup of the soil fall down ranges (left and right)
sta RangeRight
@@ -636,12 +637,9 @@ NoPlayerNoDeath
sta FallDown2
mwa #screenwidth RangeLeft
; We are randomizing the weapon now.
; jumping into the middle of the explosion
; routine
MetodOfDeath
lda random
and #%00011111 ; range 0-31
@@ -652,19 +650,16 @@ MetodOfDeath
jsr ExplosionDirect
mva #sfx_silencer sfx_effect
; jump to after explosion routines (soil fallout, etc.)
; After going through these routines we are back
; to checking if a tank exploded and maybe we have
; a deadly shot here again.
jmp MainRoundLoop.AfterExplode
.endp
;--------------------------------------------------
.proc DecreaseEnergyX
;Decreases energy of player nr X
;Decreases energy of player nr X by the value Y
;increases his financial loss
;increases gain of tank TankNr
;--------------------------------------------------
@@ -703,23 +698,82 @@ NotNegativeEnergy
.endp
;--------------------------------------------------
GetRandomWind .proc
.proc DecreaseShieldEnergyX
; Decreases energy of shield player nr X by the value Y
; if shield energy is 0 after decrease then in Y we have
; rest of the energy - to decrease tank energy
;--------------------------------------------------
sty EnergyDecrease
ldy #0 ; if Shield survive then no decrease tank anergy
; Energy cannot be less than 0
lda ShieldEnergy,x
cmp EnergyDecrease
bcc UseAllShieldEnergy
;sec
sbc EnergyDecrease
bpl NotNegativeShieldEnergy ; jump allways
UseAllShieldEnergy
; now calculate rest of energy for future tank energy decrease
sec
lda EnergyDecrease
sbc ShieldEnergy,x
tay
lda #0
NotNegativeShieldEnergy
sta ShieldEnergy,x
rts
.endp
;---------------------------------
.proc Seppuku
lda #0
sta FallDown1
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
jsr ExplosionDirect
jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku
.endp
;--------------------------------------------------
.proc GetRandomWind
;in: MaxWind (byte)
;out: Wind (word)
;uses: _
;--------------------------------------------------
lda random
cmp MaxWind
bcs GetRandomWind ; if more than MaxWind then randomize again
sta Wind
mva #$00 Wind+1
; multiply Wind by 16 and take it as a decimal part (0.Wind)
sta Wind+2
sta Wind+3
; multiply Wind by 16
; two bytes of Wind are treated as a decimal part of vx variable
:4 aslw Wind
; decide the direction
lda random
and #$01
sta WindOrientation
rts
beq @+
sec ; Wind = -Wind
.rept 4
lda #$00
sbc Wind+#
sta Wind+#
.endr
@ rts
.endp
;--------------------------------------------------
PMoutofScreen .proc
.proc PMoutofScreen
;--------------------------------------------------
lda #$00 ; let all P/M disappear
:8 sta hposp0+#
@@ -729,38 +783,37 @@ PMoutofScreen .proc
;--------------------------------------------------
.proc WeaponCleanup;
; cleaning of the weapon possesion tables
; (99 of Baby Missles, all other weapons=0)
; 99 of Baby Missles(index==0), all other weapons=0)
;--------------------------------------------------
ldx #$3f
lda #$0
loop05
sta TanksWeapon1,x
sta TanksWeapon2,x
sta TanksWeapon3,x
sta TanksWeapon4,x
sta TanksWeapon5,x
sta TanksWeapon6,x
dex
bne @+
lda #99
bne loop05
@ bpl loop05
ldx #$3f ; TODO: maxweapons
@ lda #$0
cpx #48 ; White Flag
bne @+
lda #99
@ sta TanksWeapon1,x
sta TanksWeapon2,x
sta TanksWeapon3,x
sta TanksWeapon4,x
sta TanksWeapon5,x
sta TanksWeapon6,x
dex
beq setBmissile
bpl @-1
rts
setBmissile
lda #99
bne @-
.endp
;--------------------------------------------------
.proc Initialize
;Initialization sequence
;uses: temp, ...
;--------------------------------------------------
deletePtr = temp
lda #0
sta Erase
sta tracerflag
sta GameIsOver
sta escFlag
; clean variables
lda #0
tay
mwa #variablesStart deletePtr
@ tya
@@ -843,7 +896,8 @@ ClearResults
bne ClearResults
mva #1 CurrentRoundNr ;we start from round 1
mva #6 NTSCcounter
; RMT INIT
lda #$f0 ;initial value
sta RMTSFXVOLUME ;sfx note volume * 16 (0,16,32,...,240)
@@ -861,8 +915,10 @@ ClearResults
rts
.endp
DLIinterruptGraph .proc
pha
.proc DLIinterruptGraph
;sta dliA
;sty dliY
pha
phy
ldy dliCounter
lda dliColorsBack,y
@@ -873,27 +929,46 @@ DLIinterruptGraph .proc
sta COLPF1
sty COLPF2
inc dliCounter
ply
;ldy dliY
;lda dliA
ply
pla
rti
.endp
DLIinterruptText .proc
pha
.proc DLIinterruptText
;sta dliA
pha
sta WSYNC
mva #TextBackgroundColor colpf2
mva #TextForegroundColor colpf3
pla
;lda dliA
pla
DLIinterruptNone
rti
.endp
VBLinterrupt .proc
.proc VBLinterrupt
pha
phx
phy
mva #0 dliCounter
lda PAL
and #%00001110
beq itsPAL
;it is NTSC here
dec NTSCcounter
bne itsPAL
mva #6 NTSCcounter
bne exitVBL ; skip doing VBL things each 6 frames in Amerika, Amerika
; We're all living in Amerika, Coca Cola, Wonderbra
itsPAL
; pressTimer is trigger tick counter. always 50 ticks / s
bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s
; ------- RMT -------
lda sfx_effect
bmi lab2
asl @ ; * 2
@@ -901,13 +976,14 @@ VBLinterrupt .proc
ldx #0 ;X = 0 channel (0..3 or 0..7 for stereo module)
lda #0 ;A = 12 note (0..60)
jsr RASTERMUSICTRACKER+15 ;RMT_SFX start tone (It works only if FEAT_SFX is enabled !!!)
;
lda #$ff
sta sfx_effect ;reinit value
;
lab2
jsr RASTERMUSICTRACKER+3 ;1 play
; ------- RMT -------
exitVBL
ply
plx
pla
@@ -975,7 +1051,7 @@ UsageLoop
rts
.endp
;----------------------------------------------
RandomizeAngle .proc ;
.proc RandomizeAngle
; routine returns in A
; a valid angle for the tank's barrel.
; X is not changed
@@ -998,7 +1074,7 @@ RandomizeAngle .proc ;
rts
.endp
;----------------------------------------------
RandomizeForce .proc
.proc RandomizeForce
; routine returns in ForceTable/L/H
; valid force of shooting for TankNr
; in X must be TankNr
@@ -1168,7 +1244,8 @@ nextishigher
.endp
;--------------------------------------------------
.proc getkey ; waits for pressing a key and returns pressed value in A
.proc GetKey ; waits for pressing a key and returns pressed value in A
; when [ESC] is pressed, escFlag is set to 1
;--------------------------------------------------
jsr WaitForKeyRelease
@
@@ -1210,7 +1287,7 @@ getkeyend
.endp
;--------------------------------------------------
getkeynowait .proc;
.proc getkeynowait
;--------------------------------------------------
jsr WaitForKeyRelease
lda kbcode
@@ -1218,7 +1295,7 @@ getkeynowait .proc;
rts
.endp
;--------------------------------------------------
WaitForKeyRelease .proc
.proc WaitForKeyRelease
;--------------------------------------------------
lda JSTICK0
and #$0f
BIN
View File
Binary file not shown.
+425 -226
View File
File diff suppressed because it is too large Load Diff
+67 -59
View File
@@ -8,34 +8,31 @@
; compilation to e.g. cartridge
; zero page variables are declared in program.s65 module
;=====================================================
;--------------------------------------------------
;Variables
;--------------
TanksNames ; DO NOT ZERO - ticket #24
:6 dta d" "
;----------------------------
;----------------------------------------------------
;Options DO NOT ZERO - ticket #27
OptionsTable .by 0,0,2,2,0,1,3
RoundsInTheGame .by 10 ;how many rounds in the current game
seppukuVal .by 75
;--------------------------------------------------
;----------------------------------------------------
skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning, ticket #30)
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
; 4x4 text buffer
ResultLineBuffer
dta d" "
.byte $ff
dta d" ", $ff
LineHeader1
dta d"# ROUND: "
RoundNrDisplay
dta d" #"
.byte $ff
dta d" #", $ff
;=====================================================
variablesStart ; zeroing starts here
drawFunction .ds 1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
;=====================================================
isInventory .ds 1 ; 0 - purchase, $ff - inventory
;--------------
escFlag .ds 1
drawFunction .ds 1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
;--------------
sfx_effect .ds 1
;--------------
@@ -47,30 +44,32 @@ flyDelay .ds 1
NumberOfPlayers .DS 1 ;current number of players (counted from 1)
TankSequence .DS [MaxPlayers] ;sequence of shooting during the Round
GameIsOver .DS 1 ; 1 means it was the last round in the game
;-----------------------------------
;----------------------------------------------------
moneyH ;we place zero at the end of prices and money
;and have range from 0 to 99990 (not too much)
;money players have (maybe one more byte is needed?)
.DS [MaxPlayers]
moneyL
moneyL
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
gainH ;how much money player gets after the round
;it is gathered during the round basing on energy
;opponents loose after player's shoots
.DS [MaxPlayers]
gainL
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
looseH ;how much player looses after the round
;calculated from REAL energy loss
;(not only to zero energy)
.DS [MaxPlayers]
looseL
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
Energy
.DS [MaxPlayers]
ShieldEnergy
.DS [MaxPlayers]
EnergyDecrease .DS 1
eXistenZ
.DS [MaxPlayers]
@@ -81,9 +80,7 @@ ResultsTable ;the results in the gameeeeee
.DS [MaxPlayers]
TempResults
.DS [MaxPlayers]
CurrentResult
.DS 1
;-----------------------------------
;----------------------------------------------------
ForceTableL ;shooting Force of the tank during the round
.DS [MaxPlayers]
ForceTableH
@@ -93,35 +90,38 @@ MaxForceTableL ;Energy of the tank during the round
.DS [MaxPlayers] ;1000 is the default
MaxForceTableH
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
AngleTable ;Angle of the barrel of each tank during the round
.DS [MaxPlayers]
NewAngle .DS 1
;-----------------------------------
;----------------------------------------------------
ActiveWeapon ;number of the selected weapon
.DS [MaxPlayers]
ActiveDefenceWeapon ;number of the activated defence weapon - 0
.DS [MaxPlayers]
WeaponDepleted .DS 1 ; if 0 deactivate the weapon and switch to Baby Missile
;-----------------------------------
;----------------------------------------------------
;format of the 3-byte static point number used in the game
; 20203.5 => 128 : <20203 : >20203
;-----------------------------------
;----------------------------------------------------
L1 .DS 1 ; variable used in multiplications (by 10:)
gravity .DS 1 ;only the decimal part (1/10 = 25)
;-----------------------------------
;----------------------------------------------------
Wind .ds 2 ;walue displayed on the screen
;multiplied by 16 (decimal part only)
;-----------------------------------
Wind .ds 4 ;format: 0000.hhll
;walue displayed on the screen is
;decimal portion divided by 16 (>>4)
;----------------------------------------------------
MaxWind .ds 1 ;
WindOrientation .DS 1 ;(0-right,1-left)
;-----------------------------------
;----------------------------------------------------
Counter .DS 1 ;temporary Counter for outside loops
HitFlag .DS 1 ;1 when missile hit anything
;-----------------------------------
HitFlag .DS 1 ;$ff when missile hit ground, $00 when no hit, $01-$06 tank index+1 when hit tank
;----------------------------------------------------
xtankstableL ;X positions of tanks (lower left point)
.DS [MaxPlayers]
xtankstableH
@@ -130,17 +130,17 @@ ytankstable ;Y positions of tanks (lower left point)
.DS [MaxPlayers]
LowResDistances ; coarse tank positions divided by 4 (to be in just one byte)
.DS [MaxPlayers]
;-----------------------------------
;----------------------------------------------------
Erase .DS 1 ; if 1 only mask of the character is printed
; on the graphics screen. if 0 character is printed normally
;-----------------------------------
;----------------------------------------------------
RangeLeft .DS 2 ;range of the soil to be fallen down
RangeRight .DS 2 ;it is being set by all Explosions
;-----------------------------------
;----------------------------------------------------
WeaponRangeLeft .DS 2 ;Range of the Explosion of the given weapon
WeaponRangeRight .DS 2
;--------------------------------------------------
;----------------------------------------------------
;xroller
HowMuchToFall .ds 1
HeightRol .DS 1
@@ -173,14 +173,14 @@ LineLength .DS 2
;circle
radius .DS 1
xcircle .DS 2
ycircle .DS 1
ycircle .DS 2
tempcir .DS 2
;TankFalls
IfFallDown .DS 1
PreviousFall .DS 1
EndOfTheFallFlag .DS 1 ; in case of the infinite fall
Parachute .DS 1 ; are you insured with parachute?
; -------------------------------------------------
;----------------------------------------------------
;Flight
;variables for 5 missiles (used for mirv)
xtraj00 .DS [5] ; 3 bytes of xtraj times 5. Lowest byte
@@ -193,7 +193,9 @@ vx03 .DS [5]
MirvDown .DS [5] ; is given missile down?
MirvMissileCounter .DS 1 ; missile Counter (mainly for X)
SmokeTracerFlag .DS 1 ; if Smoketracer
; -------------------------------------------------
XposFlag .DS 1 ; bullet positon X (0 - on screen , %1000000 - off-screen)
YposFlag .DS 1 ; bullet positon Y (0 - on screen , %1000000 - over the screen , %0100000 - under the screen)
;----------------------------------------------------
;CheckCollisionWithTank
vx .ds 4 ; 0,0,0,0 ;two decimal bytes, two whole bytes (DC.BA)
vy .ds 4 ;0,0,0,0
@@ -205,12 +207,11 @@ Angle .DS 1
Force .ds 3 ; 0,0,0
Multiplier .ds 3 ; 0,0,0
Multiplee .ds 2 ; 0,0
Result .ds 3 ; 0,0,0
goleft .DS 1 ;if 1 then flights left
;--------------------------------------------------
;----------------------------------------------------
;SoilDown2
IsEndOfTheFallFlag .DS 1
; -------------------------------------------------
;----------------------------------------------------
;unPlot
WhichUnPlot .DS 1
; max 5 concurrent unPlots
@@ -224,7 +225,7 @@ xtrajfb .DS 2
ytrajfb .DS 2
;
tracerflag .DS 1
; -------------------------------------------------
;----------------------------------------------------
;TypeChar
mask1 .DS [8]
mask2 .DS [8]
@@ -242,17 +243,15 @@ UpNdown .DS 1
temptankX .DS 2
temptankNr .DS 1
; -------------------------------------------------
;----------------------------------------------------
;Variables from textproc.s65
; tables with numbers of weapons on the right lists
; to be honest - I do not know at the moment what the above
; comment was supposed to mean...
; tables with indexes of weapons on the right lists
; OK (2022) so, L1 is list of offensive weapons, L2 - defensive
NubersOfWeaponsL1
.ds 8*5 ; :(8*5) .by $ff
NubersOfWeaponsL2
.ds 8*2 ; :(8*2) .by $ff
; -------------------------------------------------
IndexesOfWeaponsL1
.ds 8*5 ; max 40 offensive weapons. this is wrong, should be 48, still only 32 defined.
IndexesOfWeaponsL2
.ds 8*2 ; max 16 defensive weapons.
;----------------------------------------------------
; variables storing amount of weapons on the first and second
; list and pointer position
@@ -275,14 +274,14 @@ WhichList ; list currently on the screen
OffsetDL1 ; offset of the list screen (how many lines)....
.DS 1
; -------------------------------------------------
;----------------------------------------------------
;mark the level
PositionInName ; cursor position in name of the player when name input
.DS 1
DifficultyLevel ; Difficulty Level (human/cpu)
.DS 1
;-------------------------------------------------
;----------------------------------------------------
;displaydecimal
decimal .DS 2
decimalresult .DS 4
@@ -297,7 +296,7 @@ FallDown2 .DS 1
LeapFrogAngle .DS 1
;laser
LaserCoordinate .DS 8 ; 2,2,2,2
; -------------------------------------------------
;----------------------------------------------------
; Here go tables with weapons possesed by a given tank
; Index in the table means weapon type
; number entered means ammo for given weapon possessed (max 99)
@@ -324,7 +323,7 @@ mountaintable2 ;table of mountains (size=screenwidth)
.DS [screenwidth]
.DS 1 ; additional byte for fallout (sometimes 1 pixel)
MountaintableEnd ;good for table clearing
;----------------------------------------------
;----------------------------------------------------
TextPositionX .DS 2
TextPositionY .DS 1
TextAddress .DS 2
@@ -333,8 +332,16 @@ TextNumberOff .DS 1
;--------------
TankTempY
.DS 1
;----------------------------------------------------
;-------------- single round variables --------------
;----------------------------------------------------
singleRoundVars
;--------------
escFlag .ds 1
;--------------
CurrentResult
.DS 1
;--------------
previousAngle
.DS [MaxPlayers]
previousEnergyL
@@ -352,9 +359,9 @@ RandBoundaryHigh
AngleTablePointer
.DS 1
singleRoundVarsEnd
;----------------------------------------------
;----------------------------------------------------
; 4x4 texts
;----------------------------------------------
;----------------------------------------------------
LineAddress4x4
.DS 2
LineCharNr
@@ -372,8 +379,9 @@ ResultY
ResultOfTankNr
.DS 1
;----------------------------
;----------------------------------------------------
;PutChar4x4
;----------------------------------------------------
LoopCounter4x4 .DS 1
y4x4 .DS 1
StoreA4x4 .DS 1
@@ -385,6 +393,6 @@ plot4x4color .DS 1 ;1-white, 0-background
variablesEnd
;----------------------------
;----------------------------------------------------
.endif
+408 -302
View File
File diff suppressed because it is too large Load Diff