/[projet1]/users/dbug/games/cyclotron/cyclotron.s
Defence Force logotype

Contents of /users/dbug/games/cyclotron/cyclotron.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (show annotations)
Sun Mar 29 10:49:58 2009 UTC (10 years, 9 months ago) by dbug
File size: 60773 byte(s)
Added Cyclotron, a 4k arcade game based on Light Cycles
1
2 ;// --------------------------------------
3 ;// Cyclontron
4 ;// --------------------------------------
5 ;// (c) 2004 Mickael Pointier
6 ;// This code is provided as-is.
7 ;// I do not assume any responsability
8 ;// concerning the fact this is a bug-free
9 ;// software !!!
10 ;// Except that, you can use this example
11 ;// without any limitation !
12 ;// If you manage to do something with that
13 ;// please, contact me :)
14 ;// --------------------------------------
15 ;// For more information, please contact me
16 ;// on internet:
17 ;// e-mail: mike@defence-force.org
18 ;// URL: http://www.defence-force.org
19 ;// --------------------------------------
20 ;// Note: This text was typed with a Win32
21 ;// editor. So perhaps the text will not be
22 ;// displayed correctly with other OS.
23
24
25 ;//
26 ;// ROM system defines
27 ;// (Works only on ROM 1.1)
28 ;//
29 #define _rom_hires $ec33
30 //#define _rom_text $ec21
31
32 #define _rom_ink $f210
33 #define _rom_paper $f204
34
35 #define _rom_ping $fa9f
36 #define _rom_shoot $fab5
37 #define _rom_zap $fae1
38 #define _rom_explode $facb
39
40 #define _rom_kbdclick1 $fb14
41 #define _rom_kbdclick2 $fb2a
42
43 //#define _rom_cls $ccce
44 //#define _rom_lores0 $d9ed
45 //#define _rom_lores1 $d9ea
46
47 #define _rom_curset $f0c8
48 #define _rom_curmov $f0fd
49 #define _rom_draw $f110
50 #define _rom_fill $f268
51 #define _rom_circle $f37f
52
53 #define _rom_redef_chars $f8d0
54
55 #define KEY_NONE $38
56 #define KEY_UP 11 //$9c
57 #define KEY_DOWN 10 //$b4
58 #define KEY_LEFT 8 //$ac
59 #define KEY_RIGHT 9 //$bc
60 #define KEY_SPACE 32 //$84
61 #define KEY_P 80 //$9d
62 #define KEY_DELETE 127
63 #define KEY_ESCAPE 27 //$a9
64 #define KEY_ENTER 13
65
66
67 ;//
68 ;// Vectorial draw engine commands
69 ;//
70 #define CMD_END 0
71 #define CMD_CURSET 1
72 #define CMD_CURMOV 2
73 #define CMD_DRAW 3
74 #define CMD_CIRCLE 4
75 #define CMD_FILL 5
76
77 #define CMD_NO_DRAW 128
78
79
80 ;//
81 ;// The various text messages
82 ;//
83 #define MESSAGE_PRESS_SPACE 0
84 #define MESSAGE_TABLE_NAMES 1
85 #define MESSAGE_LEVEL_NUMBER 2
86 #define MESSAGE_ENTER_NAME 3
87
88 ;//
89 ;// The various kinds of game
90 ;//
91 #define MESSAGE_GAMETYPE 4
92 #define GAMETYPE_FIND_THE_EXIT 0
93 #define GAMETYPE_SNAKE 1
94 #define GAMETYPE_DUEL 2
95 #define GAMETYPE_SURVIVOR 3
96 #define _GAMETYPE_COUNT_ 4
97
98 #define MESSAGE_ARENATYPE 8
99 #define ARENATYPE_WALLS_NONE 0 // No walls, it warps in all directions
100 #define ARENATYPE_WALLS_HORIZONTAL 1 // Walls on left and right side, warps verticaly
101 #define ARENATYPE_WALLS_VERTICAL 2 // Walls on top and bottom side, warps horizontaly
102 #define ARENATYPE_WALLS_ALL 3 // Walls on all sides, no warp around
103 #define _ARENATYPE_COUNT_ 4
104
105 #define MESSAGE_AVOID_COLLISION 12
106 #define MESSAGE_PAUSE 13
107 #define MESSAGE_GAME_OVER 14
108
109
110 #define ARENACOLOR_BLACK 0
111 #define ARENACOLOR_GREEN 1
112 #define ARENACOLOR_CHESSBOARD 2
113 #define ARENACOLOR_GRID 3
114
115 #define DIRECTION_LEFT 0 // 0 <-
116 #define DIRECTION_UP 1 // 1 ^
117 #define DIRECTION_RIGHT 2 // 2 ->
118 #define DIRECTION_DOWN 3 // 3 v
119
120
121 #define _LEVEL_COUNT_ 8 // The number of levels defined in the table (in case we warp)
122
123 #define CONTROLMODE_RELATIVE 0 // LEFT and RIGHT keys to turn
124 #define CONTROLMODE_ABSOLUTE 1 // Use the 4 direction keys to choose the direction
125
126 #define ERASEMEMORY_TRONLOGO 0
127 #define ERASEMEMORY_TEXT_INTRO 1
128 #define ERASEMEMORY_TEXT_GAME 2
129 #define ERASEMEMORY_TEXT_GAME_16 3
130 #define ERASEMEMORY_ZEROPAGE 4
131 #define ERASEMEMORY_BSS 5
132
133 #define OBSTACLE_NONE 0
134 #define OBSTACLE_CORRIDOR 1
135 #define OBSTACLE_MICKEY 2
136 #define OBSTACLE_CROSS 4
137 #define OBSTACLE_UTURN 8
138 #define OBSTACLE_ROUNDEDSHAPES 16
139 //#define OBSTACLE_BLOCKS 32
140
141
142
143 ;//
144 ;// Zero page definition
145 ;//
146
147 .zero
148
149 *= $50
150
151 ;// Some two byte values
152 _zp_start_
153
154 // Keep these 2 ones consecutive
155 // so the "Normalize" code can work
156 base_coordinates
157 map_y .dsb 1
158 player_y .dsb 1
159 opponent_y .dsb 1
160
161 map_x .dsb 1
162 player_x .dsb 1
163 opponent_x .dsb 1
164
165 player_adress_low .dsb 1
166 opponent_adress_low .dsb 1
167 player_adress_high .dsb 1
168 opponent_adress_high .dsb 1
169
170
171 ptr_player .dsb 2
172 ptr_opponent .dsb 2
173
174 // 0 <-
175 // 1 ^
176 // 2 ->
177 // 3 v
178 player_direction .dsb 1
179 opponent_direction .dsb 1
180 current_distance .dsb 1
181 best_distance .dsb 1
182
183
184 intro_memo_ptr .dsb 1
185 intro_memo_command .dsb 1
186 intro_memo_count .dsb 1
187
188 flag_double_size .dsb 1
189
190 save_a .dsb 1
191 save_x .dsb 1
192 save_y .dsb 1
193
194 cursor_pos .dsb 1
195
196 temp_x .dsb 1
197 temp_y .dsb 1
198 temp_color .dsb 1
199
200 explode_x .dsb 2
201 explode_y .dsb 2
202 explode_color_offset .dsb 1
203
204 primitive_x .dsb 1
205 primitive_y .dsb 1
206 circle_color .dsb 1
207 circle_radius .dsb 1
208 circle_radius_squared .dsb 1
209
210 exit_color .dsb 1
211
212 remaining_lifes .dsb 1
213 current_level .dsb 1
214 life_colors .dsb 3
215
216 game_type .dsb 1
217 arena_type .dsb 1
218 arena_color .dsb 1
219 arena_obstacles .dsb 1
220
221 timer_position .dsb 1
222 timer_decay_value .dsb 1
223 timer_decay_speed .dsb 1
224
225 control_mode .dsb 1
226
227 raster_direction .dsb 1 // 0 => down
228
229
230 computemap_tmp_x .dsb 1
231
232 ColorsCounter .dsb 1
233 GradientOffet .dsb 1
234 ColorLineGradientOffset .dsb 1
235
236 ptr_base_dst
237 pl_base_dst .dsb 1
238 ph_base_dst .dsb 1
239
240 ptr_dst
241 pl_dst .dsb 1
242 ph_dst .dsb 1
243
244 ptr_src
245 pl_src .dsb 1
246 ph_src .dsb 1
247
248 counter_1 .dsb 2
249 counter_2 .dsb 2
250
251 tmp1 .dsb 1
252
253 dummy_collide .dsb 1 ;// Used as a place holder for collision in one player mode
254
255
256 ;// Some one byte temporaries
257 offset_src .dsb 1 ;// Position related to ptr_src
258 offset_dst .dsb 1 ;// Position related to ptr_dst
259
260 base_offset_dst .dsb 1 ;// Position related to ptr_dst
261
262
263 b_tmp1 .dsb 1
264 b_tmp2 .dsb 1
265 ;b_tmp3 .dsb 1
266
267 last_key_press .dsb 1
268
269
270 _zp_end_
271
272
273 .text
274
275 _main
276 //jmp _main
277 //brk
278
279 ;// Debounce keyboard (bug init Euphoric)
280 jsr _KeyboardDebounce
281
282 ;// ======================
283 ;// Inits
284 ;// ======================
285
286 ;// ======================
287 ;// We need to start each new game with a completely
288 ;// rebuilt screen, cleared BSS, reseted variables.
289 ;// The only thing that should not be reseted is the
290 ;// hiscores counter !
291 ;// ======================
292
293 ;//
294 ;// Clear the zero page adresses
295 ;//
296 ldx #ERASEMEMORY_ZEROPAGE
297 jsr _EraseMemory
298
299 ;// Set the control mode to relative by default
300 lda #CONTROLMODE_RELATIVE
301 sta control_mode
302
303 intro_start
304 ;//
305 ;// Clear the BSS section
306 ;//
307 ldx #ERASEMEMORY_BSS
308 jsr _EraseMemory
309
310
311
312
313 ;// ======================
314 ;// Intro sequence
315 ;// ======================
316 // Black paper
317 //ldy #0+16
318 //sty $26c // PAPER value
319 ldy #0
320 jsr _Intro_SetSingleParam
321 jsr _rom_paper
322
323 // Switch to HIRES
324 jsr _ClearVideo
325 jsr _rom_hires
326
327 ;// NOKEYCLICK+SCREEN no cursor
328 ;//
329 ;// We then need to remove the keyclick,
330 ;// and also disable the cursor flashing
331 ;// that is enabled after a HIRES switch.
332 ;//
333 ;// #define CURSOR 0x01 /* Cursor on (ctrl-q) */
334 ;// #define SCREEN 0x02 /* Printout to screen on (ctrl-s) */
335 ;// #define NOKEYCLICK 0x08 /* Turn keyclick off (ctrl-f) */
336 ;// #define PROTECT 0x20 /* Protect columns 0-1 (ctrl-]) */
337 lda #8+2 ;// NOKEYCLICK+SCREEN no cursor
338 sta $26a
339
340 // Black ink
341 ldy #0
342 jsr _Intro_SetSingleParam
343 jsr _rom_ink
344
345 jsr _Intro_DrawTronLogo
346
347 //
348 // Fade the logo appearance
349 //
350 ldx #0
351 loop_logo_fade
352 ldy _Table_LogoFade,x
353 jsr _SaveRegisters
354 jsr _Intro_SetSingleParam
355 jsr _rom_ink
356 jsr _TemporizeMedium
357 jsr _RestoreRegisters
358 inx
359 cpx #5
360 bne loop_logo_fade
361
362
363 //
364 // Sorte the highscore table
365 //
366 jsr _SortHighScores
367
368 //
369 // Move the logo to the top of screen
370 //
371 jsr _Intro_MoveTronLogo
372
373 //
374 // Switch screen display to a mixed up HIRES/TEXT
375 // screen, with HIRES part on the top with TRON logo
376 // and TEXT part on the bottom with the messages
377 //
378 jsr _ClearTextScreen
379
380 // Hires attrib
381 lda #30
382 sta $bb80+40*28-1
383
384 // Text attrib
385 lda #26
386 sta $a000+40*60
387
388 //
389 // Enable the character set, and display the messages
390 //
391 jsr _CreateCharSet
392
393 // Display "Press Space"
394 ldy #MESSAGE_PRESS_SPACE
395 jsr _Display_Message
396
397 // Display the "High Scores"
398 ldy #MESSAGE_TABLE_NAMES
399 jsr _Display_Message
400
401 //
402 // Big loop that moves the color of the TRON logo
403 //
404 lda #<$a000+40*3
405 sta pl_base_dst
406 lda #>$a000+40*3
407 sta ph_base_dst
408
409 loop_color_cycle
410 .(
411 .(
412 lda #60-6
413 sta counter_1
414 loop_down
415
416 ldy raster_direction
417 clc
418 lda pl_base_dst
419 sta pl_dst
420 adc Intro_TronLogo_Raster_Offset_Low,y
421 sta pl_base_dst
422 lda ph_base_dst
423 sta ph_dst
424 adc Intro_TronLogo_Raster_Offset_High,y
425 sta ph_base_dst
426
427 ldx #0
428 loop_inner
429 lda ColorCycleTable,x
430 ldy raster_direction
431 beq skip
432 lsr
433 lsr
434 lsr
435 skip
436 ldy #1
437 and #7
438 sta (ptr_dst),y
439
440 ldy raster_direction
441 clc
442 lda pl_dst
443 adc Intro_TronLogo_Raster_Offset_Low,y
444 sta pl_dst
445 lda ph_dst
446 adc Intro_TronLogo_Raster_Offset_High,y
447 sta ph_dst
448
449 inx
450 cpx #10
451 bne loop_inner
452
453 jsr _Scroll_ColorLine_Intro
454 jsr _Temporize
455 jsr _Scroll_Hiscore_Gradient
456
457 // Check for space bar
458 jsr $023B
459 cmp #KEY_SPACE
460 beq exit_intro
461
462
463 dec counter_1
464 bne loop_down
465 .)
466
467 jsr _Temporize
468 jsr _Temporize
469
470 lda raster_direction
471 eor #1
472 sta raster_direction
473
474 jmp loop_color_cycle
475 .)
476
477 exit_intro
478
479
480 ;// ======================
481 ;// Create game field
482 ;// ======================
483 // Erase the Tron logo
484 ldx #ERASEMEMORY_TRONLOGO
485 jsr _EraseMemory
486
487 // Erase the text part of screen
488 ldx #ERASEMEMORY_TEXT_INTRO
489 jsr _EraseMemory
490
491
492 // Scroll the bottom blue line to the top of screen
493 jsr _Intro_MoveUpBlueLine
494
495 // HIRES attribute
496 lda #30
497 sta $bb80+1
498
499 // For the missing color byte
500 lda #16+6
501 sta $bb80+0
502
503 // TEXT attribute
504 lda #26
505 sta $a000+40*15+39
506
507
508 ;// ======================
509 ;// Ask player name
510 ;// ======================
511 jsr _CreateCharSet
512 jsr _AskPlayerName
513
514
515 // Reset the current score
516 .(
517 lda #"0"
518 ldx #5
519 loop
520 sta _LabelPlayerScore-1,x
521 dex
522 bne loop
523 .)
524
525 ;// Game init
526 lda #0
527 sta current_level
528
529 lda #3
530 sta remaining_lifes
531
532 game_loop
533 ;//
534 ;// Level init
535 ;//
536 jsr ScoreDisplay
537
538
539 ://
540 ;// Set the parameters based on the current level,
541 ;// by using is as an index in the entry in the table
542 ;//
543 lda current_level
544 and #(_LEVEL_COUNT_-1)
545 //lda #5 // MIKE !!! <= Force the Agains the clock level
546 tay
547
548 //zobi
549 // jmp zobi
550
551 //.byt GAMETYPE_SURVIVOR 3 => 3
552 // +(ARENATYPE_WALLS_NONE<<2) 0<<2 => 0
553 // +(ARENACOLOR_GRID<<4) 3<<4 =>
554 // +(DIRECTION_RIGHT<<6) 2<<6 =>
555
556 lda _LevelDef_Infos_Arena,y
557 tax
558 and #%11
559 sta game_type
560
561 ;// Description of borders of the Arena
562 txa
563 lsr
564 lsr
565 tax
566 and #%11
567 sta arena_type
568
569 ;// Arena color scheme
570 txa
571 lsr
572 lsr
573 tax
574 and #%11
575 sta arena_color
576
577 ;// Player direction
578 txa
579 lsr
580 lsr
581 and #%11
582 sta player_direction
583
584 // Player position
585 lda _LevelDef_Infos_XPos0,y
586 sta player_x
587 lda _LevelDef_Infos_YPos0,y
588 sta player_y
589
590 // Opponent or Exit position
591 lda _LevelDef_Infos_XPos1,y
592 sta opponent_x
593 sta timer_decay_speed
594 lda _LevelDef_Infos_YPos1,y
595 sta opponent_y
596
597 // Opponent orientation
598 lda _LevelDef_Infos_Direction0,y
599 tax
600 and #%11
601 sta opponent_direction
602
603 // Obstacle mask
604 txa
605 lsr
606 lsr
607 sta arena_obstacles
608
609
610
611
612 ;//
613 ;// Erase all the things that are on screen
614 ;//
615 ldx #ERASEMEMORY_TEXT_GAME
616 jsr _EraseMemory
617
618
619 ;//
620 ;// Display current level
621 ;//
622 lda current_level
623 and #$0F
624 tax
625 lda _HexDigits,x
626 sta _Message_LevelNumberPatch+1
627 lda current_level
628 lsr
629 lsr
630 lsr
631 lsr
632 tax
633 lda _HexDigits,x
634 sta _Message_LevelNumberPatch
635
636 ldy #MESSAGE_LEVEL_NUMBER
637 jsr _Display_Message
638
639 clc // Can probably replace by clc/adc by ORA, just be sure it's a power of two
640 lda game_type
641 adc #MESSAGE_GAMETYPE
642 tay
643 jsr _Display_Message
644
645 clc // Can probably replace by clc/adc by ORA, just be sure it's a power of two
646 lda arena_type
647 adc #MESSAGE_ARENATYPE
648 tay
649 jsr _Display_Message
650
651 ldy #MESSAGE_AVOID_COLLISION
652 jsr _Display_Message
653
654
655 ;//
656 ;// Display background graphics
657 ;// => Think about restoring X/Y player position
658 jsr _Arena_Initialize
659
660
661 ;//
662 ;// For GAMETYPE_SNAKE(1) and GAMETYPE_SURVIVOR(3) we have to
663 ;// fill a gauge with the objective of the player
664 ;//
665 .(
666 lda game_type
667 and #1
668 beq skip_gauge
669
670 jsr _FillGauge
671
672 lda #1
673 sta timer_decay_value
674 skip_gauge
675 .)
676
677 ;//
678 ;// Stay into the game loop while the hero
679 ;// still has some live to spare
680 ;//
681 jsr _KeyboardDebounce
682 level_loop
683 //jmp level_loop
684 jsr ScoreDisplay
685
686 jsr _Arena_UpdateExit // Only if there is one :p
687
688
689 ;//
690 ;// Read keyboard input
691 ;// This way the player if he is fast enough can
692 ;// Change the direction of the movement at the
693 ;// begining of the game loop !
694 ;//
695 .(
696 jsr $023B
697
698 cmp #KEY_ESCAPE
699 bne test_pause
700 ;// User pressed ESCAPE => reset the game
701 jmp intro_start
702 test_pause
703 cmp #KEY_P
704 bne test_keys
705 .(
706 pause
707 ldy #MESSAGE_PAUSE
708 jsr _Display_Message
709 jsr _KeyboardDebounce
710 jsr _KeyboardGetChar
711 .)
712 jmp exit
713
714
715 test_keys
716 ldx control_mode
717 beq relative_mode
718
719 absolute_mode
720 ;// Test Left
721 ldx #0
722 cmp #KEY_LEFT
723 beq validate
724 ;// Test Up
725 inx
726 cmp #KEY_UP
727 beq validate
728 ;// Test Right
729 inx
730 cmp #KEY_RIGHT
731 beq validate
732 ;// Test Down
733 inx
734 cmp #KEY_DOWN
735 beq validate
736 bne exit
737
738 relative_mode
739 ldx player_direction
740
741 test_left
742 // Left arrow
743 cmp #KEY_LEFT
744 bne test_right
745 dex
746 jmp validate
747
748 test_right
749 // Right arrow
750 cmp #KEY_RIGHT
751 bne exit
752 inx
753
754 validate
755 //jmp validate
756 txa
757 and #3
758 sta player_direction
759 exit
760 .)
761
762 ;//
763 ;// And then we move the player(s) in the direction that was chosen.
764 ;// Implies we have to update the coordinates, but also the map
765 ;// adress for checks
766 ;//
767 ;// 0 <-
768 ;// 1 ^
769 ;// 2 ->
770 ;// 3 v
771 ;//
772 .(
773 ldy #0
774 jsr _Move_Player
775 lda game_type
776 cmp #GAMETYPE_DUEL
777 bne skip
778 jsr _Computer_AI
779 ldy #1
780 jsr _Move_Player
781 skip
782 .)
783
784
785 jsr _ComputeMapPosition
786
787
788 .(
789 ;//
790 ;// Check collisions
791 ;//
792
793 lda player_adress_low+0
794 sta ptr_player+0
795 lda player_adress_high+0
796 sta ptr_player+1
797
798 .(
799 ;//
800 ;// Generate a fake NULL collision
801 ;// In case we are playing alone
802 ;//
803 ldx player_adress_low+1
804 ldy player_adress_high+1
805
806 lda game_type
807 cmp #GAMETYPE_DUEL
808 beq skip
809 ;//
810 ;// This is not duel, so setup a fake collision
811 ;//
812 .(
813 and #1
814 beq skip_gauge
815
816 dec timer_decay_value
817 bne skip_gauge
818
819 lda timer_decay_speed
820 sta timer_decay_value
821
822 ldx timer_position
823 inx
824 cpx #241
825 bne no_end_timer
826 jmp LevelEndSequence
827 no_end_timer
828 stx timer_position
829 ldy #0
830 dex
831 jsr _FillGaugeSegment
832 skip_gauge
833 .)
834 lda #128
835 sta dummy_collide
836 ldx #<dummy_collide
837 ldy #>dummy_collide
838 skip
839 stx ptr_opponent+0
840 sty ptr_opponent+1
841 .)
842
843 // Check for simultaneous head shot:
844 cpx ptr_player+0
845 bne no_head_collide
846 cpy ptr_player+1
847 bne no_head_collide
848 jmp opponent_collision
849
850 no_head_collide
851
852 // Check for collision
853 ldy #0
854
855 lda (ptr_player),y
856 cmp #128
857 bcc player_collision
858
859 lda (ptr_opponent),y
860 cmp #128
861 bcs no_collision
862
863 opponent_collision
864 // End of level
865 lda player_x+1
866 sta player_x+0
867 lda player_y+1
868 sta player_y+0
869 jsr _ComputeMapPosition
870 lda #8
871 sta explode_color_offset
872 jsr _PlayExplosion
873 jmp LevelEndSequence
874
875 player_collision
876 // End of level
877
878 // Test if that's the end of game
879 cmp #16+0
880 beq LevelEndSequence
881 ;//
882 ;// Game Over
883 ;//
884 lda #0
885 sta explode_color_offset
886 jsr _PlayExplosion
887
888 dec remaining_lifes
889 beq was_last_life
890 ;// Restart the level
891 jmp game_loop
892
893 was_last_life
894 ldx #ERASEMEMORY_TEXT_GAME_16
895 jsr _EraseMemory
896
897 ldy #MESSAGE_GAME_OVER
898 jsr _Display_Message
899
900 jsr _Apply_ShapeFilter
901
902 jmp intro_start
903
904 no_collision
905
906 ;//
907 ;// Display the bikes on screen
908 ;//
909 lda ColorLightCycle+0
910 sta (ptr_player),y
911
912 lda ColorLightCycle+1
913 sta (ptr_opponent),y
914
915 ;//
916 ;// Display the map on screen
917 ;//
918 jsr _Display_ShowMap
919
920 ;//
921 ;// Draw the trail
922 ;//
923 ldy #0
924 ldx ColorsCounter
925 lda ColorsTrailTable,x
926 sta (ptr_player),y
927 lda ColorsTrailTable+4,x
928 sta (ptr_opponent),y
929 inx
930 txa
931 and #3
932 sta ColorsCounter
933 exit
934 .)
935
936 jsr _TemporizeGame
937
938 jmp level_loop
939
940 LevelEndSequence
941 .(
942 ;//
943 ;// Display End of Level infos (bonus time, score, bla bla bla)
944 ;//
945
946 // End of level bonus => 200 points
947 ldx #200
948 stx counter_1
949 blink
950 jsr IncrementScore
951 jsr IncrementScore
952 jsr IncrementScore
953 jsr ScoreDisplay
954 jsr _rom_kbdclick1
955 jsr _Arena_UpdateExit // Only if there is one :p
956 jsr _Display_ShowMap
957 dec counter_1
958 bne blink
959
960 // One more level
961 inc current_level
962
963 jmp game_loop
964 .)
965
966
967
968 ;// Must be called with X for direction
969 ;// Returns distance in Y
970 _Compute_Distance
971 .(
972 ;// Initialise coordinates from the current position
973 ;//
974 lda opponent_x
975 sta primitive_x
976 lda opponent_y
977 sta primitive_y
978
979 ldy #0
980 loop_scan
981 sty current_distance
982
983 ;// Increment the position to go to next direction
984 clc
985 lda primitive_x
986 adc _Move_IncrementTable_X,x
987 sta primitive_x
988 sta pl_src
989
990 clc
991 lda primitive_y
992 adc _Move_IncrementTable_Y,x
993 and #127
994 sta primitive_y
995 clc
996 adc #>_BigBuffer
997 sta ph_src
998
999 ldy #0
1000 lda (ptr_src),y
1001 ldy current_distance
1002 cmp #128
1003 bcc collide
1004
1005 iny
1006 cpy #200 // To avoid countless repetitions
1007 bne loop_scan
1008
1009 collide
1010 rts
1011 .)
1012
1013
1014 _Computer_AI
1015 //jmp _Computer_AI
1016 .(
1017 ;//
1018 ;// To avoid stupid things, we scan the current direction, and
1019 ;// continue if we have at lest 15 squares ok
1020 ;//
1021 ldx opponent_direction
1022 jsr _Compute_Distance
1023 cpy #15
1024 bcc look_for_exit
1025 rts
1026
1027 look_for_exit
1028 //jmp look_for_exit
1029 ;//
1030 ;// Starts by a basic polling around the bike to check if we have to turn
1031 ;//
1032 ldx #0
1033 stx best_distance
1034 loop_direction
1035 jsr _Compute_Distance
1036
1037 cpy best_distance
1038 bcc not_best
1039 ;// Select this direction for the computer opponent
1040 sty best_distance
1041 stx opponent_direction
1042 not_best
1043
1044 inx
1045 cpx #4
1046 bne loop_direction
1047
1048 rts
1049 .)
1050
1051
1052 _PlayExplosion
1053 .(
1054 jsr _rom_explode
1055
1056 lda player_x
1057 sta primitive_x
1058 lda player_y
1059 sta primitive_y
1060
1061 ldx #0
1062 loop_color
1063 stx temp_color
1064
1065 jsr _DrawExplosion
1066 jsr _Display_ShowMap
1067 jsr _Temporize
1068
1069 ldx temp_color
1070 inx
1071 cpx #50
1072 bne loop_color
1073 rts
1074 .)
1075
1076
1077 _ComputeMapPosition
1078 .(
1079 ;//
1080 ;// Compute the map horizontal display coordinates based on the location of the player
1081 ;//
1082 .(
1083 lda arena_type
1084 and #ARENATYPE_WALLS_VERTICAL
1085 bne blocked_x
1086
1087 warped_x
1088 sec
1089 lda player_x
1090 sbc #20
1091 jmp end_test_x
1092
1093 blocked_x
1094 lda player_x
1095 cmp #20
1096 bcs x_right
1097 x_left
1098 lda #0
1099 jmp end_test_x
1100
1101 x_right
1102 cmp #255-20
1103 bcc x_mid
1104 lda #256-40
1105 jmp end_test_x
1106
1107 x_mid
1108 sec
1109 lda player_x
1110 sbc #20
1111 end_test_x
1112 sta map_x
1113 .)
1114
1115
1116 .(
1117 //zobi
1118 // jmp zobi
1119
1120 ;//
1121 ;// Compute the map vertical display coordinates based on the location of the player
1122 ;//
1123 lda arena_type
1124 and #ARENATYPE_WALLS_HORIZONTAL
1125 bne blocked_y
1126
1127 warped_y
1128 sec
1129 lda player_y
1130 sbc #13
1131 jmp end_test_y
1132
1133 blocked_y
1134 lda player_y
1135 cmp #13
1136 bcs y_right
1137 y_left
1138 lda #0
1139 jmp end_test_y
1140
1141 y_right
1142 cmp #127-13
1143 bcc y_mid
1144 lda #128-26
1145 jmp end_test_y
1146
1147 y_mid
1148 sec
1149 lda player_y
1150 sbc #13
1151 end_test_y
1152 sta map_y
1153 .)
1154 rts
1155 .)
1156
1157
1158
1159 _Move_Player
1160 .(
1161 ldx player_direction,y
1162
1163 clc
1164 lda player_x,y
1165 adc _Move_IncrementTable_X,x
1166 sta player_x,y
1167 sta player_adress_low,y
1168
1169 clc
1170 lda player_y,y
1171 adc _Move_IncrementTable_Y,x
1172 and #127
1173 sta player_y,y
1174 clc
1175 adc #>_BigBuffer
1176 sta player_adress_high,y
1177 rts
1178 .)
1179
1180
1181
1182
1183 _ClearTextScreen
1184 ldy #($c000-$bb00)/256
1185 lda #>$bb00
1186 jmp _ClearVideoLoop
1187
1188 ;// A routine that will fill all the video memory with value 0, from
1189 ;// $9800 to $C000, effectively provocking a nice switch of resolution
1190 _ClearVideo
1191 ldy #($c000-$9800)/256
1192 lda #>$9800
1193 _ClearVideoLoop
1194 .(
1195 sta __patch+2
1196 lda #0
1197 loop_outer
1198 ldx #0
1199 loop_inner
1200 __patch
1201 sta $9800,x
1202 dex
1203 bne loop_inner
1204 inc __patch+2
1205 dey
1206 bne loop_outer
1207 .)
1208 rts
1209
1210
1211
1212
1213
1214
1215 IncrementScore
1216 .(
1217 // Pump
1218 .(
1219 lda ScoreTable_Sub+5
1220 bne skip
1221 lda #10
1222 sta ScoreTable_Sub+5
1223 skip
1224 .)
1225
1226 .(
1227 ldx #5
1228 loop
1229 ldy ScoreTable_Sub,x
1230 beq not_moving
1231
1232 .(
1233 dec ScoreTable_Sub,x
1234 bne skip
1235 inc _LabelPlayerScore-1,x
1236 skip
1237 .)
1238
1239 ldy ScoreTable,x
1240 iny
1241 tya
1242 sta ScoreTable,x
1243 cpy #100
1244 bne not_finished
1245
1246 // Reset current digit
1247 lda #0
1248 sta ScoreTable,x
1249 lda #"0"
1250 sta _LabelPlayerScore-1,x
1251
1252 dex
1253 lda #10
1254 sta ScoreTable_Sub,x
1255
1256 inx
1257
1258 not_finished
1259
1260 not_moving
1261 dex
1262 bne loop
1263 end
1264 .)
1265 rts
1266 .)
1267
1268
1269
1270 // remaining_lifes
1271
1272 ScoreDisplay
1273 //jmp ScoreDisplay
1274 .(
1275 ldx #3
1276 ldy remaining_lifes
1277 loop_life
1278 lda _LifeColors_Gradient,y
1279 iny
1280 dex
1281 sta life_colors,x
1282 bne loop_life
1283
1284 lda #<$a000+40*3
1285 sta pl_dst
1286 lda #>$a000+40*3
1287 sta ph_dst
1288
1289 ldx #0
1290 loop_y
1291 stx tmp1
1292
1293 ldy #0
1294
1295 // First bike
1296 lda life_colors+0
1297 sta (ptr_dst),y
1298 iny
1299 lda _BikesPictures_Left,x
1300 sta (ptr_dst),y
1301 iny
1302 lda _BikesPictures_Right,x
1303 sta (ptr_dst),y
1304 iny
1305
1306 // Second bike
1307 lda life_colors+1
1308 sta (ptr_dst),y
1309 iny
1310 lda _BikesPictures_Left,x
1311 sta (ptr_dst),y
1312 iny
1313 lda _BikesPictures_Right,x
1314 sta (ptr_dst),y
1315 iny
1316
1317 // Third bike
1318 lda life_colors+2
1319 sta (ptr_dst),y
1320 iny
1321 lda _BikesPictures_Left,x
1322 sta (ptr_dst),y
1323 iny
1324 lda _BikesPictures_Right,x
1325 sta (ptr_dst),y
1326 iny
1327
1328 lda _Score_GradientColorTable,x
1329 ldy #14
1330 sta (ptr_dst),y
1331 iny
1332 loop_x
1333
1334 ldx ScoreTable+1-15,y
1335 txa
1336 clc
1337 adc tmp1
1338 tax
1339
1340 lda _BigDigits,x
1341 sta (ptr_dst),y
1342
1343 iny
1344 cpy #6+14
1345 bne loop_x
1346
1347 ldx tmp1
1348 lda _Score_GradientColorTable_Timebar,x
1349 sta (ptr_dst),y
1350
1351 jsr increment_ptr_dst_40
1352
1353 ldx tmp1
1354 inx
1355 cpx #9
1356 bne loop_y
1357
1358 // Move the blue line
1359 jsr _Scroll_ColorLine_Ingame
1360
1361 //
1362 jsr IncrementScore
1363
1364 rts
1365 .)
1366
1367
1368
1369
1370
1371
1372 // Y=>Value
1373 _Intro_SetSingleParam
1374 .(
1375 lda #0
1376 sta $2e0
1377 sty $2e1
1378 sta $2e2
1379 rts
1380 .)
1381
1382
1383 _Intro_DrawTronLogo
1384 //jmp _Intro_DrawTronLogo
1385 .(
1386 //
1387 ldx #0
1388 stx intro_memo_ptr
1389 loop_drawlogo
1390 // Get command
1391 ldx intro_memo_ptr
1392 lda Intro_TronLogo_Description,x
1393 beq end
1394 inx
1395
1396 ldy #2
1397 sta intro_memo_command
1398 and #127 // Clear the NODRAW command
1399 cmp #CMD_CURSET
1400 beq draw_Curset
1401 cmp #CMD_CURMOV
1402 beq draw_Curmov
1403 cmp #CMD_DRAW
1404 beq draw_Draw
1405 cmp #CMD_CIRCLE
1406 beq draw_Circle
1407 cmp #CMD_FILL
1408 beq draw_Fill
1409 bne loop_drawlogo
1410
1411 end
1412 rts
1413
1414 draw_Curset
1415 jsr _Intro_ReadParams
1416 stx intro_memo_ptr
1417 jsr _rom_curset
1418 jmp loop_drawlogo
1419
1420 draw_Curmov
1421 jsr _Intro_ReadParams
1422 stx intro_memo_ptr
1423 jsr _rom_curmov
1424 jmp loop_drawlogo
1425
1426 draw_Draw
1427 jsr _Intro_ReadParams
1428 stx intro_memo_ptr
1429 jsr _rom_draw
1430 jmp loop_drawlogo
1431
1432 draw_Circle
1433 dey
1434 jsr _Intro_ReadParams
1435 stx intro_memo_ptr
1436 jsr _rom_circle
1437 jmp loop_drawlogo
1438
1439 draw_Fill
1440 iny
1441 jsr _Intro_ReadParams
1442 stx intro_memo_ptr
1443 jsr _rom_fill
1444 jmp loop_drawlogo
1445 .)
1446
1447
1448
1449 // Get X params (16bit) from the table
1450 _Intro_ReadParams
1451 .(
1452 sty intro_memo_count ; store X in storage byte
1453 lda #0 ; X is the number of params
1454 sta $2e0 ; Zero error indicator.
1455 tay
1456 loop
1457 lda Intro_TronLogo_Description,x
1458 inx
1459 sta $2e1,y
1460 iny
1461 lda Intro_TronLogo_Description,x
1462 inx
1463 sta $2e1,y
1464 iny ;
1465 dec intro_memo_count ; decrement pointer
1466 bne loop
1467
1468 // Set write mode
1469 lda intro_memo_command // 128
1470 rol // 128 => c
1471 rol // c => 1
1472 rol // 1 => 2
1473 and #3
1474 ora #1
1475 sta $2e1,y
1476 iny
1477 lda #0
1478 sta $2e1,y
1479
1480 rts
1481 .)
1482
1483
1484
1485 increment_ptr_dst_40
1486 .(
1487 clc
1488 lda pl_dst
1489 adc #40
1490 sta pl_dst
1491 bcc skip
1492 inc ph_dst
1493 skip
1494 rts
1495 .)
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505 _Arena_UpdateExit
1506 .(
1507 lda game_type
1508 //cmp #GAMETYPE_FIND_THE_EXIT <= 0
1509 bne exit
1510
1511 lda opponent_x
1512 sta pl_dst
1513 clc
1514 lda opponent_y
1515 adc #>_BigBuffer
1516 sta ph_dst
1517
1518 ldx exit_color
1519 inx
1520 stx exit_color
1521 txa
1522 and #7
1523 ora #16
1524 tax
1525
1526 // Top half part
1527 lda #16+0
1528 ldy #1
1529 sta (ptr_dst),y
1530 iny
1531 sta (ptr_dst),y
1532
1533 inc ph_dst
1534 ldy #0
1535 sta (ptr_dst),y
1536 iny
1537 txa
1538 sta (ptr_dst),y
1539 iny
1540 sta (ptr_dst),y
1541 iny
1542 lda #16+0
1543 sta (ptr_dst),y
1544
1545 // Bottom half part
1546 inc ph_dst
1547 ldy #0
1548 sta (ptr_dst),y
1549 iny
1550 txa
1551 sta (ptr_dst),y
1552 iny
1553 sta (ptr_dst),y
1554 iny
1555 lda #16+0
1556 sta (ptr_dst),y
1557
1558 inc ph_dst
1559 ldy #1
1560 sta (ptr_dst),y
1561 iny
1562 sta (ptr_dst),y
1563 exit
1564 rts
1565 .)
1566
1567
1568
1569 ;// Give map coordinates in X and Y.
1570 ;// Outputs the pixel adressin "ptr_src"
1571 _Compute_MapAdress
1572 .(
1573 stx pl_src
1574 clc
1575 tya
1576 and #127
1577 adc #>_BigBuffer
1578 sta ph_src
1579 rts
1580 .)
1581
1582 _pc
1583 _Display_ShowMap
1584 .(
1585 ldy map_y
1586 ldx #0 //map_x
1587 jsr _Compute_MapAdress
1588
1589 // Force the cursor to stay hiden
1590 lda #0
1591 sta $274
1592
1593 lda #<__base_mode
1594 sta pl_dst
1595 lda #>__base_mode
1596 sta ph_dst
1597
1598 lda #<$bb80+40*2
1599 sta pl_base_dst
1600 lda #>$bb80+40*2
1601 sta ph_base_dst
1602
1603 ldx #26
1604 ldy #0
1605 loop_patch
1606 iny // lda
1607
1608 lda pl_src
1609 sta (ptr_dst),y
1610 iny
1611
1612 clc
1613 lda ph_src
1614 sta (ptr_dst),y
1615 adc #1
1616
1617 ;//
1618 .(
1619 cmp #>(_BigBuffer+256*128)
1620 bne skip
1621 lda #>_BigBuffer
1622 skip
1623 .)
1624 ;//
1625
1626 sta ph_src
1627 iny
1628
1629 //iny // $9d sta
1630 //iny // $00
1631 //iny // $a0
1632
1633 lda #$9d
1634 sta (ptr_dst),y
1635 iny
1636
1637 clc
1638 lda pl_base_dst
1639 sta (ptr_dst),y
1640 adc #40
1641 sta pl_base_dst
1642 iny
1643
1644 lda ph_base_dst
1645 sta (ptr_dst),y
1646 adc #0
1647 sta ph_base_dst
1648 iny
1649
1650
1651 dex
1652 bne loop_patch
1653
1654
1655
1656 ldy map_x
1657 ldx #0
1658 loop_x
1659
1660 __base_mode
1661 lda $b9b9,y // lda $BigBuffer+...,y
1662 lda $b9b9,y // sta $bb80+000*40,x
1663 lda $b9b9,y
1664 lda $b9b9,y
1665 lda $b9b9,y
1666 lda $b9b9,y
1667 lda $b9b9,y
1668 lda $b9b9,y
1669 lda $b9b9,y
1670 lda $b9b9,y
1671 lda $b9b9,y
1672 lda $b9b9,y
1673 lda $b9b9,y
1674 lda $b9b9,y
1675 lda $b9b9,y
1676 lda $b9b9,y
1677
1678 lda $b9b9,y
1679 lda $b9b9,y
1680 lda $b9b9,y
1681 lda $b9b9,y
1682 lda $b9b9,y
1683 lda $b9b9,y
1684 lda $b9b9,y
1685 lda $b9b9,y
1686 lda $b9b9,y
1687 lda $b9b9,y
1688 lda $b9b9,y
1689 lda $b9b9,y
1690 lda $b9b9,y
1691 lda $b9b9,y
1692 lda $b9b9,y
1693 lda $b9b9,y
1694 lda $b9b9,y
1695 lda $b9b9,y
1696 lda $b9b9,y
1697 lda $b9b9,y
1698
1699 lda $b9b9,y
1700 lda $b9b9,y
1701 lda $b9b9,y
1702 lda $b9b9,y
1703 lda $b9b9,y
1704 lda $b9b9,y
1705 lda $b9b9,y
1706 lda $b9b9,y
1707 lda $b9b9,y
1708 lda $b9b9,y
1709 lda $b9b9,y
1710 lda $b9b9,y
1711 lda $b9b9,y
1712 lda $b9b9,y
1713 lda $b9b9,y
1714 lda $b9b9,y
1715
1716 iny
1717 inx
1718 cpx #40
1719 beq end
1720 jmp loop_x
1721 end
1722
1723 rts
1724 .)
1725
1726
1727
1728 // Note:
1729 // A sequence of "jmp _DoTempo" compresses better
1730 // than having only short relative branches...
1731 _TemporizeGame
1732 ldy #0
1733 lda current_level
1734 lsr
1735 sta tmp1
1736 cmp #10
1737 bcs _DoTempo
1738 sec
1739 lda #10
1740 sbc tmp1
1741 tay
1742 jmp _DoTempo
1743
1744 _TemporizeVeryLong
1745 ldy #0
1746 jmp _DoTempo
1747 _TemporizeLong
1748 ldy #150
1749 jmp _DoTempo
1750 _TemporizeMedium
1751 ldy #80
1752 jmp _DoTempo
1753 _TemporizeFast
1754 ldy #40
1755 jmp _DoTempo
1756 _Temporize
1757 ldy #10 //20
1758 jmp _DoTempo
1759 _TemporizeShort
1760 ldy #5
1761 _DoTempo
1762 .(
1763 loop_2
1764 cpy #0
1765 beq exit
1766 dey
1767 ldx #0
1768 loop_1
1769 nop
1770 dex
1771 bne loop_1
1772 beq loop_2
1773 exit
1774 rts
1775 .)
1776
1777
1778
1779
1780
1781
1782
1783
1784 ;// That small color gradient line on the screen here and there
1785 _Scroll_ColorLine_Ingame
1786 lda #<$a000+40*13
1787 sta pl_dst
1788 lda #>$a000+40*13
1789 sta ph_dst
1790 jmp _Scroll_ColorLine
1791
1792 _Scroll_ColorLine_Intro
1793 lda #<$a000+40*58
1794 sta pl_dst
1795 lda #>$a000+40*58
1796 sta ph_dst
1797
1798 _Scroll_ColorLine
1799 .(
1800 ; Some color test
1801 lda #16+6
1802 sta $a000+40*0
1803 sta $a000+40*2
1804
1805 sta $a000+40*57
1806 sta $a000+40*59
1807
1808 ldx ColorLineGradientOffset
1809 inx
1810 stx ColorLineGradientOffset
1811
1812 ldy #0
1813 loop
1814 txa
1815 and #63
1816 tax
1817 lda _Colorline_Gradient,x
1818 sta $a000+40*1,y
1819 lda _Colorline_Gradient-4,x
1820 sta (ptr_dst),y
1821 inx
1822 iny
1823 cpy #40
1824 bne loop
1825
1826 rts
1827 .)
1828
1829 _Scroll_Hiscore_Gradient
1830 .(
1831 lda #<$bb80+40*12+10
1832 sta pl_dst
1833 lda #>$bb80+40*12+10
1834 sta ph_dst
1835
1836 lda #<$bb80+40*(12+11)+10
1837 sta pl_src
1838 lda #>$bb80+40*(12+11)+10
1839 sta ph_src
1840
1841 .(
1842 ldx GradientOffet
1843 inx
1844 cpx #12
1845 bne skip
1846 ldx #0
1847 skip
1848 stx GradientOffet
1849 .)
1850
1851 lda #12
1852 sta tmp1
1853
1854 loop
1855 .(
1856 inx
1857 cpx #12
1858 bne skip
1859 ldx #0
1860 skip
1861 .)
1862 lda _HighScores_ColorGradient,x
1863 ldy #0
1864 sta (pl_dst),y
1865 ldy #7
1866 sta (pl_src),y
1867
1868 jsr increment_ptr_dst_40
1869
1870 .(
1871 sec
1872 lda pl_src
1873 sbc #40
1874 sta pl_src
1875 bcs skip
1876 dec ph_src
1877 skip
1878 .)
1879
1880 dec tmp1
1881 bne loop
1882
1883 rts
1884 .)
1885
1886
1887
1888 ;//
1889 ;// ptr_src
1890 ;// contains the message
1891 ;//
1892 ;// ptr_dst
1893 ;// contains the position of the first character of the message on screen
1894 ;//
1895 ;// Codes that can be used in the display:
1896 ;// 255 => End of message
1897 ;// 254 => End of line
1898 ;// 253 => Switch double size flag
1899 ;//
1900 _Display_Message
1901 .(
1902 // Read the source adress of messages
1903 lda _Messages_Table_AddrLow,y
1904 sta pl_src
1905 lda _Messages_Table_AddrHigh,y
1906 sta ph_src
1907
1908 lda _Messages_Table_ScreenAddrLow,y
1909 sta pl_dst
1910 lda _Messages_Table_ScreenAddrHigh,y
1911 sta ph_dst
1912
1913 ldx #0
1914 stx flag_double_size
1915 loop
1916 ldy #0
1917 lda (ptr_src),y
1918 sta tmp1
1919
1920 .(
1921 inc pl_src
1922 bne skip
1923 inc ph_src
1924 skip
1925 .)
1926
1927 cmp #255
1928 beq end_loop
1929 cmp #254
1930 beq carriage_return
1931 cmp #253
1932 beq switch_size
1933 bne display
1934
1935 switch_size
1936 lda flag_double_size
1937 eor #255
1938 sta flag_double_size
1939 jmp loop
1940
1941
1942 carriage_return
1943 // Carriage return
1944 ldx #0
1945 jsr increment_ptr_dst_40
1946 jmp loop
1947
1948 display
1949 txa
1950 tay
1951 lda tmp1
1952 sta (ptr_dst),y
1953 lda flag_double_size
1954 beq no_double_size
1955 tya
1956 clc
1957 adc #40
1958 tay
1959 lda tmp1
1960 sta (ptr_dst),y
1961 no_double_size
1962 inx
1963
1964 jmp loop
1965 end_loop
1966
1967 rts
1968 .)
1969
1970
1971
1972 _CreateCharSet
1973 .(
1974 // Reinitialise all ROM characters
1975 jsr _rom_redef_chars
1976
1977 .(
1978 // And now modify them so they look "SF"
1979 lda #<$b400
1980 sta pl_dst
1981 lda #>$b400
1982 sta ph_dst
1983
1984 ldx #128
1985 loop
1986 lda #0
1987 ldy #1
1988 sta (ptr_dst),y
1989
1990 .(
1991 clc
1992 lda pl_dst
1993 adc #8
1994 sta pl_dst
1995 bcc skip
1996 inc ph_dst
1997 skip
1998 .)
1999
2000 dex
2001 bne loop
2002 .)
2003
2004 rts
2005 .)
2006
2007
2008
2009
2010 ;// Logo is from line 80 to 120
2011 _Intro_MoveUpBlueLine
2012 ;// Start by displaying the logo
2013 lda #<$a000+40*56
2014 sta pl_dst
2015 lda #>$a000+40*56
2016 sta ph_dst
2017
2018 lda #<$a000+40*57
2019 sta pl_src
2020 lda #>$a000+40*57
2021 sta ph_src
2022
2023 lda #<40*4
2024 sta counter_1+0
2025 lda #>40*4
2026 sta counter_1+1
2027
2028 lda #45
2029
2030 jmp _Intro_ScrollBloc
2031
2032
2033 ;// Logo is from line 80 to 120
2034 _Intro_MoveTronLogo
2035 ;// Start by displaying the logo
2036 lda #<$a000+40*79
2037 sta pl_dst
2038 lda #>$a000+40*79
2039 sta ph_dst
2040
2041 lda #<$a000+40*80
2042 sta pl_src
2043 lda #>$a000+40*80
2044 sta ph_src
2045
2046 lda #<40*41
2047 sta counter_1+0
2048 lda #>40*41
2049 sta counter_1+1
2050
2051 lda #70
2052
2053 _Intro_ScrollBloc
2054 .(
2055 sta counter_2
2056 loop
2057 jsr _CopyMemory
2058
2059 .(
2060 sec
2061 lda pl_dst
2062 sbc #40
2063 sta pl_dst
2064 bcs skip
2065 dec ph_dst
2066 skip
2067 .)
2068
2069 .(
2070 sec
2071 lda pl_src
2072 sbc #40
2073 sta pl_src
2074 bcs skip
2075 dec ph_src
2076 skip
2077 .)
2078
2079 dec counter_2
2080 bne loop
2081
2082 rts
2083 .)
2084
2085
2086
2087
2088 // Take in X register the parameter
2089 // values to use to erase memory
2090 _EraseMemory
2091 // Begin pointer of data to erase
2092 clc
2093 lda _EraseMemory_Table_AddrLow,x
2094 sta pl_src
2095 adc #1
2096 sta pl_dst
2097 lda _EraseMemory_Table_AddrHigh,x
2098 sta ph_src
2099 adc #0
2100 sta ph_dst
2101
2102 // Start by clearing the very first byte
2103 // with the value we need.
2104 ldy #0
2105 lda _EraseMemory_Table_EraseValue,x
2106 sta (ptr_src),y
2107
2108 // Size of data to erase
2109 lda _EraseMemory_Table_CountLow,x
2110 sta counter_1+0
2111 lda _EraseMemory_Table_CountHigh,x
2112 sta counter_1+1
2113 ;//
2114 ;// ptr_src
2115 ;// point on the area the data are taken from
2116 ;//
2117 ;// ptr_dst
2118 ;// point on the are where the data will be transfered to
2119 ;//
2120 ;// counter_1
2121 ;// size of data to move
2122 ;//
2123 _CopyMemory
2124 sec
2125 lda #0
2126 sbc counter_1+0
2127 sta tmp1
2128 tax
2129 cmp #1
2130 lda counter_1+1
2131 adc #0
2132 tay
2133 beq return
2134
2135 sec
2136 lda ptr_dst
2137 sbc tmp1
2138 sta memcpyloop+4
2139 lda ptr_dst+1
2140 sbc #0
2141 sta memcpyloop+5
2142
2143 sec
2144 lda ptr_src
2145 sbc tmp1
2146 sta memcpyloop+1
2147 lda ptr_src+1
2148 sbc #0
2149 sta memcpyloop+2
2150
2151 memcpyloop
2152 lda $2211,x
2153 sta $5544,x
2154 inx
2155 bne memcpyloop
2156 inc memcpyloop+2
2157 inc memcpyloop+5
2158 dey
2159 bne memcpyloop
2160 return
2161 rts
2162
2163
2164 _SaveRegisters
2165 sta save_a
2166 stx save_x
2167 sty save_y
2168 rts
2169
2170 _RestoreRegisters
2171 lda save_a
2172 ldx save_x
2173 ldy save_y
2174 rts
2175
2176
2177
2178
2179 ;//
2180 ;// Assuming the highscores table is always already sorted
2181 ;// all we have to do is to start from the end, and move up
2182 ;// the new entry
2183 ;// Each score is 17 bytes long,
2184 ;// Each score is separated in memory by 20 bytes if we count the storage stuff
2185 ;// We have a total of 6 comparisons to do
2186 ;//
2187 _SortHighScores
2188 //jmp _SortHighScores
2189 .(
2190 // Score of the current player
2191 lda #<_LabelPlayerScore
2192 sta pl_src
2193 lda #>_LabelPlayerScore
2194 sta ph_src
2195
2196 // Score of the last one
2197 lda #<_LabelLastScore
2198 sta pl_dst
2199 lda #>_LabelLastScore
2200 sta ph_dst
2201
2202 ldx #6
2203 loop_next_name
2204 ldy #0
2205 loop_compare_name
2206 lda (ptr_src),y // Player score line
2207 cmp (ptr_dst),y // Current score to compare
2208 beq egal
2209 bcs exchange_loop
2210 bcc end_compare
2211 egal
2212 iny
2213 // We only want to compare on the first 5 characters !
2214 cpy #5
2215 bne loop_compare_name
2216 beq end_compare
2217
2218 exchange_loop
2219 lda (ptr_dst),y
2220 pha
2221 lda (ptr_src),y
2222 sta (ptr_dst),y
2223 pla
2224 sta (ptr_src),y
2225 iny
2226 cpy #17
2227 bne exchange_loop
2228
2229 // Next test
2230 .(
2231 sec
2232 lda pl_dst
2233 sta pl_src
2234 sbc #20
2235 sta pl_dst
2236 lda ph_dst
2237 sta ph_src
2238 sbc #0
2239 sta ph_dst
2240 .)
2241
2242 dex
2243 bne loop_next_name
2244
2245 end_compare
2246 rts
2247 .)
2248
2249
2250
2251 _KeyboardDebounce
2252 .(
2253 _getchar
2254 jsr $023B
2255 bmi _getchar ;// loop while char available
2256 rts
2257 .)
2258
2259
2260 _KeyboardGetChar
2261 .(
2262 _getchar
2263 jsr $023B
2264 bpl _getchar ;// loop while char are not available
2265 rts
2266 .)
2267
2268
2269 _AskPlayerName
2270 .(
2271 jsr _KeyboardDebounce
2272
2273 // Display the "Enter your name message"
2274 ldy #MESSAGE_ENTER_NAME
2275 jsr _Display_Message
2276
2277 // Activate key click and cursor
2278 lda #2+1
2279 sta $26a
2280
2281 ldx #0
2282 loop_input_set_cursor
2283 stx cursor_pos
2284 // Then the loop that display the current player name
2285 loop_input
2286 // Put cursor at right position
2287 clc
2288 lda #<$bb80+40*16+14-2
2289 adc cursor_pos
2290 sta $12
2291 lda #>$bb80+40*16+14-2
2292 adc #0
2293 sta $13
2294
2295 ldx #11
2296 loop_show_name
2297 lda _LabelPlayerName-1,x
2298 sta $bb80+40*16+14-1,x
2299 sta _LabelPlayerScoreName-1,x
2300 dex
2301 bne loop_show_name
2302
2303 // Display the right 2/4 character for the control mode
2304 lda control_mode
2305 asl
2306 clc
2307 adc #"2"
2308 sta $bb80+40*18+12
2309
2310 // Now check character
2311 jsr _KeyboardGetChar
2312
2313 cmp #KEY_ENTER
2314 beq validate_entry
2315 test_left
2316 cmp #KEY_LEFT
2317 bne test_right
2318
2319 ldx cursor_pos
2320 beq do_ping
2321 dex
2322 bpl loop_input_set_cursor
2323
2324 test_right
2325 cmp #KEY_RIGHT
2326 bne test_up
2327
2328 ldx cursor_pos
2329 cpx #10
2330 beq do_ping
2331 inx
2332 bne loop_input_set_cursor
2333
2334 do_ping
2335 jsr _rom_ping
2336 jmp loop_input
2337
2338 test_erase
2339 cmp #KEY_DELETE
2340 bne test_character
2341 ldx cursor_pos
2342 beq do_ping
2343 dex
2344 lda #32
2345 sta _LabelPlayerName,x
2346 bne loop_input_set_cursor
2347
2348 test_character
2349 cmp #32
2350 bcc loop_input
2351 ldx cursor_pos
2352 sta _LabelPlayerName,x
2353 inx
2354 cpx #11
2355 bne loop_input_set_cursor
2356 ldx #0
2357 beq loop_input_set_cursor
2358
2359 test_up
2360 cmp #KEY_UP
2361 bne test_escape
2362 lda control_mode
2363 eor #1
2364 sta control_mode
2365 jmp loop_input
2366
2367 test_escape
2368 cmp #KEY_ESCAPE
2369 bne test_erase
2370 jsr _rom_zap
2371 lda #32
2372 ldx #11
2373 loop_erase
2374 sta _LabelPlayerName-1,x
2375 dex
2376 bne loop_erase
2377 ldx #0
2378 jmp loop_input_set_cursor
2379
2380 validate_entry
2381
2382 // Deactivate key click and cursor
2383 lda #8+2
2384 sta $26a
2385
2386 rts
2387 .)
2388
2389
2390
2391
2392
2393
2394
2395
2396 _DrawCircle_PixelRender_Explode
2397 .(
2398 ldx #0
2399 loop_seach_color
2400 cmp ExplodeDistanceTable,x
2401 bcs set_color
2402 inx
2403 bne loop_seach_color
2404
2405 set_color
2406 txa
2407 clc
2408 adc temp_color
2409 and #7
2410 ora explode_color_offset
2411 tax
2412 lda _BlueExplosion,x
2413 sta circle_color
2414
2415 rts
2416 .)
2417
2418
2419 _DrawCircle_PixelRender_DrawDisc
2420 .(
2421 rts
2422 .)
2423
2424 _DrawExplosion
2425 // Radius
2426 ldx #12
2427 ldy #0
2428 jmp _DrawCircle
2429
2430 _DrawDisc
2431 jsr _SaveRegisters
2432
2433 lda _ArenaItems_Table_PosX,y
2434 sta primitive_x
2435
2436 lda _ArenaItems_Table_PosY,y
2437 sta primitive_y
2438
2439 ldx _ArenaItems_Table_Radius,y
2440 lda _ArenaItems_Table_Color,y
2441 sta circle_color
2442 ldy #1
2443 jsr _DrawCircle
2444 jsr _RestoreRegisters
2445 rts
2446
2447
2448 _DrawCircle
2449 .(
2450 // Maximum allowed radius is 12
2451 stx circle_radius
2452 dex
2453 lda _SquareTable,x
2454 sta circle_radius_squared
2455
2456 lda _DrawCircle_PixelRenderTable_AddrLow,y
2457 sta __auto_pixel+1
2458 lda _DrawCircle_PixelRenderTable_AddrHigh,y
2459 sta __auto_pixel+2
2460
2461 ldx #0
2462 loop_y
2463 stx temp_y
2464
2465 ldx #0
2466 loop_x
2467 stx temp_x
2468
2469 // Compute the distance
2470 ldx temp_x
2471 ldy temp_y
2472 clc
2473 lda _SquareTable,x
2474 adc _SquareTable,y
2475 bcs skip
2476 cmp circle_radius_squared
2477 bcs skip
2478
2479 __auto_pixel
2480 jsr $1234
2481
2482 // Display the pixel
2483 clc
2484 lda primitive_x
2485 adc temp_x
2486 sta explode_x+0
2487 sec
2488 lda primitive_x
2489 sbc temp_x
2490 sta explode_x+1
2491
2492 clc
2493 lda primitive_y
2494 adc temp_y
2495 sta explode_y+0
2496 sec
2497 lda primitive_y
2498 sbc temp_y
2499 sta explode_y+1
2500
2501 jsr _DrawDisc_Pixels
2502
2503 skip
2504
2505 ldx temp_x
2506 inx
2507 cpx circle_radius
2508 bne loop_x
2509
2510 ldx temp_y
2511 inx
2512 cpx circle_radius
2513 bne loop_y
2514
2515 rts
2516 .)
2517
2518 _DrawDisc_Pixels
2519 .(
2520 ldx explode_x+0
2521 ldy explode_y+0
2522 jsr _DrawDisc_Pixel
2523 ldx explode_x+1
2524 ldy explode_y+0
2525 jsr _DrawDisc_Pixel
2526 ldx explode_x+0
2527 ldy explode_y+1
2528 jsr _DrawDisc_Pixel
2529 ldx explode_x+1
2530 ldy explode_y+1
2531 _DrawDisc_Pixel
2532 jsr _Compute_MapAdress
2533 ldy #0
2534 lda circle_color
2535 sta (ptr_src),y
2536 rts
2537 .)
2538
2539
2540
2541
2542
2543 _Arena_BackgroundPixel_Checkboard
2544 .(
2545 txa
2546 ror
2547 ror
2548 ror
2549 ror
2550 //clc
2551 and #1
2552 sta tmp1
2553
2554 tya
2555 ror
2556 ror
2557 ror
2558 ror
2559 clc
2560 and #1
2561 eor tmp1
2562 asl
2563 ora #16
2564
2565 rts
2566 .)
2567
2568 _Arena_BackgroundPixel_Grid
2569 txa
2570 and #%1111
2571 cmp #%1000
2572 beq _Arena_BackgroundPixel_Green
2573
2574 tya
2575 and #%1111
2576 cmp #%1000
2577 beq _Arena_BackgroundPixel_Green
2578 _Arena_BackgroundPixel_Black
2579 lda #16+0
2580 rts
2581 _Arena_BackgroundPixel_Green
2582 lda #16+2
2583 rts
2584
2585
2586 _Arena_InitializeBackground
2587 .(
2588 // Select the requested pixel filler
2589 ldy arena_color
2590
2591 lda _Arena_BackgroundTable_AddrLow,y
2592 sta __auto_pixel+1
2593 lda _Arena_BackgroundTable_AddrHigh,y
2594 sta __auto_pixel+2
2595
2596 // Fill the whole buffer with black paper
2597 lda #<_BigBuffer
2598 sta pl_dst
2599 lda #>_BigBuffer
2600 sta ph_dst
2601
2602 ldx #0
2603 loop_y
2604 ldy #0
2605 loop_x
2606 __auto_pixel
2607 //jsr _Arena_BackgroundPixel_Checkboard
2608 jsr _Arena_BackgroundPixel_Grid
2609 eor #128+7
2610
2611 sta (ptr_dst),y
2612
2613 iny
2614 bne loop_x
2615
2616 inc ph_dst
2617
2618 inx
2619 cpx #128
2620 bne loop_y
2621 rts
2622 .)
2623
2624
2625
2626
2627 _Arena_Obstacles_Corridor
2628 .(
2629 ldy #2
2630 loop
2631 jsr _Arena_DrawRectangle
2632 iny
2633 cpy #12
2634 bne loop
2635 rts
2636 .)
2637
2638
2639 _Arena_Obstacles_MickeyMouse
2640 .(
2641 // Draw mickey
2642 ldy #12
2643 jsr _DrawDisc
2644 iny
2645 jsr _DrawDisc
2646 iny
2647 jsr _DrawDisc
2648 rts
2649 .)
2650
2651 _Arena_Obstacles_Cross
2652 .(
2653 ldy #15
2654 jsr _Arena_DrawRectangle
2655 iny
2656 jsr _Arena_DrawRectangle
2657 rts
2658 .)
2659
2660 _Arena_Obstacles_UTurn
2661 .(
2662 ldy #17
2663 loop
2664 jsr _Arena_DrawRectangle
2665 iny
2666 cpy #28+1
2667 bne loop
2668 rts
2669 .)
2670
2671
2672 //_Arena_Obstacles_Blocks
2673 //.(
2674 // rts
2675 //.)
2676
2677
2678 _Arena_Obstacles_RoundedShapes
2679 .(
2680 ldy #29
2681 loop
2682 jsr _Arena_DrawRectangle
2683 iny
2684 cpy #36+1
2685 bne loop
2686 rts
2687 rts
2688 .)
2689
2690
2691
2692 _Arena_Initialize
2693 .(
2694 jsr _Arena_InitializeBackground
2695
2696 lda arena_type
2697 and #ARENATYPE_WALLS_HORIZONTAL
2698 beq skip_horizontal_wall
2699 ldy #0
2700 jsr _Arena_DrawRectangle
2701 skip_horizontal_wall
2702
2703 lda arena_type
2704 and #ARENATYPE_WALLS_VERTICAL
2705 beq skip_vertical_wall
2706 ldy #1
2707 jsr _Arena_DrawRectangle
2708 skip_vertical_wall
2709
2710
2711 ;//
2712 ;// Display any of the 6 possible obstacles
2713 ;// depending of a bit mask
2714 ;//
2715 .(
2716 lsr arena_obstacles
2717 bcc skip1
2718 jsr _Arena_Obstacles_Corridor
2719 skip1
2720 lsr arena_obstacles
2721 bcc skip2
2722 jsr _Arena_Obstacles_MickeyMouse
2723 skip2
2724 lsr arena_obstacles
2725 bcc skip3
2726 jsr _Arena_Obstacles_Cross
2727 skip3
2728 lsr arena_obstacles
2729 bcc skip4
2730 jsr _Arena_Obstacles_UTurn
2731 skip4
2732 //lsr arena_obstacles
2733 //bcc skip5
2734 //jsr _Arena_Obstacles_Blocks
2735 //skip5
2736 lsr arena_obstacles
2737 bcc skip6
2738 jsr _Arena_Obstacles_RoundedShapes
2739 skip6
2740 .)
2741
2742
2743 jsr _Apply_ShapeFilter
2744
2745
2746 // Initialise coordinates
2747 //lda #0
2748 //sta map_x
2749 //sta map_y
2750 rts
2751 .)
2752
2753
2754
2755
2756
2757
2758
2759 ;// y point on data definition
2760 _Arena_DrawRectangle
2761 //jmp _Arena_DrawRectangle
2762 .(
2763 jsr _SaveRegisters
2764
2765 lda #0
2766 sta pl_dst
2767 clc
2768 lda _ArenaItems_Table_PosY,y
2769 adc #>_BigBuffer
2770 sta ph_dst
2771
2772 lda _ArenaItems_Table_PosX,y
2773 sta primitive_x
2774 clc
2775 adc _ArenaItems_Table_Width,y
2776 sta temp_x
2777
2778 lda _ArenaItems_Table_Color,y
2779
2780 ldx _ArenaItems_Table_Height,y
2781 loop_y
2782 ldy primitive_x
2783 loop_x
2784 sta (ptr_dst),y
2785
2786 iny
2787 cpy temp_x
2788 bne loop_x
2789
2790 .(
2791 ldy ph_dst
2792 iny
2793 cpy #>(_BigBuffer+256*128)
2794 bne skip
2795 ldy #>_BigBuffer
2796 skip
2797 sty ph_dst
2798 .)
2799
2800 dex
2801 bne loop_y
2802
2803 jsr _RestoreRegisters
2804 rts
2805 .)
2806
2807
2808
2809 _Apply_ShapeFilter
2810 //jmp _Apply_ShapeFilter
2811 .(
2812 // Fill the whole buffer with black paper
2813 lda #<_BigBuffer+256+1
2814 sta pl_base_dst
2815 lda #>_BigBuffer+256+1
2816 sta ph_base_dst
2817
2818 ldx #1
2819 loop_y
2820 stx temp_x
2821
2822 ldy #0
2823 loop_x
2824 lda pl_base_dst
2825 sta pl_dst
2826 lda ph_base_dst
2827 sta ph_dst
2828
2829 // Is the middle pixel of the good color, or border color
2830 lda (ptr_base_dst),y
2831 cmp #16+6
2832 beq skip
2833 cmp #16+3
2834 beq skip
2835
2836
2837 // Top
2838 dec ph_dst
2839 lda (ptr_dst),y
2840 ldx #16+4
2841 cmp #16+6
2842 beq set
2843 ldx #16+1
2844 cmp #16+3
2845 beq set
2846
2847 // Left
2848 dec pl_dst
2849 inc ph_dst
2850 lda (ptr_dst),y
2851 ldx #16+4
2852 cmp #16+6
2853 beq set
2854 ldx #16+1
2855 cmp #16+3
2856 beq set
2857
2858
2859 ldx #16+7
2860
2861 // Right
2862 inc pl_dst
2863 inc pl_dst
2864 lda (ptr_dst),y
2865 cmp #16+6
2866 beq set
2867 cmp #16+3
2868 beq set
2869
2870 // Bottom
2871 dec pl_dst
2872 inc ph_dst
2873 lda (ptr_dst),y
2874 cmp #16+6
2875 beq set
2876 cmp #16+3
2877 bne skip
2878
2879 // Set to yellow color
2880 set
2881 txa //lda #16+6
2882 sta (ptr_base_dst),y
2883 skip
2884
2885 iny
2886 cpy #0
2887 bne loop_x
2888
2889 inc ph_base_dst
2890
2891 ldx temp_x
2892
2893 inx
2894 cpx #127
2895 bne loop_y
2896
2897 rts
2898 .)
2899
2900
2901 ;//
2902 ;// x => x coordinate of segment
2903 ;// y => value of pattern (0 or 1)
2904 ;//
2905 _FillGaugeSegment
2906 .(
2907 lda #0
2908 sta $2e2
2909 sta $2e4
2910 sta $2e6
2911
2912 sty $2e5 // Pattern
2913
2914 stx $2e1 // X
2915
2916 ldx #3
2917 stx $2e3 // Y
2918
2919 jsr _rom_curset
2920
2921 lda #0
2922 sta $2e1 // X
2923
2924 ldx #7
2925 stx $2e3 // Y
2926
2927 jsr _rom_draw
2928
2929 rts
2930 .)
2931
2932
2933 ;//
2934 ;// We fill from 239 to 140 (about)
2935 ;//
2936 _FillGauge
2937 .(
2938 ldx #239
2939 loop_draw
2940 stx timer_position
2941
2942 ldy #1
2943 jsr _FillGaugeSegment
2944
2945 jsr _TemporizeShort
2946
2947 ldx timer_position
2948 dex
2949 cpx #130
2950 bne loop_draw
2951 rts
2952 .)
2953
2954
2955
2956
2957
2958 ; .data
2959
2960 _BikesPictures_Left
2961 .byt 64
2962 .byt 64+%000111
2963 .byt 64+%001001
2964 .byt 64+%010000
2965 .byt 64+%011100
2966 .byt 64+%101111
2967 .byt 64+%100111
2968 .byt 64+%011000
2969 .byt 64
2970
2971 _BikesPictures_Right
2972 .byt 64
2973 .byt 64+%000000
2974 .byt 64+%110000
2975 .byt 64+%111100
2976 .byt 64+%011110
2977 .byt 64+%001011
2978 .byt 64+%111001
2979 .byt 64+%000110
2980 .byt 64
2981
2982
2983 _BigDigits
2984 // 0
2985 .byt 64+%011111
2986 .byt 64+%010001
2987 .byt 64+%010001
2988 .byt 64+%010011
2989 .byt 64+%010011
2990 .byt 64+%010011
2991 .byt 64+%010011
2992 .byt 64+%010011
2993 .byt 64+%011111
2994 .byt 64+%000000
2995
2996 // 1
2997 .byt 64+%000001
2998 .byt 64+%000001
2999 .byt 64+%000001
3000 .byt 64+%000011
3001 .byt 64+%000011
3002 .byt 64+%000011
3003 .byt 64+%000011
3004 .byt 64+%000011
3005 .byt 64+%000011
3006 .byt 64+%000000
3007
3008 // 2
3009 .byt 64+%011111
3010 .byt 64+%000001
3011 .byt 64+%000001
3012 .byt 64+%000001
3013 .byt 64+%011111
3014 .byt 64+%011000
3015 .byt 64+%011000
3016 .byt 64+%011000
3017 .byt 64+%011111
3018 .byt 64+%000000
3019
3020 // 3
3021 .byt 64+%011111
3022 .byt 64+%000001
3023 .byt 64+%000001
3024 .byt 64+%000011
3025 .byt 64+%011111
3026 .byt 64+%000011
3027 .byt 64+%000011
3028 .byt 64+%000011
3029 .byt 64+%011111
3030 .byt 64+%000000
3031
3032 // 4
3033 .byt 64+%010001
3034 .byt 64+%010001
3035 .byt 64+%010001
3036 .byt 64+%010011
3037 .byt 64+%011111
3038 .byt 64+%000011
3039 .byt 64+%000011
3040 .byt 64+%000011
3041 .byt 64+%000011
3042 .byt 64+%000000
3043
3044 // 5
3045 .byt 64+%011111
3046 .byt 64+%010000
3047 .byt 64+%010000
3048 .byt 64+%010000
3049 .byt 64+%011111
3050 .byt 64+%000011
3051 .byt 64+%000011
3052 .byt 64+%000011
3053 .byt 64+%011111
3054 .byt 64+%000000
3055
3056 // 6
3057 .byt 64+%011111
3058 .byt 64+%010000
3059 .byt 64+%010000
3060 .byt 64+%010000
3061 .byt 64+%011111
3062 .byt 64+%010011
3063 .byt 64+%010011
3064 .byt 64+%010011
3065 .byt 64+%011111
3066 .byt 64+%000000
3067
3068 // 7
3069 .byt 64+%011111
3070 .byt 64+%000001
3071 .byt 64+%000001
3072 .byt 64+%000011
3073 .byt 64+%000011
3074 .byt 64+%000011
3075 .byt 64+%000011
3076 .byt 64+%000011
3077 .byt 64+%000011
3078 .byt 64+%000000
3079
3080 // 8
3081 .byt 64+%011111
3082 .byt 64+%010001
3083 .byt 64+%010001
3084 .byt 64+%010011
3085 .byt 64+%011111
3086 .byt 64+%010011
3087 .byt 64+%010011
3088 .byt 64+%010011
3089 .byt 64+%011111
3090 .byt 64+%000000
3091
3092 // 9
3093 .byt 64+%011111
3094 .byt 64+%010001
3095 .byt 64+%010001
3096 .byt 64+%010011
3097 .byt 64+%011111
3098 .byt 64+%000011
3099 .byt 64+%000011
3100 .byt 64+%000011
3101 .byt 64+%011111
3102 .byt 64+%000000
3103
3104 // 0
3105 .byt 64+%011111
3106 .byt 64+%010001
3107 .byt 64+%010001
3108 .byt 64+%010011
3109 .byt 64+%010011
3110 .byt 64+%010011
3111 .byt 64+%010011
3112 .byt 64+%010011
3113 .byt 64+%011111
3114 .byt 64+%000000
3115
3116
3117 Intro_TronLogo_Raster_Offset_Low
3118 .byt <40
3119 .byt <-40
3120
3121 Intro_TronLogo_Raster_Offset_High
3122 .byt >40
3123 .byt >-40
3124
3125
3126 Intro_TronLogo_Description
3127 // R
3128 .byt CMD_CURSET //+CMD_NO_DRAW
3129 .word 96,101
3130 .byt CMD_CIRCLE
3131 .word 10
3132 .byt CMD_CIRCLE
3133 .word 20
3134 .byt CMD_FILL
3135 .word 20,4,64
3136 .byt CMD_CURSET+CMD_NO_DRAW
3137 .word 96-24,101-20
3138 .byt CMD_FILL
3139 .word 40,4,64
3140
3141 .byt CMD_CURSET+CMD_NO_DRAW
3142 .word 96,81
3143 .byt CMD_DRAW
3144 .word -15,0
3145 .byt CMD_DRAW
3146 .word 0,10
3147 .byt CMD_DRAW
3148 .word 15,0
3149
3150 .byt CMD_CURSET+CMD_NO_DRAW
3151 .word 116,101
3152 .byt CMD_DRAW
3153 .word -10,0
3154
3155 .byt CMD_CURMOV+CMD_NO_DRAW
3156 .word -3,0
3157 .byt CMD_DRAW
3158 .word 12,18
3159 .byt CMD_DRAW
3160 .word -12,0
3161 .byt CMD_DRAW
3162 .word -12,-18
3163 .byt CMD_DRAW
3164 .word 12,0
3165
3166 .byt CMD_CURMOV+CMD_NO_DRAW
3167 .word -14,0
3168 .byt CMD_DRAW
3169 .word 0,18
3170 .byt CMD_DRAW
3171 .word -10,0
3172 .byt CMD_DRAW
3173 .word 0,-18
3174 .byt CMD_DRAW
3175 .word 10,0
3176
3177 // T
3178 .byt CMD_CURSET+CMD_NO_DRAW
3179 .word 49,81
3180 .byt CMD_DRAW
3181 .word 30,0
3182 .byt CMD_DRAW
3183 .word 0,10
3184 .byt CMD_DRAW
3185 .word -10,0
3186 .byt CMD_DRAW
3187 .word 0,28
3188 .byt CMD_DRAW
3189 .word -10,0
3190 .byt CMD_DRAW
3191 .word 0,-28
3192 .byt CMD_DRAW
3193 .word -10,0
3194 .byt CMD_DRAW
3195 .word 0,-10
3196
3197 // O
3198 .byt CMD_CURSET+CMD_NO_DRAW
3199 .word 137,100
3200 .byt CMD_CIRCLE
3201 .word 10
3202 .byt CMD_CIRCLE
3203 .word 20
3204
3205 // N
3206 .byt CMD_CURSET+CMD_NO_DRAW
3207 .word 158,81
3208 .byt CMD_DRAW
3209 .word 0,38
3210 .byt CMD_DRAW
3211 .word 10,0
3212 .byt CMD_DRAW
3213 .word 0,-19
3214 .byt CMD_DRAW
3215 .word 5,0
3216 .byt CMD_DRAW
3217 .word -15,-19
3218
3219 .byt CMD_CURMOV+CMD_NO_DRAW
3220 .word 15+2,19
3221 .byt CMD_DRAW
3222 .word 5,0
3223 .byt CMD_DRAW
3224 .word 0,-19
3225 .byt CMD_DRAW
3226 .word 10,0
3227 .byt CMD_DRAW
3228 .word 0,38
3229 .byt CMD_DRAW
3230 .word -15,-19
3231
3232 .byt CMD_END
3233
3234
3235
3236
3237
3238 // one bytes => two digits
3239 // two bytes => 4 digits
3240 // four bytes => 8 digits
3241
3242 _TableNames
3243 .byt 2," TODAY'S HIGHS",254
3244 .byt 253,254
3245 _TableScores
3246 .byt 10,"00789 FLYNN",254,254
3247 .byt 10,"00540 MCP",254,254
3248 .byt 10,"00230 DBUG",254,254
3249 .byt 10,"00175 VANJA",254,254
3250 .byt 10,"00118 COUNT ZERO",254,254
3251 _LabelLastScore = *+1
3252 .byt 10,"00023 DILLINGER",254,254
3253 .byt 255
3254 sc
3255 _LabelPlayerScore
3256 .byt "00000 "
3257 _LabelPlayerScoreName
3258 .byt "SIMPLE USER",254,254
3259
3260
3261 _Message_PressSpace
3262 .byt 6,12,"Press SPACE to play"
3263 .byt 255
3264
3265 _Message_Pause
3266 .byt 253
3267 .byt 17,14,"PAUSE "
3268 .byt 255
3269
3270 _Message_GameOver
3271 .byt 253
3272 .byt 14,1,"DISCONNECTED"
3273 .byt 255
3274
3275 _Message_EnterName
3276 .byt 2,"Enter your name",254
3277 .byt 254
3278 .byt 1," ",62
3279 _LabelPlayerName
3280 .byt "SIMPLE USER",60 //]" // 11 characters
3281 .byt 254,254
3282 .byt 3,"2 Arrows control",254
3283 .byt 3," (UP to Change)"
3284 .byt 255
3285
3286
3287 _Message_LevelNumber
3288 .byt 253,2,10,"LEVEL #"
3289 _Message_LevelNumberPatch
3290 .byt "00"
3291 .byt 255
3292
3293
3294
3295
3296 // The various game types
3297 _Message_GameType_FindTheExit
3298 .byt 253,10,3,"Locate the shiny exit"
3299 .byt 255
3300
3301 // Snake/PacMan type :)
3302 _Message_GameType_Snake
3303 .byt 253,10,3,"Eat all the shiny dots"
3304 .byt 255
3305
3306 _Message_GameType_Duel
3307 .byt 253,10,3,"Defeat the other light cycle"
3308 .byt 255
3309
3310 _Message_GameType_Survivor
3311 .byt 253,10,3,"Stay alive until the time-out"
3312 .byt 255
3313
3314
3315
3316 _Message_Arena_NoWalls
3317 .byt 253,10,3,"The Arena is open"
3318 .byt 255
3319
3320 _Message_Arena_Closed
3321 .byt 253,10,3,"The Arena is closed"
3322 .byt 255
3323
3324 _Message_Arena_HorizontalWalls
3325 .byt 253,10,3,"The Arena is closed horizontaly"
3326 .byt 255
3327
3328 _Message_Arena_VerticalWalls
3329 .byt 253,10,3,"The Arena is closed verticaly"
3330 .byt 255
3331
3332
3333
3334
3335 _Message_AvoidCollision
3336 .byt 253,10,3,"Avoid any collision"
3337 .byt 254,254,254,254
3338 .byt 14,2," DOWNLOADING ARENA"
3339 .byt 255
3340
3341
3342 _HexDigits
3343 .byt "0123456789ABCDEF"
3344
3345
3346 // 12 values
3347 _HighScores_ColorGradient
3348 .byt 7,7
3349 .byt 3,3
3350 .byt 1,1
3351 .byt 5,5
3352 .byt 4,4
3353 .byt 6,6
3354
3355 .byt 16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4
3356 _Colorline_Gradient
3357 .byt 16+4,16+4,16+6,16+7,16+3,16+1,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4
3358 .byt 16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4
3359 .byt 16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4
3360 .byt 16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4,16+4
3361
3362
3363 _Table_LogoFade
3364 .byt 4
3365 .byt 6
3366 .byt 7
3367 .byt 3
3368 .byt 1
3369
3370 _Score_GradientColorTable
3371 .byt 1,3,3,7,7,7,3,3,1
3372
3373 _Score_GradientColorTable_Timebar
3374 .byt 0,7,3,3,3,3,3,1,0
3375
3376 // Table of colors used for the gradient on the Tron logo
3377 // Bits 210 Define the colors for down movement (blue gradient)
3378 // Bits 543 Define the colors for up movement (red gradient)
3379 ColorCycleTable
3380 .byt 4+(1<<3)
3381 .byt 4+(1<<3)
3382 .byt 6+(3<<3)
3383 .byt 4+(1<<3)
3384 .byt 6+(3<<3)
3385 .byt 6+(1<<3)
3386 .byt 7+(7<<3)
3387 .byt 6+(3<<3)
3388 .byt 7+(7<<3)
3389 .byt 7+(7<<3)
3390
3391
3392 //GradientOffet
3393 // .byt 0
3394
3395 //ColorLineGradientOffset
3396 // .byt 0
3397
3398 //ColorsCounter
3399 // .byt 0
3400
3401 _LifeColors_Gradient
3402 .byt 0,0,0,6,6,6
3403
3404 ColorLightCycle
3405 .byt 16+4
3406 .byt 16+1
3407
3408 ColorsTrailTable
3409 .byt 16+6,16+4,16+5,16+4, // BLUE
3410 .byt 16+3,16+1,16+5,16+1 // Red
3411
3412
3413 _SquareTable
3414 .byt 0 // 0*0
3415 .byt 1 // 1*1
3416 .byt 4 // 2*2
3417
3418 .byt 9 // 3*3
3419 .byt 16 // 4*4
3420 .byt 25 // 5*5
3421 .byt 36 // 6*6
3422
3423 .byt 49 // 7*7
3424 .byt 64 // 8*8
3425 .byt 81 // 9*9
3426
3427 .byt 100 // 10*10
3428 .byt 121 // 11*11
3429 // From there, we have overflow :)
3430 .byt 144 // 12*12
3431 .byt 169 // 13*13
3432 .byt 196 // 14*14
3433 .byt 225 // 15*15
3434 .byt 255 // (16*16)-1 // 255
3435
3436 _BlueExplosion
3437 .byt 16+0
3438 .byt 16+4
3439 .byt 16+6
3440 .byt 16+7
3441 .byt 16+6
3442 .byt 16+4
3443 .byt 16+0
3444 .byt 16+0
3445 _RedExplosion
3446 .byt 16+0
3447 .byt 16+1
3448 .byt 16+3
3449 .byt 16+7
3450 .byt 16+3
3451 .byt 16+1
3452 .byt 16+0
3453 .byt 16+0
3454
3455
3456
3457 // List of index values:
3458 // 0 => Erase Tron Logo
3459 // 1 => Erase the text part of screen (During Tron intro)
3460 // 2 => Erase the text part of screen (In Game)
3461 // 3 => Erase the text part of screen (In Game) with value 16
3462 // 4 => Erase the zero page area
3463 // 5 => Erase the BSS
3464 _EraseMemory_Table_AddrLow
3465 .byt <$a000+40*3
3466 .byt <$bb80+40*9
3467 .byt <$bb80+40*2
3468 .byt <$bb80+40*2
3469 .byt <_zp_start_
3470 .byt <_BssStart_
3471
3472 _EraseMemory_Table_AddrHigh
3473 .byt >$a000+40*3
3474 .byt >$bb80+40*9
3475 .byt >$bb80+40*2
3476 .byt >$bb80+40*2
3477 .byt >_zp_start_
3478 .byt >_BssStart_
3479
3480 _EraseMemory_Table_CountLow
3481 .byt <40*51
3482 .byt <40*18
3483 .byt <40*26-1
3484 .byt <40*26-1
3485 .byt <_zp_end_-_zp_start_
3486 .byt <_BssEnd_-_BssStart_
3487
3488 _EraseMemory_Table_CountHigh
3489 .byt >40*51
3490 .byt >40*18
3491 .byt >40*26-1
3492 .byt >40*26-1
3493 .byt >_zp_end_-_zp_start_
3494 .byt >_BssEnd_-_BssStart_
3495
3496 _EraseMemory_Table_EraseValue
3497 .byt 64
3498 .byt 0
3499 .byt 0
3500 .byt 16
3501 .byt 0
3502 .byt 0
3503
3504
3505
3506 // List of all messages:
3507 // 0 => Press space
3508 // 1 => High scores table
3509 // 2 => Level number
3510 // 3 => Enter name
3511 // 4 => Game Type Find the Exit
3512 // 5 => Game Type Snake
3513 // 6 => Game Type Duel
3514 // 7 => Game Type Survivor
3515 // 8 => Arena Warps
3516 // 9 => Arena Walls Horizontal
3517 // 10 => Arena Walls Vertical
3518 // 11 => Arena Walls around
3519 // 12 => Avoid collision !
3520 // 13 => Pause
3521 // 14 => Game over
3522 _Messages_Table_AddrLow
3523 .byt <_Message_PressSpace
3524 .byt <_TableNames
3525 .byt <_Message_LevelNumber
3526 .byt <_Message_EnterName
3527
3528 .byt <_Message_GameType_FindTheExit
3529 .byt <_Message_GameType_Snake
3530 .byt <_Message_GameType_Duel
3531 .byt <_Message_GameType_Survivor
3532
3533 .byt <_Message_Arena_NoWalls
3534 .byt <_Message_Arena_HorizontalWalls
3535 .byt <_Message_Arena_VerticalWalls
3536 .byt <_Message_Arena_Closed
3537
3538 .byt <_Message_AvoidCollision
3539
3540 .byt <_Message_Pause
3541 .byt <_Message_GameOver
3542
3543
3544 _Messages_Table_AddrHigh
3545 .byt >_Message_PressSpace
3546 .byt >_TableNames
3547 .byt >_Message_LevelNumber
3548 .byt >_Message_EnterName
3549
3550 .byt >_Message_GameType_FindTheExit
3551 .byt >_Message_GameType_Snake
3552 .byt >_Message_GameType_Duel
3553 .byt >_Message_GameType_Survivor
3554
3555 .byt >_Message_Arena_NoWalls
3556 .byt >_Message_Arena_HorizontalWalls
3557 .byt >_Message_Arena_VerticalWalls
3558 .byt >_Message_Arena_Closed
3559
3560 .byt >_Message_AvoidCollision
3561
3562 .byt >_Message_Pause
3563 .byt >_Message_GameOver
3564
3565
3566 _Messages_Table_ScreenAddrLow
3567 .byt <$bb80+40*26+9
3568 .byt <$bb80+40*10+11
3569 .byt <$bb80+40*10+13
3570 .byt <$bb80+40*14+11
3571
3572 .byt <$bb80+40*14+8
3573 .byt <$bb80+40*14+10
3574 .byt <$bb80+40*14+5
3575 .byt <$bb80+40*14+3
3576
3577 .byt <$bb80+40*16+10
3578 .byt <$bb80+40*16+3
3579 .byt <$bb80+40*16+4
3580 .byt <$bb80+40*16+9
3581
3582 .byt <$bb80+40*18+9
3583
3584 .byt <$bb80+40*14+14
3585
3586 .byt <$bb80+40*14+11
3587
3588 _Messages_Table_ScreenAddrHigh
3589 .byt >$bb80+40*26+9
3590 .byt >$bb80+40*10+11
3591 .byt >$bb80+40*10+13
3592 .byt >$bb80+40*14+11
3593
3594 .byt >$bb80+40*14+8
3595 .byt >$bb80+40*14+10
3596 .byt >$bb80+40*14+5
3597 .byt >$bb80+40*14+3
3598
3599 .byt >$bb80+40*16+10
3600 .byt >$bb80+40*16+3
3601 .byt >$bb80+40*16+4
3602 .byt >$bb80+40*16+9
3603
3604 .byt >$bb80+40*18+9
3605
3606 .byt >$bb80+40*14+14
3607
3608 .byt >$bb80+40*14+11
3609
3610
3611
3612 _Arena_BackgroundTable_AddrLow
3613 .byt <_Arena_BackgroundPixel_Black
3614 .byt <_Arena_BackgroundPixel_Green
3615 .byt <_Arena_BackgroundPixel_Checkboard
3616 .byt <_Arena_BackgroundPixel_Grid
3617
3618 _Arena_BackgroundTable_AddrHigh
3619 .byt >_Arena_BackgroundPixel_Black
3620 .byt >_Arena_BackgroundPixel_Green
3621 .byt >_Arena_BackgroundPixel_Checkboard
3622 .byt >_Arena_BackgroundPixel_Grid
3623
3624
3625
3626 _DrawCircle_PixelRenderTable_AddrLow
3627 .byt <_DrawCircle_PixelRender_Explode
3628 .byt <_DrawCircle_PixelRender_DrawDisc
3629
3630 _DrawCircle_PixelRenderTable_AddrHigh
3631 .byt >_DrawCircle_PixelRender_Explode
3632 .byt >_DrawCircle_PixelRender_DrawDisc
3633
3634
3635
3636 ExplodeDistanceTable
3637 .byt 95,60,30,15,4,0
3638
3639
3640
3641 //
3642 // 0 => Horizontal wall (orange)
3643 // 1 => Vertical wall (orange)
3644
3645 // Serie of blocs for the corridor
3646 // 2 => 11
3647
3648 // Serie of discs for the Mickey Level
3649 // 12 => 14
3650
3651 // Serie of blocs for the cross
3652 // 15 => 16
3653
3654 // Serie of blocs for the UTurn
3655 // 17 => 28
3656
3657 // Serie of blocs for the round shapes
3658 // 29 =>
3659 //
3660 _ArenaItems_Table_PosX
3661 .byt 0 // 0
3662 .byt 255 // 1
3663
3664 .byt 16 // 2
3665 .byt 37 // 3
3666 .byt 37 // 4
3667 .byt 99 // 5
3668 .byt 154 // 6
3669 .byt 177 // 7
3670 .byt 72 // 8
3671 .byt 203 // 9
3672 .byt 62 // 10
3673 .byt 124 // 11
3674
3675 .byt 128 // 12
3676 .byt 128+24 // 13
3677 .byt 128+14 // 14
3678
3679 // Cross
3680 .byt 190 // 15
3681 .byt 120 // 16
3682
3683 // Uturn
3684 .byt 48 // 17
3685 .byt 48 // 18
3686 .byt 82 // 19
3687
3688 .byt 169 // 20
3689 .byt 169 // 21
3690 .byt 169 // 22
3691
3692 .byt 104 // 23
3693 .byt 144 // 24
3694 .byt 104 // 25
3695
3696 .byt 104 // 26
3697 .byt 144 // 27
3698 .byt 104 // 28
3699
3700 // Round shapes
3701 .byt 11 // 29
3702 .byt 11 // 30
3703 .byt 11 // 31
3704 .byt 11 // 32
3705
3706 .byt 181 // 33
3707 .byt 226 // 34
3708 .byt 226 // 35
3709 .byt 181 // 36
3710
3711
3712 _ArenaItems_Table_PosY
3713 .byt 127
3714 .byt 0
3715
3716 .byt 1
3717 .byt 11
3718 .byt 11
3719 .byt 22
3720 .byt 11
3721 .byt 35
3722 .byt 47
3723 .byt 60
3724 .byt 36
3725 .byt 1
3726
3727 .byt 64
3728 .byt 64-12
3729 .byt 64+8
3730
3731 .byt 60
3732 .byt 96
3733
3734 //
3735 .byt 41 // 17
3736 .byt 81 // 18
3737 .byt 41 // 19
3738
3739 .byt 41 // 20
3740 .byt 81 // 21
3741 .byt 41 // 22
3742
3743 .byt 21 // 23
3744 .byt 21 // 24
3745 .byt 45 // 25
3746
3747 .byt 82 // 26
3748 .byt 82 // 27
3749 .byt 82 // 28
3750
3751 // Round shapes
3752 .byt 5 // 29
3753 .byt 5 // 30
3754 .byt 78 // 31
3755 .byt 98 // 32
3756
3757 .byt 5 // 33
3758 .byt 5 // 34
3759 .byt 78 // 35
3760 .byt 98 // 36
3761
3762
3763 _ArenaItems_Table_Radius
3764 _ArenaItems_Table_Width
3765 .byt 0 // 256
3766 .byt 2
3767
3768 .byt 10
3769 .byt 10
3770 .byt 73
3771 .byt 66
3772 .byt 88
3773 .byt 78
3774 .byt 114
3775 .byt 38
3776 .byt 23
3777 .byt 18
3778
3779 .byt 12
3780 .byt 12
3781 .byt 14
3782
3783 .byt 130
3784 .byt 16
3785
3786 //
3787 .byt 41 // 17
3788 .byt 41 // 18
3789 .byt 7 // 19
3790
3791 .byt 41 // 20
3792 .byt 41 // 21
3793 .byt 7 // 22
3794
3795 .byt 7 // 23
3796 .byt 7 // 24
3797 .byt 47 // 25
3798
3799 .byt 7 // 26
3800 .byt 7 // 27
3801 .byt 47 // 28
3802
3803 // Round shapes
3804 .byt 24 // 29
3805 .byt 69 // 30
3806 .byt 24 // 31
3807 .byt 69 // 32
3808
3809 .byt 69 // 33
3810 .byt 24 // 34
3811 .byt 24 // 35
3812 .byt 69 // 36
3813
3814
3815 _ArenaItems_Table_Height
3816 .byt 2
3817 .byt 128
3818
3819 .byt 116
3820 .byt 116
3821 .byt 13
3822 .byt 13
3823 .byt 13
3824 .byt 13
3825 .byt 63
3826 .byt 67
3827 .byt 74
3828 .byt 10
3829
3830 .byt 0
3831 .byt 0
3832 .byt 0
3833
3834 .byt 10
3835 .byt 64
3836
3837 //
3838 .byt 7 // 17
3839 .byt 7 // 18
3840 .byt 47 // 19
3841
3842 .byt 7 // 20
3843 .byt 7 // 21
3844 .byt 47 // 22
3845
3846 .byt 27 // 23
3847 .byt 27 // 24
3848 .byt 7 // 25
3849
3850 .byt 27 // 26
3851 .byt 27 // 27
3852 .byt 7 // 28
3853
3854 // Round shapes
3855 .byt 44 // 29
3856 .byt 24 // 30
3857 .byt 44 // 31
3858 .byt 24 // 32
3859
3860 .byt 24 // 33
3861 .byt 44 // 34
3862 .byt 44 // 35
3863 .byt 24 // 36
3864
3865
3866 _ArenaItems_Table_Color
3867 .byt 16+3
3868 .byt 16+3
3869
3870 .byt 16+3
3871 .byt 16+3
3872 .byt 16+3
3873 .byt 16+3
3874 .byt 16+3
3875 .byt 16+3
3876 .byt 16+3
3877 .byt 16+3
3878 .byt 16+3
3879 .byt 16+6
3880
3881 .byt 16+3
3882 .byt 16+3
3883 .byt 16+6
3884
3885 .byt 16+3
3886 .byt 16+3
3887
3888 //
3889 .byt 16+3 // 17
3890 .byt 16+3 // 18
3891 .byt 16+3 // 19
3892
3893 .byt 16+3 // 20
3894 .byt 16+3 // 21
3895 .byt 16+3 // 22
3896
3897 .byt 16+6 // 23
3898 .byt 16+6 // 24
3899 .byt 16+6 // 25
3900
3901 .byt 16+6 // 26
3902 .byt 16+6 // 27
3903 .byt 16+6 // 28
3904
3905 // Round shapes
3906 .byt 16+3 // 29
3907 .byt 16+3 // 30
3908 .byt 16+6 // 31
3909 .byt 16+6 // 32
3910
3911 .byt 16+6 // 33
3912 .byt 16+6 // 34
3913 .byt 16+3 // 35
3914 .byt 16+3 // 36
3915
3916
3917 //
3918 // List of levels:
3919 // No TYPE WALLS LEVEL
3920 // 00 EXIT ALL CORRIDOR
3921 // 01 TIME MICKEY+ANGLES
3922 // 02 CYCLE
3923 // 03 EXIT
3924 // 04 CYCLE
3925 // 05 TIME
3926 // 06 CYCLE
3927 // 07 TIME
3928
3929
3930 // Definition of levels contains:
3931 // - Game type on two bits (4 values)
3932 // - Game warp mode on two bits (4 values)
3933 // - Arena color scheme on two bits (4 values)
3934 // - Orientation of player on two bits (4 values)
3935 _LevelDef_Infos_Arena
3936 .byt GAMETYPE_FIND_THE_EXIT +(ARENATYPE_WALLS_ALL<<2) +(ARENACOLOR_BLACK<<4) +(DIRECTION_DOWN<<6)
3937 .byt GAMETYPE_SURVIVOR +(ARENATYPE_WALLS_NONE<<2) +(ARENACOLOR_GRID<<4) +(DIRECTION_RIGHT<<6)
3938 .byt GAMETYPE_DUEL +(ARENATYPE_WALLS_ALL<<2) +(ARENACOLOR_CHESSBOARD<<4) +(DIRECTION_UP<<6)
3939 .byt GAMETYPE_FIND_THE_EXIT +(ARENATYPE_WALLS_NONE<<2) +(ARENACOLOR_GRID<<4) +(DIRECTION_LEFT<<6)
3940 .byt GAMETYPE_DUEL +(ARENATYPE_WALLS_HORIZONTAL<<2)+(ARENACOLOR_CHESSBOARD<<4) +(DIRECTION_LEFT<<6)
3941 .byt GAMETYPE_SURVIVOR +(ARENATYPE_WALLS_NONE<<2) +(ARENACOLOR_GREEN<<4) +(DIRECTION_LEFT<<6)
3942 .byt GAMETYPE_DUEL +(ARENATYPE_WALLS_VERTICAL<<2) +(ARENACOLOR_GRID<<4) +(DIRECTION_DOWN<<6)
3943 .byt GAMETYPE_SURVIVOR +(ARENATYPE_WALLS_ALL<<2) +(ARENACOLOR_CHESSBOARD<<4) +(DIRECTION_RIGHT<<6)
3944
3945 // Orientation of the player
3946 // - Orientation of second player on two bits (4values)
3947 // - [Remains 6 bits]
3948 _LevelDef_Infos_Direction0
3949 .byt 0 +((OBSTACLE_CORRIDOR)<<2)
3950 .byt 0 +((OBSTACLE_ROUNDEDSHAPES+OBSTACLE_MICKEY)<<2)
3951 .byt DIRECTION_UP +((OBSTACLE_CROSS)<<2)
3952 .byt 0 +((OBSTACLE_CROSS+OBSTACLE_ROUNDEDSHAPES)<<2)
3953 .byt DIRECTION_RIGHT+((OBSTACLE_MICKEY)<<2)
3954 .byt 0 +((OBSTACLE_CORRIDOR)<<2)
3955 .byt DIRECTION_UP +((OBSTACLE_ROUNDEDSHAPES)<<2)
3956 .byt 0 +((OBSTACLE_ROUNDEDSHAPES+OBSTACLE_MICKEY+OBSTACLE_CROSS)<<2)
3957
3958 _LevelDef_Infos_XPos0
3959 .byt 9
3960 .byt 20
3961 .byt 124
3962 .byt 47
3963 .byt 107
3964 .byt 132
3965 .byt 124
3966 .byt 183
3967
3968 _LevelDef_Infos_YPos0
3969 .byt 4
3970 .byt 64
3971 .byt 88
3972 .byt 74
3973 .byt 63
3974 .byt 19
3975 .byt 63
3976 .byt 3
3977
3978 // Position of the second player, or of the exit,
3979 // depending of the current game mode
3980 // Or timer decaying speed in against the clock mode
3981 _LevelDef_Infos_XPos1
3982 .byt 246
3983 .byt 10 // Timer decay speed
3984 .byt 132
3985 .byt 127
3986 .byt 167
3987 .byt 15 // Timer decay speed
3988 .byt 132
3989 .byt 20 // Timer decay speed
3990
3991 _LevelDef_Infos_YPos1
3992 .byt 115
3993 .byt 0 // UNUSED
3994 .byt 88
3995 .byt 63
3996 .byt 63
3997 .byt 0 // UNUSED
3998 .byt 63
3999 .byt 0 // UNUSED
4000
4001
4002
4003
4004 ;//
4005 ;// These two tables are used to define the increments to
4006 ;// apply to move the players on the map depending of the
4007 ;// orientation.
4008 ;//
4009 ;// 0 <-
4010 ;// 1 ^
4011 ;// 2 ->
4012 ;// 3 v
4013 ;//
4014 _Move_IncrementTable_Y
4015 .byt 0
4016 _Move_IncrementTable_X
4017 .byt 255
4018 .byt 0
4019 .byt 1
4020 .byt 0
4021
4022
4023 EndText
4024
4025 .bss
4026
4027 *=EndText
4028
4029 ;
4030 ; Allign the content of BSS section to a byte boudary
4031 ;
4032 .dsb 256-(*&255)
4033
4034 _BssStart_
4035
4036
4037 //
4038 // Game area is a 256x128 buffer => 32768k
4039 //
4040 _BigBuffer
4041 .dsb 256*128
4042
4043 .byt 0
4044 ScoreTable
4045 .byt 0 // 0
4046 .byt 0 // 1
4047 .byt 0 // 2
4048 .byt 0 // 3
4049 .byt 0 // 4
4050 .byt 0 // 5
4051
4052 .byt 0
4053 ScoreTable_Sub
4054 .byt 0 // 0
4055 .byt 0 // 1
4056 .byt 0 // 2
4057 .byt 0 // 3
4058 .byt 0 // 4
4059 .byt 0 // 5
4060
4061
4062
4063
4064 _BssEnd_
4065
4066
4067

  ViewVC Help
Powered by ViewVC 1.1.26