Danger X
New member
Hi I just started making my first game a few days ago and I encountered a problem with left scrolling, I used both left scrolling and right scrolling scripts from the modules I found in game makers, here are my scripts
--left
; LDA ScreenFlags00
; AND #%00100000
; BEQ +doActivateScrollByte
; LDA scrollByte
; AND #%00111111
; STA scrollByte
; RTS
;+doActivateScrollByte:
LEFT_SCROLL_PAD = #$60
LDX player1_object
LDA Object_x_hi,x
SEC
SBC camX
CMP #LEFT_SCROLL_PAD
BEQ +doActivateScrollByte
BCC +doActivateScrollByte
LDA scrollByte
AND #%00111111
STA scrollByte
RTS
+doActivateScrollByte
LDA scrollByte
AND #%01000000
BEQ +notChangingCamDirectionForUpdate
LDA scrollByte
ORA #%00000010
+notChangingCamDirectionForUpdate
AND #%00111111
ORA #%10000000 ;; bit one forces an update.
STA scrollByte
;;; just like movement byte of a player.
;;; bit 7 indicates horizontal movement of a player
;;; bit 6 indicates 0 for left, 1 for right.
rts
--right
; LDA ScreenFlags00
; AND #%00010000
; BEQ +doActivateScrollByte
; LDA scrollByte
; AND #%00111111
; STA scrollByte
; RTS
;+doActivateScrollByte:
RIGHT_SCROLL_PAD = #$90
LDX player1_object
LDA Object_x_hi,x
SEC
SBC camX
CMP #RIGHT_SCROLL_PAD
BEQ +doActivateScrollByte
BCS +doActivateScrollByte
LDA scrollByte
AND #%00111111
STA scrollByte
RTS
+doActivateScrollByte
LDA scrollByte
AND #%01000000
BNE +notChangingCamDirectionForUpdate
LDA scrollByte
ORA #%00000010
+notChangingCamDirectionForUpdate
AND #%00111111
ORA #%11000000
STA scrollByte
;;; just like movement byte of a player.
;;; bit 7 indicates horizontal movement of a player
;;; bit 6 indicates 0 for left, 1 for right.
RTS
the problem is when I go to left if scrolls to right (the right scrolls is working properly thou) and I'm sure I linked the right script to my directional pad, can anyone help, is there a setting I have to do somewhere else?
--left
; LDA ScreenFlags00
; AND #%00100000
; BEQ +doActivateScrollByte
; LDA scrollByte
; AND #%00111111
; STA scrollByte
; RTS
;+doActivateScrollByte:
LEFT_SCROLL_PAD = #$60
LDX player1_object
LDA Object_x_hi,x
SEC
SBC camX
CMP #LEFT_SCROLL_PAD
BEQ +doActivateScrollByte
BCC +doActivateScrollByte
LDA scrollByte
AND #%00111111
STA scrollByte
RTS
+doActivateScrollByte
LDA scrollByte
AND #%01000000
BEQ +notChangingCamDirectionForUpdate
LDA scrollByte
ORA #%00000010
+notChangingCamDirectionForUpdate
AND #%00111111
ORA #%10000000 ;; bit one forces an update.
STA scrollByte
;;; just like movement byte of a player.
;;; bit 7 indicates horizontal movement of a player
;;; bit 6 indicates 0 for left, 1 for right.
rts
--right
; LDA ScreenFlags00
; AND #%00010000
; BEQ +doActivateScrollByte
; LDA scrollByte
; AND #%00111111
; STA scrollByte
; RTS
;+doActivateScrollByte:
RIGHT_SCROLL_PAD = #$90
LDX player1_object
LDA Object_x_hi,x
SEC
SBC camX
CMP #RIGHT_SCROLL_PAD
BEQ +doActivateScrollByte
BCS +doActivateScrollByte
LDA scrollByte
AND #%00111111
STA scrollByte
RTS
+doActivateScrollByte
LDA scrollByte
AND #%01000000
BNE +notChangingCamDirectionForUpdate
LDA scrollByte
ORA #%00000010
+notChangingCamDirectionForUpdate
AND #%00111111
ORA #%11000000
STA scrollByte
;;; just like movement byte of a player.
;;; bit 7 indicates horizontal movement of a player
;;; bit 6 indicates 0 for left, 1 for right.
RTS
the problem is when I go to left if scrolls to right (the right scrolls is working properly thou) and I'm sure I linked the right script to my directional pad, can anyone help, is there a setting I have to do somewhere else?