junglejourney

changeset 189:a3e62b843f69

Fixed the logic for the fire button check. Merged keyboard and joystick messages, checking for both Space and Fire on the title screen.
author David Boddie <david@boddie.org.uk>
date Tue Sep 27 19:09:44 2011 +0200
parents f8e57c491f30
children a5463eb2fc7e
files mapcode.oph
diffstat 1 files changed, 37 insertions(+), 51 deletions(-) [+]
line diff
     1.1 --- a/mapcode.oph	Mon Sep 26 23:13:46 2011 +0200
     1.2 +++ b/mapcode.oph	Tue Sep 27 19:09:44 2011 +0200
     1.3 @@ -2197,7 +2197,7 @@
     1.4      ldx #0
     1.5      jsr $fff4
     1.6      cpx #0
     1.7 -    bne check_fire_key_fire
     1.8 +    beq check_fire_key_fire
     1.9  
    1.10      check_fire_key_no_joystick:
    1.11  
    1.12 @@ -4399,8 +4399,7 @@
    1.13  high_score_default_name2: .byte " SOFTWARE"
    1.14  
    1.15  title_vdu_bytes:    .byte 17,2, 31,7,28, "to play"
    1.16 -keyboard_message:   .byte 31,4,27, 17,2, "Press SPACE"
    1.17 -joystick_message:   .byte 31,4,27, 17,2, "Press FIRE "
    1.18 +input_message:      .byte 17,2, 31,1,27, "Press SPACE / FIRE"
    1.19  title_vdu_bytes1:   .byte 17,3, 31,1,30, "Copyright (c) 2011"
    1.20  title_vdu_bytes2:   .byte 17,3, 31,1,30, "   David Boddie   "
    1.21  title_vdu_bytes3:   .byte 17,1, 31,1,30, "for Retro Software"
    1.22 @@ -4491,7 +4490,7 @@
    1.23          cpx #12
    1.24          bmi write_title_text_loop
    1.25  
    1.26 -    jsr show_keyboard_or_joystick_message
    1.27 +    jsr show_input_message
    1.28  
    1.29      ; Show the title.
    1.30      jsr copy_title_up
    1.31 @@ -4583,67 +4582,42 @@
    1.32          beq show_title_wait_loop
    1.33  
    1.34          show_title_wait_loop_no_update:
    1.35 -        ldx #186
    1.36 -        jsr check_key
    1.37 -        cpy #255
    1.38 -        bne show_title_no_j
    1.39 -
    1.40 +        lda #128
    1.41 +        ldx #0
    1.42 +        jsr $fff4
    1.43 +        cpx #0              ; fire button pressed?
    1.44 +        beq show_title_no_joystick
    1.45 +        
    1.46          lda #1              ; enable joystick support
    1.47          sta $577e
    1.48 -        jsr show_joystick_message
    1.49 -        jmp show_title_no_k
    1.50 -
    1.51 -        show_title_no_j:
    1.52 -        ldx #185
    1.53 -        jsr check_key
    1.54 -        cpy #255
    1.55 -        bne show_title_no_k
    1.56 -
    1.57 -        lda #0              ; disable joystick support
    1.58 -        sta $577e
    1.59 -        jsr show_keyboard_message
    1.60 -
    1.61 -        show_title_no_k:
    1.62 -        ldx #157
    1.63 +        jmp show_title_exit
    1.64 +
    1.65 +        show_title_no_joystick:
    1.66 +        ldx #157            ; SPACE
    1.67          jsr check_key
    1.68          cpy #255
    1.69          bne show_title_wait_inner_loop
    1.70  
    1.71 +    lda #0              ; disable joystick support
    1.72 +    sta $577e
    1.73 +
    1.74 +    show_title_exit:
    1.75 +    clc
    1.76      rts
    1.77  
    1.78 -show_keyboard_or_joystick_message:
    1.79 -
    1.80 -    lda $577e
    1.81 -    cmp #0
    1.82 -    bne show_joystick_message
    1.83 -
    1.84 -show_keyboard_message:
    1.85 +show_input_message:
    1.86  
    1.87      ldx #0
    1.88 -    show_keyboard_message_loop:
    1.89 -
    1.90 -        lda keyboard_message,x
    1.91 +    show_input_message_loop:
    1.92 +
    1.93 +        lda input_message,x
    1.94          jsr $ffee
    1.95          inx
    1.96 -        cpx #16
    1.97 -        bne show_keyboard_message_loop
    1.98 +        cpx #23
    1.99 +        bne show_input_message_loop
   1.100      
   1.101      rts
   1.102  
   1.103 -show_joystick_message:
   1.104 -
   1.105 -    ldx #0
   1.106 -    show_joystick_message_loop:
   1.107 -
   1.108 -        lda joystick_message,x
   1.109 -        jsr $ffee
   1.110 -        inx
   1.111 -        cpx #16
   1.112 -        bne show_joystick_message_loop
   1.113 -    
   1.114 -    rts
   1.115 -
   1.116 -
   1.117  wait_for_vsync:
   1.118  
   1.119      lda #19
   1.120 @@ -4949,14 +4923,26 @@
   1.121          bne show_complete_game_no_message
   1.122  
   1.123          jsr colour1
   1.124 -        jsr show_keyboard_or_joystick_message
   1.125 +        jsr show_input_message
   1.126  
   1.127          show_complete_game_no_message:
   1.128 +
   1.129 +        lda #128
   1.130 +        ldx #0
   1.131 +        jsr $fff4
   1.132 +        cpx #0              ; fire button pressed?
   1.133 +        beq show_complete_game_no_joystick
   1.134 +        jmp show_complete_game_exit
   1.135 +
   1.136 +        show_complete_game_no_joystick:
   1.137 +
   1.138          ldx #157
   1.139          jsr check_key
   1.140          cpy #255
   1.141          bne show_complete_game_delay_loop
   1.142  
   1.143 +    show_complete_game_exit:
   1.144 +    clc
   1.145      rts
   1.146  
   1.147  check_high_scores: