1 ;----------------------------------------------------------------------------
2 ;---------------------- NEMESIS ---------------------------------------------
3 ;----------------------------------------------------------------------------
7 ; Release Date : 25.VI.00
8 ; Filename : nemesis.86p (6kb)
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 ; +0 ;counts how long a blast lasts
47 menuitem = storepos ; +0 ;used to store menu location
48 hiscorepos = storepos ; +0 ;entering hiscore name
50 x = storepos+1 ; +1 ;your ship's position
51 y = x+1 ; +2 ;your y-pos
52 firex = y+1 ; +3 ;(1 byte)
53 firey = firex+1 ; +4 ;(1 byte)
55 eventleft = storepos+5 ; +5 ;nr. of enemies still to come
56 nextevent = eventleft+1 ; +6 ;time to next event
57 level_enemy = nextevent+1 ; +7 ;enemy type
58 level_info = level_enemy+1 ; +8 ;info (see below)
59 level_move = level_info+1 ; +9 ;=
60 level_fire = level_move+1 ;+10
62 spacespace = storepos+19 ;+19
63 groundinfo = spacespace+1 ;+20
64 groundpos = groundinfo+1 ;+21 $10
65 ceilingpos = groundpos+16 ;+37 $10
67 stars1 = ceilingpos+16 ;+53
68 stars2 = stars1+1 ;+54
70 starx1 = storepos+55 ;+55
72 starx2 = starx1+(nrstars1*2) ;+69
74 mx = starx2+(nrstars2*2) ;+83 ;position of multiple#1
75 my = mx+1 ;+84 ;multiple y-pos
78 your_locpos = m2y+1 ;+87 ;position in your_prevpos tabl
79 your_prevpos = your_locpos+1 ;+88 ;save previous positions (32d)
81 ;^-----------------------------------<1 ;-120=$78
83 enemies = storepos2 ; +0 ;info about each enemy
84 enemysize = 7 ;infobytes per enemy
85 nrenemies = 16 ;max. nr of enemies
87 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,damg,x,y)
89 ebullets = ybullets+(nrybuls*4) ;+110 ;30 bytes = 10(state,x,y)
91 lvlenemies = ebullets+(nrebuls*3)
93 ;^-----------------------------------<2 ;-141=$8D
95 ; [0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
97 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 10=normal 11=moving)]
98 ; [ship type or explosion frame] [x] [y] [move] [fire]
100 ;---------------------- introduction ----------------------------------------
102 nop ;hello yas/ase/rascall/whathever
103 jp init ;here's the program, but first: a description
104 .dw $0001 ;description type 2 (description + YASicon)
105 .dw Title ;pointer to description (all shells)
106 .dw Icon ;pointer to YAS icon
108 Title: .db "Nemesis v0.97 by SHIAR",0
110 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 9bytes
113 .db %00111110 ; █████
114 .db %01111001 ; ████ █
115 .db %00111110 ; █████
117 .db %11100000 ; ███ ;recommend 80x50 screen mode
118 .DB 0 ;clear stupid YAS-line
120 ;---------------------- init ------------------------------------------------
132 init: cal BUSY_OFF ;turns the run-indicator off, obviously
133 cal _clrScrn ;clean the screen
135 res 2,(iy+13) ;don't scroll the screen
136 cal _flushallmenus ;remove TI menus
138 FixKeys: ;fixes some key problems like left+down bug
152 ld bc,int_end-int_handler
158 ;---------------------- main menu -------------------------------------------
161 xor a ;white bitmask (a=0)
162 ld hl,logo_nemesis ;from...
163 ld de,VIDEO_MEM+16 ;...to one line from top
164 ld b,e ;ld b,16: one line
166 ld (de),a ;clear/n byte
168 dnz AboveLogo ;repeat for the first line
169 ld bc,16*19 ;logo size
170 ldir ;display one line of logo
172 ld hl,16*$33+VIDEO_MEM ;$33 rows down
173 ld b,16*7 ;draw black 7 lines
174 ld a,%11111111 ;horizontal line mask
176 ld (hl),a ;draw one piece of the divider-line
177 inc hl ;move right (8 pixels = 1 byte)
178 dnz underline ;repeat
180 ld hl,_txt_email ;at the very bottom of tha screen
182 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
183 cal _vputs ;VERY important, so display in small font ?:}
185 set 3,(iy+5) ;set white on black
186 ld de,_txt_about ;near the bottom of the screen
187 ld (_penCol),de ;hl=txt_email++=txt_about
188 cal _vputs ;display version + me
189 res 3,(iy+5) ;return to default black on white
226 cal GET_KEY ;wait for keypress
244 jp samelevel ;game_main_loop
264 ;----------------------------------------------------------------------------
265 ;---------------------- game loop -------------------------------------------
266 ;----------------------------------------------------------------------------
268 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
269 ld hl,timer ;update time
270 inc (hl) ;increase by 1
271 jr nz,Clear_screen ;continue when new time <> 0
272 ld hl,1 ;once every 256 frames, increase score by 1
276 ld hl,GRAPH_MEM ;move from (hl) = top left
277 ld (hl),$00 ;first pixel will be copied all over the screen
278 ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
279 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
282 ld a,0 ;current frame/turn 0-255
284 and %11 ;a=0 once every 4 turns
285 jr z,movestarsdone ;don't move stars once every 4 frames
286 cal movestars1 ;move the stars on the FRONT layer
287 cal movestars2 ;move the distant stars
289 ld a,(stars1) ;star positions (the missing byte...)
290 ld b,nrstars1 ;how many stars? now we know.
291 ld hl,starx1 ;points to the position of the stars
292 cal DisplayStars ;display front layer stars
293 ld a,(stars2) ;weren't you paying attention five lines ago?
294 ld b,nrstars2 ;that many?! whow!
295 ld hl,starx2 ;and there they are
296 cal DisplayStars ;use the same procedure to display back layer
298 ld a,(level_info) ;level info
299 and %00000110 ;isolate ground&ceiling
300 jr z,game_stuff ;both non-present
301 and %00000010 ;bit representing the presence of any ceiling
302 cal nz,Handle_ceiling ;scroll the ceiling (if any) +check4collision
303 cal Handle_ground ;scroll the ground and check if we're dead
306 cal Handle_Ship ;move you
307 ld a,(your_occ) ;are you 100% OK?
309 jr nz,_gamestuff1 ;then don't check for movements/fires/...
312 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
313 out (1),a ;ask for them
314 nop \ nop ;delay 8 clocks
318 bit 6,a ;test bit 6 = exit-key = EXIT
319 jp z,game_over ;<exit> pressed, so be it
320 check_morekey: ;another unused label... poor compiler
321 bit 7,a ;test bit 7 = more-key = PAUSE
322 cal z,Pause ;yes, go to pause
325 bit 5,a ;test bit 5 = 2nd-key = FIRE
326 ld hl,check_selkey ;where to continue after executing Fire_bullet
327 psh hl ;push hl on stack (instead of cal Fire_bullet)
328 jp z,Fire_bullet ;fire smtn (bulletstorplasermultiples+stuff..)
329 pop hl ;no cal to Fire_bullet made, so pop stack
331 ld (just_fired),a ;reset just_fired
334 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
336 nop \ nop ;what's taking you so long
337 in a,(1) ;at last... our precious keyzzz...
339 bit 6,a ;'bout the GRAPH key...
340 cal z,Teacher ;you didn't _press_ it, did you?!?
342 rla ;test bit7 so we know f ALPHA has been pressed
343 cal nc,select ;yeppy, select the currently selected upgrade
345 cal Enemies_hit ;check for collision with enemies
349 cal Handle_enemies ;move enemies
351 cal Handle_bullets ;move your bullets + check for hits
352 cal Enemy_bullets ;move enemy bullets
353 cal Handle_torp ;the same for your torpedo (assuming u have 1)
355 cal Level_event ;insert enemies
356 cal Display_Screen ;display all
359 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
365 cp 97 ;max. 96 times (=96/16=6 increases)
366 ret nc ;return if already maxed
367 ld (weapincs),a ;save new incs
369 and %11110000 ;clear last 4 bits so no cf when rotating
371 rra ;rotate acting as shift (srl a) but just 1B
374 rra ;increase once just every 16 turns
375 ld b,a ;times to increase
377 add a,1 ;increase damage for one increase
379 dnz incthedamage ;a=total increase damage
380 ld b,1 ;minimal damage
382 add a,b ;a=total damage
383 ld (curweapdamage),a ;safe the current damage
387 ;--------------------------- ground -----------------------------------------
391 and %111 ;once every 8 frames
392 jr nz,Display_ground ;otherwise skip the scroll
393 ld bc,15 ;scroll all 16 bytes minus one (teh new byte)
394 ld hl,groundpos+1 ;from..
395 ld de,groundpos ;to (one byte to the left)
396 ldir ;LoaDIncreaseRepeat = scroll!
398 ld a,(groundinfo) ;what kind of ground
400 jr z,ground_tunnel ;tunnel effect
402 ld a,(groundpos) ;type 0
409 ld bc,$201 ;range=1..3
412 jr z,newground ;same if a=1
414 jr z,gtunneldown ;down if a=2
415 gtunnelup: ;up if a=3
418 jr z,newground ;a>=0 (a=0 actually)
430 ld (groundpos+15),a ;save new byte on the right
433 ld b,16 ;screen width
434 ld de,groundpos-1 ;height of current byte (previous actually)
436 ld hl,GRAPH_MEM+(56*16)-1 ;screen position
440 ld c,b ;push b for groundloopup
441 pop hl \ inc hl ;get screen position and go one right
442 pop de \ inc de ;get height info and set to the next byte
443 psh de \ psh hl ;save these for the next time
444 ld a,(de) ;height of current byte
447 ld de,16 ;to substract to go one line up
448 ld a,%11111111 ;bitmask black
451 ld (hl),a ;display black byte
452 sbc hl,de ;go up (sbc must be used for 16-bit sub)
453 dnz groundloopup ;and loop >groundpos< times
455 ld b,c ;pop b used by groundloopup
456 dnz groundloopright ;loop right for entire screen (16x)
457 pop hl \ pop hl ;restore stack
459 CheckGround: ;check for collision with the ground
477 ;--------------------------- ceiling ----------------------------------------
481 and %111 ;once every 8 frames
482 jr nz,Display_ceiling ;otherwise skip the scroll
483 ld bc,15 ;scroll all 15 bytes (16th is new position)
484 ld hl,ceilingpos+1 ;from..
485 ld de,ceilingpos ;to (one byte to the left)
486 ldir ;LoaDIncreaseRepeat = scroll!
488 ld a,(groundinfo) ;what kind of ceiling
490 jr z,ceiling_tunnel ;tunnel effect
495 ld d,a ;d=new ceiling
498 ld bc,$201 ;range=1..3
501 jr z,newceiling ;1:same
506 or a ;(spacespace)=0:
507 jr z,newceiling+2 ;keep same ceiling
513 cp d ;if size=1 then don't
519 ld (ceilingpos+15),a ;save the new byte
522 ld b,16 ;screen width
523 ld de,ceilingpos-1 ;height of current byte
525 ld hl,GRAPH_MEM-17 ;screen position
529 ld c,b ;push b for groundloopup
530 pop hl \ inc hl ;get screen position and go one right
531 pop de \ inc de ;get height info and set to the next byte
532 psh de \ psh hl ;save these for the next time
533 ld a,(de) ;height of current byte
536 ld de,16 ;to substract to go one line up
537 ld a,%11111111 ;bitmask black
540 ld (hl),a ;display black byte
542 dnz ceilingloopdown ;and loop >groundpos< times
544 ld b,c ;pop b used by groundloopup
545 dnz ceilingloopright ;loop right for entire screen (16x)
546 pop hl \ pop hl ;restore stack
548 CheckCeiling: ;check for collision with the ground
552 srl a ;x/8 (current ceiling-byte)
557 ld de,ceilingpos ;first ceiling-byte
558 add hl,de ;current ceiling-byte
561 cp (hl) ;compare with ceiling
562 ret nc ;carry if ceiling is above you
564 jp damage_you ;otherwise you don't wanna be in that ship
566 ;--------------------------- move stars -------------------------------------
568 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
575 ret ;let's comment this: returns
604 cp 9 ;(GRAPH_MEM&%00001111)-- = $C9FAand15-1 = $A-1
613 ret ;for stupid people, here's another comment...
615 ;--------------------------- pause ------------------------------------------
618 ld hl,$0200 ;top left
620 ld hl,txt_pressenter ;"Enter to continue"
621 cal _puts ;display message
623 cal _getkey ;enter low-power mode and wait for key
624 cp kEnter ;keypressed = enter?
625 jr nz,pause ;no, wait some more
628 ;--------------------------- teacher ----------------------------------------
631 ld (iy+12),5 ;enable flashing cursor
633 cal _homeup ;top left
635 cal _puts ;display message
638 cal _getkey ;enter low-power mode and wait for key
639 cp kEnter ;enter pressed?
641 cp kGrMenu ;keypressed = graph?
642 jr nz,teacherloop ;no, wait some more
644 ld (iy+12),0 ;disable cursor
658 ;--------------------------- exit -------------------------------------------
660 quit: im 1 ;release keyfix procedure
661 set 2,(iy+13) ;set back screen scrolling
663 ld (_asapvar+1),a ;next Asm( run will reload the program
664 ld hl,GRAPH_MEM ;graph-screen location
667 ld bc,1024-1 ;do it 1024 times = entire screen
669 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
670 ;_clrScrn) AND also executes _homeup and ret
672 ;--------------------------- display ----------------------------------------
675 ld hl,GRAPH_MEM ;from buffer (top left)
676 ld de,VIDEO_MEM ;to real screen (top left)
677 ld c,56 ;display height = 64 bytes (minus 8 for bar)
679 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
681 ld a,(hl) ;copy byte from (hl)
683 cpl ;xor $ff: invert byte (white<=>black)
685 inc hl \ inc de ;next byte
686 dnz displaytloop ;16x hl >> de
688 jr nz,displayloop ;loop 64x
690 ld hl,$396b ;Display Score
691 ld (_penCol),hl ;bottom right of screen
694 _D_HL_DECI: ;------- display 5-digit value -------
695 ld de,savestr+4 ;savenr saves number string
697 ldhld: cal UNPACK_HL ;one digit of hl
698 add a,'0' ;make number
699 ld (de),a ;save into savenr
700 dec de ;point to next digit
701 dnz ldhld ;repeat for all digits
703 ld hl,savestr ;we (the program) saved the value righthere
704 jp _vputs ;the only thing left to do is to display it
706 savestr: ;@here the score will be stored
707 .db "00000",0 ;don't worry, it's just temporary
709 ;------------------------- handle ship --------------------------------------
716 inc a ;no! next (explosion)frame
717 ld (your_occ),a ;save
719 cp 34 ;last explosion frame?
720 jp c,exploding_you ;not yet: display explosion
721 cp 40 ;delay finished?
722 jp z,You_die ;yes = game over
723 ret ;don't display anything
727 ld a,%01111110 ;get arrow keys
728 out (1),a ;it's cold outside
729 ld hl,y ;instead of nop\nop do something usefull
730 in a,(1) ;come back in
733 xor %11111111 ;inverted a = 0 if arrow-key has been pressed
734 ld a,(your_multiples)
735 jr z,no_adv ;if so, leave the multiples where they are
736 or %100 ;set move bit
738 no_adv: and %11111011 ;reset move bit
740 adv_ok: ld (your_multiples),a
742 ld a,(timer) ;framecounter
743 and %1 ;switches 0<>1 each frame
744 inc a ;a = 1 or 2 (1.5 avg)
745 ld c,a ;c = your_speed
748 rra ;rotate right (put last bit in c)
749 ld b,a ;we need a later
754 cp 50 ;56-6 = bottom of screen
759 rr b ;because we now use b, it's rr instead of rra
762 sub c ;<dec a> doesn't affect c-flag
763 jr c,no_left ;-1 = left side
770 cp 122 ;128-6 = right side
779 sub c ;<dec a> doesn't affect carry-flag
780 jr c,no_up ;-1 = top of screen
781 ld (hl),a ;save new y
783 no_up: ld e,(hl) ;e=y
784 ld ix,spr_ship01 ;normal ship sprite
785 ld hl,your_inv ;invulnerable?
786 ld a,(hl) ;load time in a
788 jr z,disp_ship ;yes so ship = normal (display \ continue)
790 ld a,(timer) ;load frame nr.
791 and %00000111 ;a=0 once every four frames
792 jr nz,not_time ;a<>0 = not time to update counter
793 dec (hl) ;decrease inv-time left
795 and %00000100 ;a switches 0<->1 every 2 frames
796 jr z,disp_ship ;show normal ship
798 ld ix,spr_ship01i ;display invulnerable ship
800 psh de ;save your position for multiples
801 cal putsprite ;display your ship
807 ld a,(your_multiples) ;do you have multiples
808 ld b,a ;save a for 2nd check
809 and %11 ;no? (last two bits = nr of multiples)
810 ret z ;then don't handle them either
812 ld a,b ;restore a (your_multiples)
813 and %100 ;move the multiples??? (=move bit set?)
814 jr z,mult_adv ;nope, just let them (saves (y)in y, (x)in x)
816 ld hl,your_locpos ;location to save this position
818 inc a ;a=a+1 (next position)
819 and %00001111 ;if a>15 then a=a-16
820 ld (hl),a ;save new a
825 ld hl,your_prevpos ;previous positions
826 add hl,bc ;16 turns ago
830 ld (mx),bc ;save multiple position in (mx)
831 ld (hl),d ;save current pos. for 16 turns into the future
840 ld ix,spr_multiple ;sprite of the multiple
841 jp putsprite ;display it + <ret>
846 srl a ;half the framerate
847 dec a ;first frame is 1>inc>srl>dec = 0
850 explosion_stuff: ;in:a=frame*2+(0 to 1); (hl)=xpos--
856 ld ix,spr_explosion ;base sprite
857 add ix,bc ;go to correct sprite (each spr. is 8 bytes)
862 jp putsprite ;and display it too
866 damage_you: ;damages you B points
867 ld a,(your_inv) ;invulnerability left?
869 ret nz ;return if inv>0
870 ld hl,your_armor ;armor left
871 ld a,(hl) ;load hp in A
872 sub b ;decrease hp by B
873 jp m,no_armor ;<0hp left so explode
874 ld (hl),a ;no, so save decreased hp
875 jp disp_armor ;and display new value
877 ld a,%01 ;occ %xxxxxx01 = explode
878 ld (your_occ),a ;too bad, you're dead meat
881 ;------------------------- place multiples ----------------------------------
884 ld (mx),de ;set last multiple-position
885 ld hl,your_prevpos ;place all previous positions
886 ld b,16 ;all 16 of them
888 ld (hl),d ;set prev-x to d
890 ld (hl),e ;set prev-y to e
892 dnz place_multiples ;repeat
895 ;------------------------- select upgrade -----------------------------------
898 ld hl,your_pickup ;select pickups
899 ld a,(hl) ;load pickups taken so far
901 ret m ;return if it's 0 (no pickups)
902 jr nz,select2 ;no, carry on
904 ld a,(your_armor) ;load current armor
905 cp 25-6 ;may not become >=25
906 jr c,select1_ ;ok then just add 6
907 ld a,25-6 ;set to maximum (6 will be added below)
909 add a,6 ;add 6 to armor
910 ld (your_armor),a ;change armor
912 ld (your_pickup),a ;reset pickups
913 jp disp_icons ;display and return
916 jr nz,select3 ;no, carry on
917 ld (hl),a ;reset pickups
919 ld (torp_occ),a ;ready torpedoes
920 jp disp_icons ;display 'n return
923 jr nz,select4 ;no, carry on
924 ld (hl),a ;reset pickups
929 jp nc,disp_icons ;weapon maxed out
930 ld (hl),a ;set new weapon
931 cal loadweapon ;load it (damage and stuff)
932 jp disp_icons ;display n return
935 jr nz,select5 ;no, carry on again
936 ld (hl),a ;reset pickups
938 ld (your_weapon),a ;ready laser
939 jp disp_icons ;display + return
942 jr nz,select6 ;no, carry on once more
943 ld (hl),a ;reset pickups
945 ld (your_multiples),a
948 jp disp_icons ;display, return
950 ld (hl),0 ;reset pickups
951 jp disp_icons ;display/return
953 ;------------------------- fire bullet --------------------------------------
957 ld a,(hl) ;just_fired
958 cp 5 ;already pressed?
959 ret z ;return when already pressed (=5)
961 inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
962 ld a,(your_weapon) ;if you have bullets.....
965 ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
968 ld hl,(x) ;yes: first fire from ship position (x)
969 ld a,(your_multiples) ;any multiples?
971 jr z,fireany ;then just fire somethin'
972 cal fireany ;and blast
973 ld hl,(mx) ;then, fire from multiple position (mx)
974 dec h ;one up (-2 height: keeps weapons centered)
975 ;blast again and <ret>
977 ld (firex),hl ;set position to fire from
980 ld a,(your_weapon) ;do you have laser?
981 ld ix,weapondata-6-(256*3)
986 ld b,3 ;go to current weapon (bc=a)
991 ld a,(ix) ;load this weapon
992 cp %11110000 ;%11110000=laser
993 cal z,fire_laser ;fire laser (will set a=0 when done)
998 pop bc ;weapon counter (do 3 weapons)
1002 ;-----fire LASER-----
1005 ld b,0 ;overflow counter
1007 ld d,(hl) ;d = your x-pos
1010 ld a,(hl) ;base y-coord (firey)
1011 add a,(ix+1) ;at specified offset (most likely the middle)
1012 ld e,a ;save laser-y in e
1013 psh de ;save unmodified (x,y)
1017 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1018 add a,a ;y*16 (width of screen)
1019 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1020 inc a ;8 pixels to right (a=even so no overflow)
1025 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1027 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1028 inc b ;a>255 so increase bc by 256
1029 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1030 ld hl,GRAPH_MEM ;save-location
1031 add hl,bc ;bc = Y*16+X/8: hl=screen address
1032 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
1033 sub d ;minus x-start (d=X/8)
1037 inc hl ;Go to next byte
1040 pop de ;de=(firex): x-pos unmodified
1042 check_laserhits: ;de = (x,y)
1043 ld b,nrenemies ;check all enemies
1044 ld hl,enemies+1 ;enemy#1+occ/hp00
1045 laserhits: ;hits with normal enemies
1048 and %00000010 ;normal/moving occ.=%1x
1049 jr z,nolashit ;no hit when enemy_occ <> 2/3
1052 or a ;enemy #0 = pickup
1053 jr z,nolashit ;yes: don't destroy
1057 jp m,nolashit ;no hit when enemy is left of you
1061 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1062 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1063 add a,5 ;add enemy height&&&
1064 jp m,nolashit ;a-e>0 = hit
1066 ld a,(curweapdamage) ;damage
1067 cal enemy_hit ;hl=enemy+y
1072 add hl,bc ;go to next enemy
1074 dnz laserhits ;check all enemies
1075 xor a ;a=0 otherwise weird things might happen :P
1076 ld (weapincs),a ;reset damage
1083 ld hl,torp_occ ;torpedo...
1084 ld a,(hl) ;load torpInfo
1085 dec a ;do you have (unused) torpedoes?
1086 ret nz ;nope (a must be 1)
1087 ld (hl),2 ;yes; use torpedo
1088 ld (torp_pos),de ;save torpedo position (in de)
1091 ;-----fire BULLETs-----
1094 ld c,a ;save bulletType in c
1095 ld hl,ybullets ;check for unused bullet
1101 jr z,found_ybullet ;0 = no bullet here
1103 dnz find_ybullet ;look next bullet
1104 pop hl ;don't try to fire any other bullets
1108 ld (hl),c ;use the bullet and set correct bullet-type
1110 ld (hl),1 ;set bullet damage
1112 ld a,(firex) ;your x-pos
1113 add a,5 ;place bullet in front of you
1114 inc hl ;go to bullet-x
1117 ld a,(firey) ;your y-pos
1118 add a,(ix+1) ;place bullet at the middle of your ship
1119 inc hl ;go to bullet-y
1123 ld (weapincs),a ;reset damage
1126 ;------------------------ handle bullets ------------------------------------
1132 cp (hl) ;off screen? (x>128-5)
1135 add a,b ;move b to the right
1136 ld (hl),a ;save new pos.
1175 pop hl ;cal bullet_left
1177 ld (hl),0 ;dump this bullet!
1178 jr next_ybullet+1 ;+1:skip pop hl at next_ybullet
1184 psh bc ;bullet counter
1185 psh hl ;save enemy+type
1186 ld (temp1),hl ;needed for check_bullethits
1187 ld a,(hl) ;@bulletType
1192 jp z,next_ybullet ;bulletType=0 >> no bullet
1197 cal bullet_left ;move bullet left
1200 psh de ;save de =position
1203 ld a,(hl) ;bullet damage=size
1204 ld hl,XLbullettable ;pointer to first bullet
1208 ld e,a ;->16bit (de=a)
1209 add hl,de ;point to correct bullet offset
1210 ld a,(hl) ;load bullet offset
1211 ld e,a ;convert to 16bit (d=0)
1212 ld ix,spr_bullet01 ;first sprite
1213 add ix,de ;add offset (go to correct sprite)
1214 pop de ;saved position
1216 ld a,(ix) ;bullet x-size
1217 ld (bulletxsize),a ;used at check_bullethits
1218 ld a,(ix+1) ;bullet y-size...
1219 ld (bulletysize),a ;...too
1221 psh de ;but will be altered so save again
1222 cal putsprite ;display bullet
1223 pop de ;position (used for check_bullethits)
1225 cal check_bullethits
1228 pop hl ;restore enemy+type
1232 inc hl ;skip type,dam,x,y: next enemy+type
1234 dnz scan_bullets ;next bullet (loop)
1237 ;--------------------------- check bullethits -------------------------------
1239 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1243 hit_enemies: ;Hits with normal enemies
1244 psh bc ;enemy counter
1249 jr z,nohit ;no hit when enemy_occ <> 2/3
1253 or a ;enemy #0 = pickup
1254 jr z,nohit ;yes: don't destroy
1256 cal find_sprite ;set ix to the sprite of this enemy
1260 sub d ;minus bullet x-position
1262 sub 5 ;minus bullet x-size
1266 add a,(ix) ;add enemy width
1271 sub e ;minus bullet y-position
1273 sub 3 ;substract bullet height
1275 jp p,nohit ;nope, missed it
1277 add a,(ix+1) ;add enemy height
1278 jp m,nohit ;missed after all
1280 ;---bullet hits enemy (auch-time!)---
1282 ld hl,0 ;@bulletType
1284 ld (hl),0 ;remove bullet
1286 ld a,(hl) ;set damage
1294 dnz hit_enemies ;check next enemy
1297 enemy_hit: ;*in:a=damage;hl=enemy+y
1298 add a,a ;a=damage to inflict
1299 add a,a ;first 2 bits used for occ.
1305 ld a,(hl) ;load hp00
1306 sub b ;decrease HP (if <0xx then c is set)
1307 ld (hl),a ;save (no flag-changes)
1308 dec hl ;@hp64; no change in c
1309 ld a,(hl) ;load; no c-change
1310 sbc a,0 ;if cf then decrease a
1311 ld (hl),a ;save back the new value
1312 ret nc ;if a>=0 then return, otherwise explode
1314 inc hl ;goto occ again
1315 ld (hl),%01 ;set to explode
1316 ld a,(pickuptimer) ;counts enemies destroyed
1317 dec a ;enough destroyed for a pickup?
1318 jr nz,pickupdone ;otherwise just explode
1319 ld (hl),%110 ;change it into a pickup (with 2 HP)
1320 ld a,18 ;reset enemies counter (18 hits = next)
1322 ld (pickuptimer),a ;save new enemiescounter value
1324 ld (hl),$00 ;explosionFrame 0
1326 ld hl,1 ;increase score by one
1329 ;--------------------------- handle torpedo ---------------------------------
1334 ret m ;return if occ=0/1
1336 ld hl,torp_pos ;x-position
1337 ld a,(hl) ;load in a
1339 cp 125 ;right edge reached
1340 jr nc,remove_torp ;remove if x>125
1341 ld (hl),a ;save new x
1347 cp 56 ;bottom reached
1348 jr nc,remove_torp ;remove if y>40
1349 ld (hl),a ;save new y
1354 cal putsprite ;display torpedo
1356 jp check_bullethits ;check for hits with enemies
1363 ;--------------------------- level events -----------------------------------
1366 ld hl,nextevent ;time to next event <ld a,(nextevent)
1367 dec (hl) ;decrease counter <dec a
1368 ld a,(hl) ;look at counter <ld (nextevent),a
1369 or a ;has it reached zero?
1370 ret nz ;nope: get outta here!
1372 ld a,0 ;enemy frequency (lvl)
1374 ld (nextevent),a ;set time to next event
1376 dec (hl) ;update enemy-counter
1378 ld a,(hl) ;look at counter
1379 or a ;has it reached 0?
1380 jp z,Next_level ;yes: level finished
1381 dec a ;has it reached 1?
1382 jr z,standby_event ;yes: wait until no enemies present/left
1383 dec a ;has it reached 2?
1384 jr z,place_boss ;yep: place the BigBossTM!
1385 dec a ;has it reached 3?
1386 jr nz,do_event ;nope: >3 = place an enemy
1387 inc hl ;nextevent located behind eventleft
1388 ld (hl),123 ;set delay
1389 ret ;don't place any more enemies
1393 ld (nrlvlenemies),a ;just one enemy: the BOSS
1394 ld hl,(levelp) ;the leveldata (including the boss)
1395 dec hl ;points to leveldata\boss\enemynr
1397 ld (lvlenemies),a ;set new enemy (boss)
1398 dec hl ;points to level\boss\movement
1400 ld (level_move),a ;set boss movement
1401 dec hl ;@level\boss\firefreq
1402 ld a,(hl) ;load in a
1403 ld (level_fire),a ;set firefrequency
1408 ld hl,enemies+1-enemysize
1413 or a ;0 = no enemy present
1424 ld hl,enemies+1-enemysize
1429 cp (hl) ;(hl) = 0 ??
1430 jr nz,chk_noenemy ;jump if enemy present (non-0)
1431 ex de,hl ;de=hl=usable enemy
1435 nrlvlenemies =$-1 ;=nr of enemies minus 1
1436 cal Random ;random enemy b..b+c = 0..nrenemies-1
1440 add hl,bc ;go to a random enemy
1441 ld a,(hl) ;load enemy nr of this mysterious random enemy
1442 ld hl,XLenemyinfos-4 ;enemy "0" specs (1 before enemy #1)
1445 ld c,a ;b=0; c=bc=type
1446 add hl,bc ;hl = enemy specs
1447 ld a,(hl) ;load hitpoints+occ of this enemy class
1450 inc hl ;next enemyInfo byte
1452 ld a,(hl) ;load hp64
1453 ld (de),a ;save hp64
1454 inc de ;next byte (or previous): occ again
1456 inc hl ;next enemyInfo byte
1457 inc de ;next byte of current enemy
1458 ld a,(hl) ;load enemy class (nr)
1459 ld (de),a ;save enemy type
1463 ld a,128 ;appear at right edge of screen
1464 sub (ix) ;minus the width of this enemy (not offscreen)
1465 ld (de),a ;= x-position (save)
1468 inc hl ;where to place??
1469 ld a,(hl) ;load placeInfo
1471 jr z,random_enemy ;yes: create random value <51 in a
1473 jr z,lure_enemy ;yes: create a 100% luring enemy
1475 halflure_enemy: ;yes (of course it is): pick one (50% lure)
1476 ld a,(timer) ;look at frame-number
1477 and %00000001 ;make random if odd frame nr.
1478 jr nz,random_enemy ;1st possibility: random enemy
1479 lure_enemy: ;2nd possibility: luring enemy
1480 ld a,(y) ;place at same y-pos as YOUR ship
1483 ld bc,256*51 ;range=0..51
1485 ypos_OK: ;random value successfully created
1486 ld (de),a ;save y-position
1489 ld a,1 ;movecounter = 1
1490 ld (de),a ;&&&(hl),1 better?
1494 and %00000001 ;bit meaning directfire
1495 jr nz,ffireOK ;(a=time-to-fire) = 1 frame (fires directly)
1496 ld a,(level_fire) ;set ttf to normal nr of frames
1497 ffireOK:ld (de),a ;save fire
1500 ;--------------------------- enemy fires ------------------------------------
1502 Enemy_fires: ;de = x,y
1512 jr z,found_ebullet ;0 = not used
1513 inc hl \ inc hl \ inc hl
1514 dnz find_ebullet ;look next bullet
1527 ld b,%1011 ;yourY-bulY = negative (=bullet below you)
1530 ld b,%1001 ;yourY-bulY = even more negative (going up)
1535 ld b,%1010 ;bullet going down
1537 jp m,bulletok ;even more going down
1544 ld (hl),a ;set bullet direction
1546 ld (hl),d ;set x-pos
1548 ld (hl),e ;set y-pos
1551 ;----------------------------- enemy bullets --------------------------------
1559 ld a,(hl) ;load bulletType in a
1560 and %1111 ;select direction-bits
1561 jr nz,enemy_bullet ;non-0: handle bullet
1563 pop hl ;do not move the <pop hl>
1565 inc hl \ inc hl \ inc hl
1570 ld b,a ;save type&%1111
1572 ld a,(hl) ;check if it has reached the left side of scrn
1573 and %11111110 ;it is <2 (0 or 1)?
1574 jr z,remove_ebullet ;yes, remove bullet
1575 dec (hl) ;move one left
1576 dec (hl) ;and another one
1580 ld a,b ;restore type
1581 cp %1100 ;is it a normal bullet? (cp = faster than bit)
1582 jr z,ebullet_common ;type %1100: normal bullet
1583 and %111 ;isolate important bits
1584 jr z,ebullet_down ;type %1000: moving down
1586 jr z,ebullet_up ;type %1001: moving up
1595 jr z,ebullet_down ;type %1010: moving down 50%
1596 ;type %1011: moving up 50%
1613 ld ix,spr_bullete1 ;display enemy bullet
1619 jr nz,next_bullet ;0 = you're normal
1639 pop hl ;points to bullettype again
1640 psh hl ;and save it again (ivm call to damage_you)
1641 ld a,(hl) ;load bullettype
1642 cal _shracc ;isolate damage-bits (%1111???? -> %00001111)
1643 ld b,a ;set damage-amount
1644 cal damage_you ;HIT!!
1646 pop hl ;hl could be destroyed by damage_you
1647 ld (hl),0 ;bullet > unused
1648 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
1650 ;--------------------------- handle enemies ---------------------------------
1654 ld b,nrenemies ;handle all enemies
1662 jr z,next_enemy ;occ "no enemy" 0
1664 jr z,exploding_enemy ;occ "exploding" 1
1665 ld b,a ;b=2 if moving, otherwise b=1
1667 normal_enemy: ;occ "normal" 2 or "moving" 3
1669 ld c,(hl) ;c = enemy type = de
1675 jr c,remove_enemy ;off screen
1676 jr z,remove_enemy ;"
1681 ld a,b ;moving state was stored in b earlier
1683 cal nz,moving_enemy ;2 = moving enemy
1687 ld (hl),d ;store new x
1688 ld a,c ;a = enemy type
1689 or a ;type 0? (pickup)
1690 jr nz,check_enemyfire ;no, a normal enemy; let em fire
1691 ld a,(timer) ;load time
1692 and %1 ;move left once every 2 turns
1693 jr z,firing_done ;don't move now
1694 inc d ;increase x-position (don't move this turn)
1695 inc (hl) ;and save it
1696 jr firing_done ;continue
1700 inc hl ;go to <move>
1701 inc hl ;go to <fire>
1702 dec (hl) ;decrease counter till next blast
1703 ld a,(hl) ;&&&doesn't seem efficient to me
1704 or a ;has it reached zero?
1705 jr nz,firing_done ;finished if not
1707 ld a,(level_fire) ;re-set counter for next blast
1708 ld (hl),a ;save time to fire
1709 inc hl ;next byte = bullettype &&&
1710 psh de ;save registers for firing-use
1711 cal Enemy_fires ;fires bullet
1712 pop de ;restore (destroyed by Enemy_fires)
1714 cal putwidesprite ;display sprite @ix
1726 ld (hl),$0000 ;bye bye enemy
1727 jr next_enemy+1 ;continue AFTER pop hl (already done)
1733 jr z,remove_enemy ;remove when at last frame
1735 ld (hl),a ;next frame
1736 cal explosion_stuff ;display explosion
1739 ;--------------------------- moving enemies ---------------------------------
1744 jr z,movetype_updown ;type 0
1746 jr z,movetype_vslow ;1
1748 jr z,movetype_fast ;2
1750 jr z,movetype_vfast ;3
1752 jr z,movetype_smart ;4
1754 jr z,movetype_lure ;5
1756 jr z,movetype_slowlure ;6
1758 jr z,movetype_stoplure ;7
1760 ; jr z,movetype_fulllure ;8
1780 jr movetype_slowlure
1799 inc hl ;hl =@ <move>
1808 or a ;reset carry flag
1809 dec hl ;reset hl to <y>
1827 pop hl ;restore stack (no ret used)
1828 jp remove_enemy ;remove this enemy (off screen)
1839 or a ;reset carry flag
1842 ld a,(hl);&&&ld a,e ;load current y-position
1845 moveup: dec a ;decrease y-pos (=move up)
1846 ret m ;don't move off the screen (y<0)
1847 dec e ;save new y-pos
1850 inc a ;increase y-pos
1851 cp 55 ;compare with bottom
1852 ret nc ;return if it has passed that line (>40)
1853 inc e ;otherwise save new position
1856 ;--------------------------- check collision --------------------------------
1859 ld hl,(x) ;e = X, d = Y
1860 ld de,$0707 ;add 7 to both d and e
1863 ld e,l ;e = X+7, d = Y+7
1866 ld b,nrenemies ;check all 20 enemies
1871 jr z,check_next ;2 or 3 = ok
1874 collide_enemy: ;&&& include in Handle_enemy proc
1878 ld a,(hl) ;check x match
1879 sub e ;enemy position minus yours minus 7
1882 add a,(ix) ;enemy width
1886 ld a,(hl) ;check y match
1887 sub d ;same as with x-check
1890 add a,(ix+1) ;enemy height
1897 ld hl,2 ;increase score by 2
1901 ld a,(hl) ;load enemy type
1903 jr nz,collide ;enemy when <>0
1906 ld hl,your_pickup ;your pickups
1911 ld a,1 ;yes: reset to pickup 1
1914 cal disp_icons ;display altered pickupicons
1917 dec hl ;to enemy occ
1918 xor a ;set to 0 = gone
1920 jr check_next ;all done, next..
1923 ld (hl),%01 ;set to explode
1925 ld (hl),0 ;explosionFrame 0
1937 ld b,collidedamage ;damage
1949 ;--------------------------- story ------------------------------------------
1969 ld hl,VIDEO_MEM ;copy text
1970 ld de,GRAPH_MEM ;to GRAPH_MEM
1971 ld bc,1024 ;entire screen
1987 cal storyPage ;do some story
1988 inc hl ;look at next hl
1989 ld a,(hl) ;load in a
1991 inc a ;set z-flag if a = $ff
1992 jr nz,dostory ;otherwise loop
1995 add hl,bc ;set hl to beginning of the level
1996 ld (levelp),hl ;set the level-pointer
1999 ;--------------------------- SFX --------------------------------------------
2001 DoSFX: ;in:a=beginLine;b=nrOfLines
2006 ld a,0 ;get line number
2008 inc a ;go to the next line
2009 ld (curline),a ;update
2016 add hl,hl ;*16 (a pixels down=a*16)
2018 ld b,h ;save hl for later
2021 ld de,VIDEO_MEM ;where to put sfx
2022 add hl,de ;go to ymin
2023 ex de,hl ;put into de again
2029 neg ;a=64-a (lines from bottom)
2031 ; ld c,a ;c=a=(curline)
2033 ; sub c ;lines from bottom
2035 SFXdisp: ;display this frame on screen
2036 ld bc,16 ;one line (=16 bytes, you'd know by now)
2037 ldir ;display (copy actually)
2038 ld bc,-16 ;go up one line (not on screen)
2039 add hl,bc ;so the same line will be displayed
2041 jr nz,SFXdisp ;repeat until whole screen is displayed
2052 ;--------------------------- show icon --------------------------------------
2055 ld (hl),a ;draw one piece of the divider-line
2056 inc hl ;move right (8 pixels = 1 byte)
2057 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
2061 psh bc \ psh de \ psh hl \ psh ix ;&&&
2063 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
2064 ld (PutWhere),hl ;place icons at bottom of normal screen
2065 ld b,16 ;draw 16x (screen width)
2066 ld a,%11111111 ;horizontal line mask
2067 cal drawline ;draw divider-line
2069 ld b,16*7 ;draw 16x (screen width) 7x (height)
2070 xor a ;blank line mask
2071 cal drawline ;clear scorebar
2075 ld ix,spr_icon01 ;armorIcon
2076 ld de,$1901 ;icon #1
2077 cal putwidesprite ;display icon
2078 cal disp_armor ;display bar
2084 ld ix,spr_icon02 ;torpedoIcon
2086 ld de,$2901 ;icon #2
2087 cal putwidesprite ;display
2090 ld a,(your_weapon) ;ur weapon
2093 ld hl,$3945 ;position to display bullet-type digit
2094 ld a,(your_weapon) ;digit
2095 dec a ;minus one (1=laser)
2096 ld (_penCol),hl ;set location
2097 add a,'0' ;make digit
2098 cal _vputmap ;display char
2099 ld ix,spr_icon03 ;bulletIcon
2101 ld de,$3901 ;icon #3
2102 cal putwidesprite ;display icon
2104 ld ix,spr_icon00 ;emptyIcon
2108 ld ix,spr_icon04 ;laserIcon
2110 ld de,$4901 ;icon #4
2113 ld ix,spr_icon00 ;emptyIcon
2114 ld a,(your_multiples)
2119 ld de,$5901 ;icon #5
2122 ld ix,spr_dividerline
2126 ld a,(your_pickup) ;pickups taken
2127 add a,a ;picks*2 (sets z-flag)
2128 jr z,iconsdone ;return if no pickups
2133 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
2134 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
2139 ld hl,GRAPH_MEM ;normal game-screen
2140 ld (PutWhere),hl ;set sprite-position to normal screen
2142 pop ix \ pop hl \ pop de \ pop bc
2146 ld hl,(57*16)+VIDEO_MEM+3
2153 ld a,(your_armor) ;load your armor
2157 srl a ;/8: don't display last 3 bits of a (later)
2158 jr z,noarmorbar ;if a=0 then it would loop 256x so skip it
2159 ld b,a ;loop b=a times
2160 armorbar: ;starting at ($39*16)+VIDEO_MEM
2161 ld (hl),%11111111 ;draw a piece of the bar
2162 inc hl ;next position
2163 dnz armorbar ;loop it b times
2167 and %111 ;display last bits of armor
2168 ret z ;if armor=0 then bit = %00000000 (don't disp)
2170 xor a ;bit = %00000000
2173 rra ;rotates A right and sets bit 7 (c-flag)
2174 dnz armorbarbit ;repeat B times (so if B=6 then a=%11111100)
2175 armorbarready: ; (an if B=3 then a=%11100000)
2176 ld (hl),a ;draw this last byte
2180 ld hl,(58*16)+VIDEO_MEM+3
2186 ld a,(weapincs) ;load bar size (0-80)
2187 srl a ;half the size (0-40)
2188 srl a ;again half that size (0-20 pixels)
2192 srl a ;/8: don't display last 3 bits of a (later)
2193 jr z,nochargebar ;if a=0 then it would loop 256x so skip it
2194 ld b,a ;loop b=a times
2195 chargebar: ;starting at ($39*16)+VIDEO_MEM
2196 ld (hl),%11111111 ;draw a piece of the bar
2197 inc hl ;next position
2198 dnz armorbar ;loop it b times
2201 and %111 ;display last bits of chargebar
2202 ret z ;if armor=0 then bit = %00000000 (don't disp)
2204 xor a ;bit = %00000000
2207 rra ;rotates A right and sets bit 7 (c-flag)
2208 dnz chargebarbit ;repeat B times (so if B=6 then a=%11111100)
2209 chargebarready: ; (an if B=3 then a=%11100000)
2210 ld (hl),a ;draw this last byte
2214 ld hl,$3A00 ;display Lives
2215 ld (_penCol),hl ;bottom left
2222 ld a,(your_lives) ;nr of lives in a
2223 add a,'0' ;make digit
2226 jp _vputs ;display on screen +ret
2228 ;--------------------------- proc -------------------------------------------
2230 Random: ;a=c<random<b+c; destr:none
2232 add a,0 ;increase last value by 0-255 (r)
2234 ld (ranseed),a ;save for next time
2236 jr nc,Random ;then add again
2240 RandomY: ;HL = random Y 0..50 right side ((1..51)*16-1)
2242 ld bc,1+50*256 ;range=1..51
2243 cal Random ;a = 1..51
2249 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2250 dec hl ;hl = 0..50 * 16 (" at right side of screen)
2252 add hl,de ;position on screen
2264 find_sprite: ;in:hl=enemy+type | out:ix=sprite to enemy
2267 ld e,(hl) ;e = enemy offset/2
2269 ld ix,spr_enemy00 ;first enemy sprite
2270 add ix,de ;add offset for current enemy
2271 add ix,de ;twice (offset stored as offset/2)
2277 ld hl,VIDEO_MEM ;screen location (top left)
2280 ld bc,1024-1 ;do it 1024 times = entire screen
2282 set 3,(iy+5) ;set white on black
2287 ld a,%10000000 ;all key-masks
2290 inc a ;cp %11111111 (no keys pressed)
2291 jr nz,releasekeys ;keep waitin
2292 cal GET_KEY ;clear buffer
2295 ;--------------------------- game over / new game / death -------------------
2297 .db 0,".<>!",0,0,0,0 ;down,L,R,up
2298 .db 0,"xtoje0",0 ;enter..clear
2299 .db " wsnid9",0 ;(-)..custom
2300 .db "zvrmhc8",0 ;dot..del
2301 .db "yuqlgb7#" ;0..xvar
2302 .db $D9,"-pkfa6'" ;on..alpha
2303 .db "54321*",0,$D0 ;F5..more
2306 ld hl,_asapvar ;find own variable
2307 rst 20h ;cal _ABS_MOV10TOOP1
2308 rst 10h ;cal _FINDSYM
2309 ret c ;not found? who cares...
2312 ld hl,4+storehi_start-_asm_exec_ram
2313 add hl,de ;hl=pointer to data in original prog
2315 cal _SET_ABS_DEST_ADDR
2318 cal _SET_ABS_SRC_ADDR
2319 ld hl,storehi_end-storehi_start
2320 cal _SET_MM_NUM_BYTES
2321 cal _mm_ldir ;save done (cal \ ret)
2325 ld hl,_asapvar ;find own variable
2326 rst 20h ;cal _ABS_MOV10TOOP1
2327 rst 10h ;cal _FINDSYM
2328 ret c ;not found? who cares...
2331 ld hl,4+storesave_start-_asm_exec_ram
2332 add hl,de ;hl=pointer to data in original prog
2334 cal _SET_ABS_DEST_ADDR
2336 ld hl,storesave_start
2337 cal _SET_ABS_SRC_ADDR
2338 ld hl,storesave_end-storesave_start
2339 cal _SET_MM_NUM_BYTES
2340 cal _mm_ldir ;save done (cal \ ret)
2343 game_over: ;stack=+0
2344 cal BLACKLCD ;clear screen
2346 ld (_curRow),hl ;center
2348 cal _puts ;display "GAME OVER"
2349 cal releasekeys ;wait for all keys to be released
2430 xor a ;clear a (Ahl will be displayed)
2431 ld hl,$1006 ;bottom-1 right
2432 ld (_curRow),hl ;set
2433 ld hl,(your_score) ;your score
2434 cal _dispahl ;display it (a=0)
2436 ld hl,$314b ;bottom-1 right before score ^^
2437 ld (_penCol),hl ;set
2438 ld hl,txt_score ;"Score"
2439 cal _vputs ;display (small)
2441 ld hl,$1007 ;bottom right
2442 ld (_curRow),hl ;set
2443 ld hl,(hiscore) ;hi-score
2444 cal _dispahl ;display
2445 ld hl,$3946 ;bottom right before hiscore ^^
2446 ld (_penCol),hl ;set
2447 ld hl,txt_hiscore ;"Hiscore"
2448 cal _vputs ;display (small)
2453 ld hl,VIDEO_MEM+(49*16)-1
2459 cal _getkey ;wait for keypress
2460 jp quit ;restore some things and return to TI-OS/shell
2462 New_game: ;stack must be +1 (so change the jp in cal :)
2464 ld (your_score),a ;reset score
2465 ld (your_score+1),a ;reset score (0)
2466 ld (torp_occ),a ;no torpedoes
2467 ld (your_weapon),a ;no laser
2468 ld (your_pickup),a ;reset pickups
2469 ld (your_multiples),a ;no multiples
2471 ld (level),a ;reset level nr (#1)
2472 ld hl,level00 ;set level pointer to level#1
2473 ld (levelp),hl ;reset level pointer
2475 ld (your_weapon),a ;default weapon
2477 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
2478 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
2480 You_die: ;stack must be +1
2481 pop hl ;restore stack
2483 ld (your_armor),a ;12 HPs/shields
2484 ld a,(your_lives) ;load lives left
2485 dec a ;decrease lives
2486 ld (your_lives),a ;if lives=0ffh GO
2487 inc a ;if -1 then zf set now
2488 jp z,game_over ;and game's over
2491 ;--------------------------- next level -------------------------------------
2493 Next_level: ;stack must be +1
2495 ld a,(your_armor) ;load current armor
2496 cp 25-8 ;may not become >=25
2497 jr c,addok ;ok then just add 8
2498 ld a,25-8 ;set to maximum (8 will be added below)
2500 add a,8 ;add 8 to armor
2501 ld (your_armor),a ;change armor
2503 ld hl,level ;level number
2510 ld h,0 ;increase score....
2511 ld l,a ;by level number * 4
2514 cal scoreInc ;update score
2516 ld hl,(levelp) ;level pointer
2517 ld c,0 ;advance one level
2519 add hl,bc ;passed the enemies
2521 add hl,bc ;update to point to next level
2522 ld (levelp),hl ;save
2526 ld (nextevent),a ;time to first enemy appearance
2528 ld hl,(levelp) ;level pointer
2533 ld a,(hl) ;number of (different) enemies in this level
2536 ld (nrlvlenemies),a ;set nr of enemies-1
2537 ld b,0 ;bc=c so we can use ldir
2538 ld de,lvlenemies ;table of enemies
2539 ldir ;load enemies to table
2540 ld a,(hl) ;load new appearance-time
2541 ld (eventtime),a ;set
2543 ld a,(hl) ;load nr of enemies in this level
2544 ld (eventleft),a ;set nr of events left
2549 ld a,(hl) ;movement of enemies in this level
2550 ld (level_move),a ;do it
2552 ld a,(hl) ;how frequent the enemies fire a bullet
2553 ld (level_fire),a ;consider it done
2568 ld (timer),a ;reset time
2569 ld hl,your_occ ;hl = your_occ
2570 ld (hl),a ;reset your ship (not exploding)
2571 inc hl ;hl = your_inv
2572 ld (hl),25 ;set 25*4=100 frames invulnerable
2574 ld (x),de ;begin position (x,y)
2575 cal Place_multiples ;place all multiple-positions at that (0,24)
2579 jr z,torpsclear ;then just continue (=0)
2580 ld a,1 ;if so, set to "ready to fire" (=1)
2583 ld hl,enemies ;remove all enemies and bullets
2584 ld (hl),0 ;clear first byte
2585 ld de,enemies+1 ;copy this to the next byte
2586 ld bc,(nrenemies*enemysize)+(nrybuls*4)+(nrebuls*3)-1
2587 ldir ;clear enemies + bullets (y/e)
2589 ;--------------------------- setup game -------------------------------------
2592 cal BLACKLCD ;white on black
2595 ld (_curRow),de ;center
2596 cal _puts ;display "LEVEL "
2598 ld a,(level) ;current level
2601 cal UNPACK_HL ;create first digit
2604 cal UNPACK_HL ;second digit
2606 cal _putc ;display second digit
2608 cal _putmap ;display first digit
2610 ld hl,txt_lives ;bar text: "Lx0"...
2612 ld (_curRow),de ;display lives left below level nr
2614 ld a,(your_lives) ;lives left
2615 add a,'0' ;make value 0='0'
2618 cal releasekeys ;wait for user to release all keys
2619 ld hl,txt_savekey ;"Press [F1] to save"
2620 ld de,$3A46 ;bottom-right
2624 res 3,(iy+5) ;set white on black
2625 cal _getkey ;wait for keypress
2629 cal _clrLCD ;clear screen
2630 cal disp_icons ;display bottom icons +ret
2634 cal RandomY ;a = random y-pos 1..bottom
2635 ld a,b ;a = b = star nr. = 1..7
2636 add a,a ;a = 2b = 2..14
2638 ld e,a ;de = a = 2-14
2640 sbc hl,de ;substract from random y => random pos anywhere
2642 ld (ix),l ;save x-pos (l)
2643 ld (ix+1),h ;save y-pos (h)
2644 inc ix \ inc ix ;next star
2645 dnz placestars ;repeat for all stars
2658 ld (weapdamage),a ;damage of bullets
2661 ld (weapdaminc),a ;damage increase
2664 ;--------------------------- putsprite --------------------------------------
2665 ;--------------------------- de =(X,Y) --------------------------------------
2668 .db $80,$40,$20,$10,8,4,2,1
2671 and %00000111 ;a = X mod 8 = bit nr. to mask
2672 ld hl,offsets_table ;pixel mask table
2675 add hl,bc ;add to table
2676 ld a,(hl) ;a = pixel mask
2677 ld (_smc1+1),a ;alter pixel mask
2679 ld hl,GRAPH_MEM ;save-location
2684 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
2685 add a,a ;y*16 (width of screen)
2686 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
2689 srl d ;d/8 (8 bits in byte) ** c is set when overflow
2690 add a,d ;a = (Y*16+X/8) mod 256
2691 jr nc,_n1 ;jump if no carry = no overflow = a<=255
2692 inc b ;a>255 so increase bc by 256
2693 _n1: ld c,a ;c = (Y*16+X/8) mod 256
2694 add hl,bc ;bc = Y*16+X/8
2698 _oloop: psh bc ;Save # of rows
2699 psh hl ;Save screen address
2701 ld c,(ix+2) ;Load one line of image
2703 _smc1: ld a,1 ;Load pixel mask
2704 _iloop: sla c ;Test leftmost pixel
2705 jr nc,_noplot ;See if a plot is needed
2706 ld e,a ;OR pixel with screen
2711 jr nc,_notedge ;Test if edge of byte reached
2712 inc hl ;Go to next byte
2715 pop hl ;Restore address
2716 ld bc,16 ;Go to next line
2718 pop bc ;Restore data
2720 ret ;<jp>s are used instead of <jr> = faster
2722 ;--------------------------- putbigsprite -----------------------------------
2755 woloop: psh bc ;Save # of rows
2756 psh hl ;Save screen address
2758 ld c,(ix+2) ;Load one line of image
2760 wsmc1: ld a,1 ;Load pixel mask
2761 wiloop: sla c ;Test leftmost pixel
2762 jr nc,wnoplot ;See if a plot is needed
2763 ld e,a ;OR pixel with screen
2769 jr nc,wnotedge ;Test if edge of byte reached
2770 inc hl ;Go to next byte
2776 pop hl ;Restore address
2777 ld bc,16 ;Go to next line
2779 pop bc ;Restore data
2794 ;----------------------------------------------------------------------------
2795 ;------------------------------- sprites ------------------------------------
2796 ;----------------------------------------------------------------------------
2799 .db 7,7 ;ship alpha class
2800 .db %01111000 ; ████
2802 .db %01111100 ; █████
2803 .db %11110010 ;████ █
2804 .db %01111100 ; █████
2806 .db %01111000 ; ████
2809 .db %01111010 ; ████ █
2810 .db %11100001 ;███ █
2811 .db %01111101 ; █████ █
2812 .db %11110011 ;████ ██
2813 .db %01111101 ; █████ █
2814 .db %11100001 ;███ █
2815 .db %01111010 ; ████ █
2818 .db 7,7 ;ship beta class
2821 .db %01111100 ; █████
2822 .db %01110010 ; ███ █
2823 .db %01111100 ; █████
2828 .db %11100010 ;███ █
2829 .db %11110001 ;████ █
2830 .db %01111101 ; █████ █
2831 .db %01110011 ; ███ ██
2832 .db %01111101 ; █████ █
2833 .db %11110001 ;████ █
2834 .db %11100010 ;███ █
2837 .db 7,7 ;ship gamma class
2838 .db %11111000 ;█████
2840 .db %11111100 ;██████
2841 .db %11100110 ;███ ██
2842 .db %11111100 ;██████
2844 .db %11111000 ;█████
2847 .db %11111010 ;█████ █
2848 .db %01100001 ; ██ █
2849 .db %11111101 ;██████ █
2850 .db %11100111 ;███ ███
2851 .db %11111101 ;██████ █
2852 .db %01100001 ; ██ █
2853 .db %11111010 ;█████ █
2856 .db 7,7 ;ship delta class
2858 .db %11110000 ; ████
2859 .db %11111100 ; ██████
2860 .db %01100010 ; ██ █
2861 .db %11111100 ; ██████
2862 .db %11110000 ; ████
2866 .db %11000010 ; ██ █
2867 .db %11110001 ; ████ █
2868 .db %11111101 ; ██████ █
2869 .db %01100011 ; ██ ██
2870 .db %11111101 ; ██████ █
2871 .db %11110001 ; ████ █
2872 .db %11000010 ; ██ █
2876 .db %01111000 ; ████
2877 .db %11001100 ; ██ ██
2879 .db %11001100 ; ██ ██
2880 .db %01111000 ; ████
2882 ;-------------------------------- explosion ---------------------------------
2888 .db %00111110 ; █████
2889 .db %01010110 ; █ █ ██
2895 .db %01001110 ; █ ▒███
2896 .db %10111110 ; █ █████
2897 .db %01001111 ; █ ▒████
2899 .db %00011010 ; ██ █
2902 .db %10110000 ; █ ██
2903 .db %01001110 ; █ ███
2904 .db %10110101 ; █ ██▒█▒█
2905 .db %01000101 ; █ ▒█▒█
2906 .db %00111110 ; █████
2907 .db %01011010 ; █ ██ █
2910 .db %00101010 ; ▒ █▒█ █
2911 .db %01000110 ; █ ▒██
2912 .db %10110101 ; █ ██ █ █
2913 .db %01100110 ; ██ ██▒
2914 .db %00111100 ; ████▒
2915 .db %01011001 ; █ ██ ▒█
2918 .db %01000000 ; █▒ ▒ ▒
2919 .db %00100101 ; ▒█ █▒█
2920 .db %00010100 ; ▒ ▒█ █ ▒
2921 .db %01000100 ; █▒ █
2922 .db %00010010 ; ▒█▒▒█
2923 .db %10011010 ; █▒ ██ █▒
2927 .db %00100000 ; ▒█ ▒ ▒
2928 .db %00000001 ; ▒ ▒ █
2930 .db %00100010 ; █▒ █
2931 .db %01001000 ; ▒█ ▒█ ▒
2934 .db %00001000 ; ▒ █▒
2935 .db %11000010 ; ██ ▒ █
2937 .db %00100000 ; ▒█ ▒
2938 .db %00000001 ; ▒ ▒█
2939 .db %00110000 ; ▒██▒
2943 .db %00000000 ; ▒▒ ▒
2947 .db %00100100 ; █▒ █
2958 ;--------------------------------- bullets ----------------------------------
2965 .db %11110000 ;▒████
2977 .db %11110000 ;▒████
2982 .db %11111000 ;▒█████
2986 .db %01110000 ; ▒███
2987 .db %11111000 ;▒█████
2988 .db %01110000 ; ▒███
2991 .db %11110000 ;▒████
2992 .db %11111000 ;▒█████
2993 .db %11110000 ;▒████
2997 .db %10111000 ;▒█▒███
2998 .db %01111000 ; ▒████
3002 .db %00111000 ; ▒███
3003 .db %01111100 ; ▒█████
3004 .db %11111100 ;▒██████
3009 .db %11111100 ;▒██████
3010 .db %00111110 ; ▒█████
3011 .db %01111100 ; ▒█████
3016 .db %11111100 ;▒██████
3017 .db %00111110 ; ▒█████
3018 .db %01111110 ; ▒██████
3019 .db %11111100 ;▒██████
3020 .db %00111000 ; ▒███
3023 .db %00111100 ; ▒████
3024 .db %11111110 ;▒███████
3025 .db %01111111 ; ▒███████
3026 .db %00011111 ; ▒█████
3027 .db %01111111 ; ▒███████
3028 .db %11111110 ;▒███████
3029 .db %00111100 ; ▒████
3033 .db %11110000 ; ████
3037 .db 4,3 ;enemy bullets
3039 .db %11110000 ;████▒
3043 .db (spr_bullet01-spr_bullet01) ;0
3044 .db (spr_bullet02-spr_bullet01) ;4
3045 .db (spr_bullet03-spr_bullet01) ;8
3046 .db (spr_bullet04-spr_bullet01) ;12
3047 .db (spr_bullet05-spr_bullet01) ;16
3048 .db (spr_bullet06-spr_bullet01) ;20
3049 .db (spr_bullet07-spr_bullet01) ;24
3050 .db (spr_bullet08-spr_bullet01) ;28
3051 .db (spr_bullet09-spr_bullet01) ;32
3052 .db (spr_bullet10-spr_bullet01) ;36
3053 .db (spr_bullet11-spr_bullet01) ;40
3054 .db (spr_bullet12-spr_bullet01) ;44
3055 .db (spr_bullet13-spr_bullet01) ;48
3056 .db (spr_bullet13-spr_bullet01) ;52
3057 .db (spr_bullet13-spr_bullet01) ;56
3058 .db (spr_bullet13-spr_bullet01) ;60
3060 ;format:[min.damage] [dam.inc] [0000:direction 0000:speed] [offset]
3061 ;damage = min.damage + dam.inc*incs (0<=incs<=6)
3064 .db 1,1,%11110000,0,%11110000,6,%00000000,0 ;LASER
3065 .db 1,1,%00000010,2,%00000000,0,%00000000,0 ;single fire
3066 .db 3,1,%00000011,2,%00000000,0,%00000000,0 ;fast single
3067 .db 1,1,%00000010,0,%00000010,5,%00000000,0 ;double
3068 .db 1,1,%00010010,2,%00110010,2,%01000010,2 ;triple
3069 .db 3,2,%00010011,2,%00110011,2,%01000011,2
3070 .db 5,3,%00010011,2,%00110011,2,%01000100,2
3071 .db 7,4,%00010100,2,%00110100,2,%01000100,2
3072 .db 12,5,%00010110,2,%00110110,2,%01000110,2
3076 ;------------------------------------ bar -----------------------------------
3079 .db 16,7 ;selected .......:.......:
3080 .db %11111111,%11111111 ; ████████████████
3081 .db %11000000,%00000001 ; ██ █
3082 .db %11000000,%00000001 ; ██ █
3083 .db %11000000,%00000001 ; ██ █
3084 .db %11000000,%00000001 ; ██ █
3085 .db %11000000,%00000001 ; ██ █
3086 .db %11111111,%11111111 ; ████████████████
3088 .db 16,7 ;unused .......:.......:
3089 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3090 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3091 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3092 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3093 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3094 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3095 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3097 .db 16,7 ;armor ; .......:.......:
3098 .db %10000111,%11110000 ; █ ███████
3099 .db %10011000,%00001100 ; █ ██ ██
3100 .db %10110011,%11000110 ; █ ██ ████ ██
3101 .db %10110000,%11110110 ; █ ██ ████ ██
3102 .db %10110011,%11000110 ; █ ██ ████ ██
3103 .db %10011000,%00001100 ; █ ██ ██
3104 .db %10000111,%11110000 ; █ ███████
3106 .db 16,7 ;torpedo .......:.......:
3107 .db %10111000,%00010101 ; █ ███ █ █ █
3108 .db %10011100,%00010101 ; █ ███ █ █ █
3109 .db %10111000,%01001010 ; █ ███ █ █ █
3110 .db %10000000,%11101010 ; █ ███ █ █
3111 .db %11100001,%11100101 ; ███ ████ █ █
3112 .db %10011000,%11110101 ; █ ██ ████ █ █
3113 .db %11100110,%00110010 ; ███ ██ ██ █
3115 .db 16,7 ;bullets .......:.......:
3116 .db %10000000,%11000000 ; █ ██
3117 .db %10000011,%11100000 ; █ █████ ▒▒▒
3118 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3119 .db %11111100,%00000000 ; ██████ ▒▒▒
3120 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3121 .db %10000011,%11100000 ; █ █████ ▒▒▒
3122 .db %10000000,%11000000 ; █ ██
3124 .db 16,7 ;laser .......:.......:
3125 .db %10000000,%00000000 ; █
3126 .db %10110010,%10000000 ; █ ██ █ █
3127 .db %10111011,%00000000 ; █ ███ ██
3128 .db %10011101,%11111111 ; █ ███ █████████
3129 .db %10111011,%00000000 ; █ ███ ██
3130 .db %10110010,%10000000 ; █ ██ █ █
3131 .db %10000000,%00000000 ; █
3133 .db 16,7 ;multiple .......:.......:
3134 .db %10000011,%10000000 ; █ ███
3135 .db %10000001,%11100110 ; █ ████ ██
3136 .db %10000001,%11100000 ; █ ████
3137 .db %10000011,%10000000 ; █ ███
3138 .db %10011000,%00000000 ; █ ██
3139 .db %10111100,%11000011 ; █ ████ ██ ██
3140 .db %10011000,%00000000 ; █ ██
3143 .db 128,128,128,128,128,128,128 ;128 = %10000000
3145 ;---------------------------- texts -----------------------------------------
3147 txt_email: .db "www.shiar.org ",127 ;title screen
3148 .db " shiar0@hotmail.com",0
3149 _txt_email = $3A01 ;$3A1E=just email
3150 txt_about: .db " v0.97.625 ",127," by Shiar",0 ;right behind txt_email
3152 txt_menu1: .db "NEW GAME",0
3153 txt_menu2: .db "CONTINUE",0
3155 txt_level: .db "LEVEL ",0 ;new level screen
3156 txt_lives: .db "Lx0",0
3157 txt_savekey: .db "Press [F1] to save",0
3159 txt_gameover: .db "GAME OVER!",0 ;game over screen
3160 txt_score: .db "Score",0
3161 txt_hiscore: .db "Hiscore",0
3163 txt_pressenter: .db "Enter to continue",0 ;pause
3164 txt_teacher: .db "(2",Lpi,"*.95)/sin 13",0 ;boss
3165 txt_teacherans: .db Lneg,"14.2063168184",0
3167 ;---------------------------- save data -------------------------------------
3169 PutWhere .dw GRAPH_MEM ;where to put the wide sprites
3174 hiname .db "Shiar.97",0
3178 level .db $01 ;level number
3179 levelp .dw level01 ;pointer to level data
3180 pickuptimer .db $04 ;counts when to place a pickup
3181 your_score .dw $0000
3184 your_occ .db $00 ;0=normal 1..16=exploding
3185 your_inv .db $00 ;invincibility left
3186 your_armor .db $0a ;HP left
3187 your_lives .db $03 ;
3189 your_weapon .db $02 ;weapon: 0=no, 1=laser, 2+=bullet n+1
3190 your_multiples .db $00 ;multiples present
3191 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
3192 torp_pos .dw $0000 ;torpedo position (x,y)
3196 ;XLlevelsdata:---------------------------------------------------------------
3200 .db $21,$1d,"Cosmic year 6716" ,0,0,$1d,$06
3201 .db $1b,$1d,"storyline coming soon..." ,0,0,$1d,$06
3202 .db $09,$19,"the Nemesis saga continues",0,1
3203 .db $2e,$21,"with NEMESIS 86" ,0,1
3204 .db $52,$36,"by Shiar" ,0,0,$19,$23
3207 ;format:[nr.dif.enemies]x [enemy nr]
3208 ; [enemy frequency] [next lvl]
3209 ; [level_info: 0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
3210 ; [level_move] [level_fire] [tunnel size] [groundtype]
3211 ; [16_ground] [16_ceiling] [stars1] [stars2]
3213 .db $15,$07,$08 ;fireFreq; moveType; enemyType
3214 level01: ;efrequency must be odd if halfluring!
3216 .db $1b,$2f,%00010001
3219 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3220 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3226 .db $01,01,"And the storyline conti",
3228 .db $01,09,"You decide to fly close",
3230 .db $01,15,"surface of a nearby pl",
3231 .db "anet =)",0,0,1,20
3237 .db $13,$4b,%00100101,0,064,0,0
3238 .db 1,2,3,4,5,6,6,5,4,3,4,5,4,3,2,1
3239 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3243 .db $01,01,"Blablabla...",0,1
3244 .db $01,34,"this storyline sux",0,0,1,39
3250 .db $2d,$3f,%00010110,0,255,-9,1
3251 .db 3,2,4,3,2,2,1,1,1,1 ,1,1,21,17,18,20
3252 .db 1,1,1,1,1,1,1,3,6,12,9,1,21,19,18,18
3253 .db -1,-1 ;=%11111111=line
3258 .db $11,$41,%00100001,0,057,0,0
3259 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3260 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3265 .db $11,$45,%00100101,%10,031,-7,1
3266 .db 14,12,11,9,10,7,7,5,4,3,4,4,2,3,1,2
3267 .db 1, 1, 1, 1,1, 1,1,1,1,1,1,1,1,1,1,1
3272 .db $19,$3a,%00100111,0,255,-4,1
3273 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3274 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3280 .db $09,$ff,%00100001,0,043,0,0
3281 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3282 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3285 ;------------------------------ enemies -------------------------------------
3292 .db %11111111 ; ████████
3293 .db %11111111 ; ████████
3299 .db 6,6 ;enemy type one
3300 .db %00111100 ; ████
3302 .db %11110000 ; ████
3303 .db %11110000 ; ████
3305 .db %00111100 ; ████
3307 .db 8,6 ;enemy type two
3308 .db %00111111 ; █████
3309 .db %01111000 ; ████
3310 .db %11111100 ; ██████
3311 .db %11111100 ; ██████
3312 .db %01111000 ; ████
3313 .db %00111111 ; █████
3315 .db 6,6 ;enemy type three
3316 .db %01111100 ; █████
3317 .db %11110000 ; ████
3318 .db %11111000 ; █████
3319 .db %11111000 ; █████
3320 .db %11110000 ; ████
3321 .db %01111100 ; █████
3323 .db 6,6 ;enemy type four
3325 .db %01111100 ; █████
3326 .db %11111000 ; █████
3327 .db %11111000 ; █████
3328 .db %01111100 ; █████
3331 .db 7,6 ;enemy type five
3332 .db %00011110 ; ████
3333 .db %01111110 ; ██████
3334 .db %11111100 ; ██████
3335 .db %11111100 ; ██████
3336 .db %01111110 ; ██████
3337 .db %00011110 ; ████
3339 .db 7,6 ;enemy type six
3341 .db %01111110 ; ██████
3342 .db %10111000 ; █ ███
3343 .db %10111000 ; █ ███
3344 .db %01111110 ; ██████
3347 .db 8,6 ;enemy type seven
3348 .db %00011110 ; ████
3349 .db %01111111 ; ███████
3350 .db %10011100 ; █ ███
3351 .db %10011100 ; █ ███
3352 .db %01111111 ; ███████
3353 .db %00011110 ; ████
3355 .db 8,6 ;enemy type seven
3356 .db %00011110 ; ████
3357 .db %01111111 ; ███████
3358 .db %10011100 ; █ ███
3359 .db %10011100 ; █ ███
3360 .db %01111111 ; ███████
3361 .db %00011110 ; ████
3364 .db 16,10 ;boss type one
3365 .db %00000001,%11111111 ; █████████
3366 .db %00001111,%11111110 ; ███████████
3367 .db %00111111,%11110000 ; ██████████
3368 .db %01011111,%10000000 ; █ ██████
3369 .db %10011111,%01000000 ; █ █████ █
3370 .db %10011111,%01000000 ; █ █████ █
3371 .db %01011111,%10000000 ; █ ██████
3372 .db %00111111,%11110000 ; ██████████
3373 .db %00001111,%11111110 ; ███████████
3374 .db %00000001,%11111111 ; █████████
3376 .db 16,10 ;boss type:one :
3377 .db %11111110,%00000000 ; ███████
3378 .db %00001111,%10001111 ; █████ ████
3379 .db %00111111,%11100011 ; █████████ ██
3380 .db %01001111,%11111110 ; █ ███████████
3381 .db %10001101,%01111100 ; █ ██ █ █████
3382 .db %10001101,%01111100 ; █ ██ █ █████
3383 .db %01001111,%11111110 ; █ ███████████
3384 .db %00111111,%11100011 ; █████████ ██
3385 .db %00001111,%10001111 ; █████ ████
3386 .db %11111110,%00000000 ; ███████
3388 ;format: [000000:HP 00:occ] [HP64] [appearance(ypos)] [unused]
3390 .db %00100110,0,(spr_enemy01-spr_enemy00)/2,1 ;#1
3391 .db %00101010,0,(spr_enemy02-spr_enemy00)/2,3 ;#2
3392 .db %00001111,0,(spr_enemy03-spr_enemy00)/2,2 ;#3
3394 .db %00000110,0,(spr_enemy04-spr_enemy00)/2,2 ;#4
3395 .db %00000111,0,(spr_enemy05-spr_enemy00)/2,3 ;#5
3396 .db %00001011,0,(spr_enemy06-spr_enemy00)/2,2 ;#6
3398 .db %00011011,0,(spr_enemy07-spr_enemy00)/2,3 ;#7
3400 .db %00110011,1,(spr_boss0_1-spr_enemy00)/2,1 ;boss1
3401 .db %01001011,1,(spr_boss0_2-spr_enemy00)/2,3 ;boss2
3411 ;----------------------------------------------------------------------------
3412 ;----------------------------- logo ------------------------------------------
3413 ;----------------------------------------------------------------------------
3416 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
3417 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
3418 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
3419 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
3420 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
3421 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
3422 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
3423 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3424 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3425 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3426 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3427 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3428 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3429 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3430 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3431 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
3432 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
3433 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
3434 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
3436 ;----------------------------- end ------------------------------------------
3442 ;----------------------------------------------------------------------------
3443 ;----------------------------------------------------------------------------
3444 ;----------------------------------------------------------------------------
3446 ; 0.97.625 -- 25.VI.00 -- size 5753
3448 ; # bullets do damage in all levels
3449 ; * more armor at armor-upgrade and extra armor at end of a level
3450 ; - internal levels again (no need 4 external, safer/smaller)
3451 ; # some registers not correctly pushed/popped
3452 ; * several optimizations (init.procs some bytes smaller)
3453 ; # enemies hit with hitpoints left disappeared (one pop too much...)
3454 ; + bullets "charge up" (more damage) when not firing
3455 ; + more powerful bullets have different sprites (larger=more damage)
3456 ; # multiples appear at your position (begin level/just selected)
3457 ; # when invulnerable multiples acted weird
3458 ; # no more error at activation after APD off after running Nemesis
3459 ; # saves correctly if own name ain't "nemesis" + some bytes smaller
3460 ; # screen wasn't always entirely cleared after quit
3461 ; * waits until all keys have been released after death
3462 ; + different bullets sizes will miss if they're too small
3463 ; + at level start "press F1 to save"-text will be displayed
3464 ; * w3.shiar.org displayed at title screen, black bar behind version nr
3465 ; # score to 0 when exit pressed at main menu
3466 ; # no residual story-text in first frame of game
3467 ; # game doesn't continue again after death (stack messed up)
3468 ; # game over when lives<0 (didn't work in v0.96+)
3469 ; * using some self-modifiing code (so it's smaller)
3470 ; # new random procedure: stars don't appear on one line anymore
3471 ; * weapons appear centered at multiples
3472 ; * laser properties can be changed (damage, charge)
3473 ; + weapon can be combination of bullets/lasers (max. of 3 per weapon)
3474 ; * bullet-icon is removed when laser is selected
3475 ; * enemy sprite table integrated in enemy specs (-1 byte/enemy)
3478 ; + added - removed * changed # bug fixed