10 .dw $0001 ;description type 2 (= +YASicon)
11 .dw Title ;pointer to description
12 .dw spr_ship ;pointer to YAS icon
14 Title: .db "Nemesis v0.9.94 by Shiar",0
16 just_fired = TEXT_MEM ;byte
17 temp1 = TEXT_MEM+1 ;word
18 RanPos = TEXT_MEM+3 ;byte
20 ;---------------------- init --------------------------------------------------
23 call _runindicoff ;turn the run-indicator off, obviously
24 call _clrLCD ;clean the screen
26 ld a,(CONTRAST) ;load current contrast level
27 cp $1f ;if already at maximum...
28 jr z,skipdarken ;...then skip level increase
29 inc a ;otherwise increase contrast level
33 ;---------------------- main menu ---------------------------------------------
36 ld hl,logo_nemesis ;from...
37 ld de,VIDEO_MEM+16 ;...to one line from top
40 ld bc,16 ;set screen width
41 ldir ;display one line
42 dec a ;decrease line-counter
43 jr nz,LogoLoop ;repeat when counter is not yet zero
46 ld hl,$1608 ;just below logo
48 ld hl,txt_about ;display "by Shiar (ICQ#43840958)"
51 ld hl,$0705 ;located one row above bottom
52 ld (_curRow),hl ;go there
53 ld hl,txt_1player ;display "ONE PLAYER"
55 ld hl,$0706 ;below oneplayer text
57 ld hl,txt_2players ;display "TWO PLAYERS"
60 call _getkey ;wait for keypress
61 call New_game ;prepare level
63 ;------------------------------------------------------------------------------
64 ;---------------------- game loop ---------------------------------------------
65 ;------------------------------------------------------------------------------
68 ld hl,timer ;update time
69 inc (hl) ;increase by 1
72 ld hl,RanPos ;random counter
73 ld a,(hl) ;random value
74 add a,b ;even more random by adding timer
75 ld (hl),a ;save even more random value back
79 ld hl,GRAPH_MEM ;screen location (top left)
80 ld b,$E0 ;loop 0E0h = 224 times = 256-32 for score-bar)
82 ld (hl),a ;clear four times (total = 224*4 = 896 bytes)
90 djnz clearloop ;repeat 224x
93 ld a,%00111111 ;<exit> pressed?
97 bit 6,a ;test bit 6 = <EXIT>
98 jr z,quit ;yes: quit game
101 call Level_event ;insert enemies
102 call Handle_Ship ;move you
103 call Fire_bullet ;check for fire
104 call Handle_enemies ;move enemies
105 call Handle_bullets ;move your bullets
106 call Handle_torp ;move your torpedo
107 call Enemy_bullets ;move enemy bullets
108 call Enemies_hit ;check for collision with enemies
110 call Display_Screen ;display all
112 jr game_main_loop ;loop
114 ;--------------------------- exit ---------------------------------------------
117 ld a,(CONTRAST) ;load original contrast level
118 out (2),a ;and set it back
121 ;--------------------------- display ------------------------------------------
124 ld hl,GRAPH_MEM ;from storage (top left)
125 ld de,VIDEO_MEM ;to screen (top left)
126 ld a,56 ;display height = 64 bytes (minus 8 for bar)
128 ld bc,16 ;display width = 16 bytes (16*8bits=256pixels)
131 jr nz,displayloop ;loop 64x
133 ld hl,$396b ;Display Score
134 ld (_penCol),hl ;bottom right of screen
138 _D_HL_DECI: ;------- display 5-digit value -------
139 ld de,savestr+4 ;savenr saves number string
141 ldhld: call UNPACK_HL ;one digit of hl
142 add a,'0' ;make number
143 ld (de),a ;save into savenr
144 dec de ;point to next digit
145 djnz ldhld ;repeat for all digits
148 call _vputs ;display string
154 ;------------------------- handle ship ----------------------------------------
159 jr z,ok ;0 = normal stat
161 inc a ;next (explosion)frame
162 ld (your_occ),a ;save
164 cp 34 ;last explosion frame?
165 jr c,exploding_you ;not yet: display explosion
166 cp 40 ;delay finished?
167 jp z,You_die ;yes = game over
168 ret ;don't display anything
175 rra ;rotate right (put last bit in c)
180 cp 49 ;55-6 = bottom of screen
186 rr b ;because we now use b, it's rr instead of rra
189 sub 1 ;<dec a> doesn't affect c-flag
190 jr c,no_left ;-1 = left side
196 cp 121 ;127-6 = right side
206 sub 1 ;<dec a> doesn't affect carry-flag
207 jr c,no_up ;-1 = top of screen
208 ld (hl),a ;save new y
211 ld ix,spr_ship01 ;ship sprite
212 ld hl,your_inv ;invulnerable?
213 ld a,(hl) ;load time in a
215 jp z,putsprite ;yes so ship = normal (display \ ret)
217 ld b,a ;save inv-time
218 ld a,(timer) ;load frame nr.
219 and %00000011 ;a=0 once every four frames
220 jr nz,not_time ;a<>0 = not time to update counter
221 dec (hl) ;decrease inv-time left
223 and %00000010 ;a switches 0<->1 every 2 frames
224 jr z,no_flicker ;don't show normal sprite anyway
226 and %11110000 ;inv-time <16 ticks left?
227 jp z,putsprite ;yes: display normal sprite
230 ld ix,spr_ship01i ;display inv-ship (ld ix is faster than add ix)
234 srl a ;half the framerate
235 dec a ;first frame is 1>inc>srl>dec = 0
254 ld a,(your_inv) ;invulnerability left?
256 ret nz ;return if inv>0
257 ld hl,your_armor ;armor left
260 jp m,no_armor ;yes, 0hp left so explode
261 ld (hl),a ;no, so save decreased hp
262 call disp_armor ;and display new value
265 ld a,%01 ;occ %xxxxxx01 = explode
266 ld (your_occ),a ;set to explode
269 ;------------------------- fire bullet ----------------------------------------
272 ld a,(your_occ) ;are you 100% OK?
274 ret nz ;return if not normal stat
276 ld a,%00111111 ;function keys (F1-F5)
277 out (1),a ;ask for them
278 nop \ nop ;delay 8 clocks
280 bit 4,a ;test bit 4 = F1-key
281 jr z,fire ;fire pressed?
283 ld (hl),0 ;no: reset just_fired
284 bit 3,a ;test bit 3 = F2-key &&&
285 ret nz ;return if not
288 ld hl,your_pickup ;select pickups
289 ld a,(hl) ;load pickups taken so far
291 jr nz,select2 ;no, carry on
292 ld (hl),a ;reset pickups
293 ld hl,your_armor ;change armor
294 inc (hl) ;increase HPs by one
295 jp disp_icons ;display and return
298 jr nz,select3 ;no, carry on
299 ld (hl),a ;reset pickups
301 ld (torp_occ),a ;ready torpedoes
302 jp disp_icons ;display 'n return
304 ld (hl),0 ;reset pickups
305 jp disp_icons ;display n return
307 fire: ld hl,RanPos ;random
308 inc (hl) ;update random counter
310 ld a,(hl) ;just_fired
311 or a ;zero when key just pressed (not already in)
312 ret nz ;return when already pressed
313 inc (hl) ;set just_fired to 1
321 jr z,found_ybullet ;0 = no bullet here
323 djnz find_ybullet ;look next bullet
327 ld (hl),1 ;use bullet
329 add a,5 ;place bullet in front of you
330 inc hl ;go to bullet-x
332 ld e,a ;save torp-x in e
335 add a,2 ;place bullet at the middle of your ship
336 inc hl ;go to bullet-y
338 add a,3 ;place torpedo at bottom of ship
339 ld d,a ;save torp-y in d
341 ld hl,torp_occ ;torpedo...
342 ld a,(hl) ;load torpInfo
343 dec a ;do you have (unused) torpedoes?
344 ret nz ;nope (a must be 1)
345 ld (hl),2 ;yes; use torpedo
346 ld (torp_pos),de ;save torpedo position (in de)
350 ;------------------------ handle bullets --------------------------------------
354 ld (hl),0 ;dump this bullet!
367 call z,bullet_2left ;yes: 2left
371 add hl,de ;3 x <inc hl>
372 djnz scan_bullets ;next bullet (loop)
377 cp 122 ;off screen? (x>128-5)
379 add a,2 ;move 2 2 the right
380 ld (hl),a ;save new pos.
388 call putsprite ;display bullet
391 check_bullethits: ;INPUT: de=X,Y
395 hit_enemies: ;Hits with normal enemies
400 jr z,nohit ;no hit when enemy_occ <> 2/3
404 or a ;enemy #0 = pickup
405 jr z,nohit ;yes: don't destroy
425 ld (hl),$00 ;remove bullet
433 and %11111100 ;occ/4 = HP left ;<srl a\srl a
434 jr nz,hpleft ;not zero -> jump
435 ld (hl),%01 ;set to explode
437 ld a,(RanPos) ;use random var
438 and %01011011 ;matches 0 100/2/2/2/2/2=3% of the time
439 jr nz,pickupdone ;otherwise just explode
440 ld (hl),%00000110 ;change it into a pickup (with 2 HP)
443 ld b,(hl) ;save enemy type
444 ld (hl),$00 ;explosionFrame 0
451 sub %00000100 ;decrease HP by one
462 djnz hit_enemies ;check next enemy
465 ;--------------------------- handle torpedo -----------------------------------
470 ret m ;return if occ=0/1
472 ld hl,torp_pos ;x-position
475 cp 125 ;right edge reached
476 jr nc,remove_torp ;remove if x>125
477 ld (hl),a ;save new x
483 cp 56 ;bottom reached
484 jr nc,remove_torp ;remove if y>40
485 ld (hl),a ;save new y
490 call putsprite ;display torpedo
492 jr check_bullethits ;check for hits with enemies
499 ;--------------------------- level events -------------------------------------
502 ld hl,nextevent ;time to next event <ld a,(nextevent)
503 dec (hl) ;decrease counter <dec a
504 ld a,(hl) ;look at counter <ld (nextevent),a
505 or a ;has it reached zero?
506 ret nz ;nope: get outta here!
508 ld a,(eventtime) ;enemy frequency (lvl)
509 ld (nextevent),a ;set time to next event
511 dec (hl) ;update enemy-counter
513 ld a,(hl) ;look at counter
514 or a ;has it reached 0?
515 jp z,Next_level ;yes: level finished
516 dec a ;has it reached 1?
517 jr nz,do_event ;nope: wait for enemies to leave
518 inc hl ;nextevent located behind eventleft
519 ld (hl),119 ;set delay
520 ret ;don't place any more enemies
530 or a ;0 = no enemy present
534 ld a,(eventenemy) ;enemy type to place (lvl)
535 ld hl,enemy00 ;enemy 1 specs
539 ld b,0 ;bc = enemy nr.
540 add hl,bc ;hl = enemy specs
541 ld a,(hl) ;load hitpoints+occ of this enemy class
544 inc hl ;next enemyInfo byte
545 inc de ;next byte of current enemy
546 ld a,(hl) ;load movement+type of this enemy class
547 ld (de),a ;enemy type
550 ld a,122 ;appear at right edge of screen (128-6)
551 ld (de),a ;= x-position
554 inc hl ;where to place??
555 ld a,(hl) ;load placeInfo
557 jr z,random_enemy ;yes: create random value <51 in a
559 jr z,lure_enemy ;yes: create a 100% luring enemy
561 halflure_enemy: ;yes (of course it is): pick one (50% lure)
562 ld a,(timer) ;look at frame-number
563 and %00000001 ;make random if odd frame nr.
564 jr nz,random_enemy ;1st possibility: random enemy
565 lure_enemy: ;2nd possibility: luring enemy
566 ld a,(y) ;place at same y-pos as YOUR ship
570 call Random ;make a (in a) random value 0-255
571 cp 51 ;y may not be more than 51
572 jr c,ypos_OK ;OK if a<51
573 and %00111111 ;a = 0..63
575 jr c,random_enemy ;not OK if a<0
577 ypos_OK: ;random value successfully created
578 ld (de),a ;save y-position
580 ld hl,add2enemy-3 ;offset to xtra enemy info
581 add hl,de ;hl points to <xtra info: move>
582 ld (hl),1 ;set move-counter to 1
583 inc hl ;hl to <xtra info: fire>
584 ld (hl),1 ;set time-to-fire to 1 frame (fires directly)
588 ld a,(RanPos) ;a handy random-var.
589 ld hl,x ;add your x-coord for randomness
591 ld hl,y ;add your y-coord for randomness
593 ld (RanPos),a ;save altered random-var
594 ret ;RanPos also in #a
596 ;--------------------------- enemy fires --------------------------------------
598 Enemy_fires: ;de = x,y
609 jr z,found_ebullet ;0 = not used
610 inc hl \ inc hl \ inc hl
611 djnz find_ebullet ;look next bullet
615 ld (hl),1 ;use bullet &&&
623 ;----------------------------- enemy bullets ----------------------------------
631 ld a,(hl) ;load bulletType in a
633 jr nz,enemy_bullet ;no: handle bullet
635 pop hl ;do not move the <pop hl>
637 inc hl \ inc hl \ inc hl
644 ld a,(hl) ;check if it has reached the left side of scrn
645 and %11111110 ;it is <2 (0 or 1)?
646 jr z,remove_ebullet ;yes, remove bullet
647 dec (hl) ;move one left
648 dec (hl) ;and another one
654 jr z,ebullet_common ;normal bullet
664 ld ix,spr_bullete1 ;display enemy bullet
670 jr nz,next_bullet ;0 = you're normal
690 call damage_you ;HIT!!
692 pop hl ;hl could be destroyed by damage_you
693 ld (hl),0 ;bullet > unused
694 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
696 ;--------------------------- handle enemies -----------------------------------
700 ld b,nrenemies ;handle all enemies
708 jr z,next_enemy ;occ "no enemy" 0
710 jr z,exploding_enemy ;occ "exploding" 1
711 ld b,a ;b=2 if moving, otherwise b=1
713 normal_enemy: ;occ "normal" 2 or "moving" 3
717 ld e,(hl) ;e = enemy type
720 ld hl,sprites ;hl = @sprites offset-table
721 add hl,de ;points to offset of current enemy offset
722 ld e,(hl) ;de = @enemy offset
724 ld ix,spr_enemy00 ;first enemy sprite
725 add ix,de ;add offset for current enemy
731 jr c,remove_enemy ;off screen
737 ld a,b ;moving state was stored in b earlier
739 call nz,moving_enemy ;2 = moving enemy
742 ld (hl),d ;store new x
745 ld a,c ;a = enemy type
746 or a ;type 0? (pickup)
747 jr z,firing_done ;pickups don't fire
749 ld bc,add2enemy+1-2 ;offset of <xtra enemy info: fire>
750 add hl,bc ;go there (@hl)
751 dec (hl) ;decrease counter till next blast
752 ld a,(hl) ;load new counter
753 or a ;has it reached zero?
754 jr nz,firing_done ;finished if not
756 add a,64 ;re-set counter for next blast
758 call Enemy_fires ;fires bullet
761 push de ;save registers for firing-use
762 call putsprite ;display sprite @ix
763 pop de ;restore (destroyed by putsprite)
775 ld (hl),$0000 ;bye bye enemy
783 call explosion_stuff ;display explosion
788 jr z,remove_enemy ;remove when at last frame
790 ld (hl),a ;next frame
793 ;--------------------------- moving enemies -----------------------------------
807 or a ;reset carry flag
813 ld a,(hl) ;load y-position
814 dec a ;decrease y-pos (=move up)
815 ret m ;don't move off the screen (y<0)
816 ld (hl),a ;save new y-pos
819 ld a,(hl) ;load current y
820 inc a ;increase y-pos
821 cp 55 ;compare with bottom
822 ret nc ;return if it has passed that line (>40)
823 ld (hl),a ;otherwise save new position
826 ;--------------------------- check collision ----------------------------------
830 or a ;0 = you're normal
833 ld de,(x) ;e = X, d = Y
835 ld b,nrenemies ;check all 20 enemies
840 jr z,check_next ;2 or 3 = ok
846 ; ld hl,enemy00 ;enemy 1 specs
850 ; ld b,0 ;bc = 4 * enemy nr.
851 ; add hl,bc ;hl = enemy specs
852 ; ld a,(hl) ;load size byte
855 ; ld c,a ;save size in c
858 ld a,(hl) ;check x match
859 sub e ;enemy position minus yours
866 ld a,(hl) ;check y match
867 sub d ;same as with x-check
876 ld a,(hl) ;load enemy type
878 jr nz,collide ;enemy when <>0
881 ld hl,your_pickup ;your pickups
886 ld a,1 ;yes: reset to pickup 1
889 call disp_icons ;display altered pickupicons
893 xor a ;set to 0 = gone
895 jr check_next ;all done, next..
899 ld (hl),a ;explosionFrame 0
902 ld (hl),a ;set to explode
903 call damage_you ;auch!
914 ;--------------------------- show icon ----------------------------------------
917 ld hl,VIDEO_MEM+(16*57);57 rows down = seven rows from bottom
918 ld b,16*7 ;draw 16x (screen width) 7x (height)
920 ld a,%00000000 ;blank line mask
921 ld (hl),a ;draw one piece of the divider-line
922 inc hl ;move right (8 pixels = 1 byte)
923 djnz cleanline ;repeat (16bytes * 7rows * 8pixels)
925 ld hl,VIDEO_MEM+(56*16)
930 ld ix,spr_icon01 ;armorIcon
932 call putwidesprite ;display icon
933 call disp_armor ;display value
939 ld ix,spr_icon02 ;torpedoIcon
942 call putwidesprite ;display
947 ld ix,spr_icon00 ;emptyIcon
950 ld ix,spr_icon00 ;emptyIcon
954 ld a,(your_pickup) ;pickups taken
956 ret z ;return if no pickups
961 ld d,a ;y-pos = picks * $10 + $0a (1a,2a,3a,4a,5a)
962 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
969 ld hl,$3926 ;Display Armor left
970 ld (_penCol),hl ;place @ armorIcon
971 ld a,(your_armor) ;load armor left
972 add a,'0' ;make digit
973 call _vputmap ;display char
977 ld hl,$3900 ;display Lives
978 ld (_penCol),hl ;bottom left
985 ld a,(lives) ;nr of lives in a
986 add a,'0' ;make digit
989 call _vputs ;display on screen
992 ;--------------------------- game over / new game / death ---------------------
995 call _clrLCD ;clear screen
997 ld (_curRow),hl ;center
999 call _puts ;display "GAME OVER"
1004 call _getkey ;wait for keypress
1006 pop hl ;=ret (game_over was called from a procedure)
1007 ret ;quit to TI-OS or shell
1011 ld (score),a ;reset score
1013 ld (level),a ;reset level nr
1014 ld hl,level01 ;set level pointer to level#1
1015 ld (levelp),hl ;reset level pointer
1016 ld hl,lives ;starting lives
1017 ld (hl),4 ;3 lives (will be decreased @ You_die)
1021 dec (hl) ;decrease lives
1022 ld a,(hl) ;load lives left
1023 inc a ;if lives=0ffh then a=0
1024 jr z,game_over ;if so, game's over
1027 ld (your_armor),a ;no armor
1028 ld (torp_occ),a ;no torpedoes
1029 ld (your_pickup),a ;reset pickups
1032 ;--------------------------- next level ---------------------------------------
1035 ld hl,level ;level number
1036 inc (hl) ;increase it
1037 ld hl,(levelp) ;level pointer
1040 inc hl ;update to point to next level
1041 ld (levelp),hl ;save
1045 ld (nextevent),a ;time to first enemy appearance
1047 ld hl,(levelp) ;level pointer
1048 ld a,(hl) ;load new level-enemy type
1049 ld (eventenemy),a ;set level-enemy
1051 ld a,(hl) ;load new appearance-time
1052 ld (eventtime),a ;set
1054 ld a,(hl) ;load nr of enemies in this level
1055 ld (eventleft),a ;set nr of events left
1058 ld (timer),a ;reset time
1059 ld hl,your_occ ;hl = your_occ
1060 ld (hl),a ;reset your ship (not exploding)
1061 inc hl ;hl = your_inv
1062 ld (hl),50 ;set 50 frames invulnerable
1063 ld hl,x ;begin position x=...
1064 ld (hl),a ;...=a=0=left
1066 ld (hl),24 ;...=24=middle
1068 ;--------------------------- setup game ---------------------------------------
1071 call _clrLCD ;clear screen
1073 ld hl,VIDEO_MEM ;screen location (top left)
1074 ld b,0 ;b = 0 (loop 0-1 = 0FFh = 256 times)
1077 ld (hl),a ;clear four times (total = 256*4 = 1024 bytes)
1087 djnz clearloop2 ;repeat 256x
1090 ld (_curRow),hl ;center
1092 call _puts ;display "LEVEL "
1103 call _putc ;display second digit
1105 call _putmap ;display first digit
1108 ld (_curRow),hl ;display lives left below level nr
1109 ld hl,txt_lives ;bar text: "Lx0"...
1110 ld a,(lives) ;lives left
1111 add a,'0' ;make value
1112 ld (txt_lives+3),a ;add to text
1113 call _puts ;display the string
1118 call _getkey ;wait for keypress
1120 call _clrLCD ;clear screen
1121 call disp_icons ;display bottom icons
1123 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
1124 ld b,16 ;draw 16x (screen width)
1126 ld a,%11111111 ;horizontal line mask
1127 ld (hl),a ;draw one piece of the divider-line
1128 inc hl ;move right (8 pixels = 1 byte)
1129 djnz drawline ;repeat (16bytes * 8pixels =128= screen width)
1132 ;--------------------------- putsprite ----------------------------------------
1133 ;--------------------------- de =(X,Y) ----------------------------------------
1136 .db 128,64,32,%10000,%01000,%00100,%00010,%00001
1139 and %00000111 ;a = X mod 8 = bit nr. to mask
1140 ld hl,offsets_table ;pixel mask table
1143 add hl,bc ;add to table
1144 ld a,(hl) ;a = pixel mask
1145 ld (_smc1+1),a ;alter pixel mask
1147 ld hl,GRAPH_MEM ;save-location
1152 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1153 add a,a ;y*16 (width of screen)
1154 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1157 srl d ;d/8 (8 bits in byte) ** c is set when overflow
1158 add a,d ;a = (Y*16+X/8) mod 256
1159 jr nc,_n1 ;jump if no carry = no overflow = a<=255
1160 inc b ;a>255 so increase bc by 256
1161 _n1: ld c,a ;c = (Y*16+X/8) mod 256
1162 add hl,bc ;bc = Y*16+X/8
1166 _oloop: push bc ;Save # of rows
1167 push hl ;Save screen address
1169 ld c,(ix+2) ;Load one line of image
1171 _smc1: ld a,1 ;Load pixel mask
1172 _iloop: sla c ;Test leftmost pixel
1173 jr nc,_noplot ;See if a plot is needed
1174 ld e,a ;OR pixel with screen
1179 jr nc,_notedge ;Test if edge of byte reached
1180 inc hl ;Go to next byte
1183 pop hl ;Restore address
1184 ld bc,16 ;Go to next line
1186 pop bc ;Restore data
1190 ;--------------------------- putbigsprite -------------------------------------
1223 woloop: push bc ;Save # of rows
1224 push hl ;Save screen address
1226 ld c,(ix+2) ;Load one line of image
1228 wsmc1: ld a,1 ;Load pixel mask
1229 wiloop: sla c ;Test leftmost pixel
1230 jr nc,wnoplot ;See if a plot is needed
1231 ld e,a ;OR pixel with screen
1237 jr nc,wnotedge ;Test if edge of byte reached
1238 inc hl ;Go to next byte
1244 pop hl ;Restore address
1245 ld bc,16 ;Go to next line
1247 pop bc ;Restore data
1262 ;------------------------------------------------------------------------------
1263 ;------------------------------- sprites --------------------------------------
1264 ;------------------------------------------------------------------------------
1269 .db %01111000 ; ████
1270 .db %00111110 ; █████
1271 .db %01111001 ; ████ █
1272 .db %01111001 ; ████ █
1273 .db %01111001 ; ████ █
1274 .db %00111110 ; █████
1275 .db %01111000 ; ████
1279 .db 7,7 ;ship alpha class
1280 .db %01111000 ; ████
1282 .db %11111100 ; ██████
1283 .db %11110010 ; ████ █
1284 .db %11111100 ; ██████
1286 .db %01111000 ; ████
1288 .db 7,7 ;ship alpha class
1291 .db %01010100 ; █ █ █
1292 .db %10100010 ; █ █ █
1293 .db %01010100 ; █ █ █
1298 .db 7,7 ;ship beta class
1300 .db %11110000 ; ████
1301 .db %01111100 ; █████
1302 .db %01110010 ; ███ █
1303 .db %01111100 ; █████
1304 .db %11110000 ; ████
1307 .db 7,7 ;ship beta class
1310 .db %01010100 ; █ █ █
1312 .db %01010100 ; █ █ █
1317 .db 5,3 ;your bullets
1318 .db %00110000 ; ░▒▓█▒
1319 .db %11111000 ; ░▒▓████▒
1320 .db %00110000 ; ░▒▓█▒
1323 .db %11110000 ; ░▒▓███▒
1324 .db %11111000 ; ░▒▓████▒
1325 .db %11110000 ; ░▒▓███▒
1329 .db %11110000 ; ████
1333 .db 4,3 ;enemy bullets
1334 .db %01100000 ; ▒█▓▒░
1335 .db %11110000 ; ▒███▓▒░
1336 .db %01100000 ; ▒█▓▒░
1338 ;---------------------------------------- explosion -------------------------------------------
1344 .db %00111110 ; █████
1345 .db %01010110 ; █ █ ██
1351 .db %01001110 ; █ ▒███
1352 .db %10111110 ; █ █████
1353 .db %01001111 ; █ ▒████
1355 .db %00011010 ; ██ █
1358 .db %10110000 ; █ ██
1359 .db %01001110 ; █ ███
1360 .db %10110101 ; █ ██▒█▒█
1361 .db %01000101 ; █ ▒█▒█
1362 .db %00111110 ; █████
1363 .db %01011010 ; █ ██ █
1366 .db %00101010 ; ▒ █▒█ █
1367 .db %01000110 ; █ ▒██
1368 .db %10110101 ; █ ██ █ █
1369 .db %01100110 ; ██ ██▒
1370 .db %00111100 ; ████▒
1371 .db %01011001 ; █ ██ ▒█
1374 .db %01000000 ; █▒ ▒ ▒
1375 .db %00100101 ; ▒█ █▒█
1376 .db %00010100 ; ▒ ▒█ █ ▒
1377 .db %01000100 ; █▒ █
1378 .db %00010010 ; ▒█▒▒█
1379 .db %10011010 ; █▒ ██ █▒
1383 .db %00100000 ; ▒█ ▒ ▒
1384 .db %00000001 ; ▒ ▒ █
1386 .db %00100010 ; █▒ █
1387 .db %01001000 ; ▒█ ▒█ ▒
1390 .db %00001000 ; ▒ █▒
1391 .db %11000010 ; ██ ▒ █
1393 .db %00100000 ; ▒█ ▒
1394 .db %00000001 ; ▒ ▒█
1395 .db %00110000 ; ▒██▒
1399 .db %00000000 ; ▒▒ ▒
1403 .db %00100100 ; █▒ █
1405 ;--------------------------------------- bar -----------------------------------
1408 .db 16,7 ;unused .......:.......:
1409 .db %11111111,%11111111 ; ████████████████
1410 .db %11000000,%00000001 ; ██ █
1411 .db %11000000,%00000001 ; ██ █
1412 .db %11000000,%00000001 ; ██ █
1413 .db %11000000,%00000001 ; ██ █
1414 .db %11000000,%00000001 ; ██ █
1415 .db %11111111,%11111111 ; ████████████████
1417 .db 16,7 ;unused .......:.......:
1418 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1419 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1420 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1421 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1422 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1423 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
1424 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
1426 .db 16,7 ;armor ; .......:.......:
1427 .db %10001111,%10000000 ; █ █████
1428 .db %10010000,%01000000 ; █ █ █ ▒▒▒
1429 .db %10101110,%00100000 ; █ █ ███ █ ▒▒▒
1430 .db %10100111,%10100000 ; █ █ ████ █ ▒▒▒
1431 .db %10101110,%00100000 ; █ █ ███ █ ▒▒▒
1432 .db %10010000,%01000000 ; █ █ █ ▒▒▒
1433 .db %10001111,%10000000 ; █ █████
1435 .db 16,7 ;torpedo .......:.......:
1436 .db %10111000,%00010101 ; █ ███ █ █ █
1437 .db %10011100,%00010101 ; █ ███ █ █ █
1438 .db %10111000,%01001010 ; █ ███ █ █ █
1439 .db %10000000,%11101010 ; █ ███ █ █
1440 .db %11100001,%11100101 ; ███ ████ █ █
1441 .db %10011000,%11110101 ; █ ██ ████ █ █
1442 .db %11100110,%00110010 ; ███ ██ ██ █
1444 .db 16,7 ;laser ........:.......:
1445 .db %10000000,%00000000 ; █
1446 .db %10110001,%01000000 ; █ ██ █ █
1447 .db %10111011,%10000000 ; █ ███ ███
1448 .db %10011101,%11111111 ; █ ███ ██████████
1449 .db %10111011,%10000000 ; █ ███ ███
1450 .db %10110001,%01000000 ; █ ██ █ █
1451 .db %10000000,%00000000 ; █
1453 .db 16,7 ;invulnerable....:.......:
1454 .db %10000000,%01010100 ; █ O O O
1455 .db %10011110,%00101010 ; █ OOOO O O O
1456 .db %10111000,%00010101 ; █ OOO O O O
1457 .db %10111111,%10101010 ; █ OOOOOOO O O O
1458 .db %10111111,%00010101 ; █ OOOOOOO O O O
1459 .db %10111000,%00101010 ; █ OOO O O O
1460 .db %10011110,%01010100 ; █ OOOO O O O
1462 ;---------------------------- texts -------------------------------------------
1464 txt_about: .db "v0.9.94 ","by Shiar "
1465 .db "(ICQ#43840958)",0
1466 txt_1player: .db "1 PLAYER",0
1467 txt_2players: .db "2 PLAYERS",0
1468 txt_level: .db "LEVEL ",0
1469 txt_gameover: .db "GAME OVER!",0
1470 txt_lives: .db "Lx0?",0
1472 ;---------------------------- save data ---------------------------------------
1476 PutWhere .dw GRAPH_MEM ;where to put the wide sprites
1478 timer .db $00 ;frame counter
1479 level .db $00 ;level number
1480 levelp .dw level01 ;pointer to level data
1482 eventenemy .db $02 ;enemy type
1483 eventtime .db $15 ;enemy frequency
1484 eventleft .db $00 ;nr. of enemies still to come
1485 nextevent .db $50 ;time to next event
1490 your_occ .db $00 ;0=normal 1..16=exploding
1491 your_inv .db $50 ;invincibility left
1492 your_armor .db $13 ;HP left
1495 y .db $46 ;think about it..
1496 hp .db $00 ;hitpoints left
1498 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
1499 torp_pos .dw $0000 ;torpedo position (x,y)
1501 ybullets .dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;10 x (state,x,y)
1502 ebullets .dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;10 x (state,x,y)
1505 enemies .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1506 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1507 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1508 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1510 enemiesxtra .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1511 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1512 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1513 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
1516 ; %111111 (HP left) 11 (00=no enemy 01=exploding 10=normal 11=moving)
1517 ; %11111111 (ship type or explosion frame) %11111111 (x) %11111111 (y)
1519 ;---------------------------- enemy data --------------------------------------
1523 .db spr_enemy01-spr_enemy00
1524 .db spr_enemy02-spr_enemy00
1525 .db spr_enemy03-spr_enemy00
1526 .db spr_enemy04-spr_enemy00
1527 .db spr_enemy05-spr_enemy00
1528 .db spr_enemy06-spr_enemy00
1529 .db spr_enemy07-spr_enemy00
1533 .db %11111110 ; ███████
1534 .db %10011010 ; █ ██ █
1535 .db %11111110 ; ███████
1536 .db %10011010 ; █ ██ █
1537 .db %11111110 ; ███████
1539 .db 6,6 ;enemy type one
1540 .db %00111100 ; ████
1542 .db %11110000 ; ████
1543 .db %11110000 ; ████
1545 .db %00111100 ; ████
1547 .db 8,6 ;enemy type two
1548 .db %00111111 ; █████
1549 .db %01111000 ; ████
1550 .db %11111100 ; ██████
1551 .db %11111100 ; ██████
1552 .db %01111000 ; ████
1553 .db %00111111 ; █████
1555 .db 6,6 ;enemy type three
1556 .db %01111100 ; █████
1557 .db %11110000 ; ████
1558 .db %11111000 ; █████
1559 .db %11111000 ; █████
1560 .db %11110000 ; ████
1561 .db %01111100 ; █████
1563 .db 6,6 ;enemy type four
1565 .db %01111100 ; █████
1566 .db %11111000 ; █████
1567 .db %11111000 ; █████
1568 .db %01111100 ; █████
1571 .db 7,6 ;enemy type four
1572 .db %00011110 ; ████
1573 .db %01111110 ; ██████
1574 .db %11111100 ; ██████
1575 .db %11111100 ; ██████
1576 .db %01111110 ; ██████
1577 .db %00011110 ; ████
1579 .db 7,6 ;enemy type four
1581 .db %01111110 ; ██████
1582 .db %10111000 ; █ ███
1583 .db %10111000 ; █ ███
1584 .db %01111110 ; ██████
1587 .db 8,6 ;enemy type four
1588 .db %00011110 ; ████
1589 .db %01111111 ; ███████
1590 enemy00:.db %10011100 ; █ ███
1591 .db %10011100 ; █ ███
1592 .db %01111111 ; ███████
1593 .db %00011110 ; ████
1595 ;enemyInfo: %000000:HP %10:occ $00:type $00:app $00:unused
1596 enemy01: ;#1 HP:1 app:random
1598 enemy02: ;#2 HP:1 app:halflure
1600 enemy03: ;#3 HP:1 app:random moving
1602 enemy04: ;#4 HP:2 app:lure
1604 enemy05: ;#5 HP:2 app:random moving
1606 enemy06: ;#6 HP:2 app:lure moving
1608 enemy07: ;#7 HP:4 app:halflure moving
1611 ;----------------------------- level info -------------------------------------
1614 .db $01,$1b,$2f ;enemy nr ; enemy frequency ; next lvl
1615 level02: ;frequency must be odd if halfluring!
1628 ;----------------------------- logo -------------------------------------------
1631 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
1632 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
1633 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
1634 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
1635 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
1636 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
1637 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
1638 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
1639 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
1640 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
1641 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
1642 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
1643 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
1644 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
1645 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
1646 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
1647 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
1648 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
1649 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
1651 ;----------------------------- end --------------------------------------------
1656 ;----------------------------- NEMESIS'86 by Shiar ----------------------------
1658 ;Game · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · NEMESIS
1659 ;Version · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 0.9.94
1660 ;Latest modification · · · · · · · · · · · · · · · · · · · · · · · · · 4.IX.99
1661 ;Calc · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · TI-86 only
1662 ;Size · · · · · · · · · · · · · · · · · · · · · · · · · · · 2694 bytes on calc
1664 ;Author · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · SHIAR
1665 ;ICQ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · #43840958
1666 ;E-mail · · · · · · · · · · · · · · · · · · · · · · · · · · shiar0@hotmail.com
1667 ;Homepage · · · · · · · · · · · · · · · · · · coming soon (www.wish.net/~shiar)
1670 ; <*> This game is not yet finished (BETA) and there may still be some bugs.
1671 ; <*> Source will be released when the game has been finished.
1672 ; <*> Have fun, and have even more fun with the completed version of NEMESIS!
1674 ;----------------------------- version history --------------------------------
1676 ;0.01.717 -- 17.VII.99 -- size 909
1678 ; + used "Galaxian"-game engine (drawings, movement, enemy-routines)
1679 ; + movement of ship over 3/4 screen (96 pixels; 32 pixels for score)
1680 ; + enemies moving from right to left, appearing right at specified times
1682 ; 0.1.718 -- 18.VII.99 -- size 832
1684 ; # no crash when level restarts for the third time
1685 ; * exit-procedure updated, unnecessary stuff/keychecks removed
1686 ; - alot of unused code removed
1687 ; + different types of enemies (just look different)
1688 ; + collision detection!! enemy ships disappear when you hit them
1690 ; 0.2.718 -- 18.VII.99 -- size 1078
1692 ; + ability to fire bullets (F1). Enemies disappear on impact
1693 ; * enemies explode instead of disappearing
1695 ; 0.3.719 -- 19.VII.99 -- size 1326
1697 ; * bullets appear correctly (not INSIDE your ship)
1698 ; + some enemies can take multiple hits (differs per class)
1699 ; + all enemies fire bullets at random
1700 ; + if you're hit by bullet/enemy, you'll lose one hitpoint
1702 ; 0.4.720 -- 20.VII.99 -- size 1406
1704 ; # collision detection fixed and optimized (much faster now!)
1705 ; + shell-icon added (YAS type)
1706 ; * code optimizations, some data "compression"
1707 ; * explosion looks better, and some vars removed/smaller
1708 ; # enemies are removed when at left side (instead of becoming invisible)
1709 ; + displays level number before each level begins
1711 ; 0.5.725 -- 25.VII.99 -- size 1703
1713 ; * waits a sec at level display (in case of accidental keypress)
1714 ; * moving enemies (move up+down)
1715 ; # bullets removed correctly so they can be used again later
1716 ; * first level made
1717 ; # enemy weaponfire is fired from correct positions
1718 ; + your ship explodes on impact with ships/bullets
1719 ; * game over screen will be displayed just *after* your ship's gone
1720 ; + frame counter onscreen
1722 ; 0.6.820 -- 20.IIX.99 -- size 2077
1724 ; * play field increased to full screen instead of 3/4
1725 ; + bottom eight lines used for score (etc) display
1726 ; - no more solid levels, enemies are placed at random
1727 ; + enemies appear every x turns (depends on level)
1728 ; # fixed bullets so they don't disappear at 3/4 of the screen
1729 ; * A LOT of optimizations both in speed and size!!
1730 ; + enemy type, frequency, and number specified per level
1731 ; + bottom score bar displays score, lives and icons (to be used later)
1732 ; * smarter enemy handling (so enemies have different sizes)
1733 ; + bottom bar divided from playing field by a horizontal line
1734 ; + five levels (and five enemies) made
1735 ; # game vars reset at start and game over
1736 ; + NEMESIS LOGO displayed at startup!! (also, program grew 350bytes ):
1737 ; + version/credits string displayed below logo: v0.6.820 by shiar (ICQ#)
1739 ; 0.6.825 -- 25.IIX.99 -- size 2085
1741 ; # pointer to fifth ship corrected (ships in level 5 weren't displayed)
1742 ; # calc doesn't crash anymore when game is continued after game over!!
1743 ; + lives are decreased when ship is destroyed
1744 ; # last eight pixels of divider line are shown correctly now
1746 ; 0.7.92 -- 02.IX .99 -- size 2303
1748 ; + contrast is increased one level at startup (and restored on exit)
1749 ; + invulnerable for a sec when you enter the game (inv-pickup later)
1750 ; + when in invulnerable-mode, your ship look different!
1751 ; + at the beginning you get three *hitpoints* so you can be hit 3 times
1752 ; * bottomline icons are now 16 pixels wide and 7 pixels high!
1753 ; + hitpoint icon added: displays nr. of hps left next to a nice picture
1754 ; * maximum invulnerability-time is increased (can last upto 1024 frames)
1755 ; + when invulnerable-mode has nearly expired, your ship flashes!
1756 ; * again a lot of optimizations esp. in size ('bout 100 bytes)
1757 ; + pickups! 10% chance a destroyed enemy changes into an armor-pickup
1758 ; # code optimization caused some bullets to reappear as "fake" bullets
1759 ; * pickups can't be destroyed by bullets (they pass right through it)
1761 ; 0.8.93 -- 03.IX .99 -- size 2433
1763 ; + enemies move individually, not all at the same time!! Looks very nice
1764 ; # titlescreen background is cleared (looked weird in Rascall and TI-OS)
1765 ; + enemies fire at a ### rate instead of firing at will (too random)
1766 ; # moving enemies don't move off the screen top/bottom (they wait there)
1767 ; + seven playable levels going easy to hard (including moving enemies)
1768 ; # xtraInfo data wasn't reset when a moving enemy entered the game
1769 ; * longer delay when level is completed (NextLevel screen came too soon)
1771 ; 0.9.94 -- 04.IX .99 -- size 2693
1773 ; # pickups no longer fire bullets like normal enemies
1774 ; + <halt>s added so the game runs slower and looks better
1775 ; + TORPEDOES!!! Bullets that fire downwards! Just like in Nemesis
1776 ; * a pickup selects the next icon on bottom bar instead of increasing hp
1777 ; + an icon can be taken by pressing F2. second icon selects torpedoes
1778 ; + first icon increases armor, icon 3 and 4 are unused for now
1779 ; * selecting an unused icon (3+4) resets pickups like icon 1 and 2
1780 ; * when you're destroyed, you loose one life instead of going game over
1781 ; you also loose all upgrades and pickups, but remain in the same level
1782 ; * random is more randomized, no more "tricks" to fool the randomizer
1783 ; # after game over the game is terminated instead of continuing+crashing
1784 ; - no more armor to start with. you'll have to collect them on your own
1785 ; * of course optimizations and a few tiny bug fixes (not important)
1786 ; * increased the size of the enemy bullets so they're better to see
1789 ; + added - removed * changed # bug fixed