1 ;----------------------------------------------------------------------------
2 ;---------------------- NEMESIS ---------------------------------------------
3 ;----------------------------------------------------------------------------
7 ; Release Date : 30.X.99
8 ; Filename : nemesis.86p (5kb)
10 ; Email Address : shiar0@hotmail.com
12 ; Web Page : www.shiar.org
13 ; Description : cool arcade-shoot-em-up-game
14 ; Where to get this game : www.shiar.org | www.ticalc.org
15 ; Other games by author : Worm
17 ; ABOUT: This source should only be used for learning practises, do not
18 ; alter it, and certainly do not distribute an altered version!!
19 ; NOTE: &&& marks uncertainties or things to optimize
21 ;---------------------- nemesis.z80 start -----------------------------------
24 #include "ti86asm.inc" ;standard ti86 romcalls
25 #include "ti86abs.inc" ;used to save hiscores and so
29 #define cal call ;just to make it harder for you to understand
30 #define psh push ; ^:D
31 #define dnz djnz ;Dec&Jump while NonZero becomes Do w.Non-Zero
33 ;GRAPH_MEM = $C9FA ;display buffer
34 TEXT_MEM = _textShadow ;167 bytes ($A7): C0F9-C1A0
35 _clrWindow = $4a86 ;a new procedure from AsmStudio86 inc. files
41 storepos = _asm_exec_ram+6000 ;120 OF 165
42 storepos2 = _asm_exec_ram+6200 ;141 OF 167
44 ;---------------------- in-game vars ----------------------------------------
46 just_fired = storepos+2 ; +2 ;counts how long a blast lasts
47 menuitem = storepos+2 ; +2 ;used to store menu location
48 hiscorepos = storepos+2 ; +2
49 timer = storepos+4 ; +4 ;frame counter
51 x = storepos+5 ; +5 ;your ship's position
52 y = x+1 ; +6 ;your y-pos
53 firex = y+1 ; +7 ;(1 byte)
54 firey = firex+1 ; +8 ;(1 byte)
57 eventtime = storepos+10 ;+10 ;enemy frequency
58 eventleft = eventtime+1 ;+11 ;nr. of enemies still to come
59 nextevent = eventleft+1 ;+12 ;time to next event
60 level_enemy = nextevent+1 ;+13 ;enemy type
61 level_info = level_enemy+1 ;+14 ;info (see below)
62 level_move = level_info+1 ;+15 ;=
63 level_fire = level_move+1 ;+16
66 spacespace = storepos+19 ;+19
67 groundinfo = spacespace+1 ;+20
68 groundpos = groundinfo+1 ;+21 $10
69 ceilingpos = groundpos+16 ;+37 $10
71 stars1 = ceilingpos+16 ;+53
72 stars2 = stars1+1 ;+54
74 starx1 = storepos+55 ;+55
76 starx2 = starx1+(nrstars1*2) ;+69
77 ; ^^ ;--------MULTIPLES
78 mx = starx2+(nrstars2*2) ;+83 ;position of multiple#1
79 my = mx+1 ;+84 ;multiple y-pos
82 your_locpos = m2y+1 ;+87 ;position in your_prevpos tabl
83 your_prevpos = your_locpos+1 ;+88 ;save previous positions (32d)
85 ;^-----------------------------------<1 ;-120=$78
87 enemies = storepos2 ; +0 ;info about each enemy
88 enemysize = 7 ;infobytes per enemy
89 nrenemies = 16 ;max. nr of enemies
91 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,damg,x,y)
93 ebullets = ybullets+(nrybuls*4) ;+110 ;30 bytes = 10(state,x,y)
96 ybuls = ebullets+(nrebuls*3) ;+140
99 ;^-----------------------------------<2 ;-141=$8D
101 ; [0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
103 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 10=normal 11=moving)]
104 ; [ship type or explosion frame] [x] [y] [move] [fire]
106 ;---------------------- introduction ----------------------------------------
108 nop ;hello yas/ase/rascall/whathever
109 jp init ;here's the program, but first: a description
110 .dw $0001 ;description type 2 (description + YASicon)
111 .dw Title ;pointer to description (all shells)
112 .dw Icon ;pointer to YAS icon
114 Title: .db "Nemesis v0.96 by Shiar",0
116 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 9bytes
119 .db %00111110 ; █████
120 .db %01111001 ; ████ █
121 .db %00111110 ; █████
123 .db %11100000 ; ███ ;recommend 80x50 screen mode
124 .DB 0 ;clear stupid YAS-line
126 ;---------------------- init ------------------------------------------------
138 init: cal BUSY_OFF ;turns the run-indicator off, obviously
139 cal _clrScrn ;clean the screen
141 res 2,(iy+13) ;don't scroll the screen
142 cal _flushallmenus ;remove TI menus
144 FixKeys: ;fixes some key problems like left+down bug
158 ld bc,int_end-int_handler
164 ;---------------------- main menu -------------------------------------------
167 xor a ;white bitmask (a=0)
168 ld hl,logo_nemesis ;from...
169 ld de,VIDEO_MEM+16 ;...to one line from top
170 ld b,e ;ld b,16: one line
172 ld (de),a ;clear/n byte
174 dnz AboveLogo ;repeat for the first line
175 ld bc,16*19 ;logo size
176 ldir ;display one line of logo
178 ld hl,16*$33+VIDEO_MEM ;$33 rows down
179 ld b,16*7 ;draw black 7 lines
180 ld a,%11111111 ;horizontal line mask
182 ld (hl),a ;draw one piece of the divider-line
183 inc hl ;move right (8 pixels = 1 byte)
184 dnz underline ;repeat
186 ld hl,_txt_email ;at the very bottom of tha screen
188 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
189 cal _vputs ;VERY important, so display in small font ?:}
191 set 3,(iy+5) ;set white on black
192 ld de,_txt_about ;near the bottom of the screen
193 ld (_penCol),de ;hl=txt_email++=txt_about
194 cal _vputs ;display version + me
195 res 3,(iy+5) ;return to default black on white
232 cal GET_KEY ;wait for keypress
250 jp samelevel ;game_main_loop
270 ;----------------------------------------------------------------------------
271 ;---------------------- game loop -------------------------------------------
272 ;----------------------------------------------------------------------------
274 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
275 ld hl,timer ;update time
276 inc (hl) ;increase by 1
277 jr nz,Clear_screen ;continue when new time <> 0
278 ld hl,1 ;once every 256 frames, increase score by 1
282 ld hl,GRAPH_MEM ;move from (hl) = top left
283 ld (hl),$00 ;first pixel will be copied all over the screen
284 ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
285 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
290 jr z,movestarsdone ;don't move stars once every 4 frames
291 cal movestars1 ;move the stars on the FRONT layer
292 cal movestars2 ;move the distant stars
294 ld a,(stars1) ;star positions (the missing byte...)
295 ld b,nrstars1 ;how many stars? now we know.
296 ld hl,starx1 ;points to the position of the stars
297 cal DisplayStars ;display front layer stars
298 ld a,(stars2) ;weren't you paying attention five lines ago?
299 ld b,nrstars2 ;that many?! whow!
300 ld hl,starx2 ;and there they are
301 cal DisplayStars ;use the same procedure to display back layer
303 ld a,(level_info) ;level info
304 and %00000110 ;isolate ground&ceiling
305 jr z,game_stuff ;both non-present
306 and %00000010 ;bit representing the presence of any ceiling
307 cal nz,Handle_ceiling ;scroll the ceiling (if any) +check4collision
308 cal Handle_ground ;scroll the ground and check if we're dead
311 cal Handle_Ship ;move you
312 ld a,(your_occ) ;are you 100% OK?
314 jr nz,_gamestuff1 ;then don't check for movements/fires/...
317 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
318 out (1),a ;ask for them
319 nop \ nop ;delay 8 clocks
323 bit 6,a ;test bit 6 = exit-key = EXIT
324 jp z,game_over ;<exit> pressed, so be it
325 check_morekey: ;another unused label... poor compiler
326 bit 7,a ;test bit 7 = more-key = PAUSE
327 cal z,Pause ;yes, go to pause
330 bit 5,a ;test bit 5 = 2nd-key = FIRE
331 ld hl,check_selkey ;where to continue after executing Fire_bullet
332 psh hl ;push hl on stack (instead of cal Fire_bullet)
333 jp z,Fire_bullet ;fire smtn (bulletstorplasermultiples+stuff..)
334 pop hl ;no cal to Fire_bullet made, so pop stack
336 ld (just_fired),a ;reset just_fired
339 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
341 nop \ nop ;what's taking you so long
342 in a,(1) ;at last... our precious keyzzz...
344 bit 6,a ;'bout the GRAPH key...
345 cal z,Teacher ;you didn't _press_ it, did you?!?
347 rla ;test bit7 so we know f ALPHA has been pressed
348 cal nc,select ;yeppy, select the currently selected upgrade
350 cal Enemies_hit ;check for collision with enemies
354 cal Handle_enemies ;move enemies
356 cal Handle_bullets ;move your bullets + check for hits
357 cal Enemy_bullets ;move enemy bullets
358 cal Handle_torp ;the same for your torpedo (assuming u have 1)
360 cal Level_event ;insert enemies
361 cal Display_Screen ;display all
364 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
370 cp 97 ;max. 96 times (=96/16=6 increases)
371 ret nc ;return if already maxed
372 ld (weapincs),a ;save new incs
374 and %11110000 ;clear last 4 bits so no cf when rotating
376 rra ;rotate acting as shift (srl a) but just 1B
379 rra ;increase once just every 16 turns
380 ld b,a ;times to increase
382 add a,1 ;increase damage for one increase
384 dnz incthedamage ;a=total increase damage
385 ld b,1 ;minimal damage
387 add a,b ;a=total damage
388 ld (curweapdamage),a ;safe the current damage
392 ;--------------------------- ground -----------------------------------------
396 and %111 ;once every 8 frames
397 jr nz,Display_ground ;otherwise skip the scroll
398 ld bc,15 ;scroll all 16 bytes minus one (teh new byte)
399 ld hl,groundpos+1 ;from..
400 ld de,groundpos ;to (one byte to the left)
401 ldir ;LoaDIncreaseRepeat = scroll!
403 ld a,(groundinfo) ;what kind of ground
405 jr z,ground_tunnel ;tunnel effect
413 ld bc,$201 ;range=1..3
416 jr z,ground_previous ;same if a=1
418 jr z,gtunneldown ;down if a=2
419 gtunnelup: ;up if a=3
422 jr z,ground_previous ;a>=0 (a=0 actually)
435 ld a,(groundpos+14) ;type 1
438 ld a,(groundpos) ;type 0
440 ld (groundpos+15),a ;save new byte on the right
450 ld b,16 ;screen width
451 ld de,groundpos-1 ;height of current byte (previous actually)
453 ld hl,GRAPH_MEM+(56*16)-1 ;screen position
457 ld c,b ;push b for groundloopup
458 pop hl \ inc hl ;get screen position and go one right
459 pop de \ inc de ;get height info and set to the next byte
460 psh de \ psh hl ;save these for the next time
461 ld a,(de) ;height of current byte
464 ld de,16 ;to substract to go one line up
465 ld a,%11111111 ;bitmask black
468 ld (hl),a ;display black byte
469 sbc hl,de ;go up (sbc must be used for 16-bit sub)
470 dnz groundloopup ;and loop >groundpos< times
472 ld b,c ;pop b used by groundloopup
473 dnz groundloopright ;loop right for entire screen (16x)
474 pop hl \ pop hl ;restore stack
476 CheckGround: ;check for collision with the ground
494 ;--------------------------- ceiling ----------------------------------------
498 and %111 ;once every 8 frames
499 jr nz,Display_ceiling ;otherwise skip the scroll
500 ld bc,15 ;scroll all 15 bytes (16th is new position)
501 ld hl,ceilingpos+1 ;from..
502 ld de,ceilingpos ;to (one byte to the left)
503 ld a,(de) ;load byte on left (will be lost after scroll)
504 ldir ;LoaDIncreaseRepeat = scroll!
506 ld a,(groundinfo) ;what kind of ceiling
508 jr z,ceiling_tunnel ;tunnel effect
516 ld bc,$201 ;range=1..3
519 jr z,ceiling_previous ;1:same
525 jr z,ceiling_previous
533 jr z,ceiling_previous
538 ld a,(ceilingpos+14) ;type 1
541 ld a,(ceilingpos) ;type 0
543 ld (ceilingpos+15),a ;save the new byte
546 jr nc,Display_ceiling
553 ld b,16 ;screen width
554 ld de,ceilingpos-1 ;height of current byte
556 ld hl,GRAPH_MEM-17 ;screen position
560 ld c,b ;push b for groundloopup
561 pop hl \ inc hl ;get screen position and go one right
562 pop de \ inc de ;get height info and set to the next byte
563 psh de \ psh hl ;save these for the next time
564 ld a,(de) ;height of current byte
567 ld de,16 ;to substract to go one line up
568 ld a,%11111111 ;bitmask black
571 ld (hl),a ;display black byte
573 dnz ceilingloopdown ;and loop >groundpos< times
575 ld b,c ;pop b used by groundloopup
576 dnz ceilingloopright ;loop right for entire screen (16x)
577 pop hl \ pop hl ;restore stack
579 CheckCeiling: ;check for collision with the ground
583 srl a ;x/8 (current ceiling-byte)
588 ld de,ceilingpos ;first ceiling-byte
589 add hl,de ;current ceiling-byte
592 cp (hl) ;compare with ceiling
593 ret nc ;carry if ceiling is above you
595 jp damage_you ;otherwise you don't wanna be in that ship
597 ;--------------------------- move stars -------------------------------------
599 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
606 ret ;let's comment this: returns
635 cp 9 ;(GRAPH_MEM&%00001111)-- = $C9FAand15-1 = $A-1
644 ret ;for stupid people, here's another comment...
646 ;--------------------------- pause ------------------------------------------
649 ld hl,$0200 ;top left
651 ld hl,txt_pressenter ;"Enter to continue"
652 cal _puts ;display message
654 cal _getkey ;enter low-power mode and wait for key
655 cp kEnter ;keypressed = enter?
656 jr nz,pause ;no, wait some more
659 ;--------------------------- teacher ----------------------------------------
662 ld (iy+12),5 ;enable flashing cursor
664 cal _homeup ;top left
666 cal _puts ;display message
669 cal _getkey ;enter low-power mode and wait for key
670 cp kEnter ;enter pressed?
672 cp kGrMenu ;keypressed = graph?
673 jr nz,teacherloop ;no, wait some more
675 ld (iy+12),0 ;disable cursor
689 ;--------------------------- exit -------------------------------------------
691 quit: im 1 ;release keyfix procedure
692 set 2,(iy+13) ;set back screen scrolling
694 ld (_asapvar+1),a ;next Asm( run will reload the program
695 ld hl,GRAPH_MEM ;graph-screen location
698 ld bc,1024-1 ;do it 1024 times = entire screen
700 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
701 ;_clrScrn) AND also executes _homeup and ret
703 ;--------------------------- display ----------------------------------------
706 ld hl,GRAPH_MEM ;from buffer (top left)
707 ld de,VIDEO_MEM ;to real screen (top left)
708 ld c,56 ;display height = 64 bytes (minus 8 for bar)
710 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
712 ld a,(hl) ;copy byte from (hl)
714 cpl ;xor $ff: invert byte (white<=>black)
716 inc hl \ inc de ;next byte
717 dnz displaytloop ;16x hl >> de
719 jr nz,displayloop ;loop 64x
721 ld hl,$396b ;Display Score
722 ld (_penCol),hl ;bottom right of screen
725 _D_HL_DECI: ;------- display 5-digit value -------
726 ld de,savestr+4 ;savenr saves number string
728 ldhld: cal UNPACK_HL ;one digit of hl
729 add a,'0' ;make number
730 ld (de),a ;save into savenr
731 dec de ;point to next digit
732 dnz ldhld ;repeat for all digits
734 ld hl,savestr ;we (the program) saved the value righthere
735 jp _vputs ;the only thing left to do is to display it
737 savestr: ;@here the score will be stored
738 .db "00000",0 ;don't worry, it's just temporary
740 ;------------------------- handle ship --------------------------------------
747 inc a ;no! next (explosion)frame
748 ld (your_occ),a ;save
750 cp 34 ;last explosion frame?
751 jp c,exploding_you ;not yet: display explosion
752 cp 40 ;delay finished?
753 jp z,You_die ;yes = game over
754 ret ;don't display anything
758 ld a,%01111110 ;get arrow keys
759 out (1),a ;it's cold outside
760 ld hl,y ;instead of nop\nop do something usefull
761 in a,(1) ;come back in
764 xor %11111111 ;inverted a = 0 if arrow-key has been pressed
765 ld a,(your_multiples)
766 jr z,no_adv ;if so, leave the multiples where they are
767 or %100 ;set move bit
769 no_adv: and %11111011 ;reset move bit
771 adv_ok: ld (your_multiples),a
773 ld a,(timer) ;framecounter
774 and %1 ;switches 0<>1 each frame
775 inc a ;a = 1 or 2 (1.5 avg)
776 ld c,a ;c = your_speed
779 rra ;rotate right (put last bit in c)
780 ld b,a ;we need a later
785 cp 50 ;56-6 = bottom of screen
790 rr b ;because we now use b, it's rr instead of rra
793 sub c ;<dec a> doesn't affect c-flag
794 jr c,no_left ;-1 = left side
801 cp 122 ;128-6 = right side
810 sub c ;<dec a> doesn't affect carry-flag
811 jr c,no_up ;-1 = top of screen
812 ld (hl),a ;save new y
814 no_up: ld e,(hl) ;e=y
815 ld ix,spr_ship01 ;normal ship sprite
816 ld hl,your_inv ;invulnerable?
817 ld a,(hl) ;load time in a
819 jr z,disp_ship ;yes so ship = normal (display \ continue)
821 ld a,(timer) ;load frame nr.
822 and %00000111 ;a=0 once every four frames
823 jr nz,not_time ;a<>0 = not time to update counter
824 dec (hl) ;decrease inv-time left
826 and %00000100 ;a switches 0<->1 every 2 frames
827 jr z,disp_ship ;show normal ship
829 ld ix,spr_ship01i ;display invulnerable ship
831 psh de ;save your position for multiples
832 cal putsprite ;display your ship
838 ld a,(your_multiples) ;do you have multiples
839 ld b,a ;save a for 2nd check
840 and %11 ;no? (last two bits = nr of multiples)
841 ret z ;then don't handle them either
843 ld a,b ;restore a (your_multiples)
844 and %100 ;move the multiples??? (=move bit set?)
845 jr z,mult_adv ;nope, just let them (saves (y)in y, (x)in x)
847 ld hl,your_locpos ;location to save this position
849 inc a ;a=a+1 (next position)
850 and %00001111 ;if a>15 then a=a-16
851 ld (hl),a ;save new a
856 ld hl,your_prevpos ;previous positions
857 add hl,bc ;16 turns ago
861 ld (mx),bc ;save multiple position in (mx)
862 ld (hl),e ;save current pos. for 16 turns into the future
868 ld ix,spr_multiple ;sprite of the multiple
869 jp putsprite ;display it + <ret>
874 srl a ;half the framerate
875 dec a ;first frame is 1>inc>srl>dec = 0
878 explosion_stuff: ;in:a=frame*2+(0 to 1); (hl)=xpos--
884 ld ix,spr_explosion ;base sprite
885 add ix,bc ;go to correct sprite (each spr. is 8 bytes)
890 jp putsprite ;and display it too
894 damage_you: ;damages you B points
895 ld a,(your_inv) ;invulnerability left?
897 ret nz ;return if inv>0
898 ld hl,your_armor ;armor left
899 ld a,(hl) ;load hp in A
900 sub b ;decrease hp by B
901 jp m,no_armor ;<0hp left so explode
902 ld (hl),a ;no, so save decreased hp
903 cal disp_armor ;and display new value
905 ld a,(your_pickup) ;how many pickups do you have?
906 dec a ;is the armor-icon selected
907 ret nz ;return if not
909 psh de \ psh ix ;&&& just2Bsave
910 ld hl,VIDEO_MEM+(16*56)
912 ld ix,spr_icon ;if so, highlight armorIcon again
913 ld de,$1901 ;position
914 cal putwidesprite ;display icon
920 ld a,%01 ;occ %xxxxxx01 = explode
921 ld (your_occ),a ;too bad, you're dead meat
924 ;------------------------- place multiples ----------------------------------
927 ld (mx),de ;set last multiple-position
928 ld hl,your_prevpos ;place all previous positions
929 ld b,16 ;all 16 of them
931 ld (hl),d ;set prev-x to d
933 ld (hl),e ;set prev-y to e
935 dnz place_multiples ;repeat
938 ;------------------------- select upgrade -----------------------------------
941 ld hl,your_pickup ;select pickups
942 ld a,(hl) ;load pickups taken so far
944 ret m ;return if it's 0 (no pickups)
945 jr nz,select2 ;no, carry on
947 ld a,(your_armor) ;load current armor
948 cp 25-6 ;may not become >=25
949 jr c,select1_ ;ok then just add 6
950 ld a,25-6 ;set to maximum (6 will be added below)
952 add a,6 ;add 6 to armor
953 ld (your_armor),a ;change armor
955 ld (your_pickup),a ;reset pickups
956 jp disp_icons ;display and return
959 jr nz,select3 ;no, carry on
960 ld (hl),a ;reset pickups
962 ld (torp_occ),a ;ready torpedoes
963 jp disp_icons ;display 'n return
966 jr nz,select4 ;no, carry on
967 ld (hl),a ;reset pickups
972 jp nc,disp_icons ;weapon maxed out
973 ld (hl),a ;set new weapon
974 cal loadweapon ;load it (damage and stuff)
975 jp disp_icons ;display n return
978 jr nz,select5 ;no, carry on again
979 ld (hl),a ;reset pickups
981 ld (your_weapon),a ;ready laser
982 jp disp_icons ;display + return
985 jr nz,select6 ;no, carry on once more
986 ld (hl),a ;reset pickups
988 ld (your_multiples),a
991 jp disp_icons ;display, return
993 ld (hl),0 ;reset pickups
994 jp disp_icons ;display/return
996 ;------------------------- fire bullet --------------------------------------
1000 ld a,(hl) ;just_fired
1001 cp 5 ;already pressed?
1002 ret z ;return when already pressed (=5)
1004 inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
1005 ld a,(your_weapon) ;if you have bullets.....
1008 ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
1011 ld hl,(x) ;yes: first fire from ship position (x)
1012 ld (firex),hl ;set firepos
1013 ld a,(your_multiples) ;any multiples?
1015 jr z,fireany ;then just fire somethin'
1016 cal fireany ;and blast
1017 ld hl,(my) ;then, fire from multiple position (mx)
1020 ld (firex),hl ;set firepos
1021 ;blast again and <ret>
1025 ld a,(your_weapon) ;do you have laser?
1051 ld hl,torp_occ ;torpedo...
1052 ld a,(hl) ;load torpInfo
1053 dec a ;do you have (unused) torpedoes?
1054 ret nz ;nope (a must be 1)
1055 ld (hl),2 ;yes; use torpedo
1056 ld (torp_pos),de ;save torpedo position (in de)
1059 ;-----fire LASER-----
1061 fire_laser: ;yes, fire that laser instead
1062 ld a,(firex) ;a = your x-pos
1065 ld hl,GRAPH_MEM ;save-location
1066 ld a,(firey) ;y-coord
1067 add a,3 ;at middle of your ship (y+3)
1068 ld e,a ;save laser-y in e
1072 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1073 add a,a ;y*16 (width of screen)
1074 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1075 inc a ;8 pixels to right (a=even so no overflow)
1080 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1081 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1082 inc b ;a>255 so increase bc by 256
1083 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1084 add hl,bc ;bc = Y*16+X/8
1085 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
1086 sub d ;minus x-start (d=X/8)
1090 inc hl ;Go to next byte
1094 ld d,a ;d was divided, so reload the laser-x
1096 check_laserhits: ;de = (x,y)
1099 laserhits: ;Hits with normal enemies
1103 jr z,nolashit ;no hit when enemy_occ <> 2/3
1106 or a ;enemy #0 = pickup
1107 jr z,nolashit ;yes: don't destroy
1111 jp m,nolashit ;no hit when enemy is left of you
1115 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1116 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1117 add a,5 ;add enemy height&&&
1118 jp m,nolashit ;a-e>0 = hit
1127 add hl,bc ;go to next enemy
1129 dnz laserhits ;check all enemies
1132 ;-----fire BULLET-----
1141 jr z,found_ybullet ;0 = no bullet here
1143 dnz find_ybullet ;look next bullet
1144 pop hl ;don't try to fire any other bullets
1151 ld (hl),c ;use the bullet and set correct bullet-type
1153 ld (hl),1 ;set bullet damage
1155 ld a,(firex) ;your x-pos
1156 add a,5 ;place bullet in front of you
1157 inc hl ;go to bullet-x
1160 ld a,(firey) ;your y-pos
1161 add a,(ix+1) ;place bullet at the middle of your ship
1162 inc hl ;go to bullet-y
1166 ld (weapincs),a ;reset damage
1169 ;------------------------ handle bullets ------------------------------------
1175 cp (hl) ;off screen? (x>128-5)
1178 add a,b ;move b to the right
1179 ld (hl),a ;save new pos.
1218 pop hl ;cal bullet_left
1220 ld (hl),0 ;dump this bullet!
1221 jr next_ybullet+1 ;+1:skip pop hl at next_ybullet
1227 psh bc ;bullet counter
1228 psh hl ;save enemy+type
1229 ld (temp1),hl ;needed for check_bullethits
1230 ld a,(hl) ;@bulletType
1235 jp z,next_ybullet ;bulletType=0 >> no bullet
1240 cal bullet_left ;move bullet left
1243 psh de ;save de =position
1246 ld a,(hl) ;bullet damage=size
1247 ld hl,XLbullettable ;pointer to first bullet
1251 ld e,a ;->16bit (de=a)
1252 add hl,de ;point to correct bullet offset
1253 ld a,(hl) ;load bullet offset
1254 ld e,a ;convert to 16bit (d=0)
1255 ld ix,spr_bullet01 ;first sprite
1256 add ix,de ;add offset (go to correct sprite)
1257 pop de ;saved position
1259 ld a,(ix) ;bullet x-size
1260 ld (bulletxsize),a ;used at check_bullethits
1261 ld a,(ix+1) ;bullet y-size...
1262 ld (bulletysize),a ;...too
1264 psh de ;but will be altered so save again
1265 cal putsprite ;display bullet
1266 pop de ;position (used for check_bullethits)
1268 cal check_bullethits
1271 pop hl ;restore enemy+type
1275 inc hl ;skip type,dam,x,y: next enemy+type
1277 dnz scan_bullets ;next bullet (loop)
1280 ;--------------------------- check bullethits -------------------------------
1282 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1286 hit_enemies: ;Hits with normal enemies
1287 psh bc ;enemy counter
1292 jr z,nohit ;no hit when enemy_occ <> 2/3
1296 or a ;enemy #0 = pickup
1297 jr z,nohit ;yes: don't destroy
1299 cal find_sprite ;set ix to the sprite of this enemy
1303 sub d ;minus bullet x-position
1305 sub 5 ;minus bullet x-size
1309 add a,(ix) ;add enemy width
1314 sub e ;minus bullet y-position
1316 sub 3 ;substract bullet height
1318 jp p,nohit ;nope, missed it
1320 add a,(ix+1) ;add enemy height
1321 jp m,nohit ;missed after all
1323 ;---bullet hits enemy (auch-time!)---
1325 ld hl,0 ;@bulletType
1327 ld (hl),0 ;remove bullet
1329 ld a,(hl) ;set damage
1337 dnz hit_enemies ;check next enemy
1340 enemy_hit: ;*in:a=damage;hl=enemy+y
1341 add a,a ;a=damage to inflict
1342 add a,a ;first 2 bits used for occ.
1348 ld a,(hl) ;load hp00
1349 sub b ;decrease HP (if <0xx then c is set)
1350 ld (hl),a ;save (no flag-changes)
1351 dec hl ;@hp64; no change in c
1352 ld a,(hl) ;load; no c-change
1353 sbc a,0 ;if cf then decrease a
1354 ld (hl),a ;save back the new value
1355 ret nc ;if a>=0 then return, otherwise explode
1357 inc hl ;goto occ again
1358 ld (hl),%01 ;set to explode
1359 ld a,(pickuptimer) ;counts enemies destroyed
1360 dec a ;enough destroyed for a pickup?
1361 jr nz,pickupdone ;otherwise just explode
1362 ld (hl),%110 ;change it into a pickup (with 2 HP)
1363 ld a,18 ;reset enemies counter (18 hits = next)
1365 ld (pickuptimer),a ;save new enemiescounter value
1367 ld (hl),$00 ;explosionFrame 0
1369 ld hl,1 ;increase score by one
1372 ;--------------------------- handle torpedo ---------------------------------
1377 ret m ;return if occ=0/1
1379 ld hl,torp_pos ;x-position
1380 ld a,(hl) ;load in a
1382 cp 125 ;right edge reached
1383 jr nc,remove_torp ;remove if x>125
1384 ld (hl),a ;save new x
1390 cp 56 ;bottom reached
1391 jr nc,remove_torp ;remove if y>40
1392 ld (hl),a ;save new y
1397 cal putsprite ;display torpedo
1399 jp check_bullethits ;check for hits with enemies
1406 ;--------------------------- level events -----------------------------------
1409 ld hl,nextevent ;time to next event <ld a,(nextevent)
1410 dec (hl) ;decrease counter <dec a
1411 ld a,(hl) ;look at counter <ld (nextevent),a
1412 or a ;has it reached zero?
1413 ret nz ;nope: get outta here!
1415 ld a,(eventtime) ;enemy frequency (lvl)
1416 ld (nextevent),a ;set time to next event
1418 dec (hl) ;update enemy-counter
1420 ld a,(hl) ;look at counter
1421 or a ;has it reached 0?
1422 jp z,Next_level ;yes: level finished
1423 dec a ;has it reached 1?
1424 jr z,standby_event ;yes: wait until no enemies present/left
1425 dec a ;has it reached 2?
1426 jr z,place_boss ;yep: place the BigBossTM!
1427 dec a ;has it reached 3?
1428 jr nz,do_event ;nope: >3 = place an enemy
1429 inc hl ;nextevent located behind eventleft
1430 ld (hl),123 ;set delay
1431 ret ;don't place any more enemies
1434 ld hl,(levelp) ;the leveldata (including the boss)
1435 dec hl ;points to leveldata\boss\enemynr
1437 ld (level_enemy),a ;set new enemy (boss)
1438 dec hl ;points to level\boss\movement
1440 ld (level_move),a ;set boss movement
1441 dec hl ;@level\boss\firefreq
1442 ld a,(hl) ;load in a
1443 ld (level_fire),a ;set firefrequency
1448 ld hl,enemies+1-enemysize
1453 or a ;0 = no enemy present
1464 ld hl,enemies+1-enemysize
1469 cp (hl) ;(hl) = 0 ??
1470 jr nz,chk_noenemy ;jump if enemy present (non-0)
1471 ex de,hl ;de=hl=usable enemy
1474 ld a,(level_enemy) ;enemy type to place (lvl)
1475 ld hl,XLenemyinfos-4 ;enemy "0" specs (1 before enemy #1)
1479 ld b,0 ;bc = enemy nr.&&&XX
1480 add hl,bc ;hl = enemy specs
1481 ld a,(hl) ;load hitpoints+occ of this enemy class
1484 inc hl ;next enemyInfo byte
1486 ld a,(hl) ;load hp64
1487 ld (de),a ;save hp64
1488 inc de ;next byte (or previous): occ again
1490 inc hl ;next enemyInfo byte
1491 inc de ;next byte of current enemy
1492 ld a,(hl) ;load enemy class (nr)
1493 ld (de),a ;save enemy type
1497 ld a,128 ;appear at right edge of screen
1498 sub (ix) ;minus the width of this enemy (not offscreen)
1499 ld (de),a ;= x-position (save)
1502 inc hl ;where to place??
1503 ld a,(hl) ;load placeInfo
1505 jr z,random_enemy ;yes: create random value <51 in a
1507 jr z,lure_enemy ;yes: create a 100% luring enemy
1509 halflure_enemy: ;yes (of course it is): pick one (50% lure)
1510 ld a,(timer) ;look at frame-number
1511 and %00000001 ;make random if odd frame nr.
1512 jr nz,random_enemy ;1st possibility: random enemy
1513 lure_enemy: ;2nd possibility: luring enemy
1514 ld a,(y) ;place at same y-pos as YOUR ship
1517 ld bc,256*51 ;range=0..51
1519 ; ld b,e ;b will be added to random-value
1520 ; cal Random50 ;make a (in a) random value 0-51
1521 ypos_OK: ;random value successfully created
1522 ld (de),a ;save y-position
1525 ld a,1 ;movecounter = 1
1526 ld (de),a ;&&&(hl),1 better?
1530 and %00000001 ;bit meaning directfire
1531 jr nz,ffireOK ;(a=time-to-fire) = 1 frame (fires directly)
1532 ld a,(level_fire) ;set ttf to normal nr of frames
1533 ffireOK:ld (de),a ;save fire
1536 ;--------------------------- enemy fires ------------------------------------
1538 Enemy_fires: ;de = x,y
1548 jr z,found_ebullet ;0 = not used
1549 inc hl \ inc hl \ inc hl
1550 dnz find_ebullet ;look next bullet
1563 ld b,%1011 ;yourY-bulY = negative (=bullet below you)
1566 ld b,%1001 ;yourY-bulY = even more negative (going up)
1571 ld b,%1010 ;bullet going down
1573 jp m,bulletok ;even more going down
1580 ld (hl),a ;set bullet direction
1582 ld (hl),d ;set x-pos
1584 ld (hl),e ;set y-pos
1587 ;----------------------------- enemy bullets --------------------------------
1595 ld a,(hl) ;load bulletType in a
1596 and %1111 ;select direction-bits
1597 jr nz,enemy_bullet ;non-0: handle bullet
1599 pop hl ;do not move the <pop hl>
1601 inc hl \ inc hl \ inc hl
1606 ld b,a ;save type&%1111
1608 ld a,(hl) ;check if it has reached the left side of scrn
1609 and %11111110 ;it is <2 (0 or 1)?
1610 jr z,remove_ebullet ;yes, remove bullet
1611 dec (hl) ;move one left
1612 dec (hl) ;and another one
1616 ld a,b ;restore type
1617 cp %1100 ;is it a normal bullet? (cp = faster than bit)
1618 jr z,ebullet_common ;type %1100: normal bullet
1619 and %111 ;isolate important bits
1620 jr z,ebullet_down ;type %1000: moving down
1622 jr z,ebullet_up ;type %1001: moving up
1631 jr z,ebullet_down ;type %1010: moving down 50%
1632 ;type %1011: moving up 50%
1649 ld ix,spr_bullete1 ;display enemy bullet
1655 jr nz,next_bullet ;0 = you're normal
1675 pop hl ;points to bullettype again
1676 psh hl ;and save it again (ivm call to damage_you)
1677 ld a,(hl) ;load bullettype
1678 cal _shracc ;isolate damage-bits (%1111???? -> %00001111)
1679 ld b,a ;set damage-amount
1680 cal damage_you ;HIT!!
1682 pop hl ;hl could be destroyed by damage_you
1683 ld (hl),0 ;bullet > unused
1684 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
1686 ;--------------------------- handle enemies ---------------------------------
1690 ld b,nrenemies ;handle all enemies
1698 jr z,next_enemy ;occ "no enemy" 0
1700 jr z,exploding_enemy ;occ "exploding" 1
1701 ld b,a ;b=2 if moving, otherwise b=1
1703 normal_enemy: ;occ "normal" 2 or "moving" 3
1705 ld c,(hl) ;c = enemy type = de
1711 jr c,remove_enemy ;off screen
1712 jr z,remove_enemy ;"
1717 ld a,b ;moving state was stored in b earlier
1719 cal nz,moving_enemy ;2 = moving enemy
1723 ld (hl),d ;store new x
1724 ld a,c ;a = enemy type
1725 or a ;type 0? (pickup)
1726 jr nz,check_enemyfire ;no, a normal enemy; let em fire
1727 ld a,(timer) ;load time
1728 and %1 ;move left once every 2 turns
1729 jr z,firing_done ;don't move now
1730 inc d ;increase x-position (don't move this turn)
1731 inc (hl) ;and save it
1732 jr firing_done ;continue
1736 inc hl ;go to <move>
1737 inc hl ;go to <fire>
1738 dec (hl) ;decrease counter till next blast
1739 ld a,(hl) ;&&&doesn't seem efficient to me
1740 or a ;has it reached zero?
1741 jr nz,firing_done ;finished if not
1743 ld a,(level_fire) ;re-set counter for next blast
1744 ld (hl),a ;save time to fire
1745 inc hl ;next byte = bullettype &&&
1746 psh de ;save registers for firing-use
1747 cal Enemy_fires ;fires bullet
1748 pop de ;restore (destroyed by Enemy_fires)
1750 cal putwidesprite ;display sprite @ix
1762 ld (hl),$0000 ;bye bye enemy
1763 jr next_enemy+1 ;continue AFTER pop hl (already done)
1769 jr z,remove_enemy ;remove when at last frame
1771 ld (hl),a ;next frame
1772 cal explosion_stuff ;display explosion
1775 ;--------------------------- moving enemies ---------------------------------
1780 jr z,movetype_updown ;type 0
1782 jr z,movetype_vslow ;1
1784 jr z,movetype_fast ;2
1786 jr z,movetype_vfast ;3
1788 jr z,movetype_smart ;4
1790 jr z,movetype_lure ;5
1792 jr z,movetype_slowlure ;6
1794 jr z,movetype_stoplure ;7
1796 ; jr z,movetype_fulllure ;8
1816 jr movetype_slowlure
1835 inc hl ;hl =@ <move>
1844 or a ;reset carry flag
1845 dec hl ;reset hl to <y>
1863 pop hl ;restore stack (no ret used)
1864 jp remove_enemy ;remove this enemy (off screen)
1875 or a ;reset carry flag
1878 ld a,(hl);&&&ld a,e ;load current y-position
1881 moveup: dec a ;decrease y-pos (=move up)
1882 ret m ;don't move off the screen (y<0)
1883 dec e ;save new y-pos
1886 inc a ;increase y-pos
1887 cp 55 ;compare with bottom
1888 ret nc ;return if it has passed that line (>40)
1889 inc e ;otherwise save new position
1892 ;--------------------------- check collision --------------------------------
1895 ld hl,(x) ;e = X, d = Y
1896 ld de,$0707 ;add 7 to both d and e
1899 ld e,l ;e = X+7, d = Y+7
1902 ld b,nrenemies ;check all 20 enemies
1907 jr z,check_next ;2 or 3 = ok
1910 collide_enemy: ;&&& include in Handle_enemy proc
1914 ld a,(hl) ;check x match
1915 sub e ;enemy position minus yours minus 7
1918 add a,(ix) ;enemy width
1922 ld a,(hl) ;check y match
1923 sub d ;same as with x-check
1926 add a,(ix+1) ;enemy height
1933 ld hl,2 ;increase score by 2
1937 ld a,(hl) ;load enemy type
1939 jr nz,collide ;enemy when <>0
1942 ld hl,your_pickup ;your pickups
1947 ld a,1 ;yes: reset to pickup 1
1950 cal disp_icons ;display altered pickupicons
1953 dec hl ;to enemy occ
1954 xor a ;set to 0 = gone
1956 jr check_next ;all done, next..
1959 ld (hl),%01 ;set to explode
1961 ld (hl),0 ;explosionFrame 0
1973 ld b,collidedamage ;damage
1985 ;--------------------------- story ------------------------------------------
2005 ld hl,VIDEO_MEM ;copy text
2006 ld de,GRAPH_MEM ;to GRAPH_MEM
2007 ld bc,1024 ;entire screen
2023 cal storyPage ;do some story
2024 inc hl ;look at next hl
2025 ld a,(hl) ;load in a
2027 inc a ;set z-flag if a = $ff
2028 jr nz,dostory ;otherwise loop
2031 add hl,bc ;set hl to beginning of the level
2032 ld (levelp),hl ;set the level-pointer
2035 ;--------------------------- SFX --------------------------------------------
2037 DoSFX: ;in:a=beginLine;b=nrOfLines
2042 ld a,0 ;get line number
2044 inc a ;go to the next line
2045 ld (curline),a ;update
2052 add hl,hl ;*16 (a pixels down=a*16)
2054 ld b,h ;save hl for later
2057 ld de,VIDEO_MEM ;where to put sfx
2058 add hl,de ;go to ymin
2059 ex de,hl ;put into de again
2065 neg ;a=64-a (lines from bottom)
2067 ; ld c,a ;c=a=(curline)
2069 ; sub c ;lines from bottom
2071 SFXdisp: ;display this frame on screen
2072 ld bc,16 ;one line (=16 bytes, you'd know by now)
2073 ldir ;display (copy actually)
2074 ld bc,-16 ;go up one line (not on screen)
2075 add hl,bc ;so the same line will be displayed
2077 jr nz,SFXdisp ;repeat until whole screen is displayed
2088 ;--------------------------- show icon --------------------------------------
2091 ld (hl),a ;draw one piece of the divider-line
2092 inc hl ;move right (8 pixels = 1 byte)
2093 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
2097 psh bc \ psh de \ psh hl \ psh ix ;&&&
2099 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
2100 ld (PutWhere),hl ;place icons at bottom of normal screen
2101 ld b,16 ;draw 16x (screen width)
2102 ld a,%11111111 ;horizontal line mask
2103 cal drawline ;draw divider-line
2105 ld b,16*7 ;draw 16x (screen width) 7x (height)
2106 xor a ;blank line mask
2107 cal drawline ;clear scorebar
2111 ld ix,spr_icon01 ;armorIcon
2112 ld de,$1901 ;icon #1
2113 cal putwidesprite ;display icon
2114 cal disp_armor ;display bar
2120 ld ix,spr_icon02 ;torpedoIcon
2122 ld de,$2901 ;icon #2
2123 cal putwidesprite ;display
2125 ld ix,spr_icon03 ;bulletIcon
2126 ld de,$3901 ;icon #3
2127 cal putwidesprite ;display icon
2128 ld hl,$3945 ;position to display bullet-type digit
2129 ld a,(your_weapon) ;digit
2130 dec a ;minus one (1=laser)
2131 ld (_penCol),hl ;set location
2132 add a,'0' ;make digit
2133 cal _vputmap ;display char
2135 ld ix,spr_icon00 ;emptyIcon
2139 ld ix,spr_icon04 ;laserIcon
2141 ld de,$4901 ;icon #4
2144 ld ix,spr_icon00 ;emptyIcon
2145 ld a,(your_multiples)
2150 ld de,$5901 ;icon #5
2153 ld ix,spr_dividerline
2157 ld a,(your_pickup) ;pickups taken
2158 add a,a ;picks*2 (sets z-flag)
2159 jr z,iconsdone ;return if no pickups
2164 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
2165 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
2170 ld hl,GRAPH_MEM ;normal game-screen
2171 ld (PutWhere),hl ;set sprite-position to normal screen
2173 pop ix \ pop hl \ pop de \ pop bc
2177 ld hl,(57*16)+VIDEO_MEM+3
2184 ld a,(your_armor) ;load your armor
2188 srl a ;/8: don't display last 3 bits of a (later)
2189 jr z,noarmorbar ;if a=0 then it would loop 256x so skip it
2190 ld b,a ;loop b=a times
2191 armorbar: ;starting at ($39*16)+VIDEO_MEM
2192 ld (hl),%11111111 ;draw a piece of the bar
2193 inc hl ;next position
2194 dnz armorbar ;loop it b times
2198 and %111 ;display last bits of armor
2199 ret z ;if armor=0 then bit = %00000000 (don't disp)
2201 xor a ;bit = %00000000
2204 rra ;rotates A right and sets bit 7 (c-flag)
2205 dnz armorbarbit ;repeat B times (so if B=6 then a=%11111100)
2206 armorbarready: ; (an if B=3 then a=%11100000)
2207 ld (hl),a ;draw this last byte
2211 ld hl,(58*16)+VIDEO_MEM+3
2217 ld a,(weapincs) ;load bar size (0-80)
2218 srl a ;half the size (0-40)
2219 srl a ;again half that size (0-20 pixels)
2223 srl a ;/8: don't display last 3 bits of a (later)
2224 jr z,nochargebar ;if a=0 then it would loop 256x so skip it
2225 ld b,a ;loop b=a times
2226 chargebar: ;starting at ($39*16)+VIDEO_MEM
2227 ld (hl),%11111111 ;draw a piece of the bar
2228 inc hl ;next position
2229 dnz armorbar ;loop it b times
2232 and %111 ;display last bits of chargebar
2233 ret z ;if armor=0 then bit = %00000000 (don't disp)
2235 xor a ;bit = %00000000
2238 rra ;rotates A right and sets bit 7 (c-flag)
2239 dnz chargebarbit ;repeat B times (so if B=6 then a=%11111100)
2240 chargebarready: ; (an if B=3 then a=%11100000)
2241 ld (hl),a ;draw this last byte
2245 ld hl,$3A00 ;display Lives
2246 ld (_penCol),hl ;bottom left
2253 ld a,(your_lives) ;nr of lives in a
2254 add a,'0' ;make digit
2257 jp _vputs ;display on screen +ret
2259 ;--------------------------- proc -------------------------------------------
2261 Random: ;a=b<random<b+c; destr:none
2263 add a,0 ;increase last value by 0-255 (r)
2265 ld (ranseed),a ;save for next time
2268 jr nc,Random ;then add again
2272 RandomY: ;HL = random Y 0..50 right side ((1..51)*16-1)
2274 ld bc,1+50*256 ;range=1..51
2275 cal Random ;a = 1..51
2281 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2282 dec hl ;hl = 0..50 * 16 (" at right side of screen)
2284 add hl,de ;position on screen
2296 find_sprite: ;in:hl=enemy+type | out:ix=sprite to enemy
2299 ld e,(hl) ;e = enemy type
2301 ld hl,XLenemytable ;hl = @sprites offset-table
2302 add hl,de ;points to offset of current enemy offset
2303 ld e,(hl) ;de = @enemy offset
2305 ld ix,spr_enemy00 ;first enemy sprite
2306 add ix,de ;add offset for current enemy
2307 add ix,de ;twice (offset stored as offset/2)
2313 ld hl,VIDEO_MEM ;screen location (top left)
2316 ld bc,1024-1 ;do it 1024 times = entire screen
2318 set 3,(iy+5) ;set white on black
2323 ld a,%10000000 ;all key-masks
2326 inc a ;cp %11111111 (no keys pressed)
2327 jr nz,releasekeys ;keep waitin
2328 cal GET_KEY ;clear buffer
2331 ;--------------------------- game over / new game / death -------------------
2333 .db 0,".<>!",0,0,0,0 ;down,L,R,up
2334 .db 0,"xtoje0",0 ;enter..clear
2335 .db " wsnid9",0 ;(-)..custom
2336 .db "zvrmhc8",0 ;dot..del
2337 .db "yuqlgb7#" ;0..xvar
2338 .db $D9,"-pkfa6'" ;on..alpha
2339 .db "54321*",0,$D0 ;F5..more
2342 ld hl,_asapvar ;find own variable
2343 rst 20h ;cal _ABS_MOV10TOOP1
2344 rst 10h ;cal _FINDSYM
2345 ret c ;not found? who cares...
2348 ld hl,4+storehi_start-_asm_exec_ram
2349 add hl,de ;hl=pointer to data in original prog
2351 cal _SET_ABS_DEST_ADDR
2354 cal _SET_ABS_SRC_ADDR
2355 ld hl,storehi_end-storehi_start
2356 cal _SET_MM_NUM_BYTES
2357 cal _mm_ldir ;save done (cal \ ret)
2361 ld hl,_asapvar ;find own variable
2362 rst 20h ;cal _ABS_MOV10TOOP1
2363 rst 10h ;cal _FINDSYM
2364 ret c ;not found? who cares...
2367 ld hl,4+storesave_start-_asm_exec_ram
2368 add hl,de ;hl=pointer to data in original prog
2370 cal _SET_ABS_DEST_ADDR
2372 ld hl,storesave_start
2373 cal _SET_ABS_SRC_ADDR
2374 ld hl,storesave_end-storesave_start
2375 cal _SET_MM_NUM_BYTES
2376 cal _mm_ldir ;save done (cal \ ret)
2379 game_over: ;stack=+0
2380 cal BLACKLCD ;clear screen
2382 ld (_curRow),hl ;center
2384 cal _puts ;display "GAME OVER"
2385 cal releasekeys ;wait for all keys to be released
2466 xor a ;clear a (Ahl will be displayed)
2467 ld hl,$1006 ;bottom-1 right
2468 ld (_curRow),hl ;set
2469 ld hl,(your_score) ;your score
2470 cal _dispahl ;display it (a=0)
2472 ld hl,$314b ;bottom-1 right before score ^^
2473 ld (_penCol),hl ;set
2474 ld hl,txt_score ;"Score"
2475 cal _vputs ;display (small)
2477 ld hl,$1007 ;bottom right
2478 ld (_curRow),hl ;set
2479 ld hl,(hiscore) ;hi-score
2480 cal _dispahl ;display
2481 ld hl,$3946 ;bottom right before hiscore ^^
2482 ld (_penCol),hl ;set
2483 ld hl,txt_hiscore ;"Hiscore"
2484 cal _vputs ;display (small)
2489 ld hl,VIDEO_MEM+(49*16)-1
2495 cal _getkey ;wait for keypress
2496 jp quit ;restore some things and return to TI-OS/shell
2498 New_game: ;stack must be +1 (so change the jp in cal :)
2500 ld (your_score),a ;reset score
2501 ld (your_score+1),a ;reset score (0)
2502 ld (torp_occ),a ;no torpedoes
2503 ld (your_weapon),a ;no laser
2504 ld (your_pickup),a ;reset pickups
2505 ld (your_multiples),a ;no multiples
2507 ld (level),a ;reset level nr (#1)
2508 ld hl,level00 ;set level pointer to level#1
2509 ld (levelp),hl ;reset level pointer
2511 ld (your_weapon),a ;default weapon
2513 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
2514 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
2516 You_die: ;stack must be +1
2517 pop hl ;restore stack
2519 ld (your_armor),a ;12 HPs/shields
2520 ld a,(your_lives) ;load lives left
2521 dec a ;decrease lives
2522 ld (your_lives),a ;if lives=0ffh GO
2523 inc a ;if -1 then zf set now
2524 jp z,game_over ;and game's over
2527 ;--------------------------- next level -------------------------------------
2529 Next_level: ;stack must be +1
2531 ld a,(your_armor) ;load current armor
2532 cp 25-8 ;may not become >=25
2533 jr c,addok ;ok then just add 8
2534 ld a,25-8 ;set to maximum (8 will be added below)
2536 add a,8 ;add 8 to armor
2537 ld (your_armor),a ;change armor
2539 ld hl,level ;level number
2546 ld h,0 ;increase score....
2547 ld l,a ;by level number * 4
2550 cal scoreInc ;update score
2552 ld hl,(levelp) ;level pointer
2553 ld bc,5+32+4+4 ;advance one level
2554 add hl,bc ;update to point to next level
2555 ld (levelp),hl ;save
2559 ld (nextevent),a ;time to first enemy appearance
2561 ld hl,(levelp) ;level pointer
2566 ld a,(hl) ;load new level-enemy type
2567 ld (level_enemy),a ;set level-enemy
2569 ld a,(hl) ;load new appearance-time
2570 ld (eventtime),a ;set
2572 ld a,(hl) ;load nr of enemies in this level
2573 ld (eventleft),a ;set nr of events left
2578 ld a,(hl) ;movement of enemies in this level
2579 ld (level_move),a ;do it
2581 ld a,(hl) ;how frequent the enemies fire a bullet
2582 ld (level_fire),a ;consider it done
2597 ld (timer),a ;reset time
2598 ld hl,your_occ ;hl = your_occ
2599 ld (hl),a ;reset your ship (not exploding)
2600 inc hl ;hl = your_inv
2601 ld (hl),25 ;set 25*4=100 frames invulnerable
2603 ld (x),de ;begin position (x,y)
2604 cal Place_multiples ;place all multiple-positions at that (0,24)
2608 jr z,torpsclear ;then just continue (=0)
2609 ld a,1 ;if so, set to "ready to fire" (=1)
2612 ld hl,enemies ;remove all enemies and bullets
2613 ld (hl),0 ;clear first byte
2614 ld de,enemies+1 ;copy this to the next byte
2615 ld bc,(nrenemies*enemysize)+((nrybuls+nrebuls)*3)-1
2616 ldir ;clear enemies + bullets (y/e)
2618 ;--------------------------- setup game -------------------------------------
2621 cal BLACKLCD ;white on black
2624 ld (_curRow),de ;center
2625 cal _puts ;display "LEVEL "
2627 ld a,(level) ;current level
2630 cal UNPACK_HL ;create first digit
2633 cal UNPACK_HL ;second digit
2635 cal _putc ;display second digit
2637 cal _putmap ;display first digit
2639 ld hl,txt_lives ;bar text: "Lx0"...
2641 ld (_curRow),de ;display lives left below level nr
2643 ld a,(your_lives) ;lives left
2644 add a,'0' ;make value 0='0'
2647 cal releasekeys ;wait for user to release all keys
2648 ld hl,txt_savekey ;"Press [F1] to save"
2649 ld de,$3A46 ;bottom-right
2653 res 3,(iy+5) ;set white on black
2654 cal _getkey ;wait for keypress
2658 cal _clrLCD ;clear screen
2659 cal disp_icons ;display bottom icons +ret
2663 cal RandomY ;a = random y-pos 1..bottom
2664 ld a,b ;a = b = star nr. = 1..7
2665 add a,a ;a = 2b = 2..14
2667 ld e,a ;de = a = 2-14
2669 sbc hl,de ;substract from random y => random pos anywhere
2671 ld (ix),l ;save x-pos (l)
2672 ld (ix+1),h ;save y-pos (h)
2673 inc ix \ inc ix ;next star
2674 dnz placestars ;repeat for all stars
2687 ld (weapdamage),a ;damage of bullets
2690 ld (weapdaminc),a ;damage increase
2693 ;--------------------------- putsprite --------------------------------------
2694 ;--------------------------- de =(X,Y) --------------------------------------
2697 .db $80,$40,$20,$10,8,4,2,1
2700 and %00000111 ;a = X mod 8 = bit nr. to mask
2701 ld hl,offsets_table ;pixel mask table
2704 add hl,bc ;add to table
2705 ld a,(hl) ;a = pixel mask
2706 ld (_smc1+1),a ;alter pixel mask
2708 ld hl,GRAPH_MEM ;save-location
2713 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
2714 add a,a ;y*16 (width of screen)
2715 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
2718 srl d ;d/8 (8 bits in byte) ** c is set when overflow
2719 add a,d ;a = (Y*16+X/8) mod 256
2720 jr nc,_n1 ;jump if no carry = no overflow = a<=255
2721 inc b ;a>255 so increase bc by 256
2722 _n1: ld c,a ;c = (Y*16+X/8) mod 256
2723 add hl,bc ;bc = Y*16+X/8
2727 _oloop: psh bc ;Save # of rows
2728 psh hl ;Save screen address
2730 ld c,(ix+2) ;Load one line of image
2732 _smc1: ld a,1 ;Load pixel mask
2733 _iloop: sla c ;Test leftmost pixel
2734 jr nc,_noplot ;See if a plot is needed
2735 ld e,a ;OR pixel with screen
2740 jr nc,_notedge ;Test if edge of byte reached
2741 inc hl ;Go to next byte
2744 pop hl ;Restore address
2745 ld bc,16 ;Go to next line
2747 pop bc ;Restore data
2749 ret ;<jp>s are used instead of <jr> = faster
2751 ;--------------------------- putbigsprite -----------------------------------
2784 woloop: psh bc ;Save # of rows
2785 psh hl ;Save screen address
2787 ld c,(ix+2) ;Load one line of image
2789 wsmc1: ld a,1 ;Load pixel mask
2790 wiloop: sla c ;Test leftmost pixel
2791 jr nc,wnoplot ;See if a plot is needed
2792 ld e,a ;OR pixel with screen
2798 jr nc,wnotedge ;Test if edge of byte reached
2799 inc hl ;Go to next byte
2805 pop hl ;Restore address
2806 ld bc,16 ;Go to next line
2808 pop bc ;Restore data
2823 ;----------------------------------------------------------------------------
2824 ;------------------------------- sprites ------------------------------------
2825 ;----------------------------------------------------------------------------
2828 .db 7,7 ;ship alpha class
2829 .db %01111000 ; ████
2831 .db %01111100 ; █████
2832 .db %11110010 ;████ █
2833 .db %01111100 ; █████
2835 .db %01111000 ; ████
2838 .db %01111010 ; ████ █
2839 .db %11100001 ;███ █
2840 .db %01111101 ; █████ █
2841 .db %11110011 ;████ ██
2842 .db %01111101 ; █████ █
2843 .db %11100001 ;███ █
2844 .db %01111010 ; ████ █
2847 .db 7,7 ;ship beta class
2850 .db %01111100 ; █████
2851 .db %01110010 ; ███ █
2852 .db %01111100 ; █████
2857 .db %11100010 ;███ █
2858 .db %11110001 ;████ █
2859 .db %01111101 ; █████ █
2860 .db %01110011 ; ███ ██
2861 .db %01111101 ; █████ █
2862 .db %11110001 ;████ █
2863 .db %11100010 ;███ █
2866 .db 7,7 ;ship gamma class
2867 .db %11111000 ;█████
2869 .db %11111100 ;██████
2870 .db %11100110 ;███ ██
2871 .db %11111100 ;██████
2873 .db %11111000 ;█████
2876 .db %11111010 ;█████ █
2877 .db %01100001 ; ██ █
2878 .db %11111101 ;██████ █
2879 .db %11100111 ;███ ███
2880 .db %11111101 ;██████ █
2881 .db %01100001 ; ██ █
2882 .db %11111010 ;█████ █
2885 .db 7,7 ;ship delta class
2887 .db %11110000 ; ████
2888 .db %11111100 ; ██████
2889 .db %01100010 ; ██ █
2890 .db %11111100 ; ██████
2891 .db %11110000 ; ████
2895 .db %11000010 ; ██ █
2896 .db %11110001 ; ████ █
2897 .db %11111101 ; ██████ █
2898 .db %01100011 ; ██ ██
2899 .db %11111101 ; ██████ █
2900 .db %11110001 ; ████ █
2901 .db %11000010 ; ██ █
2905 .db %01111000 ; ████
2906 .db %11001100 ; ██ ██
2908 .db %11001100 ; ██ ██
2909 .db %01111000 ; ████
2911 ;-------------------------------- explosion ---------------------------------
2917 .db %00111110 ; █████
2918 .db %01010110 ; █ █ ██
2924 .db %01001110 ; █ ▒███
2925 .db %10111110 ; █ █████
2926 .db %01001111 ; █ ▒████
2928 .db %00011010 ; ██ █
2931 .db %10110000 ; █ ██
2932 .db %01001110 ; █ ███
2933 .db %10110101 ; █ ██▒█▒█
2934 .db %01000101 ; █ ▒█▒█
2935 .db %00111110 ; █████
2936 .db %01011010 ; █ ██ █
2939 .db %00101010 ; ▒ █▒█ █
2940 .db %01000110 ; █ ▒██
2941 .db %10110101 ; █ ██ █ █
2942 .db %01100110 ; ██ ██▒
2943 .db %00111100 ; ████▒
2944 .db %01011001 ; █ ██ ▒█
2947 .db %01000000 ; █▒ ▒ ▒
2948 .db %00100101 ; ▒█ █▒█
2949 .db %00010100 ; ▒ ▒█ █ ▒
2950 .db %01000100 ; █▒ █
2951 .db %00010010 ; ▒█▒▒█
2952 .db %10011010 ; █▒ ██ █▒
2956 .db %00100000 ; ▒█ ▒ ▒
2957 .db %00000001 ; ▒ ▒ █
2959 .db %00100010 ; █▒ █
2960 .db %01001000 ; ▒█ ▒█ ▒
2963 .db %00001000 ; ▒ █▒
2964 .db %11000010 ; ██ ▒ █
2966 .db %00100000 ; ▒█ ▒
2967 .db %00000001 ; ▒ ▒█
2968 .db %00110000 ; ▒██▒
2972 .db %00000000 ; ▒▒ ▒
2976 .db %00100100 ; █▒ █
2987 ;--------------------------------- bullets ----------------------------------
2994 .db %11110000 ;▒████
3006 .db %11110000 ;▒████
3011 .db %11111000 ;▒█████
3015 .db %01110000 ; ▒███
3016 .db %11111000 ;▒█████
3017 .db %01110000 ; ▒███
3020 .db %11110000 ;▒████
3021 .db %11111000 ;▒█████
3022 .db %11110000 ;▒████
3026 .db %10111000 ;▒█▒███
3027 .db %01111000 ; ▒████
3031 .db %00111000 ; ▒███
3032 .db %01111100 ; ▒█████
3033 .db %11111100 ;▒██████
3038 .db %11111100 ;▒██████
3039 .db %00111110 ; ▒█████
3040 .db %01111100 ; ▒█████
3045 .db %11111100 ;▒██████
3046 .db %00111110 ; ▒█████
3047 .db %01111110 ; ▒██████
3048 .db %11111100 ;▒██████
3049 .db %00111000 ; ▒███
3052 .db %00111100 ; ▒████
3053 .db %11111110 ;▒███████
3054 .db %01111111 ; ▒███████
3055 .db %00011111 ; ▒█████
3056 .db %01111111 ; ▒███████
3057 .db %11111110 ;▒███████
3058 .db %00111100 ; ▒████
3062 .db %11110000 ; ████
3066 .db 4,3 ;enemy bullets
3068 .db %11110000 ;████▒
3072 .db (spr_bullet01-spr_bullet01) ;0
3073 .db (spr_bullet02-spr_bullet01) ;4
3074 .db (spr_bullet03-spr_bullet01) ;8
3075 .db (spr_bullet04-spr_bullet01) ;12
3076 .db (spr_bullet05-spr_bullet01) ;16
3077 .db (spr_bullet06-spr_bullet01) ;20
3078 .db (spr_bullet07-spr_bullet01) ;24
3079 .db (spr_bullet08-spr_bullet01) ;28
3080 .db (spr_bullet09-spr_bullet01) ;32
3081 .db (spr_bullet10-spr_bullet01) ;36
3082 .db (spr_bullet11-spr_bullet01) ;40
3083 .db (spr_bullet12-spr_bullet01) ;44
3084 .db (spr_bullet13-spr_bullet01) ;48
3085 .db (spr_bullet13-spr_bullet01) ;52
3086 .db (spr_bullet13-spr_bullet01) ;56
3087 .db (spr_bullet13-spr_bullet01) ;60
3089 ;format:[min.damage] [dam.inc] [0000:direction 0000:speed] [offset]
3090 ;damage = min.damage + dam.inc*incs (0<=incs<=6)
3093 .db 1,1,%00000010,2,%00000000,0,%00000000,0 ;single fire
3094 .db 3,1,%00000011,2,%00000000,0,%00000000,0 ;fast single
3095 .db 1,1,%00000010,0,%00000010,5,%00000000,0 ;double
3096 .db 1,1,%00010010,2,%00110010,2,%01000010,2 ;triple
3097 .db 3,2,%00010011,2,%00110011,2,%01000011,2
3098 .db 5,3,%00010011,2,%00110011,2,%01000100,2
3099 .db 7,4,%00010100,2,%00110100,2,%01000100,2
3100 .db 12,5,%00010110,2,%00110110,2,%01000110,2
3104 ;------------------------------------ bar -----------------------------------
3107 .db 16,7 ;selected .......:.......:
3108 .db %11111111,%11111111 ; ████████████████
3109 .db %11000000,%00000001 ; ██ █
3110 .db %11000000,%00000001 ; ██ █
3111 .db %11000000,%00000001 ; ██ █
3112 .db %11000000,%00000001 ; ██ █
3113 .db %11000000,%00000001 ; ██ █
3114 .db %11111111,%11111111 ; ████████████████
3116 .db 16,7 ;unused .......:.......:
3117 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3118 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3119 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3120 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3121 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3122 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3123 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3125 .db 16,7 ;armor ; .......:.......:
3126 .db %10000111,%11110000 ; █ ███████
3127 .db %10011000,%00001100 ; █ ██ ██
3128 .db %10110011,%11000110 ; █ ██ ████ ██
3129 .db %10110000,%11110110 ; █ ██ ████ ██
3130 .db %10110011,%11000110 ; █ ██ ████ ██
3131 .db %10011000,%00001100 ; █ ██ ██
3132 .db %10000111,%11110000 ; █ ███████
3134 .db 16,7 ;torpedo .......:.......:
3135 .db %10111000,%00010101 ; █ ███ █ █ █
3136 .db %10011100,%00010101 ; █ ███ █ █ █
3137 .db %10111000,%01001010 ; █ ███ █ █ █
3138 .db %10000000,%11101010 ; █ ███ █ █
3139 .db %11100001,%11100101 ; ███ ████ █ █
3140 .db %10011000,%11110101 ; █ ██ ████ █ █
3141 .db %11100110,%00110010 ; ███ ██ ██ █
3143 .db 16,7 ;bullets .......:.......:
3144 .db %10000000,%11000000 ; █ ██
3145 .db %10000011,%11100000 ; █ █████ ▒▒▒
3146 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3147 .db %11111100,%00000000 ; ██████ ▒▒▒
3148 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3149 .db %10000011,%11100000 ; █ █████ ▒▒▒
3150 .db %10000000,%11000000 ; █ ██
3152 .db 16,7 ;laser .......:.......:
3153 .db %10000000,%00000000 ; █
3154 .db %10110010,%10000000 ; █ ██ █ █
3155 .db %10111011,%00000000 ; █ ███ ██
3156 .db %10011101,%11111111 ; █ ███ █████████
3157 .db %10111011,%00000000 ; █ ███ ██
3158 .db %10110010,%10000000 ; █ ██ █ █
3159 .db %10000000,%00000000 ; █
3161 .db 16,7 ;multiple .......:.......:
3162 .db %10000011,%10000000 ; █ ███
3163 .db %10000001,%11100110 ; █ ████ ██
3164 .db %10000001,%11100000 ; █ ████
3165 .db %10000011,%10000000 ; █ ███
3166 .db %10011000,%00000000 ; █ ██
3167 .db %10111100,%11000011 ; █ ████ ██ ██
3168 .db %10011000,%00000000 ; █ ██
3171 .db 128,128,128,128,128,128,128 ;128 = %10000000
3173 ;---------------------------- texts -----------------------------------------
3175 txt_email: .db "www.shiar.org ",127 ;title screen
3176 .db " shiar0@hotmail.com",0
3177 _txt_email = $3A01 ;$3A1E=just email
3178 txt_about: .db " v0.97.624 ",127," by Shiar",0 ;right behind txt_email
3180 txt_menu1: .db "NEW GAME",0
3181 txt_menu2: .db "CONTINUE",0
3183 txt_level: .db "LEVEL ",0 ;new level screen
3184 txt_lives: .db "Lx0",0
3185 txt_savekey: .db "Press [F1] to save",0
3187 txt_gameover: .db "GAME OVER!",0 ;game over screen
3188 txt_score: .db "Score",0
3189 txt_hiscore: .db "Hiscore",0
3191 txt_pressenter: .db "Enter to continue",0 ;pause
3192 txt_teacher: .db "(2",Lpi,"*.95)/sin 13",0 ;boss
3193 txt_teacherans: .db Lneg,"14.2063168184",0
3195 ;---------------------------- save data -------------------------------------
3197 PutWhere .dw GRAPH_MEM ;where to put the wide sprites
3202 hiname .db "Shiar.97",0
3206 level .db $01 ;level number
3207 levelp .dw level01 ;pointer to level data
3208 pickuptimer .db $04 ;counts when to place a pickup
3209 your_score .dw $0000
3212 your_occ .db $00 ;0=normal 1..16=exploding
3213 your_inv .db $00 ;invincibility left
3214 your_armor .db $0a ;HP left
3215 your_lives .db $03 ;
3217 your_weapon .db $02 ;weapon: 0=no, 1=laser, 2+=bullet n+1
3218 your_multiples .db $00 ;multiples present
3219 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
3220 torp_pos .dw $0000 ;torpedo position (x,y)
3224 ;XLlevelsdata:---------------------------------------------------------------
3228 .db $21,$1d,"Cosmic year 6716" ,0,0,$1d,$06
3229 .db $1b,$1d,"storyline coming soon..." ,0,0,$1d,$06
3230 .db $09,$19,"the Nemesis saga continues",0,1
3231 .db $2e,$21,"with NEMESIS 86" ,0,1
3232 .db $52,$36,"by Shiar" ,0,0,$19,$23
3235 ;format:[enemy nr] [enemy frequency] [next lvl]
3236 ; [level_info: 0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
3237 ; [level_move] [level_fire] [tunnel size] [groundtype] [16_ground]
3238 ; [16_ceiling] [stars1] [stars2]
3240 .db $15,$07,$08 ;fireFreq; moveType; enemyType
3241 level01: ;efrequency must be odd if halfluring!
3242 .db $01,$1b,$2f,%00010001,0,255,0,0 ;0f>>2f ; 7
3243 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3244 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3249 .db $01,01,"And the storyline conti",
3251 .db $01,09,"You decide to fly close",
3253 .db $01,15,"surface of a nearby pl",
3254 .db "anet =)",0,0,1,20
3259 .db $02,$13,$4b,%00100101,0,064,0,0
3260 .db 1,2,3,4,5,6,6,5,4,3,4,5,4,3,2,1
3261 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3266 .db $01,01,"Blablabla...",0,1
3267 .db $01,34,"this storyline sux",0,0,1,39
3272 .db $03,$2d,$3f,%00010110,0,255,-9,1
3273 .db 3,2,4,3,2,2,1,1,1,1 ,1,1,21,17,18,20
3274 .db 1,1,1,1,1,1,1,3,6,12,9,1,21,19,18,18
3279 .db $04,$11,$41,%00100001,0,057,0,0
3280 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3281 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3285 .db $05,$11,$45,%00100101,%10,031,-7,1
3286 .db 14,12,11,9,10,7,7,5,4,3,4,4,2,3,1,2
3287 .db 1, 1, 1, 1,1, 1,1,1,1,1,1,1,1,1,1,1
3291 .db $06,$19,$3a,%00100111,0,255,-4,1
3292 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3293 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3298 .db $07,$09,$ff,%00100001,0,043,0,0
3299 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3300 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3303 ;------------------------------ enemies -------------------------------------
3310 .db %11111111 ; ████████
3311 .db %11111111 ; ████████
3317 .db 6,6 ;enemy type one
3318 .db %00111100 ; ████
3320 .db %11110000 ; ████
3321 .db %11110000 ; ████
3323 .db %00111100 ; ████
3325 .db 8,6 ;enemy type two
3326 .db %00111111 ; █████
3327 .db %01111000 ; ████
3328 .db %11111100 ; ██████
3329 .db %11111100 ; ██████
3330 .db %01111000 ; ████
3331 .db %00111111 ; █████
3333 .db 6,6 ;enemy type three
3334 .db %01111100 ; █████
3335 .db %11110000 ; ████
3336 .db %11111000 ; █████
3337 .db %11111000 ; █████
3338 .db %11110000 ; ████
3339 .db %01111100 ; █████
3341 .db 6,6 ;enemy type four
3343 .db %01111100 ; █████
3344 .db %11111000 ; █████
3345 .db %11111000 ; █████
3346 .db %01111100 ; █████
3349 .db 7,6 ;enemy type five
3350 .db %00011110 ; ████
3351 .db %01111110 ; ██████
3352 .db %11111100 ; ██████
3353 .db %11111100 ; ██████
3354 .db %01111110 ; ██████
3355 .db %00011110 ; ████
3357 .db 7,6 ;enemy type six
3359 .db %01111110 ; ██████
3360 .db %10111000 ; █ ███
3361 .db %10111000 ; █ ███
3362 .db %01111110 ; ██████
3365 .db 8,6 ;enemy type seven
3366 .db %00011110 ; ████
3367 .db %01111111 ; ███████
3368 .db %10011100 ; █ ███
3369 .db %10011100 ; █ ███
3370 .db %01111111 ; ███████
3371 .db %00011110 ; ████
3373 .db 8,6 ;enemy type seven
3374 .db %00011110 ; ████
3375 .db %01111111 ; ███████
3376 .db %10011100 ; █ ███
3377 .db %10011100 ; █ ███
3378 .db %01111111 ; ███████
3379 .db %00011110 ; ████
3382 .db 16,10 ;boss type one
3383 .db %00000001,%11111111 ; █████████
3384 .db %00001111,%11111110 ; ███████████
3385 .db %00111111,%11110000 ; ██████████
3386 .db %01011111,%10000000 ; █ ██████
3387 .db %10011111,%01000000 ; █ █████ █
3388 .db %10011111,%01000000 ; █ █████ █
3389 .db %01011111,%10000000 ; █ ██████
3390 .db %00111111,%11110000 ; ██████████
3391 .db %00001111,%11111110 ; ███████████
3392 .db %00000001,%11111111 ; █████████
3394 .db 16,10 ;boss type:one :
3395 .db %11111110,%00000000 ; ███████
3396 .db %00001111,%10001111 ; █████ ████
3397 .db %00111111,%11100011 ; █████████ ██
3398 .db %01001111,%11111110 ; █ ███████████
3399 .db %10001101,%01111100 ; █ ██ █ █████
3400 .db %10001101,%01111100 ; █ ██ █ █████
3401 .db %01001111,%11111110 ; █ ███████████
3402 .db %00111111,%11100011 ; █████████ ██
3403 .db %00001111,%10001111 ; █████ ████
3404 .db %11111110,%00000000 ; ███████
3408 .db (spr_enemy01-spr_enemy00)/2 ;01
3409 .db (spr_enemy02-spr_enemy00)/2 ;02
3410 .db (spr_enemy03-spr_enemy00)/2 ;03
3411 .db (spr_enemy04-spr_enemy00)/2 ;04
3412 .db (spr_enemy05-spr_enemy00)/2 ;05
3413 .db (spr_enemy06-spr_enemy00)/2 ;06
3414 .db (spr_enemy07-spr_enemy00)/2 ;07
3415 .db (spr_boss0_1-spr_enemy00)/2 ;08
3416 .db (spr_boss0_2-spr_enemy00)/2 ;09
3417 .db (spr_enemy08-spr_enemy00)/2 ;0A
3418 .db (spr_enemy00-spr_enemy00)/2 ;0B
3419 .db (spr_enemy00-spr_enemy00)/2 ;0C
3420 .db (spr_enemy00-spr_enemy00)/2 ;0D
3421 .db (spr_enemy00-spr_enemy00)/2 ;0E
3422 .db (spr_enemy00-spr_enemy00)/2 ;0F
3424 ;format: [000000:HP 00:occ] [HP64] [appearance(ypos)] [unused]
3426 .db %00100110,0,1,1 ;#1 HP:1 app:random
3427 .db %00101010,0,2,3 ;#2 HP:1 app:halflure
3428 .db %00001111,0,3,2 ;#3 HP:1 app:lure
3430 .db %00000110,0,4,2 ;#4 HP:2 app:lure
3431 .db %00000111,0,5,3 ;#5 HP:2 app:random moving
3432 .db %00001011,0,6,2 ;#6 HP:3 app:lure moving
3434 .db %00011011,0,7,3 ;#7 HP:7 app:halflure moving
3436 .db %00110011,1,8,1 ;boss1
3437 .db %00111011,0,9,3 ;boss2
3447 ;----------------------------------------------------------------------------
3448 ;----------------------------- logo ------------------------------------------
3449 ;----------------------------------------------------------------------------
3452 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
3453 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
3454 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
3455 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
3456 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
3457 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
3458 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
3459 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3460 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3461 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3462 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3463 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3464 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3465 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3466 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3467 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
3468 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
3469 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
3470 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
3472 ;----------------------------- end ------------------------------------------
3478 ;----------------------------------------------------------------------------
3479 ;----------------------------------------------------------------------------
3480 ;----------------------------------------------------------------------------
3482 ; 0.97.624 -- 24.VI.00 -- size 5803
3484 ; # bullets do damage in all levels
3485 ; * more armor at armor-upgrade and extra armor at end of a level
3486 ; - internal levels again (no need 4 external, safer/smaller)
3487 ; # some registers not correctly pushed/popped
3488 ; * several optimizations (init.procs some bytes smaller)
3489 ; # enemies hit with hitpoints left disappeared (one pop too much...)
3490 ; + bullets "charge up" (more damage) when not firing
3491 ; + more powerful bullets have different sprites (larger=more damage)
3492 ; # multiples appear at your position (begin level/just selected)
3493 ; # when invulnerable multiples acted weird
3494 ; # no more error at activation after APD off after running Nemesis
3495 ; # saves correctly if own name ain't "nemesis" + some bytes smaller
3496 ; # screen wasn't always entirely cleared after quit
3497 ; * waits until all keys have been released after death
3498 ; + different bullets sizes will miss if they're too small
3499 ; + at level start "press F1 to save"-text will be displayed
3500 ; * w3.shiar.org displayed at title screen, black bar behind version nr
3501 ; # score to 0 when exit pressed at main menu
3502 ; # no residual story-text in first frame of game
3503 ; # game doesn't continue again after death (stack messed up)
3504 ; # game over when lives<0 (didn't work in v0.96+)
3505 ; * using some self-modifiing code (so it's smaller)
3508 ; + added - removed * changed # bug fixed