version 0.92: fix regressions, minor updates
authorMischa Poslawsky <nemesis@shiar.org>
Thu, 9 Sep 1999 13:54:50 +0000 (15:54 +0200)
committerMischa Poslawsky <nemesis@shiar.org>
Wed, 18 Mar 2009 02:16:15 +0000 (03:16 +0100)
+ all bullets and enemies are removed at the start of a level
# you can fire bullets again (no more laser at startup)
* 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 2 bullets)

nemesis.z80

index fe86778efbe027b3cf2bdb45881bdcf2e0b19160..6fd51d94a616b260ae6d21ca27a1a3d4a8ae6692 100644 (file)
@@ -13,7 +13,7 @@ DELC_LEN = _undelBufLen               ;$64 bytes long
        .dw Title               ;pointer to description
        .dw spr_ship            ;pointer to YAS icon
 
        .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
 
 just_fired     = TEXT_MEM      ;byte
 temp1          = TEXT_MEM+1    ;word
@@ -25,7 +25,7 @@ my            = mx+1          ;byte
 your_locpos    = TEXT_MEM+8    ;byte
 your_prevpos   = TEXT_MEM+9    ;16 words
 
 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)
 ybullets       = your_prevpos+32                       ;20 x (state,x,y)
 nrebullets     = 10
 ebullets       = ybullets+(nrybullets*3)               ;10 x (state,x,y)
@@ -36,6 +36,7 @@ enemies               = DELC_LEN
        ; %11111111 (ship type or explosion frame)  %11111111 (x) %11111111 (y)
 add2enemy      = nrenemies*4
 enemiesxtra    = enemies+add2enemy
        ; %11111111 (ship type or explosion frame)  %11111111 (x) %11111111 (y)
 add2enemy      = nrenemies*4
 enemiesxtra    = enemies+add2enemy
+       ; $11 (move) $11 (fire)
 
 ;---------------------- init --------------------------------------------------
 
 
 ;---------------------- init --------------------------------------------------
 
@@ -98,19 +99,11 @@ game_main_loop:
        ld  (hl),a              ;save even more random value back
 
 Clear_screen:
        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
 
 check_exitkey:
        call GET_KEY
@@ -213,7 +206,7 @@ Handle_Ship:
 ok:
        ld  a,%01111110
        out (1),a
 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
        in  a,(1)
        rra                     ;rotate right (put last bit in c)
        ld  b,a                 ;we need a
@@ -267,7 +260,7 @@ not_time:
        jr  z,no_flicker        ;don't show normal sprite anyway
        ld  a,b                 ;pop inv-time
        and %11110000           ;inv-time <16 ticks left?
        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)
 
 no_flicker:
        ld  ix,spr_ship01i      ;display inv-ship (ld ix is faster than add ix)
@@ -355,7 +348,7 @@ Fire_bullet:
        jr  z,fire              ;fire pressed?
        ld  hl,just_fired
        ld  (hl),0              ;no: reset just_fired
        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:
        ret nz                  ;return if not
 
 select:
@@ -399,12 +392,18 @@ select6:
 
 fire:  ld  hl,RanPos           ;random
        inc (hl)                ;update random counter
 
 fire:  ld  hl,RanPos           ;random
        inc (hl)                ;update random counter
+
        ld  hl,just_fired
        ld  a,(hl)              ;just_fired
        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?
        ld  hl,(x)              ;yes: first fire from ship position (x)
        ld  (firex),hl          ;set firepos
        ld  a,(your_multiples)  ;any multiples?
@@ -627,11 +626,13 @@ enemy_hit:
        jr  nz,hpleft           ;not zero -> jump
        ld  (hl),%01            ;set to explode
 
        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)
        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:
 pickupdone:
+       ld  (pickuptimer),a     ;save new enemiescounter value
        inc hl
        ld  (hl),$00            ;explosionFrame 0
        jp  (ix)
        inc hl
        ld  (hl),$00            ;explosionFrame 0
        jp  (ix)
@@ -678,7 +679,7 @@ Handle_torp:
        push de
        call putsprite          ;display torpedo
        pop de
        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
 
 remove_torp:
        ld  a,1
@@ -1070,7 +1071,7 @@ take_pickup:
        ld  hl,your_pickup      ;your pickups
        ld  a,(hl)              ;current
        inc a                   ;go to next
        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:
        jr  c,not_maxpickup
        ld  a,1                 ;yes: reset to pickup 1
 not_maxpickup:
@@ -1227,9 +1228,7 @@ You_die:
        xor a                   ;a=0
        ld  (your_armor),a      ;no armor
        ld  (torp_occ),a        ;no torpedoes
        xor a                   ;a=0
        ld  (your_armor),a      ;no armor
        ld  (torp_occ),a        ;no torpedoes
- inc a
        ld  (your_laser),a      ;no laser
        ld  (your_laser),a      ;no laser
- xor a
        ld  (your_pickup),a     ;reset pickups
        ld  (your_multiples),a  ;no multiples
        jr  nonext_level
        ld  (your_pickup),a     ;reset pickups
        ld  (your_multiples),a  ;no multiples
        jr  nonext_level
@@ -1270,6 +1269,10 @@ nonext_level:
        inc hl                  ;y=...
        ld  (hl),24             ;...=24=middle
 
        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
        xor a                   ;reset previous positions
        ld  hl,your_prevpos     ;place all previous positions
        ld  b,16                ;all 16 of them
@@ -1280,6 +1283,18 @@ place_multiples:
        inc hl                  ;next
        djnz place_multiples    ;repeat
 
        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:
 ;--------------------------- setup game ---------------------------------------
 
 game_setup:
@@ -1692,7 +1707,7 @@ spr_icon05:
 
 ;---------------------------- texts -------------------------------------------
 
 
 ;---------------------------- 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
                .db "(ICQ#43840958)",0
 txt_1player:   .db "1 PLAYER",0
 txt_2players:  .db "2 PLAYERS",0
@@ -1715,6 +1730,7 @@ eventenemy        .db $02                 ;enemy type
 eventtime      .db $15                 ;enemy frequency
 eventleft      .db $00                 ;nr. of enemies still to come
 nextevent      .db $50                 ;time to next event
 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
 
 
 score          .dw $0000
 
@@ -1872,10 +1888,10 @@ logo_nemesis:
 ;----------------------------- NEMESIS'86 by Shiar ----------------------------
 
 ;Game · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · NEMESIS
 ;----------------------------- 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
 ;Calc · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·  TI-86 only
-;Size · · · · · · · · · · · · · · · · · · · · · · · · · · ·  2694 bytes on calc
+;Size · · · · · · · · · · · · · · · · · · · · · · · · · · ·  2935 bytes on calc
 
 ;Author · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · SHIAR
 ;ICQ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·  #43840958
 
 ;Author · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · SHIAR
 ;ICQ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·  #43840958
@@ -2010,6 +2026,17 @@ logo_nemesis:
 ;      * 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
 ;      * 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
 
 
 ;       + added        - removed       * changed       # bug fixed