Skip to content

Commit

Permalink
Merge pull request #26 from jes/master
Browse files Browse the repository at this point in the history
Fix turn counter
  • Loading branch information
skx authored Aug 23, 2021
2 parents db3a1e8 + 953688f commit a4af2a5
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions game.z80
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,16 @@ ship_warning_over:
call find_command
cp 255
jp z, no_handler

; Call the handler
call JP_HL
push hl

; Valid command - increase turn count
ld hl, TURN_COUNT
inc (hl)

; Call the handler
pop hl
call JP_HL

; Did we get eaten?
call maybe_grue_death

Expand Down Expand Up @@ -412,12 +414,7 @@ CompareStringsWithLength:
; Helper function, to allow indirection.
;
JP_HL:
ld bc, ret_obj
push bc
push hl
ret_obj:
ret

jp (hl)


;
Expand Down Expand Up @@ -1886,7 +1883,6 @@ turns_function:
call show_msg
ld hl, TURN_COUNT
ld a, (hl)
inc a
call show_a_register
ld de, PLAYER_TURN_COUNT_END
call show_msg
Expand Down

0 comments on commit a4af2a5

Please sign in to comment.