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 ;=
61 spacespace = storepos+19 ;+19
62 groundinfo = spacespace+1 ;+20
63 groundpos = groundinfo+1 ;+21 $10
64 ceilingpos = groundpos+16 ;+37 $10
66 stars1 = ceilingpos+16 ;+53
67 stars2 = stars1+1 ;+54
69 starx1 = storepos+55 ;+55
71 starx2 = starx1+(nrstars1*2) ;+69
73 mx = starx2+(nrstars2*2) ;+83 ;position of multiple#1
74 my = mx+1 ;+84 ;multiple y-pos
77 your_locpos = m2y+1 ;+87 ;position in your_prevpos tabl
78 your_prevpos = your_locpos+1 ;+88 ;save previous positions (32d)
80 ;^-----------------------------------<1 ;-120=$78
82 enemies = storepos2 ; +0 ;info about each enemy
83 enemysize = 8 ;infobytes per enemy
84 nrenemies = 16 ;max. nr of enemies
86 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,damg,x,y)
88 ebullets = ybullets+(nrybuls*4) ;+110 ;30 bytes = 10(state,x,y)
90 lvlenemies = ebullets+(nrebuls*3)
92 ;^-----------------------------------<2 ;-141=$8D
94 ; [0000:damage 0:diagfire 0:ground 0:ceiling 0:-]
96 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 10=normal 11=moving)]
97 ; [ship type or explosion frame] [x] [y] [movecounter] [firecounter] [firefreq]
99 ;---------------------- introduction ----------------------------------------
101 nop ;hello yas/ase/rascall/whathever
102 jp init ;here's the program, but first: a description
103 .dw $0001 ;description type 2 (description + YASicon)
104 .dw Title ;pointer to description (all shells)
105 .dw Icon ;pointer to YAS icon
107 Title: .db "Nemesis v0.97 by SHIAR",0
109 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 9bytes
112 .db %00111110 ; █████
113 .db %01111001 ; ████ █
114 .db %00111110 ; █████
116 .db %11100000 ; ███ ;recommend 80x50 screen mode
117 .DB 0 ;clear stupid YAS-line
119 ;---------------------- init ------------------------------------------------
131 init: cal BUSY_OFF ;turns the run-indicator off, obviously
132 cal _clrScrn ;clean the screen
134 res 2,(iy+13) ;don't scroll the screen
135 cal _flushallmenus ;remove TI menus
137 FixKeys: ;fixes some key problems like left+down bug
151 ld bc,int_end-int_handler
157 ;---------------------- main menu -------------------------------------------
160 xor a ;white bitmask (a=0)
161 ld hl,logo_nemesis ;from...
162 ld de,VIDEO_MEM+16 ;...to one line from top
163 ld b,e ;ld b,16: one line
165 ld (de),a ;clear/n byte
167 dnz AboveLogo ;repeat for the first line
168 ld bc,16*19 ;logo size
169 ldir ;display one line of logo
171 ld hl,16*$33+VIDEO_MEM ;$33 rows down
172 ld b,16*7 ;draw black 7 lines
173 ld a,%11111111 ;horizontal line mask
175 ld (hl),a ;draw one piece of the divider-line
176 inc hl ;move right (8 pixels = 1 byte)
177 dnz underline ;repeat
179 ld hl,_txt_email ;at the very bottom of tha screen
181 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
182 cal _vputs ;VERY important, so display in small font ?:}
184 set 3,(iy+5) ;set white on black
185 ld de,_txt_about ;near the bottom of the screen
186 ld (_penCol),de ;hl=txt_email++=txt_about
187 cal _vputs ;display version + me
188 res 3,(iy+5) ;return to default black on white
225 cal GET_KEY ;wait for keypress
243 jp samelevel ;game_main_loop
263 ;----------------------------------------------------------------------------
264 ;---------------------- game loop -------------------------------------------
265 ;----------------------------------------------------------------------------
267 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
268 ld hl,timer ;update time
269 inc (hl) ;increase by 1
270 jr nz,Clear_screen ;continue when new time <> 0
271 ld hl,1 ;once every 256 frames, increase score by 1
275 ld hl,GRAPH_MEM ;move from (hl) = top left
276 ld (hl),$00 ;first pixel will be copied all over the screen
277 ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
278 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
281 ld a,0 ;current frame/turn 0-255
283 and %11 ;a=0 once every 4 turns
284 jr z,movestarsdone ;don't move stars once every 4 frames
285 cal movestars1 ;move the stars on the FRONT layer
286 cal movestars2 ;move the distant stars
288 ld a,(stars1) ;star positions (the missing byte...)
289 ld b,nrstars1 ;how many stars? now we know.
290 ld hl,starx1 ;points to the position of the stars
291 cal DisplayStars ;display front layer stars
292 ld a,(stars2) ;weren't you paying attention five lines ago?
293 ld b,nrstars2 ;that many?! whow!
294 ld hl,starx2 ;and there they are
295 cal DisplayStars ;use the same procedure to display back layer
297 ld a,(level_info) ;level info
298 and %00000110 ;isolate ground&ceiling
299 jr z,game_stuff ;both non-present
300 and %00000010 ;bit representing the presence of any ceiling
301 cal nz,Handle_ceiling ;scroll the ceiling (if any) +check4collision
302 cal Handle_ground ;scroll the ground and check if we're dead
305 cal Handle_Ship ;move you
306 ld a,(your_occ) ;are you 100% OK?
308 jr nz,_gamestuff1 ;then don't check for movements/fires/...
311 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
312 out (1),a ;ask for them
313 nop \ nop ;delay 8 clocks
317 bit 6,a ;test bit 6 = exit-key = EXIT
318 jp z,game_over ;<exit> pressed, so be it
319 check_morekey: ;another unused label... poor compiler
320 bit 7,a ;test bit 7 = more-key = PAUSE
321 cal z,Pause ;yes, go to pause
324 bit 5,a ;test bit 5 = 2nd-key = FIRE
325 ld hl,check_selkey ;where to continue after executing Fire_bullet
326 psh hl ;push hl on stack (instead of cal Fire_bullet)
327 jp z,Fire_bullet ;fire smtn (bulletstorplasermultiples+stuff..)
328 pop hl ;no cal to Fire_bullet made, so pop stack
330 ld (just_fired),a ;reset just_fired
333 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
335 nop \ nop ;what's taking you so long
336 in a,(1) ;at last... our precious keyzzz...
338 bit 6,a ;'bout the GRAPH key...
339 cal z,Teacher ;you didn't _press_ it, did you?!?
341 rla ;test bit7 so we know f ALPHA has been pressed
342 cal nc,select ;yeppy, select the currently selected upgrade
344 cal Enemies_hit ;check for collision with enemies
348 cal Handle_enemies ;move enemies
350 cal Handle_bullets ;move your bullets + check for hits
351 cal Enemy_bullets ;move enemy bullets
352 cal Handle_torp ;the same for your torpedo (assuming u have 1)
354 cal Level_event ;insert enemies
355 cal Display_Screen ;display all
358 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
364 cp 97 ;max. 96 times (=96/16=6 increases)
365 ret nc ;return if already maxed
366 ld (weapincs),a ;save new incs
368 and %11110000 ;clear last 4 bits so no cf when rotating
370 rra ;rotate acting as shift (srl a) but just 1B
373 rra ;increase once just every 16 turns
374 ld b,a ;times to increase
376 add a,1 ;increase damage for one increase
378 dnz incthedamage ;a=total increase damage
379 ld b,1 ;minimal damage
381 add a,b ;a=total damage
382 ld (curweapdamage),a ;safe the current damage
386 ;--------------------------- ground -----------------------------------------
390 and %111 ;once every 8 frames
391 jr nz,Display_ground ;otherwise skip the scroll
392 ld bc,15 ;scroll all 16 bytes minus one (teh new byte)
393 ld hl,groundpos+1 ;from..
394 ld de,groundpos ;to (one byte to the left)
395 ldir ;LoaDIncreaseRepeat = scroll!
397 ld a,(groundinfo) ;what kind of ground
399 jr z,ground_tunnel ;tunnel effect
401 ld a,(groundpos) ;type 0
408 ld bc,$201 ;range=1..3
411 jr z,newground ;same if a=1
413 jr z,gtunneldown ;down if a=2
414 gtunnelup: ;up if a=3
417 jr z,newground ;a>=0 (a=0 actually)
429 ld (groundpos+15),a ;save new byte on the right
432 ld b,16 ;screen width
433 ld de,groundpos-1 ;height of current byte (previous actually)
435 ld hl,GRAPH_MEM+(56*16)-1 ;screen position
439 ld c,b ;push b for groundloopup
440 pop hl \ inc hl ;get screen position and go one right
441 pop de \ inc de ;get height info and set to the next byte
442 psh de \ psh hl ;save these for the next time
443 ld a,(de) ;height of current byte
446 ld de,16 ;to substract to go one line up
447 ld a,%11111111 ;bitmask black
450 ld (hl),a ;display black byte
451 sbc hl,de ;go up (sbc must be used for 16-bit sub)
452 dnz groundloopup ;and loop >groundpos< times
454 ld b,c ;pop b used by groundloopup
455 dnz groundloopright ;loop right for entire screen (16x)
456 pop hl \ pop hl ;restore stack
458 CheckGround: ;check for collision with the ground
476 ;--------------------------- ceiling ----------------------------------------
480 and %111 ;once every 8 frames
481 jr nz,Display_ceiling ;otherwise skip the scroll
482 ld bc,15 ;scroll all 15 bytes (16th is new position)
483 ld hl,ceilingpos+1 ;from..
484 ld de,ceilingpos ;to (one byte to the left)
485 ldir ;LoaDIncreaseRepeat = scroll!
487 ld a,(groundinfo) ;what kind of ceiling
489 jr z,ceiling_tunnel ;tunnel effect
494 ld d,a ;d=new ceiling
497 ld bc,$201 ;range=1..3
500 jr z,newceiling ;1:same
505 or a ;(spacespace)=0:
506 jr z,newceiling+2 ;keep same ceiling
512 cp d ;if size=1 then don't
518 ld (ceilingpos+15),a ;save the new byte
521 ld b,16 ;screen width
522 ld de,ceilingpos-1 ;height of current byte
524 ld hl,GRAPH_MEM-17 ;screen position
528 ld c,b ;push b for groundloopup
529 pop hl \ inc hl ;get screen position and go one right
530 pop de \ inc de ;get height info and set to the next byte
531 psh de \ psh hl ;save these for the next time
532 ld a,(de) ;height of current byte
535 ld de,16 ;to substract to go one line up
536 ld a,%11111111 ;bitmask black
539 ld (hl),a ;display black byte
541 dnz ceilingloopdown ;and loop >groundpos< times
543 ld b,c ;pop b used by groundloopup
544 dnz ceilingloopright ;loop right for entire screen (16x)
545 pop hl \ pop hl ;restore stack
547 CheckCeiling: ;check for collision with the ground
551 srl a ;x/8 (current ceiling-byte)
556 ld de,ceilingpos ;first ceiling-byte
557 add hl,de ;current ceiling-byte
560 cp (hl) ;compare with ceiling
561 ret nc ;carry if ceiling is above you
563 jp damage_you ;otherwise you don't wanna be in that ship
565 ;--------------------------- move stars -------------------------------------
567 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
574 ret ;let's comment this: returns
603 cp 9 ;(GRAPH_MEM&%00001111)-- = $C9FAand15-1 = $A-1
612 ret ;for stupid people, here's another comment...
614 ;--------------------------- pause ------------------------------------------
617 ld hl,$0200 ;top left
619 ld hl,txt_pressenter ;"Enter to continue"
620 cal _puts ;display message
622 cal _getkey ;enter low-power mode and wait for key
623 cp kEnter ;keypressed = enter?
624 jr nz,pause ;no, wait some more
627 ;--------------------------- teacher ----------------------------------------
630 ld (iy+12),5 ;enable flashing cursor
632 cal _homeup ;top left
634 cal _puts ;display message
637 cal _getkey ;enter low-power mode and wait for key
638 cp kEnter ;enter pressed?
640 cp kGrMenu ;keypressed = graph?
641 jr nz,teacherloop ;no, wait some more
643 ld (iy+12),0 ;disable cursor
657 ;--------------------------- exit -------------------------------------------
659 quit: im 1 ;release keyfix procedure
660 set 2,(iy+13) ;set back screen scrolling
662 ld (_asapvar+1),a ;next Asm( run will reload the program
663 ld hl,GRAPH_MEM ;graph-screen location
666 ld bc,1024-1 ;do it 1024 times = entire screen
668 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
669 ;_clrScrn) AND also executes _homeup and ret
671 ;--------------------------- display ----------------------------------------
674 ld hl,GRAPH_MEM ;from buffer (top left)
675 ld de,VIDEO_MEM ;to real screen (top left)
676 ld c,56 ;display height = 64 bytes (minus 8 for bar)
678 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
680 ld a,(hl) ;copy byte from (hl)
682 cpl ;xor $ff: invert byte (white<=>black)
684 inc hl \ inc de ;next byte
685 dnz displaytloop ;16x hl >> de
687 jr nz,displayloop ;loop 64x
689 ld hl,$396b ;Display Score
690 ld (_penCol),hl ;bottom right of screen
693 _D_HL_DECI: ;------- display 5-digit value -------
694 ld de,savestr+4 ;savenr saves number string
696 ldhld: cal UNPACK_HL ;one digit of hl
697 add a,'0' ;make number
698 ld (de),a ;save into savenr
699 dec de ;point to next digit
700 dnz ldhld ;repeat for all digits
702 ld hl,savestr ;we (the program) saved the value righthere
703 jp _vputs ;the only thing left to do is to display it
705 savestr: ;@here the score will be stored
706 .db "00000",0 ;don't worry, it's just temporary
708 ;------------------------- handle ship --------------------------------------
715 inc a ;no! next (explosion)frame
716 ld (your_occ),a ;save
718 cp 34 ;last explosion frame?
719 jp c,exploding_you ;not yet: display explosion
720 cp 40 ;delay finished?
721 jp z,You_die ;yes = game over
722 ret ;don't display anything
726 ld a,%01111110 ;get arrow keys
727 out (1),a ;it's cold outside
728 ld hl,y ;instead of nop\nop do something usefull
729 in a,(1) ;come back in
732 xor %11111111 ;inverted a = 0 if arrow-key has been pressed
733 ld a,(your_multiples)
734 jr z,no_adv ;if so, leave the multiples where they are
735 or %100 ;set move bit
737 no_adv: and %11111011 ;reset move bit
739 adv_ok: ld (your_multiples),a
741 ld a,(timer) ;framecounter
742 and %1 ;switches 0<>1 each frame
743 inc a ;a = 1 or 2 (1.5 avg)
744 ld c,a ;c = your_speed
747 rra ;rotate right (put last bit in c)
748 ld b,a ;we need a later
753 cp 50 ;56-6 = bottom of screen
758 rr b ;because we now use b, it's rr instead of rra
761 sub c ;<dec a> doesn't affect c-flag
762 jr c,no_left ;-1 = left side
769 cp 122 ;128-6 = right side
778 sub c ;<dec a> doesn't affect carry-flag
779 jr c,no_up ;-1 = top of screen
780 ld (hl),a ;save new y
782 no_up: ld e,(hl) ;e=y
783 ld ix,spr_ship01 ;normal ship sprite
784 ld hl,your_inv ;invulnerable?
785 ld a,(hl) ;load time in a
787 jr z,disp_ship ;yes so ship = normal (display \ continue)
789 ld a,(timer) ;load frame nr.
790 and %00000111 ;a=0 once every four frames
791 jr nz,not_time ;a<>0 = not time to update counter
792 dec (hl) ;decrease inv-time left
794 and %00000100 ;a switches 0<->1 every 2 frames
795 jr z,disp_ship ;show normal ship
797 ld ix,spr_ship01i ;display invulnerable ship
799 cal safeputsprite ;display your ship; save de
804 ld a,(your_multiples) ;do you have multiples
805 ld b,a ;save a for 2nd check
806 and %11 ;no? (last two bits = nr of multiples)
807 ret z ;then don't handle them either
809 ld a,b ;restore a (your_multiples)
810 and %100 ;move the multiples??? (=move bit set?)
811 jr z,mult_adv ;nope, just let them (saves (y)in y, (x)in x)
813 ld hl,your_locpos ;location to save this position
815 inc a ;a=a+1 (next position)
816 and %00001111 ;if a>15 then a=a-16
817 ld (hl),a ;save new a
822 ld hl,your_prevpos ;previous positions
823 add hl,bc ;16 turns ago
827 ld (mx),bc ;save multiple position in (mx)
828 ld (hl),d ;save current pos. for 16 turns into the future
837 ld ix,spr_multiple ;sprite of the multiple
838 jp putsprite ;display it + <ret>
843 srl a ;half the framerate
844 dec a ;first frame is 1>inc>srl>dec = 0
847 explosion_stuff: ;in:a=frame*2+(0 to 1); (hl)=xpos--
853 ld ix,spr_explosion ;base sprite
854 add ix,bc ;go to correct sprite (each spr. is 8 bytes)
859 jp putsprite ;and display it too
863 damage_you: ;damages you B points
864 ld a,(your_inv) ;invulnerability left?
866 ret nz ;return if inv>0
867 ld hl,your_armor ;armor left
868 ld a,(hl) ;load hp in A
869 sub b ;decrease hp by B
870 jp m,no_armor ;<0hp left so explode
871 ld (hl),a ;no, so save decreased hp
872 jp disp_armor ;and display new value
874 ld a,%01 ;occ %xxxxxx01 = explode
875 ld (your_occ),a ;too bad, you're dead meat
878 ;------------------------- place multiples ----------------------------------
881 ld (mx),de ;set last multiple-position
882 ld hl,your_prevpos ;place all previous positions
883 ld b,16 ;all 16 of them
885 ld (hl),d ;set prev-x to d
887 ld (hl),e ;set prev-y to e
889 dnz place_multiples ;repeat
892 ;------------------------- select upgrade -----------------------------------
895 ld hl,your_pickup ;select pickups
896 ld a,(hl) ;load pickups taken so far
898 ret m ;return if it's 0 (no pickups)
899 jr nz,select2 ;no, carry on
901 ld a,(your_armor) ;load current armor
902 cp 25-6 ;may not become >=25
903 jr c,select1_ ;ok then just add 6
904 ld a,25-6 ;set to maximum (6 will be added below)
906 add a,6 ;add 6 to armor
907 ld (your_armor),a ;change armor
909 ld (your_pickup),a ;reset pickups
910 jp disp_icons ;display and return
913 jr nz,select3 ;no, carry on
914 ld (hl),a ;reset pickups
916 ld (torp_occ),a ;ready torpedoes
917 jp disp_icons ;display 'n return
920 jr nz,select4 ;no, carry on
921 ld (hl),a ;reset pickups
926 jp nc,disp_icons ;weapon maxed out
927 ld (hl),a ;set new weapon
928 cal loadweapon ;load it (damage and stuff)
929 jp disp_icons ;display n return
932 jr nz,select5 ;no, carry on again
933 ld (hl),a ;reset pickups
935 ld (your_weapon),a ;ready laser
936 jp disp_icons ;display + return
939 jr nz,select6 ;no, carry on once more
940 ld (hl),a ;reset pickups
942 ld (your_multiples),a
945 jp disp_icons ;display, return
947 ld (hl),0 ;reset pickups
948 jp disp_icons ;display/return
950 ;------------------------- fire bullet --------------------------------------
954 ld a,(hl) ;just_fired
955 cp 5 ;already pressed?
956 ret z ;return when already pressed (=5)
958 inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
959 ld a,(your_weapon) ;if you have bullets.....
962 ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
965 ld hl,(x) ;yes: first fire from ship position (x)
966 ld a,(your_multiples) ;any multiples?
968 jr z,fireany ;then just fire somethin'
969 cal fireany ;and blast
970 ld hl,(mx) ;then, fire from multiple position (mx)
971 dec h ;one up (-2 height: keeps weapons centered)
972 ;blast again and <ret>
974 ld (firex),hl ;set position to fire from
977 ld a,(your_weapon) ;do you have laser?
978 ld ix,weapondata-6-(256*3)
983 ld b,3 ;go to current weapon (bc=a)
988 ld a,(ix) ;load this weapon
989 cp %11110000 ;%11110000=laser
990 cal z,fire_laser ;fire laser (will set a=0 when done)
995 pop bc ;weapon counter (do 3 weapons)
999 ;-----fire LASER-----
1002 ld b,0 ;overflow counter
1004 ld d,(hl) ;d = your x-pos
1007 ld a,(hl) ;base y-coord (firey)
1008 add a,(ix+1) ;at specified offset (most likely the middle)
1009 ld e,a ;save laser-y in e
1010 psh de ;save unmodified (x,y)
1014 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1015 add a,a ;y*16 (width of screen)
1016 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1017 inc a ;8 pixels to right (a=even so no overflow)
1022 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1024 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1025 inc b ;a>255 so increase bc by 256
1026 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1027 ld hl,GRAPH_MEM ;save-location
1028 add hl,bc ;bc = Y*16+X/8: hl=screen address
1029 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
1030 sub d ;minus x-start (d=X/8)
1034 inc hl ;Go to next byte
1037 pop de ;de=(firex): x-pos unmodified
1039 check_laserhits: ;de = (x,y)
1040 ld b,nrenemies ;check all enemies
1041 ld hl,enemies+1 ;enemy#1+occ/hp00
1042 laserhits: ;hits with normal enemies
1045 and %00000010 ;normal/moving occ.=%1x
1046 jr z,nolashit ;no hit when enemy_occ <> 2/3
1049 or a ;enemy #0 = pickup
1050 jr z,nolashit ;yes: don't destroy
1054 jp m,nolashit ;no hit when enemy is left of you
1058 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1059 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1060 add a,5 ;add enemy height&&&
1061 jp m,nolashit ;a-e>0 = hit
1063 ld a,(curweapdamage) ;damage
1064 cal enemy_hit ;hl=enemy+y
1069 add hl,bc ;go to next enemy
1071 dnz laserhits ;check all enemies
1072 xor a ;a=0 otherwise weird things might happen :P
1073 ld (weapincs),a ;reset damage
1080 ld hl,torp_occ ;torpedo...
1081 ld a,(hl) ;load torpInfo
1082 dec a ;do you have (unused) torpedoes?
1083 ret nz ;nope (a must be 1)
1084 ld (hl),2 ;yes; use torpedo
1085 ld (torp_pos),de ;save torpedo position (in de)
1088 ;-----fire BULLETs-----
1091 ld c,a ;save bulletType in c
1092 ld hl,ybullets ;check for unused bullet
1098 jr z,found_ybullet ;0 = no bullet here
1100 dnz find_ybullet ;look next bullet
1101 pop hl ;don't try to fire any other bullets
1105 ld (hl),c ;use the bullet and set correct bullet-type
1107 ld (hl),1 ;set bullet damage
1109 ld a,(firex) ;your x-pos
1110 add a,5 ;place bullet in front of you
1111 inc hl ;go to bullet-x
1114 ld a,(firey) ;your y-pos
1115 add a,(ix+1) ;place bullet at the middle of your ship
1116 inc hl ;go to bullet-y
1120 ld (weapincs),a ;reset damage
1123 ;------------------------ handle bullets ------------------------------------
1131 cp (hl) ;off screen? (x>=128)
1134 add a,b ;move b to the right
1135 ld (hl),a ;save new pos.
1174 pop hl ;cal bullet_left
1176 ld (hl),0 ;dump this bullet!
1177 jr next_ybullet+1 ;+1:skip pop hl at next_ybullet
1183 psh bc ;bullet counter
1184 psh hl ;save enemy+type
1185 ld (temp1),hl ;needed for check_bullethits
1186 ld a,(hl) ;@bulletType
1191 jp z,next_ybullet ;bulletType=0 >> no bullet
1192 cal bullet_left ;move bullet left
1195 psh de ;save de =position
1198 ld a,(hl) ;bullet damage=size
1199 ld hl,XLbullettable ;pointer to first bullet
1203 ld e,a ;->16bit (de=a)
1204 add hl,de ;point to correct bullet offset
1205 ld a,(hl) ;load bullet offset
1206 ld e,a ;convert to 16bit (d=0)
1207 ld ix,spr_bullet01 ;first sprite
1208 add ix,de ;add offset (go to correct sprite)
1209 pop de ;saved position
1211 ld a,(ix) ;bullet x-size
1212 ld (bulletxsize),a ;used at check_bullethits
1213 ld a,(ix+1) ;bullet y-size...
1214 ld (bulletysize),a ;...too
1216 cal safeputsprite ;display bullet; DE used for check_bullethits
1218 cal check_bullethits
1221 pop hl ;restore enemy+type
1225 inc hl ;skip type,dam,x,y: next enemy+type
1227 dnz scan_bullets ;next bullet (loop)
1230 ;--------------------------- check bullethits -------------------------------
1232 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1236 hit_enemies: ;Hits with normal enemies
1237 psh bc ;enemy counter
1242 jr z,nohit ;no hit when enemy_occ <> 2/3
1246 or a ;enemy #0 = pickup
1247 jr z,nohit ;yes: don't destroy
1249 cal find_sprite ;set ix to the sprite of this enemy
1253 sub d ;minus bullet x-position
1255 sub 5 ;minus bullet x-size
1259 add a,(ix) ;add enemy width
1264 sub e ;minus bullet y-position
1266 sub 3 ;substract bullet height
1268 jp p,nohit ;nope, missed it
1270 add a,(ix+1) ;add enemy height
1272 jp m,nohit ;missed after all
1274 ;---bullet hits enemy (auch-time!)---
1276 ld hl,0 ;@bulletType
1278 ld (hl),0 ;remove bullet
1280 ld a,(hl) ;set damage
1288 dnz hit_enemies ;check next enemy
1291 enemy_hit: ;*in:a=damage;hl=enemy+y
1292 add a,a ;a=damage to inflict
1293 add a,a ;first 2 bits used for occ.
1299 ld a,(hl) ;load hp00
1300 sub b ;decrease HP (if <0xx then c is set)
1301 ld (hl),a ;save (no flag-changes)
1302 dec hl ;@hp64; no change in c
1303 ld a,(hl) ;load; no c-change
1304 sbc a,0 ;if cf then decrease a
1305 ld (hl),a ;save back the new value
1306 ret nc ;if a>=0 then return, otherwise explode
1308 inc hl ;goto occ again
1309 ld (hl),%01 ;set to explode
1310 ld a,(pickuptimer) ;counts enemies destroyed
1311 dec a ;enough destroyed for a pickup?
1312 jr nz,pickupdone ;otherwise just explode
1313 ld (hl),%110 ;change it into a pickup (with 2 HP)
1314 ld a,18 ;reset enemies counter (18 hits = next)
1316 ld (pickuptimer),a ;save new enemiescounter value
1318 ld (hl),$00 ;explosionFrame 0
1320 ld hl,1 ;increase score by one
1323 ;--------------------------- handle torpedo ---------------------------------
1328 ret m ;return if occ=0/1
1330 ld hl,torp_pos ;x-position
1331 ld a,(hl) ;load in a
1333 cp 125 ;right edge reached
1334 jr nc,remove_torp ;remove if x>125
1335 ld (hl),a ;save new x
1341 cp 56 ;bottom reached
1342 jr nc,remove_torp ;remove if y>40
1343 ld (hl),a ;save new y
1347 cal safeputsprite ;display torpedo
1348 jp check_bullethits ;check for hits with enemies
1355 ;--------------------------- level events -----------------------------------
1358 ld hl,nextevent ;time to next event <ld a,(nextevent)
1359 dec (hl) ;decrease counter <dec a
1360 ld a,(hl) ;look at counter <ld (nextevent),a
1361 or a ;has it reached zero?
1362 ret nz ;nope: get outta here!
1364 ld a,0 ;enemy frequency (lvl)
1366 ld (nextevent),a ;set time to next event
1368 dec (hl) ;update enemy-counter
1370 ld a,(hl) ;look at counter
1371 or a ;has it reached 0?
1372 jp z,Next_level ;yes: level finished
1373 dec a ;has it reached 1?
1374 jr z,standby_event ;yes: wait until no enemies present/left
1375 dec a ;has it reached 2?
1376 jr z,place_boss ;yep: place the BigBossTM!
1377 dec a ;has it reached 3?
1378 jr nz,do_event ;nope: >3 = place an enemy
1379 inc hl ;nextevent located behind eventleft
1380 ld (hl),123 ;set delay
1381 ret ;don't place any more enemies
1385 ld (nrlvlenemies),a ;just one enemy: the BOSS
1386 ld hl,(levelp) ;the leveldata (including the boss)
1387 dec hl ;points to leveldata\boss\enemynr
1389 ld (lvlenemies),a ;set new enemy (boss)
1390 dec hl ;points to level\boss\movement
1392 ld (level_move),a ;set boss movement
1397 ld hl,enemies+1-enemysize
1402 or a ;0 = no enemy present
1413 ld hl,enemies+1-enemysize
1418 cp (hl) ;(hl) = 0 ??
1419 jr nz,chk_noenemy ;jump if enemy present (non-0)
1420 ex de,hl ;de=hl=usable enemy
1422 place_enemy: ;de = enemy+1
1424 nrlvlenemies =$-1 ;=nr of enemies minus 1
1425 cal Random ;random enemy b..b+c = 0..nrenemies-1
1429 add hl,bc ;go to a random enemy
1430 ld a,(hl) ;load enemy nr of this mysterious random enemy
1431 cal findenemyspecs ;hl = enemy #a specs
1433 dec de ;goto hp64 (before occ)
1435 ldi ;set hitpoints+occ of enemy class
1436 ldi ;set enemy class (nr)
1438 ld a,128 ;appear at right edge of screen
1439 ld (de),a ;= x-position (save)
1442 ld a,(hl) ;load placeInfo
1445 jr z,random_enemy ;yes: create random value <51 in a
1447 jr z,lure_enemy ;yes: create a 100% luring enemy
1449 halflure_enemy: ;yes (of course it is): pick one (50% lure)
1450 ld a,(timer) ;look at frame-number
1451 and %00000001 ;make random if odd frame nr.
1452 jr nz,random_enemy ;1st possibility: random enemy
1453 lure_enemy: ;2nd possibility: luring enemy
1454 ld a,(y) ;place at same y-pos as YOUR ship
1457 ld bc,256*51 ;range=0..51
1459 ypos_OK: ;random value successfully created
1460 ld (de),a ;save y-position
1461 inc de ;@movecounter
1463 ld a,1 ;movecounter = 1
1465 inc de ;@firecounter
1467 ldi ;set time-to-1st-fire
1471 ;--------------------------- enemy fires ------------------------------------
1473 Enemy_fires: ;de = x,y
1483 jr z,found_ebullet ;0 = not used
1484 inc hl \ inc hl \ inc hl
1485 dnz find_ebullet ;look next bullet
1498 ld b,%1011 ;yourY-bulY = negative (=bullet below you)
1501 ld b,%1001 ;yourY-bulY = even more negative (going up)
1506 ld b,%1010 ;bullet going down
1508 jp m,bulletok ;even more going down
1515 ld (hl),a ;set bullet direction
1517 ld (hl),d ;set x-pos
1519 ld (hl),e ;set y-pos
1522 ;----------------------------- enemy bullets --------------------------------
1530 ld a,(hl) ;load bulletType in a
1531 and %1111 ;select direction-bits
1532 jr nz,enemy_bullet ;non-0: handle bullet
1534 pop hl ;do not move the <pop hl>
1536 inc hl \ inc hl \ inc hl
1541 ld b,a ;save type&%1111
1543 ld a,(hl) ;check if it has reached the left side of scrn
1545 jr nz,remove_ebullet ;yes, remove bullet
1546 dec (hl) ;move one left
1547 dec (hl) ;and another one
1551 ld a,b ;restore type
1552 cp %1100 ;is it a normal bullet? (cp = faster than bit)
1553 jr z,ebullet_common ;type %1100: normal bullet
1554 and %111 ;isolate important bits
1555 jr z,ebullet_down ;type %1000: moving down
1557 jr z,ebullet_up ;type %1001: moving up
1566 jr z,ebullet_down ;type %1010: moving down 50%
1567 ;type %1011: moving up 50%
1584 ld ix,spr_bullete1 ;display enemy bullet
1590 jr nz,next_bullet ;0 = you're normal
1610 pop hl ;points to bullettype again
1611 psh hl ;and save it again (ivm call to damage_you)
1612 ld a,(hl) ;load bullettype
1613 cal _shracc ;isolate damage-bits (%1111???? -> %00001111)
1614 ld b,a ;set damage-amount
1615 cal damage_you ;HIT!!
1617 pop hl ;hl could be destroyed by damage_you
1618 ld (hl),0 ;bullet > unused
1619 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
1621 ;--------------------------- handle enemies ---------------------------------
1625 ld b,nrenemies ;handle all enemies
1633 jr z,next_enemy ;occ "no enemy" 0
1635 jr z,exploding_enemy ;occ "exploding" 1
1636 ld b,a ;b=2 if moving, otherwise b=1
1638 normal_enemy: ;occ "normal" 2 or "moving" 3
1640 ld c,(hl) ;c = enemy type = de
1650 jr c,remove_enemy ;=off screen
1654 ld a,b ;moving state was stored in b earlier
1656 cal nz,moving_enemy ;2 = moving enemy
1660 ld (hl),d ;store new x
1661 ld a,c ;a = enemy type
1662 or a ;type 0? (pickup)
1663 jr nz,check_enemyfire ;no, a normal enemy; let em fire
1664 ld a,(timer) ;load time
1665 and %1 ;move left once every 2 turns
1666 jr z,firing_done ;don't move now
1667 inc d ;increase x-position (don't move this turn)
1668 inc (hl) ;and save it
1669 jr firing_done ;continue
1675 dec (hl) ;decrease counter till next blast
1676 ld a,(hl) ;&&&doesn't seem efficient to me
1677 or a ;has it reached zero?
1678 jr nz,firing_done ;finished if not
1683 ld (hl),a ;reset counter for next blast
1684 psh de ;save registers for firing-use
1685 cal Enemy_fires ;fires bullet
1686 pop de ;restore (destroyed by Enemy_fires)
1688 cal putwidesprite ;display sprite @ix
1700 ld (hl),$0000 ;bye bye enemy
1701 jr next_enemy+1 ;continue AFTER pop hl (already done)
1707 jr z,remove_enemy ;remove when at last frame
1709 ld (hl),a ;next frame
1710 cal explosion_stuff ;display explosion
1713 ;--------------------------- moving enemies ---------------------------------
1718 jr z,movetype_updown ;type 0
1720 jr z,movetype_vslow ;1
1722 jr z,movetype_fast ;2
1724 jr z,movetype_vfast ;3
1726 jr z,movetype_smart ;4
1728 jr z,movetype_lure ;5
1730 jr z,movetype_slowlure ;6
1732 jr z,movetype_stoplure ;7
1734 ; jr z,movetype_fulllure ;8
1755 jr c,movetype_slowlure
1756 inc d ;x<100: full stop
1757 jr movetype_slowlure
1776 inc hl ;hl =@ <move>
1785 or a ;reset carry flag
1786 dec hl ;reset hl to <y>
1804 pop hl ;restore stack (no ret used)
1805 jp remove_enemy ;remove this enemy (off screen)
1816 or a ;reset carry flag
1819 ld a,(hl);&&&ld a,e ;load current y-position
1822 moveup: dec a ;decrease y-pos (=move up)
1823 ret m ;don't move off the screen (y<0)
1824 dec e ;save new y-pos
1827 inc a ;increase y-pos
1828 cp 55 ;compare with bottom
1829 ret nc ;return if it has passed that line (>40)
1830 inc e ;otherwise save new position
1833 ;--------------------------- check collision --------------------------------
1836 ld hl,(x) ;e = X, d = Y
1837 ld de,$0707 ;add 7 to both d and e
1840 ld e,l ;e = X+7, d = Y+7
1843 ld b,nrenemies ;check all 20 enemies
1848 jr z,check_next ;2 or 3 = ok
1851 collide_enemy: ;&&& include in Handle_enemy proc
1855 ld a,(hl) ;check x match
1856 sub e ;enemy position minus yours minus 7
1859 add a,(ix) ;enemy width
1863 ld a,(hl) ;check y match
1864 sub d ;same as with x-check
1867 add a,(ix+1) ;enemy height
1874 ld hl,2 ;increase score by 2
1878 ld a,(hl) ;load enemy type
1880 jr nz,collide ;enemy when <>0
1883 ld hl,your_pickup ;your pickups
1888 ld a,1 ;yes: reset to pickup 1
1891 cal disp_icons ;display altered pickupicons
1894 dec hl ;to enemy occ
1895 xor a ;set to 0 = gone
1897 jr check_next ;all done, next..
1900 ld (hl),%01 ;set to explode
1902 ld (hl),0 ;explosionFrame 0
1914 ld b,collidedamage ;damage
1926 ;--------------------------- story ------------------------------------------
1946 ld hl,VIDEO_MEM ;copy text
1947 ld de,GRAPH_MEM ;to GRAPH_MEM
1948 ld bc,1024 ;entire screen
1964 cal storyPage ;do some story
1965 inc hl ;look at next hl
1966 ld a,(hl) ;load in a
1968 inc a ;set z-flag if a = $ff
1969 jr nz,dostory ;otherwise loop
1971 ld bc,3+1 ;story ends
1972 add hl,bc ;set hl to beginning of the level
1973 ld (levelp),hl ;set the level-pointer
1976 ;--------------------------- SFX --------------------------------------------
1978 DoSFX: ;in:a=beginLine;b=nrOfLines
1983 ld a,0 ;get line number
1985 inc a ;go to the next line
1986 ld (curline),a ;update
1993 add hl,hl ;*16 (a pixels down=a*16)
1995 ld b,h ;save hl for later
1998 ld de,VIDEO_MEM ;where to put sfx
1999 add hl,de ;go to ymin
2000 ex de,hl ;put into de again
2006 neg ;a=64-a (lines from bottom)
2008 ; ld c,a ;c=a=(curline)
2010 ; sub c ;lines from bottom
2012 SFXdisp: ;display this frame on screen
2013 ld bc,16 ;one line (=16 bytes, you'd know by now)
2014 ldir ;display (copy actually)
2015 ld bc,-16 ;go up one line (not on screen)
2016 add hl,bc ;so the same line will be displayed
2018 jr nz,SFXdisp ;repeat until whole screen is displayed
2029 ;--------------------------- show icon --------------------------------------
2032 ld (hl),a ;draw one piece of the divider-line
2033 inc hl ;move right (8 pixels = 1 byte)
2034 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
2038 psh bc \ psh de \ psh hl \ psh ix ;&&&
2040 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
2041 ld (PutWhere),hl ;place icons at bottom of normal screen
2042 ld b,16 ;draw 16x (screen width)
2043 ld a,%11111111 ;horizontal line mask
2044 cal drawline ;draw divider-line
2046 ld b,16*7 ;draw 16x (screen width) 7x (height)
2047 xor a ;blank line mask
2048 cal drawline ;clear scorebar
2052 ld ix,spr_icon01 ;armorIcon
2053 ld de,$1901 ;icon #1
2054 cal putwidesprite ;display icon
2055 cal disp_armor ;display bar
2061 ld ix,spr_icon02 ;torpedoIcon
2063 ld de,$2901 ;icon #2
2064 cal putwidesprite ;display
2067 ld a,(your_weapon) ;ur weapon
2070 ld hl,$3945 ;position to display bullet-type digit
2071 ld a,(your_weapon) ;digit
2072 dec a ;minus one (1=laser)
2073 ld (_penCol),hl ;set location
2074 add a,'0' ;make digit
2075 cal _vputmap ;display char
2076 ld ix,spr_icon03 ;bulletIcon
2078 ld de,$3901 ;icon #3
2079 cal putwidesprite ;display icon
2081 ld ix,spr_icon00 ;emptyIcon
2085 ld ix,spr_icon04 ;laserIcon
2087 ld de,$4901 ;icon #4
2090 ld ix,spr_icon00 ;emptyIcon
2091 ld a,(your_multiples)
2096 ld de,$5901 ;icon #5
2099 ld ix,spr_dividerline
2103 ld a,(your_pickup) ;pickups taken
2104 add a,a ;picks*2 (sets z-flag)
2105 jr z,iconsdone ;return if no pickups
2110 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
2111 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
2116 ld hl,GRAPH_MEM ;normal game-screen
2117 ld (PutWhere),hl ;set sprite-position to normal screen
2119 pop ix \ pop hl \ pop de \ pop bc
2123 ld hl,(57*16)+VIDEO_MEM+3
2130 ld a,(your_armor) ;load your armor
2134 srl a ;/8: don't display last 3 bits of a (later)
2135 jr z,noarmorbar ;if a=0 then it would loop 256x so skip it
2136 ld b,a ;loop b=a times
2137 armorbar: ;starting at ($39*16)+VIDEO_MEM
2138 ld (hl),%11111111 ;draw a piece of the bar
2139 inc hl ;next position
2140 dnz armorbar ;loop it b times
2144 and %111 ;display last bits of armor
2145 ret z ;if armor=0 then bit = %00000000 (don't disp)
2147 xor a ;bit = %00000000
2150 rra ;rotates A right and sets bit 7 (c-flag)
2151 dnz armorbarbit ;repeat B times (so if B=6 then a=%11111100)
2152 armorbarready: ; (an if B=3 then a=%11100000)
2153 ld (hl),a ;draw this last byte
2157 ld hl,(58*16)+VIDEO_MEM+3
2163 ld a,(weapincs) ;load bar size (0-80)
2164 srl a ;half the size (0-40)
2165 srl a ;again half that size (0-20 pixels)
2169 srl a ;/8: don't display last 3 bits of a (later)
2170 jr z,nochargebar ;if a=0 then it would loop 256x so skip it
2171 ld b,a ;loop b=a times
2172 chargebar: ;starting at ($39*16)+VIDEO_MEM
2173 ld (hl),%11111111 ;draw a piece of the bar
2174 inc hl ;next position
2175 dnz armorbar ;loop it b times
2178 and %111 ;display last bits of chargebar
2179 ret z ;if armor=0 then bit = %00000000 (don't disp)
2181 xor a ;bit = %00000000
2184 rra ;rotates A right and sets bit 7 (c-flag)
2185 dnz chargebarbit ;repeat B times (so if B=6 then a=%11111100)
2186 chargebarready: ; (an if B=3 then a=%11100000)
2187 ld (hl),a ;draw this last byte
2191 ld hl,$3A00 ;display Lives
2192 ld (_penCol),hl ;bottom left
2199 ld a,(your_lives) ;nr of lives in a
2200 add a,'0' ;make digit
2203 jp _vputs ;display on screen +ret
2205 ;--------------------------- proc -------------------------------------------
2207 Random: ;a=c<random<b+c; destr:none
2209 add a,0 ;increase last value by 0-255 (r)
2211 ld (ranseed),a ;save for next time
2213 jr nc,Random ;then add again
2217 RandomY: ;HL = random Y 0..50 right side ((1..51)*16-1)
2219 ld bc,1+50*256 ;range=1..51
2220 cal Random ;a = 1..51
2226 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2227 dec hl ;hl = 0..50 * 16 (" at right side of screen)
2229 add hl,de ;position on screen
2241 find_sprite: ;in:hl=enemy+type | out:ix=sprite to enemy
2244 ld e,(hl) ;e = enemy offset/2
2246 ld ix,spr_enemy00 ;first enemy sprite
2247 add ix,de ;add offset for current enemy
2248 add ix,de ;twice (offset stored as offset/2)
2254 ld hl,VIDEO_MEM ;screen location (top left)
2257 ld bc,1024-1 ;do it 1024 times = entire screen
2259 set 3,(iy+5) ;set white on black
2264 ld a,%10000000 ;all key-masks
2267 inc a ;cp %11111111 (no keys pressed)
2268 jr nz,releasekeys ;keep waitin
2269 cal GET_KEY ;clear buffer
2272 findenemyspecs: ;enemy #a specs in (hl); in:b=0; out:ac=?
2273 ld hl,enemyspecs-8 ;enemy "0" specs (1 before enemy #1)
2277 ld c,a ;b=0; c=bc=type*8
2278 add hl,bc ;hl = enemy specs
2281 ;--------------------------- game over / new game / death -------------------
2283 .db 0,".<>!",0,0,0,0 ;down,L,R,up
2284 .db 0,"xtoje0",0 ;enter..clear
2285 .db " wsnid9",0 ;(-)..custom
2286 .db "zvrmhc8",0 ;dot..del
2287 .db "yuqlgb7#" ;0..xvar
2288 .db $D9,"-pkfa6'" ;on..alpha
2289 .db "54321*",0,$D0 ;F5..more
2292 ld hl,_asapvar ;find own variable
2293 rst 20h ;cal _ABS_MOV10TOOP1
2294 rst 10h ;cal _FINDSYM
2295 ret c ;not found? who cares...
2298 ld hl,4+storehi_start-_asm_exec_ram
2299 add hl,de ;hl=pointer to data in original prog
2301 cal _SET_ABS_DEST_ADDR
2304 cal _SET_ABS_SRC_ADDR
2305 ld hl,storehi_end-storehi_start
2306 cal _SET_MM_NUM_BYTES
2307 cal _mm_ldir ;save done (cal \ ret)
2311 ld hl,_asapvar ;find own variable
2312 rst 20h ;cal _ABS_MOV10TOOP1
2313 rst 10h ;cal _FINDSYM
2314 ret c ;not found? who cares...
2317 ld hl,4+storesave_start-_asm_exec_ram
2318 add hl,de ;hl=pointer to data in original prog
2320 cal _SET_ABS_DEST_ADDR
2322 ld hl,storesave_start
2323 cal _SET_ABS_SRC_ADDR
2324 ld hl,storesave_end-storesave_start
2325 cal _SET_MM_NUM_BYTES
2326 cal _mm_ldir ;save done (cal \ ret)
2329 game_over: ;stack=+0
2330 cal BLACKLCD ;clear screen
2332 ld (_curRow),hl ;center
2334 cal _puts ;display "GAME OVER"
2335 cal releasekeys ;wait for all keys to be released
2416 xor a ;clear a (Ahl will be displayed)
2417 ld hl,$1006 ;bottom-1 right
2418 ld (_curRow),hl ;set
2419 ld hl,(your_score) ;your score
2420 cal _dispahl ;display it (a=0)
2422 ld hl,$314b ;bottom-1 right before score ^^
2423 ld (_penCol),hl ;set
2424 ld hl,txt_score ;"Score"
2425 cal _vputs ;display (small)
2427 ld hl,$1007 ;bottom right
2428 ld (_curRow),hl ;set
2429 ld hl,(hiscore) ;hi-score
2430 cal _dispahl ;display
2431 ld hl,$3946 ;bottom right before hiscore ^^
2432 ld (_penCol),hl ;set
2433 ld hl,txt_hiscore ;"Hiscore"
2434 cal _vputs ;display (small)
2439 ld hl,VIDEO_MEM+(49*16)-1
2445 cal _getkey ;wait for keypress
2446 jp quit ;restore some things and return to TI-OS/shell
2448 New_game: ;stack must be +1 (so change the jp in cal :)
2450 ld (your_score),a ;reset score
2451 ld (your_score+1),a ;reset score (0)
2452 ld (torp_occ),a ;no torpedoes
2453 ld (your_weapon),a ;no laser
2454 ld (your_pickup),a ;reset pickups
2455 ld (your_multiples),a ;no multiples
2457 ld (level),a ;reset level nr (#1)
2458 ld hl,level00 ;set level pointer to level#1
2459 ld (levelp),hl ;reset level pointer
2461 ld (your_weapon),a ;default weapon
2463 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
2464 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
2466 You_die: ;stack must be +1
2467 pop hl ;restore stack
2469 ld (your_armor),a ;12 HPs/shields
2470 ld a,(your_lives) ;load lives left
2471 dec a ;decrease lives
2472 ld (your_lives),a ;if lives=0ffh GO
2473 inc a ;if -1 then zf set now
2474 jp z,game_over ;and game's over
2477 ;--------------------------- next level -------------------------------------
2479 Next_level: ;stack must be +1
2481 ld a,(your_armor) ;load current armor
2482 cp 25-8 ;may not become >=25
2483 jr c,addok ;ok then just add 8
2484 ld a,25-8 ;set to maximum (8 will be added below)
2486 add a,8 ;add 8 to armor
2487 ld (your_armor),a ;change armor
2489 ld hl,level ;level number
2496 ld h,0 ;increase score....
2497 ld l,a ;by level number * 4
2500 cal scoreInc ;update score
2502 ld hl,(levelp) ;level pointer
2503 ld b,0 ;advance one level
2505 add hl,bc ;passed the enemies
2507 add hl,bc ;update to point to next level
2508 ld (levelp),hl ;save
2512 ld (nextevent),a ;time to first enemy appearance
2514 ld hl,(levelp) ;level pointer
2519 ld a,(hl) ;number of (different) enemies in this level
2522 ld (nrlvlenemies),a ;set nr of enemies-1
2523 ld b,0 ;bc=c so we can use ldir
2524 ld de,lvlenemies ;table of enemies
2525 ldir ;load enemies to table
2526 ld a,(hl) ;load new appearance-time
2527 ld (eventtime),a ;set
2529 ld a,(hl) ;load nr of enemies in this level
2530 ld (eventleft),a ;set nr of events left
2535 ld a,(hl) ;movement of enemies in this level
2536 ld (level_move),a ;do it
2551 ld (timer),a ;reset time
2552 ld hl,your_occ ;hl = your_occ
2553 ld (hl),a ;reset your ship (not exploding)
2554 inc hl ;hl = your_inv
2555 ld (hl),25 ;set 25*4=100 frames invulnerable
2557 ld (x),de ;begin position (x,y)
2558 cal Place_multiples ;place all multiple-positions at that (0,24)
2562 jr z,torpsclear ;then just continue (=0)
2563 ld a,1 ;if so, set to "ready to fire" (=1)
2566 ld hl,enemies ;remove all enemies and bullets
2567 ld (hl),0 ;clear first byte
2568 ld de,enemies+1 ;copy this to the next byte
2569 ld bc,(nrenemies*enemysize)+(nrybuls*4)+(nrebuls*3)-1
2570 ldir ;clear enemies + bullets (y/e)
2572 ;--------------------------- setup game -------------------------------------
2575 cal BLACKLCD ;white on black
2578 ld (_curRow),de ;center
2579 cal _puts ;display "LEVEL "
2581 ld a,(level) ;current level
2584 cal UNPACK_HL ;create first digit
2587 cal UNPACK_HL ;second digit
2589 cal _putc ;display second digit
2591 cal _putmap ;display first digit
2593 ld hl,txt_lives ;bar text: "Lx0"...
2595 ld (_curRow),de ;display lives left below level nr
2597 ld a,(your_lives) ;lives left
2598 add a,'0' ;make value 0='0'
2601 cal releasekeys ;wait for user to release all keys
2602 ld hl,txt_savekey ;"Press [F1] to save"
2603 ld de,$3A46 ;bottom-right
2607 res 3,(iy+5) ;set white on black
2608 cal _getkey ;wait for keypress
2612 cal _clrLCD ;clear screen
2613 cal disp_icons ;display bottom icons +ret
2617 cal RandomY ;a = random y-pos 1..bottom
2618 ld a,b ;a = b = star nr. = 1..7
2619 add a,a ;a = 2b = 2..14
2621 ld e,a ;de = a = 2-14
2623 sbc hl,de ;substract from random y => random pos anywhere
2625 ld (ix),l ;save x-pos (l)
2626 ld (ix+1),h ;save y-pos (h)
2627 inc ix \ inc ix ;next star
2628 dnz placestars ;repeat for all stars
2641 ld (weapdamage),a ;damage of bullets
2644 ld (weapdaminc),a ;damage increase
2647 ;----------------------------------------------------------------------------
2648 ;--------------------------- putsprite --------------------------------------
2649 ;----------------------------------------------------------------------------
2650 ;in: de=(x,y); ix=sprite
2651 ;out: ix=behind sprite; hl:a=right below sprite; b=0; d=width; ce=?
2654 ld c,(ix) ;save width
2655 _putsprite: ;putsprite with custom width
2657 bit 7,d ;check sign bit of X
2658 jr z,CSpositive ;X>=0
2661 cp (ix) ;off screen?
2662 ret nc ;X<=-width: don't draw at all
2663 ld b,a ;b=|X|mod 8=1..7=bits to draw
2664 ld a,%11111111 ;all bits set (draw everything)
2666 srl a ;remove first bit in a for each b
2667 dnz CSclipleft ;b=1: a=%01111111
2674 res 7,d ;subtract 128, if X was -1 (255) it is now 127
2676 jr CSdisplay ;done clipping
2679 sub 129-8 ;minus (screen width - byte width)
2681 ld a,%11111111 ;clipmask
2682 jr c,CSdisplay ;x+width<128 then entire sprite is on screen
2683 inc b ;b = number of pixels off screen
2685 add a,a ;remove last bit in a for each b
2686 dnz CSclipright ;b=1: a=%11111110
2693 ;b>7: a=%00000000 = off screen
2695 CSdisplay: ;display the sprite ix at (d,e) masked
2696 ld (CSclipmask),a ;set mask
2697 cal findpixel ;convert de to screen location hl:a
2703 psh bc ;save rows to go
2706 ld a,(ix+2) ;load image line
2712 ld a,1 ;saved bitmask
2714 sla c ;test leftmost pixel
2715 jr nc,CSnodraw ;don't draw if it's 0
2716 ld e,a ;psh af: save bitmask
2718 ld (hl),a ;OR pixel with screen
2722 jr nc,CSbitdrawn ;carry set if bit "jumped"
2726 pop hl ;screen at x-offset=0
2728 add hl,bc ;next line
2729 pop bc ;rows counter
2733 ;--------------------------- putbigsprite -----------------------------------
2738 jr c,putsprite ;width<=8: just draw the sprite
2745 cal _putsprite ;otherwise draw one column (8 pixels wide)
2749 add a,d ;8 pixels right
2751 pop bc ;then draw the remaining pixels (c=width-8)
2754 safeputsprite: ;cal putsprite with de intact
2760 ;------------------------------- findpixel ----------------------------------
2761 ;based upon CLEM's fp | 131 cycles | 28 bytes | in:(d,e); out:hla; destr:de
2766 add a,a ;add a,a is 7 cycles faster than add hl,hl
2767 ld h,0 ;switch to hl now (Y<64)
2770 rra ;RRA: carry flag must be reset!
2771 add hl,hl ;that's what the adds are for :P
2787 ld de,GRAPH_MEM ;screen base position (where x+y=0)
2792 ;----------------------------------------------------------------------------
2793 ;------------------------------- sprites ------------------------------------
2794 ;----------------------------------------------------------------------------
2797 .db 7,7 ;ship alpha class
2798 .db %01111000 ; ████
2800 .db %01111100 ; █████
2801 .db %11110010 ;████ █
2802 .db %01111100 ; █████
2804 .db %01111000 ; ████
2807 .db %01111010 ; ████ █
2808 .db %11100001 ;███ █
2809 .db %01111101 ; █████ █
2810 .db %11110011 ;████ ██
2811 .db %01111101 ; █████ █
2812 .db %11100001 ;███ █
2813 .db %01111010 ; ████ █
2816 .db 7,7 ;ship beta class
2819 .db %01111100 ; █████
2820 .db %01110010 ; ███ █
2821 .db %01111100 ; █████
2826 .db %11100010 ;███ █
2827 .db %11110001 ;████ █
2828 .db %01111101 ; █████ █
2829 .db %01110011 ; ███ ██
2830 .db %01111101 ; █████ █
2831 .db %11110001 ;████ █
2832 .db %11100010 ;███ █
2835 .db 7,7 ;ship gamma class
2836 .db %11111000 ;█████
2838 .db %11111100 ;██████
2839 .db %11100110 ;███ ██
2840 .db %11111100 ;██████
2842 .db %11111000 ;█████
2845 .db %11111010 ;█████ █
2846 .db %01100001 ; ██ █
2847 .db %11111101 ;██████ █
2848 .db %11100111 ;███ ███
2849 .db %11111101 ;██████ █
2850 .db %01100001 ; ██ █
2851 .db %11111010 ;█████ █
2854 .db 7,7 ;ship delta class
2856 .db %11110000 ; ████
2857 .db %11111100 ; ██████
2858 .db %01100010 ; ██ █
2859 .db %11111100 ; ██████
2860 .db %11110000 ; ████
2864 .db %11000010 ; ██ █
2865 .db %11110001 ; ████ █
2866 .db %11111101 ; ██████ █
2867 .db %01100011 ; ██ ██
2868 .db %11111101 ; ██████ █
2869 .db %11110001 ; ████ █
2870 .db %11000010 ; ██ █
2874 .db %01111000 ; ████
2875 .db %11001100 ; ██ ██
2877 .db %11001100 ; ██ ██
2878 .db %01111000 ; ████
2880 ;-------------------------------- explosion ---------------------------------
2886 .db %00111110 ; █████
2887 .db %01010110 ; █ █ ██
2893 .db %01001110 ; █ ▒███
2894 .db %10111110 ; █ █████
2895 .db %01001111 ; █ ▒████
2897 .db %00011010 ; ██ █
2900 .db %10110000 ; █ ██
2901 .db %01001110 ; █ ███
2902 .db %10110101 ; █ ██▒█▒█
2903 .db %01000101 ; █ ▒█▒█
2904 .db %00111110 ; █████
2905 .db %01011010 ; █ ██ █
2908 .db %00101010 ; ▒ █▒█ █
2909 .db %01000110 ; █ ▒██
2910 .db %10110101 ; █ ██ █ █
2911 .db %01100110 ; ██ ██▒
2912 .db %00111100 ; ████▒
2913 .db %01011001 ; █ ██ ▒█
2916 .db %01000000 ; █▒ ▒ ▒
2917 .db %00100101 ; ▒█ █▒█
2918 .db %00010100 ; ▒ ▒█ █ ▒
2919 .db %01000100 ; █▒ █
2920 .db %00010010 ; ▒█▒▒█
2921 .db %10011010 ; █▒ ██ █▒
2925 .db %00100000 ; ▒█ ▒ ▒
2926 .db %00000001 ; ▒ ▒ █
2928 .db %00100010 ; █▒ █
2929 .db %01001000 ; ▒█ ▒█ ▒
2932 .db %00001000 ; ▒ █▒
2933 .db %11000010 ; ██ ▒ █
2935 .db %00100000 ; ▒█ ▒
2936 .db %00000001 ; ▒ ▒█
2937 .db %00110000 ; ▒██▒
2941 .db %00000000 ; ▒▒ ▒
2945 .db %00100100 ; █▒ █
2956 ;--------------------------------- bullets ----------------------------------
2963 .db %11110000 ;▒████
2975 .db %11110000 ;▒████
2980 .db %11111000 ;▒█████
2984 .db %01110000 ; ▒███
2985 .db %11111000 ;▒█████
2986 .db %01110000 ; ▒███
2989 .db %11110000 ;▒████
2990 .db %11111000 ;▒█████
2991 .db %11110000 ;▒████
2995 .db %10111000 ;▒█▒███
2996 .db %01111000 ; ▒████
3000 .db %00111000 ; ▒███
3001 .db %01111100 ; ▒█████
3002 .db %11111100 ;▒██████
3007 .db %11111100 ;▒██████
3008 .db %00111110 ; ▒█████
3009 .db %01111100 ; ▒█████
3014 .db %11111100 ;▒██████
3015 .db %00111110 ; ▒█████
3016 .db %01111110 ; ▒██████
3017 .db %11111100 ;▒██████
3018 .db %00111000 ; ▒███
3021 .db %00111100 ; ▒████
3022 .db %11111110 ;▒███████
3023 .db %01111111 ; ▒███████
3024 .db %00011111 ; ▒█████
3025 .db %01111111 ; ▒███████
3026 .db %11111110 ;▒███████
3027 .db %00111100 ; ▒████
3031 .db %11110000 ; ████
3035 .db 4,3 ;enemy bullets
3037 .db %11110000 ;████▒
3041 .db (spr_bullet01-spr_bullet01) ;0
3042 .db (spr_bullet02-spr_bullet01) ;4
3043 .db (spr_bullet03-spr_bullet01) ;8
3044 .db (spr_bullet04-spr_bullet01) ;12
3045 .db (spr_bullet05-spr_bullet01) ;16
3046 .db (spr_bullet06-spr_bullet01) ;20
3047 .db (spr_bullet07-spr_bullet01) ;24
3048 .db (spr_bullet08-spr_bullet01) ;28
3049 .db (spr_bullet09-spr_bullet01) ;32
3050 .db (spr_bullet10-spr_bullet01) ;36
3051 .db (spr_bullet11-spr_bullet01) ;40
3052 .db (spr_bullet12-spr_bullet01) ;44
3053 .db (spr_bullet13-spr_bullet01) ;48
3054 .db (spr_bullet13-spr_bullet01) ;52
3055 .db (spr_bullet13-spr_bullet01) ;56
3056 .db (spr_bullet13-spr_bullet01) ;60
3058 ;format:[min.damage] [dam.inc] [0000:direction 0000:speed] [offset]
3059 ;damage = min.damage + dam.inc*incs (0<=incs<=6)
3062 .db 1,1,%11110000,0,%11110000,6,%00000000,0 ;LASER
3063 .db 1,1,%00000010,3,%00000000,0,%00000000,0 ;single fire
3064 .db 3,1,%00000011,3,%00000000,0,%00000000,0 ;fast single
3065 .db 1,1,%00000010,0,%00000010,6,%00000000,0 ;double
3066 .db 1,1,%00010010,2,%00110010,2,%01000010,2 ;triple
3067 .db 3,2,%00010011,2,%00110011,2,%01000011,2
3068 .db 5,3,%00010011,2,%00110011,2,%01000100,2
3069 .db 7,4,%00010100,2,%00110100,2,%01000100,2
3070 .db 12,5,%00010110,2,%00110110,2,%01000110,2
3074 ;------------------------------------ bar -----------------------------------
3077 .db 16,7 ;selected .......:.......:
3078 .db %11111111 ; ████████████████
3079 .db %11000000 ; ██ █
3080 .db %11000000 ; ██ █
3081 .db %11000000 ; ██ █
3082 .db %11000000 ; ██ █
3083 .db %11000000 ; ██ █
3084 .db %11111111 ; ████████████████
3094 .db 16,7 ;unused .......:.......:
3095 .db %10101010 ; █ █ █ █ █ █ █ █
3096 .db %11010101 ; ██ █ █ █ █ █ █ █
3097 .db %10101010 ; █ █ █ █ █ █ █ █
3098 .db %11010101 ; ██ █ █ █ █ █ █ █
3099 .db %10101010 ; █ █ █ █ █ █ █ █
3100 .db %11010101 ; ██ █ █ █ █ █ █ █
3101 .db %10101010 ; █ █ █ █ █ █ █ █
3111 .db 16,7 ;armor ; .......:.......:
3112 .db %10000111 ; █ ███████
3113 .db %10011000 ; █ ██ ██
3114 .db %10110011 ; █ ██ ████ ██
3115 .db %10110000 ; █ ██ ████ ██
3116 .db %10110011 ; █ ██ ████ ██
3117 .db %10011000 ; █ ██ ██
3118 .db %10000111 ; █ ███████
3128 .db 16,7 ;torpedo .......:.......:
3129 .db %10111000 ; █ ███ █ █ █
3130 .db %10011100 ; █ ███ █ █ █
3131 .db %10111000 ; █ ███ █ █ █
3132 .db %10000000 ; █ ███ █ █
3133 .db %11100001 ; ███ ████ █ █
3134 .db %10011000 ; █ ██ ████ █ █
3135 .db %11100110 ; ███ ██ ██ █
3145 .db 16,7 ;bullets .......:.......:
3146 .db %10000000 ; █ ██
3147 .db %10000011 ; █ █████ ▒▒▒
3148 .db %10011000 ; █ ██ ██ ▒▒▒
3149 .db %11111100 ; ██████ ▒▒▒
3150 .db %10011000 ; █ ██ ██ ▒▒▒
3151 .db %10000011 ; █ █████ ▒▒▒
3152 .db %10000000 ; █ ██
3162 .db 16,7 ;laser .......:.......:
3164 .db %10110010 ; █ ██ █ █
3165 .db %10111011 ; █ ███ ██
3166 .db %10011101 ; █ ███ █████████
3167 .db %10111011 ; █ ███ ██
3168 .db %10110010 ; █ ██ █ █
3179 .db 16,7 ;multiple .......:.......:
3180 .db %10000011 ; █ ███
3181 .db %10000001 ; █ ████ ██
3182 .db %10000001 ; █ ████
3183 .db %10000011 ; █ ███
3184 .db %10011000 ; █ ██
3185 .db %10111100 ; █ ████ ██ ██
3186 .db %10011000 ; █ ██
3197 .db 128,128,128,128,128,128,128 ;128 = %10000000
3199 ;---------------------------- texts -----------------------------------------
3201 txt_email: .db "www.shiar.org ",127 ;title screen
3202 .db " shiar0@hotmail.com",0
3203 _txt_email = $3A01 ;$3A1E=just email
3204 txt_about: .db " v0.97.625 ",127," by Shiar",0 ;right behind txt_email
3206 txt_menu1: .db "NEW GAME",0
3207 txt_menu2: .db "CONTINUE",0
3209 txt_level: .db "LEVEL ",0 ;new level screen
3210 txt_lives: .db "Lx0",0
3211 txt_savekey: .db "Press [F1] to save",0
3213 txt_gameover: .db "GAME OVER!",0 ;game over screen
3214 txt_score: .db "Score",0
3215 txt_hiscore: .db "Hiscore",0
3217 txt_pressenter: .db "Enter to continue",0 ;pause
3218 txt_teacher: .db "(2",Lpi,"*.95)/sin 13",0 ;boss
3219 txt_teacherans: .db Lneg,"14.2063168184",0
3221 ;---------------------------- save data -------------------------------------
3225 hiname .db "Shiar.97",0
3229 level .db $01 ;level number
3230 levelp .dw level01 ;pointer to level data
3231 pickuptimer .db $04 ;counts when to place a pickup
3232 your_score .dw $0000
3235 your_occ .db $00 ;0=normal 1..16=exploding
3236 your_inv .db $00 ;invincibility left
3237 your_armor .db $0a ;HP left
3238 your_lives .db $03 ;
3240 your_weapon .db $02 ;weapon: 0=no, 1=laser, 2+=bullet n+1
3241 your_multiples .db $00 ;multiples present
3242 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
3243 torp_pos .dw $0000 ;torpedo position (x,y)
3247 ;XLlevelsdata:---------------------------------------------------------------
3250 .db 0 ;story identifier
3251 .db $21,$1d,"Cosmic year 6716" ,0,0,$1d,$06
3252 .db $1b,$1d,"storyline coming soon..." ,0,0,$1d,$06
3253 .db $09,$19,"the Nemesis saga continues",0,1
3254 .db $2e,$21,"with NEMESIS 86" ,0,1
3255 .db $52,$36,"by Shiar" ,0,0,$19,$23
3258 ;format:[nr.dif.enemies]x [enemy nr]
3259 ; [enemy frequency] [next lvl]
3260 ; [level_info: 0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
3261 ; [level_move] [tunnel size] [groundtype]
3262 ; [16_ground] [16_ceiling] [stars1] [stars2]
3264 .db $07,$08 ;moveType; enemyType
3265 level01: ;efrequency must be odd if halfluring!
3267 .db $1b,$2f,%00010000
3270 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3271 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3277 .db $01,01,"And the storyline conti",
3279 .db $01,09,"You decide to fly close",
3281 .db $01,15,"surface of a nearby pl",
3282 .db "anet =)",0,0,1,20
3288 .db $13,$4b,%00100100,0,0,0
3289 .db 1,2,3,4,5,6,6,5,4,3,4,5,4,3,2,1
3290 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3296 .db $01,01,"Blablabla...",0,1
3297 .db $01,34,"this storyline sux",0,0,1,39
3303 .db $2d,$3f,%00010110,0,-9,1
3304 .db 3,2,4,3,2,2,1,1,1,1 ,1,1,21,17,18,20
3305 .db 1,1,1,1,1,1,1,3,6,12,9,1,21,19,18,18
3306 .db -1,-1 ;=%11111111=line
3311 .db $11,$41,%00100001,0,0,0
3312 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3313 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3318 .db $11,$45,%00100101,%10,-7,1
3319 .db 14,12,11,9,10,7,7,5,4,3,4,4,2,3,1,2
3320 .db 1, 1, 1, 1,1, 1,1,1,1,1,1,1,1,1,1,1
3325 .db $19,$3a,%00100111,0,-4,1
3326 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3327 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3333 .db $09,$ff,%00100001,0,0,0
3334 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3335 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3338 ;------------------------------ enemies -------------------------------------
3340 ;format: [000000:HP 00:occ] [HP64] [sprite] [appearance(ypos)]
3341 ; [time2fire] [firefreq] [0] [0]
3343 .db 0,%00100110,(spr_enemy01-spr_enemy00)/2,1,10,10,0,0 ;#1
3344 .db 0,%00101010,(spr_enemy02-spr_enemy00)/2,3,20,20,0,0 ;#2
3345 .db 0,%00001111,(spr_enemy03-spr_enemy00)/2,2,100,5,0,0 ;#3
3347 .db 0,%00000110,(spr_enemy04-spr_enemy00)/2,2,0,0,0,0 ;#4
3348 .db 0,%00000111,(spr_enemy05-spr_enemy00)/2,3,0,0,0,0 ;#5
3349 .db 0,%00001011,(spr_enemy06-spr_enemy00)/2,2,0,0,0,0 ;#6
3351 .db 0,%00011011,(spr_enemy07-spr_enemy00)/2,3,0,0,0,0 ;#7
3353 .db 1,%00110011,(spr_boss0_1-spr_enemy00)/2,1,15,10,0,0 ;boss1
3354 .db 1,%11001011,(spr_boss0_2-spr_enemy00)/2,3,10,8,0,0 ;boss2
3356 .db 0,%00000000,0,0,0,0,0,0
3357 .db 0,%00000000,0,0,0,0,0,0
3358 .db 0,%00000000,0,0,0,0,0,0
3359 .db 0,%00000000,0,0,0,0,0,0
3360 .db 0,%00000000,0,0,0,0,0,0
3361 .db 0,%00000000,0,0,0,0,0,0
3362 .db 0,%00000000,0,0,0,0,0,0
3369 .db %11111111 ; ████████
3370 .db %11111111 ; ████████
3376 .db 6,6 ;enemy type one
3377 .db %00111100 ; ████
3379 .db %11110000 ; ████
3380 .db %11110000 ; ████
3382 .db %00111100 ; ████
3384 .db 8,6 ;enemy type two
3385 .db %00111111 ; █████
3386 .db %01111000 ; ████
3387 .db %11111100 ; ██████
3388 .db %11111100 ; ██████
3389 .db %01111000 ; ████
3390 .db %00111111 ; █████
3392 .db 6,6 ;enemy type three
3393 .db %01111100 ; █████
3394 .db %11110000 ; ████
3395 .db %11111000 ; █████
3396 .db %11111000 ; █████
3397 .db %11110000 ; ████
3398 .db %01111100 ; █████
3400 .db 6,6 ;enemy type four
3402 .db %01111100 ; █████
3403 .db %11111000 ; █████
3404 .db %11111000 ; █████
3405 .db %01111100 ; █████
3408 .db 7,6 ;enemy type five
3409 .db %00011110 ; ████
3410 .db %01111110 ; ██████
3411 .db %11111100 ; ██████
3412 .db %11111100 ; ██████
3413 .db %01111110 ; ██████
3414 .db %00011110 ; ████
3416 .db 7,6 ;enemy type six
3418 .db %01111110 ; ██████
3419 .db %10111000 ; █ ███
3420 .db %10111000 ; █ ███
3421 .db %01111110 ; ██████
3424 .db 8,6 ;enemy type seven
3425 .db %00011110 ; ████
3426 .db %01111111 ; ███████
3427 .db %10011100 ; █ ███
3428 .db %10011100 ; █ ███
3429 .db %01111111 ; ███████
3430 .db %00011110 ; ████
3432 .db 8,6 ;enemy type seven
3433 .db %00011110 ; ████
3434 .db %01111111 ; ███████
3435 .db %10011100 ; █ ███
3436 .db %10011100 ; █ ███
3437 .db %01111111 ; ███████
3438 .db %00011110 ; ████
3441 .db 16,10 ;boss type one :
3442 .db %00000001 ; █████████
3443 .db %00001111 ; ███████████
3444 .db %00111111 ; ██████████
3445 .db %01011111 ; █ ██████
3446 .db %10011111 ; █ █████ █
3447 .db %10011111 ; █ █████ █
3448 .db %01011111 ; █ ██████
3449 .db %00111111 ; ██████████
3450 .db %00001111 ; ███████████
3451 .db %00000001 ; █████████
3464 .db 16,10 ;boss type:one :
3465 .db %11111110 ; ███████
3466 .db %00001111 ; █████ ████
3467 .db %00111111 ; █████████ ██
3468 .db %01001111 ; █ ███████████
3469 .db %10001101 ; █ ██ █ █████
3470 .db %10001101 ; █ ██ █ █████
3471 .db %01001111 ; █ ███████████
3472 .db %00111111 ; █████████ ██
3473 .db %00001111 ; █████ ████
3474 .db %11111110 ; ███████
3487 ;----------------------------------------------------------------------------
3488 ;----------------------------- logo ------------------------------------------
3489 ;----------------------------------------------------------------------------
3492 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
3493 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
3494 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
3495 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
3496 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
3497 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
3498 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
3499 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3500 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3501 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3502 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3503 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3504 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3505 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3506 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3507 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
3508 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
3509 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
3510 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
3512 ;----------------------------- end ------------------------------------------
3518 ;----------------------------------------------------------------------------
3519 ;----------------------------------------------------------------------------
3520 ;----------------------------------------------------------------------------
3522 ; 0.97.625 -- 25.VI.00 -- size 5729
3524 ; # bullets do damage in all levels
3525 ; * more armor at armor-upgrade and extra armor at end of a level
3526 ; - internal levels again (no need 4 external, safer/smaller)
3527 ; # some registers not correctly pushed/popped
3528 ; * several optimizations (init.procs some bytes smaller)
3529 ; # enemies hit with hitpoints left disappeared (one pop too much...)
3530 ; + bullets "charge up" (more damage) when not firing
3531 ; + more powerful bullets have different sprites (larger=more damage)
3532 ; # multiples appear at your position (begin level/just selected)
3533 ; # when invulnerable multiples acted weird
3534 ; # no more error at activation after APD off after running Nemesis
3535 ; # saves correctly if own name ain't "nemesis" + some bytes smaller
3536 ; # screen wasn't always entirely cleared after quit
3537 ; * waits until all keys have been released after death
3538 ; + different bullets sizes will miss if they're too small
3539 ; + at level start "press F1 to save"-text will be displayed
3540 ; * w3.shiar.org displayed at title screen, black bar behind version nr
3541 ; # score to 0 when exit pressed at main menu
3542 ; # no residual story-text in first frame of game
3543 ; # game doesn't continue again after death (stack messed up)
3544 ; # game over when lives<0 (didn't work in v0.96+)
3545 ; * using some self-modifiing code (so it's smaller)
3546 ; # new random procedure: stars don't appear on one line anymore
3547 ; * weapons appear centered at multiples
3548 ; * laser properties can be changed (damage, charge)
3549 ; + weapon can be combination of bullets/lasers (max. of 3 per weapon)
3550 ; * bullet-icon is removed when laser is selected
3551 ; * enemy sprite table integrated in enemy specs (-1 byte/enemy)
3552 ; + random enemy is chosen from any number of enemies per level
3553 ; * time to first enemy fire defined per enemy, not per level
3554 ; + CLIPPED sprites!! no more in/out popping enemies! wow...
3555 ; * bullets/enemies removed when _entirely_ off screen
3556 ; # enemies would sometimes be hit by bullets going right below them
3557 ; # size of the second bullet was too big (invisible hit)
3558 ; * the frequency an enemy fires bullets is defined per enemy
3559 ; + wide clipped sprites implemented (width 1-16 pixels)
3560 ; # bosses first move left until x=100, otherwise they'd be off-screen
3563 ; + added - removed * changed # bug fixed