junglejourney

changeset 29:98510cf24d1f

Simplified the right and down movement checks.
author David Boddie <david@boddie.org.uk>
date Wed Aug 17 01:26:50 2011 +0200
parents af6c0a43d773
children 3efa4d121a4f
files mapcode.oph
diffstat 1 files changed, 8 insertions(+), 16 deletions(-) [+]
line diff
     1.1 --- a/mapcode.oph	Tue Aug 16 02:11:30 2011 +0200
     1.2 +++ b/mapcode.oph	Wed Aug 17 01:26:50 2011 +0200
     1.3 @@ -1340,7 +1340,9 @@
     1.4  
     1.5      lda $3305                   ; read dx
     1.6      cmp #2
     1.7 -    bpl move_player_right_check_x
     1.8 +    beq move_player_right_check_x
     1.9 +    cmp #3
    1.10 +    beq move_player_right_tile
    1.11  
    1.12      inc $3305
    1.13      clc
    1.14 @@ -1381,18 +1383,13 @@
    1.15  
    1.16      move_player_allow_right:
    1.17  
    1.18 -    lda $3305                   ; only if the player is leaving the tile
    1.19 -    cmp #3                      ; do we update the x offset
    1.20 -    beq move_player_right_tile
    1.21 -
    1.22 -    inc $3305                   ; otherwise, we update dx instead
    1.23 +    inc $3305                   ; update dx
    1.24      clc
    1.25      jmp animate_player_right    ; optimise away the rts
    1.26  
    1.27      move_player_right_tile:
    1.28  
    1.29 -    tya
    1.30 -    sta $3304               ; store the new room x offset
    1.31 +    inc $3304               ; store the new room x offset
    1.32      lda #0
    1.33      sta $3305               ; dx = 0
    1.34      clc
    1.35 @@ -1502,7 +1499,7 @@
    1.36      cmp #0
    1.37      beq move_player_down_check_y
    1.38      cmp #5
    1.39 -    beq move_player_down_check_y
    1.40 +    beq move_player_down_tile
    1.41  
    1.42      inc $3303                   ; 0 < dy < 5
    1.43      clc
    1.44 @@ -1541,18 +1538,13 @@
    1.45  
    1.46      move_player_allow_down:
    1.47  
    1.48 -    lda $3303                   ; only if the player is leaving the tile
    1.49 -    cmp #5                      ; do we update the y offset
    1.50 -    beq move_player_down_tile
    1.51 -
    1.52 -    inc $3303                   ; otherwise, we update dy instead
    1.53 +    inc $3303                   ; update dy
    1.54      clc
    1.55      jmp animate_player_down     ; optimise away the rts
    1.56  
    1.57      move_player_down_tile:
    1.58  
    1.59 -    txa
    1.60 -    sta $3302                   ; store the new room y offset
    1.61 +    inc $3302                   ; store the new room y offset
    1.62      lda #0
    1.63      sta $3303                   ; dy = 0
    1.64      clc