9 DELC_LEN = _undelBufLen ;$64 bytes long
14 .dw $0001 ;description type 2 (= +YASicon)
15 .dw Title ;pointer to description
16 .dw spr_ship ;pointer to YAS icon
18 Title: .db "Nemesis v0.93.911 by Shiar",0
20 just_fired = TEXT_MEM ;byte
21 temp1 = TEXT_MEM+1 ;word
22 RanPos = TEXT_MEM+3 ;byte
23 firex = TEXT_MEM+4 ;byte
27 your_locpos = TEXT_MEM+8 ;byte
28 your_prevpos = TEXT_MEM+9 ;16 words
31 ybullets = your_prevpos+32 ;20 x (state,x,y)
33 ebullets = ybullets+(nrybullets*3) ;10 x (state,x,y)
37 ; %111111 (HP left) 11 (00=no enemy 01=exploding 10=normal 11=moving)
38 ; %11111111 (ship type or explosion frame) %11111111 (x) %11111111 (y)
39 add2enemy = nrenemies*4
40 enemiesxtra = enemies+add2enemy
41 ; $11 (move) $11 (fire)
43 ;---------------------- init --------------------------------------------------
46 call _runindicoff ;turn the run-indicator off, obviously
47 call _clrLCD ;clean the screen
52 ld a,(CONTRAST) ;load current contrast level
53 cp $1f ;if already at maximum...
54 jr z,skipdarken ;...then skip level increase
55 inc a ;otherwise increase contrast level
59 ;---------------------- main menu ---------------------------------------------
62 ld hl,logo_nemesis ;from...
63 ld de,VIDEO_MEM+16 ;...to one line from top
66 ld bc,16 ;set screen width
67 ldir ;display one line
68 dec a ;decrease line-counter
69 jr nz,LogoLoop ;repeat when counter is not yet zero
71 ld hl,VIDEO_MEM+(16*$39)+4 ;$39 rows down, 4 cols right (4*8=$20)
72 ld b,$8 ;draw 8x one byte = 8*8 = 64 pixels wide
73 ld a,%11111111 ;horizontal line mask
75 ld (hl),a ;draw one piece of the divider-line
76 inc hl ;move right (8 pixels = 1 byte)
77 djnz underline ;repeat (16bytes * 8pixels =128= screen width)
80 ld hl,$3320 ;near the bottom of the screen
82 ld hl,txt_about ;display version and author (yes, that's me!)
86 ld hl,$3a1e ;below previous stuff
88 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
89 call _vputs ;VERY important, so display in small font ?:}
91 call _getkey ;wait for keypress
92 call New_game ;prepare level
94 ;------------------------------------------------------------------------------
95 ;---------------------- game loop ---------------------------------------------
96 ;------------------------------------------------------------------------------
98 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
99 ld hl,timer ;update time
100 inc (hl) ;increase by 1
101 ld b,(hl) ;new time, save for rand# upd. (no flag change)
102 jr nz,updaterandom ;continue when new time <> 0
103 ld hl,1 ;once every 256 frames, increase score by 1
107 ld hl,RanPos ;random counter
108 ld a,(hl) ;random value
109 add a,b ;even more random by adding timer
111 ld (hl),a ;save even more random value back
114 ld hl,GRAPH_MEM ;move from (hl) = top left
115 ld (hl),$00 ;first pixel will be copied all over the screen
116 ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
117 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
121 ld a,%00111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
122 out (1),a ;ask for them
123 nop \ nop ;delay 8 clocks
127 bit 6,a ;test bit 6 = exit-key = EXIT
128 jp z,game_over_nopop ;<exit> pressed, so be it
130 bit 7,a ;test bit 7 = more-key = PAUSE
131 call z,Pause ;yes, go to pause
134 bit 5,a ;test bit 5 = 2nd-key = FIRE
135 ld hl,game_stuff ;where to continue after executing Fire_bullet
136 push hl ;push hl on stack (instead of call Fire_bullet)
137 jp z,Fire_bullet ;fire smtn (bulletstorplasersmultiples+stuff..)
138 pop hl ;no call to Fire_bullet made, so pop stack
139 ld hl,just_fired ;no:
140 ld (hl),0 ;reset just_fired
143 call Level_event ;insert enemies
144 call Handle_Ship ;move you
145 call Handle_enemies ;move enemies
147 ld a,(your_occ) ;are you 100% OK?
149 jr nz,activesdone ;then don't check for movements/fires/...
151 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
152 out (1),a ;gimme gimme
153 nop \ nop ;what's taking you so long
154 in a,(1) ;at last... our precious keyzzz...
155 ;old: <bit 7,a \ call z,select> now see this:
156 rla ;test bit 7 so we know f ALPHA has been pressed
157 call nc,select ;yeppy, select the currently selected upgrade
158 call Enemies_hit ;check for collision with enemies
161 call Handle_bullets ;move your bullets
162 call Handle_torp ;move your torpedo
163 call Enemy_bullets ;move enemy bullets
165 call Display_Screen ;display all
168 jr game_main_loop ;LOOP
170 ;--------------------------- pause --------------------------------------------
173 ld hl,$0200 ;top left
175 ld hl,txt_pressenter ;"Enter to continue"
176 call _puts ;display message
178 call _getkey ;enter low-power mode and wait for key
179 cp kEnter ;keypressed = enter?
180 jr nz,pause ;no, wait some more
183 ;--------------------------- exit ---------------------------------------------
186 call _clrLCD ;clears screen
187 call _homeup ;set cursor to top-left
188 ld a,(CONTRAST) ;load original contrast level
189 out (2),a ;and set it back
190 ld (iy+13),6 ;restore system-flags
193 ;--------------------------- display ------------------------------------------
196 ld hl,GRAPH_MEM ;from storage (top left)
197 ld de,VIDEO_MEM ;to screen (top left)
198 ld a,56 ;display height = 64 bytes (minus 8 for bar)
200 ld bc,16 ;display width = 16 bytes (16*8bits=256pixels)
203 jr nz,displayloop ;loop 64x
205 ld hl,$396b ;Display Score
206 ld (_penCol),hl ;bottom right of screen
209 _D_HL_DECI: ;------- display 5-digit value -------
210 ld de,savestr+4 ;savenr saves number string
212 ldhld: call UNPACK_HL ;one digit of hl
213 add a,'0' ;make number
214 ld (de),a ;save into savenr
215 dec de ;point to next digit
216 djnz ldhld ;repeat for all digits
219 call _vputs ;display string
225 ;------------------------- handle ship ----------------------------------------
230 jr z,ok ;0 = normal stat
232 inc a ;next (explosion)frame
233 ld (your_occ),a ;save
235 cp 34 ;last explosion frame?
236 jp c,exploding_you ;not yet: display explosion
237 cp 40 ;delay finished?
238 jp z,You_die ;yes = game over
239 ret ;don't display anything
244 ld hl,y ;instead of nop\nop do something usefull
247 ld b,a ;push a (keys)
248 xor %11111111 ;inverted a = 0 if arrow-key has been pressed
249 ld a,(your_multiples)
250 jr z,no_adv ;if so, leave the multiples where they are
251 or %100 ;set move bit
254 and %11111011 ;reset move bit
256 ld (your_multiples),a
259 rra ;rotate right (put last bit in c)
264 cp 49 ;55-6 = bottom of screen
270 rr b ;because we now use b, it's rr instead of rra
273 sub 1 ;<dec a> doesn't affect c-flag
274 jr c,no_left ;-1 = left side
280 cp 121 ;127-6 = right side
290 sub 1 ;<dec a> doesn't affect carry-flag
291 jr c,no_up ;-1 = top of screen
292 ld (hl),a ;save new y
295 ld ix,spr_ship01 ;ship sprite
296 ld hl,your_inv ;invulnerable?
297 ld a,(hl) ;load time in a
299 jr z,handle_multiples ;yes so ship = normal (display \ continue)
301 ld b,a ;save inv-time
302 ld a,(timer) ;load frame nr.
303 and %00000011 ;a=0 once every four frames
304 jr nz,not_time ;a<>0 = not time to update counter
305 dec (hl) ;decrease inv-time left
307 and %00000010 ;a switches 0<->1 every 2 frames
308 jr z,no_flicker ;don't show normal sprite anyway
310 and %11110000 ;inv-time <16 ticks left?
311 jr z,handle_multiples ;yes: display normal sprite and continue
314 ld ix,spr_ship01i ;display inv-ship (ld ix is faster than add ix)
317 call putsprite ;display your ship
319 ld a,(your_multiples) ;do you have multiples
320 ld b,a ;save a for 2nd check
321 and %11 ;no? (last two bits = nr of multiples)
322 ret z ;then don't handle them either
325 ld a,b ;restore a (your_multiples)
326 and %100 ;move the multiples???
327 jr z,mult_adv ;nope, just let them (saves (y) in y, (x) in x)
329 ld hl,your_locpos ;location to save this position
332 and %00001111 ;if a>15 then a=a-16
333 ld (hl),a ;save new a
338 ld hl,your_prevpos ;previous positions
339 add hl,bc ;16 turns ago
343 ld (mx),de ;save multiple position in (mx)
345 ld a,(y) ;load new y-pos
346 ld (hl),a ;save it for 16 turns in the future
348 ld a,(x) ;load new x-pos
349 ld (hl),a ;save that too
353 ld ix,spr_multiple ;sprite of the multiple
354 jp putsprite ;display it + <ret>
357 srl a ;half the framerate
358 dec a ;first frame is 1>inc>srl>dec = 0
377 ld a,(your_inv) ;invulnerability left?
379 ret nz ;return if inv>0
380 ld hl,your_armor ;armor left
383 jp m,no_armor ;yes, 0hp left so explode
384 ld (hl),a ;no, so save decreased hp
385 call disp_armor ;and display new value
388 ld a,%01 ;occ %xxxxxx01 = explode
389 ld (your_occ),a ;set to explode
392 ;------------------------- place multiples ------------------------------------
395 ld (mx),de ;set last multiple-position
396 ld hl,your_prevpos ;place all previous positions
397 ld b,16 ;all 16 of them
399 ld (hl),d ;set prev-x to d
401 ld (hl),e ;set prev-y to e
403 djnz place_multiples ;repeat
406 ;------------------------- select upgrade -------------------------------------
409 ld hl,your_pickup ;select pickups
410 ld a,(hl) ;load pickups taken so far
412 jr nz,select2 ;no, carry on
413 ld (hl),a ;reset pickups (a=0)
414 ld hl,your_armor ;change armor
415 inc (hl) ;increase HPs by one
416 jp disp_icons ;display and return
419 jr nz,select3 ;no, carry on
420 ld (hl),a ;reset pickups
422 ld (torp_occ),a ;ready torpedoes
423 jp disp_icons ;display 'n return
426 jr nz,select4 ;no, carry on
427 ld (hl),a ;reset pickups
428 jp disp_icons ;display n return
431 jr nz,select5 ;no, carry on again
432 ld (hl),a ;reset pickups
434 ld (your_laser),a ;ready laser
435 jp disp_icons ;display + return
438 jr nz,select6 ;no, carry on once more
439 ld (hl),a ;reset pickups
441 ld (your_multiples),a
444 jp disp_icons ;display, return
446 ld (hl),0 ;reset pickups
447 jp disp_icons ;display/return
449 ;------------------------- fire bullet ----------------------------------------
453 inc (hl) ;update random counter
456 ld a,(hl) ;just_fired
457 cp 5 ;already pressed?
458 ret z ;return when already pressed (=5)
459 inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
460 ld a,(your_laser) ;if you have bullets.....
463 ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
466 ld hl,(x) ;yes: first fire from ship position (x)
467 ld (firex),hl ;set firepos
468 ld a,(your_multiples) ;any multiples?
470 jr z,fireany ;then just fire somethin'
471 call fireany ;and blast
472 ld hl,(my) ;then, fire from multiple position (mx)
475 ld (firex),hl ;set firepos
476 ;blast again and <ret>
478 ld a,(your_laser) ;do you have laser?
480 jr nz,fire_ybullet ;no, just fire a bullet
482 fire_laser: ;yes, fire that laser instead
483 ld a,(firex) ;a = your x-pos
486 ld hl,GRAPH_MEM ;save-location
487 ld a,(firey) ;y-coord
488 add a,3 ;at middle of your ship (y+3)
489 ld e,a ;save laser-y in e
493 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
494 add a,a ;y*16 (width of screen)
495 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
496 inc a ;8 pixels to right (a=even so no overflow)
501 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
502 jr nc,_nolc ;jump if no carry = no overflow = a<=255
503 inc b ;a>255 so increase bc by 256
504 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
505 add hl,bc ;bc = Y*16+X/8
507 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
508 sub d ;minus x-start (d=X/8)
513 inc hl ;Go to next byte
518 ld d,a ;d was divided, so reload the laser-x
520 check_laserhits: ;de = (x,y)
525 laserhits: ;Hits with normal enemies
530 jr z,nolashit ;no hit when enemy_occ <> 2/3
534 or a ;enemy #0 = pickup
535 jr z,nolashit ;yes: don't destroy
540 jp m,nolashit ;no hit when enemy is left of you
545 jp z,enemy_hit ;a-e=0 = laser on top line of enemy = hit
546 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
547 add a,5 ;add enemy height
548 jp p,enemy_hit ;a-e>0 = hit
552 inc hl ;go to next enemy
556 djnz laserhits ;check all enemies
561 jr fire_torp ;fire torpedoes as well
570 jr z,found_ybullet ;0 = no bullet here
572 djnz find_ybullet ;look next bullet
576 ld (hl),1 ;use bullet
577 ld a,(firex) ;your x-pos
578 add a,5 ;place bullet in front of you
579 inc hl ;go to bullet-x
581 ld e,a ;save torp-x in e
583 ld a,(firey) ;your y-pos
584 add a,2 ;place bullet at the middle of your ship
585 inc hl ;go to bullet-y
587 add a,3 ;place torpedo at bottom of ship
588 ld d,a ;save torp-y in d
591 ld hl,torp_occ ;torpedo...
592 ld a,(hl) ;load torpInfo
593 dec a ;do you have (unused) torpedoes?
594 ret nz ;nope (a must be 1)
595 ld (hl),2 ;yes; use torpedo
596 ld (torp_pos),de ;save torpedo position (in de)
599 ;------------------------ handle bullets --------------------------------------
603 ld (hl),0 ;dump this bullet!
616 call z,bullet_2left ;yes: 2left
620 add hl,de ;3 x <inc hl>
621 djnz scan_bullets ;next bullet (loop)
626 cp 122 ;off screen? (x>128-5)
628 add a,2 ;move 2 2 the right
629 ld (hl),a ;save new pos.
637 call putsprite ;display bullet
640 check_bullethits: ;INPUT: de=X,Y
645 hit_enemies: ;Hits with normal enemies
650 jr z,nohit ;no hit when enemy_occ <> 2/3
654 or a ;enemy #0 = pickup
655 jr z,nohit ;yes: don't destroy
675 ld (hl),$00 ;remove bullet
684 and %11111100 ;occ/4 = HP left ;<srl a\srl a
685 jr nz,hpleft ;not zero -> jump
686 ld (hl),%01 ;set to explode
688 ld a,(pickuptimer) ;counts enemies destroyed
689 dec a ;enough destroyed for a pickup?
690 jr nz,pickupdone ;otherwise just explode
691 ld (hl),%00000110 ;change it into a pickup (with 2 HP)
692 ld a,18 ;reset enemies counter (18 hits = next)
694 ld (pickuptimer),a ;save new enemiescounter value
696 ld (hl),$00 ;explosionFrame 0
698 ld hl,1 ;increase score by one
704 sub %00000100 ;decrease HP by one
714 djnz hit_enemies ;check next enemy
717 ;--------------------------- handle torpedo -----------------------------------
722 ret m ;return if occ=0/1
724 ld hl,torp_pos ;x-position
727 cp 125 ;right edge reached
728 jr nc,remove_torp ;remove if x>125
729 ld (hl),a ;save new x
735 cp 56 ;bottom reached
736 jr nc,remove_torp ;remove if y>40
737 ld (hl),a ;save new y
742 call putsprite ;display torpedo
744 jp check_bullethits ;check for hits with enemies
751 ;--------------------------- level events -------------------------------------
754 ld hl,nextevent ;time to next event <ld a,(nextevent)
755 dec (hl) ;decrease counter <dec a
756 ld a,(hl) ;look at counter <ld (nextevent),a
757 or a ;has it reached zero?
758 ret nz ;nope: get outta here!
760 ld a,(eventtime) ;enemy frequency (lvl)
761 ld (nextevent),a ;set time to next event
763 dec (hl) ;update enemy-counter
765 ld a,(hl) ;look at counter
766 or a ;has it reached 0?
767 jp z,Next_level ;yes: level finished
768 dec a ;has it reached 1?
769 jr nz,do_event ;nope: wait for enemies to leave
770 inc hl ;nextevent located behind eventleft
771 ld (hl),119 ;set delay
772 ret ;don't place any more enemies
782 or a ;0 = no enemy present
786 ld a,(eventenemy) ;enemy type to place (lvl)
787 ld hl,enemy00 ;enemy 1 specs
791 ld b,0 ;bc = enemy nr.
792 add hl,bc ;hl = enemy specs
793 ld a,(hl) ;load hitpoints+occ of this enemy class
796 inc hl ;next enemyInfo byte
797 inc de ;next byte of current enemy
798 ld a,(hl) ;load movement+type of this enemy class
799 ld (de),a ;enemy type
802 ld a,122 ;appear at right edge of screen (128-6)
803 ld (de),a ;= x-position
806 inc hl ;where to place??
807 ld a,(hl) ;load placeInfo
809 jr z,random_enemy ;yes: create random value <51 in a
811 jr z,lure_enemy ;yes: create a 100% luring enemy
813 halflure_enemy: ;yes (of course it is): pick one (50% lure)
814 ld a,(timer) ;look at frame-number
815 and %00000001 ;make random if odd frame nr.
816 jr nz,random_enemy ;1st possibility: random enemy
817 lure_enemy: ;2nd possibility: luring enemy
818 ld a,(y) ;place at same y-pos as YOUR ship
822 call Random ;make a (in a) random value 0-255
823 cp 51 ;y may not be more than 51
824 jr c,ypos_OK ;OK if a<51
825 and %00111111 ;a = 0..63
827 jr c,random_enemy ;not OK if a<0
829 ypos_OK: ;random value successfully created
830 ld (de),a ;save y-position
832 ld hl,add2enemy-3 ;offset to xtra enemy info
833 add hl,de ;hl points to <xtra info: move>
834 ld (hl),1 ;set move-counter to 1
835 inc hl ;hl to <xtra info: fire>
836 ld (hl),1 ;set time-to-fire to 1 frame (fires directly)
840 ld a,(RanPos) ;a handy random-var.
841 ld hl,x ;add your x-coord for randomness
843 ld hl,y ;add your y-coord for randomness
845 ld (RanPos),a ;save altered random-var
846 ret ;RanPos also in #a
848 ;--------------------------- enemy fires --------------------------------------
850 Enemy_fires: ;de = x,y
861 jr z,found_ebullet ;0 = not used
862 inc hl \ inc hl \ inc hl
863 djnz find_ebullet ;look next bullet
867 ld (hl),1 ;use bullet &&&
875 ;----------------------------- enemy bullets ----------------------------------
883 ld a,(hl) ;load bulletType in a
885 jr nz,enemy_bullet ;no: handle bullet
887 pop hl ;do not move the <pop hl>
889 inc hl \ inc hl \ inc hl
896 ld a,(hl) ;check if it has reached the left side of scrn
897 and %11111110 ;it is <2 (0 or 1)?
898 jr z,remove_ebullet ;yes, remove bullet
899 dec (hl) ;move one left
900 dec (hl) ;and another one
906 jr z,ebullet_common ;normal bullet
916 ld ix,spr_bullete1 ;display enemy bullet
922 jr nz,next_bullet ;0 = you're normal
942 call damage_you ;HIT!!
944 pop hl ;hl could be destroyed by damage_you
945 ld (hl),0 ;bullet > unused
946 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
948 ;--------------------------- handle enemies -----------------------------------
952 ld b,nrenemies ;handle all enemies
960 jr z,next_enemy ;occ "no enemy" 0
962 jr z,exploding_enemy ;occ "exploding" 1
963 ld b,a ;b=2 if moving, otherwise b=1
965 normal_enemy: ;occ "normal" 2 or "moving" 3
969 ld e,(hl) ;e = enemy type
972 ld hl,sprites ;hl = @sprites offset-table
973 add hl,de ;points to offset of current enemy offset
974 ld e,(hl) ;de = @enemy offset
976 ld ix,spr_enemy00 ;first enemy sprite
977 add ix,de ;add offset for current enemy
983 jr c,remove_enemy ;off screen
989 ld a,b ;moving state was stored in b earlier
991 call nz,moving_enemy ;2 = moving enemy
994 ld (hl),d ;store new x
995 ld a,c ;a = enemy type
996 or a ;type 0? (pickup)
997 jr nz,check_enemyfire ;no, a normal enemy; let em fire
998 ld a,(timer) ;load time
999 and %1 ;move left once every 2 turns
1000 jr z,firing_done ;don't move now
1001 inc d ;increase x-position (don't move this turn)
1002 inc (hl) ;and save it
1003 jr firing_done ;continue
1006 ld bc,add2enemy+1-2 ;offset of <xtra enemy info: fire>
1007 add hl,bc ;go there (@hl)
1008 dec (hl) ;decrease counter till next blast
1009 ld a,(hl) ;load new counter
1010 or a ;has it reached zero?
1011 jr nz,firing_done ;finished if not
1013 add a,64 ;re-set counter for next blast
1015 call Enemy_fires ;fires bullet
1018 push de ;save registers for firing-use
1019 call putsprite ;display sprite @ix
1020 pop de ;restore (destroyed by putsprite)
1032 ld (hl),$0000 ;bye bye enemy
1040 call explosion_stuff ;display explosion
1045 jr z,remove_enemy ;remove when at last frame
1047 ld (hl),a ;next frame
1050 ;--------------------------- moving enemies -----------------------------------
1064 or a ;reset carry flag
1070 ld a,(hl) ;load y-position
1071 dec a ;decrease y-pos (=move up)
1072 ret m ;don't move off the screen (y<0)
1073 ld (hl),a ;save new y-pos
1076 ld a,(hl) ;load current y
1077 inc a ;increase y-pos
1078 cp 55 ;compare with bottom
1079 ret nc ;return if it has passed that line (>40)
1080 ld (hl),a ;otherwise save new position
1083 ;--------------------------- check collision ----------------------------------
1086 ld de,(x) ;e = X, d = Y
1088 ld b,nrenemies ;check all 20 enemies
1093 jr z,check_next ;2 or 3 = ok
1099 ; ld hl,enemy00 ;enemy 1 specs
1103 ; ld b,0 ;bc = 4 * enemy nr.
1104 ; add hl,bc ;hl = enemy specs
1105 ; ld a,(hl) ;load size byte
1108 ; ld c,a ;save size in c
1111 ld a,(hl) ;check x match
1112 sub e ;enemy position minus yours
1119 ld a,(hl) ;check y match
1120 sub d ;same as with x-check
1129 ld a,(hl) ;load enemy type
1132 ld hl,2 ;increase score by 2
1137 jr nz,collide ;enemy when <>0
1140 ld hl,your_pickup ;your pickups
1145 ld a,1 ;yes: reset to pickup 1
1148 call disp_icons ;display altered pickupicons
1151 dec hl ;to enemy occ
1152 xor a ;set to 0 = gone
1154 jr check_next ;all done, next..
1158 ld (hl),a ;explosionFrame 0
1161 ld (hl),a ;set to explode
1162 call damage_you ;auch!
1170 djnz check_collision
1173 ;--------------------------- update score -------------------------------------
1183 ;--------------------------- show icon ----------------------------------------
1186 ld hl,VIDEO_MEM+(16*57);57 rows down = seven rows from bottom
1187 ld b,16*7 ;draw 16x (screen width) 7x (height)
1188 xor a ;blank line mask
1190 ld (hl),a ;draw one piece of the divider-line
1191 inc hl ;move right (8 pixels = 1 byte)
1192 djnz cleanline ;repeat (16bytes * 7rows * 8pixels)
1194 ld hl,VIDEO_MEM+(56*16)
1199 ld ix,spr_icon01 ;armorIcon
1200 ld de,$1901 ;icon #1
1201 call putwidesprite ;display icon
1202 call disp_armor ;display value
1208 ld ix,spr_icon02 ;torpedoIcon
1210 ld de,$2901 ;icon #2
1211 call putwidesprite ;display
1213 ld ix,spr_icon03 ;emptyIcon
1214 ld de,$3901 ;icon #3
1217 ld ix,spr_icon00 ;emptyIcon
1221 ld ix,spr_icon04 ;laserIcon
1223 ld de,$4901 ;icon #4
1226 ld ix,spr_icon00 ;emptyIcon
1227 ld a,(your_multiples)
1232 ld de,$5901 ;icon #5
1239 ld a,(your_pickup) ;pickups taken
1241 ret z ;return if no pickups
1246 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
1247 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
1254 ld hl,$3925 ;Display Armor left
1255 ld (_penCol),hl ;place @ armorIcon
1256 ld a,(your_armor) ;load armor left
1257 add a,'0' ;make digit
1258 call _vputmap ;display char
1262 ld hl,$3900 ;display Lives
1263 ld (_penCol),hl ;bottom left
1270 ld a,(lives) ;nr of lives in a
1271 add a,'0' ;make digit
1274 call _vputs ;display on screen
1277 ;--------------------------- game over / new game / death ---------------------
1282 ld hl,own_name ; Find own variable
1284 call _ABS_MOV10TOOP1
1286 ret c ; If not found, give up
1288 ld a,b ; Save the stored section
1292 ld de,4+stored_data_start-_asm_exec_ram
1295 call _SET_ABS_DEST_ADDR
1297 ld hl,stored_data_start
1298 call _SET_ABS_SRC_ADDR
1299 ld hl,stored_data_end-stored_data_start
1300 call _SET_MM_NUM_BYTES
1306 pop hl ;=ret (game_over was called from a procedure)
1308 call _clrLCD ;clear screen
1310 ld (_curRow),hl ;center
1312 call _puts ;display "GAME OVER"
1314 xor a ;clear a (AHL will be displayed)
1315 ld hl,$1006 ;bottom-1 right
1316 ld (_curRow),hl ;set
1317 ld hl,(score) ;your score
1318 call _dispahl ;display it (a=0)
1319 ld hl,$314b ;bottom-1 right before score ^^
1320 ld (_penCol),hl ;set
1321 ld hl,txt_score ;"Score"
1322 call _vputs ;display (small)
1324 ld hl,$1007 ;bottom right
1325 ld (_curRow),hl ;set
1326 ld hl,(hiscore) ;hi-score
1327 call _dispahl ;display
1328 ld hl,$3946 ;bottom right before hiscore ^^
1329 ld (_penCol),hl ;set
1330 ld hl,txt_hiscore ;"Hiscore"
1331 call _vputs ;display (small)
1345 call _getkey ;wait for keypress
1346 jp quit ;restore some things and return to TI-OS/shell
1350 ld (score),a ;reset score
1351 ld (score+1),a ;reset score
1353 ld (level),a ;reset level nr
1354 ld hl,level01 ;set level pointer to level#1
1355 ld (levelp),hl ;reset level pointer
1356 ld hl,lives ;starting lives
1357 ld (hl),4 ;3 lives (will be decreased @ You_die)
1361 dec (hl) ;decrease lives
1362 ld a,(hl) ;load lives left
1363 inc a ;if lives=0ffh then a=0
1364 jr z,game_over ;if so, game's over
1367 ld (your_armor),a ;no armor
1368 ld (torp_occ),a ;no torpedoes
1369 ld (your_laser),a ;no laser
1370 ld (your_pickup),a ;reset pickups
1371 ld (your_multiples),a ;no multiples
1374 ;--------------------------- next level ---------------------------------------
1377 ld hl,level ;level number
1382 ld hl,(levelp) ;level pointer
1385 inc hl ;update to point to next level
1386 ld (levelp),hl ;save
1388 ld h,0 ;increase score....
1389 ld l,a ;by level number
1392 call scoreInc ;update score
1396 ld (nextevent),a ;time to first enemy appearance
1398 ld hl,(levelp) ;level pointer
1399 ld a,(hl) ;load new level-enemy type
1400 ld (eventenemy),a ;set level-enemy
1402 ld a,(hl) ;load new appearance-time
1403 ld (eventtime),a ;set
1405 ld a,(hl) ;load nr of enemies in this level
1406 ld (eventleft),a ;set nr of events left
1409 ld (timer),a ;reset time
1410 ld hl,your_occ ;hl = your_occ
1411 ld (hl),a ;reset your ship (not exploding)
1412 inc hl ;hl = your_inv
1413 ld (hl),50 ;set 50 frames invulnerable
1414 ld hl,x ;begin position x=...
1415 ld (hl),a ;...=a=0=left
1417 ld (hl),24 ;...=24=middle
1421 jr z,torpsclear ;then just continue (=0)
1422 ld a,1 ;if so, set to "ready to fire" (=1)
1425 ld de,$0018 ;x=0, y=24 (like you..)
1426 call Place_multiples ;place all multiple-positions at (0,24)
1428 ld hl,ybullets ;clear your/enemy bullets
1429 ld (hl),a ;clear first byte
1430 ld de,ybullets+1 ;and copy this byte to the next byte
1431 ld bc,(nrybullets+nrebullets)*3-1 ;bc times (all bullets)
1434 ld hl,enemies ;and remove all enemies as well
1435 ld (hl),a ;clear first byte
1436 ld de,enemies+1 ;point to the next
1437 ld bc,add2enemy+nrenemies*2 ;clear enemy-info + enemiesxtra
1440 ;--------------------------- setup game ---------------------------------------
1443 call _clrLCD ;clear screen
1445 ld hl,VIDEO_MEM ;screen location (top left)
1446 ld b,0 ;b = 0 (loop 0-1 = 0FFh = 256 times)
1449 ld (hl),a ;clear four times (total = 256*4 = 1024 bytes)
1459 djnz clearloop2 ;repeat 256x
1462 ld (_curRow),hl ;center
1464 call _puts ;display "LEVEL "
1475 call _putc ;display second digit
1477 call _putmap ;display first digit
1480 ld (_curRow),hl ;display lives left below level nr
1481 ld hl,txt_lives ;bar text: "Lx0"...
1482 ld a,(lives) ;lives left
1483 add a,'0' ;make value
1484 ld (txt_lives+3),a ;add to text
1485 call _puts ;display the string
1490 call _getkey ;wait for keypress
1492 call _clrLCD ;clear screen
1493 call disp_icons ;display bottom icons
1495 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
1496 ld b,16 ;draw 16x (screen width)
1497 ld a,%11111111 ;horizontal line mask
1499 ld (hl),a ;draw one piece of the divider-line
1500 inc hl ;move right (8 pixels = 1 byte)
1501 djnz drawline ;repeat (16bytes * 8pixels =128= screen width)
1504 ;--------------------------- putsprite ----------------------------------------
1505 ;--------------------------- de =(X,Y) ----------------------------------------
1508 .db 128,64,32,%10000,%01000,%00100,%00010,%00001
1511 and %00000111 ;a = X mod 8 = bit nr. to mask
1512 ld hl,offsets_table ;pixel mask table
1515 add hl,bc ;add to table
1516 ld a,(hl) ;a = pixel mask
1517 ld (_smc1+1),a ;alter pixel mask
1519 ld hl,GRAPH_MEM ;save-location
1524 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1525 add a,a ;y*16 (width of screen)
1526 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1529 srl d ;d/8 (8 bits in byte) ** c is set when overflow
1530 add a,d ;a = (Y*16+X/8) mod 256
1531 jr nc,_n1 ;jump if no carry = no overflow = a<=255
1532 inc b ;a>255 so increase bc by 256
1533 _n1: ld c,a ;c = (Y*16+X/8) mod 256
1534 add hl,bc ;bc = Y*16+X/8
1538 _oloop: push bc ;Save # of rows
1539 push hl ;Save screen address
1541 ld c,(ix+2) ;Load one line of image
1543 _smc1: ld a,1 ;Load pixel mask
1544 _iloop: sla c ;Test leftmost pixel
1545 jr nc,_noplot ;See if a plot is needed
1546 ld e,a ;OR pixel with screen
1551 jr nc,_notedge ;Test if edge of byte reached
1552 inc hl ;Go to next byte
1555 pop hl ;Restore address
1556 ld bc,16 ;Go to next line
1558 pop bc ;Restore data
1562 ;--------------------------- putbigsprite -------------------------------------
1595 woloop: push bc ;Save # of rows
1596 push hl ;Save screen address
1598 ld c,(ix+2) ;Load one line of image
1600 wsmc1: ld a,1 ;Load pixel mask
1601 wiloop: sla c ;Test leftmost pixel
1602 jr nc,wnoplot ;See if a plot is needed
1603 ld e,a ;OR pixel with screen
1609 jr nc,wnotedge ;Test if edge of byte reached
1610 inc hl ;Go to next byte
1616 pop hl ;Restore address
1617 ld bc,16 ;Go to next line
1619 pop bc ;Restore data
1634 ;------------------------------------------------------------------------------
1635 ;------------------------------- sprites --------------------------------------
1636 ;------------------------------------------------------------------------------
1641 .db %01111000 ; ████
1642 .db %00111110 ; █████
1643 .db %01111001 ; ████ █
1644 .db %01111001 ; ████ █
1645 .db %01111001 ; ████ █
1646 .db %00111110 ; █████
1647 .db %01111000 ; ████
1651 .db 7,7 ;ship alpha class
1652 .db %01111000 ; ████
1654 .db %11111100 ; ██████
1655 .db %11110010 ; ████ █
1656 .db %11111100 ; ██████
1658 .db %01111000 ; ████
1660 .db 7,7 ;ship alpha class
1663 .db %01010100 ; █ █ █
1664 .db %10100010 ; █ █ █
1665 .db %01010100 ; █ █ █
1670 .db 7,7 ;ship beta class
1672 .db %11110000 ; ████
1673 .db %01111100 ; █████
1674 .db %01110010 ; ███ █
1675 .db %01111100 ; █████
1676 .db %11110000 ; ████
1679 .db 7,7 ;ship beta class
1682 .db %01010100 ; █ █ █
1684 .db %01010100 ; █ █ █
1690 .db %01111000 ; ████
1691 .db %11111100 ; ██████
1692 .db %11111100 ; ██████
1693 .db %01111000 ; ████
1696 .db 5,3 ;your bullets
1697 .db %00110000 ; ░▒▓█▒
1698 .db %11111000 ; ░▒▓████▒
1699 .db %00110000 ; ░▒▓█▒
1702 .db %11110000 ; ░▒▓███▒
1703 .db %11111000 ; ░▒▓████▒
1704 .db %11110000 ; ░▒▓███▒
1708 .db %11110000 ; ████
1712 .db 4,3 ;enemy bullets
1713 .db %01100000 ; ▒█▓▒░
1714 .db %11110000 ; ▒███▓▒░
1715 .db %01100000 ; ▒█▓▒░
1717 ;---------------------------------------- explosion -------------------------------------------
1723 .db %00111110 ; █████
1724 .db %01010110 ; █ █ ██
1730 .db %01001110 ; █ ▒███
1731 .db %10111110 ; █ █████
1732 .db %01001111 ; █ ▒████
1734 .db %00011010 ; ██ █
1737 .db %10110000 ; █ ██
1738 .db %01001110 ; █ ███
1739 .db %10110101 ; █ ██▒█▒█
1740 .db %01000101 ; █ ▒█▒█
1741 .db %00111110 ; █████
1742 .db %01011010 ; █ ██ █
1745 .db %00101010 ; ▒ █▒█ █
1746 .db %01000110 ; █ ▒██
1747 .db %10110101 ; █ ██ █ █
1748 .db %01100110 ; ██ ██▒
1749 .db %00111100 ; ████▒
1750 .db %01011001 ; █ ██ ▒█
1753 .db %01000000 ; █▒ ▒ ▒
1754 .db %00100101 ; ▒█ █▒█
1755 .db %00010100 ; ▒ ▒█ █ ▒
1756 .db %01000100 ; █▒ █
1757 .db %00010010 ; ▒█▒▒█
1758 .db %10011010 ; █▒ ██ █▒
1762 .db %00100000 ; ▒█ ▒ ▒
1763 .db %00000001 ; ▒ ▒ █
1765 .db %00100010 ; █▒ █
1766 .db %01001000 ; ▒█ ▒█ ▒
1769 .db %00001000 ; ▒ █▒
1770 .db %11000010 ; ██ ▒ █
1772 .db %00100000 ; ▒█ ▒
1773 .db %00000001 ; ▒ ▒█
1774 .db %00110000 ; ▒██▒
1778 .db %00000000 ; ▒▒ ▒
1782 .db %00100100 ; █▒ █
1784 ;--------------------------------------- bar -----------------------------------
1787 .db 16,7 ;selected .......:.......:
1788 .db %11111111,%11111111 ; ████████████████
1789 .db %11000000,%00000001 ; ██ █
1790 .db %11000000,%00000001 ; ██ █
1791 .db %11000000,%00000001 ; ██ █
1792 .db %11000000,%00000001 ; ██ █
1793 .db %11000000,%00000001 ; ██ █
1794 .db %11111111,%11111111 ; ████████████████
1796 .db 16,7 ;unused .......:.......:
1797 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1798 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1799 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1800 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1801 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1802 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1803 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1805 .db 16,7 ;armor ; .......:.......:
1806 .db %10001111,%10000000 ; █ █████
1807 .db %10010000,%01000000 ; █ █ █ ▒▒▒
1808 .db %10101110,%00100000 ; █ █ ███ █ ▒▒▒
1809 .db %10100111,%10100000 ; █ █ ████ █ ▒▒▒
1810 .db %10101110,%00100000 ; █ █ ███ █ ▒▒▒
1811 .db %10010000,%01000000 ; █ █ █ ▒▒▒
1812 .db %10001111,%10000000 ; █ █████
1814 .db 16,7 ;torpedo .......:.......:
1815 .db %10111000,%00010101 ; █ ███ █ █ █
1816 .db %10011100,%00010101 ; █ ███ █ █ █
1817 .db %10111000,%01001010 ; █ ███ █ █ █
1818 .db %10000000,%11101010 ; █ ███ █ █
1819 .db %11100001,%11100101 ; ███ ████ █ █
1820 .db %10011000,%11110101 ; █ ██ ████ █ █
1821 .db %11100110,%00110010 ; ███ ██ ██ █
1823 .db 16,7 ;empty .......:.......:
1824 .db %10000000,%00000000 ; █
1825 .db %10000000,%00000000 ; █
1826 .db %10000000,%00000000 ; █
1827 .db %10000000,%00000000 ; █
1828 .db %10000000,%00000000 ; █
1829 .db %10000000,%00000000 ; █
1830 .db %10000000,%00000000 ; █
1832 .db 16,7 ;laser .......:.......:
1833 .db %10000000,%00000000 ; █
1834 .db %10110010,%10000000 ; █ ██ █ █
1835 .db %10111011,%00000000 ; █ ███ ██
1836 .db %10011101,%11111111 ; █ ███ █████████
1837 .db %10111011,%00000000 ; █ ███ ██
1838 .db %10110010,%10000000 ; █ ██ █ █
1839 .db %10000000,%00000000 ; █
1841 .db 16,7 ;multiple .......:.......:
1842 .db %10000011,%10000000 ; █ ███
1843 .db %10000001,%11100110 ; █ ████ ██
1844 .db %10000001,%11100000 ; █ ████
1845 .db %10000011,%10000000 ; █ ███
1846 .db %10011000,%00000000 ; █ ██
1847 .db %10111100,%11000011 ; █ ████ ██ ██
1848 .db %10011000,%00000000 ; █ ██
1850 ;---------------------------- texts -------------------------------------------
1852 txt_about: .db " v0.93.911",127,"by Shiar",0
1853 txt_email: .db "shiar0@hotmail.com",0
1854 txt_level: .db "LEVEL ",0
1855 txt_gameover: .db "GAME OVER!",0
1856 txt_score: .db "Score",0
1857 txt_hiscore: .db "Hiscore",0
1858 txt_lives: .db "Lx0?",0
1859 txt_pressenter: .db "Enter to continue",0
1861 ;---------------------------- save data ---------------------------------------
1863 PutWhere .dw GRAPH_MEM ;where to put the wide sprites
1865 timer .db $00 ;frame counter
1866 level .db $00 ;level number
1867 levelp .dw level01 ;pointer to level data
1869 eventenemy .db $02 ;enemy type
1870 eventtime .db $15 ;enemy frequency
1871 eventleft .db $00 ;nr. of enemies still to come
1872 nextevent .db $50 ;time to next event
1881 your_occ .db $00 ;0=normal 1..16=exploding
1882 your_inv .db $50 ;invincibility left
1883 your_armor .db $13 ;HP left
1886 y .db $46 ;think about it..
1887 hp .db $00 ;hitpoints left
1889 your_laser .db $01 ;laser avail: 0=no, 1=yes
1890 your_multiples .db $00 ;multiples present
1891 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
1892 torp_pos .dw $0000 ;torpedo position (x,y)
1894 ;---------------------------- enemy data --------------------------------------
1898 .db spr_enemy01-spr_enemy00
1899 .db spr_enemy02-spr_enemy00
1900 .db spr_enemy03-spr_enemy00
1901 .db spr_enemy04-spr_enemy00
1902 .db spr_enemy05-spr_enemy00
1903 .db spr_enemy06-spr_enemy00
1904 .db spr_enemy07-spr_enemy00
1908 .db %11111110 ; ███████
1909 .db %11111110 ; ███████
1910 .db %11000110 ; ██ ██
1911 .db %11111110 ; ███████
1912 .db %11111110 ; ███████
1914 .db 6,6 ;enemy type one
1915 .db %00111100 ; ████
1917 .db %11110000 ; ████
1918 .db %11110000 ; ████
1920 .db %00111100 ; ████
1922 .db 8,6 ;enemy type two
1923 .db %00111111 ; █████
1924 .db %01111000 ; ████
1925 .db %11111100 ; ██████
1926 .db %11111100 ; ██████
1927 .db %01111000 ; ████
1928 .db %00111111 ; █████
1930 .db 6,6 ;enemy type three
1931 .db %01111100 ; █████
1932 .db %11110000 ; ████
1933 .db %11111000 ; █████
1934 .db %11111000 ; █████
1935 .db %11110000 ; ████
1936 .db %01111100 ; █████
1938 .db 6,6 ;enemy type four
1940 .db %01111100 ; █████
1941 .db %11111000 ; █████
1942 .db %11111000 ; █████
1943 .db %01111100 ; █████
1946 .db 7,6 ;enemy type four
1947 .db %00011110 ; ████
1948 .db %01111110 ; ██████
1949 .db %11111100 ; ██████
1950 .db %11111100 ; ██████
1951 .db %01111110 ; ██████
1952 .db %00011110 ; ████
1954 .db 7,6 ;enemy type four
1956 .db %01111110 ; ██████
1957 .db %10111000 ; █ ███
1958 .db %10111000 ; █ ███
1959 .db %01111110 ; ██████
1962 .db 8,6 ;enemy type four
1963 .db %00011110 ; ████
1964 .db %01111111 ; ███████
1965 enemy00:.db %10011100 ; █ ███
1966 .db %10011100 ; █ ███
1967 .db %01111111 ; ███████
1968 .db %00011110 ; ████
1970 ;enemyInfo: %000000:HP %10:occ $00:type $00:app $00:unused
1971 enemy01: ;#1 HP:1 app:random
1973 enemy02: ;#2 HP:1 app:halflure
1975 enemy03: ;#3 HP:1 app:random moving
1977 enemy04: ;#4 HP:2 app:lure
1979 enemy05: ;#5 HP:2 app:random moving
1981 enemy06: ;#6 HP:3 app:lure moving
1983 enemy07: ;#7 HP:6 app:halflure moving
1986 ;----------------------------- level info -------------------------------------
1989 .db $01,$1b,$2f ;enemy nr ; enemy frequency ; next lvl
1990 level02: ;frequency must be odd if halfluring!
2003 ;----------------------------- logo -------------------------------------------
2006 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
2007 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
2008 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
2009 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
2010 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
2011 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
2012 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
2013 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
2014 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
2015 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
2016 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
2017 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
2018 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
2019 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
2020 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
2021 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
2022 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
2023 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
2024 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
2026 ;----------------------------- end --------------------------------------------
2031 ;----------------------------- NEMESIS'86 by Shiar ----------------------------
2033 ;Game · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · NEMESIS
2034 ;Version · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 0.93.911
2035 ;Latest modification · · · · · · · · · · · · · · · · · · · · · · · · 11.IX.99
2036 ;Calc · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · TI-86 only
2037 ;Size · · · · · · · · · · · · · · · · · · · · · · · · · · · 3098 bytes on calc
2039 ;Author · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · SHIAR
2040 ;ICQ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · #43840958
2041 ;E-mail · · · · · · · · · · · · · · · · · · · · · · · · · · shiar0@hotmail.com
2042 ;Homepage · · · · · · · · · · · · · · · · · · · · · · · · · · · · come.to/shiar
2045 ; <*> This game is not yet finished (BETA) and there may still be some bugs.
2046 ; <*> I'll probably release the source when the game has been finished.
2047 ; <*> Have fun, and have even more fun with the completed version of NEMESIS!
2049 ;----------------------------- version history --------------------------------
2051 ;0.01.717 -- 17.VII.99 -- size 909
2053 ; + used "Galaxian"-game engine (drawings, movement, enemy-routines)
2054 ; + movement of ship over 3/4 screen (96 pixels; 32 pixels for score)
2055 ; + enemies moving from right to left, appearing right at specified times
2057 ; 0.1.718 -- 18.VII.99 -- size 832
2059 ; # no crash when level restarts for the third time
2060 ; * exit-procedure updated, unnecessary stuff/keychecks removed
2061 ; - alot of unused code removed
2062 ; + different types of enemies (just look different)
2063 ; + collision detection!! enemy ships disappear when you hit them
2065 ; 0.2.718 -- 18.VII.99 -- size 1078
2067 ; + ability to fire bullets (F1). Enemies disappear on impact
2068 ; * enemies explode instead of disappearing
2070 ; 0.3.719 -- 19.VII.99 -- size 1326
2072 ; * bullets appear correctly (not INSIDE your ship)
2073 ; + some enemies can take multiple hits (differs per class)
2074 ; + all enemies fire bullets at random
2075 ; + if you're hit by bullet/enemy, you'll lose one hitpoint
2077 ; 0.4.720 -- 20.VII.99 -- size 1406
2079 ; # collision detection fixed and optimized (much faster now!)
2080 ; + shell-icon added (YAS type)
2081 ; * code optimizations, some data "compression"
2082 ; * explosion looks better, and some vars removed/smaller
2083 ; # enemies are removed when at left side (instead of becoming invisible)
2084 ; + displays level number before each level begins
2086 ; 0.5.725 -- 25.VII.99 -- size 1703
2088 ; * waits a sec at level display (in case of accidental keypress)
2089 ; * moving enemies (move up+down)
2090 ; # bullets removed correctly so they can be used again later
2091 ; * first level made
2092 ; # enemy weaponfire is fired from correct positions
2093 ; + your ship explodes on impact with ships/bullets
2094 ; * game over screen will be displayed just *after* your ship's gone
2095 ; + frame counter onscreen
2097 ; 0.6.820 -- 20.IIX.99 -- size 2077 -- MAJOR UPGRADE first release (not on web)
2099 ; * play field increased to full screen instead of 3/4
2100 ; + bottom eight lines used for score (etc) display
2101 ; - no more solid levels, enemies are placed at random
2102 ; + enemies appear every x turns (depends on level)
2103 ; # fixed bullets so they don't disappear at 3/4 of the screen
2104 ; * A LOT of optimizations both in speed and size!!
2105 ; + enemy type, frequency, and number specified per level
2106 ; + bottom score bar displays score, lives and icons (to be used later)
2107 ; * smarter enemy handling (so enemies have different sizes)
2108 ; + bottom bar divided from playing field by a horizontal line
2109 ; + five levels (and five enemies) made
2110 ; # game vars reset at start and game over
2111 ; + NEMESIS LOGO displayed at startup!! (also, program grew 350bytes ):
2112 ; + version/credits string displayed below logo: v0.6.820 by shiar (ICQ#)
2114 ;0.61.825 -- 25.IIX.99 -- size 2085 -- small changes to v0.6
2116 ; # pointer to fifth ship corrected (ships in level 5 weren't displayed)
2117 ; # calc doesn't crash anymore when game is continued after game over!!
2118 ; + lives are decreased when ship is destroyed
2119 ; # last eight pixels of divider line are shown correctly now
2121 ; 0.7.92 -- 02.IX .99 -- size 2303 -- optimizations and pickups
2123 ; + contrast is increased one level at startup (and restored on exit)
2124 ; + invulnerable for a sec when you enter the game (inv-pickup later)
2125 ; + when in invulnerable-mode, your ship look different!
2126 ; + at the beginning you get three *hitpoints* so you can be hit 3 times
2127 ; * bottomline icons are now 16 pixels wide and 7 pixels high!
2128 ; + hitpoint icon added: displays nr. of hps left next to a nice picture
2129 ; * maximum invulnerability-time is increased (can last upto 1024 frames)
2130 ; + when invulnerable-mode has nearly expired, your ship flashes!
2131 ; * again a lot of optimizations esp. in size ('bout 100 bytes)
2132 ; + pickups! 10% chance a destroyed enemy changes into an armor-pickup
2133 ; # code optimization caused some bullets to reappear as "fake" bullets
2134 ; * pickups can't be destroyed by bullets (they pass right through it)
2136 ; 0.8.93 -- 03.IX .99 -- size 2433 -- small improvements and bugfixes
2138 ; + enemies move individually, not all at the same time!! Looks very nice
2139 ; # titlescreen background is cleared (looked weird in Rascall and TI-OS)
2140 ; + enemies fire at a ### rate instead of firing at will (too random)
2141 ; # moving enemies don't move off the screen top/bottom (they wait there)
2142 ; + seven playable levels going easy to hard (including moving enemies)
2143 ; # xtraInfo data wasn't reset when a moving enemy entered the game
2144 ; * longer delay when level is completed (NextLevel screen came too soon)
2146 ; 0.9.94 -- 04.IX .99 -- size 2693 -- FIRST MAJOR (BETA) RELEASE; on websites
2148 ; # pickups no longer fire bullets like normal enemies
2149 ; + <halt>s added so the game runs slower and looks better
2150 ; + TORPEDOES!!! Bullets that fire downwards! Just like in Nemesis
2151 ; * a pickup selects the next icon on bottom bar instead of increasing hp
2152 ; + an icon can be taken by pressing F2. second icon selects torpedoes
2153 ; + first icon increases armor, icon 3 and 4 are unused for now
2154 ; * selecting an unused icon (3+4) resets pickups like icon 1 and 2
2155 ; * when you're destroyed, you loose one life instead of going game over
2156 ; you also loose all upgrades and pickups, but remain in the same level
2157 ; * random is more randomized, no more "tricks" to fool the randomizer
2158 ; # after game over the game is terminated instead of continuing+crashing
2159 ; - no more armor to start with. you'll have to collect them on your own
2160 ; * of course optimizations and a few tiny bug fixes (not important)
2161 ; * increased the size of the enemy bullets so they're better to see
2163 ; 0.91.95 -- 05.IX .99 -- size 2797 -- good improvements (upgrades); beta rel.
2165 ; + LASERS!!!!! four pickups and you fire laserbeams instead of bullets
2166 ; * multiple enemies can be hit at once, very usefull when firing lasers
2167 ; + MULTIPLE!! like the (shadow-)multiple from MSX-Nemesis. for 5 pickups
2168 ; you get an multiple following you, firing bullets and lasers like you
2169 ; * most data (enemy positions) stored at TEXT_MEM and DELC_LEN positions
2170 ; instead of in program, saving A LOT of bytes in program-size
2171 ; - at release of 0.91 bullets didn't work, laser is used instead
2173 ; 0.92.98 -- 08.IX .99 -- size 2831 -- beta released to testers
2175 ; + all bullets and enemies are removed at the start of a level
2176 ; # you can fire bullets again (no more laser at startup)
2177 ; * pickups aren't given at random, but appear every x enemies destroyed
2178 ; # solved a minor bug in invulnerability flashing display
2179 ; * clearScreen procedure improved (faster and smaller)
2180 ; # fifth icon couldn't be selected (so no multiples selectable). fixed
2181 ; * laserbeam lasts 5 turns (laser wasnt good enough compared to bullets)
2183 ;0.93.911 -- 11.IX .99 -- size 3098
2185 ; # torpedo-upgrade was cleared when firing torpedo at the end of a level
2186 ; * pickups move away half the speed of enemies (one pixel every 2 turns)
2187 ; # fixed a bug causing some calcs to crash on quit
2188 ; # contrast was not restored after game over (remained one step darker)
2189 ; * fire key changed from F1 to 2ND, select key changed from F2 to ALPHA
2190 ; * improved key-checking procedureS (much faster, smaller, better, yea)
2191 ; * changed title screen, displays version white on black and my e-mail
2192 ; + score count!! simple system: one point for an enemy destroyed, two
2193 ; for collision, and one point every 256 frames. plus level clear bonus
2194 ; + saves HISCORE!!! At game-over screen your- and hi-score are displayed
2195 ; * Game over screen will be displayed before quit after pressing <exit>
2196 ; + screen is cleared and cursor moved to top-left on quit
2197 ; * multiples move only when YOU move, just like the original MSX-Nemesis
2198 ; * multiple is placed at your position when selected/at start of level
2199 ; * minor changes in iconbar (3rd icon is empty, line between 5th/score)
2202 ; + added - removed * changed # bug fixed