1 ;------------------------------------------------------------------------------
2 ;---------------------- NEMESIS -----------------------------------------------
3 ;------------------------------------------------------------------------------
4 ; >>> NEMESIS <<< Version 0.96 BETA by SHIAR
5 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8 ; Release Date : 30.X.99
9 ; Filename : nemesis.86p (4836) nemesis0.86p (888)
11 ; Email Address : shiar0@hotmail.com
13 ; Web Page : come.to/shiar
14 ; Description : cool arcade-shoot-em-up-game (release 12/99)
15 ; Where to get this game : www.ticalc.org
16 ; Other games by author : N/A
18 ; ABOUT: This source should only be used for learning practises, do not
19 ; alter it, and certainly do not distribute an altered version!!
20 ; NOTE: &&& marks uncertainties or things to optimize
22 ;---------------------- nemesis.z80 start -------------------------------------
25 #include "ti86asm.inc" ;standard ti86 romcalls
26 #include "ti86abs.inc" ;used to save hiscores and so
30 #define cal call ;just to make it harder for you to understand
31 #define psh push ; ^:D
32 #define dnz djnz ;Dec&Jump while NonZero becomes Do w.Non-Zero
34 TEXT_MEM = _textShadow ;167 bytes ($A7): C0F9-C1A0
35 _clrWindow = $4a86 ;a new procedure from AsmStudio86 inc. files
41 storepos = _asm_exec_ram+6000 ;120 OF 165
42 storepos2 = _asm_exec_ram+6200 ;141 OF 167
44 ;---------------------- in-game vars ------------------------------------------
46 just_fired = storepos+2 ; +2 ;counts how long a blast lasts
47 curline = storepos+2 ; +2 ;used to display SFX
48 menuitem = storepos+2 ; +2 ;used to store menu location
49 hiscorepos = storepos+2 ; +2
50 RanPos = storepos+3 ; +3 ;used for making random values
51 timer = storepos+4 ; +4 ;frame counter
53 x = storepos+5 ; +5 ;your ship's position
54 y = x+1 ; +6 ;your y-pos
55 firex = y+1 ; +7 ;(1 byte)
56 firey = firex+1 ; +8 ;(1 byte)
59 eventtime = storepos+10 ;+10 ;enemy frequency
60 eventleft = eventtime+1 ;+11 ;nr. of enemies still to come
61 nextevent = eventleft+1 ;+12 ;time to next event
62 level_enemy = nextevent+1 ;+13 ;enemy type
63 level_info = level_enemy+1 ;+14 ;info (see below)
64 level_move = level_info+1 ;+15 ;=
65 level_fire = level_move+1 ;+16
68 spacespace = storepos+19 ;+19
69 groundinfo = spacespace+1 ;+20
70 groundpos = groundinfo+1 ;+21 $10
71 ceilingpos = groundpos+16 ;+37 $10
73 stars1 = ceilingpos+16 ;+53
74 stars2 = stars1+1 ;+54
76 starx1 = storepos+55 ;+55
78 starx2 = starx1+(nrstars1*2) ;+69
79 ; ^^ ;--------MULTIPLES
80 mx = starx2+(nrstars2*2) ;+83 ;position of multiple#1
81 my = mx+1 ;+84 ;multiple y-pos
84 your_locpos = m2y+1 ;+87 ;position in your_prevpos tabl
85 your_prevpos = your_locpos+1 ;+88 ;save previous positions (32d)
87 ;^-----------------------------------<1 ;-120=$78
89 enemies = storepos2 ; +0 ;info about each enemy (6byt)
91 nrenemies = 10 ;max. nr of enemies
93 ybullets = enemies+(nrenemies*enemysize) ;60 bytes = 20(state,x,y)
95 ebullets = ybullets+(nrybuls*3) ;+110 ;30 bytes = 10(state,x,y)
98 ybuls = ebullets+(nrebuls*3) ;+140
101 ;^-----------------------------------<2 ;-141=$8D
103 ; [0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
105 ; [HP64] [000000:HP left 00:(00=no enemy 01=exploding 10=normal 11=moving)]
106 ; [ship type or explosion frame] [x] [y] [move] [fire]
108 ;---------------------- introduction ------------------------------------------
110 nop ;hello yas/ase/rascall/whathever
111 jp init ;here's the program, but first: a description
112 .dw $0001 ;description type 2 (description + YASicon)
113 .dw Title ;pointer to description (all shells)
114 .dw Icon ;pointer to YAS icon
116 Title: .db "Nemesis v0.96 by Shiar",0
118 Icon: .db 8,1 ;icon for YAS: width = 1byte; height = 9bytes
121 .db %00111110 ; █████
122 .db %01111001 ; ████ █
123 .db %00111110 ; █████
125 .db %11100000 ; ███ ;recommend 80x50 screen mode
126 .DB 0 ;clear stupid YAS-line
128 ;---------------------- init --------------------------------------------------
130 level_name: .db 8,"nemesis0"
142 init: cal BUSY_OFF ;turns the run-indicator off, obviously
143 cal _clrScrn ;clean the screen
145 ld (iy+13),a ;don't affect TEXT_MEM and don't scroll screen
146 cal _flushallmenus ;remove TI menus
147 ld (_asapvar+1),a ;Asm( thinks it's the first time it runs Nems.
149 FixKeys: ;fixes some key problems like left+down bug
163 ld bc,int_end-int_handler
169 ;---------------------- main menu ---------------------------------------------
172 xor a ;white bitmask (a=0)
173 ld hl,logo_nemesis ;from...
174 ld de,VIDEO_MEM+16 ;...to one line from top
175 ld b,e ;ld b,16: one line
177 ld (de),a ;clear/n byte
179 dnz AboveLogo ;repeat for the first line
181 ld bc,16*19 ;logo size
182 ldir ;display one line of logo
184 ld hl,VIDEO_MEM+(16*$39)+4 ;$39 rows down, 4 cols right (4*8=$20)
185 ld b,8 ;draw 8x one byte = 8*8 = 64 pixels wide
186 ld a,%11111111 ;horizontal line mask
188 ld (hl),a ;draw one piece of the divider-line
189 inc hl ;move right (8 pixels = 1 byte)
190 dnz underline ;repeat
192 set 3,(iy+5) ;set white on black
193 ld hl,$3320 ;near the bottom of the screen
195 ld hl,txt_about ;display version and author (yes, that's me!)
196 cal _vputs ;useful procedure if you want to display somtn
197 res 3,(iy+5) ;return to default black on white
199 ld hl,$3a1e ;below previous stuff
201 ld hl,txt_email ;hey, my e-mail address so SEND ME SOMETHING!!
202 cal _vputs ;VERY important, so display in small font ?:}
239 cal GET_KEY ;wait for keypress
276 ;------------------------------------------------------------------------------
277 ;---------------------- game loop ---------------------------------------------
278 ;------------------------------------------------------------------------------
280 game_main_loop: ;REPEATS FROM HERE EVERY FRAME
281 ld hl,timer ;update time
282 inc (hl) ;increase by 1
283 ld b,(hl) ;new time, save for rand# upd. (no flag change)
284 jr nz,updaterandom ;continue when new time <> 0
285 ld hl,1 ;once every 256 frames, increase score by 1
289 ld hl,RanPos ;random counter
290 ld a,r ;add r register to randomize
291 add a,(hl) ;add previous random value
292 add a,b ;even more random by adding timer
293 ld (hl),a ;save even more random value back
296 ld hl,GRAPH_MEM ;move from (hl) = top left
297 ld (hl),$00 ;first pixel will be copied all over the screen
298 ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
299 ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
304 jr z,movestarsdone ;don't move stars once every 4 frames
306 cal movestars1 ;move the stars on the FRONT layer
307 cal movestars2 ;move the distant stars
310 ld a,(stars1) ;star positions (the missing byte...)
311 ld b,nrstars1 ;how many stars? now we know.
312 ld hl,starx1 ;points to the position of the stars
313 cal DisplayStars ;display front layer stars
315 ld a,(stars2) ;weren't you paying attention five lines ago?
316 ld b,nrstars2 ;that many?! whow!
317 ld hl,starx2 ;and there they are
318 cal DisplayStars ;use the same procedure to display back layer
320 ld a,(level_info) ;level info
321 and %00000110 ;isolate ground&ceiling
322 jr z,game_stuff ;both non-present
323 and %00000010 ;bit representing the presence of any ceiling
324 cal nz,Handle_ceiling ;scroll the ceiling (if any)
325 cal Handle_ground ;scroll the ground
328 ld a,(your_occ) ;are you 100% OK?
330 jr nz,_gamestuff1 ;then don't check for movements/fires/...
332 ld a,(level_info) ;the same level info
333 and %00000110 ;isolate ground&ceiling again
334 jr z,check_keys ;no ceiling nor ground
335 and %00000010 ;this bit will tell us if there is a ceiling
336 cal nz,CheckCeiling ;if there is, check it
337 cal CheckGround ;check for collision with the ground
340 ld a,%10111111 ;function keys (MORE,EXIT,2ND,F1,F2,F3,F4,F5)
341 out (1),a ;ask for them
342 nop \ nop ;delay 8 clocks
346 bit 6,a ;test bit 6 = exit-key = EXIT
347 jp z,game_over_nopop ;<exit> pressed, so be it
348 check_morekey: ;another unused label... poor compiler
349 bit 7,a ;test bit 7 = more-key = PAUSE
350 cal z,Pause ;yes, go to pause
353 bit 5,a ;test bit 5 = 2nd-key = FIRE
354 ld hl,check_selkey ;where to continue after executing Fire_bullet
355 psh hl ;push hl on stack (instead of cal Fire_bullet)
356 jp z,Fire_bullet ;fire smtn (bulletstorplasermultiples+stuff..)
357 pop hl ;no cal to Fire_bullet made, so pop stack
359 ld (just_fired),a ;reset just_fired
362 ld a,%01011111 ;look at first column of keys (ALPHA to STO)
364 nop \ nop ;what's taking you so long
365 in a,(1) ;at last... our precious keyzzz...
367 bit 6,a ;'bout the GRAPH key...
368 cal z,Teacher ;you didn't _press_ it, did you?!?
370 rla ;test bit7 so we know f ALPHA has been pressed
371 cal nc,select ;yeppy, select the currently selected upgrade
373 cal Enemies_hit ;check for collision with enemies
377 cal Handle_Ship ;move you
378 cal Handle_bullets ;move your bullets
379 cal Handle_torp ;move your torpedo
381 cal Handle_enemies ;move enemies
382 cal Enemy_bullets ;move enemy bullets
384 cal Level_event ;insert enemies
385 cal Display_Screen ;display all
388 jp game_main_loop ;LOOP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
395 ret nc ;return if increased 16 times or more already
405 ;--------------------------- ground -------------------------------------------
409 and %111 ;once every 8 frames
410 jr nz,Display_ground ;otherwise skip the scroll
411 ld bc,15 ;scroll all 16 bytes minus one (teh new byte)
412 ld hl,groundpos+1 ;from..
413 ld de,groundpos ;to (one byte to the left)
414 ldir ;LoaDIncreaseRepeat = scroll!
416 ld a,(groundinfo) ;what kind of ground
418 jr z,ground_tunnel ;tunnel effect
435 jr z,ground_previous ;a>=0 (a=0 actually)
448 ld a,(groundpos+14) ;type 1
451 ld a,(groundpos) ;type 0
453 ld (groundpos+15),a ;save new byte on the right
463 ld b,16 ;screen width
464 ld de,groundpos-1 ;height of current byte (previous actually)
466 ld hl,GRAPH_MEM+(56*16)-1 ;screen position
470 ld c,b ;push b for groundloopup
471 pop hl \ inc hl ;get screen position and go one right
472 pop de \ inc de ;get height info and set to the next byte
473 psh de \ psh hl ;save these for the next time
474 ld a,(de) ;height of current byte
477 ld de,16 ;to substract to go one line up
478 ld a,%11111111 ;bitmask black
481 ld (hl),a ;display black byte
482 sbc hl,de ;go up (sbc must be used for 16-bit sub)
483 dnz groundloopup ;and loop >groundpos< times
485 ld b,c ;pop b used by groundloopup
486 dnz groundloopright ;loop right for entire screen (16x)
487 pop hl \ pop hl ;restore stack
490 CheckGround: ;check for collision with the ground
508 ;--------------------------- ceiling ------------------------------------------
512 and %111 ;once every 8 frames
513 jr nz,Display_ceiling ;otherwise skip the scroll
514 ld bc,15 ;scroll all 15 bytes (16th is new position)
515 ld hl,ceilingpos+1 ;from..
516 ld de,ceilingpos ;to (one byte to the left)
517 ld a,(de) ;load byte on left (will be lost after scroll)
518 ldir ;LoaDIncreaseRepeat = scroll!
520 ld a,(groundinfo) ;what kind of ceiling
522 jr z,ceiling_tunnel ;tunnel effect
533 jr z,ceiling_previous
539 jr z,ceiling_previous
547 jr z,ceiling_previous
552 ld a,(ceilingpos+14) ;type 1
555 ld a,(ceilingpos) ;type 0
557 ld (ceilingpos+15),a ;save the new byte
560 jr nc,Display_ceiling
567 ld b,16 ;screen width
568 ld de,ceilingpos-1 ;height of current byte
570 ld hl,GRAPH_MEM-17 ;screen position
574 ld c,b ;push b for groundloopup
575 pop hl \ inc hl ;get screen position and go one right
576 pop de \ inc de ;get height info and set to the next byte
577 psh de \ psh hl ;save these for the next time
578 ld a,(de) ;height of current byte
581 ld de,16 ;to substract to go one line up
582 ld a,%11111111 ;bitmask black
585 ld (hl),a ;display black byte
587 dnz ceilingloopdown ;and loop >groundpos< times
589 ld b,c ;pop b used by groundloopup
590 dnz ceilingloopright ;loop right for entire screen (16x)
591 pop hl \ pop hl ;restore stack
594 CheckCeiling: ;check for collision with the ground
598 srl a ;x/8 (current ceiling-byte)
603 ld de,ceilingpos ;first ceiling-byte
604 add hl,de ;current ceiling-byte
607 cp (hl) ;compare with ceiling
608 ret nc ;carry if ceiling is above you
610 jp damage_you ;otherwise you don't wanna be in that ship
612 ;--------------------------- move stars ---------------------------------------
614 DisplayStars: ;inputs: hl=starx# a=stars# b=nrstars#
621 ret ;let's comment this: returns
650 cp 9 ;(GRAPH_MEM&%00001111)-- = $C9FAand15-1 = $A-1
659 ret ;for stupid people, here's another comment...
661 ;--------------------------- pause --------------------------------------------
664 ld hl,$0200 ;top left
666 ld hl,txt_pressenter ;"Enter to continue"
667 cal _puts ;display message
669 cal _getkey ;enter low-power mode and wait for key
670 cp kEnter ;keypressed = enter?
671 jr nz,pause ;no, wait some more
674 ;--------------------------- teacher ------------------------------------------
677 ld (iy+12),5 ;enable flashing cursor
679 cal _homeup ;top left
681 cal _puts ;display message
684 cal _getkey ;enter low-power mode and wait for key
685 cp kEnter ;enter pressed?
687 cp kGrMenu ;keypressed = graph?
688 jr nz,teacherloop ;no, wait some more
690 ld (iy+12),0 ;disable cursor
704 ;--------------------------- exit ---------------------------------------------
707 im 1 ;release keyfix procedure
708 ld (iy+13),3 ;use textshadow (TEXT_MEM) and scrolling
710 ld hl,GRAPH_MEM ;graph-screen location
713 ld bc,1024-1 ;do it 1024 times = entire screen
716 jp _clrWindow ;as _clrLCD but also clears TEXT_MEM (like the
717 ;_clrScrn) AND also executes _homeup and ret
719 ;--------------------------- display ------------------------------------------
722 ld hl,GRAPH_MEM ;from storage (top left)
723 ld de,VIDEO_MEM ;to screen (top left)
724 ld c,56 ;display height = 64 bytes (minus 8 for bar)
726 ld b,16 ;display width = 16 bytes (16*8bits=256pixels)
728 ld a,(hl) ;copy byte from (hl)
730 cpl ;xor $ff: invert byte (white<=>black)
732 inc hl \ inc de ;next byte
733 dnz displaytloop ;16x hl >> de
735 jr nz,displayloop ;loop 64x
737 ld hl,$396b ;Display Score
738 ld (_penCol),hl ;bottom right of screen
741 _D_HL_DECI: ;------- display 5-digit value -------
742 ld de,savestr+4 ;savenr saves number string
744 ldhld: cal UNPACK_HL ;one digit of hl
745 add a,'0' ;make number
746 ld (de),a ;save into savenr
747 dec de ;point to next digit
748 dnz ldhld ;repeat for all digits
750 ld hl,savestr ;we (the program) saved the value righthere
751 jp _vputs ;the only thing left to do is to display it
753 savestr: ;@here the score will be stored
754 .db "00000",0 ;don't worry, it's just temporary
756 ;------------------------- handle ship ----------------------------------------
763 inc a ;no! next (explosion)frame
764 ld (your_occ),a ;save
766 cp 34 ;last explosion frame?
767 jp c,exploding_you ;not yet: display explosion
768 cp 40 ;delay finished?
769 jp z,You_die ;yes = game over
770 ret ;don't display anything
773 ld a,%01111110 ;get arrow keys
774 out (1),a ;it's cold outside
775 ld hl,y ;instead of nop\nop do something usefull
776 in a,(1) ;come back in
779 xor %11111111 ;inverted a = 0 if arrow-key has been pressed
780 ld a,(your_multiples)
781 jr z,no_adv ;if so, leave the multiples where they are
782 or %100 ;set move bit
784 no_adv: and %11111011 ;reset move bit
786 adv_ok: ld (your_multiples),a
788 ld a,(timer) ;framecounter
789 and %1 ;switches 0<>1 each frame
790 inc a ;a = 1 or 2 (1.5 avg)
791 ld c,a ;c = your_speed
794 rra ;rotate right (put last bit in c)
795 ld b,a ;we need a later
800 cp 50 ;56-6 = bottom of screen
805 rr b ;because we now use b, it's rr instead of rra
808 sub c ;<dec a> doesn't affect c-flag
809 jr c,no_left ;-1 = left side
816 cp 122 ;128-6 = right side
825 sub c ;<dec a> doesn't affect carry-flag
826 jr c,no_up ;-1 = top of screen
827 ld (hl),a ;save new y
830 ld ix,spr_ship01 ;ship sprite
831 ld hl,your_inv ;invulnerable?
832 ld a,(hl) ;load time in a
834 jr z,handle_multiples ;yes so ship = normal (display \ continue)
836 ld a,(timer) ;load frame nr.
837 and %00000111 ;a=0 once every four frames
838 jr nz,not_time ;a<>0 = not time to update counter
839 dec (hl) ;decrease inv-time left
841 and %00000100 ;a switches 0<->1 every 2 frames
842 jr z,handle_multiples ;show normal ship
844 ld ix,spr_ship01i ;don't display ship
847 cal putsprite ;display your ship
849 ld a,(your_multiples) ;do you have multiples
850 ld b,a ;save a for 2nd check
851 and %11 ;no? (last two bits = nr of multiples)
852 ret z ;then don't handle them either
855 ld a,b ;restore a (your_multiples)
856 and %100 ;move the multiples???
857 jr z,mult_adv ;nope, just let them (saves (y) in y, (x) in x)
859 ld hl,your_locpos ;location to save this position
862 and %00001111 ;if a>15 then a=a-16
863 ld (hl),a ;save new a
868 ld hl,your_prevpos ;previous positions
869 add hl,bc ;16 turns ago
873 ld (mx),de ;save multiple position in (mx)
875 ld a,(y) ;load new y-pos
876 ld (hl),a ;save it for 16 turns in the future
878 ld a,(x) ;load new x-pos
879 ld (hl),a ;save that too
883 ld ix,spr_multiple ;sprite of the multiple
884 jp putsprite ;display it + <ret>
887 srl a ;half the framerate
888 dec a ;first frame is 1>inc>srl>dec = 0
906 damage_you: ;damages you B points
907 ld a,(your_inv) ;invulnerability left?
909 ret nz ;return if inv>0
910 ld hl,your_armor ;armor left
911 ld a,(hl) ;load hp in A
912 sub b ;decrease hp by B
913 jp m,no_armor ;<0hp left so explode
914 ld (hl),a ;no, so save decreased hp
915 cal disp_armor ;and display new value
917 ld a,(your_pickup) ;how many pickups do you have?
918 dec a ;is the armor-icon selected
919 ret nz ;return if not
921 psh de \ psh ix ;&&& just2Bsave
922 ld hl,VIDEO_MEM+(16*56)
924 ld ix,spr_icon ;if so, highlight armorIcon again
925 ld de,$1901 ;position
926 cal putwidesprite ;display icon
933 ld a,%01 ;occ %xxxxxx01 = explode
934 ld (your_occ),a ;set to explode
937 ;------------------------- place multiples ------------------------------------
940 ld (mx),de ;set last multiple-position
941 ld hl,your_prevpos ;place all previous positions
942 ld b,16 ;all 16 of them
944 ld (hl),d ;set prev-x to d
946 ld (hl),e ;set prev-y to e
948 dnz place_multiples ;repeat
951 ;------------------------- select upgrade -------------------------------------
954 ld hl,your_pickup ;select pickups
955 ld a,(hl) ;load pickups taken so far
957 ret m ;return if it's 0 (no pickups)
958 jr nz,select2 ;no, carry on
960 ld a,(your_armor) ;load current armor
961 cp 25-6 ;may not become >=25
962 jr c,select1_ ;ok then just add 6
963 ld a,25-6 ;set to maximum (6 will be added below)
965 add a,6 ;add 6 to armor
966 ld (your_armor),a ;change armor
968 ld (your_pickup),a ;reset pickups
969 jp disp_icons ;display and return
972 jr nz,select3 ;no, carry on
973 ld (hl),a ;reset pickups
975 ld (torp_occ),a ;ready torpedoes
976 jp disp_icons ;display 'n return
979 jr nz,select4 ;no, carry on
980 ld (hl),a ;reset pickups
985 jp nc,disp_icons ;>=10
988 jp disp_icons ;display n return
991 jr nz,select5 ;no, carry on again
992 ld (hl),a ;reset pickups
994 ld (your_weapon),a ;ready laser
995 jp disp_icons ;display + return
998 jr nz,select6 ;no, carry on once more
999 ld (hl),a ;reset pickups
1001 ld (your_multiples),a
1004 jp disp_icons ;display, return
1006 ld (hl),0 ;reset pickups
1007 jp disp_icons ;display/return
1009 ;------------------------- fire bullet ----------------------------------------
1013 ld a,(hl) ;just_fired
1014 cp 5 ;already pressed?
1015 ret z ;return when already pressed (=5)
1017 inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
1018 ld a,(your_weapon) ;if you have bullets.....
1021 ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
1024 ld hl,(x) ;yes: first fire from ship position (x)
1025 ld (firex),hl ;set firepos
1026 ld a,(your_multiples) ;any multiples?
1028 jr z,fireany ;then just fire somethin'
1029 cal fireany ;and blast
1030 ld hl,(my) ;then, fire from multiple position (mx)
1033 ld (firex),hl ;set firepos
1034 ;blast again and <ret>
1038 ld a,(your_weapon) ;do you have laser?
1068 ld hl,torp_occ ;torpedo...
1069 ld a,(hl) ;load torpInfo
1070 dec a ;do you have (unused) torpedoes?
1071 ret nz ;nope (a must be 1)
1072 ld (hl),2 ;yes; use torpedo
1073 ld (torp_pos),de ;save torpedo position (in de)
1077 fire_laser: ;yes, fire that laser instead
1078 ld a,(firex) ;a = your x-pos
1081 ld hl,GRAPH_MEM ;save-location
1082 ld a,(firey) ;y-coord
1083 add a,3 ;at middle of your ship (y+3)
1084 ld e,a ;save laser-y in e
1088 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
1089 add a,a ;y*16 (width of screen)
1090 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
1091 inc a ;8 pixels to right (a=even so no overflow)
1096 add a,d ;a = (Y*16+X/8) mod 256 (c set on overflow)
1097 jr nc,_nolc ;jump if no carry = no overflow = a<=255
1098 inc b ;a>255 so increase bc by 256
1099 _nolc: ld c,a ;c = (Y*16+X/8) mod 256
1100 add hl,bc ;bc = Y*16+X/8
1102 ld a,15 ;128/8=16=screen width ** minus one (inc a ^^)
1103 sub d ;minus x-start (d=X/8)
1107 inc hl ;Go to next byte
1110 ; ld a,(just_fired) ;fired for how long
1112 ; ret nz ;then do damage, otherwise quit
1116 ld d,a ;d was divided, so reload the laser-x
1118 check_laserhits: ;de = (x,y)
1122 laserhits: ;Hits with normal enemies
1127 jr z,nolashit ;no hit when enemy_occ <> 2/3
1131 or a ;enemy #0 = pickup
1132 jr z,nolashit ;yes: don't destroy
1137 jp m,nolashit ;no hit when enemy is left of you
1142 jr z,enemy_lashit ;a-e=0 = laser on top line of enemy = hit
1143 jr nc,nolashit ;a-e>0 = enemy above laser = no hit
1144 add a,5 ;add enemy height
1145 jp p,enemy_lashit ;a-e>0 = hit
1151 add hl,bc ;go to next enemy
1153 dnz laserhits ;check all enemies
1156 enemy_lashit: ;&&&before nolashit
1167 jr z,found_ybullet ;0 = no bullet here
1169 dnz find_ybullet ;look next bullet
1170 pop hl ;don't try to fire any other bullets
1174 ld (hl),c ;use the bullet and set correct bullet-type
1175 ld a,(firex) ;your x-pos
1176 add a,5 ;place bullet in front of you
1177 inc hl ;go to bullet-x
1180 ld a,(firey) ;your y-pos
1181 add a,(ix+1) ;place bullet at the middle of your ship
1182 inc hl ;go to bullet-y
1186 ld (weapincs),a ;reset damage
1189 ;------------------------ handle bullets --------------------------------------
1195 cp (hl) ;off screen? (x>128-5)
1198 add a,b ;move b to the right
1199 ld (hl),a ;save new pos.
1239 ld (hl),0 ;dump this bullet!
1249 ld (temp1),hl ;needed for check_bullethits
1254 jp z,next_ybullet ;bulletType=0 >> no bullet
1259 cal bullet_left ;move bullet left
1263 ld hl,XLbullettable ;pointer to first bullet
1264 ld a,(curweapdamage) ;bullet damage=size
1267 inc a ;must be at least 1
1271 jr nz,nextbulletlook
1272 ld a,(hl) ;load pointer offset
1274 ld e,a ;convert to 16bit
1275 ld ix,spr_bullet01 ;first sprite
1276 add ix,de ;add offset (go to correct sprite)
1277 pop de ;position saved
1278 psh de ;but will be altered so save again
1279 cal putsprite ;display bullet
1282 cal check_bullethits
1290 dnz scan_bullets ;next bullet (loop)
1293 ;--------------------------- check bullethits --------------------------------
1295 check_bullethits: ;INPUT: de=X,Y; (temp1)=bullet
1299 hit_enemies: ;Hits with normal enemies
1300 psh bc ;enemy counter
1305 jr z,nohit ;no hit when enemy_occ <> 2/3
1309 or a ;enemy #0 = pickup
1310 jr z,nohit ;yes: don't destroy
1336 ld (0),a ;remove bullet
1346 dnz hit_enemies ;check next enemy
1354 ld a,1 ;damage to inflict
1360 sub b ;decrease HP (if <0 then c is set)
1361 ld (hl),a ;save (no flag-changes)
1362 dec hl ;goto hp64; no change in c
1363 ld a,(hl) ;load; no c-change
1364 sbc a,0 ;if c then decrease a
1365 ld (hl),a ;save back the new value
1366 ret nc ;if a>=0 then return, otherwise explode
1368 inc hl ;goto occ again
1369 ld (hl),%01 ;set to explode
1370 ld a,(pickuptimer) ;counts enemies destroyed
1371 dec a ;enough destroyed for a pickup?
1372 jr nz,pickupdone ;otherwise just explode
1373 ld (hl),%110 ;change it into a pickup (with 2 HP)
1374 ld a,18 ;reset enemies counter (18 hits = next)
1376 ld (pickuptimer),a ;save new enemiescounter value
1378 ld (hl),$00 ;explosionFrame 0
1380 ld hl,1 ;increase score by one
1383 ;--------------------------- handle torpedo ----------------------------------
1388 ret m ;return if occ=0/1
1390 ld hl,torp_pos ;x-position
1391 ld a,(hl) ;load in a
1393 cp 125 ;right edge reached
1394 jr nc,remove_torp ;remove if x>125
1395 ld (hl),a ;save new x
1401 cp 56 ;bottom reached
1402 jr nc,remove_torp ;remove if y>40
1403 ld (hl),a ;save new y
1408 cal putsprite ;display torpedo
1410 jp check_bullethits ;check for hits with enemies
1417 ;--------------------------- level events -------------------------------------
1420 ld hl,nextevent ;time to next event <ld a,(nextevent)
1421 dec (hl) ;decrease counter <dec a
1422 ld a,(hl) ;look at counter <ld (nextevent),a
1423 or a ;has it reached zero?
1424 ret nz ;nope: get outta here!
1426 ld a,(eventtime) ;enemy frequency (lvl)
1427 ld (nextevent),a ;set time to next event
1429 dec (hl) ;update enemy-counter
1431 ld a,(hl) ;look at counter
1432 or a ;has it reached 0?
1433 jp z,Next_level ;yes: level finished
1434 dec a ;has it reached 1?
1435 jr z,standby_event ;yes: wait until no enemies present/left
1436 dec a ;has it reached 2?
1437 jr z,place_boss ;yep: place the BigBossTM!
1438 dec a ;has it reached 3?
1439 jr nz,do_event ;nope: >3 = place an enemy
1440 inc hl ;nextevent located behind eventleft
1441 ld (hl),123 ;set delay
1442 ret ;don't place any more enemies
1445 ld hl,(levelp) ;the leveldata (including the boss)
1446 dec hl ;points to leveldata\boss\enemynr
1448 ld (level_enemy),a ;set new enemy (boss)
1449 dec hl ;points to level\boss\movement
1451 ld (level_move),a ;set boss movement
1452 dec hl ;@level\boss\firefreq
1453 ld a,(hl) ;load in a
1454 ld (level_fire),a ;set firefrequency
1459 ld hl,enemies+1-enemysize
1464 or a ;0 = no enemy present
1475 ld hl,enemies+1-enemysize
1480 cp (hl) ;(hl) = 0 ??
1481 jr nz,chk_noenemy ;jump if enemy present (non-0)
1482 ex de,hl ;de=hl=usable enemy
1485 ld a,(level_enemy) ;enemy type to place (lvl)
1486 ld hl,XLenemyinfos-4 ;enemy "0" specs (1 before enemy #1)
1490 ld b,0 ;bc = enemy nr.&&&XX
1491 add hl,bc ;hl = enemy specs
1492 ld a,(hl) ;load hitpoints+occ of this enemy class
1495 inc hl ;next enemyInfo byte
1497 ld a,(hl) ;load hp64
1498 ld (de),a ;save hp64
1499 inc de ;next byte (or previous): occ again
1501 inc hl ;next enemyInfo byte
1502 inc de ;next byte of current enemy
1503 ld a,(hl) ;load enemy class (nr)
1504 ld (de),a ;save enemy type
1510 ld a,128 ;appear at right edge of screen
1511 sub (ix) ;minus the width of this enemy (not offscreen)
1512 ld (de),a ;= x-position (save)
1515 inc hl ;where to place??
1516 ld a,(hl) ;load placeInfo
1518 jr z,random_enemy ;yes: create random value <51 in a
1520 jr z,lure_enemy ;yes: create a 100% luring enemy
1522 halflure_enemy: ;yes (of course it is): pick one (50% lure)
1523 ld a,(timer) ;look at frame-number
1524 and %00000001 ;make random if odd frame nr.
1525 jr nz,random_enemy ;1st possibility: random enemy
1526 lure_enemy: ;2nd possibility: luring enemy
1527 ld a,(y) ;place at same y-pos as YOUR ship
1531 ld b,e ;b will be added to random-value
1532 cal Random50 ;make a (in a) random value 0-51
1534 ypos_OK: ;random value successfully created
1535 ld (de),a ;save y-position
1538 ld a,1 ;movecounter = 1
1539 ld (de),a ;&&&(hl),1 better?
1543 and %00000001 ;bit meaning directfire
1544 jr nz,ffireOK ;(a=time-to-fire) = 1 frame (fires directly)
1545 ld a,(level_fire) ;set ttf to normal nr of frames
1546 ffireOK:ld (de),a ;save fire
1549 ;--------------------------- enemy fires --------------------------------------
1551 Enemy_fires: ;de = x,y
1561 jr z,found_ebullet ;0 = not used
1562 inc hl \ inc hl \ inc hl
1563 dnz find_ebullet ;look next bullet
1576 ld b,%1011 ;yourY-bulY = negative (=bullet below you)
1579 ld b,%1001 ;yourY-bulY = even more negative (going up)
1584 ld b,%1010 ;bullet going down
1586 jp m,bulletok ;even more going down
1593 ld (hl),a ;set bullet direction
1595 ld (hl),d ;set x-pos
1597 ld (hl),e ;set y-pos
1600 ;----------------------------- enemy bullets ----------------------------------
1608 ld a,(hl) ;load bulletType in a
1609 and %1111 ;select direction-bits
1610 jr nz,enemy_bullet ;non-0: handle bullet
1612 pop hl ;do not move the <pop hl>
1614 inc hl \ inc hl \ inc hl
1619 ld b,a ;save type&%1111
1621 ld a,(hl) ;check if it has reached the left side of scrn
1622 and %11111110 ;it is <2 (0 or 1)?
1623 jr z,remove_ebullet ;yes, remove bullet
1624 dec (hl) ;move one left
1625 dec (hl) ;and another one
1629 ld a,b ;restore type
1630 cp %1100 ;is it a normal bullet? (cp = faster than bit)
1631 jr z,ebullet_common ;type %1100: normal bullet
1632 and %111 ;isolate important bits
1633 jr z,ebullet_down ;type %1000: moving down
1635 jr z,ebullet_up ;type %1001: moving up
1644 jr z,ebullet_down ;type %1010: moving down 50%
1645 ;type %1011: moving up 50%
1662 ld ix,spr_bullete1 ;display enemy bullet
1668 jr nz,next_bullet ;0 = you're normal
1688 pop hl ;points to bullettype again
1689 psh hl ;and save it again (ivm call to damage_you)
1690 ld a,(hl) ;load bullettype
1691 cal _shracc ;isolate damage-bits (%1111???? -> %00001111)
1692 ld b,a ;set damage-amount
1693 cal damage_you ;HIT!!
1695 pop hl ;hl could be destroyed by damage_you
1696 ld (hl),0 ;bullet > unused
1697 jr next_bullet+1 ;next bullet (SKIP THE <POP HL> = one byte)
1699 ;--------------------------- handle enemies -----------------------------------
1703 ld b,nrenemies ;handle all enemies
1711 jr z,next_enemy ;occ "no enemy" 0
1713 jr z,exploding_enemy ;occ "exploding" 1
1714 ld b,a ;b=2 if moving, otherwise b=1
1716 normal_enemy: ;occ "normal" 2 or "moving" 3
1718 ld c,(hl) ;c = enemy type = de
1724 jr c,remove_enemy ;off screen
1725 jr z,remove_enemy ;"
1730 ld a,b ;moving state was stored in b earlier
1732 cal nz,moving_enemy ;2 = moving enemy
1736 ld (hl),d ;store new x
1737 ld a,c ;a = enemy type
1738 or a ;type 0? (pickup)
1739 jr nz,check_enemyfire ;no, a normal enemy; let em fire
1740 ld a,(timer) ;load time
1741 and %1 ;move left once every 2 turns
1742 jr z,firing_done ;don't move now
1743 inc d ;increase x-position (don't move this turn)
1744 inc (hl) ;and save it
1745 jr firing_done ;continue
1749 inc hl ;go to <move>
1750 inc hl ;go to <fire>
1751 dec (hl) ;decrease counter till next blast
1752 ld a,(hl) ;&&&doesn't seem efficient to me
1753 or a ;has it reached zero?
1754 jr nz,firing_done ;finished if not
1756 ld a,(level_fire) ;re-set counter for next blast
1757 ld (hl),a ;save time to fire
1758 inc hl ;next byte = bullettype &&&
1759 psh de ;save registers for firing-use
1760 cal Enemy_fires ;fires bullet
1761 pop de ;restore (destroyed by Enemy_fires)
1763 cal putwidesprite ;display sprite @ix
1775 ld (hl),$0000 ;bye bye enemy
1776 jr next_enemy+1 ;continue AFTER pop hl (already done)
1782 cal explosion_stuff ;display explosion
1787 jr z,remove_enemy ;remove when at last frame
1789 ld (hl),a ;next frame
1792 ;--------------------------- moving enemies -----------------------------------
1797 jr z,movetype_updown ;type 0
1799 jr z,movetype_vslow ;1
1801 jr z,movetype_fast ;2
1803 jr z,movetype_vfast ;3
1805 jr z,movetype_smart ;4
1807 jr z,movetype_lure ;5
1809 jr z,movetype_slowlure ;6
1811 jr z,movetype_stoplure ;7
1813 ; jr z,movetype_fulllure ;8
1833 jr movetype_slowlure
1852 inc hl ;hl =@ <move>
1861 or a ;reset carry flag
1862 dec hl ;reset hl to <y>
1880 pop hl ;restore stack (no ret used)
1881 jp remove_enemy ;remove this enemy (off screen)
1892 or a ;reset carry flag
1895 ld a,(hl);&&&ld a,e ;load current y-position
1898 moveup: dec a ;decrease y-pos (=move up)
1899 ret m ;don't move off the screen (y<0)
1900 dec e ;save new y-pos
1903 inc a ;increase y-pos
1904 cp 55 ;compare with bottom
1905 ret nc ;return if it has passed that line (>40)
1906 inc e ;otherwise save new position
1909 ;--------------------------- check collision ----------------------------------
1912 ld hl,(x) ;e = X, d = Y
1913 ld de,$0707 ;add 7 to both d and e
1916 ld e,l ;e = X+7, d = Y+7
1919 ld b,nrenemies ;check all 20 enemies
1924 jr z,check_next ;2 or 3 = ok
1927 collide_enemy: ;&&& include in Handle_enemy proc
1933 ld a,(hl) ;check x match
1934 sub e ;enemy position minus yours minus 7
1941 ld a,(hl) ;check y match
1942 sub d ;same as with x-check
1952 ld hl,2 ;increase score by 2
1956 ld a,(hl) ;load enemy type
1958 jr nz,collide ;enemy when <>0
1961 ld hl,your_pickup ;your pickups
1966 ld a,1 ;yes: reset to pickup 1
1969 cal disp_icons ;display altered pickupicons
1972 dec hl ;to enemy occ
1973 xor a ;set to 0 = gone
1975 jr check_next ;all done, next..
1978 ld (hl),%01 ;set to explode
1980 ld (hl),0 ;explosionFrame 0
2004 ;--------------------------- story -------------------------------------------
2042 cal storyPage ;do some story
2043 inc hl ;look at next hl
2044 ld a,(hl) ;load in a
2046 inc a ;set z-flag if a = $ff
2047 jr nz,dostory ;otherwise loop
2050 add hl,bc ;set hl to beginning of the level
2051 ld (levelp),hl ;set the level-pointer
2054 ;--------------------------- SFX ---------------------------------------------
2064 DoSFX: ;ins: a=beginLine b=nrOfLines
2069 ld a,(curline) ;get line number
2070 inc a ;go to the next line
2071 ld (curline),a ;update
2080 ld b,h ;save hl for later
2084 add hl,de ;go to ymin
2091 ld a,(curline) ;Calculate how many lines to draw
2097 SFXdisp: ;display this frame on screen
2098 ld a,b ;psh b (a will not be used)
2099 ld bc,16 ;one line (=16 bytes, you'd know by now)
2100 ldir ;display (copy actually)
2101 ld bc,-16 ;go up one line (not on screen)
2102 add hl,bc ;so the same line will be displayed
2104 dnz SFXdisp ;repeat until whole screen is displayed
2115 ;--------------------------- show icon ----------------------------------------
2118 ld (hl),a ;draw one piece of the divider-line
2119 inc hl ;move right (8 pixels = 1 byte)
2120 dnz drawline ;repeat (16bytes * 8pixels =128= screen width)
2124 psh bc \ psh de \ psh hl \ psh ix ;&&&
2126 ld hl,VIDEO_MEM+(16*56);56 rows down = eight rows from bottom
2127 ld (PutWhere),hl ;place icons at bottom of normal screen
2128 ld b,16 ;draw 16x (screen width)
2129 ld a,%11111111 ;horizontal line mask
2130 cal drawline ;draw divider-line
2132 ld b,16*7 ;draw 16x (screen width) 7x (height)
2133 xor a ;blank line mask
2134 cal drawline ;clear scorebar
2138 ld ix,spr_icon01 ;armorIcon
2139 ld de,$1901 ;icon #1
2140 cal putwidesprite ;display icon
2141 cal disp_armor ;display bar
2147 ld ix,spr_icon02 ;torpedoIcon
2149 ld de,$2901 ;icon #2
2150 cal putwidesprite ;display
2152 ld ix,spr_icon03 ;bulletIcon
2153 ld de,$3901 ;icon #3
2154 cal putwidesprite ;display icon
2155 ld hl,$3945 ;position to display bullet-type digit
2156 ld a,(your_weapon) ;digit
2157 dec a ;minus one (1=laser)
2158 ld (_penCol),hl ;set location
2159 add a,'0' ;make digit
2160 cal _vputmap ;display char
2162 ld ix,spr_icon00 ;emptyIcon
2166 ld ix,spr_icon04 ;laserIcon
2168 ld de,$4901 ;icon #4
2171 ld ix,spr_icon00 ;emptyIcon
2172 ld a,(your_multiples)
2177 ld de,$5901 ;icon #5
2180 ld ix,spr_dividerline
2184 ld a,(your_pickup) ;pickups taken
2185 add a,a ;picks*2 (sets z-flag)
2186 jr z,iconsdone ;return if no pickups
2191 ld d,a ;y-pos = picks * $10 + $0a (19,29,39,49,59)
2192 ld e,$01 ;x-pos = bottom (1a01,2a01,3a01,4a01,5a01)
2197 ld hl,GRAPH_MEM ;normal game-screen
2198 ld (PutWhere),hl ;set sprite-position to normal screen
2200 pop ix \ pop hl \ pop de \ pop bc
2204 ld hl,(57*16)+VIDEO_MEM+3
2211 ld a,(your_armor) ;load your armor
2215 srl a ;/8: don't display last 2 bits of a (later)
2216 jr z,noarmorbar ;if a=0 then it would loop 256x so skip it
2217 ld b,a ;loop b=a times
2218 armorbar: ;starting at ($39*16)+VIDEO_MEM
2219 ld (hl),%11111111 ;draw a piece of the bar
2220 inc hl ;next position
2221 dnz armorbar ;loop it b times
2225 and %111 ;display last bits of armor
2226 ret z ;if armor=0 then bit = %00000000 (don't disp)
2228 xor a ;bit = %00000000
2231 rra ;rotates A right and sets bit 7 (c-flag)
2232 dnz armorbarbit ;repeat B times (so if B=6 then a=%11111100)
2233 armorbarready: ; (an if B=3 then a=%11100000)
2234 ld (hl),a ;draw this last byte
2238 ld hl,$3A00 ;display Lives
2239 ld (_penCol),hl ;bottom left
2246 ld a,(your_lives) ;nr of lives in a
2247 add a,'0' ;make digit
2250 jp _vputs ;display on screen +ret
2252 ;--------------------------- proc ---------------------------------------------
2255 cal Random50 ; a = 0..50
2259 add hl,hl ;hl = 1..51 * 2
2260 add hl,hl ;hl = 1..51 * 4
2261 add hl,hl ;hl = 1..51 * 8
2262 add hl,hl ;hl = 1..51 * 16 (left side at random y)
2263 dec hl ;hl = 1..51 * 16 (" at right side of screen)
2265 add hl,de ;position on screen
2270 cp 51 ;y may not be more than 50
2272 and %00111111 ;a = 0..63
2275 add a,13+(50-12) ;a = -13..-1 >=> 0..12 >=> 39..50
2279 ld a,(RanPos) ;a handy random-var.
2280 ld hl,x ;add your x-coord for randomness
2282 inc hl ;add your y-coord for randomness
2284 ld (RanPos),a ;save altered random-var
2285 ret ;RanPos also in #a
2295 find_sprite: ;destroyed: de ix
2297 ld e,(hl) ;e = enemy type
2299 ld hl,XLenemytable ;hl = @sprites offset-table
2300 add hl,de ;points to offset of current enemy offset
2301 ld e,(hl) ;de = @enemy offset
2304 ld ix,XLsprenemies ;first enemy sprite
2305 add ix,de ;add offset for current enemy
2306 add ix,de ;twice (offset stored as offset/2)
2311 ld hl,VIDEO_MEM ;screen location (top left)
2314 ld bc,1024-1 ;do it 1024 times = entire screen
2316 set 3,(iy+5) ;set white on black
2323 jr nz,waitnokeypressed
2326 Decompress: ;hl=source(compressed) de=dest(decompressed)
2361 ;--------------------------- game over / new game / death ---------------------
2363 .db 0,"!<>^",0,0,0,0
2364 .db 0,"xtoje0",0 ;enter..clear
2365 .db " wsnid9",0 ;(-)..custom
2366 .db "zvrmhc8",0 ;dot..del
2367 .db "yuqlgb7x" ;0..xvar
2368 .db 0,"-pkfa6'" ;on..alpha
2369 .db "54321.",0,0 ;F5..more
2375 ld hl,own_name-1 ;find own variable
2376 rst 20h ;cal _ABS_MOV10TOOP1
2377 rst 10h ;cal _FINDSYM
2378 ret c ;not found? who cares...
2381 ld hl,4+storehi_start-_asm_exec_ram
2382 add hl,de ;hl=pointer to data in original prog
2384 cal _SET_ABS_DEST_ADDR
2387 cal _SET_ABS_SRC_ADDR
2388 ld hl,storehi_end-storehi_start
2389 cal _SET_MM_NUM_BYTES
2390 cal _mm_ldir ;save done (cal \ ret)
2394 ld hl,own_name-1 ;find own variable
2395 rst 20h ;cal _ABS_MOV10TOOP1
2396 rst 10h ;cal _FINDSYM
2397 ret c ;not found? who cares...
2400 ld hl,4+storesave_start-_asm_exec_ram
2401 add hl,de ;hl=pointer to data in original prog
2403 cal _SET_ABS_DEST_ADDR
2405 ld hl,storesave_start
2406 cal _SET_ABS_SRC_ADDR
2407 ld hl,storesave_end-storesave_start
2408 cal _SET_MM_NUM_BYTES
2409 cal _mm_ldir ;save done (cal \ ret)
2413 pop hl ;=ret (game_over was called from a procedure)
2415 cal BLACKLCD ;clear screen
2416 cal waitnokeypressed
2418 ld (_curRow),hl ;center
2420 cal _puts ;display "GAME OVER"
2470 cal waitnokeypressed
2501 xor a ;clear a (Ahl will be displayed)
2502 ld hl,$1006 ;bottom-1 right
2503 ld (_curRow),hl ;set
2504 ld hl,(score) ;your score
2505 cal _dispahl ;display it (a=0)
2507 ld hl,$314b ;bottom-1 right before score ^^
2508 ld (_penCol),hl ;set
2509 ld hl,txt_score ;"Score"
2510 cal _vputs ;display (small)
2512 ld hl,$1007 ;bottom right
2513 ld (_curRow),hl ;set
2514 ld hl,(hiscore) ;hi-score
2515 cal _dispahl ;display
2516 ld hl,$3946 ;bottom right before hiscore ^^
2517 ld (_penCol),hl ;set
2518 ld hl,txt_hiscore ;"Hiscore"
2519 cal _vputs ;display (small)
2524 ld hl,VIDEO_MEM+(49*16)-1
2530 cal _getkey ;wait for keypress
2531 jp quit ;restore some things and return to TI-OS/shell
2535 ld (score),a ;reset score
2536 ld (score+1),a ;reset score (0)
2537 ld (torp_occ),a ;no torpedoes
2538 ld (your_weapon),a ;no laser
2539 ld (your_pickup),a ;reset pickups
2540 ld (your_multiples),a ;no multiples
2542 ld (level),a ;reset level nr (#1)
2543 ld hl,XLlevelsdata ;set level pointer to level#1
2544 ld (levelp),hl ;reset level pointer
2546 ld (your_weapon),a ;default weapon
2548 ld (your_lives),a ;3 lives (4 will be decreased @ You_die)
2549 ld (pickuptimer),a ;next pickup after 4 enemies destroyed
2553 ld (your_armor),a ;12 HPs/shields
2554 ld a,(your_lives) ;load lives left
2555 dec a ;decrease lives
2556 ld (your_lives),a ;if lives=0ffh GO
2560 ;--------------------------- next level ---------------------------------------
2563 ld a,(your_armor) ;load current armor
2564 cp 25-8 ;may not become >=25
2565 jr c,addok ;ok then just add 8
2566 ld a,25-8 ;set to maximum (8 will be added below)
2568 add a,8 ;add 8 to armor
2569 ld (your_armor),a ;change armor
2571 ld hl,level ;level number
2578 ld h,0 ;increase score....
2579 ld l,a ;by level number * 4
2582 cal scoreInc ;update score
2584 ld hl,(levelp) ;level pointer
2585 ld bc,5+32+4+4 ;advance one level
2586 add hl,bc ;update to point to next level
2587 ld (levelp),hl ;save
2591 ld (nextevent),a ;time to first enemy appearance
2593 ld hl,(levelp) ;level pointer
2598 ld a,(hl) ;load new level-enemy type
2599 ld (level_enemy),a ;set level-enemy
2601 ld a,(hl) ;load new appearance-time
2602 ld (eventtime),a ;set
2604 ld a,(hl) ;load nr of enemies in this level
2605 ld (eventleft),a ;set nr of events left
2610 ld a,(hl) ;movement of enemies in this level
2611 ld (level_move),a ;do it
2613 ld a,(hl) ;how frequent the enemies fire a bullet
2614 ld (level_fire),a ;consider it done
2631 ld (timer),a ;reset time
2632 ld hl,your_occ ;hl = your_occ
2633 ld (hl),a ;reset your ship (not exploding)
2634 inc hl ;hl = your_inv
2635 ld (hl),25 ;set 25*4=100 frames invulnerable
2636 ld hl,x ;begin position x=...
2637 ld (hl),a ;...=a=0=left
2639 ld a,24 ;...=24=middle
2644 jr z,torpsclear ;then just continue (=0)
2645 ld a,1 ;if so, set to "ready to fire" (=1)
2648 ld de,$0018 ;x=0, y=24 (like you..)
2649 ; cal Place_multiples ;place all multiple-positions at (0,24)
2651 ld hl,enemies ;remove all enemies and bullets
2652 ld (hl),0 ;clear first byte
2653 ld de,enemies+1 ;copy this to the next byte
2654 ld bc,(nrenemies*enemysize)+((nrybuls+nrebuls)*3)-1
2655 ldir ;clear enemies + bullets (y/e)
2657 ;--------------------------- setup game ---------------------------------------
2662 ld (_curRow),hl ;center
2664 cal _puts ;display "LEVEL "
2675 cal _putc ;display second digit
2677 cal _putmap ;display first digit
2680 ld (_curRow),hl ;display lives left below level nr
2681 ld hl,txt_lives ;bar text: "Lx0"...
2682 ld a,(your_lives) ;lives left
2683 add a,'0' ;make value
2684 ld (txt_lives+3),a ;add to text
2685 cal _puts ;display the string
2686 res 3,(iy+5) ;set white on black
2688 cal _getkey ;wait for keypress
2692 cal _clrLCD ;clear screen
2693 jp disp_icons ;display bottom icons +ret
2696 cal Random5016 ;a = (0..50)*16 = random y-pos
2697 ld a,b ;a = b = star nr. = 1..7
2698 add a,a ;a = 2b = 2..14
2700 ld e,a ;de = a = 2-14
2701 add hl,de ;add to random y => random pos anywhere
2703 ld (ix),l ;save x-pos (l)
2704 ld (ix+1),h ;save y-pos (h)
2705 inc ix \ inc ix ;next star
2706 dnz placestars ;repeat for all stars
2719 ld (weapdamage),a ;damage of bullets
2722 ; ld (weapdaminc),a ;damage increase
2725 ;--------------------------- putsprite ----------------------------------------
2726 ;--------------------------- de =(X,Y) ----------------------------------------
2729 .db $80,$40,$20,$10,8,4,2,1
2732 and %00000111 ;a = X mod 8 = bit nr. to mask
2733 ld hl,offsets_table ;pixel mask table
2736 add hl,bc ;add to table
2737 ld a,(hl) ;a = pixel mask
2738 ld (_smc1+1),a ;alter pixel mask
2740 ld hl,GRAPH_MEM ;save-location
2745 rl b ;b (=0) =b*2+overflow (if y>32 then bc=bc+256)
2746 add a,a ;y*16 (width of screen)
2747 rl b ;b=b*2+overflow (if y>64 then bc=bc+512)
2750 srl d ;d/8 (8 bits in byte) ** c is set when overflow
2751 add a,d ;a = (Y*16+X/8) mod 256
2752 jr nc,_n1 ;jump if no carry = no overflow = a<=255
2753 inc b ;a>255 so increase bc by 256
2754 _n1: ld c,a ;c = (Y*16+X/8) mod 256
2755 add hl,bc ;bc = Y*16+X/8
2759 _oloop: psh bc ;Save # of rows
2760 psh hl ;Save screen address
2762 ld c,(ix+2) ;Load one line of image
2764 _smc1: ld a,1 ;Load pixel mask
2765 _iloop: sla c ;Test leftmost pixel
2766 jr nc,_noplot ;See if a plot is needed
2767 ld e,a ;OR pixel with screen
2772 jr nc,_notedge ;Test if edge of byte reached
2773 inc hl ;Go to next byte
2776 pop hl ;Restore address
2777 ld bc,16 ;Go to next line
2779 pop bc ;Restore data
2781 ret ;<jp>s are used instead of <jr> = faster
2783 ;--------------------------- putbigsprite -------------------------------------
2816 woloop: psh bc ;Save # of rows
2817 psh hl ;Save screen address
2819 ld c,(ix+2) ;Load one line of image
2821 wsmc1: ld a,1 ;Load pixel mask
2822 wiloop: sla c ;Test leftmost pixel
2823 jr nc,wnoplot ;See if a plot is needed
2824 ld e,a ;OR pixel with screen
2830 jr nc,wnotedge ;Test if edge of byte reached
2831 inc hl ;Go to next byte
2837 pop hl ;Restore address
2838 ld bc,16 ;Go to next line
2840 pop bc ;Restore data
2855 ;------------------------------------------------------------------------------
2856 ;------------------------------- sprites --------------------------------------
2857 ;------------------------------------------------------------------------------
2860 .db 7,7 ;ship alpha class
2861 .db %01111000 ; ████
2863 .db %01111100 ; █████
2864 .db %11110010 ; ████ █
2865 .db %01111100 ; █████
2867 .db %01111000 ; ████
2869 .db 7,7 ;ship alpha class
2872 .db %01010100 ; █ █ █
2873 .db %10100010 ; █ █ █
2874 .db %01010100 ; █ █ █
2879 ; .db 7,7 ;ship beta class
2880 ; .db %11100000 ; ███
2881 ; .db %11110000 ; ████
2882 ; .db %01111100 ; █████
2883 ; .db %01110010 ; ███ █
2884 ; .db %01111100 ; █████
2885 ; .db %11110000 ; ████
2886 ; .db %11100000 ; ███
2888 ; .db 7,7 ;ship beta class
2890 ; .db %10100000 ; █ █
2891 ; .db %01010100 ; █ █ █
2892 ; .db %00100010 ; █ █
2893 ; .db %01010100 ; █ █ █
2894 ; .db %10100000 ; █ █
2899 .db %01111000 ; ████
2900 .db %11111100 ; ██████
2901 .db %11111100 ; ██████
2902 .db %01111000 ; ████
2905 .db 5,3 ;your bullets
2906 .db %00110000 ; ░▒▓█▒
2907 .db %11111000 ; ░▒▓████▒
2908 .db %00110000 ; ░▒▓█▒
2911 .db %11110000 ; ░▒▓███▒
2912 .db %11111000 ; ░▒▓████▒
2913 .db %11110000 ; ░▒▓███▒
2917 .db %11110000 ; ████
2921 .db 4,3 ;enemy bullets
2922 .db %01100000 ; ▒█▓▒░
2923 .db %11110000 ; ▒███▓▒░
2924 .db %01100000 ; ▒█▓▒░
2926 ;---------------------------------------- explosion -------------------------------------------
2932 .db %00111110 ; █████
2933 .db %01010110 ; █ █ ██
2939 .db %01001110 ; █ ▒███
2940 .db %10111110 ; █ █████
2941 .db %01001111 ; █ ▒████
2943 .db %00011010 ; ██ █
2946 .db %10110000 ; █ ██
2947 .db %01001110 ; █ ███
2948 .db %10110101 ; █ ██▒█▒█
2949 .db %01000101 ; █ ▒█▒█
2950 .db %00111110 ; █████
2951 .db %01011010 ; █ ██ █
2954 .db %00101010 ; ▒ █▒█ █
2955 .db %01000110 ; █ ▒██
2956 .db %10110101 ; █ ██ █ █
2957 .db %01100110 ; ██ ██▒
2958 .db %00111100 ; ████▒
2959 .db %01011001 ; █ ██ ▒█
2962 .db %01000000 ; █▒ ▒ ▒
2963 .db %00100101 ; ▒█ █▒█
2964 .db %00010100 ; ▒ ▒█ █ ▒
2965 .db %01000100 ; █▒ █
2966 .db %00010010 ; ▒█▒▒█
2967 .db %10011010 ; █▒ ██ █▒
2971 .db %00100000 ; ▒█ ▒ ▒
2972 .db %00000001 ; ▒ ▒ █
2974 .db %00100010 ; █▒ █
2975 .db %01001000 ; ▒█ ▒█ ▒
2978 .db %00001000 ; ▒ █▒
2979 .db %11000010 ; ██ ▒ █
2981 .db %00100000 ; ▒█ ▒
2982 .db %00000001 ; ▒ ▒█
2983 .db %00110000 ; ▒██▒
2987 .db %00000000 ; ▒▒ ▒
2991 .db %00100100 ; █▒ █
3002 ;--------------------------------------- bar -----------------------------------
3005 .db 16,7 ;selected .......:
3006 .db %11111111 ; ████████
3012 .db %11111111 ; ████████
3014 .db 16,7 ;selected .......:.......:
3015 .db %11111111,%11111111 ; ████████████████
3016 .db %11000000,%00000001 ; ██ █
3017 .db %11000000,%00000001 ; ██ █
3018 .db %11000000,%00000001 ; ██ █
3019 .db %11000000,%00000001 ; ██ █
3020 .db %11000000,%00000001 ; ██ █
3021 .db %11111111,%11111111 ; ████████████████
3023 .db 16,7 ;unused .......:.......:
3024 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3025 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3026 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3027 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3028 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3029 .db %11010101,%01010101 ; ██ █ █ █ █ █ █ █
3030 .db %10101010,%10101010 ; █ █ █ █ █ █ █ █
3032 .db 16,7 ;armor ; .......:.......:
3033 .db %10000111,%11110000 ; █ ███████
3034 .db %10011000,%00001100 ; █ ██ ██
3035 .db %10110011,%11000110 ; █ ██ ████ ██
3036 .db %10110000,%11110110 ; █ ██ ████ ██
3037 .db %10110011,%11000110 ; █ ██ ████ ██
3038 .db %10011000,%00001100 ; █ ██ ██
3039 .db %10000111,%11110000 ; █ ███████
3041 .db 16,7 ;torpedo .......:.......:
3042 .db %10111000,%00010101 ; █ ███ █ █ █
3043 .db %10011100,%00010101 ; █ ███ █ █ █
3044 .db %10111000,%01001010 ; █ ███ █ █ █
3045 .db %10000000,%11101010 ; █ ███ █ █
3046 .db %11100001,%11100101 ; ███ ████ █ █
3047 .db %10011000,%11110101 ; █ ██ ████ █ █
3048 .db %11100110,%00110010 ; ███ ██ ██ █
3050 .db 16,7 ;bullets .......:.......:
3051 .db %10000000,%11000000 ; █ ██
3052 .db %10000011,%11100000 ; █ █████ ▒▒▒
3053 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3054 .db %11111100,%00000000 ; ██████ ▒▒▒
3055 .db %10011000,%11000000 ; █ ██ ██ ▒▒▒
3056 .db %10000011,%11100000 ; █ █████ ▒▒▒
3057 .db %10000000,%11000000 ; █ ██
3059 .db 16,7 ;laser .......:.......:
3060 .db %10000000,%00000000 ; █
3061 .db %10110010,%10000000 ; █ ██ █ █
3062 .db %10111011,%00000000 ; █ ███ ██
3063 .db %10011101,%11111111 ; █ ███ █████████
3064 .db %10111011,%00000000 ; █ ███ ██
3065 .db %10110010,%10000000 ; █ ██ █ █
3066 .db %10000000,%00000000 ; █
3068 .db 16,7 ;multiple .......:.......:
3069 .db %10000011,%10000000 ; █ ███
3070 .db %10000001,%11100110 ; █ ████ ██
3071 .db %10000001,%11100000 ; █ ████
3072 .db %10000011,%10000000 ; █ ███
3073 .db %10011000,%00000000 ; █ ██
3074 .db %10111100,%11000011 ; █ ████ ██ ██
3075 .db %10011000,%00000000 ; █ ██
3078 .db 128,128,128,128,128,128,128 ;128 = %10000000
3080 ;-------------------------- weapondata ----------------------------------------
3082 ;format:[unused] [ybuls(max.bullets)] [0000:direction 0000:speed] [offset]
3084 .db 2,1,%00000010,2,%00000000,0,%00000000,0 ;single fire
3085 .db 2,1,%00000011,2,%00000000,0,%00000000,0 ;fast single
3086 .db 16,2,%00000010,0,%00000010,5,%00000000,0 ;double
3087 .db 16,1,%00010010,2,%00110010,2,%01000010,2 ;triple
3088 .db 16,1,%00010011,2,%00110011,2,%01000011,2
3089 .db 16,1,%00010011,2,%00110011,2,%01000100,2
3090 .db 16,1,%00010100,2,%00110100,2,%01000101,2
3091 .db 16,1,%00010100,2,%00110100,2,%01000101,2
3093 ;---------------------------- texts -------------------------------------------
3095 txt_about: .db " v0.96.A30",127,"by Shiar",0
3096 txt_email: .db "shiar0@hotmail.com",0
3097 txt_menu1: .db "NEW GAME",0
3098 txt_menu2: .db "CONTINUE",0
3100 txt_level: .db "LEVEL ",0
3101 txt_gameover: .db "GAME OVER!",0
3102 txt_score: .db "Score",0
3103 txt_hiscore: .db "Hiscore",0
3104 txt_lives: .db "Lx0?",0
3106 txt_pressenter: .db "Enter to continue",0
3107 txt_teacher: .db "(2",Lpi,"*.95)/sin 13",0
3108 txt_teacherans: .db Lneg,"14.2063168184",0
3110 ;---------------------------- save data ---------------------------------------
3112 PutWhere .dw GRAPH_MEM ;where to put the wide sprites
3117 hiname .db "Shiar.97",0
3121 level .db $01 ;level number
3122 levelp .dw XLlevelsdata ;pointer to level data
3123 pickuptimer .db $04 ;counts when to place a pickup
3127 your_occ .db $00 ;0=normal 1..16=exploding
3128 your_inv .db $00 ;invincibility left
3129 your_armor .db $0a ;HP left
3130 your_lives .db $03 ;
3132 your_weapon .db $02 ;weapon: 0=no, 1=laser, 2+=bullet n+1
3133 your_multiples .db $00 ;multiples present
3134 torp_occ .db $00 ;torp.state: 0=unavail 1=avail 2=presnt
3135 torp_pos .dw $0000 ;torpedo position (x,y)
3139 ;XLlevelsdata:----------------------------------------------------------------
3143 .db $21,$1d,"Cosmic year 6716" ,0,0,$1d,$06
3144 .db $1b,$1d,"storyline coming soon..." ,0,0,$1d,$06
3145 .db $09,$19,"the Nemesis saga continues",0,1
3146 .db $2e,$21,"with NEMESIS 86" ,0,1
3147 .db $52,$36,"by Shiar" ,0,0,$19,$23
3150 ;format:[enemy nr] [enemy frequency] [next lvl]
3151 ; [level_info: 0000:damage 0:directfire 0:ground 0:ceiling 0:diagfire]
3152 ; [level_move] [level_fire] [tunnel size] [groundtype] [16_ground]
3153 ; [16_ceiling] [stars1] [stars2]
3155 .db $15,$07,$08 ;fireFreq; moveType; enemyType
3156 level01: ;efrequency must be odd if halfluring!
3157 .db $01,$1b,$2f,%00010001,0,255,0,0 ;0f>>2f ; 7
3158 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3159 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;16
3164 .db $01,01,"And the storyline conti",
3166 .db $01,09,"You decide to fly close",
3168 .db $01,15,"surface of a nearby pl",
3169 .db "anet =)",0,0,1,20
3174 .db $02,$13,$4b,%00100101,0,064,0,0
3175 .db 1,2,3,4,5,6,6,5,4,3,4,5,4,3,2,1
3176 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3181 .db $01,01,"Blablabla...",0,1
3182 .db $01,34,"this storyline sux",0,0,1,39
3187 .db $03,$2d,$3f,%00010110,0,255,-9,1
3188 .db 3,2,4,3,2,2,1,1,1,1 ,1,1,21,17,18,20
3189 .db 1,1,1,1,1,1,1,3,6,12,9,1,21,19,18,18
3194 .db $04,$11,$41,%00100001,0,057,0,0
3195 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3196 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3200 .db $05,$11,$45,%00100101,%10,031,-7,1
3201 .db 14,12,11,9,10,7,7,5,4,3,4,4,2,3,1,2
3202 .db 1, 1, 1, 1,1, 1,1,1,1,1,1,1,1,1,1,1
3206 .db $06,$19,$3a,%00100111,0,255,-4,1
3207 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3208 .db 20,22,18,15,9,1,1,1,1,1,1,1,1,1,1,1
3213 .db $07,$09,$ff,%00100001,0,043,0,0
3214 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3215 .db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3218 ;XLenemytable:----------------------------------------------------------------
3220 .db (spr_bullet01-spr_bullet01)
3221 .db (spr_bullet01-spr_bullet01)
3222 .db (spr_bullet01-spr_bullet01)
3223 .db (spr_bullet01-spr_bullet01)
3224 .db (spr_bullet01-spr_bullet01)
3225 .db (spr_bullet01-spr_bullet01)
3226 .db (spr_bullet02-spr_bullet01)
3227 .db (spr_bullet02-spr_bullet01)
3228 .db (spr_bullet02-spr_bullet01)
3229 .db (spr_bullet02-spr_bullet01)
3230 .db (spr_bullet02-spr_bullet01)
3231 .db (spr_bullet02-spr_bullet01)
3232 .db (spr_bullet02-spr_bullet01)
3233 .db (spr_bullet02-spr_bullet01)
3234 .db (spr_bullet02-spr_bullet01)
3235 .db (spr_bullet02-spr_bullet01)
3236 .db (spr_bullet02-spr_bullet01)
3237 .db (spr_bullet02-spr_bullet01)
3238 .db (spr_bullet02-spr_bullet01)
3239 .db (spr_bullet02-spr_bullet01)
3240 .db (spr_bullet02-spr_bullet01)
3244 .db (spr_enemy01-spr_enemy00)/2 ;01
3245 .db (spr_enemy02-spr_enemy00)/2 ;02
3246 .db (spr_enemy03-spr_enemy00)/2 ;03
3247 .db (spr_enemy04-spr_enemy00)/2 ;04
3248 .db (spr_enemy05-spr_enemy00)/2 ;05
3249 .db (spr_enemy06-spr_enemy00)/2 ;06
3250 .db (spr_enemy07-spr_enemy00)/2 ;07
3251 .db (spr_boss01 -spr_enemy00)/2 ;08
3252 .db (spr_boss02 -spr_enemy00)/2 ;09
3253 .db (spr_enemy08-spr_enemy00)/2 ;0A
3254 .db (spr_enemy00-spr_enemy00)/2 ;0B
3255 .db (spr_enemy00-spr_enemy00)/2 ;0C
3256 .db (spr_enemy00-spr_enemy00)/2 ;0D
3257 .db (spr_enemy00-spr_enemy00)/2 ;0E
3258 .db (spr_enemy00-spr_enemy00)/2 ;0F
3260 ;XLenemyinfos:----------------------------------------------------------------
3263 ;format: [000000:HP 00:occ] [HP64] [appearance(ypos)] [unused]
3265 .db %00100110,0,1,1 ;#1 HP:1 app:random
3266 .db %00101010,0,2,3 ;#2 HP:1 app:halflure
3267 .db %00001111,0,3,2 ;#3 HP:1 app:lure
3269 .db %00000110,0,4,2 ;#4 HP:2 app:lure
3270 .db %00000111,0,5,3 ;#5 HP:2 app:random moving
3271 .db %00001011,0,6,2 ;#6 HP:3 app:lure moving
3273 .db %00011011,0,7,3 ;#7 HP:7 app:halflure moving
3275 .db %00110011,1,8,1 ;boss1
3276 .db %00111011,0,9,3 ;boss2
3286 ;XLsprenemies:----------------------------------------------------------------
3294 .db %11111111 ; ████████
3295 .db %11111111 ; ████████
3301 .db 6,6 ;enemy type one
3302 .db %00111100 ; ████
3304 .db %11110000 ; ████
3305 .db %11110000 ; ████
3307 .db %00111100 ; ████
3309 .db 8,6 ;enemy type two
3310 .db %00111111 ; █████
3311 .db %01111000 ; ████
3312 .db %11111100 ; ██████
3313 .db %11111100 ; ██████
3314 .db %01111000 ; ████
3315 .db %00111111 ; █████
3317 .db 6,6 ;enemy type three
3318 .db %01111100 ; █████
3319 .db %11110000 ; ████
3320 .db %11111000 ; █████
3321 .db %11111000 ; █████
3322 .db %11110000 ; ████
3323 .db %01111100 ; █████
3325 .db 6,6 ;enemy type four
3327 .db %01111100 ; █████
3328 .db %11111000 ; █████
3329 .db %11111000 ; █████
3330 .db %01111100 ; █████
3333 .db 7,6 ;enemy type five
3334 .db %00011110 ; ████
3335 .db %01111110 ; ██████
3336 .db %11111100 ; ██████
3337 .db %11111100 ; ██████
3338 .db %01111110 ; ██████
3339 .db %00011110 ; ████
3341 .db 7,6 ;enemy type six
3343 .db %01111110 ; ██████
3344 .db %10111000 ; █ ███
3345 .db %10111000 ; █ ███
3346 .db %01111110 ; ██████
3349 .db 8,6 ;enemy type seven
3350 .db %00011110 ; ████
3351 .db %01111111 ; ███████
3352 .db %10011100 ; █ ███
3353 .db %10011100 ; █ ███
3354 .db %01111111 ; ███████
3355 .db %00011110 ; ████
3358 .db 16,10 ;boss type one
3359 .db %00000001,%11111111 ; █████████
3360 .db %00001111,%11111110 ; ███████████
3361 .db %00111111,%11110000 ; ██████████
3362 .db %01011111,%10000000 ; █ ██████
3363 .db %10011111,%01000000 ; █ █████ █
3364 .db %10011111,%01000000 ; █ █████ █
3365 .db %01011111,%10000000 ; █ ██████
3366 .db %00111111,%11110000 ; ██████████
3367 .db %00001111,%11111110 ; ███████████
3368 .db %00000001,%11111111 ; █████████
3370 .db 16,10 ;boss type:one :
3371 .db %11111110,%00000000 ; ███████
3372 .db %00001111,%10001111 ; █████ ████
3373 .db %00111111,%11100011 ; █████████ ██
3374 .db %01001111,%11111110 ; █ ███████████
3375 .db %10001101,%01111100 ; █ ██ █ █████
3376 .db %10001101,%01111100 ; █ ██ █ █████
3377 .db %01001111,%11111110 ; █ ███████████
3378 .db %00111111,%11100011 ; █████████ ██
3379 .db %00001111,%10001111 ; █████ ████
3380 .db %11111110,%00000000 ; ███████
3384 .db 8,6 ;enemy type eight
3385 .db %00011110 ; ████
3386 .db %01111111 ; ███████
3387 .db %10011100 ; █ ███
3388 .db %10011100 ; █ ███
3389 .db %01111111 ; ███████
3390 .db %00011110 ; ████
3392 ;-----------------------------------------------------------------------------
3393 ;----------------------------- logo -------------------------------------------
3396 .db %11111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00001011,%11111111,%11111111,%11111111,%11111000
3397 .db %01111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00011011,%11111111,%11111111,%11111111,%11110000
3398 .db %00111111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%00111011,%11111111,%11111111,%11111111,%11100000
3399 .db %00011111,%11111111,%11111111,%11111110,%11111111,%11110111,%11111111,%11111110,%11111111,%111101111,%11111111,%01111011,%11111111,%11111111,%11111111,%11000000
3400 .db %00000000,%00000000,%00000001,%00011110,%00010000,%00000000,%10000001,%00011110,%00010000,%000000001,%00000000,%00001000,%01000000,%00000000,%00000000,%00000000
3401 .db %00000000,%00000000,%00000011,%00011110,%00110000,%00000001,%10000011,%00011110,%00110000,%000000011,%00000000,%00011000,%11000000,%00000000,%00000000,%00000000
3402 .db %00000000,%00000000,%00000111,%00011110,%01110000,%00000011,%10000111,%00011110,%01110000,%000000111,%00000000,%00111001,%11000000,%00000000,%00000000,%00000000
3403 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3404 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3405 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3406 .db %00000000,%00000000,%00001111,%00011110,%11111111,%00000111,%10001111,%00011110,%11111111,%000001111,%11111111,%01111011,%11111111,%11000000,%00000000,%00000000
3407 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3408 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3409 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3410 .db %00000000,%00000000,%00001111,%00011110,%11110000,%00000111,%10001111,%00011110,%11110000,%000000000,%00001111,%01111000,%00000011,%11000000,%00000000,%00000000
3411 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000111,%11010001
3412 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00011011
3413 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010101
3414 .db %00000000,%00000000,%00001111,%00011110,%11111111,%11110111,%10001111,%00011110,%11111111,%111101111,%11111111,%01111011,%11111111,%11000000,%00000001,%00010001
3416 ;----------------------------- end --------------------------------------------
3422 ;------------------------------------------------------------------------------
3424 ; 0.95.A22 -- 22.X.99 -- size 5321
3426 ; * total size of enemy-sprites can now be 510 bytes (space = doubled!)
3427 ; # bullets hit enemies correctly that aren't 6x6; even the 16x10 bosses!
3428 ; * at g/o or nextlevel checks for keys released instead of waiting abit
3429 ; + name stored with hiscore (max. 8 chars, Shiar.95 by default)
3430 ; + when entering hi-name DEL goes back one char (with check 4 no chars)
3431 ; # program is reloaded at start so some score-bugs solved! (_asapvar=0)
3432 ; * at death, upgrades and pickups AREN'T removed! (just armor=0)
3433 ; # bullet is not displayed after being removed anymore
3434 ; # armor-icon stays hilighted when armor is decreased
3435 ; * when stars move off screen, they are placed at a NEW y-pos!
3436 ; * the starting x-positions of stars are not random, so the stars are
3437 ; spread all over screen. y is still random and changes during game
3438 ; * make_random functions smaller and used by different procs
3439 ; # MAJOR BUG! a "random" value was placed somewhere in mem thus
3440 ; creating bugs like unexplained loss of armor and stuff! (I think)
3442 ; 0.96.A31 -- 31.X.99 -- size 4836 + 888
3444 ; # if you were hit when armor-icon selected, prog did weird stuff
3445 ; + armor-bar (shows armor as a black line left at bottom)
3446 ; # bugs involving armor-bar changing armor to a wrong value
3447 ; # YES!!! the saving-bugs were caused by mmldir: it reset all data
3448 ; at mem $8000, so data is now stored at asmexecram+6000 instead!
3449 ; * external levels. All leveldata is loaded from "nemesis0"-var
3450 ; * some optimization (like cal\ret>jp + unused code removed/shortened)
3451 ; * storyline is loaded from level-file (will be compressed later..)
3452 ; + story can be _between_ levels, not only at the start of a new game
3453 ; * "new game" and "continue" in main menu are swapped (new comes 1st)
3454 ; * enemy bullets can do more than one damage: differs per level
3455 ; * collision does 4 damage, ground does 5, you start with 12 armor
3456 ; # running the level-file no longer crashes your calc but just returns
3457 ; * you now move 1.5 pixels per frame! this way you can outrun enemies
3458 ; * hellofajob but enemy-data is now stored at one location in 6 bytes,
3459 ; instead of two 4-byte spaces 40 bytes apart! (cleaner code; faster)
3460 ; * ground/ceiling/stars are continued when at boss (c00l level 3 boss)
3462 ; 0.97.B12 -- 12.XI.99 -- size
3464 ; # bullets do damage in all levels
3465 ; * more armor at armor-upgrade and extra armor at end of a level
3466 ; - internal levels again (no need, safer/smaller)
3467 ; # some registers not correctly pushed/popped
3468 ; * several optimizations (init.procs some bytes smaller)
3471 ; + added - removed * changed # bug fixed