1 ;----------------------------------------------------------------------------
2 ;---------------------- NEMESIS ---------------------------------------------
3 ;----------------------------------------------- cool arcade-shoot-em-up-game
5 ;by SHIAR | shiar0@hotmail.com | icq#43840958 | www.shiar.org
7 ;This source should only be used for learning practises, do not
8 ;alter it, and certainly never distribute an altered version!!
10 ;&&& marks uncertainties or things to optimize
13 ; up-double | torpedoes | levels 7-12 | jp m | better weapons
15 ;---------------------- nemesis.z80 start -----------------------------------
18 #include "ti86asm.inc" ;standard ti86 romcalls
19 #include "ti86abs.inc" ;used to save hiscores and so
23 #define cal call ;just to make it harder for you to understand
24 #define psh push ; ^:D
25 #define dnz djnz ;Dec&Jump while NonZero becomes Do w.Non-Zero
27 dispbuffer = $81FA ;= $C9FA ;virtual screen
28 ;VIDEO_MEM = $FC00 ;tha big scareen
29 TEXT_MEM = _textShadow ;text buffer; C0F9-C1A0 (167/$A7 bytes)
31 _clrWindow = $4a86 ;_clrLCD and _clrScrn
32 _ex_ahl_bde = $45f3 ;exchange values between AHL and BDE
33 _shracc = $4383 ;like _shlacc but just the opposite :P
34 _dispahl = $4a33 ;display value in ahl <100000 (cheap TI)
35 _asapvar = $d6fc ;our own variable name (likely "nemesis")
37 storepos = _asm_exec_ram+7000 ;120 OF 165
38 storepos2 = _asm_exec_ram+7200 ;141 OF 167 9000 BYTES
40 ;---------------------- in-game vars ----------------------------------------
42 just_fired = storepos ; +0 ;counts how long a blast lasts
43 hiscorepos = storepos ; +0 ;entering hiscore name
45 x = storepos+1 ; +1 ;your ship's position
46 y = x+1 ; +2 ;your y-pos
47 firex = y+1 ; +3 ;(1 byte)
48 firey = firex+1 ; +4 ;(1 byte)
50 eventleft = storepos+5 ; +5 ;nr. of enemies still to come
51 level_enemy = eventleft+1 ; +7 ;enemy type
52 level_info = level_enemy+1 ; +8 ;info (see below)
53 level_move = level_info+1 ; +9 ;=
54 spacespace = level_move+1 ;+10
55 groundinfo = spacespace+1 ;+20
56 groundpos = groundinfo+1 ;+21 $10
57 ceilingpos = groundpos+16 ;+37 $10
59 stars1 = ceilingpos+16 ;+53
60 stars2 = stars1+1 ;+54
62 starx1 = storepos+55 ;+55
64 starx2 = starx1+(nrstars1*2) ;+69
66 your_prevpos = starx2+(nrstars2*2) ;+87 ;save previous positions (32d)
67 mm = 4 ;max. number of multiples
69 ;^-----------------------------------<1 ;-120=$78
71 enemies = storepos2 ; +0 ;info about each enemy
72 enemysize = 10 ;infobytes per enemy
73 nrenemies = 16 ;max. nr of enemies
75 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,damg,x,y)
77 ebullets = ybullets+(nrybuls*4) ;+110 ;30 bytes = 10(state,x,y)
79 lvlenemies = ebullets+(nrebuls*3)
81 ;^-----------------------------------<2 ;-141=$8D
83 ; [0000:damage 0:diagfire 0:ground 0:ceiling 0:-]
85 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 10=normal 11=moving)]
86 ; [ship type or explosion frame] [x] [y] [movetype] [movecounter]
87 ; [firecounter] [firefreq] [firetype]
89 ;---------------------- introduction ----------------------------------------
91 nop ;hello yas/ase/rascall/whathever
92 jp init ;here's the program, but first: a description
93 .dw $0001 ;description type 2 (description + YASicon)
94 .dw Title ;pointer to description (all shells)
95 .dw Icon ;pointer to YAS icon
97 Title: .db "Nemesis v0.99.812 by SHIAR",0
99 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 9bytes
102 .db %00111110 ; █████
103 .db %01111001 ; ████ █
104 .db %00111110 ; █████
106 .db %11100000 ; ███ ;recommend 80x50 screen mode
107 .db 0 ;YAS 0.92 compatibility
109 ;---------------------- init ------------------------------------------------
111 int_handler: ;new interrupt proc
112 ex af,af' ;just af only (no need for exx)
113 in a,($03) ;read bit 3 port 3
114 bit 3,a ;is ON key pressed?
115 jp z,$0039 ;no: np, return
116 res 0,a ;yes: then we have a problem (freeze), so...
117 out ($03),a ;...mask the ON key interrupts!
118 jp $0039 ;all done, return
121 init: cal BUSY_OFF ;turns the run-indicator off, obviously
122 cal _clrScrn ;clean the screen
124 res 2,(iy+13) ;don't scroll the screen
125 cal _flushallmenus ;remove TI menus
127 FixKeys: ;fixes some key problems like left+down bug
132 ld l,c ;ld hl,$D400 (user silent link routine space)
137 ldir ;fill $D400-D500 with $D3s (slink/user on)
138 ld hl,int_handler ;new interrupt handler
141 ld bc,int_end-int_handler
142 ldir ;load new handler at ($D3D3)
147 ;---------------------- main menu -------------------------------------------
150 xor a ;white bitmask (a=0)
151 ld hl,logo_nemesis ;from...
152 ld de,VIDEO_MEM+16 ;...to one line from top
153 ld b,e ;ld b,16: one line
155 ld (de),a ;clear/n byte
157 dnz AboveLogo ;repeat for the first line
158 ld bc,16*19 ;logo size
159 ldir ;display one line of logo
161 ld hl,16*$33+VIDEO_MEM ;$33 rows down
162 ld b,16*7 ;draw black 7 lines
163 ld a,%11111111 ;horizontal line mask
165 ld (hl),a ;draw one piece of the divider-line
166 inc hl ;move right (8 pixels = 1 byte)
167 dnz underline ;repeat
169 ld hl,_txt_email ;at the very bottom of tha screen
171 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
172 cal _vputs ;VERY important, so display in small font ?:}
174 set 3,(iy+5) ;set white on black
175 ld de,_txt_about ;near the bottom of the screen
176 ld (_penCol),de ;hl=txt_email++=txt_about
177 cal _vputs ;display version + me
178 res 3,(iy+5) ;return to default black on white
191 ld a,0 ;current menu item (0 or 1); 0 by default
211 cal getsomekeys ;read keys (z if enter/2nd pressed)
212 jr z,start_tha_freakin_game
223 ld (hl),a ;set new menu item
226 start_tha_freakin_game:
229 cal nz,New_game ;NEW GAME
230 jp samelevel ;CONTINUE: game_main_loop
234 ld (your_score),hl ;(prevents hiscore while never played)
235 jp game_over ;and go to game over screen
237 do_invert: ;invert screen (b<>w)
239 psh af ;can't destroy b
242 xor (hl) ;$2F (cpl) <-> $B7 (or a)
257 ;----------------------------------------------------------------------------
258 ;---------------------- game loop -------------------------------------------
259 ;----------------------------------------------------------------------------
261 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
262 ld hl,timer ;update time
263 inc (hl) ;increase by 1
266 ld hl,1 ;once every 32 frames, increase score by 1
267 cal z,scoreInc ;do it
270 ld hl,dispbuffer ;move from (hl) = top left
271 ld (hl),$00 ;first pixel will be copied all over the screen
272 ld de,dispbuffer+1 ;(de) = next pixel, thus clearing whole screen
273 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
276 ld a,0 ;current frame/turn 0-255
278 and %11 ;a=0 once every 4 turns
279 jr z,movestarsdone ;don't move stars once every 4 frames
280 cal movestars1 ;move the stars on the FRONT layer
281 cal movestars2 ;move the distant stars
283 ld a,(stars1) ;star positions (the missing byte...)
284 ld b,nrstars1 ;how many stars? now we know.
285 ld hl,starx1 ;points to the position of the stars
286 cal DisplayStars ;display front layer stars
287 ld a,(stars2) ;weren't you paying attention five lines ago?
288 ld b,nrstars2 ;that many?! whow!
289 ld hl,starx2 ;and there they are
290 cal DisplayStars ;use the same procedure to display back layer
292 ld a,(level_info) ;level info
293 and %00000110 ;isolate ground&ceiling
294 jr z,game_stuff ;both non-present
295 and %00000010 ;bit representing the presence of any ceiling
296 cal nz,Handle_ceiling ;scroll the ceiling (if any) +check4collision
297 cal Handle_ground ;scroll the ground and check if we're dead
300 cal Handle_Ship ;move you
301 ld a,(your_occ) ;are you 100% OK?
303 jr nz,_gamestuff1 ;then don't check for movements/fires/...
306 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
307 out (1),a ;ask for them
308 nop \ nop ;delay 8 clocks
312 bit 6,a ;test bit 6 = exit-key = EXIT
313 jp z,game_over ;<exit> pressed, so be it
314 check_morekey: ;another unused label... poor compiler
315 bit 7,a ;test bit 7 = more-key = PAUSE
317 cal z,Pause ;yes, go to pause
321 bit 5,a ;test bit 5 = 2nd-key = FIRE
322 ld hl,check_selkey ;where to continue after executing Fire_bullet
323 psh hl ;push hl on stack (instead of cal Fire_bullet)
324 jp z,Fire_bullet ;fire smtn (bulletstaillasermultiples+stuff..)
325 pop hl ;no cal to Fire_bullet made, so pop stack
326 ld hl,just_fired ;no:
327 ld (hl),5 ;able to fire (five turns = laser duration)
328 laserdur =$-1 ;SMC laser duration
331 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
333 in a,(1) ;our precious keys
335 bit 6,a ;'bout the GRAPH key...
336 cal z,Teacher ;you didn't _press_ it, did you?!?
338 rla ;test bit7 so we know f ALPHA has been pressed
339 cal nc,select ;yeppy, select the currently selected upgrade
341 cal Enemies_hit ;check for collision with enemies
345 cal Handle_enemies ;move enemies
347 cal Handle_bullets ;move your bullets + check for hits
348 cal Enemy_bullets ;move enemy bullets
350 cal Level_event ;insert enemies
351 cal Display_Screen ;display all
354 halt ;delay and preserve batteries :)
355 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
357 ;------- weapon -------
363 cp 97 ;max. 96 times (=96/16=6 increases)
364 ret nc ;return if already maxed
365 ld (weapincs),a ;save new incs
367 and %11110000 ;clear last 4 bits so no cf when rotating
369 rra ;rotate acting as shift (srl a) but just 1B
372 rra ;increase once just every 16 turns
373 ld b,a ;times to increase
375 add a,1 ;increase damage for one increase
377 dnz incthedamage ;a=total increase damage
378 ld b,1 ;minimal damage
380 add a,b ;a=total damage
381 ld (curweapdamage),a ;safe the current damage
384 disp_charge: ;display charge bar
385 ld hl,(59*16)+VIDEO_MEM+3
392 ld a,(weapincs) ;load bar size (0-80)
393 srl a ;half the size (0-40)
394 srl a ;again half that size (0-20 pixels)
398 srl a ;/8: don't display last 3 bits of a (later)
399 jr z,nochargebar ;if a=0 then it would loop 256x so skip it
400 ld b,a ;loop b=a times
401 chargebar: ;starting at ($39*16)+VIDEO_MEM
402 ld (hl),%11111111 ;draw a piece of the bar
403 inc hl ;next position
404 dnz chargebar ;loop it b times
407 and %111 ;display last bits of chargebar
408 ret z ;if armor=0 then bit = %00000000 (don't disp)
410 xor a ;bit = %00000000
413 rra ;rotates A right and sets bit 7 (c-flag)
414 dnz chargebarbit ;repeat B times (so if B=6 then a=%11111100)
415 chargebarready: ; (an if B=3 then a=%11100000)
416 ld (hl),a ;draw this last byte
419 ;--------------------------- ground -----------------------------------------
423 and %111 ;once every 8 frames
424 jr nz,Display_ground ;otherwise skip the scroll
425 ld bc,15 ;scroll all 16 bytes minus one (teh new byte)
426 ld hl,groundpos+1 ;from..
427 ld de,groundpos ;to (one byte to the left)
428 ldir ;LoaDIncreaseRepeat = scroll!
430 ld a,(groundinfo) ;what kind of ground
432 jr z,ground_tunnel ;tunnel effect
434 ld a,(groundpos) ;type 0
441 ld bc,$500 ;range=0..4
446 add a,(hl) ;add to spacesize (so +2..-2)
448 jr c,newground ;>=0 then don't change
451 add a,b ;new position
453 jr z,newground ;may not be 0 (=256)
455 jr nc,newground ;and not be <0 (>246)
461 ld (groundpos+15),a ;save new byte on the right
464 ld b,16 ;screen width
465 ld de,groundpos-1 ;height of current byte (previous actually)
467 ld hl,dispbuffer+(56*16)-1 ;screen position
471 ld c,b ;push b for groundloopup
472 pop hl \ inc hl ;get screen position and go one right
473 pop de \ inc de ;get height info and set to the next byte
474 psh de \ psh hl ;save these for the next time
475 ld a,(de) ;height of current byte
478 ld de,16 ;to substract to go one line up
479 ld a,%11111111 ;bitmask black
482 ld (hl),a ;display black byte
483 sbc hl,de ;go up (sbc must be used for 16-bit sub)
484 dnz groundloopup ;and loop >groundpos< times
486 ld b,c ;pop b used by groundloopup
487 dnz groundloopright ;loop right for entire screen (16x)
488 pop hl \ pop hl ;restore stack
490 CheckGround: ;check for collision with the ground
508 ;--------------------------- ceiling ----------------------------------------
512 and %111 ;once every 8 frames
513 jr nz,Display_ceiling ;otherwise skip the scroll
514 ld bc,15 ;scroll all 15 bytes (16th is new position)
515 ld hl,ceilingpos+1 ;from..
516 ld de,ceilingpos ;to (one byte to the left)
517 ldir ;LoaDIncreaseRepeat = scroll!
519 ld a,(groundinfo) ;what kind of ceiling
521 jr z,ceiling_tunnel ;tunnel effect
526 ld d,a ;d=new ceiling
529 ld bc,$201 ;range=1..3
532 jr z,newceiling ;1:same
537 or a ;(spacespace)=0:
538 jr z,newceiling+2 ;keep same ceiling
544 cp d ;if size=1 then don't
550 ld (ceilingpos+15),a ;save the new byte
553 ld b,16 ;screen width
554 ld de,ceilingpos-1 ;height of current byte
556 ld hl,dispbuffer-17 ;screen position
560 ld c,b ;push b for groundloopup
561 pop hl \ inc hl ;get screen position and go one right
562 pop de \ inc de ;get height info and set to the next byte
563 psh de \ psh hl ;save these for the next time
564 ld a,(de) ;height of current byte
567 ld de,16 ;to substract to go one line up
568 ld a,%11111111 ;bitmask black
571 ld (hl),a ;display black byte
573 dnz ceilingloopdown ;and loop >groundpos< times
575 ld b,c ;pop b used by groundloopup
576 dnz ceilingloopright ;loop right for entire screen (16x)
577 pop hl \ pop hl ;restore stack
579 CheckCeiling: ;check for collision with the ground
583 srl a ;x/8 (current ceiling-byte)
588 ld de,ceilingpos ;first ceiling-byte
589 add hl,de ;current ceiling-byte
592 cp (hl) ;compare with ceiling
593 ret nc ;carry if ceiling is above you
595 jp damage_you ;otherwise you don't wanna be in that ship
597 ;--------------------------- move stars -------------------------------------
599 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
606 ret ;let's comment this: returns
611 rlca ;move bits (star) left
613 ret nc ;if star didn't went from left to right bit
614 ld b,nrstars2 ;otherwise move all stars one byte left
635 cp (dispbuffer&15)-1 ;$C9FAand15-- = 9
644 ret ;for stupid people, here's another comment...
646 ;--------------------------- pause ------------------------------------------
652 cal _vputs ;display small font
653 ld hl,_txt_pressenter ;top centered
655 ld hl,txt_pressenter ;"Enter to continue"
656 cal _puts ;display message
658 cal getsomekeys ;GET_KEY w/ halts and checks for enter
659 ret z ;enter/second pressed: continue game
661 cal z,do_invert ;if so then change invert screen (AF saved)
662 ld hl,CONTRAST ;contrast setting (0-31)
663 ld b,(hl) ;load contrast into b
664 cp K_UP ;+ key changes contrast up
666 inc b ;increase contrast
670 jr nz,pause ;nope: loop
671 dec b ;decrease contrast
675 out (2),a ;and set it
679 ;--------------------------- teacher ----------------------------------------
682 ld (iy+12),5 ;enable flashing cursor
683 cal _clrWindow ;top left
685 cal _puts ;display message
689 cal _getkey ;enter low-power mode and wait for key
690 cp kEnter ;enter pressed?
692 cp kGrMenu ;keypressed = graph?
693 jr nz,teacherloop ;no, wait some more
695 ld (iy+12),0 ;disable cursor
710 ;--------------------------- exit -------------------------------------------
712 quit: im 1 ;release keyfix procedure
713 set 2,(iy+13) ;set back screen scrolling
715 ld (_asapvar+1),a ;next Asm( run will reload the program
716 ld hl,dispbuffer ;graph-screen location
719 ld bc,1024-1 ;do it 1024 times = entire screen
721 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
722 ;_clrScrn) AND also executes _homeup and ret
724 ;--------------------------- display ----------------------------------------
727 ld hl,dispbuffer ;from buffer (top left)
728 ld de,VIDEO_MEM ;to real screen (top left)
729 ld c,56 ;display height = 64 bytes (minus 8 for bar)
731 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
733 ld a,(hl) ;copy byte from (hl)
734 _invert: ;SMC: cpl <-> or a
735 cpl ;xor $ff: invert byte (white<=>black)
737 inc hl \ inc de ;next byte
738 dnz displaytloop ;16x hl >> de
740 jr nz,displayloop ;loop 56x
744 or a ;(time2invert)=0:
745 jr z,noinvert ; do nothing
746 dec a ;otherwise decrease
747 cal z,do_invert ;if it became 0 then invert
748 ld (hl),a ;save new value
751 ld hl,$396b ;Display Score
752 ld (_penCol),hl ;bottom right of screen
755 _D_HL_DECI: ;------- display 5-digit value -------
756 ld de,savestr+4 ;savenr saves number string
758 ldhld: cal UNPACK_HL ;one digit of hl
759 add a,'0' ;make number
760 ld (de),a ;save into savenr
761 dec de ;point to next digit
762 dnz ldhld ;repeat for all digits
764 ld hl,savestr ;we (the program) saved the value righthere
765 jp _vputs ;the only thing left to do is to display it
767 savestr: ;@here the score will be stored
768 .db "00000",0 ;don't worry, it's just temporary
770 ;------------------------- handle ship --------------------------------------
777 inc a ;no! next (explosion)frame
778 ld (your_occ),a ;save
780 cp 64+1 ;last explosion frame? (1-16=1st;49-64=4th)
781 jp c,exploding_you ;not yet: display explosion
782 cp 64+16 ;delay finished?
783 jp z,You_die ;yes = game over
784 ret ;don't display anything
788 ld a,%01111110 ;get arrow keys
789 out (1),a ;it's cold outside
790 ld hl,y ;instead of nop\nop do something usefull
791 in a,(1) ;come back in
794 xor -1 ;inverted a: 0 if arrow-key has been pressed
795 ld a,(your_multiples) ;(btw: CPL doesn't set any flags)
796 res 7,a ;reset move bit (no flags changed)
797 jr z,adv_ok ;if so, leave the multiples where they are
798 set 7,a ;set move bit
799 adv_ok: ld (your_multiples),a
801 ld a,(timer) ;framecounter
802 and %1 ;switches 0<>1 each frame
803 inc a ;a = 1 or 2 (1.5 avg)
804 ld c,a ;c = your_speed
807 rra ;rotate right (put last bit in c)
808 ld b,a ;we need a later
813 cp 50 ;56-6 = bottom of screen
818 rr b ;because we now use b, it's rr instead of rra
821 sub c ;<dec a> doesn't affect c-flag
822 jr c,no_left ;-1 = left side
829 cp 122 ;128-6 = right side
838 sub c ;<dec a> doesn't affect carry-flag
839 jr c,no_up ;-1 = top of screen
840 ld (hl),a ;save new y
842 no_up: ld e,(hl) ;e=y
843 ld ix,spr_ship01 ;normal ship sprite
845 ld hl,your_inv ;invulnerable?
846 ld a,(hl) ;load time in a
848 jr z,disp_ship ;yes so ship = normal (display \ continue)
850 ld a,(timer) ;load frame nr.
851 and %00000111 ;a=0 once every four frames
852 jr nz,not_time ;a<>0 = not time to update counter
853 dec (hl) ;decrease inv-time left
855 and %00000100 ;a switches 0<->1 every 2 frames
856 jr z,disp_ship ;show normal ship
858 ld bc,spr_ship01i-spr_ship01
859 add ix,bc ;display invulnerable ship
861 cal safeputsprite ;display your ship; save de
866 ld a,(your_multiples) ;do you have multiples
867 ld b,a ;save a for 2nd check
868 and %1111 ;no? (last four bits = nr of multiples)
869 ret z ;then don't handle them either
870 bit 7,b ;move the multiples??? (=move bit set?)
871 jr z,mult_adv ;nope, just let them (saves (y)in y, (x)in x)
873 psh de ;current position = needed later
874 ld hl,mm*14+1+your_prevpos ;previous positions
875 ld de,mm*14+3+your_prevpos ;move all positions one back
877 lddr ;change 0-57 -> 2-59 (if mm=4 that is)
878 inc hl ;your_prevpos+0
881 inc hl ;=current position
885 ld ix,spr_multiple ;normal sprite
887 bit 3,(hl) ;change sprites every 8 turns
889 ld ix,spr_multiple2 ;second sprite
891 ld hl,your_prevpos+16 ;first pos.
895 ld d,(hl) ;load coords
899 cal putsprite ;display
900 pop ix ;same sprite next time ;)
903 add hl,de ;next multiple
906 ret z ;return if all done
907 jr dispmultiplesloop ;loop
912 srl a ;half the framerate
913 srl a ;half that framerate
914 srl a ;and half again that framerate
916 ld ix,spr_yexplosion ;base sprite
918 explosion_stuff: ;in:a=frame*2+(0 to 1); (hl)=xpos-- ix=sprite
924 add ix,bc ;go to correct sprite (each spr. is 8 bytes)
929 jp putsprite ;and display it too
933 damage_you: ;damages you B points
934 ld a,(your_inv) ;shield left?
936 jr z,dothadamage ;no shield
937 srl b ;shield: half the damage
941 cp (hl) ;not already inverted?
942 cal z,do_invert ;then invert screen
943 ld (hl),2 ;change back 2 frames from now
945 ld hl,your_armor ;armor left
946 ld a,(hl) ;load hp in A
947 sub b ;decrease hp by B
948 jr nc,newarmor ;>=0hp left so don't explode
949 ld a,%01 ;occ %xxxxxx01 = explode
950 ld (your_occ),a ;too bad, you're dead meat
952 ld (hl),a ;save decreased hp
953 jp disp_armor ;and display new value
955 ;------------------------- place multiples ----------------------------------
958 ld hl,your_prevpos ;place all previous positions
959 ld b,mm*7+2 ;all saved positions of them (14 per multiple)
961 ld (hl),e ;set prev-x to d
963 ld (hl),d ;set prev-y to e
965 dnz place_multiples ;repeat
968 ;------------------------- select upgrade -----------------------------------
971 ld a,(your_armor) ;load current armor
972 cp 25-6 ;may not become >=25
973 jr c,doincarmor ;ok then just add 6
974 ld a,24-6 ;set to maximum (6 will be added below)
976 add a,6 ;add 6 to armor
977 ld (your_armor),a ;change armor
981 ld hl,your_pickup ;select pickups
982 ld a,(hl) ;load pickups taken so far
984 ret m ;return if it's 0 (no pickups)
985 jr nz,select2 ;no, carry on
987 ld (hl),a ;reset pickups
989 jr disp_icons ;display and return
992 jr nz,select3 ;no, carry on
993 ld (hl),a ;reset pickups
995 ld (your_tail),a ;ready tail beam
996 jr disp_icons ;display 'n return
999 jr nz,select4 ;no, carry on
1000 ld (hl),a ;reset pickups
1005 jr nc,disp_icons ;weapon maxed out
1006 ld (hl),a ;set new weapon
1007 cal loadweapon ;load it (damage and stuff)
1008 jr disp_icons ;display n return
1011 jr nz,select5 ;no, carry on again
1012 ld (hl),a ;reset pickups
1015 cp maxweapon ;upgrade from bullet
1016 jr nc,upgradelaser ;nope, just upgrade
1017 ld a,maxweapon-1 ;yes, set laser #1
1021 jr nc,disp_icons ;laser maxed out
1024 jr disp_icons ;display + return
1027 jr nz,select6 ;no, carry on once more
1028 ld (hl),a ;reset pickups
1029 ld hl,your_multiples
1030 ld a,(hl) ;multiples you already got
1031 and %1111 ;reset movebit so (your_multiples)=real value
1034 jr nc,enoughmultiples ;maxed out
1038 dec a ;if this is your first multiple then...
1039 cal z,Place_multiples ;reset multiples positions
1040 jr disp_icons ;display, return
1042 ld (hl),0 ;reset pickups
1045 ;--------------------------- show icon --------------------------------------
1048 psh bc \ psh de \ psh hl \ psh ix ;&&&
1050 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
1051 ld (PutWhere),hl ;place icons at bottom of normal screen
1052 ld b,16 ;draw 16x (screen width)
1053 ld a,%11111111 ;horizontal line mask
1054 cal drawline ;draw divider-line
1056 ld b,16*7 ;draw 16x (screen width) 7x (height)
1057 xor a ;blank line mask
1058 cal drawline ;clear scorebar
1062 ld a,(your_lives) ;nr of lives
1064 jr z,displivesdone ;no lives
1069 cal safeputsprite ;put li'l ship
1074 dnz displivesloop ;one ship per life
1076 cal disp_armor ;display bar
1078 ld ix,spr_icon01 ;torpedoIcon
1079 ld de,$1901 ;icon #1
1080 cal putwidesprite ;display icon
1083 ld a,(your_weapon) ;ur weapon
1084 cp maxweapon ;laser?
1085 psh af ;(your_weapon)
1086 jr nc,no_tail ;if laser (nc) then tail ain't fired
1090 ld ix,spr_icon02 ;tailbeamIcon
1092 ld de,$2901 ;icon #2
1093 cal putwidesprite ;display
1096 pop af ;a=(your_weapon); cf=bullets
1098 jr nc,no_bullets ;=laser
1099 ld hl,$3945 ;position to display bullet-type digit
1100 pop af ;digit=(your_weapon)
1102 inc a ;1 = weapon #1 (=0)
1103 ld (_penCol),hl ;set location
1104 add a,'0' ;make digit
1105 cal _vputmap ;display char
1106 ld ix,spr_icon03 ;bulletIcon
1108 ld de,$3901 ;icon #3
1109 cal putwidesprite ;display icon
1111 ld ix,spr_icon00 ;emptyIcon
1112 pop af ;ld a,(your_weapon)
1114 jr c,no_laser ;popped carry
1115 ld hl,$3955 ;position to display bullet-type digit
1116 ld (_penCol),hl ;set location
1117 ld a,b ;(your_weapon) ;load = faster than push
1118 sub maxweapon-1 ;1 = laser #1 (=maxweapon)
1119 add a,'0' ;make digit
1120 cal _vputmap ;display char
1121 ld ix,spr_icon04 ;laserIcon
1123 ld de,$4901 ;icon #4
1126 ld ix,spr_icon00 ;emptyIcon
1127 ld a,(your_multiples)
1132 ld de,$5901 ;icon #5
1135 ld ix,spr_dividerline
1139 ld a,(your_pickup) ;pickups taken
1140 add a,a ;picks*2 (sets z-flag)
1141 jr z,iconsdone ;return if no pickups
1146 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
1147 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
1152 ld hl,dispbuffer ;normal game-screen
1153 ld (PutWhere),hl ;set sprite-position to normal screen
1155 pop ix \ pop hl \ pop de \ pop bc
1160 ld hl,(57*16)+VIDEO_MEM+3
1170 ld a,(your_armor) ;load your armor (<25)
1174 srl a ;/8: don't display last 3 bits of a (later)
1175 jr z,noarmorbar ;if a=0 then it would loop 256x so skip it
1176 ld b,a ;loop b=a times
1177 armorbar: ;starting at ($39*16)+VIDEO_MEM
1178 ld (hl),%11111111 ;draw a piece of the bar
1179 add hl,de ;one down (resets carry)
1180 ld (hl),%11111111 ;same piece
1182 inc hl ;next position
1183 dnz armorbar ;loop it b times
1187 and %111 ;display last bits of armor
1188 ret z ;if armor=0 then bit = %00000000 (don't disp)
1190 xor a ;bit = %00000000
1193 rra ;rotates A right and sets bit 7 (c-flag)
1194 dnz armorbarbit ;repeat B times (so if B=6 then a=%11111100)
1195 armorbarready: ; (an if B=3 then a=%11100000)
1196 ld (hl),a ;draw this last byte
1198 ld (hl),a ;and just below
1202 ld (hl),a ;draw one piece of the divider-line
1203 inc hl ;move right (8 pixels = 1 byte)
1204 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
1207 ;------------------------- fire bullet --------------------------------------
1211 psh ix ;save ix for next fire
1212 cal fireany ;fire from multiple position
1213 pop ix ;saving ix is much faster than recalculating
1214 pop af ;number of multiples
1215 dec a ;one just displayed
1217 ret z ;ret2 if none left
1221 ld hl,(your_prevpos+16);then, fire from multiple position
1223 ld hl,(your_prevpos+30)
1225 ld hl,(your_prevpos+44)
1227 ld hl,(your_prevpos+58)
1228 cal fire_multiple ;no JP: that messes up the stack
1232 ld hl,just_fired ;=for how long you may hold fire (2nd)
1233 ld a,(hl) ;a = time left
1234 dec a ;decrease timer
1235 ret z ;may not fire when (just_fired) became 0
1236 ld (hl),a ;save new decreased value
1238 ld a,(your_weapon) ;if you have bullets.....
1240 jr nc,fireOK ;>weapons = laser
1241 ld (hl),1 ;bullet may last one turn (just fire 1 bullet)
1243 ld a,(your_weapon) ;weapon nr.
1249 ld b,0 ;go to current weapon (bc=a)
1250 add ix,bc ;ix=weapon ptr
1252 ld a,(your_multiples) ;any multiples?
1253 and %1111 ;nr. of multiples
1254 cal nz,fire_multiples ;if >0 then fire them too
1255 ld hl,(x) ;fire from ship position (x)
1257 ld (firex),hl ;set position to fire from
1258 ld b,3 ;or use the proc at fireOK with ld ix,weapondata+2-(256*3)
1260 psh bc ;save counter
1261 ld a,(ix) ;load this weapon
1262 ld c,a ;save bulletType in c
1263 and %11100000 ;%111?????=laser
1264 cp %11100000 ;is it?
1265 cal z,fire_laser ;fire laser (will set c=0 when done)
1268 cal nz,fire_ybullet ;then fire bullet
1269 inc ix ;otherwise fire next weapon
1271 pop bc ;weapon counter (do 3 weapons)
1279 ld a,(ix-2) ;last weapon fired
1280 cp %11100000 ;issit laser
1282 xor %11111 ;smart way of going left instead of right :P
1284 ;-----fire BULLETs-----
1286 fire_ybullet: ;fire bullet type=C dam=(curweapdamage) at (firex/y)
1287 ld hl,ybullets ;check for unused bullet
1293 jr z,found_ybullet ;0 = no bullet here
1295 dnz find_ybullet ;look next bullet
1296 ret ;none found, return don't fire
1299 ld (hl),c ;use the bullet and set correct bullet-type
1301 ld (hl),1 ;set bullet damage
1303 ld a,(firex) ;your x-pos
1304 add a,5 ;place bullet in front of you
1305 inc hl ;go to bullet-x
1308 ld a,(firey) ;your y-pos
1309 add a,(ix+1) ;place bullet at the middle of your ship
1310 inc hl ;go to bullet-y
1314 ld (weapincs),a ;reset damage
1317 ;-----fire LASER-----
1320 ld b,0 ;overflow counter
1322 ld d,(hl) ;d = your x-pos
1325 ld a,(hl) ;base y-coord (firey)
1326 add a,(ix+1) ;at specified offset (most likely the middle)
1327 ld e,a ;save laser-y in e
1328 psh de ;save unmodified (x,y)
1332 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1333 add a,a ;y*16 (width of screen)
1334 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1335 inc a ;8 pixels to right (a=even so no overflow)
1340 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1342 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1343 inc b ;a>255 so increase bc by 256
1344 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1345 ld hl,dispbuffer ;save-location
1346 add hl,bc ;bc = Y*16+X/8: hl=screen address
1347 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
1348 sub d ;minus x-start (d=X/8)
1352 inc hl ;Go to next byte
1355 pop de ;de=(firex): x-pos unmodified
1357 check_laserhits: ;de = (x,y)
1359 ld b,nrenemies ;check all enemies
1360 ld hl,enemies+1 ;enemy#1+occ/hp00
1361 laserhits: ;hits with normal enemies
1364 and %00000010 ;normal/moving occ.=%1x
1365 jr z,nolashit ;no hit when enemy_occ <> 2/3
1368 or a ;enemy #0 = pickup
1369 jr z,nolashit ;yes: don't destroy
1371 cal find_sprite ;ix=sprite to enemy (hl)
1375 jr c,nolashit ;no hit when enemy is left of you
1379 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1380 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1382 add a,(ix+1) ;add enemy height (according to sprite @ix)
1383 jp m,nolashit ;a-e>0 = hit
1385 ld a,(curweapdamage) ;damage
1386 cal enemy_hit ;hl=enemy+y
1391 add hl,bc ;go to next enemy
1393 dnz laserhits ;check all enemies
1395 ld (weapincs),a ;reset damage
1400 ;------------------------ handle bullets ------------------------------------
1404 and %11111 ;pixels to move
1405 add a,(hl) ;a = X + (hl) to the right
1406 sub 16 ;and 16 to the left (so -16..+15)
1407 jr c,remove_bullet ;remove if x<0
1409 jr nc,remove_bullet ;or x>=128
1410 ld (hl),a ;save new pos.
1415 cal _shracc ;%11110000->1111
1416 ;Note: a _shracc procedure inside Nemesis itself would be 27 cycles faster
1419 jr z,bullet_noymove ;1=straight forward
1421 jr z,bullet_up ;2=up
1423 jr z,bullet_halfup ;3=1/2up
1425 jr z,bullet_down ;4=down
1427 bullet_halfdown: ;5=1/2down
1429 rra ;carry once every other turn
1439 rra ;CF every other turn
1451 pop hl ;cal move_bullet
1453 ld (hl),0 ;dump this bullet!
1454 jr next_ybullet+1 ;+1:skip pop hl at next_ybullet
1460 ld a,(hl) ;@bulletType
1461 or a ;bulletType=0 >> no bullet
1462 jp z,next_ybullet+2 ;skip pops (+2); jP for speed
1464 psh bc ;bullet counter
1465 psh hl ;save enemy+type
1466 ld (temp1),hl ;needed for check_bullethits
1469 cal move_bullet ;move bullet
1474 ld a,(hl) ;bullet damage=size
1475 ld hl,bullettable ;pointer to first bullet
1479 ld c,a ;->16bit (de=a)
1480 add hl,bc ;point to correct bullet offset
1481 ld a,(hl) ;load bullet offset
1482 ld c,a ;convert to 16bit (d=0)
1483 ld ix,spr_bullet01 ;first sprite
1484 add ix,bc ;add offset (go to correct sprite)
1486 ld a,(ix) ;bullet x-size
1487 ld (bulletxsize),a ;used at check_bullethits
1488 ld a,(ix+1) ;bullet y-size...
1489 ld (bulletysize),a ;...too
1491 cal safeputsprite ;display bullet; DE used for check_bullethits
1493 cal check_bullethits
1496 pop hl ;restore enemy+type
1498 inc hl ;&&&add hl = faster
1501 inc hl ;skip type,dam,x,y: next enemy+type
1502 dnz scan_bullets ;next bullet (loop)
1505 ;--------------------------- check bullethits -------------------------------
1507 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1511 hit_enemies: ;Hits with normal enemies
1512 psh bc ;enemy counter
1517 jr z,nohit ;no hit when enemy_occ <> 2/3
1521 or a ;enemy #0 = pickup
1522 jr z,nohit ;yes: don't destroy
1524 cal find_sprite ;set ix to the sprite of this enemy
1528 sub d ;minus bullet x-position
1530 sub 5 ;minus bullet x-size
1534 add a,(ix) ;add enemy width
1539 sub e ;minus bullet y-position
1541 sub 3 ;substract bullet height
1543 jp p,nohit ;nope, missed it
1545 add a,(ix+1) ;add enemy height
1547 jp m,nohit ;missed after all
1549 ;---bullet hits enemy (auch-time!)---
1551 ld hl,0 ;@bulletType
1553 ld (hl),0 ;remove bullet
1555 ld a,(hl) ;set damage
1563 dnz hit_enemies ;check next enemy
1566 enemy_hit: ;*in:a=damage;hl=enemy+y
1567 add a,a ;a=damage to inflict
1568 add a,a ;first 2 bits used for occ.
1574 ld a,(hl) ;load hp00
1575 sub b ;decrease HP (if <0xx then c is set)
1576 ld (hl),a ;save (no flag-changes)
1577 dec hl ;@hp64; no change in c
1578 ld a,(hl) ;load; no c-change
1579 sbc a,0 ;if cf then decrease a
1580 ld (hl),a ;save back the new value
1581 ret nc ;if a>=0 then return, otherwise explode
1583 inc hl ;goto occ again
1584 ld (hl),%01 ;set to explode
1586 ld a,(pickuptimer) ;counts enemies destroyed
1587 dec a ;enough destroyed for a pickup?
1588 psh af ;save flags and a=0
1589 jr nz,pickupdone ;otherwise just explode
1590 ld a,18 ;reset enemies counter (18 hits = next)
1592 ld (pickuptimer),a ;save new enemiescounter value
1594 ld (hl),0 ;explosionFrame 0 or enemy #0=pickup
1596 cal z,place_enemy ;place pickup (enemy#=0=a cuz ZF)
1598 ld hl,1 ;increase score by one
1601 ;--------------------------- level events -----------------------------------
1604 ld a,0 ;time to next event
1606 dec a ;decrease counter
1607 ld (nextevent),a ;store new value
1608 ret nz ;hasn't reached zero yet: get outta here!
1610 ld bc,0 ;enemy frequency (lvl)
1613 ld (nextevent),a ;set time to next event
1615 dec (hl) ;update enemy-counter
1617 ld a,(hl) ;look at counter
1618 or a ;has it reached 0?
1619 jp z,Next_level ;yes: level finished
1620 dec a ;has it reached 1?
1621 jr z,standby_event ;yes: wait until no enemies present/left
1622 dec a ;has it reached 2?
1623 jr z,place_boss ;yep: place the BigBossTM!
1624 dec a ;has it reached 3?
1625 jr nz,place_ranenemy ;nope: >3 = place an enemy
1626 inc hl ;nextevent located behind eventleft
1627 ld (hl),123 ;set delay
1628 ret ;don't place any more enemies
1632 ld hl,enemies+1-enemysize
1637 cp (hl) ;0 = no enemy present
1648 ld bc,0 ;0..nrlvlenemies
1649 nrlvlenemies =$-1 ;=nr of enemies minus 1
1650 cal Random ;random enemy b..b+c = 0..nrenemies-1
1654 add hl,bc ;go to a random enemy
1655 ld a,(hl) ;load enemy nr of this mysterious random enemy
1659 ld hl,(levelp) ;the leveldata (including the boss)
1660 dec hl ;points to leveldata\boss\enemynr
1661 ld a,(hl) ;load enemy# of boss
1663 place_enemy: ;places enemy #=a
1665 ld hl,enemies+1-enemysize
1668 chk_noenemy: ;find an unused (no) enemy
1669 add hl,bc ;check next enemy
1670 cp (hl) ;(hl) = 0 ??
1671 jr nz,chk_noenemy ;jump if enemy present (non-0)
1672 ex de,hl ;de=hl=usable enemy +1
1673 pop af ;enemy# to place
1674 cal findenemyspecs ;hl = enemy #a specs
1676 dec de ;goto hp64 (before occ)
1678 ldi ;set hitpoints+occ of enemy class
1679 ld a,(hl) ;save sprite-offset/2 (ldi decs bc so in a)
1684 ld a,(hl) ;load placeInfo
1687 jr z,random_enemy ;yes: create random value <51 in a
1689 jr z,lure_enemy ;yes: create a 100% luring enemy
1691 halflure_enemy: ;yes (of course it is): pick one (50% lure)
1692 ld a,(timer) ;look at frame-number
1693 rra ;make random if odd frame nr.
1694 jr nc,random_enemy ;1st possibility: random enemy
1695 lure_enemy: ;2nd possibility: luring enemy
1696 ld a,(y) ;place at same y-pos as YOUR ship
1699 ld b,0 ;bc = enemy sprite offset / 2
1700 ld ix,spr_enemy00 ;first enemy sprite
1701 add ix,bc ;add offset for current enemy
1702 add ix,bc ;twice (offset stored as offset/2)
1703 ld a,64-8 ;=57=screen height (8 is scorebar)
1704 sub (ix+1) ;minus sprite height=bottom
1705 ld c,b ;range=0 to...
1707 cal Random ;random value on screen
1708 ypos_OK: ;random value successfully created
1709 ld (de),a ;save y-position
1710 inc de ;@movecounter
1712 ld a,1 ;movecounter = 1
1714 inc de ;@firecounter
1715 ldi ;set time-to-1st-fire
1720 ;--------------------------- enemy fires ------------------------------------
1722 Enemy_fires: ;de = x,y; c = type
1723 ld hl,ebullets ;first bullet to check
1728 enemy_fires_again: ;same but hl = first bullet possibly free
1732 jr z,found_ebullet ;0 = not used
1733 inc hl \ inc hl \ inc hl
1734 dnz find_ebullet ;look next bullet
1740 jr c,bulletok ;type #0-5 = done (normal/diag)
1742 jr z,bulletaiming ;type #6 = aiming = type#2..5
1744 jr z,bullettriple ;type #7 = triple
1749 cal enemy_fires_again ;fire bullet
1750 inc hl ;next bullet position
1753 jr bulletok ;fire another bullet
1756 ld c,1 ;type #1 = normal
1757 cal enemy_fires_again ;fire
1759 ld c,4 ;type #4 = down 50%
1760 cal enemy_fires_again
1762 ld c,5 ;type #5 = up 50%
1770 ld c,5 ;yourY-bulY = negative (=bullet below you)
1773 ld c,3 ;yourY-bulY = even more negative (going up)
1777 ld c,4 ;bullet going down (=jp m)
1779 jr c,bulletok ;even more going down
1783 ld (hl),c ;set bullet direction
1785 ld (hl),d ;set x-pos
1787 ld (hl),e ;set y-pos
1790 ;----------------------------- enemy bullets --------------------------------
1793 ld hl,ebullets ;hl=bullet pointer
1794 ld b,nrebuls ;number of bullets (or _possible_ bullets)
1798 ld a,(hl) ;load bulletType in a
1799 or a ;bullet present?
1800 cal nz,enemy_bullet ;non-0: handle bullet
1801 pop hl ;enemy_bullet could've added one or two to hl
1802 pop bc ;bullet counter
1803 inc hl \ inc hl \ inc hl ;next bullet (3 bytes per bullet)
1804 dnz handle_bullet ;loop for each and every bullet
1809 ld d,(hl) ;check if it has reached the left side of scrn
1811 jr nz,remove_ebullet ;yes, remove bullet
1812 dec d ;move one pixel left
1813 dec d ;and another one (that makes 2)
1814 ld (hl),d ;save new x-coordinate in (HL) and D
1815 inc hl ;@y (BTW: x >= -2)
1819 jr z,ebullet_common ;type 1: normal bullet
1821 jr z,ebullet_down ;type 2: moving down
1823 jr z,ebullet_up ;type 3: moving up
1825 ld b,a ;save bulletType
1826 ld a,(timer) ;load timer
1827 rra ;half speed (CF set every other turn)
1828 jr c,ebullet_common ;if bit then normal bullet
1831 jr z,ebullet_down ;type 4: moving down 50%
1832 ;type 5: moving up 50%
1835 jp m,ebullet_common ;y<top; don't save new value (so y=0)
1842 jr z,ebullet_common ;then keep it there
1843 ld (hl),e ;otherwise save new y
1846 ld ix,spr_bullete1 ;display enemy bullet
1849 pop hl ;we'll need it again
1854 ret nz ;0 = you're normal
1856 ld a,(y) ;check y collision
1871 ld b,auch_bullet ;set damage-amount
1873 cal damage_you ;HIT!!
1874 pop hl ;save hl to remove the bullet
1876 dec hl ;points to bullettype again
1877 ld (hl),0 ;bullet > unused
1880 ;--------------------------- handle enemies ---------------------------------
1884 ld b,nrenemies ;handle all enemies
1892 jr z,next_enemy ;occ "no enemy" 0
1894 jr z,exploding_enemy ;occ "exploding" 1
1898 ld c,(hl) ;c = enemy type = de
1912 jr c,enemyonscreenY ;=on screen
1913 cp -20 ;moved off at top
1914 ld e,0 ;reset to top
1915 jr nc,enemyonscreenY
1916 ld e,57 ;otherwise reset to bottom
1918 ld (hl),e ;store new y
1923 jr c,enemyonscreenX ;=on screen
1925 jr c,remove_enemy ;=off screen
1927 ld (hl),d ;store new x
1928 ld a,c ;a = enemy type
1929 or a ;type 0? (pickup)
1930 jr nz,check_enemyfire ;no, a normal enemy; let em fire
1931 jr firing_done ;continue
1935 add hl,bc ;@firecount
1936 dec (hl) ;decrease counter till next blast
1937 ld a,(hl) ;&&&doesn't seem efficient to me
1938 or a ;has it reached zero?
1939 jr nz,firing_done ;finished if not
1946 dec hl ;@firecount again
1947 ld (hl),a ;reset counter for next blast
1948 psh de ;save registers for firing-use
1949 cal Enemy_fires ;fires bullet
1950 pop de ;restore (destroyed by Enemy_fires)
1952 cal putwidesprite ;display sprite @ix
1966 jr nz,keep_enemy ;remove when at last frame
1969 ld (hl),$0000 ;bye bye enemy
1970 jr next_enemy+1 ;continue AFTER pop hl (already done)
1973 ld (hl),a ;next frame
1975 ld ix,spr_explosion ;base sprite
1976 cal explosion_stuff ;display explosion
1979 ;--------------------------- moving enemies ---------------------------------
1982 dec d ;move left once
1983 ld a,(hl) ;how does this enemy move?
1989 jr z,movetype_updown ;1 = (1<) up / down
1991 jr z,movetype_vslow ;2 = (.25<)
1993 jr z,movetype_slow ;3 = (.5<)
1995 jr z,movetype_fast ;4 = (1.5<)
1997 jr z,movetype_vfast ;5 = (2<)
2001 jr z,movetype_smart ;6 = &&& smart
2003 jr z,movetype_lure ;7 = (0) move y towards you
2005 jr z,movetype_slowlure ;8 = (0) lure 1/2 speed
2008 jr z,movetype_fulllure ;10 = x+y towards you 1/2 speed
2010 jr z,movetype_right ;11 = (.5>)
2012 jr z,movetype_fright ;12 = (1>)
2018 inc d ;move right one px
2027 jr c,movetype_vfast ;moves left (again)
2038 jr nc,dothelurethingy
2039 dec d ;x>109: move left
2043 ret z ;don't move vertically if equal
2044 jr c,lure_up ;below you then move up
2045 lure_down: ;above then move down
2058 or a ;reset carry flag
2059 dec hl ;reset hl to <y>
2077 ret c ;once every other turn
2079 dec d ;move left twice
2086 and 127 ;range 0..127
2087 ld (hl),a ;store new movecounter
2088 dec hl ;reset hl to @movetype
2089 and %00100000 ;ZF changes once every 64 turns
2090 ld a,e ;load current y-position
2092 moveup: dec a ;decrease y-pos (=move up)
2093 ret m ;don't move off the screen (y<0)
2094 dec e ;save new y-pos
2097 inc a ;increase y-pos
2098 cp 55 ;compare with bottom
2099 ret nc ;return if it has passed that line (>40)
2100 inc e ;otherwise save new position
2103 ;--------------------------- check collision --------------------------------
2106 ld hl,(x) ;e = X, d = Y
2107 ld de,$0707 ;add 7 to both d and e
2109 ex de,hl ;e = X+7, d = Y+7
2112 ld b,nrenemies ;check all 20 enemies
2117 and %00000010 ;enemy status
2118 jr z,check_next ;2 or 3 = ok, otherwise: next enemy
2121 collide_enemy: ;&&& include in Handle_enemy proc
2125 ld a,(hl) ;check x match
2126 sub e ;enemy position minus yours minus 7
2129 add a,(ix) ;enemy width
2133 ld a,(hl) ;check y match
2134 sub d ;same as with x-check
2135 jr nc,check_next ;(=jp p)
2137 add a,(ix+1) ;enemy height
2144 ld hl,2 ;increase score by 2
2148 ld a,(hl) ;load enemy type
2150 jr nz,collide ;enemy when <>0
2153 ld hl,your_pickup ;your pickups
2158 ld a,1 ;yes: reset to pickup 1
2161 cal disp_icons ;display altered pickupicons
2164 dec hl ;to enemy occ
2165 xor a ;set to 0 = gone
2167 jr check_next ;all done, next..
2174 jr nc,enemydamaged ;enemy still ok (HP>=0)
2175 ld (hl),%01 ;set to explode
2177 ld (hl),0 ;explosionFrame 0
2178 enemydamaged: ;damage to enemy delivered
2179 ld b,auch_collide ;your damage
2190 ;--------------------------- story ------------------------------------------
2193 psh hl ;hl will be destroyed by _clrLCD
2194 cal _clrLCD ;clear screen
2197 ld (curline),a ;begin line for special effect
2199 ld d,(hl) ;vertical position of text
2201 ld e,(hl) ;horizontal text-position
2202 ld (_penCol),de ;set position
2204 cal _vputs ;display text
2206 ld a,(hl) ;load next byte
2208 or a ;0 means more text
2209 jr z,storyLine ;loop if there is
2213 ld hl,VIDEO_MEM ;copy text
2214 ld de,dispbuffer ;to GRAPH_MEM
2215 ld bc,1024 ;entire screen
2217 cal _clrLCD ;clear VIDEO_MEM
2219 pop bc ;last byte (<>0) is lines to SFX
2221 cal DoSFX ;do special effects
2222 cal _getkey ;wait for a key
2227 cal storyPage ;do some story
2228 ld a,(hl) ;load next byte in a
2229 inc a ;set z-flag if a = $ff
2230 jr nz,dostory ;otherwise loop
2232 inc hl ;set hl to beginning of the level
2233 ld (levelp),hl ;set the level-pointer
2236 ;--------------------------- SFX --------------------------------------------
2238 DoSFX: ;in:(curline)=beginLine;b=nrOfLines
2242 ld a,0 ;get line number
2244 inc a ;go to the next line
2245 ld (curline),a ;update
2251 add hl,hl ;*16 (a pixels down=a*16)
2253 neg ;a=64-a (lines from bottom)
2255 ld b,h ;save hl for later
2257 ld de,VIDEO_MEM ;where to put sfx
2258 add hl,de ;go to ymin
2259 ex de,hl ;put into de again
2260 ld hl,dispbuffer ;source of original
2261 add hl,bc ;hl->source
2263 SFXdisp: ;display this frame on screen
2264 ld bc,16 ;one line (=16 bytes, you'd know by now)
2265 ldir ;display (copy actually)
2266 ld bc,-16 ;go up one line (not on screen)
2267 add hl,bc ;so the same line will be displayed
2269 jr nz,SFXdisp ;repeat until whole screen is displayed
2280 ;--------------------------- proc -------------------------------------------
2282 Random: ;a=c<random<b+c; destr:none
2284 ld hl,rancount ;amount to increase with (0-255)
2286 inc (hl) ;change for next time
2287 ld a,r ;value $0-7F (can be _anything_ so watch out!)
2288 add a,0 ;add to last random value
2289 ranseed =$-1 ;SMC :P
2290 add a,(hl) ;add the changing increase value
2291 ;(this is because R can be anything;
2292 ; ie always be even so freeze when a must be 1<=a<=1)
2293 ld (ranseed),a ;save for next time
2295 jr nc,randomloop ;then add again
2301 RandomY: ;HL = random Y 0..50 right side ((1..51)*16-1)
2303 ld bc,50*256+1 ;range=1..51
2304 cal Random ;a = 1..51
2310 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2311 dec hl ;hl = 0..50 * 16 (" at right side of screen)
2313 add hl,de ;position on screen
2325 find_sprite: ;in:hl=enemy+type | out:ix=sprite to enemy
2328 ld e,(hl) ;e = enemy offset/2
2330 ld ix,spr_enemy00 ;first enemy sprite
2331 add ix,de ;add offset for current enemy
2332 add ix,de ;twice (offset stored as offset/2)
2338 ld hl,VIDEO_MEM ;screen location (top left)
2341 ld bc,1024-1 ;do it 1024 times = entire screen
2343 set 3,(iy+5) ;set white on black
2348 ld a,%10000000 ;all key-masks
2351 inc a ;cp %11111111 (no keys pressed)
2352 jr nz,releasekeys ;keep waitin
2353 jp GET_KEY ;clear buffer
2355 findenemyspecs: ;enemy #a specs in (hl); in:b=0; out:ac=?
2356 ld hl,enemyspecs ;enemy "0" specs
2362 ld c,a ;b=0; c=bc=type*8
2363 add hl,bc ;hl = enemy specs
2366 ;--------------------------- game over / new game / death -------------------
2368 .db 0,".<>!",0,0,0,0 ;down,L,R,up
2369 .db 0,"xtoje0",0 ;enter..clear
2370 .db " wsnid9",0 ;(-)..custom
2371 .db "zvrmhc8",0 ;dot..del
2372 .db "yuqlgb7#" ;0..xvar
2373 .db $D9,"-pkfa6'" ;on..alpha
2374 .db "54321*",0,$D0 ;F5..more
2377 ld hl,_asapvar ;find own variable
2378 rst 20h ;cal _ABS_MOV10TOOP1
2379 rst 10h ;cal _FINDSYM
2382 ld hl,4+storehi_start-_asm_exec_ram
2383 add hl,de ;hl=pointer to data in original prog
2385 cal _SET_ABS_DEST_ADDR
2388 cal _SET_ABS_SRC_ADDR
2389 ld hl,storehi_end-storehi_start
2390 cal _SET_MM_NUM_BYTES
2391 cal _mm_ldir ;save done (cal \ ret)
2395 ld hl,_asapvar ;find own variable
2396 rst 20h ;cal _ABS_MOV10TOOP1
2397 rst 10h ;cal _FINDSYM
2400 ld hl,4+storesave_start-_asm_exec_ram
2401 add hl,de ;hl=pointer to data in original prog
2403 cal _SET_ABS_DEST_ADDR
2405 ld hl,storesave_start
2406 cal _SET_ABS_SRC_ADDR
2407 ld hl,storesave_end-storesave_start
2408 cal _SET_MM_NUM_BYTES
2409 cal _mm_ldir ;save done (cal \ ret)
2412 game_over: ;stack=+0
2413 cal BLACKLCD ;clear screen
2415 ld (_curRow),hl ;center
2417 cal _puts ;display "GAME OVER"
2418 cal releasekeys ;wait for all keys to be released
2497 xor a ;clear a (Ahl will be displayed)
2498 ld hl,$1006 ;bottom-1 right
2499 ld (_curRow),hl ;set
2500 ld hl,(your_score) ;your score
2501 cal _dispahl ;display it (a=0)
2503 ld hl,$314b ;bottom-1 right before score ^^
2504 ld (_penCol),hl ;set
2505 ld hl,txt_score ;"Score"
2506 cal _vputs ;display (small)
2508 ld hl,$1007 ;bottom right
2509 ld (_curRow),hl ;set
2510 ld hl,(hiscore) ;hi-score
2511 cal _dispahl ;display
2512 ld hl,$3946 ;bottom right before hiscore ^^
2513 ld (_penCol),hl ;set
2514 ld hl,txt_hiscore ;"Hiscore"
2515 cal _vputs ;display (small)
2520 ld hl,VIDEO_MEM+(49*16)-1
2526 cal _getkey ;wait for keypress
2527 jp quit ;restore some things and return to TI-OS/shell
2529 invship: ;procedure used in New_game
2533 ld hl,VIDEO_MEM+$30-$C0;begin pos
2537 ld b,$B0 ;12 lines down
2543 dnz invshiploop ;loop
2547 New_game: ;stack must be +1 (so change the jp in cal :)
2550 ld (PutWhere),hl ;will be reset after displaying iconbar
2551 ld ix,spr_ship01 ;first ship: sprite
2552 ld de,$0105 ;position
2553 ld b,4 ;number of ships to display
2557 cal putwidesprite ;display
2559 ld bc,spr_ship01i-spr_ship01+2
2560 add ix,bc ;go to next ship
2561 ld a,12 ;below the previous one
2565 dnz dispshipsloop ;loop
2581 jr z,startthenewgame
2583 jr z,startthenewgame
2598 ld hl,spr_ship01-(spr_ship02-spr_ship01)
2599 ld de,spr_ship02-spr_ship01
2600 inc b ;your ship #0-3++
2602 add hl,de ;next ship
2606 ld (your_score),a ;reset score
2607 ld (your_score+1),a ;reset score (0)
2608 ld (your_tail),a ;no tail beam
2609 ld (your_weapon),a ;no laser
2610 ld (your_pickup),a ;reset pickups
2611 ld (your_multiples),a ;no multiples
2613 ld (level),a ;reset level nr (#1)
2614 ld hl,level00 ;set level pointer to level#1
2615 ld (levelp),hl ;reset level pointer
2617 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
2618 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
2620 You_die: ;stack must be +1
2621 pop hl ;restore stack
2623 ld (your_armor),a ;12 HPs/shields
2624 ld a,(your_lives) ;load lives left
2625 dec a ;decrease lives
2626 ld (your_lives),a ;if lives=0ffh GO
2627 inc a ;if -1 then zf set now
2628 jp z,game_over ;and game's over
2632 cal dostory ;display end (hl=(levelp))
2634 cal scoreInc ;game complete bonus: 250
2635 jp game_over ;game over (+hiscore)
2637 ;--------------------------- next level -------------------------------------
2639 Next_level: ;stack must be +1
2642 cal inc_armor ;increase armor
2644 ld hl,(levelp) ;level pointer
2645 ld b,0 ;advance one level
2647 add hl,bc ;passed the enemies
2649 add hl,bc ;update to point to next level
2650 ld (levelp),hl ;save
2652 ld a,(level) ;level number
2654 cp endlevel+1 ;last level done?
2655 jr nc,gamedone ;yes: display end story and quit
2660 ld h,0 ;increase score....
2661 ld l,a ;by level number * 4
2664 cal scoreInc ;update score
2668 ld (your_shipspr),hl
2671 ld (nextevent),a ;time to first enemy appearance
2673 ld hl,(levelp) ;level pointer
2674 dec hl ;byte before level (boss byte)
2675 xor a ;if it's zero it means here's a story
2677 inc hl ;begin of level
2678 cal z,dostory ;do the story and set (levelp) to real level
2680 ld a,(hl) ;number of (different) enemies in this level
2683 ld (nrlvlenemies),a ;set nr of enemies-1
2684 ld b,0 ;bc=c so we can use ldir
2685 ld de,lvlenemies ;table of enemies
2686 ldir ;load enemies to table
2687 ld a,(hl) ;load new appearance-time
2691 ld (eventtime+1),a ;set
2693 ld a,(hl) ;load nr of enemies in this level
2694 ld (eventleft),a ;set nr of events left
2699 ;loads (level_info); (level_move); (spacespace); (groundinfo)
2701 ld b,32 ;fill (groundpos) and (ceilingpos)
2715 ld (timer),a ;reset time
2716 ld hl,your_occ ;hl = your_occ
2717 ld (hl),a ;reset your ship (not exploding)
2718 inc hl ;hl = your_inv
2719 ld (hl),25 ;set 25*4=100 frames invulnerable
2721 ld (x),de ;begin position (x,y)
2722 cal Place_multiples ;place all multiple-positions at that (0,24)
2724 cal loadweapon ;load (your_weapon)
2726 ld hl,enemies ;remove all enemies and bullets
2727 ld (hl),0 ;clear first byte
2728 ld de,enemies+1 ;copy this to the next byte
2729 ld bc,(nrenemies*enemysize)+(nrybuls*4)+(nrebuls*3)-1
2730 ldir ;clear enemies + bullets (y/e)
2732 ;--------------------------- setup game -------------------------------------
2735 cal BLACKLCD ;white on black
2738 ld (_curRow),de ;center
2739 cal _puts ;display "LEVEL "
2741 ld a,(level) ;current level
2744 cal UNPACK_HL ;create first digit
2747 cal UNPACK_HL ;second digit
2749 cal _putc ;display second digit
2751 cal _putmap ;display first digit
2753 ld hl,txt_lives ;bar text: "Lx0"...
2755 ld (_curRow),de ;display lives left below level nr
2757 ld a,(your_lives) ;lives left
2758 add a,'0' ;make value 0='0'
2761 cal releasekeys ;wait for user to release all keys
2762 ld hl,txt_savekey ;"Press [F1] to save"
2763 ld de,$3A46 ;bottom-right
2767 res 3,(iy+5) ;set white on black
2768 cal _getkey ;wait for keypress
2772 cal _clrLCD ;clear screen
2773 cal disp_icons ;display bottom icons +ret
2777 cal RandomY ;a = random y-pos 1..bottom
2778 ld a,b ;a = b = star nr. = 1..7
2779 add a,a ;a = 2b = 2..14
2781 ld e,a ;de = a = 2-14
2783 sbc hl,de ;substract from random y => random pos anywhere
2785 ld (ix),l ;save x-pos (l)
2786 ld (ix+1),h ;save y-pos (h)
2787 inc ix \ inc ix ;next star
2788 dnz placestars ;repeat for all stars
2801 ld (weapdamage),a ;damage of bullets
2804 ld (weapdaminc),a ;damage increase
2807 and %00011111 ;laser duration
2811 ;----------------------------------------------------------------------------
2812 ;--------------------------- putsprite --------------------------------------
2813 ;----------------------------------------------------------------------------
2814 ;in: de=(x,y); ix=sprite
2815 ;out: ix=behind sprite; hl:a=right below sprite; b=0; d=width; ce=?
2818 ld c,(ix) ;save width
2819 _putsprite: ;putsprite with custom width
2821 bit 7,d ;check sign bit of X
2822 jr z,CSpositive ;X>=0
2825 cp (ix) ;off screen?
2826 ret nc ;X<=-width: don't draw at all
2827 ld b,a ;b=|X|mod 8=1..7=bits to draw
2828 ld a,%11111111 ;all bits set (draw everything)
2830 srl a ;remove first bit in a for each b
2831 dnz CSclipleft ;b=1: a=%01111111
2838 res 7,d ;X+128 (right side of screen)
2840 jr CSdisplay ;done clipping
2843 sub 129-8 ;minus (screen width - byte width)
2845 ld a,%11111111 ;clipmask
2846 jr c,CSdisplay ;x+width<128 then entire sprite is on screen
2847 inc b ;b = number of pixels off screen
2849 add a,a ;remove last bit in a for each b
2850 dnz CSclipright ;b=1: a=%11111110
2857 ;b>7: a=%00000000 = off screen
2859 CSdisplay: ;display the sprite ix at (d,e) masked
2860 ld (CSclipmask),a ;set mask
2861 cal findpixel ;convert de to screen location hl:a
2867 psh bc ;save rows to go
2870 ld a,(ix+2) ;load image line
2876 ld a,1 ;saved bitmask
2878 sla c ;test leftmost pixel
2879 jr nc,CSnodraw ;don't draw if it's 0
2880 ld e,a ;psh af: save bitmask
2882 ld (hl),a ;OR pixel with screen
2886 jr nc,CSbitdrawn ;carry set if bit "jumped"
2890 pop hl ;screen at x-offset=0
2892 add hl,bc ;next line
2893 pop bc ;rows counter
2897 ;--------------------------- putbigsprite -----------------------------------
2900 ;destr: abcdehl+ix (ix=behind sprite; hl:a=right below sprite; b=0; d=width)
2903 jr c,putsprite ;width<=8: just draw the sprite
2910 cal _putsprite ;otherwise draw one column (8 pixels wide)
2912 inc ix ;no x-size to load
2914 add a,d ;8 pixels right
2916 pop bc ;then draw the remaining pixels (c=width-8)
2920 safeputsprite: ;cal putsprite with de intact
2926 ;------------------------------- findpixel ----------------------------------
2927 ;based upon CLEM's fp | 131 cycles | 28 bytes | in:(d,e); out:hla; destr:de
2932 add a,a ;add a,a is 7 cycles faster than add hl,hl
2933 ld h,0 ;switch to hl now (Y<64)
2936 rra ;RRA: carry flag must be reset!
2937 add hl,hl ;that's what the adds are for :P
2953 ld de,dispbuffer ;screen base position (where x+y=0)
2958 ;----------------------------------------------------------------------------
2959 ;------------------------------- sprites ------------------------------------
2960 ;----------------------------------------------------------------------------
2963 .db 7,7 ;ship alpha class
2966 .db %01111110 ; ██████
2967 .db %11101000 ;███ █
2968 .db %01111110 ; ██████
2974 .db %11110001 ;████ █
2975 .db %01111111 ; ███████
2976 .db %11101001 ;███ █ █
2977 .db %01111111 ; ███████
2978 .db %11110001 ;████ █
2982 .db 7,7 ;ship beta class
2984 .db %11111000 ;█████
2985 .db %01111100 ; █████
2986 .db %01110010 ; ███ █
2987 .db %01111100 ; █████
2988 .db %11111000 ;█████
2992 .db %11100010 ;███ █
2993 .db %11111001 ;█████ █
2994 .db %01111101 ; █████ █
2995 .db %01110011 ; ███ ██
2996 .db %01111101 ; █████ █
2997 .db %11111001 ;█████ █
2998 .db %11100010 ;███ █
3001 .db 7,7 ;ship gamma class
3002 .db %11111000 ;█████
3004 .db %11111100 ;██████
3005 .db %11100110 ;███ ██
3006 .db %11111100 ;██████
3008 .db %11111000 ;█████
3011 .db %11111010 ;█████ █
3012 .db %01100001 ; ██ █
3013 .db %11111101 ;██████ █
3014 .db %11100111 ;███ ███
3015 .db %11111101 ;██████ █
3016 .db %01100001 ; ██ █
3017 .db %11111010 ;█████ █
3020 .db 7,7 ;ship delta class
3022 .db %11110000 ; ████
3023 .db %11111100 ; ██████
3024 .db %01100010 ; ██ █
3025 .db %11111100 ; ██████
3026 .db %11110000 ; ████
3030 .db %11000010 ; ██ █
3031 .db %11110001 ; ████ █
3032 .db %11111101 ; ██████ █
3033 .db %01100011 ; ██ ██
3034 .db %11111101 ; ██████ █
3035 .db %11110001 ; ████ █
3036 .db %11000010 ; ██ █
3039 .db 8,8 ;XC1701II ship
3042 .db %11110010 ;████ █
3043 .db %01011101 ; █ ███ █
3044 .db %01011101 ; █ ███ █
3045 .db %11110010 ;████ █
3049 auch_bullet = 1 ;damage to you when hit by an enemy bullet
3050 auch_ground = 5 ;the same when you hit the ground/ceiling
3051 auch_collide = 3 ;when you hit an enemy
3052 auch_ecollide = 2*4 ;damage to both the enemy that hit you (skip bit 0/1)
3058 .db %01111100 ; █████
3059 .db %01111100 ; █████
3060 .db %01111100 ; █████
3065 .db %01111100 ; █████
3066 .db %11111110 ;███████
3067 .db %11111110 ;███████
3068 .db %11111110 ;███████
3069 .db %01111100 ; █████
3072 ;-------------------------------- explosions --------------------------------
3078 .db %00111110 ; █████
3079 .db %01010110 ; █ █ ██
3085 .db %01001110 ; █ ▒███
3086 .db %10111110 ; █ █████
3087 .db %01001111 ; █ ▒████
3089 .db %00011010 ; ██ █
3092 .db %10110000 ; █ ██
3093 .db %01001110 ; █ ███
3094 .db %10110101 ; █ ██▒█▒█
3095 .db %01000101 ; █ ▒█▒█
3096 .db %00111110 ; █████
3097 .db %01011010 ; █ ██ █
3100 .db %00101010 ; ▒ █▒█ █
3101 .db %01000110 ; █ ▒██
3102 .db %10110101 ; █ ██ █ █
3103 .db %01100110 ; ██ ██▒
3104 .db %00111100 ; ████▒
3105 .db %01011001 ; █ ██ ▒█
3108 .db %01000000 ; █▒ ▒ ▒
3109 .db %00100101 ; ▒█ █▒█
3110 .db %00010100 ; ▒ ▒█ █ ▒
3111 .db %01000100 ; █▒ █
3112 .db %00010010 ; ▒█▒▒█
3113 .db %10011010 ; █▒ ██ █▒
3117 .db %00100000 ; ▒█ ▒ ▒
3118 .db %00000001 ; ▒ ▒ █
3120 .db %00100010 ; █▒ █
3121 .db %01001000 ; ▒█ ▒█ ▒
3124 .db %00001000 ; ▒ █▒
3125 .db %11000010 ; ██ ▒ █
3127 .db %00100000 ; ▒█ ▒
3128 .db %00000001 ; ▒ ▒█
3129 .db %00110000 ; ▒██▒
3133 .db %00000000 ; ▒▒ ▒
3137 .db %00100100 ; █▒ █
3142 .db %00101100 ; █ ██
3143 .db %00011110 ; ████
3144 .db %00110100 ; ██ █
3150 .db %01011100 ; █ ███
3151 .db %10010111 ;█ █ ███
3152 .db %01000110 ; █ ██
3157 .db %00111100 ; ████
3158 .db %01001111 ; █ ████
3159 .db %10100011 ;█ █ ██
3160 .db %11000110 ;██ ██
3161 .db %01110101 ; ███ █ █
3165 .db %00110110 ; ██ ██
3168 .db %01100001 ; ██ █
3170 .db %01010001 ; █ █ █
3172 ;--------------------------------- bullets ----------------------------------
3175 .db (spr_bullet01-spr_bullet01) ;0
3176 .db (spr_bullet02-spr_bullet01) ;4
3177 .db (spr_bullet03-spr_bullet01) ;8
3178 .db (spr_bullet04-spr_bullet01) ;12
3179 .db (spr_bullet05-spr_bullet01) ;16
3180 .db (spr_bullet06-spr_bullet01) ;20
3181 .db (spr_bullet07-spr_bullet01) ;24
3182 .db (spr_bullet08-spr_bullet01) ;28
3183 .db (spr_bullet09-spr_bullet01) ;32
3184 .db (spr_bullet10-spr_bullet01) ;36
3185 .db (spr_bullet11-spr_bullet01) ;40
3186 .db (spr_bullet12-spr_bullet01) ;44
3187 .db (spr_bullet13-spr_bullet01) ;48
3188 .db (spr_bullet13-spr_bullet01) ;52
3189 .db (spr_bullet13-spr_bullet01) ;56
3190 .db (spr_bullet13-spr_bullet01) ;60
3197 .db %11110000 ;▒████
3204 .db %10110000 ;▒█▒██
3205 .db %10110000 ;▒█▒██
3209 .db %11110000 ;▒████
3214 .db %11111000 ;▒█████
3218 .db %01110000 ; ▒███
3219 .db %11111000 ;▒█████
3220 .db %01110000 ; ▒███
3223 .db %11110000 ;▒████
3224 .db %11111000 ;▒█████
3225 .db %11110000 ;▒████
3229 .db %10111000 ;▒█▒███
3230 .db %01111000 ; ▒████
3234 .db %00111000 ; ▒███
3235 .db %01111100 ; ▒█████
3236 .db %11111100 ;▒██████
3241 .db %11111100 ;▒██████
3242 .db %00111110 ; ▒█████
3243 .db %01111100 ; ▒█████
3248 .db %11111100 ;▒██████
3249 .db %00111110 ; ▒█████
3250 .db %01111110 ; ▒██████
3251 .db %11111100 ;▒██████
3252 .db %00111000 ; ▒███
3255 .db %00111100 ; ▒████
3256 .db %11111110 ;▒███████
3257 .db %01111111 ; ▒███████
3258 .db %00011111 ; ▒█████
3259 .db %01111111 ; ▒███████
3260 .db %11111110 ;▒███████
3261 .db %00111100 ; ▒████
3266 .db %11110000 ; ████
3270 .db 4,3 ;enemy bullets
3272 .db %11110000 ;████▒
3275 ;format:[min.damage] [dam.inc] [000:direction 00000:speed] [offset]
3276 ;damage = min.damage + dam.inc*incs (0<=incs<=6)
3277 ;speed in pixels/frame (>=%10010=forward; <=%01110=backwards)
3278 ;direction: 0=straight forward; 1=up; 2=1/2up; 3=down; 4=1/2down
3282 .db 1,1,%00000000,0,%00000000,0,%00010010,3 ;1 single fire
3283 .db 4,1,%00000000,0,%00000000,0,%00010011,3 ;2 fast single
3284 .db 1,1,%00000000,0,%00010010,0,%00010010,6 ;3 double
3285 .db 1,1,%01110010,2,%10010010,2,%00110010,2 ;4 triple
3286 .db 3,2,%01110011,2,%10010011,2,%00110011,2 ;5
3287 .db 5,3,%01110011,2,%10010100,2,%00110011,2 ;6
3288 .db 7,4,%01110100,2,%10010100,2,%00110100,2 ;7
3289 .db 12,5,%01110110,2,%10010110,2,%00110110,2 ;8
3291 .db 1,1,%11100100,3,%00000000,0,%00000000,0 ;1 single laser
3292 .db 1,1,%11111111,0,%11100000,6,%00000000,0 ;2 double laser
3293 .db 10,1,%11100001,0,%11100000,6,%11100000,3 ;3 triple laser
3296 ;------------------------------------ bar -----------------------------------
3299 .db 5,3 ;li'l ship indicating lives left
3301 .db %01111000 ; ████
3303 lshipsize = 5 ;space between two ship icons
3306 .db 16,7 ;selected.......:.......:
3307 .db %11111111 ;████████████████
3313 .db %11111111 ;████████████████
3323 .db 16,7 ;unused .......:.......:
3324 .db %10101010 ;█ █ █ █ █ █ █ █
3325 .db %11010101 ;██ █ █ █ █ █ █ █
3326 .db %10101010 ;█ █ █ █ █ █ █ █
3327 .db %11010101 ;██ █ █ █ █ █ █ █
3328 .db %10101010 ;█ █ █ █ █ █ █ █
3329 .db %11010101 ;██ █ █ █ █ █ █ █
3330 .db %10101010 ;█ █ █ █ █ █ █ █
3340 .db 16,7 ;torpedo .......:.......:
3341 .db %10000001 ;█ ███ ██ █▒
3342 .db %10000000 ;█ ███ ██ ▒
3343 .db %11000000 ;██ ███ ██▒
3344 .db %10110001 ;█ ██ ███ █ █▒
3345 .db %11001100 ;██ ██ ██ ▒
3346 .db %10110011 ;█ ██ ██ ████ ▒
3347 .db %11001100 ;██ ██ ██ ██ ▒
3357 .db 16,7 ;tailbeam.......:.......:
3359 .db %10000011 ;█ ██ ▒
3360 .db %10000001 ;█ ███ ▒
3361 .db %10111011 ;█ ███ ██████ ██▒
3362 .db %10000001 ;█ ███ ▒
3363 .db %10000011 ;█ ██ ▒
3372 .db 11,7 ;bullets .......:.......:
3373 .db %10000000 ;█ ██ ▒
3374 .db %10000011 ;█ █████ ▒▒▒ ▒
3375 .db %10011000 ;█ ██ ██ ▒▒▒ ▒
3376 .db %11111100 ;██████ ▒▒▒ ▒
3377 .db %10011000 ;█ ██ ██ ▒▒▒ ▒
3378 .db %10000011 ;█ █████ ▒▒▒ ▒
3379 .db %10000000 ;█ ██ ▒
3389 .db 16,7 ;laser .......:.......:
3391 .db %10001010 ;█ █ █ ▒▒▒ ▒
3392 .db %11101100 ;███ ██ ▒▒▒ ▒
3393 .db %11110111 ;████ ███████▒▒▒█▒
3394 .db %11101100 ;███ ██ ▒▒▒ ▒
3395 .db %10001010 ;█ █ █ ▒▒▒ ▒
3403 .db 16,7 ;multiple.......:.......:
3404 .db %10000011 ;█ ███ ▒
3405 .db %10000001 ;█ ████ ██ ▒
3406 .db %10000001 ;█ ████ ▒
3407 .db %10000011 ;█ ███ ▒
3408 .db %10011000 ;█ ██ ▒
3409 .db %10111100 ;█ ████ ██ ██▒
3410 .db %10011000 ;█ ██ ▒
3420 .db 128,128,128,128,128,128,128 ;128 = %10000000
3422 ;---------------------------- texts -----------------------------------------
3424 txt_email: .db "www.shiar.org ",127 ;title screen
3425 .db " shiar0@hotmail.com",0
3426 _txt_email = $3A01 ;$3A1E=just email
3427 txt_about: .db "v0.99.812 ",127," by Shiar",0 ;right behind txt_email
3429 txt_menu1: .db "NEW GAME",0
3430 txt_menu2: .db "CONTINUE",0
3432 txt_level: .db "LEVEL ",0 ;new level screen
3433 txt_lives: .db "Lx0",0
3434 txt_savekey: .db "Press [F1] to save",0
3436 txt_gameover: .db "GAME OVER!",0 ;game over screen
3437 txt_score: .db "Score",0
3438 txt_hiscore: .db "Hiscore",0
3440 txt_pause: .db " ",6,"/",7," ",$1C,"contrast; "
3441 .db "F1",$1C,"B",$CF,5,"W Mode",0
3443 txt_pressenter: .db "Enter to continue",0 ;pause
3444 _txt_pressenter = $0201
3445 txt_teacher: .db "(2",Lpi,"*.98)/sin 13",0 ;teacher
3446 txt_teacherans: .db Lneg,"14.6549373495",0
3448 ;---------------------------- save data -------------------------------------
3451 hiscore .dw 0 ;default hiscore
3452 hiname .db "shiar.99",0 ; " " name
3455 storesave_start: ;--SAVED GAME-- defs:
3456 level .db 1 ;level number 1
3457 levelp .dw level01 ;pointer to level data l01
3458 pickuptimer .db 4 ;counts when to place a pickup 4
3459 your_ship .dw spr_ship01 ;your sprite sprs1
3460 your_score .dw 0 ;current score 0
3461 your_pickup .db 4 ;pickups already picked up 0
3462 your_occ .db 0 ;0=normal 1..16=exploding 0
3463 your_inv .db 0 ;invincibility left 0
3464 your_armor .db 22 ;HP left 12
3465 your_lives .db 3 ;lives left 3
3466 your_weapon .db 8 ;current weapon upgrade 0
3467 your_multiples .db 0 ;multiples present 0
3468 your_tail .db 0 ;tail beam present 0
3471 time2invert: .db 0 ;time until b<>w switch (0 at startup)
3473 ;------------------------------ levels data ---------------------------------
3475 ;format:boss: [moveType] [enemyType]
3476 ; @level: [nr.dif.enemies]x [enemy nr]
3477 ; [min. enemy frequency] [enemy frequency max.inc] [next lvl]
3478 ; [level_info: 0000:damage 0:diagfire 0:ground 0:ceiling 0:?]
3479 ; [level_move] [tunnel size] [groundtype] [stars1] [stars2]
3480 ;efrequency must be odd if halfluring!
3483 level00: ;[y-pos] [x-pos] [text,0] [SFX lines; 0=more text] [-1=end]
3484 .db 25,33,"Imperial ships have",0,0
3485 .db 31,9,"been sent to intercept you",0,31-25+6,-1
3487 .db 20 ;boss for level01
3488 level01: ;intro-like, just a few enemies to begin with
3490 .db 26,70,20,%00010000,0,0,0
3494 level02: ;first wave of enemies; easeey
3496 .db 20,60,60,%00100000,0,0,0
3500 level03: ;some more enemies
3502 .db 17,40,75,%00110000,0,0,0
3506 .db 1,1,"Long-Range scanners are ",
3508 .db 8,1,"lots of enemy vessels ",
3509 .db "advancing fast.",0,8-1+6
3510 .db 24,1,"I'm changing course to a",
3512 .db 31,1,"asteroid belt and try to",0,0
3513 .db 38,1,"lose them inthere.",0,38-24+6,-1
3516 level04: ;approaching asteroid belt
3517 .db 7,11,11,12,12,13,1,2
3518 .db 12,24,80,%00111000
3522 level05: ;light asteroid belt
3524 .db 12,24,80,%00111000
3528 level06: ;inside asteroid belt
3530 .db 7,18,180,%01011000
3533 .db 0,1,1,"That's it for now...",0,5,-1
3538 .db 1,1,"And the storyline conti",
3540 .db 9,1,"You decide to fly close",
3542 .db 15,1,"surface of a nearby pl",
3543 .db "anet =)",0,15-9+6,-1
3548 .db $13,40,$4b,%00100100,0,-5,1
3554 .db $01,01,"Blablabla...",0,1
3555 .db $01,34,"this storyline sux",0,0,1,39
3561 .db $2d,$3f,%00110110,0,-9,1
3562 .db -1,-1 ;=%11111111=line
3567 .db $11,$41,%00100001,0,0,0
3572 .db $11,$45,%00100101,%10,-7,1
3577 .db $19,$3a,%00100111,0,-4,1
3583 .db $09,$ff,%00100001,0,0,0
3586 ;------------------------------ enemies -------------------------------------
3588 ;format: [HP64] [000000:HP 00:occ] [sprite] [xpos] [appearance(ypos)]
3589 ; [movetype] [time2fire] [firefreq] [firetype]
3590 ;appearances: 1=random; 2=lure; 3=halflure
3591 ;movetypes: 1=updown; 2=1/4x; 3=1/2x; 4=1.5x; 5=2x; 6=smart; 7=y-lure;
3592 ; 8=y-lure 1/2x; 9=x; 10=x+y-lure 1/2x
3593 ;firetypes: 1=normal; 6=aiming; 7=triple; 8=double
3596 .db 0,%00000110,(spr_enemy00-spr_enemy00)/2,128,2,03, 0, 0,1 ;pickup
3597 ;1-5=asteroids , , , , , ,
3598 .db 0,%00100110,(spr_enemyA1-spr_enemy00)/2,128,1,00, 0, 0,1
3599 .db 0,%00111110,(spr_enemyA2-spr_enemy00)/2,128,1,00, 0, 0,1
3600 .db 0,%01011010,(spr_enemyA3-spr_enemy00)/2,128,1,04, 0, 0,1
3601 .db 1,%00001010,(spr_enemyA4-spr_enemy00)/2,128,1,03, 0, 0,1 ;slow+hard
3602 .db 0,%00111110,(spr_enemyA4-spr_enemy00)/2,128,1,05, 0, 0,1
3603 ;6-10=basic enemies , , , , , ,
3604 .db 0,%00010010,(spr_enemyE1-spr_enemy00)/2,128,1,00,10, 0,1 ;weak
3605 .db 0,%00110010,(spr_enemyE4-spr_enemy00)/2,128,1,03, 6,50,1 ;slow
3606 .db 0,%00100110,(spr_enemyE2-spr_enemy00)/2,128,1,00, 1, 0,1
3607 .db 0,%00101110,(spr_enemyE3-spr_enemy00)/2,128,3,00,19,39,8 ;heavy
3608 .db 0,%00101010,(spr_enemyE5-spr_enemy00)/2,128,3,04, 1, 0,1 ;fast
3609 ;11-13=backwards enemies , , , , ,
3610 .db 0,%00011110,(spr_enemyB1-spr_enemy00)/2,000,3,11,19,92,1
3611 .db 0,%00101110,(spr_enemyB2-spr_enemy00)/2,000,1,12,11,45,1
3612 .db 0,%00110110,(spr_enemyB3-spr_enemy00)/2,000,1,11,10,41,8 ;small
3613 ;14=improved enemies , , , , , ,
3614 .db 0,%01001010,(spr_enemyG1-spr_enemy00)/2,128,3,00, 1,35,1
3616 .db 0,%00000011,(spr_enemy00-spr_enemy00)/2,128,0,00, 0, 0,1 ;15
3617 .db 0,%00000011,(spr_enemy00-spr_enemy00)/2,128,0,00, 0, 0,1 ;16
3618 .db 0,%00000011,(spr_enemy00-spr_enemy00)/2,128,0,00, 0, 0,1 ;17
3619 .db 0,%00000011,(spr_enemy00-spr_enemy00)/2,128,0,00, 0, 0,1 ;18
3620 .db 0,%00000011,(spr_enemy00-spr_enemy00)/2,128,0,00, 0, 0,1 ;19
3621 ;20-23=first bosses , , , , , ,
3622 .db 1,%00101011,(spr_boss2 -spr_enemy00)/2,127,1,08,20,12,1 ;small
3623 .db 1,%00110011,(spr_boss1 -spr_enemy00)/2,127,1,08,15,11,8 ;normal
3624 .db 1,%01001011,(spr_boss1 -spr_enemy00)/2,127,3,10,10,11,1 ;moving
3625 .db 0,%11111111,(spr_boss3 -spr_enemy00)/2,127,2,10, 1, 4,1 ;weak+rapidfire
3626 ;24-25=asteroid bosses , , , , , ,
3627 .db 2,%00001011,(spr_bossA1 -spr_enemy00)/2,127,1,10,36,14,6
3628 .db 2,%00110011,(spr_bossA1 -spr_enemy00)/2,127,2,10,28,12,6
3629 ;26-27=big bosses , , , , , ,
3630 .db 2,%00000111,(spr_bossB1 -spr_enemy00)/2,127,3,07,18, 7,7
3631 .db 2,%01001011,(spr_bossB2 -spr_enemy00)/2,127,3,07,18, 7,7
3635 .db %11111111 ; ████████████
3636 .db %10000110 ; █ ██ █
3637 .db %10000110 ; █ ██ █
3638 .db %10111111 ; █ ████████ █
3639 .db %10111111 ; █ ████████ █
3640 .db %10000110 ; █ ██ █
3641 .db %10000110 ; █ ██ █
3642 .db %11111111 ; ████████████
3655 .db 7,6 ;asteroid one
3657 .db %01101100 ; ██ ██
3658 .db %10011110 ;█ ████
3659 .db %11111010 ;█████ █
3660 .db %10111100 ;█ ████
3663 .db 8,7 ;asteroid two
3664 .db %00111100 ; ████
3665 .db %01011010 ; █ ██ █
3666 .db %01101101 ; ██ ██ █
3667 .db %11111101 ;██████ █
3668 .db %11111111 ;████████
3669 .db %10110110 ;█ ██ ██
3673 .db 8,8 ;asteroid three
3674 .db %00011110 ; ████
3675 .db %01110011 ; ███ ██
3676 .db %01111101 ; █████ █
3677 .db %10110111 ;█ ██ ███
3678 .db %11111110 ;███████
3679 .db %11111101 ;██████ █
3680 .db %01010111 ; █ █ ███
3683 .db 7,6 ;asteroid four
3684 .db %01111000 ; ████
3685 .db %10110110 ;█ ██ ██
3686 .db %11111101 ;██████ █
3687 .db %01111011 ; ████ ██
3688 .db %01001110 ; █ ███
3693 .db %00111100 ; ████
3695 .db %10111000 ;█ ███
3697 .db %10111000 ;█ ███
3699 .db %00111100 ; ████
3703 .db %00111100 ; ████
3708 .db %00111100 ; ████
3710 .db 6,6 ;normal solid (Galaxian enemy)
3711 .db %00111100 ; ████
3716 .db %00111100 ; ████
3720 .db %01101000 ; ██ █
3724 .db %01101000 ; ██ █
3730 .db %01111000 ; ████
3733 .db %01111000 ; ████
3737 .db 6,6 ;solid backwards
3740 .db %01010100 ; █ █ █
3741 .db %01010100 ; █ █ █
3748 .db %01110100 ; ███ █
3750 .db %01110100 ; ███ █
3758 .db %01111000 ; ████
3760 .db %01111000 ; ████
3767 .db %00111111 ; █████
3769 .db %10110100 ;█ ██ █
3770 .db %10110100 ;█ ██ █
3772 .db %00111111 ; █████
3774 .db 8,6 ;smaller nacelles
3776 .db %01101100 ; ██ ██
3777 .db %10110100 ;█ ██ █
3778 .db %10110100 ;█ ██ █
3779 .db %01101100 ; ██ ██
3783 .db %00001111 ; ████
3784 .db %01111100 ; █████
3785 .db %10011100 ;█ ███
3786 .db %10011100 ;█ ███
3787 .db %01111100 ; █████
3788 .db %00001111 ; ████
3790 .db 8,6 ;G-Type solid
3791 .db %00111111 ; █████
3792 .db %01111000 ; ████
3793 .db %11111100 ;██████
3794 .db %11111100 ;██████
3795 .db %01111000 ; ████
3796 .db %00111111 ; █████
3799 .db %01111100 ; █████
3801 .db %10111000 ;█ ███
3802 .db %10111000 ;█ ███
3804 .db %01111100 ; █████
3806 .db 7,6 ;small G-type solid
3807 .db %00011110 ; ████
3808 .db %01111000 ; ████
3811 .db %01111000 ; ████
3812 .db %00011110 ; ████
3817 .db %01111100 ; █████
3818 .db %11111000 ; █████
3819 .db %11111000 ; █████
3820 .db %01111100 ; █████
3823 .db 7,6 ;some attack vessel
3825 .db %01110010 ; ███ █
3826 .db %10101100 ; █ █ ██
3827 .db %10101100 ; █ █ ██
3828 .db %01110010 ; ███ █
3831 .db 7,6 ;interceptor
3832 .db %00011110 ; ████
3833 .db %01111110 ; ██████
3834 .db %11111100 ; ██████
3835 .db %11111100 ; ██████
3836 .db %01111110 ; ██████
3837 .db %00011110 ; ████
3839 .db 8,6 ;cheap intercept
3840 .db %00011011 ; ██ ██
3841 .db %01110110 ; ███ ██
3842 .db %10111100 ; █ ████
3843 .db %10111100 ; █ ████
3844 .db %01110110 ; ███ ██
3845 .db %00011011 ; ██ ██
3848 .db 8,7 ;some cool Nemesis-MSX enemy
3849 .db %00111110 ; █████
3850 .db %11110001 ;████ █
3852 .db %00010101 ; █ █ █
3854 .db %11110001 ;████ █
3855 .db %00111110 ; █████
3859 .db %00111110 ; █████
3860 .db %00011101 ; ███ █
3861 .db %11111111 ;████ ███
3862 .db %01110110 ; ██ ███
3863 .db %11111111 ;████ ███
3864 .db %00011101 ; ███ █
3865 .db %00111110 ; █████
3868 .db 8,7 ;Nem3MSX jumper lvl#3
3869 .db %10111110 ;█ █████
3870 .db %01011101 ; █ ███ █
3871 .db %01111110 ; ██████
3873 .db %01111110 ; ██████
3874 .db %01011101 ; █ ███ █
3875 .db %10111110 ;█ █████
3878 .db 8,8 ;Stolen from XC1701II
3879 .db %01111110 ; ██████
3880 .db %11110101 ;████ █ █
3881 .db %00011111 ; █████
3882 .db %00111101 ; ████ █
3883 .db %00111001 ; ███ █
3884 .db %00011111 ; █████
3885 .db %11110101 ;████ █ █
3886 .db %01111110 ; ██████
3888 .db 7,8 ;Stolen from XC1701II
3889 .db %00111100 ; ████
3890 .db %01010010 ; █ █ █
3891 .db %11111110 ;███████
3892 .db %01001010 ; █ █ █
3893 .db %01011010 ; █ ██ █
3894 .db %11111110 ;███████
3895 .db %01010010 ; █ █ █
3896 .db %01111100 ; ████
3899 .db 16,10 ;.......:.......:
3900 .db %00000001 ; ██████ ██
3901 .db %00001110 ; ███ █ ███
3902 .db %00110010 ; ██ █ ████
3903 .db %01001101 ; █ ██ ██
3904 .db %11101011 ;███ █ ██ █
3905 .db %11101011 ;███ █ ██ █
3906 .db %01001101 ; █ ██ ██
3907 .db %00110010 ; ██ █ ████
3908 .db %00001110 ; ███ █ ███
3909 .db %00000001 ; ██████ ██
3923 .db 12,12 ;.......:....5..:
3924 .db %00011110 ; ████
3925 .db %01100001 ; ██ ██
3926 .db %10110010 ;█ ██ █ ██
3927 .db %00000101 ; █ ██ █
3928 .db %00001010 ; █ █ ██
3929 .db %00011010 ; ██ █ █ █
3930 .db %00011010 ; ██ █ █ █
3931 .db %00001010 ; █ █ ██
3932 .db %00000101 ; █ ██ █
3933 .db %10110010 ;█ ██ █ ██
3934 .db %01100001 ; ██ ██
3935 .db %00011110 ; ████
3949 .db 16,10 ;.......:.......:
3950 .db %11111110 ;███████
3951 .db %00000011 ; ███ ████
3952 .db %00110101 ; ██ █ ████ █
3953 .db %01111010 ; ████ █ █ █ ██
3954 .db %10001101 ;█ ██ █ ██ ██ █
3955 .db %10001101 ;█ ██ █ ██ ██ █
3956 .db %01111010 ; ████ █ █ █ ██
3957 .db %00110101 ; ██ █ ████ █
3958 .db %00000011 ; ███ ████
3959 .db %11111110 ;███████
3971 .db 16,11 ;AsteroidBoss one
3972 .db %00011110 ; ████
3973 .db %01110011 ; ███ ███
3974 .db %01111111 ; ███████ █
3975 .db %01111111 ; █████████
3976 .db %11111110 ;███████ ███
3977 .db %11111111 ;███████████
3978 .db %11111111 ;████████████
3979 .db %10111110 ;█ █████ ████
3980 .db %01011111 ; █ ███████
3981 .db %00110111 ; ██ ███
3995 .db 16,18 ;BigBoss one :
3997 .db %00000111 ; ███ ███
3998 .db %00000011 ; ████ █
3999 .db %00000001 ; ██ ██
4000 .db %00000011 ; ███ ██
4001 .db %00000000 ; █████
4002 .db %00010111 ; █ ██████████
4003 .db %00111111 ; ██████ ██ ██
4004 .db %11111000 ;█████ ██ █ ███
4005 .db %00001111 ; █████ ██ █ █
4006 .db %11111000 ;█████ ██ █ ███
4007 .db %00111111 ; ██████ ██ ██
4008 .db %00010111 ; █ ██████████
4009 .db %00000000 ; █████
4010 .db %00000011 ; ███ ██
4011 .db %00000001 ; ██ ██
4012 .db %00000011 ; ████ █
4013 .db %00000111 ; ███ ███
4015 .db %01010000 ;modelled after a Nemesis][MSX boss
4035 .db 16,15 ;BigBoss two :
4036 .db %00001111 ; █████
4037 .db %00111110 ; █████ █████
4038 .db %01111101 ; █████ █ ███████
4041 .db %00000011 ; █████
4042 .db %00011110 ; ████ ██ ████
4043 .db %11110011 ;████ ██ █ █
4044 .db %00011110 ; ████ ██ ████
4045 .db %00000011 ; █████
4048 .db %01111101 ; █████ █ ███████
4049 .db %00111110 ; █████ █████
4050 .db %00001111 ; █████
4051 .db 15 ;modelled after a Nemesis][MSX boss
4069 ;----------------------------------------------------------------------------
4070 ;----------------------------- logo ------------------------------------------
4071 ;----------------------------------------------------------------------------
4074 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111110
4075 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11111100
4076 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11111000
4077 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11110000
4078 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
4079 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
4080 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
4081 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
4082 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
4083 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
4084 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
4085 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
4086 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
4087 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
4088 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
4089 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
4090 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
4091 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
4092 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
4094 ;----------------------------- end ------------------------------------------
4100 ;----------------------------------------------------------------------------
4101 ;----------------------------------------------------------------------------
4102 ;----------------------------------------------------------------------------
4104 ; 0.98.77 -- 7.VII.00 -- size 6707
4106 ; # bullets do damage in all levels
4107 ; * more armor at armor-upgrade and extra armor at end of a level
4108 ; - internal levels again (no need 4 external, safer/smaller)
4109 ; # some registers not correctly pushed/popped
4110 ; * several optimizations (init.procs some bytes smaller)
4111 ; # enemies hit with hitpoints left disappeared (one pop too much...)
4112 ; + bullets "charge up" (more damage) when not firing
4113 ; - removed contrast changes
4114 ; + more powerful bullets have different sprites (larger=more damage)
4115 ; # multiples appear at your position (begin level/just selected)
4116 ; # when invulnerable multiples acted weird
4117 ; # no more error at activation after APD off after running Nemesis
4118 ; # saves correctly if own name ain't "nemesis" + some bytes smaller
4119 ; # screen wasn't always entirely cleared after quit
4120 ; * waits until all keys have been released after death
4121 ; + different bullets sizes will miss if they're too small
4122 ; + at level start "press F1 to save"-text will be displayed
4123 ; * w3.shiar.org displayed at title screen, black bar behind version nr
4124 ; # score to 0 when exit pressed at main menu
4125 ; # no residual story-text in first frame of game
4126 ; # game doesn't continue again after death (stack messed up)
4127 ; # game over when lives<0 (didn't work in v0.96+)
4128 ; * using some self-modifiing code (so it's smaller)
4129 ; # new random procedure: stars don't appear on one line anymore
4130 ; * weapons appear centered at multiples
4131 ; * laser properties can be changed (damage, charge)
4132 ; + weapon can be combination of bullets/lasers (max. of 3 per weapon)
4133 ; * bullet-icon is removed when laser is selected
4134 ; * enemy sprite table integrated in enemy specs (-1 byte/enemy)
4135 ; + random enemy is chosen from any number of enemies per level
4136 ; * time to first enemy fire defined per enemy, not per level
4137 ; + CLIPPED sprites!! no more in/out popping enemies! wow...
4138 ; * bullets/enemies removed when _entirely_ off screen
4139 ; # enemies would sometimes be hit by bullets going right below them
4140 ; # size of the second bullet was too big (invisible hit)
4141 ; * the frequency an enemy fires bullets is defined per enemy
4142 ; + wide clipped sprites implemented (width 1-16 pixels)
4143 ; # bosses first move left until x=100, otherwise they'd be off-screen
4144 ; * at status bar left below ships are displayed for lives left
4145 ; * armor bar is two pixels high (better visible)
4146 ; # bullet overflow fixed again (>63 bullets fired)
4147 ; # correct weapon loaded when continuing a saved game
4148 ; # game freezed when generating a random value <=1
4149 ; * you explode in a different way than the enemies
4150 ; + screen inverts for a brief time when you are hit!
4151 ; # stats-bar was messed up when ya got 0 lives left
4152 ; * two new (big) bosses modeled after a common MSX Nemesis2-boss
4153 ; * score increased once every 32 frames (instead of every 256)
4154 ; # ground fixed for new random routine (smaller routine; incs -2 to 2)
4155 ; + laser will upgrade as well when you reselect it
4156 ; * 2nd can be used in main menu (wow!)
4157 ; # altered variable storage space because of Nemesis grew beyond 6kb
4158 ; # fixed armor bar display when at maximum
4159 ; + a few new enemies (asteroids) and remade 1st 4 levels; new pickup
4160 ; - torpedo since it was kinda useless
4161 ; + second icon now selects TAIL BEAM: bullet going backwards
4162 ; # armor increase at the end of a level doesn't overflow armorbar
4163 ; + you can choose your own ship out of four vessel after NEW GAME!
4164 ; + enemies can appear at any x-position and move both left and right
4165 ; + move patterns given per enemy, not per level
4166 ; * new (faster) enemy-move system; 10 basic moves (x2 left+right)
4167 ; # enemies can _never_ move above or below visible screen
4168 ; * "randomY"-enemies are placed entirely on screen (height calced)
4169 ; # the major TI-OS crash bug WAS afterall caused by sprites drawn
4170 ; (partially) outside screen memory. temporarily fixed by setting
4171 ; virtual screen buffer to $8200 (enough mem there)
4172 ; + upto 29 cool enemy sprites and redone first five levels
4173 ; * improved enemy-move routine; smooth luring, five speeds+backwards
4174 ; # after pause weapon will not be fired
4175 ; # teacher key fixed (waits for GRAPH to be release before&after)
4177 ; 0.99.815 -- 15.VIII.00 -- size 6399
4179 ; + you can have upto FOUR multiples! (~20 pixels apart)
4180 ; * some optimizations: keycall, menu handling, port nops removed,
4181 ; more SMC, fire handling, fast bullet handling, enemy movement
4182 ; * better "backwards" enemies handling (and implemented in game)
4183 ; # when enemy changed into a pickup, movement is set to vslow
4184 ; * instead of turning into a pickup, enemies explode and a pickup
4185 ; appears at the right side of the screen (moves left slowly)
4186 ; # bullets do damage again (screenflash made damage become 0)
4187 ; + when destroyed by bullets, the armor bar will show 0HP left
4188 ; * all enemy bullets do the same damage in all levels
4189 ; * you now appear at (*32*,30) because enemies can come from left
4190 ; * improved bullet handling (faster, smaller, etc.)
4191 ; + multiples are animated like real Nemesis (grow-shrink-grow-shrink>)
4192 ; # fixed a bug that didn't select multiples when you were moving
4193 ; # enemy collision screwed up invert and some other weird stuff
4194 ; + in pause screen change contrast with up/down and B/W mode with F1
4195 ; + lasers can have different durations (beams last longer)
4196 ; * some sign-flag checkings replaced by carry-flag (thus reducing size)
4197 ; # slow enemies (including pickups) didn't always appear (just 25-50%)
4198 ; + enemies can fire different kinds of bullets: aiming, double, triple
4199 ; * maximum number of bullets increased (48 for enemies, 128 for you)
4201 ; + added - removed * changed # bug fixed
4203 ;bullet handling: (255/enemy)+419+putsprite cycles per bullet