|
@ -136,7 +136,7 @@ Map_Scroll:: |
|
|
sub 8 |
|
|
sub 8 |
|
|
ld [PAGEY], a |
|
|
ld [PAGEY], a |
|
|
|
|
|
|
|
|
jr .done |
|
|
|
|
|
|
|
|
jp .done |
|
|
|
|
|
|
|
|
.scroll_down_check: |
|
|
.scroll_down_check: |
|
|
; Check SCY + (SCRN_Y + 16) = PAGEY |
|
|
; Check SCY + (SCRN_Y + 16) = PAGEY |
|
@ -144,7 +144,7 @@ Map_Scroll:: |
|
|
sub SCRN_Y + 16 |
|
|
sub SCRN_Y + 16 |
|
|
ld hl, rSCY |
|
|
ld hl, rSCY |
|
|
cp [hl] |
|
|
cp [hl] |
|
|
jr nz, .scroll_right_check |
|
|
|
|
|
|
|
|
jr nz, .scroll_left_check |
|
|
|
|
|
|
|
|
ld a, [PAGEY] |
|
|
ld a, [PAGEY] |
|
|
srl a |
|
|
srl a |
|
@ -177,11 +177,45 @@ Map_Scroll:: |
|
|
|
|
|
|
|
|
jr .done |
|
|
jr .done |
|
|
|
|
|
|
|
|
; If SCX = PAGEX, write map col |
|
|
|
|
|
.scroll_left_check: |
|
|
.scroll_left_check: |
|
|
|
|
|
; If SCX = PAGEX, write map col |
|
|
|
|
|
ld a, [PAGEX] |
|
|
|
|
|
ld hl, rSCX |
|
|
|
|
|
cp [hl] |
|
|
|
|
|
jr nz, .scroll_right_check |
|
|
|
|
|
|
|
|
|
|
|
; HL = VRAM + PAGEX/8 |
|
|
|
|
|
ld hl, _SCRN0 |
|
|
|
|
|
ld a, [PAGEX] |
|
|
|
|
|
srl a |
|
|
|
|
|
srl a |
|
|
|
|
|
srl a |
|
|
|
|
|
dec a |
|
|
|
|
|
ADD16 hl |
|
|
|
|
|
|
|
|
|
|
|
; B = CAMERA_X - 1 |
|
|
|
|
|
ld a, [CURRENT_CAMERA_X] |
|
|
|
|
|
dec a |
|
|
|
|
|
ld b, a |
|
|
|
|
|
|
|
|
|
|
|
; C = CAMERA_Y - SCY/8 |
|
|
|
|
|
ld a, [rSCY] |
|
|
|
|
|
ld c, a |
|
|
|
|
|
ld a, [CURRENT_CAMERA_Y] |
|
|
|
|
|
srl c |
|
|
|
|
|
srl c |
|
|
|
|
|
srl c |
|
|
|
|
|
sub c |
|
|
|
|
|
ld c, a |
|
|
|
|
|
|
|
|
|
|
|
call enqueue_col_write |
|
|
|
|
|
|
|
|
|
|
|
ld a, [PAGEX] |
|
|
|
|
|
sub 8 |
|
|
|
|
|
ld [PAGEX], a |
|
|
|
|
|
|
|
|
; If SCX = SCRN_X - PAGEX, write map col |
|
|
|
|
|
.scroll_right_check: |
|
|
.scroll_right_check: |
|
|
|
|
|
; If SCX = SCRN_X - PAGEX, write map col |
|
|
; Check SCX + (SCRN_X + 16) = PAGEX |
|
|
; Check SCX + (SCRN_X + 16) = PAGEX |
|
|
ld a, [PAGEX] |
|
|
ld a, [PAGEX] |
|
|
sub SCRN_X + 16 |
|
|
sub SCRN_X + 16 |
|
@ -211,7 +245,6 @@ Map_Scroll:: |
|
|
srl c |
|
|
srl c |
|
|
srl c |
|
|
srl c |
|
|
sub c |
|
|
sub c |
|
|
; dec a |
|
|
|
|
|
ld c, a |
|
|
ld c, a |
|
|
|
|
|
|
|
|
call enqueue_col_write |
|
|
call enqueue_col_write |
|
|