pokered/engine/predefs12.asm

72 lines
1.1 KiB
NASM
Raw Normal View History

2014-09-13 07:50:56 +00:00
; b = new colour for BG colour 0 (usually white) for 4 frames
2016-06-12 00:24:04 +00:00
ChangeBGPalColor0_4Frames:
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
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
2016-06-12 00:24:04 +00:00
PredefShakeScreenVertically:
2015-07-12 23:24:03 +00:00
; Moves the window down and then back in a sequence of progressively smaller
; numbers of pixels, starting at b.
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
2016-06-12 06:42:19 +00:00
.MutateWY
2015-07-12 23:24:03 +00:00
ld a, [$ff96]
2014-05-22 22:13:20 +00:00
xor b
2015-07-12 23:24:03 +00:00
ld [$ff96], a
ld [rWY], a
ld c, 3
2014-05-22 22:13:20 +00:00
jp DelayFrames
2016-06-12 00:24:04 +00:00
PredefShakeScreenHorizontally:
2015-07-12 23:24:03 +00:00
; Moves the window right and then back in a sequence of progressively smaller
; numbers of pixels, starting at b.
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
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
ld [rWX], a
2014-05-22 22:13:20 +00:00
ret
2016-06-12 06:42:19 +00:00
.MutateWX
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
ld [rWX], a
ld c, 4
2014-05-22 22:13:20 +00:00
jp DelayFrames