2014-09-13 07:50:56 +00:00
|
|
|
; b = new colour for BG colour 0 (usually white) for 4 frames
|
|
|
|
ChangeBGPalColor0_4Frames: ; 480eb (12:40eb)
|
2014-05-23 22:11:09 +00:00
|
|
|
call GetPredefRegisters
|
2014-09-13 07:50:56 +00:00
|
|
|
ld a, [rBGP]
|
2014-05-22 22:13:20 +00:00
|
|
|
or b
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [rBGP], a
|
2015-07-03 19:37:53 +00:00
|
|
|
ld c, 4
|
2014-05-22 22:13:20 +00:00
|
|
|
call DelayFrames
|
2014-09-13 07:50:56 +00:00
|
|
|
ld a, [rBGP]
|
|
|
|
and %11111100
|
|
|
|
ld [rBGP], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
|
2015-07-12 23:24:03 +00:00
|
|
|
PredefShakeScreenVertically: ; 480ff (12:40ff)
|
|
|
|
; Moves the window down and then back in a sequence of progressively smaller
|
|
|
|
; numbers of pixels, starting at b.
|
2014-05-23 22:11:09 +00:00
|
|
|
call GetPredefRegisters
|
2015-07-12 23:24:03 +00:00
|
|
|
ld a, 1
|
|
|
|
ld [wDisableVBlankWYUpdate], a
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2015-07-12 23:24:03 +00:00
|
|
|
.loop
|
|
|
|
ld [$ff96], a
|
|
|
|
call .MutateWY
|
|
|
|
call .MutateWY
|
2014-05-22 22:13:20 +00:00
|
|
|
dec b
|
|
|
|
ld a, b
|
2015-07-12 23:24:03 +00:00
|
|
|
jr nz, .loop
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2015-07-12 23:24:03 +00:00
|
|
|
ld [wDisableVBlankWYUpdate], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
|
2015-07-12 23:24:03 +00:00
|
|
|
.MutateWY ; 48119 (12:4119)
|
|
|
|
ld a, [$ff96]
|
2014-05-22 22:13:20 +00:00
|
|
|
xor b
|
2015-07-12 23:24:03 +00:00
|
|
|
ld [$ff96], a
|
2015-07-03 19:37:53 +00:00
|
|
|
ld [rWY], a
|
|
|
|
ld c, 3
|
2014-05-22 22:13:20 +00:00
|
|
|
jp DelayFrames
|
|
|
|
|
2015-07-12 23:24:03 +00:00
|
|
|
PredefShakeScreenHorizontally: ; 48125 (12:4125)
|
|
|
|
; Moves the window right and then back in a sequence of progressively smaller
|
|
|
|
; numbers of pixels, starting at b.
|
2014-05-23 22:11:09 +00:00
|
|
|
call GetPredefRegisters
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2015-07-12 23:24:03 +00:00
|
|
|
.loop
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [$ff97], a
|
2015-07-12 23:24:03 +00:00
|
|
|
call .MutateWX
|
2015-07-03 19:37:53 +00:00
|
|
|
ld c, 1
|
2014-05-22 22:13:20 +00:00
|
|
|
call DelayFrames
|
2015-07-12 23:24:03 +00:00
|
|
|
call .MutateWX
|
2014-05-22 22:13:20 +00:00
|
|
|
dec b
|
|
|
|
ld a, b
|
2015-07-12 23:24:03 +00:00
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
; restore normal WX
|
|
|
|
ld a, 7
|
2015-07-03 19:37:53 +00:00
|
|
|
ld [rWX], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
|
2015-07-12 23:24:03 +00:00
|
|
|
.MutateWX ; 4813f (12:413f)
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, [$ff97]
|
|
|
|
xor b
|
|
|
|
ld [$ff97], a
|
|
|
|
bit 7, a
|
2015-07-12 23:24:03 +00:00
|
|
|
jr z, .skipZeroing
|
|
|
|
xor a ; zero a if it's negative
|
|
|
|
.skipZeroing
|
|
|
|
add 7
|
2015-07-03 19:37:53 +00:00
|
|
|
ld [rWX], a
|
|
|
|
ld c, 4
|
2014-05-22 22:13:20 +00:00
|
|
|
jp DelayFrames
|