.dw Title ;pointer to description
.dw spr_ship ;pointer to YAS icon
-Title: .db "Nemesis v0.91.95 by Shiar",0
+Title: .db "Nemesis v0.92.98 by Shiar",0
just_fired = TEXT_MEM ;byte
temp1 = TEXT_MEM+1 ;word
your_locpos = TEXT_MEM+8 ;byte
your_prevpos = TEXT_MEM+9 ;16 words
-nrybullets = 10
+nrybullets = 20
ybullets = your_prevpos+32 ;20 x (state,x,y)
nrebullets = 10
ebullets = ybullets+(nrybullets*3) ;10 x (state,x,y)
; %11111111 (ship type or explosion frame) %11111111 (x) %11111111 (y)
add2enemy = nrenemies*4
enemiesxtra = enemies+add2enemy
+ ; $11 (move) $11 (fire)
;---------------------- init --------------------------------------------------
ld (hl),a ;save even more random value back
Clear_screen:
- xor a ;empty bitmask
- ld hl,GRAPH_MEM ;screen location (top left)
- ld b,$E0 ;loop 0E0h = 224 times = 256-32 for score-bar)
-clearloop:
- ld (hl),a ;clear four times (total = 224*4 = 896 bytes)
- inc hl
- ld (hl),a
- inc hl
- ld (hl),a
- inc hl
- ld (hl),a
- inc hl
- djnz clearloop ;repeat 224x
+ ld hl,GRAPH_MEM ;move from (hl) = top left
+ ld (hl),$00 ;first pixel will be copied all over the screen
+ ld de,GRAPH_MEM+1 ;(de) = next pixel, thus clearing whole screen
+ ld bc,896 ;loop 896 times = (128/8) * (64-8 for scorebar)
+ ldir ;clear!
check_exitkey:
call GET_KEY
ok:
ld a,%01111110
out (1),a
- ld hl,y
+ ld hl,y ;instead of nop\nop do something usefull
in a,(1)
rra ;rotate right (put last bit in c)
ld b,a ;we need a
jr z,no_flicker ;don't show normal sprite anyway
ld a,b ;pop inv-time
and %11110000 ;inv-time <16 ticks left?
- jr handle_multiples ;yes: display normal sprite and continue
+ jr z,handle_multiples ;yes: display normal sprite and continue
no_flicker:
ld ix,spr_ship01i ;display inv-ship (ld ix is faster than add ix)
jr z,fire ;fire pressed?
ld hl,just_fired
ld (hl),0 ;no: reset just_fired
- bit 3,a ;test bit 3 = F2-key &&&
+ bit 3,a ;test bit 3 = F2-key
ret nz ;return if not
select:
fire: ld hl,RanPos ;random
inc (hl) ;update random counter
+
ld hl,just_fired
ld a,(hl) ;just_fired
- or a ;zero when key just pressed (not already in)
- ret nz ;return when already pressed
- inc (hl) ;set just_fired to 1
-
+ cp 5 ;already pressed?
+ ret z ;return when already pressed (=5)
+ inc (hl) ;otherwise increase counter (0 to 4 >> 1 to 5)
+ ld a,(your_laser) ;if you have bullets.....
+ or a ;(0=no laser)
+ jr nz,fireOK
+ ld (hl),5 ;.....then can't fire next turn (go to 5 imm.)
+
+fireOK:
ld hl,(x) ;yes: first fire from ship position (x)
ld (firex),hl ;set firepos
ld a,(your_multiples) ;any multiples?
jr nz,hpleft ;not zero -> jump
ld (hl),%01 ;set to explode
- ld a,(RanPos) ;use random var
- and %01011011 ;matches 0 100/2/2/2/2/2=3% of the time
+ ld a,(pickuptimer) ;counts enemies destroyed
+ dec a ;enough destroyed for a pickup?
jr nz,pickupdone ;otherwise just explode
ld (hl),%00000110 ;change it into a pickup (with 2 HP)
+ ld a,18 ;reset enemies counter (18 hits = next)
pickupdone:
+ ld (pickuptimer),a ;save new enemiescounter value
inc hl
ld (hl),$00 ;explosionFrame 0
jp (ix)
push de
call putsprite ;display torpedo
pop de
- jr check_bullethits ;check for hits with enemies
+ jp check_bullethits ;check for hits with enemies
remove_torp:
ld a,1
ld hl,your_pickup ;your pickups
ld a,(hl) ;current
inc a ;go to next
- cp 5 ;pickups >=5
+ cp 6 ;pickups >=6
jr c,not_maxpickup
ld a,1 ;yes: reset to pickup 1
not_maxpickup:
xor a ;a=0
ld (your_armor),a ;no armor
ld (torp_occ),a ;no torpedoes
- inc a
ld (your_laser),a ;no laser
- xor a
ld (your_pickup),a ;reset pickups
ld (your_multiples),a ;no multiples
jr nonext_level
inc hl ;y=...
ld (hl),24 ;...=24=middle
+ ld a,(torp_occ)
+ and %00000001 ;remove torpedoes
+ ld (torp_occ),a
+
xor a ;reset previous positions
ld hl,your_prevpos ;place all previous positions
ld b,16 ;all 16 of them
inc hl ;next
djnz place_multiples ;repeat
+ ld hl,ybullets ;clear your/enemy bullets
+ ld (hl),a ;clear first byte
+ ld de,ybullets+1 ;and copy this byte to the next byte
+ ld bc,(nrybullets+nrebullets)*3-1 ;bc times (all bullets)
+ ldir
+
+ ld hl,enemies ;and remove all enemies as well
+ ld (hl),a ;clear first byte
+ ld de,enemies+1 ;point to the next
+ ld bc,add2enemy+nrenemies*2 ;clear enemy-info + enemiesxtra
+ ldir
+
;--------------------------- setup game ---------------------------------------
game_setup:
;---------------------------- texts -------------------------------------------
-txt_about: .db "v0.91.95 ","by Shiar "
+txt_about: .db "v0.92.98 ","by Shiar "
.db "(ICQ#43840958)",0
txt_1player: .db "1 PLAYER",0
txt_2players: .db "2 PLAYERS",0
eventtime .db $15 ;enemy frequency
eventleft .db $00 ;nr. of enemies still to come
nextevent .db $50 ;time to next event
+pickuptimer .db $4
score .dw $0000
;----------------------------- NEMESIS'86 by Shiar ----------------------------
;Game · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · NEMESIS
-;Version · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 0.9.94
-;Latest modification · · · · · · · · · · · · · · · · · · · · · · · · · 4.IX.99
+;Version · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 0.92.98
+;Latest modification · · · · · · · · · · · · · · · · · · · · · · · · · 7.IX.99
;Calc · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · TI-86 only
-;Size · · · · · · · · · · · · · · · · · · · · · · · · · · · 2694 bytes on calc
+;Size · · · · · · · · · · · · · · · · · · · · · · · · · · · 2935 bytes on calc
;Author · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · SHIAR
;ICQ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · #43840958
; * most data (enemy positions) stored at TEXT_MEM and DELC_LEN positions
; instead of in program, saving A LOT of bytes in program-size
; - at release of 0.91 bullets didn't work, laser is used instead
+;
+; 0.92.98 -- 08.IX .99 -- size 2831
+;
+; + all bullets and enemies are removed at the start of a level
+; # you can fire bullets again (no more laser at startup)
+; * game delay is increased (one halt more) so it runs slower
+; * pickups aren't given at random, but appear every x enemies destroyed
+; # solved a minor bug in invulnerability flashing display
+; * clearScreen procedure improved (faster and smaller)
+; # fifth icon couldn't be selected (so no multiples selectable). fixed
+; * laserbeam lasts 5 turns (laser wasnt good enough compared to bullets)
; + added - removed * changed # bug fixed