Skip to content

Instantly share code, notes, and snippets.

View StardustGear's full-sized avatar

Stardust Gear StardustGear

View GitHub Profile
@StardustGear
StardustGear / BGScrollSizes.asm
Last active December 7, 2019 18:49
S3&K BG Scroll in Sonic 1
BGScrollSize_GHZ:
dc.w $20 ; cloud 1
dc.w $10 ; cloud 2
dc.w $10 ; cloud 3
dc.w $30 ; distant mountains
dc.w $28 ; hills with waterfall
dc.w $8068 ; water (pixelwise)
BGScrollSize_MZ:
dc.w $200 ; unused 2 chunks
; Background Scroll Deformation - ported from S3&K
; Input: a4 - block size specification
; a5 - block position buffer
; Block Size Format: Each word is Size, if bit 15 set - then force 1px scroll
ProcessBGScroll:
move.w #224-1,d1 ; 224px
ProcessBGScroll_ParamSize: ; for custom screen heights
lea (v_hscrolltablebuffer).w,a1