junglejourney

changeset 138:ac6302309cef

Added support for pause/resume and sound on/off keys.
author David Boddie <david@boddie.org.uk>
date Sun Sep 11 00:00:13 2011 +0200
parents 7b695a054073
children 7f3984e82c65
files mapcode.oph
diffstat 1 files changed, 46 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/mapcode.oph	Sat Sep 10 23:42:04 2011 +0200
     1.2 +++ b/mapcode.oph	Sun Sep 11 00:00:13 2011 +0200
     1.3 @@ -5207,6 +5207,12 @@
     1.4      jsr $ffee
     1.5      rts
     1.6  
     1.7 +disable_sound:  ; X=1 (disable); X=0 (enable)
     1.8 +
     1.9 +    lda #210
    1.10 +    ldy #0
    1.11 +    jmp $fff4   ; optimise away the rts
    1.12 +
    1.13  status_vdu_bytes: .byte 31,2,0, 17,3, "Score", 31,11,0, 17,2, "Strength", 17,1
    1.14  ; TAB(1,0), COLOUR 3, "Score", TAB(12,0), COLOUR 2, "Strength", COLOUR 1
    1.15  
    1.16 @@ -5428,7 +5434,10 @@
    1.17                      clc
    1.18  
    1.19                      dec $5785           ; leave the loop when the delay
    1.20 -                    beq after_room_loop ; counter is about to reset
    1.21 +                    bne room_loop_delay_next
    1.22 +                    jmp after_room_loop ; counter is about to reset
    1.23 +
    1.24 +                    room_loop_delay_next:
    1.25  
    1.26                      lda $5281           ; leave the loop when the player
    1.27                      cmp #11             ; animation has finished
    1.28 @@ -5472,10 +5481,45 @@
    1.29                      jsr $fff4
    1.30                      jsr plot_buffer
    1.31  
    1.32 -                    ldx #143
    1.33 +                    ldx #143            ; Escape key check
    1.34                      jsr check_key
    1.35                      cpy #255
    1.36                      beq game_over
    1.37 +
    1.38 +                    ldx #174            ; S key check
    1.39 +                    jsr check_key
    1.40 +                    cpy #255
    1.41 +                    bne no_set_sound
    1.42 +
    1.43 +                    ldx #0
    1.44 +                    jsr disable_sound
    1.45 +                    jmp after_sound_checks
    1.46 +
    1.47 +                    no_set_sound:
    1.48 +
    1.49 +                    ldx #239            ; Q key check
    1.50 +                    jsr check_key
    1.51 +                    cpy #255
    1.52 +                    bne after_sound_checks
    1.53 +
    1.54 +                    ldx #1
    1.55 +                    jsr disable_sound
    1.56 +
    1.57 +                    after_sound_checks:
    1.58 +
    1.59 +                    ldx #200            ; P key check
    1.60 +                    jsr check_key
    1.61 +                    cpy #255
    1.62 +                    bne no_pause
    1.63 +
    1.64 +                    pause_loop:
    1.65 +
    1.66 +                        ldx #201         ; O key check
    1.67 +                        jsr check_key
    1.68 +                        cpy #255
    1.69 +                        bne pause_loop
    1.70 +
    1.71 +                    no_pause:
    1.72                      clc
    1.73  
    1.74                      lda $578d