diff --git a/Code/edit.asm b/Code/edit.asm index ff32daf..0d0746e 100644 --- a/Code/edit.asm +++ b/Code/edit.asm @@ -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+] diff --git a/Code/nintendo-out.asm b/Code/nintendo-out.asm index f7e0de9..13cba10 100644 --- a/Code/nintendo-out.asm +++ b/Code/nintendo-out.asm @@ -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 diff --git a/rom.gb b/rom.gb index 51762ff..737e3bb 100644 Binary files a/rom.gb and b/rom.gb differ