less shake in intro, shake while clearing

This commit is contained in:
2019-01-08 21:24:43 +01:00
parent 974edee924
commit dd138a0b70
3 changed files with 42 additions and 1 deletions

View File

@@ -410,8 +410,48 @@ Clear:
; render cleared buffer
call StartRender
; disable sprites
HaltAndClearInterrupts
ldh a, [rLCDC]
and a, ~LCDCF_OBJON
ldh [rLCDC], a
; shake background
ld d, HIGH(Random)
ld e, LOW(Random)
ld b, 16
.shake
HaltAndClearInterrupts
ld a, [de]
ldh [rSCX], a
inc e
ld a, e
and a, $7
ld e, a
ld a, [de]
ldh [rSCY], a
inc e
ld a, e
and a, $7
ld e, a
dec b
jr nz, .shake
call WaitRender
; reset scrolling and enable sprites again
xor a
ldh [rSCX], a
ldh [rSCY], a
ldh a, [rLCDC]
or a, LCDCF_OBJON
ldh [rLCDC], a
; reset video pointer
ld hl, Video
ld a, [hl+]

View File

@@ -1,9 +1,10 @@
INCLUDE "hardware.inc"
INCLUDE "utils.inc"
EXPORT Random, RandomEnd
SECTION "Random", ROM0, ALIGN[4]
Random:
db -1, 1, 2, -1, 4, 3, -2, -1, -4, 3, -1, 5, 2
db -1, 1, 2, -1, 2, 0, -2, -1, -2, 3, -1, -2, 2
RandomEnd:
EXPORT ScrollNintendoOut