shithub: pokecrystal

Download patch

ref: b65fe57db61c8b4528092ca7cd13f33e559e33d2
parent: 15a03a2577a46d8f2362db090b1de4d7c559b735
author: PikalaxALT <PikalaxALT@gmail.com>
date: Fri Dec 11 06:50:49 EST 2015

Simplify EnlargedTiles

--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -256,7 +256,7 @@
 	jr FoundOne
 
 FoundOne: ; c292
-	ld a, $1
+	ld a, TRUE
 	ld [ScriptVar], a
 	ret
 
@@ -334,11 +334,11 @@
 	call GetSRAMBank
 	ld a, [sMysteryGiftItem]
 	ld [CurItem], a
-	ld a, $1
+	ld a, 1
 	ld [wItemQuantityChangeBuffer], a
 	ld hl, NumItems
 	call ReceiveItem
-	jr nc, .asm_c33d
+	jr nc, .no_room
 	xor a
 	ld [sMysteryGiftItem], a
 	call CloseSRAM
@@ -347,11 +347,11 @@
 	call GetItemName
 	ld hl, .ReceiveItemText
 	call PrintText
-	ld a, $1
+	ld a, TRUE
 	ld [ScriptVar], a
 	ret
 
-.asm_c33d
+.no_room
 	call CloseSRAM
 	xor a
 	ld [ScriptVar], a
@@ -433,35 +433,35 @@
 	ld hl, Coins
 	ld a, [hli]
 	or [hl]
-	jr z, .asm_c3c4
+	jr z, .no_coins
 	ld a, COIN_CASE
 	ld [CurItem], a
 	ld hl, NumItems
 	call CheckItem
-	jr nc, .asm_c3c9
+	jr nc, .no_coin_case
 	and a
 	ret
 
-.asm_c3c4
-	ld hl, UnknownText_0xc3d1
-	jr .asm_c3cc
+.no_coins
+	ld hl, .NoCoinsText
+	jr .print
 
-.asm_c3c9
-	ld hl, UnknownText_0xc3d6
+.no_coin_case
+	ld hl, .NoCoinCaseText
 
-.asm_c3cc
+.print
 	call PrintText
 	scf
 	ret
 ; c3d1
 
-UnknownText_0xc3d1: ; 0xc3d1
+.NoCoinsText: ; 0xc3d1
 	; You have no coins.
 	text_jump UnknownText_0x1bd3d7
 	db "@"
 ; 0xc3d6
 
-UnknownText_0xc3d6: ; 0xc3d6
+.NoCoinCaseText: ; 0xc3d6
 	; You don't have a COIN CASE.
 	text_jump UnknownText_0x1bd3eb
 	db "@"
@@ -557,7 +557,7 @@
 	ld hl, .ProximityCoords
 .loop
 	ld a, [hli]
-	cp $ff
+	cp -1
 	jr z, .nope
 	cp b
 	jr nz, .nextcoord
@@ -565,7 +565,7 @@
 	cp c
 	jr nz, .loop
 
-	ld a, $1
+	ld a, TRUE
 	jr .done
 
 .nextcoord
@@ -585,7 +585,7 @@
 	db 35, 10 ; below
 	db 36,  8 ; right
 	db 36,  9 ; right
-	db $ff
+	db -1
 
 
 PlayCurMonCry: ; c472
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -755,29 +755,12 @@
 ; e16b7
 
 .EnlargedTiles: ; e16b7
-doubletile: MACRO
-rept _NARG
-x = 0
-y = 0
-rept 4
-x = x + (3 * (1 << (2 * y))) * ((\1 >> y) & 1)
-y = y + 1
-endr
-	db x
-	shift
-endr
-endm
 
-__x__ = 0
+x = 0
 rept 16
-	doubletile __x__
-__x__ = __x__ + 1
+	db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11)
+x = x + 1
 endr
-
-	; db $00, $03, $0c, $0f
-	; db $30, $33, $3c, $3f
-	; db $c0, $c3, $cc, $cf
-	; db $f0, $f3, $fc, $ff
 ; e16c7
 
 UnownPuzzle_AddPuzzlePieceBorders: ; e16c7
@@ -838,14 +821,14 @@
 ; e1703
 
 GFXHeaders: ; e1703
-	dw .TileBordersGFX + $00, VTiles0 tile $00
-	dw .TileBordersGFX + $10, VTiles0 tile $01
-	dw .TileBordersGFX + $20, VTiles0 tile $02
-	dw .TileBordersGFX + $30, VTiles0 tile $0c
-	dw .TileBordersGFX + $40, VTiles0 tile $0e
-	dw .TileBordersGFX + $50, VTiles0 tile $18
-	dw .TileBordersGFX + $60, VTiles0 tile $19
-	dw .TileBordersGFX + $70, VTiles0 tile $1a
+	dw .TileBordersGFX + 0 tiles, VTiles0 tile $00
+	dw .TileBordersGFX + 1 tiles, VTiles0 tile $01
+	dw .TileBordersGFX + 2 tiles, VTiles0 tile $02
+	dw .TileBordersGFX + 3 tiles, VTiles0 tile $0c
+	dw .TileBordersGFX + 4 tiles, VTiles0 tile $0e
+	dw .TileBordersGFX + 5 tiles, VTiles0 tile $18
+	dw .TileBordersGFX + 6 tiles, VTiles0 tile $19
+	dw .TileBordersGFX + 7 tiles, VTiles0 tile $1a
 ; e1723
 
 .TileBordersGFX: ; e1723