9 Title: .db "Nemesis v0.1.718 by Shiar",0
13 ;-------------------- init ----------------------------------------------------
18 ;-------------------- main menu -----------------------------------------------
22 ;-------------------- exit ----------------------------------------------------
27 ;----------------------- game setup -------------------------------------------
30 ld hl,stored_data_start
31 ld bc,variables_end-stored_data_start-1
33 ;---------------------- display setup ----------------------------------------
57 ;------------------------------------------------------------------------------
58 ;-------------------------- game loop -----------------------------------------
59 ;------------------------------------------------------------------------------
62 ld hl,timer ;update time
67 ld hl,GRAPH_MEM+(16*12)
79 ld a,%00111111 ;<exit> pressed?
85 jr z,quit ;yes: quit game
88 call Level_event ;insert enemies
89 call Handle_Ship ;move you
90 call Handle_enemies ;move enemies
91 call Enemies_hit ;check for collision with enemies
93 call Display_Screen ;display all
94 ; halt \ halt \ halt ;delay
95 jr game_main_loop ;loop
99 ;---------------------- display -----------------------------------------------
102 ld a,64 ;Display Image
103 ld hl,GRAPH_MEM+(16*12)
115 ; ld hl,$1007 ;Display Score
121 ;------------------------- handle ship ----------------------------------------
126 ; jr nz,you_not_normal
178 no_up: ld ix,spr_ship
208 ; ld ix,spr_explosion
215 ;--------------------------- level events -------------------------------------
262 ;--------------------------- handle enemies -----------------------------------
315 ;--------------------------- check collision ----------------------------------
318 ld de,(x) ;e = X, d = Y
328 ret z ;-1 = no more enemies
331 jr nz,nocrash ;1 = enemy
335 ld a,(hl) ;check x match
343 ld a,(hl) ;check y match
354 ld (hl),2 ;set to explode
360 ;--------------------------- next level ---------------------------------------
367 ;--------------------------- putsprite ----------------------------------------
370 .db 128,64,32,16,8,4,2,1
401 _oloop: push bc ;Save # of rows
402 push hl ;Save screen address
404 ld c,(ix+2) ;Load one line of image
406 _smc1: ld a,1 ;Load pixel mask
407 _iloop: sla c ;Test leftmost pixel
408 jr nc,_noplot ;See if a plot is needed
409 ld e,a ;OR pixel with screen
414 jr nc,_notedge ;Test if edge of byte reached
415 inc hl ;Go to next byte
417 pop hl ;Restore address
418 ld bc,12 ;Go to next line
430 ldhld: call UNPACK_HL
448 up_data: .db "PAD98",0
452 ;------------------------------- sprites --------------------------------------
558 ;---------------------------- level data -------------------------------------
560 .db $10,$00,$40 ;$time (ff=end) $type $y-pos
566 ;---------------------------- texts ------------------------------------------
569 .db "* * NEMESIS * *",0
571 ;---------------------------- save data --------------------------------------
575 curevent .dw Leveldata+1 ;next event
576 nextevent .db (Leveldata) ;time to next event
583 ybullets .dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
584 ebuls .dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
585 enemies .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
586 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
587 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
588 .dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$ffff,$ffff
589 ; 0011 2233 >> 0=occupation (0=no enemy 1=normal 2=exploding)
590 ; 1=frame/ship 2=x 3=y
601 warped_status .db $00
616 ; 0.01.717 -- 17.VII.99 -- size 984
618 ; + movement of ship over whole screen
619 ; + enemies moving from right to left, appearing right at specified times
621 ; 0.1.718 -- 18.VII.99 -- size 907
623 ; * no crash when level restarts for the third time
624 ; * exit-procedure updated, unnecessary stuff/keychecks removed
625 ; * alot of unused code removed
626 ; + different types of enemies (just look different)
627 ; + collision detection!! enemy ships disappear when you hit them