geschrieben am 31.12.2011 17:06:59 in Allgemeine SMW Hacking Fragen
(
Link
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; "Vertical Auto Scroll" generator
; By Jimmy52905
; Fixed by yoshicookiezeus
; Uses first extra bit: YES
; If extra bit is set, the generator makes the screen scroll downwards instead of upwards
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
STOP dcb $10 ; screen number the sprite should stop at when scrolling downwards
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dcb "INIT"
dcb "MAIN"
PHB
PHK
PLB
JSR Main
PLB
RTL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Main sprite code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Main:
LDA $9D ;\ If sprites are locked...
BNE Return ;/ Go to "Return".
LDA $13 ;\
LSR A ; |
BCC Return ;/ Only run code every other frame.
STZ $1412 ; Disable Vertical Scroll so that the code can run properly.
LDA $18B9 ;\ If the first extra bit is set...
AND #$40 ; |
BNE Down ;/ Go to "Down".
STZ $55 ; Make sure that new tiles are uploaded from the top of the screen
LDA $1464 ;\
ORA $1465 ; |If the screen position is at the top of the level...
BEQ Return ;/ Go to "Return".
REP #$20 ; 16-bit (accumulator).
DEC $1464 ; Make the screen scroll upwards automatically.
SEP #$20 ; 8-bit (accumulator).
Return:
RTS ;Return from Subroutine.
Down:
LDA #$02 ;\ Make sure that new tiles are uploaded from the bottom of the screen
STA $55 ;/
LDA $1465 ;\ If the screen position is at screen 10 (last screen of a vertical layer 2 level)...
CMP STOP ; |
BEQ Return ;/ Go to "Return".
REP #$20 ; 16-bit (accumulator).
INC $1464 ; Make the screen scroll downwards automatically.
SEP #$20 ; 8-bit (accumulator).
RTS ;Return from Subroutine.
#0 w200 t150
#0 @16 q7f v100 y10
o5
c4v95c+4v90d4v85d+4v80e4v75f4v70f+4v65g4v60g+4v55a4v50a+4v45b4
#1 @16 q7f v155 y10
o4
c4v150c+4v145d4v140d+4v135e4v130f4v125f+4v120g4v115g+4v110a4v105a+4v100b4
#2 @16 q7f v100 y10
o4
c4v105c+4v110d4v115d+4v120e4v125f4v130f+4v135g4v140g+4v145a4v150a+4v155b4
#3 @16 q7f v45 y10
o5
c4v50c+4v55d4v60d+4v65e4v70f4v75f+4v80g4v85g+4v90a4v95a+4v100b4