1 ;-----------------------------------------------------------------------------
2 ;---------------------------- N E M E S I S --------------------------------
3 ;------------------------------------------------ cool arcade-shoot-em-up-game
5 ; --------- Version - 1.01.314 ---------
6 ; --------- Release Date - 2002 March 14 ---------
7 ; --------- Author(s) - Shiar ---------
8 ; --------- Email Address - nemesis@shiar.org ---------
9 ; --------- Web Page - www.shiar.org ---------
10 ; --------- Description - cool shoot-em-up arcade ---------
11 ; --------- Where to get this game - shiar.org ---------
12 ; --------- Other games by author(s) - Wormy ---------
14 ; ----------------------------------------------------------------------
15 ; --- This source should only be used for learning practises, do not ---
16 ; --- alter it, and certainly never distribute an altered version!! ---
17 ; ----------------------------------------------------------------------
19 ;---------------------- nemesis.z80 start ------------------------------------
23 #define cal call ;just to make it harder for you to understand
24 #define rcl call ;RemoteCaLl / RomCalL
25 #define rjp jp ;RomJumP
26 #define dnz djnz ;Dec&Jump while NonZero becomes Do w.Non-Zero
27 #define psh push ; >:->
29 #ifdef TI83 ;-----------------------------------------------------------------
30 #include "ion.inc" ;standard TI-83 ROMcalls (Ion shell)
36 #define teacherkey ;compiled with teacher key: 92 bytes extra
38 VIDEO_MEM = plotsscreen
39 dispbuffer = VIDEO_MEM ;virtual screen (MUST be mod$400=0!!)
41 BUSY_OFF = _indicatorOff
45 ;_clrLCD = _clrlcdf ;clears screen
46 _clrScrn = _clrscrf ;also clears TEXT_MEM
48 GET_KEY = $4014 ;_getcsc
51 UNPACK_HL = $4008 ;_divhlby10
68 storepos = saferam2 ;<1024 bytes needed to store things
74 Title: .db "Nemesis 83 TEST by SHIAR",0
75 #endif ;----------------------------------------------------------------------
78 #ifdef TI85 ;-----------------------------------------------------------------
79 #include "usgard.h" ;usgard shell
83 ;#define clearbuffer ;clears the display buffer after usage
84 ;#define fixkeys ;fixes left+down bug: 47 bytes extra size
85 ;#define teacherkey ;compiled with teacher key: 92 bytes extra
86 ;#define story ;storyline shown (w/ neat effect): 871 bytes
87 ;#define shiscore ;save hiscore/savegame
90 dispbuffer = $8400 ;$C9FA ;virtual screen (MUST be mod$400=0!!)
92 ;_clrWindow = $4a86 ;_clrLCD and _clrScrn
93 ;_ex_ahl_bde = $45f3 ;exchange values between AHL and BDE
94 ;_shracc = $4383 ;like _shlacc but just the opposite :P
95 ;_dispahl = $4a33 ;display value in ahl <100000 (cheap TI)
96 ;_asapvar = $d6fc ;our own variable name (likely "nemesis")
98 storepos = TEXT_MEM ;<1024 bytes needed to store things
102 Title: .db "Nemesis 85 Alpha" ;Usgard description
103 ; .db " - 4 Nunome",0 ;present
104 .db " by SHIAR",0 ;author
105 #endif ;----------------------------------------------------------------------
108 #ifdef TI86 ;-----------------------------------------------------------------
110 #include "ti86asm.inc" ;standard ti86 romcalls
111 #include "ti86abs.inc" ;used to save hiscores and stuff
115 ;#define clearbuffer ;clears the display buffer after usage
116 #define fixkeys ;fixes left+down bug: 47 bytes extra size
117 #define teacherkey ;compiled with teacher key: 92 bytes extra
118 ;#define story ;storyline shown (w/ neat effect): 871 bytes
119 #define shiscore ;save hiscore/savegame
122 dispbuffer = $8400 ;$C9FA ;virtual screen (MUST be mod$400=0!!)
124 _clrWindow = $4a86 ;_clrLCD and _clrScrn
125 _ex_ahl_bde = $45f3 ;exchange values between AHL and BDE
126 _shracc = $4383 ;like _shlacc but just the opposite :P
127 _dispahl = $4a33 ;display value in ahl <100000 (cheap TI)
128 _asapvar = $d6fc ;our own variable name (likely "nemesis")
130 storepos = _asm_exec_ram+7800 ;<1024 bytes needed to store things
131 ;$F5C0..F9C0 (safe mem D748..FA6F)
135 nop ;hello yas/ase/rascall/whathever
136 jp init ;here's the program, but first: a description
137 .dw $0001 ;description type 2 (description + YASicon)
138 .dw Title ;pointer to description (all shells)
139 .dw Icon ;pointer to YAS icon
141 Title: .db "Nemesis v1.0.C21" ;Ashell/Rascall/YAS/any shell description
142 ; .db " - 4 Nunome",0 ;present
143 .db " by SHIAR",0 ;author
145 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 7bytes
148 .db %00111110 ; █████
149 .db %01111001 ; ████ █
150 .db %00111110 ; █████
152 .db %11100000 ; ███ ;recommend 80x50 screen mode
153 .db 0 ;YAS 0.92 compatibility
154 #endif ;----------------------------------------------------------------------
156 ;---------------------- in-game vars -----------------------------------------
158 just_fired = storepos ; +0 ;counts how long a blast lasts
160 hiscorepos = storepos ; +0 ;entering hiscore name
163 x = storepos+1 ; +1 ;your ship's position
164 y = x+1 ; +2 ;your y-pos
165 firex = y+1 ; +3 ;(1 byte)
166 firey = firex+1 ; +4 ;(1 byte)
168 eventleft = firey+1 ; +5 ;nr. of enemies still to come
169 level_enemy = eventleft+1 ; +6 ;enemy type
170 level_info = level_enemy+1 ; +7 ;ground (%0) present
171 spacespace = level_info+1 ; +8
172 stars1 = spacespace+1 ; +9 ;slow stars byte (<< %1)
173 stars2 = stars1+1 ; +10 ;fast stars byte (<<< %1)
174 groundpos = stars2+1 ; +11 $10
176 starx1 = groundpos+16 ; +27 ;20
178 starx2 = starx1+(nrstars1*2) ; +47 ;20
180 mm = 4 ;max. number of multiples
181 your_prevpos = starx2+(nrstars2*2) ; +67 ;14*mm+2 ;previous positions
184 enemies = your_prevpos+(mm*14+4);+125 ;info about each enemy
185 enemysize = 11 ;infobytes per enemy
186 nrenemies = 16 ;max. nr of enemies
189 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,damg,x,y)
194 ebullets = ybullets+(nrybuls*4) ;+813 ;30 bytes = 10(state,x,y)
196 lvlenemies = ebullets+(nrebuls*3) ;-957
199 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 1X=normal)]
200 ; [ship sprite (DW!) or explosion frame] [x] [y] [movetype]
201 ; [movecounter] [firecounter] [firefreq] [firetype]
203 ;---------------------------- save data --------------------------------------
207 hiscore .dw 0 ;default hiscore
208 hiname .db "by shiar",0,0 ; " " name
212 invertmode: cpl ;/or a ;saves B<>W mode setting cpl
214 storesave_start: ;--SAVED GAME-- defs:
215 your_ship .dw spr_ship03 ;your sprite (^invertmode^) sprs1
216 level .db 4 ;level number 1
217 levelp .dw level05 ;pointer to level data lev00
218 pickuptimer .db 4 ;counts when to place a pickup 4
219 your_score .dw 0 ;current score 0
220 your_pickup .db 3 ;pickups already picked up 0
221 your_occ .db 0 ;0=normal 1..16=exploding 0
222 your_shield .db 0 ;invincibility left 0
223 your_armor .db 24 ;HP left 24
224 your_lives .db 3 ;lives left 3
225 your_weapon .db 3 ;current weapon upgrade 0
226 your_multiples .db 0 ;multiples present 0
227 your_extra .db 0 ;extra beam present 0
228 hardcore .db 0 ;hardcore mode if non-0 0
231 time2invert: .db 0 ;time until b<>w switch (0 at startup)
233 ;---------------------- init -------------------------------------------------
236 int_handler: ;new interrupt proc
237 ex af,af' ;just af only (no need for exx)
238 in a,($03) ;read bit 3 port 3
239 bit 3,a ;is ON key pressed?
240 jp z,$0039 ;no: np, return
241 res 0,a ;yes: then we have a problem (freeze), so...
242 out ($03),a ;...mask the ON key interrupts!
243 jp $0039 ;all done, return
244 int_end: ;(size 15 bytes)
247 init: rcl BUSY_OFF ;turns the run-indicator off, obviously
250 res 6,(iy+9) ;TI-83 uses statmem
251 set textwrite,(iy+20) ;write text to gbuf
255 res 2,(iy+13) ;don't scroll the screen
256 rcl _flushallmenus ;remove TI-86 menus
257 rcl _clrScrn ;clean the screen
270 FixKeys: ;fixes some key problems like left+down bug
275 ld l,c ;ld hl,$D400 (user silent link routine space)
280 ldir ;fill $D400-D500 with $D3s (slink/user on)
281 ld hl,int_handler ;new interrupt handler
284 ld bc,int_end-int_handler
285 ldir ;load new handler at ($D3D3)
291 ;---------------------- main menu --------------------------------------------
294 xor a ;white bitmask (a=0)
295 ld hl,logo_nemesis ;from...
296 ld de,VIDEO_MEM+scrwidth;...to one line from top
298 ld b,e ;ld b,16: one line
303 ld (de),a ;clear/n byte
305 dnz AboveLogo ;repeat for the first line
306 ld bc,scrwidth*19 ;logo size
307 ldir ;display one line of logo
309 ld hl,scrwidth*$33+VIDEO_MEM ;$33 rows down
310 ld b,scrwidth*7 ;draw black 7 lines
311 ld a,%11111111 ;horizontal line mask
313 ld (hl),a ;draw one piece of the divider-line
314 inc hl ;move right (8 pixels = 1 byte)
315 dnz underline ;repeat
317 cal fastCopy ;draw buffer on screen
320 ld hl,_txt_email ;at the very bottom of tha screen
322 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
323 rcl _vputs ;VERY important, so display in small font ?:}
325 set 3,(iy+5) ;set white on black
326 ld de,_txt_about ;near the bottom of the screen
327 ld (_penCol),de ;hl=txt_email++=txt_about
328 rcl _vputs ;display version + me
329 res 3,(iy+5) ;return to default black on white
334 ld hl,txt_menu1 ;NEW GAME
338 ld hl,txt_menu2 ;CONTINUE GAME
342 ld a,0 ;current menu item (0 or 1); 0 by default
344 ld h,$01 ;selector (*) x-coord. = 1
346 ld l,a ;y-coord. = sel menu item + 4 = 4/5
347 ld (_curRow),hl ;set position
349 rcl _putmap ;mark selected menu item
352 xor 1 ;invert (4=5; 5=4)
353 ld (_curRow),a ;set new row position
354 ld a,32 ;' ' (empty, just remove any * present)
357 cal getsomekeys ;read keys (z if enter/2nd pressed)
359 jr z,start_tha_freakin_game
361 jr z,menuexit ;exit goes to the g/o screen (first score=0)
363 jr z,menuchange ;up changes selected menu item
364 cp K_DOWN ;down as well
365 jr nz,menuloop ;anything else just loops
367 ld a,(hl) ;(menuitem)
369 ld (hl),a ;set new menu item
370 jr menuloop ;continue looping
372 start_tha_freakin_game:
373 ld a,(hl) ;(menuitem)
374 dec a ;new game=0; so that gives -1 = NZ
375 jp nz,New_game ;NEW GAME
376 jp samelevel ;CONTINUE: game_main_loop
380 ld (your_score),hl ;(prevents hiscore while never played)
381 jp game_over ;and go to game over screen
383 do_invert: ;invert screen (b<>w)
385 psh af ;can't destroy b
388 xor (hl) ;$2F (cpl) <-> $B7 (or a)
396 ld hl,invertmode ;change invert mode (will be stored)
398 xor (hl) ;$2F (cpl) <-> $B7 (or a)
402 psh hl ;dest (invertmode)
403 ld hl,4+invertmode-_asm_exec_ram
408 ;-----------------------------------------------------------------------------
409 ;---------------------- game loop --------------------------------------------
410 ;-----------------------------------------------------------------------------
412 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
413 ld hl,timer ;update time
414 inc (hl) ;increase by 1
417 ld hl,dispbuffer ;move from (hl) = top left
418 ld (hl),0 ;first pixel will be copied all over the screen
419 ld de,dispbuffer+1 ;(de) = next pixel, thus clearing whole screen
420 ld bc,scrwidth*56-1 ;loop 896 times = (128/8) * (64-8 for scorebar)
423 ld a,0 ;current frame/turn 0-255
425 and %11 ;a=0 once every 4 turns
426 jr z,movestarsdone ;don't move stars once every 4 frames
427 cal movestars1 ;move the stars on the FRONT layer
428 cal movestars2 ;move the distant stars
430 ld a,(stars1) ;star positions (the missing byte...)
431 ld b,nrstars1 ;how many stars? now we know.
432 ld hl,starx1 ;points to the position of the stars
433 cal DisplayStars ;display front layer stars
434 ld a,(stars2) ;weren't you paying attention five lines ago?
435 ld b,nrstars2 ;that many?! whow!
436 ld hl,starx2 ;and there they are
437 cal DisplayStars ;use the same procedure to display back layer
439 ld a,(level_info) ;level info
440 rra ;ground present? (%1)
441 jr nc,game_stuff ;no, continue game
442 cal Handle_ground ;scroll the ground and check if we're dead
445 cal Handle_Ship ;move you
446 ld a,(your_occ) ;are you 100% OK?
448 jr nz,_gamestuff1 ;then don't check for movements/fires/...
451 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
452 out (1),a ;ask for them
453 nop \ nop ;delay 8 clocks
457 bit 6,a ;test bit 6 = exit-key = EXIT
458 jp z,game_over ;<exit> pressed, so be it
459 check_morekey: ;another unused label... poor compiler
460 bit 7,a ;test bit 7 = more-key = PAUSE
462 cal z,Pause ;yes, go to pause
466 bit 5,a ;test bit 5 = 2nd-key = FIRE
467 ld hl,check_selkey ;where to continue after executing Fire_bullet
468 psh hl ;push hl on stack (instead of cal Fire_bullet)
469 jp z,Fire_bullet ;fire smtn (bulletstaillasermultiples+stuff..)
470 pop hl ;no cal to Fire_bullet made, so pop stack
471 ld hl,just_fired ;no:
472 ld (hl),5 ;able to fire (five turns = laser duration)
473 laserdur =$-1 ;SMC laser duration
476 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
478 in a,(1) ;our precious keys
480 #ifdef teacherkey ;should we check for the teacherkey?
481 bit 6,a ;'bout the GRAPH key...
482 cal z,Teacher ;you didn't _press_ it, did you?!?
485 rla ;test bit7 so we know f ALPHA has been pressed
486 cal nc,select ;yeppy, select the currently selected upgrade
488 cal Enemies_hit ;check for collision with enemies
492 cal Handle_enemies ;move enemies
494 cal Handle_bullets ;move your bullets + check for hits
495 cal Enemy_bullets ;move enemy bullets
497 cal Level_event ;insert enemies
498 cal Display_Screen ;display all
502 halt ;delay and preserve batteries :)
503 #else ;halt doesn't work on TI-83
511 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
513 ;------- weapon -------
519 cp 97 ;max. 96 times (=96/16=6 increases)
520 ret nc ;return if already maxed
521 ld (weapincs),a ;save new incs
523 and %11110000 ;clear last 4 bits so no cf when rotating
525 rra ;rotate acting as shift (srl a) but just 1B
528 rra ;increase once just every 16 turns
529 ld b,a ;times to increase
531 add a,1 ;increase damage for one increase
533 dnz incthedamage ;a=total increase damage
534 ld b,1 ;minimal damage
536 add a,b ;a=total damage
537 ld (curweapdamage),a ;safe the current damage
540 disp_charge: ;display charge bar
542 ld hl,(58*scrwidth)+VIDEO_MEM+3
545 ld hl,(58*scrwidth)+VIDEO_MEM+2
546 ld b,2 ;bar width 1.5
550 ld (hl),0 ;clear (previous) bar
553 ld a,(weapincs) ;load bar size (0-80)
554 srl a ;half the size (0-40)
555 srl a ;again half that size (0-20 pixels)
557 srl a ;and again if 83 (smaller screen)
562 srl a ;/8: don't display last 3 bits of a (later)
563 jr z,nochargebar ;if a=0 then it would loop 256x so skip it
564 ld b,a ;loop b=a times
565 chargebar: ;starting at ($39*16)+VIDEO_MEM
566 ld (hl),%11111111 ;draw a piece of the bar
567 inc hl ;next position
568 dnz chargebar ;loop it b times
571 and %111 ;display last bits of chargebar
572 ret z ;if armor=0 then bit = %00000000 (don't disp)
574 xor a ;bit = %00000000
577 rra ;rotates A right and sets bit 7 (c-flag)
578 dnz chargebarbit ;repeat B times (so if B=6 then a=%11111100)
579 chargebarready: ; (an if B=3 then a=%11100000)
580 ld (hl),a ;draw this last byte
583 spr_bossA2: ;the following 51 bytes also function as the
584 .db 8,51 ; sprite for boss A2 (the fullscreen asteroid)
586 ;--------------------------- ground ------------------------------------------
590 and %111 ;once every 8 frames
591 jr nz,Display_ground ;otherwise skip the scroll
592 ld bc,scrwidth-1 ;scroll all 16 bytes minus one (teh new byte)
593 ld hl,groundpos+1 ;from..
594 ld de,groundpos ;to (one byte to the left)
595 ldir ;LoaDIncreaseRepeat = scroll!
597 ld a,(groundpos+14) ;last ground on right
598 ld d,a ;as default ground
600 ld bc,$500 ;range=0..4
605 add a,(hl) ;substract to spacesize
607 jr c,newground ;if nothing left then don't change
609 ld a,d ;current grond height
610 add a,b ;add offset (2 higher/lower) => new position
612 jr z,newground ;may not be 0 (=256)
614 jr nc,newground ;and not be <0
619 ld (groundpos+15),a ;save new byte on the right
622 ld b,scrwidth ;screen width
623 ld de,groundpos-1 ;height of current byte (previous actually)
625 ld hl,dispbuffer+(56*scrwidth)-1 ;screen position
629 ld c,b ;push b for groundloopup
630 pop hl \ inc hl ;get screen position and go one right
631 pop de \ inc de ;get height info and set to the next byte
632 psh de \ psh hl ;save these for the next time
633 ld a,(de) ;height of current byte
636 ld de,-scrwidth ;to substract to go one line up
637 ld a,%11111111 ;bitmask black
639 ld (hl),a ;display black byte
640 add hl,de ;go up (sbc must be used for 16-bit sub)
641 dnz groundloopup ;and loop >groundpos< times
643 ld b,c ;pop b used by groundloopup
644 dnz groundloopright ;loop right for entire screen (16x)
645 pop hl \ pop hl ;restore stack
647 CheckGround: ;check for collision with the ground
665 ;--------------------------- move stars --------------------------------------
667 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
674 ret ;let's comment this: returns
679 rlca ;move bits (star) left
681 ret nc ;if star didn't went from left to right bit
682 ld b,nrstars2 ;otherwise move all stars one byte left
690 ret c ;once every other turn...
698 ld l,(ix) ;star (ix) pos in hl
699 dec hl ;one byte left (hl--)
701 ld a,dispbuffer/256-1 ;screen high byte minus one (it may be equal)
702 cp h ;compare w/ star high byte
703 jr c,newstarok ;screen<star: still on screen
704 cal RandomY ;otherwise create new position hl
707 ld (ix),l ;save star's new position (ix)=hl
709 inc ix \ inc ix ;next star (2 bytes/star)
710 dnz movestars_loop ;repeat for each star
711 ret ;...here's another comment... :P
713 ;--------------------------- pause -------------------------------------------
719 rcl _vputs ;display small font
720 ld hl,_txt_pressenter ;top centered
722 ld hl,txt_pressenter ;"Enter to continue"
723 rcl _puts ;display message
725 cal getsomekeys ;GET_KEY w/ halts and checks for enter
726 ret z ;enter/second pressed: continue game
730 cal do_invert ;if so then change invert screen (AF saved)
731 cal mode_invert ;and screen mode (will be saved)
734 ld hl,CONTRAST ;contrast setting (0-31)
735 ld b,(hl) ;load contrast into b
736 cp K_UP ;+ key changes contrast up
738 inc b ;increase contrast
742 jr nz,pause ;nope: loop
743 dec b ;decrease contrast
747 out (2),a ;and set it
751 ;--------------------------- teacher -----------------------------------------
753 #ifdef teacherkey ;can be disabled to save space if not needed
755 ld (iy+12),5 ;enable flashing cursor
756 rcl _clrWindow ;top left
758 rcl _puts ;display message
762 rcl _getkey ;enter low-power mode and wait for key
763 cp kEnter ;enter pressed?
765 cp kGrMenu ;keypressed = graph?
766 jr nz,teacherloop ;no, wait some more
768 ld (iy+12),0 ;disable cursor
772 teacherans: ;enter displays the answer
773 ld a,' ' ;the cursor could still be displayed (█)
774 rcl _putc ;so remove it by displaying a ' ' over it
777 ld (_curRow),hl ;below the equation, aligned right
778 ld hl,txt_teacherans ;the answer text
780 jr teacherloop ;and continue loop
783 ;--------------------------- exit --------------------------------------------
787 im 1 ;release keyfix procedure
791 ld (_asapvar+1),a ;next Asm( run will reload the program
792 res 5,(iy) ;don't display "Done" in TI-OS :P
793 set 2,(iy+13) ;set back screen scrolling again
796 res 7,(iy+20) ;_vputs will now write directly to LCD again
797 set 6,(iy+9) ;finished with statmem
799 #ifdef clearbuffer ;should we clear the display buffer?
800 ld hl,dispbuffer ;graph-screen location
802 ld (hl),a ;set to 0 (zero, nothing, nada, empty..)
803 ld bc,1024-1 ;do it 1024 times = entire screen
804 ldir ;load that first 0 into the entire area
806 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
807 ;_clrScrn) AND also executes _homeup and ret
809 ;--------------------------- display -----------------------------------------
817 ld hl,dispbuffer+2-16-(-(16*64)+1) ; 10
823 ld de,-(16*64)+1 ; 10
833 dnz fastCopyLoop ; 13/8 ; 3392
836 jr nz,fastCopyAgain; 12/7
840 ld hl,dispbuffer ;from buffer (top left)
841 ld de,VIDEO_MEM ;to real screen (top left)
842 ld c,56 ;display height = 64 bytes (minus 8 for bar)
844 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
846 ld a,(hl) ;copy byte from (hl)
847 _invert: ;SMC: cpl <-> or a
848 cpl ;xor $ff: invert byte (white<=>black)
850 inc hl \ inc de ;next byte
851 dnz displaytloop ;16x hl >> de
853 jr nz,displayloop ;loop 56x
857 or a ;(time2invert)=0:
858 jr z,noinvert ; do nothing
859 dec a ;otherwise decrease
860 cal z,do_invert ;if it became 0 then invert
861 ld (hl),a ;save new value
864 ld hl,$396b ;Display Score
865 ld (_penCol),hl ;bottom right of screen
868 _D_HL_DECI: ;------- display 5-digit value -------
869 ld de,savestr+4 ;savenr saves number string
871 ldhld: rcl UNPACK_HL ;one digit of hl
872 add a,'0' ;make number
873 ld (de),a ;save into savenr
874 dec de ;point to next digit
875 dnz ldhld ;repeat for all digits
877 ld hl,savestr ;we (the program) saved the value righthere
878 jp _vputs ;the only thing left to do is to display it
880 savestr: ;@here the score will be stored
881 .db "00000",0 ;don't worry, it's just temporary
883 ;------------------------- handle ship ---------------------------------------
890 inc a ;no! next (explosion)frame
891 ld (your_occ),a ;save
893 cp 63+1 ;last explosion frame?
894 jp c,exploding_you ;not yet: display explosion
895 cp 64+16 ;delay finished?
896 ret nz ;no, don't display anything (&return)
897 pop hl ;restore stack (cuzzof call)
898 jp z,You_die ;yes = game over
902 ld a,%01111110 ;get arrow keys
903 out (1),a ;it's cold outside
904 ld hl,y ;instead of nop\nop do something usefull
905 in a,(1) ;come back in
908 xor -1 ;inverted a: 0 if arrow-key has been pressed
909 ld a,(your_multiples) ;(btw: CPL doesn't set any flags)
910 res 7,a ;reset move bit (no flags changed)
911 jr z,adv_ok ;if so, leave the multiples where they are
912 set 7,a ;set move bit
913 adv_ok: ld (your_multiples),a
915 ld a,(timer) ;framecounter
916 and %1 ;switches 0<>1 each frame
917 inc a ;a = 1 or 2 (1.5 avg)
918 ld c,a ;c = your_speed
921 rra ;rotate right (put last bit in c)
922 ld b,a ;we need a later
927 cp 50 ;56-6 = bottom of screen
932 rr b ;because we now use b, it's rr instead of rra
935 sub c ;<dec a> doesn't affect c-flag
936 jr c,no_left ;-1 = left side
943 cp 122 ;128-6 = right side
952 sub c ;<dec a> doesn't affect carry-flag
953 jr c,no_up ;-1 = top of screen
954 ld (hl),a ;save new y
956 no_up: ld e,(hl) ;e=y
957 ld ix,spr_ship01 ;normal ship sprite
959 ld hl,your_shield ;shielded?
960 ld a,(hl) ;load time in a
962 jr z,disp_ship ;yes so ship = normal (display \ continue)
964 ld a,(timer) ;load frame nr.
965 and %00000111 ;a=0 once every four frames
966 jr nz,not_time ;a<>0 = not time to update counter
967 dec (hl) ;decrease inv-time left
969 and %00000100 ;a switches 0<->1 every 2 frames
970 jr z,disp_ship ;show normal ship
972 ld bc,spr_ship01i-spr_ship01
973 add ix,bc ;display invulnerable ship
975 cal safeputsprite ;display your ship; save de
980 ld a,(your_multiples) ;do you have multiples
981 ld b,a ;save a for 2nd check
982 and %1111 ;no? (last four bits = nr of multiples)
983 ret z ;then don't handle them either
984 bit 7,b ;move the multiples??? (=move bit set?)
985 jr z,mult_adv ;nope, just let them (saves (y)in y, (x)in x)
987 psh de ;current position = needed later
988 ld hl,mm*14+1+your_prevpos ;previous positions
989 ld de,mm*14+3+your_prevpos ;move all positions one back
991 lddr ;change 0-57 -> 2-59 (if mm=4 that is)
992 inc hl ;your_prevpos+0
995 inc hl ;=current position
999 ld ix,spr_multiple ;normal sprite
1001 bit 3,(hl) ;change sprites every 8 turns
1003 ld ix,spr_multiple2 ;second sprite
1005 ld hl,your_prevpos+16 ;first pos.
1009 ld d,(hl) ;load coords
1013 cal putsprite ;display
1014 pop ix ;same sprite next time ;)
1017 add hl,de ;next multiple
1020 ret z ;return if all done
1021 jr dispmultiplesloop ;loop
1026 srl a ;half the framerate
1027 srl a ;and half that framerate
1029 ld ix,spr_yexplosion ;base sprite
1031 explosion_stuff: ;in:a=frame*2+(0 to 1); (hl)=xpos-- ix=sprite
1037 add ix,bc ;go to correct sprite (each spr. is 8 bytes)
1039 ld d,(hl) ;load xpos
1042 jp putsprite ;and display it too
1046 damage_you: ;damages you B points
1047 ld a,(your_occ) ;return if already dead (prevents exploding
1048 or a ; twice, or stucking in exploding state)
1049 ret nz ;0 = you're normal
1051 ld a,(hardcore) ;hardcore mode?
1053 jr z,damageok ;0 = no = don't modify
1054 ; sla b ;1 = yes = double tha damage (b shifted left)
1055 .db $CB,$30 ;sll b ;damage=2b|1 (CB3r = unsupported SLL r)
1057 ld a,(your_shield) ;shield left?
1059 jr z,dothadamage ;no shield
1060 srl b ;shield: half the damage
1064 cp (hl) ;not already inverted?
1065 cal z,do_invert ;then invert screen
1066 ld (hl),2 ;change back 2 frames from now
1068 ld hl,your_armor ;armor left
1069 ld a,(hl) ;load hp in A
1070 sub b ;decrease hp by B
1071 jr nc,newarmor ;>=0hp left so don't explode
1072 ld a,%01 ;occ %xxxxxx01 = explode
1073 ld (your_occ),a ;too bad, you're dead meat
1075 ld (hl),a ;save decreased hp
1076 jp disp_armor ;and display new value
1078 ;------------------------- place multiples -----------------------------------
1081 ld hl,your_prevpos ;place all previous positions
1082 ld b,mm*7+2 ;all saved positions of them (14 per multiple)
1084 ld (hl),e ;set prev-x to d
1086 ld (hl),d ;set prev-y to e
1088 dnz place_multiples ;repeat
1091 ;------------------------- select upgrade ------------------------------------
1094 ld a,(your_armor) ;load current armor
1095 cp maxarmor-5 ;may not become >=maxarmor
1096 jr c,doincarmor ;ok then just add 6
1097 ld a,maxarmor-6 ;set to maximum (6 will be added below)
1099 add a,6 ;add 6 to armor
1100 ld (your_armor),a ;change armor
1104 ld de,your_weapon ;current weapon, required for most selections
1105 ld hl,your_pickup ;select pickups
1106 ld a,(hl) ;load pickups taken so far
1108 ret m ;return if it's 0 (no pickups)
1110 ld (hl),0 ;reset pickups
1111 jr nz,selectlaser ;no, carry on again
1113 ld a,(de) ;(your_weapon)
1116 jr c,selectedbeam ;weapon OK
1117 jr z,disp_icons ;weapon maxed out
1118 xor a ;laser was selected: set to first weapon
1120 ld (de),a ;set new weapon
1121 cal loadweapon ;load it (damage and stuff)
1122 jr disp_icons ;display n return
1125 jr nz,selectextra ;no, carry on
1126 ld (your_extra),a ;no extra beams (tailbeam/up-double)
1127 ld a,(de) ;(your_weapon)
1128 cp maxweapon ;upgrade from bullet?
1129 jr nc,upgradelaser ;nope, just upgrade
1130 ld a,maxweapon-1 ;yes, set laser #1
1134 jr nc,disp_icons ;laser maxed out
1137 jr disp_icons ;display + return
1139 ; ld a,(de) ;(your_weapon)
1140 ; cp maxweapon+1 ;laser or beams?
1141 ; jr c,selectXbeam ;if beamweap then no multiples but extra beam
1142 ld hl,your_multiples
1143 ld a,(hl) ;multiples you already got
1144 and %1111 ;reset movebit so (your_multiples)=real value
1147 jr nc,enoughmultiples ;maxed out
1151 dec a ;if this is your first multiple then...
1152 cal z,Place_multiples ;reset multiples positions
1153 ; jr disp_icons ;display, return
1156 ; ld (your_extra),a ;ready extra beam
1157 ; jr disp_icons ;display 'n return
1159 ;--------------------------- show icon ---------------------------------------
1161 disp_icons: ;destroyes: abcdehlix
1162 #ifdef TI86 ;-------86
1164 ld a,VIDEO_MEM/$400 ;directly on screen
1165 ld (PutWhere),a ;place icons at normal screen
1166 ld hl,VIDEO_MEM+(scrwidth*56);56 rows down = eight rows from bottom
1167 ld b,scrwidth ;draw 16x (screen width)
1168 ld a,%11111111 ;horizontal line mask
1169 cal drawline ;draw divider-line
1171 ld b,scrwidth*7 ;draw 16x (screen width) 7x (height)
1172 xor a ;blank line mask
1173 cal drawline ;clear scorebar
1177 ld a,(your_lives) ;nr of lives
1179 jr z,displivesdone ;no lives
1184 cal safeputsprite ;put li'l ship
1189 dnz displivesloop ;one ship per life
1191 cal disp_armor ;display bar
1193 ld ix,spr_icon00 ;emptyIcon
1194 ld a,(your_weapon) ;ur weapon
1195 cp maxweapon ;bullets?
1196 psh af ;a=(your_weapon); cf=bullets
1197 jr nc,no_bullets ;=laser
1198 ld hl,$3945 ;position to display bullet-type digit
1199 inc a ;1 = weapon #1 (=0)
1200 ld (_penCol),hl ;set location
1201 add a,'0' ;make digit
1202 rcl _vputmap ;display char
1203 ld ix,spr_icon04 ;bulletIcon
1205 ld de,$3939 ;icon #2
1206 cal putwidesprite ;(beamweap)
1209 pop af ;ld a,(your_weapon) \ cp maxweapon
1210 jr c,no_laser ;popped carry
1211 ld hl,$3955 ;position to display laser-type digit
1212 ld (_penCol),hl ;set location
1213 sub maxweapon-1 ;1 = laser #1 (=maxweapon)
1214 add a,'0' ;make digit
1215 rcl _vputmap ;display char
1216 ld ix,spr_icon03 ;laserIcon
1218 ld de,$4939 ;icon #1
1219 cal putwidesprite ;display icon (laser)
1221 ld ix,spr_icon00 ;emptyIcon
1222 ld a,(your_multiples) ;number of multiples
1224 jr z,no_multiples ;none (empty)
1225 ld ix,spr_icon05 ;multiples-icon
1226 no_multiples: ;no multiples
1227 ld de,$5939 ;icon #3
1230 ld ix,spr_dividerline
1234 ld a,(your_pickup) ;pickups taken
1235 add a,a ;picks*2 (sets z-flag)
1236 jr z,iconsdone ;return if no pickups
1241 ld d,a ;y-pos = picks * $10 + $29 (3a,4a,5a)
1242 ld e,$39 ;x-pos = bottom (3a39,4a39,5a39)
1247 ld a,dispbuffer/$400 ;normal game-screen
1248 ld (PutWhere),a ;set sprite-position to normal screen
1249 jp disp_charge ;display weapon charge bar
1251 #else ;-------------83
1253 ld hl,VIDEO_MEM+(scrwidth*56);56 rows down = eight rows from bottom
1254 ld b,scrwidth ;draw 12x (screen width)
1255 ld a,%11111111 ;horizontal line mask
1256 cal drawline ;draw divider-line
1258 ld b,scrwidth*7 ;draw 12x (screen width) 7x (height)
1259 xor a ;blank line mask
1260 cal drawline ;clear scorebar
1264 ld a,(your_lives) ;nr of lives
1266 jr z,displivesdone ;no lives
1271 cal safeputsprite ;put li'l ship
1276 dnz displivesloop ;one ship per life
1278 cal disp_armor ;display bar
1280 ld ix,spr_icon00 ;emptyIcon
1281 ld a,(your_weapon) ;ur weapon
1282 cp maxweapon ;bullets?
1283 psh af ;a=(your_weapon); cf=bullets
1284 jr nc,no_bullets ;=laser
1285 ld hl,$3935 ;position to display bullet-type digit
1286 inc a ;1 = weapon #1 (=0)
1287 ld (_penCol),hl ;set location
1288 add a,'0' ;make digit
1289 rcl _vputmap ;display char
1290 ld ix,spr_icon04 ;bulletIcon
1292 ld de,$2F39 ;icon #2
1293 cal putwidesprite ;(beamweap)
1296 pop af ;ld a,(your_weapon) \ cp maxweapon
1297 jr c,no_laser ;popped carry
1298 ld hl,$393F ;position to display laser-type digit
1299 ld (_penCol),hl ;set location
1300 sub maxweapon-1 ;1 = laser #1 (=maxweapon)
1301 add a,'0' ;make digit
1302 rcl _vputmap ;display char
1303 ld ix,spr_icon03 ;laserIcon
1305 ld de,$3939 ;icon #1
1306 cal putwidesprite ;display icon (laser)
1308 ld ix,spr_icon00 ;emptyIcon
1309 ld a,(your_multiples) ;number of multiples
1311 jr z,no_multiples ;none (empty)
1312 ld ix,spr_icon05 ;multiples-icon
1313 no_multiples: ;no multiples
1314 ld de,$4339 ;icon #3
1317 ld ix,spr_dividerline
1321 ld a,(your_pickup) ;pickups taken
1322 add a,a ;picks*2 (sets z-flag)
1323 ld e,a ;save 2*picks
1324 jr z,iconsdone ;return if no pickups
1327 add a,e ;picks*10 (8+2=10)
1329 ld d,a ;y-pos = picks * 10 + $29 (3a,45,4e)
1330 ld e,$39 ;x-pos = bottom (3a39,4539,4e39)
1335 jp disp_charge ;display weapon charge bar
1337 #endif ;------------^^
1340 ld (hl),a ;draw one piece of the divider-line
1341 inc hl ;move right (8 pixels = 1 byte)
1342 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
1347 ld de,scrwidth ;line size
1349 ld hl,VIDEO_MEM+(58*scrwidth)+6
1351 ld hl,VIDEO_MEM+(58*scrwidth)+5
1353 ld a,(your_armor) ;load your armor (<maxarmor)
1354 srl a ;divide by 2 (barsize halved)
1356 and %111 ;display last bits of armor
1357 jr z,armorbarbitok ;if b=0 then prevent looping 256x
1359 xor a ;bit = %00000000
1362 rla ;rotates A left and sets bit 0 (c-flag)
1363 dnz armorbarbit ;repeat B times (so if B=6 then a=%00111111)
1364 armorbarbitok: ; (an if B=3 then a=%00000111)
1365 ld c,a ;save last bit in c
1366 pop af ;now we'll make the byte
1367 and %11111000 ;clear last three bits
1368 rra ;so we can use rotate instead of shift right
1369 rra ;which saves 3(-2) bytes and speed
1370 rra ;/8: don't display last 3 bits of a (later)
1374 psh bc ;yloop counter
1375 psh hl ;begin x-position
1376 ld b,a ;loop b=a times per line
1378 jr z,lastarmorbit ;then don't display bytes (would be 256x)
1380 ld (hl),%11111111 ;draw a piece of the bar
1381 dec hl ;next position
1382 dnz armorbarbyte ;loop it b times
1384 ld (hl),c ;draw the last byte
1386 ld (hl),0 ;empty byte before to remove any remainders
1387 pop hl ;recall first byte
1389 pop bc ;recall yloop-counter
1390 dnz armorbarloop1 ;display again
1393 ld hl,(56*scrwidth)+VIDEO_MEM+7
1395 ld hl,(56*scrwidth)+VIDEO_MEM+6
1399 cal drawbarrow ;display "grey" mask
1400 cal drawbarrow ;display "grey" mask
1405 drawbarrow: ;ORs an entire row with A
1407 ld b,4 ;four bytes right
1416 pop hl ;old position
1419 ;------------------------- fire bullet ---------------------------------------
1423 psh ix ;save ix for next fire
1424 cal fireany ;fire from multiple position
1425 pop ix ;saving ix is much faster than recalculating
1426 pop af ;number of multiples
1427 dec a ;one just displayed
1429 ret z ;ret2 if none left
1433 ld hl,(your_prevpos+16);then, fire from multiple position
1435 ld hl,(your_prevpos+30)
1437 ld hl,(your_prevpos+44)
1439 ld hl,(your_prevpos+58)
1440 cal fire_multiple ;no JP: that messes up the stack
1444 ld hl,just_fired ;=for how long you may hold fire (2nd)
1445 ld a,(hl) ;a = time left
1446 dec a ;decrease timer
1447 ret z ;may not fire when (just_fired) became 0
1448 ld (hl),a ;save new decreased value
1450 ld a,(your_weapon) ;if you have bullets.....
1452 jr nc,fireOK ;>weapons = laser
1453 ld (hl),1 ;bullet may last one turn (just fire 1 bullet)
1455 ld a,(your_weapon) ;weapon nr.
1461 ld b,0 ;go to current weapon (bc=a)
1462 add ix,bc ;ix=weapon ptr
1464 ld a,(your_multiples) ;any multiples?
1465 and %1111 ;nr. of multiples
1466 cal nz,fire_multiples ;if >0 then fire them too
1467 ld hl,(x) ;fire from ship position (x)
1469 ld (firex),hl ;set position to fire from
1470 ld b,3 ;or use the proc at fireOK with ld ix,weapondata+2-(256*3)
1472 psh bc ;save counter
1473 ld a,(ix) ;load this weapon
1474 ld c,a ;save bulletType in c
1475 and %11100000 ;%111?????=laser
1476 cp %11100000 ;is it?
1477 cal z,fire_laser ;fire laser (will set c=0 when done)
1480 cal nz,fire_ybullet ;then fire bullet
1481 inc ix ;otherwise fire next weapon
1483 pop bc ;weapon counter (do 3 weapons)
1487 ld ix,extrabulletpos-1 ;extra bullet's position
1488 ld hl,your_extra ;data
1492 ; ld c,tailbeam ;tailbeam weapon data
1493 ; dec a ;(your_extra)=1
1494 ; jr z,fire_ybullet ;=tail
1495 ld c,doublebeam ;up double data
1496 ;(your_extra)=2 =double
1497 ;-----fire BULLETs-----
1499 fire_ybullet: ;fire bullet type=C dam=(curweapdamage) at (firex/y)
1500 ld hl,ybullets ;check for unused bullet
1506 jr z,found_ybullet ;0 = no bullet here
1508 dnz find_ybullet ;look next bullet
1509 ret ;none found, return don't fire
1512 ld (hl),c ;use the bullet and set correct bullet-type
1514 ld (hl),1 ;set bullet damage
1516 ld a,(firex) ;your x-pos
1517 add a,5 ;place bullet in front of you
1518 inc hl ;go to bullet-x
1521 ld a,(firey) ;your y-pos
1522 add a,(ix+1) ;place bullet at the middle of your ship
1523 inc hl ;go to bullet-y
1527 ld (weapincs),a ;reset damage
1530 ;-----fire LASER-----
1533 ld b,0 ;overflow counter
1535 ld d,(hl) ;d = your x-pos
1538 ld a,(hl) ;base y-coord (firey)
1539 add a,(ix+1) ;at specified offset (most likely the middle)
1540 ld e,a ;save laser-y in e
1541 psh de ;save unmodified (x,y)
1548 add a,a ;y*8 (86) | y*6 (83)
1549 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1550 add a,a ;width of screen (y*16 (86) | y*12 (83))
1551 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1552 inc a ;8 pixels to right (a=even so no overflow)
1557 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1559 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1560 inc b ;a>255 so increase bc by 256
1561 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1562 ld hl,dispbuffer ;save-location
1563 add hl,bc ;bc = Y*16+X/8: hl=screen address
1564 ld a,scrwidth-1 ;128/8=16=screen width ** minus one (inc a ^^)
1565 sub d ;minus x-start (d=X/8)
1566 jr z,handle_laser ;if size=0=256x (right edge) then skip display
1570 inc hl ;Go to next byte
1573 pop de ;de=(firex): x-pos unmodified
1575 check_laserhits: ;de = (x,y)
1577 ld b,nrenemies ;check all enemies
1578 ld hl,enemies+1 ;enemy#1+occ/hp00
1579 laserhits: ;hits with normal enemies
1582 and %11 ;normal enemy occ = %11
1584 jr nz,nolashit ;no hit when enemy_occ <> 11
1587 cal find_sprite ;ix=sprite to enemy (hl)
1591 jr c,nolashit ;no hit when enemy is left of you
1595 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1596 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1598 add a,(ix+1) ;add enemy height (according to sprite @ix)
1599 jp m,nolashit ;a-e>0 = hit
1601 psh hl ;pointer to enemy destroyed by putsprite
1602 psh bc ;safe enemy counter
1603 psh de ; and Ur position (used for further compares)
1604 dec e ;adjust y-position
1606 dec e ;hit sprite centered at e (height=6)
1608 ld d,(hl) ;x-position of hit (enemy's x-pos)
1609 ld ix,spr_lashit ;laserHit sprite
1610 cal putsprite ;display this frame only unlike bullethit ani
1611 pop de ;restore regs
1614 ld a,(curweapdamage) ;damage
1615 cal enemy_hit ;inflict (hl=enemy+y)
1620 add hl,bc ;go to next enemy
1622 dnz laserhits ;check all enemies
1624 ld (weapincs),a ;reset damage
1629 ;------------------------ handle bullets -------------------------------------
1635 ld a,(hl) ;@bulletType
1636 or a ;bulletType=0 >> no bullet
1637 jp z,next_ybullet+2 ;skip pops (+2); jP for speed
1639 psh bc ;bullet counter
1640 psh hl ;save enemy+type
1641 ld (temp1),hl ;needed for check_bullethits
1645 jp m,bullethitbullet ;damage<=0 (=no bullet)
1650 and %11111 ;pixels to move
1651 add a,(hl) ;a = X + (hl) to the right
1652 sub 16 ;and 16 to the left (so -16..+15)
1653 jr c,remove_bullet ;remove if x<0
1655 jr nc,remove_bullet ;or x>=128
1656 ld (hl),a ;save new pos.
1662 rcl _shracc ;%11100000->1110
1663 ;Note: a _shracc procedure inside Nemesis itself would be 27 cycles faster
1665 srl a \ srl a \ srl a \ srl a ;83 doesn't have a shracc call
1669 jr z,bullet_noymove ;1=straight forward
1671 jr z,bullet_up ;2=up
1673 jr z,bullet_halfup ;3=1/2up
1675 jr z,bullet_down ;4=down
1676 bullet_halfdown: ;5=1/2down
1678 rra ;carry once every other turn
1688 rra ;CF every other turn
1701 ld a,(hl) ;bullet damage=size
1702 ld hl,bullettable ;pointer to first bullet
1706 ld c,a ;->16bit (de=a)
1707 add hl,bc ;point to correct bullet offset
1708 ld a,(hl) ;load bullet offset
1709 ld c,a ;convert to 16bit (d=0)
1710 ld ix,spr_bullet01 ;first sprite
1711 add ix,bc ;add offset (go to correct sprite)
1713 ld a,(ix) ;bullet x-size
1714 ld (bulletxsize),a ;used at check_bullethits
1715 ld a,(ix+1) ;bullet y-size...
1716 ld (bulletysize),a ;...too
1718 cal safeputsprite ;display bullet; DE used for check_bullethits
1720 cal check_bullethits
1723 pop hl ;restore enemy+type
1727 dnz scan_bullets ;next bullet (loop)
1732 ld (hl),0 ;dump this bullet!
1733 jr next_ybullet+1 ;+1:skip pop hl at next_ybullet
1735 bullethitbullet: ;"bullet" just displaying a bullet hit
1736 inc c ;restore damage (to -5..0)
1737 jp z,remove_bullet ;if it's 0 remove it
1738 inc c ;increase to next frame
1741 neg ;make positive value (frame nr. 0..4)
1748 ld ix,spr_hit ;first hit sprite
1749 add ix,de ;add frame nr*8 (goto correct sprite)
1753 ld e,(hl) ;load position into de
1754 cal putsprite ;display hit-sprite
1755 jr next_ybullet ;handle the other bullets
1757 ;--------------------------- check bullethits --------------------------------
1759 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1763 hit_enemies: ;Hits with normal enemies
1764 psh bc ;enemy counter
1770 jr nz,nohit ;no hit when enemy_occ <> %11
1773 cal find_sprite ;set ix to the sprite of this enemy
1777 sub d ;minus bullet x-position
1779 sub 5 ;minus bullet x-size
1783 add a,(ix) ;add enemy width
1788 sub e ;minus bullet y-position
1790 sub 3 ;substract bullet height
1792 jp p,nohit ;nope, missed it
1794 add a,(ix+1) ;add enemy height
1796 jp m,nohit ;missed after all
1798 ;---bullet hits enemy (auch-time!)---
1800 ld hl,0 ;@bulletType
1803 ld a,(hl) ;damage to inflict on enemy
1804 ld (hl),-(hitsprites+1);make this bullet exploding (damage = -5)
1812 dnz hit_enemies ;check next enemy
1815 enemy_hit: ;*in:a=damage;hl=enemy+y
1816 add a,a ;a=damage to inflict
1817 add a,a ;first 2 bits used for occ.
1824 ld a,(hl) ;load hp00
1825 sub b ;decrease HP (if <0xx then c is set)
1826 ld (hl),a ;save (no flag-changes)
1827 dec hl ;@hp64; no change in c
1828 ld a,(hl) ;load; no c-change
1829 sbc a,0 ;if cf then decrease a
1830 ld (hl),a ;save back the new value
1831 ret nc ;if a>=0 then return, otherwise explode
1833 inc hl ;goto occ again
1834 ld (hl),%01 ;set to explode
1836 ld a,(pickuptimer) ;counts enemies destroyed
1837 dec a ;enough destroyed for a pickup?
1838 psh af ;save flags and a=0
1839 jr nz,pickupdone ;otherwise just explode
1840 ld a,pickupfreq ;reset enemies counter
1842 ld (pickuptimer),a ;save new enemiescounter value
1843 inc hl ;@sprite (=explosionFrame)
1844 ld (hl),0 ;explosionFrame 0 or enemy #0=pickup
1846 cal z,place_enemy ;place pickup (enemy#=0=a cuz ZF)
1848 ld hl,1 ;increase score by one
1851 ;--------------------------- level events ------------------------------------
1854 ld a,0 ;time to next event
1856 dec a ;decrease counter
1857 ld (nextevent),a ;store new value
1858 ret nz ;hasn't reached zero yet: get outta here!
1860 ld bc,0 ;enemy frequency (lvl)
1863 ld (nextevent),a ;set time to next event
1865 dec (hl) ;update enemy-counter
1867 ld a,(hl) ;look at counter
1868 or a ;has it reached 0?
1869 jp z,Next_level ;yes: level finished
1870 dec a ;has it reached 1?
1871 jr z,standby_event ;yes: wait until no enemies present/left
1872 dec a ;has it reached 2?
1873 jr z,place_boss ;yep: place the BigBossTM!
1874 dec a ;has it reached 3?
1875 jr nz,place_ranenemy ;nope: >3 = place an enemy
1876 inc hl ;nextevent located behind eventleft
1877 ld (hl),193 ;3: set delay for next boss to appear
1878 ret ;don't place any more enemies
1882 ld hl,enemies+1-enemysize
1886 add hl,de ;go to next enemy
1887 cp (hl) ;0 = no enemy present
1888 jr nz,enemyleft ;if enemy present (<>0) then quit checking
1889 dnz chk_enemyleft ;loop for all enemies
1890 ld hl,nextevent ;time 'til next event
1891 ld (hl),157 ;next time to check is in 157 turns/frames
1893 cp maxweapon ;you have bullets?
1894 jr nc,placebigupgrade ;if not just place the big upgrade
1896 rra ;if level&1=0 (even levels)
1897 ret nc ;then dont place a pickup (=50%)
1899 ld a,1 ;no enemies left: place upgrade pickup
1900 jr place_enemy ;place enemy #1(=a) = big pickup
1908 ld hl,1 ;increase score by 1
1910 ld bc,0 ;0..nrlvlenemies
1911 nrlvlenemies =$-1 ;=nr of enemies minus 1
1912 cal Random ;random enemy b..b+c = 0..nrenemies-1
1916 add hl,bc ;go to a random enemy
1917 ld a,(hl) ;load enemy nr of this mysterious random enemy
1921 ld hl,(levelp) ;the leveldata (including the boss)
1922 dec hl ;points to leveldata\boss\enemynr
1923 ld a,(hl) ;load enemy# of boss
1925 place_enemy: ;places enemy #=a (out:achl=?;b=0;de=@enemy+11)
1927 ld hl,enemies+1-enemysize
1930 chk_noenemy: ;find an unused (no) enemy
1931 add hl,bc ;check next enemy
1932 cp (hl) ;(hl) = 0 ??
1933 jr nz,chk_noenemy ;jump if enemy present (non-0)
1934 ex de,hl ;de=hl=usable enemy +1
1935 pop af ;enemy# to place
1936 cal findenemyspecs ;hl = enemy #a specs
1938 dec de ;goto hp64 (before occ)
1940 ldi ;set hitpoints+occ of enemy class
1943 ld b,(hl) ;bc=@enemy_sprite
1944 inc bc ;@sprite-height
1946 ld b,a ;b = sprite-height
1950 ld a,(hl) ;load placeInfo
1953 jr z,random_enemy ;yes: create random value <51 in a
1955 jr z,lure_enemy ;yes: create a 100% luring enemy
1957 jr z,lure_enemy ;yes: pick one (50% lure)
1959 jr z,ground_enemy ;yes: place @ current ground position
1961 yset_enemy: ;set 0+3..$FC+3 as y-position
1965 ld a,(groundpos+15) ;ground height
1966 neg ;negative (high ground, low y-pos)
1967 add a,50 ;at the bottom
1968 ld (de),a ;is turret's position
1971 ld a,(timer) ;look at frame-number
1972 rra ;make random if odd frame nr.
1973 rra ;...well make that frame/2
1974 jr nc,random_enemy ;1st possibility: random enemy
1975 lure_enemy: ;2nd possibility: luring enemy
1976 ld a,(y) ;place at same y-pos as YOUR ship
1979 ld a,64-8 ;=57=screen height (8 is scorebar)
1980 sub b ;minus sprite height=bottom
1981 ld c,0 ;range=0 to...
1983 cal Random ;random value on screen
1984 ypos_OK: ;random value successfully created
1985 ld (de),a ;save y-position
1986 inc de ;@movecounter
1988 ld a,1 ;movecounter = 1
1990 inc de ;@firecounter
1991 ldi ;set time-to-1st-fire
1996 ;--------------------------- enemy fires -------------------------------------
1998 Enemy_fires: ;de = x,y; c = type; ix = enemy_sprite
1999 ld hl,ebullets ;first bullet to check
2002 dec d ;d = x of firing enemy minus 2
2004 ld a,(ix+1) ;the height of the enemy firing this bullet
2006 add a,e ;added to his y-position
2008 dec e ;minus one (bullet height)
2010 enemy_fires_again: ;same but hl = first bullet possibly free
2014 jr z,found_ebullet ;0 = not used
2015 inc hl \ inc hl \ inc hl
2016 dnz find_ebullet ;look next bullet
2022 jp c,bulletok ;type #0-5 = done (normal/diag)
2024 jp z,bulletaiming ;type #6 = aiming = type#2..5
2026 jr z,bullettriple ;type #7 = triple
2028 jr z,bulletdouble ;type #8 = double
2030 jr z,bulletwide5 ;type #9 = wide 5x
2032 jr z,bulletdquad ;type #10 = double-quad
2034 jr z,bulletran ;type #11 = random
2036 jr z,firesenemies ;type #12 = mine + Dquad
2038 jr z,basefiresenemies ;type #13 = enemies + 10
2040 jr z,randomfire ;type #14 = random @full height
2042 jr z,bulletwide3 ;type #15 = wide triple
2044 jr z,bulletfullfire ;type #16 = straight 5x
2054 basefiresenemies: ;type #13 = base
2060 cal bulletok ;find and fire bullet
2062 ld a,boss2enemy ;otherwise place enemy #[boss2enemy]
2065 firesenemies: ;type #12 = mine / Dquad
2067 rra ;if odd turn (50% chance)
2068 jr c,bulletdquad ;then fire 6x
2069 ld a,boss1enemy ;otherwise place enemy #[boss1enemy]
2072 bulletran: ;type #11 = fires bullets 1-5 at random
2074 ld (hl),a ;set type a=1..5
2077 bulletdquad: ;type #10 = double-quad
2078 cal bulletwide5 ;fire type #1 to 5
2084 ld c,1 ;type #1 = normal
2085 cal enemy_fires_again
2089 ld e,a ;offset 14 down (7 total)
2091 jr enemy_fires_again
2093 bulletwide5: ;type #9 = wide 5x (fires 4 dirs + 1 straight)
2094 cal bullettriple ;fire type #1, 4 and 5
2096 ld c,2 ;type #2 = down
2097 cal enemy_fires_again
2099 ld c,3 ;type #3 = up
2100 jr _enemy_fires_again
2102 bulletfullfire: ;type #16 = straight 5 bullets
2103 cal bullettriple ;fire 3 bullets at center (offset -2,+0,+2)
2104 inc e \ inc e ;restore base (Y)position
2105 jr addedgebullets ;fire 2 more bullets (at offsets -7 and +7)
2107 bullettriple: ;type #7 = triple
2108 cal bulletdouble+1 ;fire double weapon (offset +0,+2)
2109 dec e \ dec e ;two px back up
2110 dec e \ dec e ;and another two up (offset -2)
2111 inc hl ;next bullet position
2112 ld c,1 ;type #1 = normal
2113 jr _enemy_fires_again ;find and fire another bullet
2115 bulletdouble: ;type #8 = double
2116 dec e ;one up (1st bullet not centered:offset -1,+1)
2117 ld c,1 ;type #1 = straight
2118 cal bulletok ;fire bullet
2119 inc hl ;next bullet position
2122 jr _enemy_fires_again ;find and fire another bullet
2124 bulletwide3: ;type #15 = spread (3 bullets)
2125 ld (hl),1 ;type #1 = normal
2128 ld c,4 ;type #4 = down 50%
2129 cal enemy_fires_again
2131 ld c,5 ;type #5 = up 50%
2132 jr _enemy_fires_again
2134 bulletaiming: ;type #6 = aiming = type#2..5
2136 sub e ;a = yourY-bulY = pixels bullet is above you
2138 jp p,bulletnotup ;jump when 10 pixels below you or higher
2139 ld (hl),5 ;go slightly down
2140 add a,10 ;10 to 20 pixels below you
2141 jp p,_bulletok ;yes: all done.
2142 ld (hl),3 ;otherwise move down even more
2145 ld (hl),1 ;normal bullet...
2147 jp m,_bulletok ;...10 pixels below you to 20 pixels above
2148 ld (hl),4 ;bullet going slightly up...
2150 jr c,_bulletok ;...20 to 30 pixels above you
2151 ld c,2 ;else (more than 30 pixels) move up more
2154 ld (hl),c ;set bullet direction
2157 ld (hl),d ;set x-pos
2161 jr nc,bulletonscreen ;<bottom (=on screen) is ok (skip next part)
2162 ld e,a ;otherwise set y-pos to bottom of screen
2164 ld (hl),e ;set y-pos
2167 ;----------------------------- enemy bullets ---------------------------------
2170 ld hl,ebullets ;hl=bullet pointer
2171 ld b,nrebuls ;number of bullets (or _possible_ bullets)
2175 ld a,(hl) ;load bulletType in a
2176 or a ;bullet present?
2177 cal nz,enemy_bullet ;non-0: handle bullet
2178 pop hl ;enemy_bullet could've added one or two to hl
2179 pop bc ;bullet counter
2180 inc hl \ inc hl \ inc hl ;next bullet (3 bytes per bullet)
2181 dnz handle_bullet ;loop for each and every bullet
2186 ld d,(hl) ;check if it has reached the left side of scrn
2188 jr nz,remove_ebullet ;yes, remove bullet
2189 dec d ;move one pixel left
2190 dec d ;and another one (that makes 2)
2191 ld (hl),d ;save new x-coordinate in (HL) and D
2192 inc hl ;@y (BTW: x >= -2)
2196 jr z,ebullet_common ;type 1: normal bullet
2198 jr z,ebullet_down ;type 2: moving down
2200 jr z,ebullet_up ;type 3: moving up
2202 ld b,a ;save bulletType
2203 ld a,(timer) ;load timer
2204 rra ;half speed (CF set every other turn)
2205 jr c,ebullet_common ;if bit then normal bullet
2208 jr z,ebullet_down ;type 4: moving down 50%
2209 ;type 5: moving up 50%
2212 jp m,ebullet_common ;y<top; don't save new value (so y=0)
2219 jr nc,ebullet_common ;then keep it there
2220 ld (hl),e ;otherwise save new y
2223 ld ix,spr_bullete1 ;display enemy bullet
2226 pop hl ;we'll need it again
2231 ret nz ;0 = you're normal
2233 ld a,(y) ;check y collision
2248 ld b,auch_bullet ;set damage-amount
2250 cal damage_you ;HIT!!
2251 pop hl ;save hl to remove the bullet
2253 dec hl ;points to bullettype again
2254 ld (hl),0 ;bullet > unused
2257 ;--------------------------- handle enemies ----------------------------------
2261 ld b,nrenemies ;handle all enemies
2269 jr z,next_enemy ;occ "no enemy" 00
2271 jr z,exploding_enemy ;occ "exploding" 01
2274 ld c,a ;c = occ-1 = %10 (normal) or %01 (pickup)
2289 jr c,enemyonscreenY ;=on screen
2290 cp -20 ;moved off at top
2291 ld e,0 ;reset to top
2292 jr nc,enemyonscreenY
2293 ld e,57 ;otherwise reset to bottom
2295 ld (hl),e ;store new y
2300 jr c,enemyonscreenX ;=on screen
2302 jr c,remove_enemy ;=off screen
2304 ld (hl),d ;store new x
2305 dec c ;is this a pickup? (c=%01 so ZF=1)
2306 jr nz,check_enemyfire ;no, a normal enemy; let em fire
2307 jr firing_done ;continue
2311 add hl,bc ;@firecount
2312 ld a,(hl) ;counter till next blast
2314 ld (hl),a ;save new value
2315 jr nz,firing_done ;finished if not reached 0 yet
2318 ld a,(hl) ;=time 'til next blast
2322 dec hl ;@firecount again
2323 ld (hl),a ;reset counter for next blast
2324 psh de ;save registers for firing-use
2325 cal Enemy_fires ;fires bullet
2326 pop de ;restore (destroyed by Enemy_fires)
2328 cal putwidesprite ;display sprite @ix
2342 jr nz,keep_enemy ;remove when at last frame
2345 ld (hl),$0000 ;bye bye enemy
2346 jr next_enemy+1 ;continue AFTER pop hl (already done)
2349 ld (hl),a ;next frame
2351 ld ix,spr_explosion ;base sprite
2353 cal explosion_stuff ;display explosion
2356 ;--------------------------- moving enemies ----------------------------------
2359 dec d ;move left once
2360 ld a,(hl) ;how does this enemy move?
2366 jp z,movetype_updown ;1 = (1<) up / down
2368 jr z,movetype_vslow ;2 = (.25<)
2370 jr z,movetype_slow ;3 = (.5 <)
2372 jr z,movetype_lslow ;4 = (.75<)
2374 jr z,movetype_mfast ;5 = (1.25<)
2376 jr z,movetype_fast ;6 = (1.5<)
2378 jr z,movetype_vfast ;7 = (2 <)
2380 jr z,movetype_xfast ;8 = (3 <)
2382 jr z,movetype_slowlure ;9 = (1<) move y towards you 50%
2386 jr z,movetype_lure ;10 = (0) move y towards you
2388 jr z,movetype_slowlure ;11 = (0) lure 1/2 speed
2390 jr z,movetype_fulllure ;12 = x+y towards you 1/2 speed
2392 jr z,movetype_right ;13 = (.5>)
2394 jr z,movetype_fright ;14 = (1>)
2396 jr z,movetype_right ;15 = (0)
2403 jr c,dothemovethingy
2404 inc d ;x<110: move right
2406 jr movetype_updown ;move up and down and up and down and...
2412 inc d ;move right one px
2421 jr c,movetype_vfast ;moves left (again)
2432 jr nc,dothelurethingy
2433 dec d ;x>109: move left
2437 ret z ;don't move vertically if equal
2438 jr c,lure_up ;below you then move up
2439 lure_down: ;above then move down
2452 or a ;reset carry flag
2453 dec hl ;reset hl to <y>
2460 inc d ;don't move 25% of the time
2465 inc d ;don't move 50%
2470 inc d ;don't move 75%
2475 ret c ;50% chance (makes it 25% total)
2478 ret c ;once every other turn
2480 dec d ;move left twice
2483 dec d ;woowoo, now that's fast!
2484 dec d ;move left trice!
2491 and 127 ;range 0..127
2492 ld (hl),a ;store new movecounter
2493 dec hl ;reset hl to @movetype
2494 and %00100000 ;ZF changes once every 64 turns
2495 ld a,e ;load current y-position
2497 moveup: dec a ;decrease y-pos (=move up)
2498 ret m ;don't move off the screen (y<0)
2499 dec e ;save new y-pos
2502 inc a ;increase y-pos
2503 cp 55 ;compare with bottom
2504 ret nc ;return if it has passed that line (>40)
2505 inc e ;otherwise save new position
2508 ;--------------------------- check collision ---------------------------------
2511 ld hl,(x) ;e = X, d = Y
2512 ld de,$0707 ;add 7 to both d and e
2514 ex de,hl ;e = X+7, d = Y+7
2517 ld b,nrenemies ;check all 20 enemies
2522 and %10 ;enemy status (%11=normal; %10=pickup)
2523 jr z,check_next ;2 or 3 = ok, otherwise: next enemy
2526 collide_enemy: ;&&& include in Handle_enemy proc
2530 ld a,(hl) ;check x match
2531 sub e ;enemy position minus yours minus 7
2534 add a,(ix) ;enemy width
2538 ld a,(hl) ;check y match
2539 sub d ;same as with x-check
2540 jr nc,check_next ;(=jp p)
2542 add a,(ix+1) ;enemy height
2550 ld a,(hl) ;load enemy occ
2551 rra ;if occ = %10 (can't be %00) then pickup
2552 jr c,collide ;otherwise normal enemy so you collide
2554 rra ;skip this bit (=%1)
2555 rra ;this bit specifies the pickup ID (big/small)
2556 jr nc,armorpickup ;%0 = pickup increases armor and shield
2557 ;%1 = pickup selects (next) upgrade
2558 ld hl,your_pickup ;your pickups
2563 psh hl ;too much pickups
2565 cal scoreInc ;increase score by 250
2567 ld a,1 ;and reset to pickup #1
2571 cal disp_icons ;display altered pickupicons
2573 jr check_next ;all done, next..
2576 cal inc_armor ;increase armor (like at end of level)
2577 ld a,30 ;activate shield for 30*4=120 frames
2579 cal disp_icons ;display status bar (new armor value)
2586 jr nc,enemydamaged ;enemy still ok (HP>=0)
2587 ld (hl),%01 ;set to explode
2589 ld (hl),0 ;explosionFrame 0
2590 enemydamaged: ;damage to enemy delivered
2591 ld b,auch_collide ;your damage
2595 pop hl ;current enemy base (unaltered)
2596 ld bc,enemysize ;bytes per enemy
2597 add hl,bc ;pointer to next enemy
2598 pop bc ;restore counter
2599 dnz check_collision ;loop for all enemies
2602 ;--------------------------- story -------------------------------------------
2606 cal storyPage ;do some story
2607 ld a,(hl) ;load next byte in a
2608 inc a ;set z-flag if a = $ff
2609 jr nz,dostory ;otherwise loop
2611 inc hl ;set hl to beginning of the level
2612 ld (levelp),hl ;set the level-pointer
2616 psh hl ;hl will be destroyed by _clrLCD
2617 rcl _clrLCD ;clear screen
2620 ld (curline),a ;begin line for special effect
2622 ld d,(hl) ;vertical position of text
2624 ld e,(hl) ;horizontal text-position
2625 ld (_penCol),de ;set position
2627 rcl _vputs ;display text
2629 ld a,(hl) ;load next byte
2631 or a ;0 means more text
2632 jr z,storyLine ;loop if there is
2636 ld hl,VIDEO_MEM ;copy text
2637 ld de,dispbuffer ;to GRAPH_MEM
2638 ld bc,1024 ;entire screen
2640 rcl _clrLCD ;clear VIDEO_MEM
2642 pop bc ;last byte (<>0) is lines to SFX
2644 cal DoSFX ;do special effects
2645 cal getsomekeys ;wait for a key
2649 DoSFX: psh bc ;in:(curline)=beginLine;b=nrOfLines
2651 ld a,0 ;get line number
2653 inc a ;go to the next line
2654 ld (curline),a ;update
2660 add hl,hl ;*16 (a pixels down=a*16)
2662 neg ;a=64-a (lines from bottom)
2664 ld b,h ;save hl for later
2666 ld de,VIDEO_MEM ;where to put sfx
2667 add hl,de ;go to ymin
2668 ex de,hl ;put into de again
2669 ld hl,dispbuffer ;source of original
2670 add hl,bc ;hl->source
2672 sfxlaserdisp: ;display this frame on screen
2673 ld bc,16 ;one line (=16 bytes, you'd know by now)
2674 ldir ;display (copy actually)
2675 ld bc,-16 ;go up one line (not on screen)
2676 add hl,bc ;so the same line will be displayed
2678 jr nz,sfxlaserdisp ;repeat until whole screen is displayed
2680 ld b,11 ;11x 1/200sec = ~20 frames/s
2683 dnz sfxlaserdelay ;8x
2692 jp getsomekeys ;wait for a key
2694 .db "-CONGRATULATIONS!-",0
2697 ;--------------------------- proc --------------------------------------------
2699 random14: ;random 1..1+4
2703 Random: ;a=c<random<b+c; destr:none
2705 ld hl,rancount ;amount to increase with (0-255)
2707 inc (hl) ;change for next time
2708 ld a,r ;value $0-7F (can be _anything_ so watch out!)
2709 add a,0 ;add to last random value
2710 ranseed =$-1 ;SMC :P
2711 add a,(hl) ;add the changing increase value
2712 ;(this is because R can be anything;
2713 ; ie always be even so freeze when a must be 1<=a<=1)
2714 ld (ranseed),a ;save for next time
2716 jr nc,randomloop ;then add again
2722 RandomY: ;HL = random Y 0..50 right side ((1..51)*16-1)
2725 ld bc,50*256+1 ;range=1..51
2726 cal Random ;a = 1..51
2732 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2733 dec hl ;hl = 0..50 * 16 (" at right side of screen)
2735 add hl,de ;position on screen
2740 ld bc,50*256+1 ;range=1..51
2741 cal Random ;a = 1..51
2746 ld l,a ;hl = 1..51 * 3
2748 add hl,hl ;hl = 1..51 * 12 (left side at random y)
2749 dec hl ;hl = 0..50 * 12 (" at right side of screen)
2751 add hl,de ;position on screen
2756 scoreInc: ;increase score by HL
2757 psh bc ;don't destroy bc (or any registers Xcept hl)
2758 ld bc,(your_score) ;your current score in bc
2759 psh af ;don't destroy a either
2760 ld a,(hardcore) ;load hardcore mode settings in a
2762 jr z,scoreincok ;then skip the next instruction (score = ok)
2763 add hl,hl ;otherwise (hardcore) double the inc.score
2765 pop af ;restore a register
2766 add hl,bc ;add bc to hl (or vice versa)
2767 ld (your_score),hl ;save new increased score
2768 pop bc ;all registers to what they were
2771 find_sprite: ;in:hl=enemy+type | out:ix=sprite to enemy
2772 ld a,(hl) ;sprite byte #1
2773 .db $DD,$6F ;ld hx,a
2775 ld a,(hl) ;sprite byte #2
2776 .db $DD,$67 ;ld lx,a ;ld ix,(hl)
2780 ld hl,VIDEO_MEM ;screen location (top left)
2783 ld bc,scrwidth*64-1 ;do it 1024 times = entire screen
2788 set 3,(iy+5) ;set white on black
2792 halt ;wait a li'l while and save batteries :P
2794 rcl GET_KEY ;input keys
2796 jr z,getsomekeys ;wait if none
2797 cp K_SECOND ;2nd pressed?
2798 ret z ;then return with zf set
2799 cp K_ENTER ;enter pressed
2800 ret ;then return with zf set, otherwise zf reset
2804 ld a,%10000000 ;all key-masks
2807 inc a ;cp %11111111 (no keys pressed)
2808 jr nz,releasekeys ;keep waitin
2809 jp GET_KEY ;clear buffer
2811 findenemyspecs: ;enemy #a specs in (hl); in:b=0; out:ac=?
2812 ld hl,enemyspecs ;enemy "0" specs
2814 ld c,a ;b=0; bc=c=a=type*2
2815 add hl,bc ;hl = enm#0 + type*2
2816 add a,a ;a=type*4 (max.type<64)
2818 add hl,bc ;hl = enm#0 + type*6
2819 add hl,bc ;hl = enm#0 + type*10
2820 ret ;hl = enemy specs
2822 ;--------------------------- game over / new game / death --------------------
2825 chartable: ;use chartable-1 and add GET_KEY scancode
2826 .db ".<>!",0,0,0,0 ;down,L,R,up
2827 .db 0,"xtoje0",0 ;enter..clear
2828 .db " wsnid9",0 ;(-)..custom
2829 .db "zvrmhc8",0 ;dot..del
2830 .db "yuqlgb7#" ;0..xvar
2831 .db $D9,"-pkfa6'" ;on..alpha
2832 .db "54321",$D0,0,'*' ;F5..F1,2nd,exit,more
2835 ld hl,storesave_end-storesave_start
2837 ld hl,storesave_start
2839 ld hl,4+storesave_start-_asm_exec_ram
2844 ld hl,storehi_end-storehi_start
2848 ld hl,4+storehi_start-_asm_exec_ram
2851 storesmtn: ;stores data [stack=src; stack+1=dest; stack+2=size]
2852 ld hl,_asapvar ;find own variable
2853 rst 20h ;cal _ABS_MOV10TOOP1
2854 rst 10h ;cal _FINDSYM
2856 xor a ;bde=pointer to begin of real program
2858 add hl,de ;hl=pointer to data in real prog
2859 adc a,b ;if hl overflow also increase a
2860 rcl _SET_ABS_DEST_ADDR ;destination = real program = ahl
2862 pop hl ;data position in normal program ($D748+)
2863 rcl _SET_ABS_SRC_ADDR ;set as source (ahl)
2865 rcl _SET_MM_NUM_BYTES ;set
2866 rcl _mm_ldir ;copy data to real program
2867 jp _RAM_PAGE_1 ;and finally: reset ram page
2870 game_over: ;stack=+0
2871 cal BLACKLCD ;clear screen
2873 ld hl,$0603 ;centered on 86
2875 ld hl,$0403 ;centered on 83 (smaller screen)
2877 ld (_curRow),hl ;center
2879 rcl _puts ;display "GAME OVER"
2880 cal releasekeys ;wait for all keys to be released
2885 ld de,(your_score) ;current score
2886 ld hl,(hiscore) ;hiscore
2887 rcl CP_HL_DE ;de<=hl means no hiscore (or same)
2888 jr nc,no_hiscore ;skip the new hiscore part
2889 ld (hiscore),de ;otherwise save current score as new hiscore
2891 ask_hiname: ;and ask for new hiscore name
2892 ld ix,hiname ;where to store the hiscore name
2893 ld a,9 ;max. length <9
2894 ld (hiscorepos),a ;current char (counts backwards 9-1)
2896 ld a,'_' ;cursor appearance
2897 rcl _putmap ;display (do not advance cursorpos)
2899 cal getsomekeys ;wait for any key
2900 jr z,nomore ;if [enter] or [2nd] pressed we're all done
2902 ld hl,hiscorepos ;string position
2903 cp K_DEL ;[DEL] functions as "backspace"
2904 jr z,backup ;delete previous char if pressed
2905 cp K_EXIT ;exit also ends name
2908 ld b,(hl) ;(hiscorepos)
2909 dec b ;next position (counts backwards)
2910 jr z,nokeypressed ;if it's 1 (became 0) then don't add no more
2911 ld (hl),b ;otherwise save new string position
2913 ld hl,chartable-1 ;chars to add for each key
2915 ld d,0 ;de = key pressed
2916 add hl,de ;add so we know which char to add for this key
2917 ld a,(hl) ;load in a
2918 or a ;if it's 0 then
2919 jr z,nokeypressed ;don't add anything afterall
2921 ld (ix),a ;save new char
2922 rcl _putc ;and also display on screen
2923 inc ix ;goto next char
2924 cal releasekeys ;wait for the key to be released
2925 jr enter_name_loop ;and continue the loop
2928 ld a,(hl) ;(hiscorepos)
2929 cp 9 ;9 means begin (0 total chars)
2930 jr nc,nokeypressed ;nothing to remove so continue loop
2931 inc (hl) ;otherwise pos one back
2933 dec ix ;and string to previous char as well
2934 ld a,32 ;remove cursor
2935 rcl _putmap ;by replacing it by ' '
2937 dec (hl) ;cursor one back
2938 jr enter_name_loop ;continue name loop
2940 nomore: ;name's done
2941 ld a,' ' ;remove cursor
2942 rcl _putc ;(or actually replace with ' ')
2943 ld (ix),0 ;end of string marker (zero-terminated)
2944 cal save_hi ;store hiscore with name in real program
2945 jr hiscoredone ;continue with game over screen
2947 no_hiscore: ;no new hiscore
2948 ld hl,hiname ;just display old name
2952 xor a ;clear a (Ahl will be displayed)
2953 ld hl,$1006 ;bottom-1 right
2954 ld (_curRow),hl ;set
2955 ld hl,(your_score) ;your score
2956 rcl _dispahl ;display it (a=0)
2959 ld hl,$314b ;bottom-1 right before score ^^
2963 ld (_penCol),hl ;set
2964 ld hl,txt_score ;"Score"
2965 rcl _vputs ;display (small)
2967 ld hl,$1007 ;bottom right
2968 ld (_curRow),hl ;set
2969 ld hl,(hiscore) ;hi-score
2970 rcl _dispahl ;display
2972 ld hl,$3946 ;bottom right before hiscore ^^
2976 ld (_penCol),hl ;set
2977 ld hl,txt_hiscore ;"Hiscore"
2978 rcl _vputs ;display (small)
2983 ld hl,VIDEO_MEM+(49*scrwidth)-1
2989 cal getsomekeys ;wait for keypress
2990 jp quit ;restore some things and return to TI-OS/shell
2992 invship: ;procedure used in New_game
2996 ld hl,scrwidth*(3-12)+VIDEO_MEM;begin pos
3000 ld b,12*scrwidth ;12 lines down
3006 dnz invshiploop ;loop
3010 New_game: ;start a new game (SP=+0)
3014 ld (PutWhere),a ;will be reset after displaying iconbar
3016 ld ix,spr_ship01 ;first ship: sprite
3017 ld de,$0105 ;position
3018 ld b,4 ;number of ships to display
3028 ld (_penCol),hl ;small cursor position
3029 psh ix ;ix destroyed by _vputmap
3030 ld hl,txt_difhardcore ;hardcore ships text
3031 ld a,b ;ship displaying (4 to 1)
3032 dec a ;minus 1 (3..0)
3034 and %10 ;gives 1,1,0,0 (for ships 0,0,1,1)
3035 jr z,dispdifficulty ;0 indicates hardcore difficulty ship
3036 ld hl,txt_difnormal ;normal difficulty ships text
3038 rcl _vputs ;display difficulty
3044 ld (_penCol),a ;set x=95
3045 pop af ;ship nr (backwards 3..0)
3046 ld hl,txt_shpbeam ;updouble for ships 1
3047 and %1 ;gives 0,1,0,1 (for ships 0,1,0,1)
3049 ld hl,txt_shplaser ;tailbeam for ships 0
3051 rcl _vputs ;display special beam type
3055 cal putwidesprite ;display ship
3058 ld bc,spr_ship01i-spr_ship01+2
3059 add ix,bc ;go to next ship
3060 ld a,12 ;below the previous one
3064 dnz dispshipsloop ;loop
3075 jr z,startthenewgame ;enter/2nd
3077 jp z,menuexit ;go game over when exit was pressed
3079 cal invship ;display selection bar on current ship
3081 cp K_DOWN ;down pressed?
3083 inc b ;move selection down
3085 cp K_UP ;up pressed?
3087 dec b ;move selection up
3089 ld a,b ;new selection
3090 and %11 ;must be 0..3
3095 ld hl,spr_ship01-(spr_ship02-spr_ship01)
3096 ld de,spr_ship02-spr_ship01
3097 psh bc ;save b (ship#)
3098 inc b ;your ship #0-3++
3101 add hl,de ;next ship
3104 and 1 ;gives: 1,0,1,0 for the ships
3105 xor 1 ;well, make it 0,1,0,1 :)
3106 jr z,whichship ;ships 0 have bullets
3107 ld a,maxweapon ;ships 1 have lasers (0,8,0,8)
3109 ld (your_weapon),a ;set bullet#1 or laser#1 depending on ship
3111 and %10 ;ships give 0,0,1,1
3112 ld (hardcore),a ;hardcore mode set for ships 3 and 4
3114 ld (your_score),a ;reset score
3115 ld (your_score+1),a ;reset score (0)
3116 ld (your_extra),a ;no extra beam
3117 ld (your_pickup),a ;reset pickups
3118 ld (your_multiples),a ;no multiples
3120 ld (level),a ;reset level nr (#1)
3121 ld hl,levelstart ;set level pointer to level#1
3122 ld (levelp),hl ;reset level pointer
3124 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
3125 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
3127 You_die: ;stack must be +1
3129 ld (your_armor),a ;24 HPs/shields
3130 ld a,(your_lives) ;load lives left
3131 dec a ;decrease lives
3132 ld (your_lives),a ;if lives=0ffh GO
3133 inc a ;if -1 then zf set now
3134 jp z,game_over ;and game's over
3137 ;--------------------------- next level --------------------------------------
3139 Next_level: ;stack must be +1
3142 cal inc_armor ;increase armor
3144 ld hl,(levelp) ;level pointer
3145 ld b,0 ;advance one level
3147 add hl,bc ;passed the enemies
3149 add hl,bc ;update to point to next level
3150 ld (levelp),hl ;save
3152 ld a,(level) ;level number
3154 cp endlevel+1 ;last level done?
3155 jr c,gamenotdone ;no: continue game
3157 cal dostory ;display end (hl=(levelp))
3159 cal scoreInc ;game complete bonus: 500
3160 jp game_over ;game over (+hiscore)
3166 ld h,0 ;increase score....
3167 ld l,a ;by level number * 4
3170 cal scoreInc ;update score
3174 ld de,_invert ;sets B<>W mode
3175 ldi ;ld (_invert),(invertmode)
3176 ld de,your_shipspr ;sets your ship's sprite
3177 ldi ;ld (your_shipspr),(your_ship)
3178 ldi ;and second byte (heh it's a word)
3181 ld (nextevent),a ;time to first enemy appearance
3183 ld hl,(levelp) ;level pointer
3185 dec hl ;byte before level (boss byte)
3186 xor a ;if it's zero it means here's a story
3188 inc hl ;begin of level
3189 cal z,dostory ;do the story and set (levelp) to real level
3192 ld a,(hl) ;number of (different) enemies in this level
3195 ld (nrlvlenemies),a ;set nr of enemies-1
3196 ld b,0 ;bc=c so we can use ldir
3197 ld de,lvlenemies ;table of enemies
3198 ldir ;load enemies to table
3199 ld a,(hl) ;load new appearance-time
3203 ld (eventtime+1),a ;set
3205 ld a,(hl) ;load nr of enemies in this level
3206 ld (eventleft),a ;set nr of events left
3209 ld c,4 ;5xLDI: loads (level_info) (spacespace)
3210 ldir ; (stars1) (stars2)
3212 ld b,16 ;fill (groundpos)
3226 ld (timer),a ;reset time
3227 ld hl,your_occ ;hl = your_occ
3228 ld (hl),a ;reset your ship (not exploding)
3229 inc hl ;hl = your_shield
3230 ld (hl),25 ;set 25*4=100 frames shielded
3232 ld (x),de ;begin position (x,y)
3233 cal Place_multiples ;place all multiple-positions at that (0,24)
3235 cal loadweapon ;load (your_weapon)
3238 ld hl,enemies ;remove all enemies and bullets
3239 ld (hl),a ;clear first byte
3240 ld de,enemies+1 ;copy this to the next byte
3241 #ifdef TI86 ;on '86 everything's located here
3242 ld bc,(nrenemies*enemysize)+(nrybuls*4)+(nrebuls*3)-1
3243 #else ;on '83 it's a little harder...
3244 ld bc,(nrenemies*enemysize)-1
3245 ldir ;just clear the enemies
3246 ld hl,ybullets ;now remove all the bullets (different loc.)
3247 ld (hl),a ;clear 1st byte
3248 ld de,ybullets+1 ;copy2next
3249 ld bc,(nrybuls*4)+(nrebuls*3)-1
3251 ldir ;clear enemies + ybullets + ebullets
3253 ;--------------------------- setup game --------------------------------------
3256 cal BLACKLCD ;white on black
3259 ld (_curRow),de ;center
3260 rcl _puts ;display "LEVEL "
3262 ld a,(level) ;current level
3265 rcl UNPACK_HL ;create first digit
3268 rcl UNPACK_HL ;second digit
3270 rcl _putc ;display second digit
3272 rcl _putmap ;display first digit
3274 ld hl,txt_lives ;bar text: "Lx0"...
3276 ld (_curRow),de ;display lives left below level nr
3278 ld a,(your_lives) ;lives left
3279 add a,'0' ;make value 0='0'
3282 cal releasekeys ;wait for user to release all keys
3283 ld hl,txt_savekey ;"Press [F1] to save"
3284 ld de,$3A46 ;bottom-right
3288 res 3,(iy+5) ;set white on black
3289 cal getsomekeys ;wait for keypress
3295 rcl _clrLCD ;clear screen
3296 cal disp_icons ;display bottom icons +ret
3300 cal RandomY ;a = random y-pos 1..bottom
3301 ld a,b ;a = b = star nr. = 1..7
3302 add a,a ;a = 2b = 2..14
3304 ld e,a ;de = a = 2-14
3306 sbc hl,de ;substract from rand y => random pos anywhere
3308 ld (ix),l ;save x-pos (l)
3309 ld (ix+1),h ;save y-pos (h)
3310 inc ix \ inc ix ;next star
3311 dnz placestars ;repeat for all stars
3324 ld (weapdamage),a ;damage of bullets
3327 ld (weapdaminc),a ;damage increase
3330 and %00011111 ;laser duration
3338 ld hl,dispbuffer ;move from (hl) = top left
3339 ld (hl),0 ;first pixel will be copied all over the screen
3340 ld de,dispbuffer+1 ;(de) = next pixel, thus clearing whole screen
3341 ld bc,scrwidth*64-1 ;loop 896 times = (128/8) * (64-8 for scorebar)
3346 ;-----------------------------------------------------------------------------
3347 ;--------------------------- putsprite ---------------------------------------
3348 ;-----------------------------------------------------------------------------
3349 ;in: de=(x,y); ix=sprite
3350 ;out: ix=behind sprite; hl:a=right below sprite; b=0; d=width; ce=?
3354 ld c,(ix) ;save width
3355 _putsprite: ;putsprite with custom width
3357 bit 7,d ;check sign bit of X
3358 jr z,CSpositive ;X>=0
3361 cp (ix) ;off screen?
3362 ret nc ;X<=-width: don't draw at all
3363 ld b,a ;b=|X|mod 8=1..7=bits to draw
3364 ld a,%11111111 ;all bits set (draw everything)
3366 srl a ;remove first bit in a for each b
3367 dnz CSclipleft ;b=1: a=%01111111
3374 res 7,d ;X+128 (right side of screen)
3376 jr CSdisplay ;done clipping
3379 sub 129-8 ;minus (screen width - byte width)
3381 ld a,%11111111 ;clipmask
3382 jr c,CSdisplay ;x+width<128 then entire sprite is on screen
3383 inc b ;b = number of pixels off screen
3385 add a,a ;remove last bit in a for each b
3386 dnz CSclipright ;b=1: a=%11111110
3393 ;b>7: a=%00000000 = off screen
3395 CSdisplay: ;display the sprite ix at (d,e) masked
3396 ld (CSclipmask),a ;set mask
3397 cal findpixel ;convert de to screen location hl:a
3403 psh bc ;save rows to go
3406 ld a,(ix+2) ;load image line
3412 ld a,1 ;saved bitmask
3414 sla c ;test leftmost pixel
3415 jr nc,CSnodraw ;don't draw if it's 0
3416 ld e,a ;psh af: save bitmask
3418 ld (hl),a ;OR pixel with screen
3422 jr nc,CSbitdrawn ;carry set if bit "jumped"
3426 pop hl ;screen at x-offset=0
3428 add hl,bc ;next line
3429 pop bc ;rows counter
3436 ld c,(ix) ;save width
3437 _putsprite: ;putsprite with custom width
3439 bit 7,d ;check sign bit of X
3440 jr z,CSpositive ;X>=0
3443 cp (ix) ;off screen?
3444 ret nc ;X<=-width: don't draw at all
3445 ld b,a ;b=|X|mod 8=1..7=bits to draw
3447 ld a,%11111111 ;all bits set (draw everything)
3449 srl a ;remove first bit in a for each b
3450 dnz CSclipleft ;b=1: a=%01111111
3464 jr CSdisplay ;done clipping
3467 sub 97-8 ;minus (screen width - byte width)
3469 ld a,%11111111 ;clipmask
3470 jr c,CSdisplay ;x+width<128 then entire sprite is on screen
3471 inc b ;b = number of pixels off screen
3473 add a,a ;remove last bit in a for each b
3474 dnz CSclipright ;b=1: a=%11111110
3481 ;b>7: a=%00000000 = off screen
3483 CSdisplay: ;display the sprite ix at (d,e) masked
3484 ld (CSclipmask),a ;set mask
3485 cal findpixel ;convert de to screen location hl:a
3491 psh bc ;save rows to go
3494 ld a,(ix+2) ;load image line
3500 ld a,1 ;saved bitmask
3502 sla c ;test leftmost pixel
3503 jr nc,CSnodraw ;don't draw if it's 0
3504 ld e,a ;psh af: save bitmask
3506 ld (hl),a ;OR pixel with screen
3510 jr nc,CSbitdrawn ;carry set if bit "jumped"
3514 pop hl ;screen at x-offset=0
3516 add hl,bc ;next line
3517 pop bc ;rows counter
3522 ;--------------------------- putbigsprite -----------------------------------=
3525 ;destr: abcdehl+ix (ix=behind sprite; hl:a=right below sprite; b=0; d=width)
3528 jr c,putsprite ;width<=8: just draw the sprite
3535 cal _putsprite ;otherwise draw one column (8 pixels wide)
3537 inc ix ;no x-size to load
3539 add a,d ;8 pixels right
3541 pop bc ;then draw the remaining pixels (c=width-8)
3545 safeputsprite: ;cal putsprite with de intact
3551 ;------------------------------- findpixel -----------------------------------
3552 ;based upon CLEM's fp | 131 cycles | 28 bytes | in:(d,e); out:hla; destr:de
3558 add a,a ;add a,a is 7 cycles faster than add hl,hl
3559 ld h,dispbuffer/$400 ;switch to hl (Y<64) & set base to dispbuffer
3560 PutWhere =$-1 ;screen base position/$400 (where x+y=0)
3563 rra ;RRA: carry flag must be reset!
3564 add hl,hl ;that's what the adds are for :P
3594 ;-----------------------------------------------------------------------------
3595 ;------------------------------- sprites -------------------------------------
3596 ;-----------------------------------------------------------------------------
3598 spr_ship01: ;(normal; up double)
3599 .db 7,7 ;ship alpha class (vic viper)
3602 .db %01111110 ; ██████
3603 .db %11101000 ;███ █
3604 .db %01111110 ; ██████
3609 .db %11001010 ;██ █ █
3610 .db %11110101 ;████ █ █
3611 .db %01111110 ; ██████
3612 .db %11101001 ;███ █ █
3613 .db %01111110 ; ██████
3614 .db %11110101 ;████ █ █
3615 .db %11001010 ;██ █ █
3617 spr_ship02: ;(normal; tail beam)
3618 .db 7,7 ;ship gamma class
3619 .db %11111000 ;█████
3621 .db %11111100 ;██████
3622 .db %11100110 ;███ ██
3623 .db %11111100 ;██████
3625 .db %11111000 ;█████
3628 .db %11111010 ;█████ █
3629 .db %01100001 ; ██ █
3630 .db %11111101 ;██████ █
3631 .db %11100111 ;███ ███
3632 .db %11111101 ;██████ █
3633 .db %01100001 ; ██ █
3634 .db %11111010 ;█████ █
3636 spr_ship03: ;(hardcore; up double)
3637 .db 7,7 ;ship gamma class
3638 .db %11111000 ;█████
3640 .db %11111100 ;██████
3641 .db %11100110 ;███ ██
3642 .db %11111100 ;██████
3644 .db %11111000 ;█████
3647 .db %11111010 ;█████ █
3648 .db %01100001 ; ██ █
3649 .db %11111101 ;██████ █
3650 .db %11100111 ;███ ███
3651 .db %11111101 ;██████ █
3652 .db %01100001 ; ██ █
3653 .db %11111010 ;█████ █
3655 .db 7,7 ;ship delta class (lord british)
3657 .db %11110000 ; ████
3658 .db %11111100 ; ██████
3659 .db %01100010 ; ██ █
3660 .db %11111100 ; ██████
3661 .db %11110000 ; ████
3665 .db %11111100 ; ██████
3666 .db %11110010 ; ████ █
3667 .db %11111101 ; ██████ █
3668 .db %01100011 ; ██ ██
3669 .db %11111101 ; ██████ █
3670 .db %11110010 ; ████ █
3671 .db %11111100 ; ██████
3673 spr_ship04: ;(hardcore; tail beam)
3674 .db 7,7 ;XC1701II ship
3677 .db %11110010 ;████ █
3678 .db %01011110 ; █ ████
3679 .db %11110010 ;████ █
3685 .db %10011100 ;█ ███
3686 .db %11111110 ;███████
3687 .db %01011110 ; █ ████
3688 .db %11111110 ;███████
3689 .db %10011100 ;█ ███
3692 auch_bullet = 1 ;damage to you when hit by an enemy bullet
3693 auch_ground = 5 ;the same but when you hit the ground
3694 auch_collide = 4 ;when you hit an enemy
3695 auch_ecollide = 2*4 ;damage to the enemy that hit you (skip bit 0/1)
3701 .db %01111100 ; █████
3702 .db %01111100 ; █████
3703 .db %01111100 ; █████
3709 .db %01111100 ; █████
3710 .db %11111110 ;███████
3711 .db %11111110 ;███████
3712 .db %11111110 ;███████
3713 .db %01111100 ; █████
3716 ;-------------------------------- explosions ---------------------------------
3718 ;spr_lashit: ;the same as spr_multiple2
3720 ; .db %00111000 ; ███
3721 ; .db %01111100 ; █████
3722 ; .db %11111110 ; ███████
3723 ; .db %11111110 ;▒▒▒███████
3724 ; .db %11111110 ; ███████
3725 ; .db %01111100 ; █████
3726 ; .db %00111000 ; ███
3729 hitsprites = 5 ;btw: sprites stored backwards
3731 .db %10101000 ;█▒█ █
3733 .db %10000000 ;█ ▒ ▒
3734 .db %10101000 ;█▒█▒█
3737 .db %01001000 ; █▒▒█
3738 .db %11010000 ;██ █▒
3739 .db %00101000 ;▒ █ █
3745 .db %10001000 ;█ ▒▒█
3750 .db %00001000 ; ▒▒ █
3764 .db %00111110 ; █████
3765 .db %01010110 ; █ █ ██
3771 .db %01001110 ; █ ▒███
3772 .db %10111110 ;█ █████
3773 .db %01001111 ; █ ▒████
3775 .db %00011010 ; ██ █
3779 .db %01001110 ; █ ███
3780 .db %10110101 ;█ ██▒█▒█
3781 .db %01000101 ; █ ▒█▒█
3782 .db %00111110 ; █████
3783 .db %01011010 ; █ ██ █
3786 .db %00101010 ;▒ █▒█ █
3787 .db %01000110 ; █ ▒██
3788 .db %10110101 ;█ ██ █ █
3789 .db %01100110 ; ██ ██▒
3790 .db %00111100 ; ████▒
3791 .db %01011001 ; █ ██ ▒█
3794 .db %01000000 ; █▒ ▒ ▒
3795 .db %00100101 ; ▒█ █▒█
3796 .db %00010100 ;▒ ▒█ █ ▒
3797 .db %01000100 ; █▒ █
3798 .db %00010010 ; ▒█▒▒█
3799 .db %10011010 ;█▒ ██ █▒
3803 .db %00100000 ; ▒█ ▒ ▒
3804 .db %00000001 ; ▒ ▒ █
3806 .db %00100010 ; █▒ █
3807 .db %01001000 ;▒█ ▒█ ▒
3810 .db %00001000 ; ▒ █▒
3811 .db %11000010 ;██ ▒ █
3813 .db %00100000 ; ▒█ ▒
3814 .db %00000001 ; ▒ ▒█
3815 .db %00110000 ; ▒██▒
3823 .db %00100100 ; █▒ █
3828 .db %00101100 ; █ ██
3829 .db %00011110 ; ████
3830 .db %00110100 ; ██ █
3837 .db %00111010 ; ███ █
3838 .db %01110110 ; ███ ██
3844 .db %00101100 ; █ ██
3845 .db %01100110 ; ██ ██
3846 .db %01001011 ; █ █ ██
3847 .db %00111100 ; ████
3852 .db %01011100 ; █ ███
3853 .db %10010111 ;█ █ ███
3854 .db %01000110 ; █ ██
3859 .db %00111100 ; ████
3860 .db %01001111 ; █ ████
3861 .db %10100011 ;█ █ ██
3862 .db %11000110 ;██ ██
3863 .db %01110101 ; ███ █ █
3867 .db %00101110 ; █ ███
3869 .db %01000101 ; █ █ █
3870 .db %10100011 ;█ █ ██
3871 .db %01000110 ; █ ██
3875 .db %00110110 ; ██ ██
3877 .db %10001001 ;█ █ █
3878 .db %01100001 ; ██ █
3880 .db %01010001 ; █ █ █
3890 ;--------------------------------- bullets -----------------------------------
3893 .db (spr_bullet01-spr_bullet01) ;0
3894 .db (spr_bullet02-spr_bullet01) ;4
3895 .db (spr_bullet03-spr_bullet01) ;8
3896 .db (spr_bullet04-spr_bullet01) ;12
3897 .db (spr_bullet05-spr_bullet01) ;16
3898 .db (spr_bullet06-spr_bullet01) ;20
3899 .db (spr_bullet07-spr_bullet01) ;24
3900 .db (spr_bullet08-spr_bullet01) ;28
3901 .db (spr_bullet09-spr_bullet01) ;32
3902 .db (spr_bullet10-spr_bullet01) ;36
3903 .db (spr_bullet11-spr_bullet01) ;40
3904 .db (spr_bullet12-spr_bullet01) ;44
3905 .db (spr_bullet13-spr_bullet01) ;48
3912 .db %11110000 ;▒████
3919 .db %10110000 ;▒█▒██
3920 .db %10110000 ;▒█▒██
3924 .db %11110000 ;▒████
3929 .db %11111000 ;▒█████
3933 .db %01110000 ; ▒███
3934 .db %11111000 ;▒█████
3935 .db %01110000 ; ▒███
3938 .db %11110000 ;▒████
3939 .db %11111000 ;▒█████
3940 .db %11110000 ;▒████
3944 .db %10111000 ;▒█▒███
3945 .db %01111000 ; ▒████
3949 .db %00111000 ; ▒███
3950 .db %01111100 ; ▒█████
3951 .db %11111100 ;▒██████
3956 .db %11111100 ;▒██████
3957 .db %00111110 ; ▒█████
3958 .db %01111100 ; ▒█████
3963 .db %11111100 ;▒██████
3964 .db %00111110 ; ▒█████
3965 .db %01111110 ; ▒██████
3966 .db %11111100 ;▒██████
3967 .db %00111000 ; ▒███
3970 .db %00111100 ; ▒████
3971 .db %11111110 ;▒███████
3972 .db %01111111 ; ▒███████
3973 .db %00011111 ; ▒█████
3974 .db %01111111 ; ▒███████
3975 .db %11111110 ;▒███████
3976 .db %00111100 ; ▒████
3981 .db %11110000 ; ████
3985 .db 4,3 ;enemy bullets
3987 .db %11110000 ;████▒
3990 ;format:[min.damage] [dam.inc] [000:direction 00000:speed] [offset]
3991 ;damage = min.damage + dam.inc*incs (0<=incs<=6)
3992 ;speed in pixels/frame (>=%10010=forward; <=%01110=backwards)
3993 ;direction: 001=straight forward; 010=up; 011=1/2up; 100=down; 101=1/2down
3994 ; 111=laser (speed=duration 00010-00000)
3996 weapondata: ;max = 9x6; 15x5; 21x4; 27x3
3997 .db 2,1,%00110010,3,%00000000,0,%00000000,0 ;1 single (1x2+1) 2
3998 .db 3,1,%00110011,3,%00000000,0,%00000000,0 ;2 fast (1x3+1) 3
3999 .db 2,1,%00110010,0,%00110010,6,%00000000,0 ;3 double (2x2+1) 4
4000 .db 2,1,%01110010,2,%10010010,2,%00110010,2 ;4 triple (3x2+1) 6
4001 .db 3,2,%00110011,2,%10010010,2,%01110010,2 ;5 (3x3+2) 9
4002 .db 4,2,%01110011,2,%10010011,2,%00110011,2 ;6 (3x4+2) 12
4003 .db 5,3,%01110100,2,%10010100,2,%00110100,2 ;7 (3x5+3) 15
4004 .db 7,4,%01110101,2,%10010101,2,%00110101,2 ;8 (3x7+4) 21
4005 .db 9,6,%01110110,2,%10010110,2,%00110110,2 ;9 (3x9+6) 27
4007 .db 1,1,%11100100,3,%00000000,0,%00000000,0 ;1 single (1x1x3) 3
4008 .db 2,3,%11100011,3,%00000000,0,%00000000,0 ;2 short (2x1x2) 4
4009 .db 1,2,%11100100,3,%11100000,4,%00000000,0 ;3 fat (1x2x3) 6
4010 .db 1,2,%11100101,0,%11100000,6,%00000000,0 ;4 double (1x2x4) 8
4011 .db 4,4,%11100011,3,%00000000,0,%00000000,0 ;5 short (4x1x2) 8
4012 .db 1,2,%11100100,3,%11100000,6,%11100000,0 ;6 triple (1x3x3) 9
4013 .db 1,3,%11101000,3,%11100000,6,%11100000,0 ;7 triple long(1x3x7) 21
4014 .db 2,5,%11100101,2,%11100000,4,%00000000,0 ;8 double (2x2x4) 32
4015 .db 1,9,%11101100,3,%11100000,2,%11100000,4 ;9 big fat lng(1x3xB) 33
4017 tailbeam = %00101101 ;180 degrees
4018 doublebeam = %01010010 ;45 degrees
4020 .db 3 ;tail/double yposition
4022 ;------------------------------------ bar ------------------------------------
4027 .db 5,3 ;li'l ship indicating lives left
4028 .db %11100000 ;███ ▒▒▒
4029 .db %01111000 ; ████ ▒▒▒▒
4030 .db %11100000 ;███ ▒▒▒
4031 lshipsize = 5 ;space between two ship icons
4034 .db 16,7 ;selected.......:.......:
4035 .db %11111111 ;████████████████
4041 .db %11111111 ;████████████████
4051 .db 15,7 ;unused .......:.......:
4053 .db %10111111 ;█ █████████████
4054 .db %10101010 ;█ █ █ █ █ █ █ █
4055 .db %10110101 ;█ ██ █ █ █ █ ██
4056 .db %10101010 ;█ █ █ █ █ █ █ █
4057 .db %10111111 ;█ █████████████
4067 ; .db 16,7 ;shield .......:.......:
4068 ; .db %10001111 ;█ ███████ █ ▒
4069 ; .db %10011001 ;█ ██ █████ █ ▒
4070 ; .db %10111100 ;█ ████ ████ █ ▒
4071 ; .db %10111000 ;█ ███ █ ██ █ ▒
4072 ; .db %10111100 ;█ ████ ████ █ ▒
4073 ; .db %10011001 ;█ ██ █████ █ ▒
4074 ; .db %10001111 ;█ ███████ █ ▒
4083 maxarmor = 63 ;maximum HPs you can get
4085 ; .db 16,6 ;tailbeam.......:.......:
4086 ; .db %10000000 ;█ ▒
4087 ; .db %10000011 ;█ ██ ▒
4088 ; .db %10000001 ;█ ███ ▒
4089 ; .db %10111011 ;█ ███ ███ ██ ██▒
4090 ; .db %10000001 ;█ ███ ▒
4091 ; .db %10000011 ;█ ██ ▒
4092 ; .db %10000000 ;█ ▒
4100 .db 16,7 ;updouble.......:.......:
4101 .db %10000000 ;█ ██ ▒
4102 .db %10000000 ;█ ██ ▒
4103 .db %10110000 ;█ ██ ██ ▒
4104 .db %10011100 ;█ ███ ▒
4105 .db %10111011 ;█ ███ ██ ████ ▒
4106 .db %10011100 ;█ ███ ▒
4107 .db %10110000 ;█ ██ ▒
4115 .db 16,7 ;laser .......:.......:
4117 .db %10001010 ;█ █ █ ▒▒▒ ▒
4118 .db %11101100 ;███ ██ ▒▒▒ ▒
4119 .db %11110111 ;████ ███████▒▒▒█▒
4120 .db %11101100 ;███ ██ ▒▒▒ ▒
4121 .db %10001010 ;█ █ █ ▒▒▒ ▒
4129 .db 11,7 ;bullets .......:.......:
4130 .db %10000000 ;█ ██ ▒
4131 .db %10000011 ;█ █████ ▒▒▒ ▒
4132 .db %10011000 ;█ ██ ██ ▒▒▒ ▒
4133 .db %11111100 ;██████ ▒▒▒ ▒
4134 .db %10011000 ;█ ██ ██ ▒▒▒ ▒
4135 .db %10000011 ;█ █████ ▒▒▒ ▒
4136 .db %10000000 ;█ ██ ▒
4146 .db 16,7 ;multiple.......:.......:
4147 .db %10000011 ;█ ███ ▒
4148 .db %10000001 ;█ ████ ██ ▒
4149 .db %10000001 ;█ ████ ▒
4150 .db %10000011 ;█ ███ ▒
4151 .db %10011000 ;█ ██ ▒
4152 .db %10111100 ;█ ████ ██ ██▒
4153 .db %10011000 ;█ ██ ▒
4166 .db 3,3 ;li'l ship indicating lives left
4167 .db %11000000 ;██ ▒▒
4168 .db %01100000 ; ██ ▒▒
4169 .db %11000000 ;██ ▒▒
4170 lshipsize = 3 ;space between two ship icons
4173 .db 10,7 ;selected.......:.......:
4174 .db %11111111 ;███████████
4180 .db %11111111 ;███████████
4190 .db 9,7 ;unused .......:.......:
4192 .db %10111111 ;█ ███████
4193 .db %10101010 ;█ █ █ █ █
4194 .db %10110101 ;█ ██ █ ██
4195 .db %10101010 ;█ █ █ █ █
4196 .db %10111111 ;█ ███████
4205 maxarmor = 63 ;maximum HPs you can get
4207 .db 5,7 ;laser .......:.......:
4209 .db %10100000 ;█ █ ▒▒▒ ▒
4210 .db %10100000 ;█ █ ▒▒▒ ▒
4211 .db %10100000 ;█ █ ▒▒▒ ▒
4212 .db %10100000 ;█ █ ▒▒▒ ▒
4213 .db %10111000 ;█ ███ ▒▒▒ ▒
4216 .db 5,7 ;bullets .......:.......:
4218 .db %10110000 ;█ ██ ▒▒▒ ▒
4219 .db %10101000 ;█ █ █ ▒▒▒ ▒
4220 .db %10110000 ;█ ██ ▒▒▒ ▒
4221 .db %10101000 ;█ █ █ ▒▒▒ ▒
4222 .db %10110000 ;█ ██ ▒▒▒ ▒
4225 .db 7,7 ;multiple.......:.......:
4227 .db %10100010 ;█ █ █ ▒
4228 .db %10110110 ;█ ██ ██ ▒
4229 .db %10101010 ;█ █ █ █ ▒
4230 .db %10100010 ;█ █ █ ▒
4231 .db %10100010 ;█ █ █ ▒
4238 .db 128,128,128,128,128,128,128 ;128 = %10000000
4240 ;---------------------------- texts ------------------------------------------
4243 txt_email: .db 127," www.shiar.org ",127,0 ;title screen
4245 txt_about: .db "v1.0.C21 ",127," by Shiar",0 ;right behind txt_email
4249 txt_email: .db "www.shiar.org ",127 ;title screen
4250 .db " shiar0@hotmail.com",0
4251 _txt_email = $3A01 ;$3A1E=just email
4252 txt_about: .db "v1.0.C21 ",127," by Shiar",0 ;right behind txt_email
4256 txt_menu1: .db "NEW GAME",0
4257 txt_menu2: .db "CONTINUE",0
4259 txt_difhardcore:.db "Hardcore!",0
4260 txt_difnormal: .db "Normal",0
4261 txt_shpbeam: .db "Beam",0
4262 txt_shplaser: .db "Laser",0
4264 txt_level: .db "LEVEL ",0 ;new level screen
4265 txt_lives: .db "Lx0",0
4266 txt_savekey: .db "Press [F1] to save",0
4268 txt_gameover: .db "GAME OVER!",0 ;game over screen
4269 txt_score: .db "Score",0
4270 txt_hiscore: .db "Hiscore",0
4272 txt_pause: .db " ",6,"/",7," ",$1C,"contrast; "
4273 .db "F1",$1C,"B",$CF,5,"W Mode",0
4275 txt_pressenter: .db "Enter to continue",0 ;pause
4276 _txt_pressenter = $0201
4278 txt_teacher: .db "(2",Lpi,"*.98)/sin 13",0 ;teacher
4279 txt_teacherans: .db Lneg,"14.6549373495",0
4282 ;------------------------------ levels data ----------------------------------
4284 ;format:boss: [moveType] [enemyType]
4285 ; @level: [nr.dif.enemies]x [enemy nr]
4286 ; [min. enemy frequency] [enemy frequency max.inc]
4287 ; [next lvl (=nrenemies+4)] [level_info: 0000000 1:ground]
4288 ; [tunnel size] [groundtype] [stars1] [stars2]
4289 ;efrequency must be odd if halfluring!
4293 levelstart: ;[y-pos] [x-pos] [text,0] [SFX lines; 0=more text] [-1=end]
4294 .db 28,35,"COSMIC YEAR 6718",0,28-28+6
4295 .db 10,8,"INTELLIGENCE REPORTS ",
4297 .db 17,7,"FORCES ARE BUILDING A ",
4298 .db "NEW VESSEL",0,0
4299 .db 33,32,"A POWERFUL VESSEL",0,0
4300 .db 40,15,"THAT COULD EASILY DESTROY",
4302 .db 47,36,"ONCE COMPLETED",0,47-10+6
4304 .db 22,1,"YOU HAVE TO GO INTO THE ",
4305 .db "HEART OF THEIR",0,0
4306 .db 28,1,"SPACE AND DESTROY THE VESSEL",
4308 .db 34,22,"IT BECOMES OPERATIONAL.",0,34-22+6
4309 .db 25,56,"GOOD",0,0
4310 .db 32,56,"LUCK",0,32-25+6
4333 level03:.db 4,4,5,6,7
4338 .db 25,2,"LONG-RANGE SCANNERS ARE ",
4340 .db 32,2,"LOTS OF ENEMY VESSELS ",
4341 .db "APPROACHING",0,32-25+6
4342 .db 22,9,"I'M CHANGING COURSE TO A",
4344 .db 28,4,"ASTEROID BELT AND TRY TO ",
4346 .db 34,48,"INTHERE...",0,34-22+6
4350 level04: ;approaching asteroid belt
4356 level05: ;inside belt
4357 .db 7,10,11,9,11,12,12,14
4362 level06: ;(deep inside)
4363 .db 10,10,11,12,12,14,13,13,14,15,15
4368 .db 28,6,"APPROACHING BACTERION ",
4370 .db 25,10,"READING LOTS OF ENEMY ",
4372 .db 32,24,"ON AN INTERCEPT COURSE",0,32-25+6
4376 level07:.db 4,16,17,18,6
4378 .db %0,0,1,1 ;-1=%11111111=line
4381 level08:.db 5,16,17,18,19,19
4386 level09: ;lot of triples
4392 level10: ;likely no pickups here (hard)
4393 .db 7,22,23,24,24,24,25,26
4398 .db 24,18,"REACHED THEIR HOMEPLANET",0,0
4399 .db 33,18,"SCANNING FOR THE VESSEL...",0,33-24+6
4403 level11: ;planet level
4404 .db 8,27,27,28,28,29,29,29,30
4409 level12: ;planet level 2
4415 .db 18,11,"ENEMY VESSEL STRAIGHT "
4417 .db 25,16,"IT SEEMS TO BE "
4418 .db "OPERATIONAL!!",0,0
4419 .db 33,19,"WELL YOU'VE COME THIS "
4421 .db 39,8,"TRY TO DESTROY IT, OR DIE "
4422 .db "TRYING....",0,39-18+6
4432 .db 1,1,"Thats all folks...",0,0
4433 .db 20,50,"for now...",0,20-1+6
4440 ;------------------------------ enemies --------------------------------------
4442 ;format: [HP64] [000000:HP 00:occ] [sprite] [xpos] [appearance(ypos)]
4443 ; [movetype] [time2fire] [firefreq] [firetype]
4444 ;occ: %00=no enemy; 01=exploding (sprite=frame); 10=pickup; 11=enemy
4445 ;appearances: 0+=ypos; -1=random; -2=lure; -3=halflure
4446 ;movetypes: 0=1x; 1=updown; 2=0.25x; 3=0.5x; 4=0.75x; 5=1.25x; 6=1.5x;
4447 ; 7=2x; 8=3x; 9=ylure50%; 10=ylure; 11=ylure50%; 12=x+y-lure 50%;
4448 ; 13=-1/2x; 14=-1x; 16=boss; 17=right+1
4449 ;firetypes: 1=normal; 2=down; 3=up; 4=1/2down; 5=1/2up; 6=aiming(2-5);
4450 ; 7=triple; 8=double; 9=wide5; 10=wide7; 11=ran; 12=10+enemies
4451 ; 13=base; 14=ranY; 15=wide3; 16=5x
4453 enemyspecs: ;10 bytes/enemy | max.enemies <64 | sprites use <768 bytes
4456 .db 0,%00000010,spr_enemyP1&255,spr_enemyP1/256,128,-2,03, 0, 0,1 ;pickup
4457 .db 0,%00000110,spr_enemyP2&255,spr_enemyP2/256,128,-2,03, 0, 0,1 ;bigpickup
4458 ;2-7=basic enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4459 .db 0,%00001011,spr_enemyE0&255,spr_enemyE0/256,128,-1,00,12, 0,1 ;intro
4460 .db 0,%00100011,spr_enemyE1&255,spr_enemyE1/256,128,-1,00,10, 0,1 ;weak
4461 .db 0,%01100011,spr_enemyE4&255,spr_enemyE4/256,128,-1,03, 6,50,1 ;slow
4462 .db 0,%01001011,spr_enemyE2&255,spr_enemyE2/256,128,-1,00, 1, 0,1
4463 .db 0,%01011011,spr_enemyE3&255,spr_enemyE3/256,128,-3,00,19,39,8 ;heavy
4464 .db 0,%01010011,spr_enemyE5&255,spr_enemyE5/256,128,-3,05, 1, 0,1 ;fast
4465 ;8-10=backwards enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4466 .db 0,%00111011,spr_enemyB1&255,spr_enemyB1/256,000,-3,13,19,92,1
4467 .db 0,%01011011,spr_enemyB2&255,spr_enemyB2/256,000,-1,14,11,45,1
4468 .db 0,%01101011,spr_enemyB3&255,spr_enemyB3/256,000,-1,13,10,41,8 ;small
4469 ;11-15=asteroid ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4470 .db 0,%01001011,spr_enemyA1&255,spr_enemyA1/256,128,-1,04, 0, 0,1
4471 .db 0,%01111011,spr_enemyA2&255,spr_enemyA2/256,128,-1,00, 0, 0,1
4472 .db 0,%10110011,spr_enemyA3&255,spr_enemyA3/256,128,-1,06, 0, 0,1
4473 .db 1,%00010011,spr_enemyA4&255,spr_enemyA4/256,128,-1,03, 0, 0,1 ;slow+hard
4474 .db 0,%01111011,spr_enemyA4&255,spr_enemyA4/256,128,-1,07, 0, 0,1
4475 ;16-21=improved enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4476 .db 0,%10010011,spr_enemyG1&255,spr_enemyG1/256,128,-3,00, 3,40,1
4477 .db 0,%10111011,spr_enemyG2&255,spr_enemyG2/256,128,-3,00, 1,36,1
4478 .db 0,%01100011,spr_enemyG5&255,spr_enemyG5/256,128,-1,01, 9,52,1 ;updown
4479 .db 0,%11110011,spr_enemyG3&255,spr_enemyG3/256,128,-3,04, 7,99,15 ;3x
4480 .db 1,%01101011,spr_enemyG4&255,spr_enemyG4/256,128,-2,01,17, 0,15 ;updown3x
4481 .db 1,%00010011,spr_enemyG6&255,spr_enemyG6/256,128,-2,09,62,60,8 ;lure
4482 ;22-26=hi-speed ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4483 .db 1,%00010011,spr_enemyS2&255,spr_enemyS2/256,128,-2,06, 3,32,8 ;fast
4484 .db 0,%11111011,spr_enemyS1&255,spr_enemyS1/256,128,-3,09, 2,28,1 ;lure
4485 .db 1,%00101011,spr_enemyS4&255,spr_enemyS4/256,128,-3,07, 0, 0,1 ;vfast+nofire
4486 .db 1,%01110011,spr_enemyS3&255,spr_enemyS3/256,128,-1,09, 1,20,8 ;lure+
4487 .db 0,%11011011,spr_enemyS2&255,spr_enemyS2/256,128,-2,01, 3,7,11 ;updown+ran
4488 ;27-29=hyper ,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4489 .db 1,%00001011,spr_enemyN1&255,spr_enemyN1/256,128,-1,07, 0, 0,1
4490 .db 1,%00010111,spr_enemyN2&255,spr_enemyN2/256,128,-2,07, 0, 0,1
4491 .db 1,%00001111,spr_enemyN3&255,spr_enemyN3/256,128,-1,08, 0, 0,1 ;xfast
4492 ;30-31=turrets,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4493 .db 1,%10001111,spr_enemyT1&255,spr_enemyT1/256,128,-4,00, 1,15,3 ;turret L
4494 .db 1,%11011011,spr_enemyT1&255,spr_enemyT1/256,128,-4,00, 1,16,5 ;turret l
4496 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,128, 0, 0, 0, 0,0
4497 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,128, 0, 0, 0, 0,0
4498 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,128, 0, 0, 0, 0,0
4499 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,128, 0, 0, 0, 0,0
4500 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,128, 0, 0, 0, 0,0
4501 ;37-38=final boss' enemy,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4502 .db 0,%11110011,spr_enemyM1&255,spr_enemyM1/256,128,-3,01, 0, 0,1 ;moving
4503 .db 0,%11110011,spr_enemyM1&255,spr_enemyM1/256,128,23,11, 0, 0,1 ;mid+lure
4504 ;39=misc ,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4505 .db -1,%11111111,spr_enemyM2&255,spr_enemyM2/256,128,-2,08, 0, 0,1 ;bullet
4508 ;40-44=first bosses ,spr_ &255,spr_ /256, X, Y, d,WT,WF,W
4509 .db 2,%01000111,spr_boss01&255,spr_boss01 /256,127,-1,11,35,48,15 ;triple
4510 .db 2,%01010011,spr_boss02&255,spr_boss02 /256,127,-1,11,20,12,1 ;single
4511 .db 2,%11011011,spr_boss03&255,spr_boss03 /256,127,-1,10,15, 8,8 ;double
4512 .db 3,%00111111,spr_boss04&255,spr_boss04 /256,127,-3,12,10,11,1 ;Flure
4513 .db 4,%01011011,spr_boss05&255,spr_boss05 /256,000,-2,17, 1,3,11 ;ranfire
4514 ;45-46=asteroid bosses ,spr_ &255,spr_ /256, X, Y, , , ,
4515 .db 5,%01101111,spr_bossA1&255,spr_bossA1 /256,127,-2,12,28,14,7 ;Flure
4516 .db 20,%00011111,spr_bossA2&255,spr_bossA2 /256,119,00,16,31, 3,14 ;fullscreen
4517 ;47-51=big bosses ,spr_ &255,spr_ /256, X, Y, , , ,
4518 .db 4,%00010111,spr_boss07&255,spr_boss07 /256,127,-3,10,31, 8,16 ;5x
4519 .db 6,%10001111,spr_boss08&255,spr_boss08 /256,127,-1,10,18, 8,9 ;quad
4520 .db 3,%10111011,spr_boss06&255,spr_boss06 /256,127,-2,12, 1, 4,1 ;weak+rapidfire
4521 .db 7,%11101011,spr_boss09&255,spr_boss09 /256,127,-1,10,21, 9,10 ;6x
4522 .db 9,%11011011,spr_boss10&255,spr_boss10 /256,127,-1,10,12,11,12 ;enemies
4525 .db 0,%00000010,spr_enemyP1&255,spr_enemyP1/256,96,-2,03, 0, 0,1 ;pickup
4526 .db 0,%00000110,spr_enemyP2&255,spr_enemyP2/256,96,-2,03, 0, 0,1 ;bigpickup
4527 ;2-7=basic enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4528 .db 0,%00001011,spr_enemyE0&255,spr_enemyE0/256,96,-1,00,12, 0,1 ;intro
4529 .db 0,%00100011,spr_enemyE1&255,spr_enemyE1/256,96,-1,00,10, 0,1 ;weak
4530 .db 0,%01100011,spr_enemyE4&255,spr_enemyE4/256,96,-1,03, 6,50,1 ;slow
4531 .db 0,%01001011,spr_enemyE2&255,spr_enemyE2/256,96,-1,00, 1, 0,1
4532 .db 0,%01011011,spr_enemyE3&255,spr_enemyE3/256,96,-3,00,19,39,8 ;heavy
4533 .db 0,%01010011,spr_enemyE5&255,spr_enemyE5/256,96,-3,05, 1, 0,1 ;fast
4534 ;8-10=backwards enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4535 .db 0,%00111011,spr_enemyB1&255,spr_enemyB1/256,00,-3,13,19,92,1
4536 .db 0,%01011011,spr_enemyB2&255,spr_enemyB2/256,00,-1,14,11,45,1
4537 .db 0,%01101011,spr_enemyB3&255,spr_enemyB3/256,00,-1,13,10,41,8 ;small
4538 ;11-15=asteroid ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4539 .db 0,%01001011,spr_enemyA1&255,spr_enemyA1/256,96,-1,04, 0, 0,1
4540 .db 0,%01111011,spr_enemyA2&255,spr_enemyA2/256,96,-1,00, 0, 0,1
4541 .db 0,%10110011,spr_enemyA3&255,spr_enemyA3/256,96,-1,06, 0, 0,1
4542 .db 1,%00010011,spr_enemyA4&255,spr_enemyA4/256,96,-1,03, 0, 0,1 ;slow+hard
4543 .db 0,%01111011,spr_enemyA4&255,spr_enemyA4/256,96,-1,07, 0, 0,1
4544 ;16-21=improved enemies ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4545 .db 0,%10010011,spr_enemyG1&255,spr_enemyG1/256,96,-3,00, 3,40,1
4546 .db 0,%10111011,spr_enemyG2&255,spr_enemyG2/256,96,-3,00, 1,36,1
4547 .db 0,%01100011,spr_enemyG5&255,spr_enemyG5/256,96,-1,01, 9,52,1 ;updown
4548 .db 0,%11110011,spr_enemyG3&255,spr_enemyG3/256,96,-3,04, 7,99,15 ;3x
4549 .db 1,%01101011,spr_enemyG4&255,spr_enemyG4/256,96,-2,01,17, 0,15 ;updown3x
4550 .db 1,%00010011,spr_enemyG6&255,spr_enemyG6/256,96,-2,09,62,60,8 ;lure
4551 ;22-26=hi-speed ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4552 .db 1,%00010011,spr_enemyS2&255,spr_enemyS2/256,96,-2,06, 3,32,8 ;fast
4553 .db 0,%11111011,spr_enemyS1&255,spr_enemyS1/256,96,-3,09, 2,28,1 ;lure
4554 .db 1,%00101011,spr_enemyS4&255,spr_enemyS4/256,96,-3,07, 0, 0,1 ;vfast+nofire
4555 .db 1,%01110011,spr_enemyS3&255,spr_enemyS3/256,96,-1,09, 1,20,8 ;lure+
4556 .db 0,%11011011,spr_enemyS2&255,spr_enemyS2/256,96,-2,01, 3,7,11 ;updown+ran
4557 ;27-29=hyper ,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4558 .db 1,%00001011,spr_enemyN1&255,spr_enemyN1/256,96,-1,07, 0, 0,1
4559 .db 1,%00010111,spr_enemyN2&255,spr_enemyN2/256,96,-2,07, 0, 0,1
4560 .db 1,%00001111,spr_enemyN3&255,spr_enemyN3/256,96,-1,08, 0, 0,1 ;xfast
4561 ;30-31=turrets,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4562 .db 1,%10001111,spr_enemyT1&255,spr_enemyT1/256,96,-4,00, 1,15,3 ;turret L
4563 .db 1,%11011011,spr_enemyT1&255,spr_enemyT1/256,96,-4,00, 1,16,5 ;turret l
4565 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,96, 0, 0, 0, 0,0
4566 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,96, 0, 0, 0, 0,0
4567 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,96, 0, 0, 0, 0,0
4568 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,96, 0, 0, 0, 0,0
4569 .db 0,%00000011,spr_enemy00&255,spr_enemy00/256,96, 0, 0, 0, 0,0
4570 ;37-38=final boss' enemy,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4571 .db 0,%11110011,spr_enemyM1&255,spr_enemyM1/256,96,-3,01, 0, 0,1 ;moving
4572 .db 0,%11110011,spr_enemyM1&255,spr_enemyM1/256,96,23,11, 0, 0,1 ;mid+lure
4573 ;39=misc ,% ,spr_enemy &255,spr_enemy /256, X, Y, d,WT,WF,W
4574 .db -1,%11111111,spr_enemyM2&255,spr_enemyM2/256,96,-2,08, 0, 0,1 ;bullet
4577 ;40-44=first bosses ,spr_ &255,spr_ /256, X, Y, d,WT,WF,W
4578 .db 2,%01000111,spr_boss01&255,spr_boss01 /256,95,-1,11,35,48,15 ;triple
4579 .db 2,%01010011,spr_boss02&255,spr_boss02 /256,95,-1,11,20,12,1 ;single
4580 .db 2,%11011011,spr_boss03&255,spr_boss03 /256,95,-1,10,15, 8,8 ;double
4581 .db 3,%00111111,spr_boss04&255,spr_boss04 /256,95,-3,12,10,11,1 ;Flure
4582 .db 4,%01011011,spr_boss05&255,spr_boss05 /256,00,-2,17, 1,3,11 ;ranfire
4583 ;45-46=asteroid bosses ,spr_ &255,spr_ /256, X, Y, , , ,
4584 .db 5,%01101111,spr_bossA1&255,spr_bossA1 /256,95,-2,12,28,14,7 ;Flure
4585 .db 20,%00011111,spr_bossA2&255,spr_bossA2 /256,87,00,16,31, 3,14 ;fullscreen
4586 ;47-51=big bosses ,spr_ &255,spr_ /256, X, Y, , , ,
4587 .db 4,%00010111,spr_boss07&255,spr_boss07 /256,95,-3,10,31, 8,16 ;5x
4588 .db 6,%10001111,spr_boss08&255,spr_boss08 /256,95,-1,10,18, 8,9 ;quad
4589 .db 3,%10111011,spr_boss06&255,spr_boss06 /256,95,-2,12, 1, 4,1 ;weak+rapidfire
4590 .db 7,%11101011,spr_boss09&255,spr_boss09 /256,95,-1,10,21, 9,10 ;6x
4591 .db 9,%11011011,spr_boss10&255,spr_boss10 /256,95,-1,10,12,11,12 ;enemies
4597 .db %00111111 ; ██████
4598 .db %01100001 ; ██ ██
4599 .db %10001100 ;█ ██ █
4600 .db %10111111 ;█ ██████ █
4601 .db %10111111 ;█ ██████ █
4602 .db %10001100 ;█ ██ █
4603 .db %01100001 ; ██ ██
4604 .db %00111111 ; ██████
4614 .db 11,9 ;big pickup
4615 .db %00111111 ; ███████
4616 .db %01100000 ; ██ ██
4617 .db %10001110 ;█ ███ █
4618 .db %10111011 ;█ ███ ███ █
4619 .db %10100000 ;█ █ █ █
4620 .db %10111011 ;█ ███ ███ █
4621 .db %10001110 ;█ ███ █
4622 .db %01100000 ; ██ ██
4623 .db %00111111 ; ███████
4639 .db %01101000 ; ██ █
4640 .db %10110100 ;█ ██ █
4641 .db %01101000 ; ██ █
4646 .db %00111100 ; ████
4648 .db %10111000 ;█ ███
4650 .db %10111000 ;█ ███
4652 .db %00111100 ; ████
4655 .db %00111100 ; ████
4660 .db %00111100 ; ████
4662 .db 6,6 ;normal solid (Galaxian enemy)
4663 .db %00111100 ; ████
4668 .db %00111100 ; ████
4672 .db %01101000 ; ██ █
4676 .db %01101000 ; ██ █
4681 .db %01111000 ; ████
4684 .db %01111000 ; ████
4688 .db 6,6 ;solid backwards
4691 .db %01010100 ; █ █ █
4692 .db %01010100 ; █ █ █
4699 .db %01110100 ; ███ █
4701 .db %01110100 ; ███ █
4708 .db %01111000 ; ████
4710 .db %01111000 ; ████
4715 .db 7,6 ;asteroid one
4717 .db %01101100 ; ██ ██
4718 .db %10011110 ;█ ████
4719 .db %11111010 ;█████ █
4720 .db %10111100 ;█ ████
4723 .db 8,7 ;asteroid two
4724 .db %00111100 ; ████
4725 .db %01011010 ; █ ██ █
4726 .db %01101101 ; ██ ██ █
4727 .db %11111101 ;██████ █
4728 .db %11111111 ;████████
4729 .db %10110110 ;█ ██ ██
4732 .db 8,8 ;asteroid three
4733 .db %00011110 ; ████
4734 .db %01110011 ; ███ ██
4735 .db %01111101 ; █████ █
4736 .db %10110111 ;█ ██ ███
4737 .db %11111110 ;███████
4738 .db %11111101 ;██████ █
4739 .db %01010111 ; █ █ ███
4742 .db 7,6 ;asteroid four
4743 .db %01111000 ; ████
4744 .db %10110110 ;█ ██ ██
4745 .db %11111101 ;██████ █
4746 .db %01111011 ; ████ ██
4747 .db %01001110 ; █ ███
4752 .db %00011111 ; █████
4754 .db %10110100 ;█ ██ █
4755 .db %10110100 ;█ ██ █
4757 .db %00011111 ; █████
4759 .db 8,6 ;smaller nacelles
4760 .db %00010111 ; █ ███
4761 .db %01101100 ; ██ ██
4762 .db %10110100 ;█ ██ █
4763 .db %10110100 ;█ ██ █
4764 .db %01101100 ; ██ ██
4765 .db %00010111 ; █ ███
4768 .db %00001111 ; ████
4769 .db %01110100 ; ███ █
4770 .db %10011100 ;█ ███
4771 .db %10011100 ;█ ███
4772 .db %01110100 ; ███ █
4773 .db %00001111 ; ████
4775 .db 8,6 ;G-Type solid
4776 .db %00111101 ; ███ █
4777 .db %01111000 ; ████
4778 .db %11110100 ;████ █
4779 .db %11110100 ;████ █
4780 .db %01111000 ; ████
4781 .db %00111101 ; ███ █
4784 .db %01111100 ; █████
4786 .db %10101000 ;█ █ █
4787 .db %10101000 ;█ █ █
4789 .db %01111100 ; █████
4792 .db %00001111 ; ████
4793 .db %01110100 ; ███ █
4794 .db %10011010 ;█ ██ █
4795 .db %01110100 ; ███ █
4796 .db %00001111 ; ████
4801 .db %01111100 ; █████
4802 .db %11111000 ; █████
4803 .db %11111000 ; █████
4804 .db %01111100 ; █████
4807 .db 7,6 ;some attack vessel
4809 .db %01110010 ; ███ █
4810 .db %10101100 ; █ █ ██
4811 .db %10101100 ; █ █ ██
4812 .db %01110010 ; ███ █
4815 .db 7,6 ;interceptor
4816 .db %00011110 ; ████
4817 .db %01111110 ; ██████
4818 .db %11111100 ; ██████
4819 .db %11111100 ; ██████
4820 .db %01111110 ; ██████
4821 .db %00011110 ; ████
4823 .db 8,6 ;fast interceptor
4824 .db %00011011 ; ██ ██
4825 .db %01110110 ; ███ ██
4826 .db %10111100 ; █ ████
4827 .db %10111100 ; █ ████
4828 .db %01110110 ; ███ ██
4829 .db %00011011 ; ██ ██
4832 .db 8,7 ;some cool Nemesis-MSX enemy
4833 .db %00111110 ; █████
4834 .db %11110001 ;████ █
4836 .db %00010101 ; █ █ █
4838 .db %11110001 ;████ █
4839 .db %00111110 ; █████
4842 .db %00111110 ; █████
4843 .db %00011101 ; ███ █
4844 .db %11111111 ;████ ███
4845 .db %01110110 ; ██ ███
4846 .db %11111111 ;████ ███
4847 .db %00011101 ; ███ █
4848 .db %00111110 ; █████
4850 .db 8,7 ;Nem3MSX jumper lvl#3
4851 .db %10111110 ;█ █████
4852 .db %01011101 ; █ ███ █
4853 .db %01111110 ; ██████
4855 .db %01111110 ; ██████
4856 .db %01011101 ; █ ███ █
4857 .db %10111110 ;█ █████
4859 .db 8,8 ;Stolen from XC1701II
4860 .db %01111110 ; ██████
4861 .db %11110101 ;████ █ █
4862 .db %00011111 ; █████
4863 .db %00111101 ; ████ █
4864 .db %00111001 ; ███ █
4865 .db %00011111 ; █████
4866 .db %11110101 ;████ █ █
4867 .db %01111110 ; ██████
4869 .db 7,8 ;Stolen from XC1701II
4870 .db %00111100 ; ████
4871 .db %01010010 ; █ █ █
4872 .db %11111110 ;███████
4873 .db %01001010 ; █ █ █
4874 .db %01011010 ; █ ██ █
4875 .db %11111110 ;███████
4876 .db %01010010 ; █ █ █
4877 .db %01111100 ; ████
4880 .db 8,7 ;turret left
4884 .db %01011100 ; █ ███
4885 .db %10110110 ;█ ██ ██
4886 .db %01011010 ; █ ██ █
4887 .db %11111111 ;████████
4889 .db 8,7 ;turret right
4893 .db %00111010 ; ███ █
4894 .db %01101101 ; ██ ██ █
4895 .db %01011010 ; █ ██ █
4896 .db %11111111 ;████████
4900 .db %00111100 ; ████
4901 .db %01011010 ; █ ██ █
4902 .db %11111111 ;████████
4903 .db %01001010 ; █ █ █
4904 .db %11111111 ;████████
4905 .db %01011010 ; █ ██ █
4906 .db %00111100 ; ████
4908 .db 7,6 ;giant bullet
4910 .db %01111110 ; ██████▒
4911 .db %11111000 ;█████▒
4912 .db %11111100 ;██████▒
4913 .db %01111110 ; ██████▒
4914 .db %00111000 ; ███▒
4917 .db 9,12 ;.......:.2.....:
4918 .db %00000111 ; ████
4920 .db %00101010 ; █ █ █
4921 .db %01011011 ; █ ██ ██
4922 .db %10100110 ;█ █ ██ █
4923 .db %11010101 ;██ █ █ █
4924 .db %11010101 ;██ █ █ █
4925 .db %10100110 ;█ █ ██ █
4926 .db %01011011 ; █ ██ ██
4927 .db %00101010 ; █ █ █
4929 .db %00000111 ; ████
4936 .db %00000000 ;...what a waste of space...
4944 .db 12,12 ;.......:....5..:
4945 .db %00011110 ; ████
4946 .db %01100001 ; ██ ██
4947 .db %10110010 ;█ ██ █ ██
4948 .db %00000101 ; █ ██ █
4949 .db %00001010 ; █ █ ██
4950 .db %00011010 ; ██ █ █ █
4951 .db %00011010 ; ██ █ █ █
4952 .db %00001010 ; █ █ ██
4953 .db %00000101 ; █ ██ █
4954 .db %10110010 ;█ ██ █ ██
4955 .db %01100001 ; ██ ██
4956 .db %00011110 ; ████
4970 .db 16,10 ;.......:.......:
4971 .db %00000001 ; ██████ ██
4972 .db %00001110 ; ███ █ ███
4973 .db %00110010 ; ██ █ ████
4974 .db %01001101 ; █ ██ ██
4975 .db %11101011 ;███ █ ██ █
4976 .db %11101011 ;███ █ ██ █
4977 .db %01001101 ; █ ██ ██
4978 .db %00110010 ; ██ █ ████
4979 .db %00001110 ; ███ █ ███
4980 .db %00000001 ; ██████ ██
4993 .db 16,10 ;.......:.......:
4994 .db %00000000 ; █████
4995 .db %00000000 ; ███ █
4996 .db %00000111 ; ████ █████
4997 .db %00111101 ; ████ █ █ ████
4998 .db %01001010 ; █ █ █ ██ ███ █
4999 .db %10110110 ;█ ██ ██ ███ █ █
5000 .db %10110110 ;█ ██ ██ ███ █ █
5001 .db %01001010 ; █ █ █ ██ ███ █
5002 .db %00111101 ; ████ █ █ ████
5003 .db %00000111 ; ████ █████
5005 .db %00011111 ; █████
5018 .db 16,10 ;.......:.......:
5019 .db %11111110 ;███████
5020 .db %00000011 ; ███ ████
5021 .db %00110101 ; ██ █ ████ █
5022 .db %01111010 ; ████ █ █ █ ██
5023 .db %10001101 ;█ ██ █ ██ ██ █
5024 .db %10001101 ;█ ██ █ ██ ██ █
5025 .db %01111010 ; ████ █ █ █ ██
5026 .db %00110101 ; ██ █ ████ █
5027 .db %00000011 ; ███ ████
5028 .db %11111110 ;███████
5040 .db 12,11 ;AsteroidBoss one
5041 .db %00011110 ; ████
5042 .db %01110011 ; ███ ███
5043 .db %01111111 ; ███████ █
5044 .db %01111111 ; █████████
5045 .db %11111110 ;███████ ███
5046 .db %11111111 ;███████████
5047 .db %11111111 ;████████████
5048 .db %10111110 ;█ █████ ████
5049 .db %01011111 ; █ ███████
5050 .db %00110111 ; ██ ███
5063 .db 16,10 ;.......:.......:
5064 .db %10111110 ;█ █████ ███
5065 .db %00000011 ; ███ ████
5066 .db %01110101 ; ███ █ ████ ██ █
5067 .db %11111101 ;██████ █ ███ █
5068 .db %00000110 ; ██ █ █ ██ █
5069 .db %00000110 ; ██ █ █ ██ █
5070 .db %11111101 ;██████ █ ███ █
5071 .db %01110101 ; ███ █ ████ ██ █
5072 .db %00000011 ; ███ ████
5073 .db %10111110 ;█ █████ ███
5085 spr_boss07: ;modelled after a Nemesis][MSX boss
5086 .db 16,15 ;.......:.......:
5087 .db %00001111 ; █████
5088 .db %00111110 ; █████ █████
5089 .db %01111101 ; █████ █ ███████
5092 .db %00000011 ; █████
5093 .db %00011110 ; ████ ██ ████
5094 .db %11110011 ;████ ██ █ █
5095 .db %00011110 ; ████ ██ ████
5096 .db %00000011 ; █████
5099 .db %01111101 ; █████ █ ███████
5100 .db %00111110 ; █████ █████
5101 .db %00001111 ; █████
5118 spr_boss08: ;modelled after a Nemesis][MSX boss
5119 .db 16,18 ;.......:.......:
5121 .db %00000111 ; ███ ███
5122 .db %00000011 ; ████ █
5123 .db %00000001 ; ██ ██
5124 .db %00000011 ; ███ ██
5125 .db %00000000 ; █████
5126 .db %00010111 ; █ ██████████
5127 .db %00111111 ; ██████ ██ ██
5128 .db %11111000 ;█████ ██ █ ███
5129 .db %00001111 ; █████ ██ █ █
5130 .db %11111000 ;█████ ██ █ ███
5131 .db %00111111 ; ██████ ██ ██
5132 .db %00010111 ; █ ██████████
5133 .db %00000000 ; █████
5134 .db %00000011 ; ███ ██
5135 .db %00000001 ; ██ ██
5136 .db %00000011 ; ████ █
5137 .db %00000111 ; ███ ███
5159 .db 14,14 ;.......:......7:
5160 .db %01100111 ; ██ ████ ██
5161 .db %11001011 ;██ █ ██ █ ██
5162 .db %10110000 ;█ ██ ██ █
5163 .db %10101111 ;█ █ ██████ █ █
5164 .db %01010000 ; █ ██ ██ █
5165 .db %01010011 ; █ █ ██ █ █
5166 .db %10100111 ;█ █ ████ ██ █
5167 .db %10100111 ;█ █ ████ ██ █
5168 .db %01010011 ; █ █ ██ █ █
5169 .db %01010000 ; █ ██ ██ █
5170 .db %10101111 ;█ █ ██████ █ █
5171 .db %10110000 ;█ ██ ██ █
5172 .db %11001001 ;██ █ ██ █ ██
5173 .db %01100111 ; ██ ████ ██
5190 .db 16,19 ;.......:.......:
5191 .db %01111011 ; ████ ███
5192 .db %10000110 ;█ ██ █████
5193 .db %00000011 ; ███ █
5194 .db %00111011 ; ███ ██ ███
5195 .db %00000111 ; ███ ███
5196 .db %00001100 ; ██ ███ █
5197 .db %00110111 ; ██ █████ █ ██
5198 .db %01111011 ; ████ ██ █ ██ █
5199 .db %11100100 ;███ █ ██ ██ █
5200 .db %00000001 ; ██████ ██ █
5201 .db %11100100 ;███ █ ██ ██ █
5202 .db %01111011 ; ████ ██ █ ██ █
5203 .db %00110111 ; ██ █████ █ ██
5204 .db %00001100 ; ██ ███ █
5205 .db %00000111 ; ███ ██
5206 .db %00111011 ; ███ ██ ███
5207 .db %00000011 ; ███ █
5208 .db %10000110 ;█ ██ █████
5209 .db %01111011 ; ████ ███
5230 ;spr_bossA2: ;in asm code
5232 ;-----------------------------------------------------------------------------
5233 ;----------------------------- logo ------------------------------------------
5234 ;-----------------------------------------------------------------------------
5238 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011
5239 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011
5240 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011
5241 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011
5242 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000
5243 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000
5244 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001
5245 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011
5246 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011
5247 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011
5248 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011
5249 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000
5250 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000
5251 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000
5252 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000
5253 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011
5254 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011
5255 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011
5256 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011
5259 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111110
5260 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11111100
5261 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11111000
5262 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11110000
5263 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
5264 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
5265 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
5266 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
5267 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
5268 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
5269 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
5270 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
5271 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
5272 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
5273 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
5274 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
5275 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
5276 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
5277 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
5280 ;----------------------------- end -------------------------------------------
5286 ;-----------------------------------------------------------------------------
5287 ;-----------------------------------------------------------------------------
5288 ;-----------------------------------------------------------------------------
5290 ; 0.99.99 -- 9.IX.00 -- size 6936
5292 ; + you can have upto FOUR multiples! (~20 pixels apart)
5293 ; * some optimizations: keycall, menu handling, port nops removed,
5294 ; more SMC, fire handling, fast bullet handling, enemy movement
5295 ; * better "backwards" enemies handling (and implemented in game)
5296 ; # when enemy changed into a pickup, movement is set to vslow
5297 ; * instead of turning into a pickup, enemies explode and a pickup
5298 ; appears at the right side of the screen (moves left slowly)
5299 ; # bullets do damage again (screenflash made damage become 0)
5300 ; + when destroyed by bullets, the armor bar will show 0HP left
5301 ; * all enemy bullets do the same damage in all levels
5302 ; * you now appear at (*32*,30) because enemies can come from left
5303 ; * improved bullet handling (faster, smaller, etc.)
5304 ; + multiples are animated like real Nemesis (grow-shrink-grow-shrink>)
5305 ; # fixed a bug that didn't select multiples when you were moving
5306 ; # enemy collision screwed up invert and some other weird stuff
5307 ; + in pause screen change contrast with up/down and B/W mode with F1
5308 ; + lasers can have different durations (beams last longer)
5309 ; * some sign-flag checkings replaced by carry-flag (thus reducing size)
5310 ; # slow enemies (including pickups) didn't always appear (just 25-50%)
5311 ; + enemies can fire different kinds of bullets: aiming, double, triple
5312 ; * maximum number of bullets increased (48 for enemies, 128 for you)
5313 ; * beamweapon can be selected when you got laser (like vice versa)
5314 ; * selecting laser removes tailbeam or up-double
5315 ; # tail beam/up-double correctly centered
5316 ; # disappearing bullets (when enemies fired multiple bullets) fixed
5317 ; + bullets and lasers both upgradable upto level 9
5318 ; # fixed end story (_vputs didn't recognize 0-end when "'" in string)
5319 ; # stars couldn't be altered anymore since recent levelformat changes
5320 ; * maximum different enemies increased from 28 to 63
5321 ; * pickup sprite altered, small changes to some enemies
5322 ; + new moves implemented: 75% speed and lure-while-moving
5323 ; # fixed the enemy aiming bullets procedure
5324 ; * enemies fire their bullets centered too! (even the large bosses)
5325 ; * you may NOT have any multiples together with beams, just lasers
5326 ; + added new enemy guns: quad- and 6x-fire!!
5327 ; * sprite table length increased to 768 bytes (stored DIV3)
5328 ; + ships 3/4 select hardcore mode: score and damage are doubled
5329 ; + first icon not only increases armor, but also activates shield for
5330 ; some time (shield halves damage and absorbs bullets in normal mode)
5331 ; + ship selection screen also shows ship specs (hardcore/tailbeam/etc)
5332 ; * shield looks different for each ship
5333 ; * hiscore/savegame procedure optimized (several bytes smaller)
5334 ; + B<>W mode setting will be stored
5335 ; * enemy sprite pointers stored as words (thus increasing sprite table
5336 ; length from 768B to 65kB, and increasing sprite calculation speed)
5337 ; * hardcore mode does _more_ than doubled damage (bulletsdamage +1)
5338 ; * 10 bytes off by optimizing main menu a little
5339 ; * and optimizations to hiscore name handling saved another 17 bytes!
5340 ; * score increased by 1 per placed enemy, instead of time (otherwise
5341 ; you could just evade bosses for a long time for very high score)
5342 ; * findpixel optimized (or rather un-unoptimized: restored to original)
5343 ; # ground fixed again (and optimized for tunnel only)
5344 ; # prevents exploding more than once (not dieing while inside ground)
5345 ; * some unneccessary pushes removed
5346 ; + final boss also fires moving mines (just up/down-enemies)
5347 ; * on collision less damage to enemy, more to you (bosses too simple)
5348 ; * normal pickups will increase armor and shield directly (no [alpha])
5349 ; + a large pickup'll appear at the end of a level which will select
5350 ; your next upgrade: beamweapon, laser, multiple/tailbeam/up-double
5351 ; + a small explosion is displayed when enemy's hit but not destroyed
5352 ; # _all_ multiples appear at your position at start of level
5353 ; # bug in selecting multiples fixed (recent bug)
5354 ; + getting passed 3rd upgrade (4 pickups) increases score by 250!
5355 ; - second icon integrated in 5th, first two icons removed (unused now)
5356 ; * the armor bar is now 5 pixels in height; very visible
5357 ; # if selecting upgrade or starting level, charge bar wasn't displayed
5359 ; 1.00.C21 -- 21.XII.00 -- size 6797
5361 ; * armor-bar background, empty upgrades sprites changed
5362 ; + shows sprite when laser hits an enemy (his "shield"?)
5363 ; + exit-key also quits out of ship selection screen
5364 ; # fixed direct-quit on death bug (bug since recent optimization)
5365 ; * armor-bar background changed (more elegant and smaller code)
5366 ; # "flash" when end-boss spawns mine fixed
5367 ; + enemy's y start position can be specified per enemy
5368 ; + when bullets selected, upgrade icons won't appear half the time
5369 ; # remainder pixels in armor bar (appeared after heavy damage) removed
5370 ; + your ship's explosion is now also 8 frames (half enemy expl. speed)
5371 ; + does NOT display Done after running in TI-OS! (anti-teacher ;)
5372 ; * storyline completed (probably the crappiest story ever!)
5373 ; # only first byte of ship's sprite altered; now loads whole word
5374 ; - tail beam removed (up double only); odd ships now contain laser
5375 ; # fixed laserbeam display when firing at right edge
5376 ; # star relocation altered to work correctly w/ new screen location
5377 ; # halfluring wasn't 50% (more like 75%) since random enemy spawning
5378 ; * restored multiples for bullets (since it's unlikely you'll select 1)
5379 ; # fixed mem overlapping causing "weird stuff" when moving multiples
5380 ; # bullets fired below screen bottom are moved up onto screen
5381 ; + SOURCE ALSO TI-83 COMPATIBLE (still few bugs like hiscore, bullets)
5382 ; # upgrading beam weapon removed multiples
5383 ; # clipping at left side wrong in TI-83 version fixed
5386 ; + added - removed * changed # bug fixed
5388 ;bullet handling: (255/enemy)+419+putsprite cycles per bullet