shithub: pokecrystal

Download patch

ref: 000c6d134952b8fdf9cae24792c91b64348c5db7
parent: 8ecd66f5d58087988fdd4a8aaffb0c380914da4c
author: yenatch <[email protected]>
date: Thu Aug 15 02:06:50 EDT 2013

CheckContestMon and a couple labels in bank 0

--- a/constants.asm
+++ b/constants.asm
@@ -236,6 +236,7 @@
 PREDEF_PRINT_TYPE EQU $2B
 PREDEF_GET_UNOWN_LETTER EQU $2D
 PREDEF_LOAD_SGB_LAYOUT EQU $31
+PREDEF_CHECK_CONTEST_MON EQU $33
 PREDEF_PARTYMON_ITEM_NAME EQU $3B
 PREDEF_DECOMPRESS EQU $40
 
--- a/main.asm
+++ b/main.asm
@@ -143,10 +143,14 @@
 	call Function245
 	call ClearSprites
 	call Function270
-	ld a, $1
+
+
+	ld a, BANK(Function4031)
 	rst Bankswitch
+	call Function4031
 
-	call $4031
+; Note that Function642e is called later assuming it's in the same bank.
+
 	xor a
 	ld [$ffde], a
 	ld [$ffcf], a
@@ -164,25 +168,22 @@
 	ld [rLCDC], a
 	ld a, $ff
 	ld [$ffcb], a
-	ld a, $2
-	ld hl, $5890
-	rst FarCall
+	callba Function9890
 	ld a, $9c
 	ld [$ffd7], a
 	xor a
 	ld [hBGMapAddress], a
-	ld a, $5
-	ld hl, $4089
-	rst FarCall
+	callba Function14089
 	xor a
 	ld [$6000], a
 	ld [$0000], a
+
 	ld a, [hCGB]
 	and a
 	jr z, .asm_22b
 	call Function2ff7
-
 .asm_22b
+
 	xor a
 	ld [rIF], a
 	ld a, $f
@@ -194,7 +195,7 @@
 	call CleanSoundRestart
 	xor a
 	ld [CurMusic], a
-	jp $642e
+	jp Function642e
 ; 245
 
 Function245: ; 245
@@ -319,7 +320,7 @@
 	ld a, [hCGB]
 	and a
 	jr z, .asm_4af
-	ld hl, $0517
+	ld hl, IncGradGBPalTable_00
 	ld b, $4
 	jr Function4c7
 
@@ -20963,7 +20964,7 @@
 	dwb $5853, $02
 	dwb $464c, $02 ; LoadSGBLayout, BANK(LoadSGBLayout)
 	dwb $5d11, $24
-	dwb $4a88, $02
+	dwb CheckContestMon, BANK(CheckContestMon)
 	dwb $420f, $23
 	dwb $4000, $23
 	dwb $4000, $23
@@ -21052,7 +21053,7 @@
 ; 8a88
 
 
-Function8a88: ; 8a88
+CheckContestMon: ; 8a88
 	ld a, [hl]
 	cp $a0
 	jr c, .asm_8aa2