ref: 59cb57b9545e1aaba5d45f1a627abf082edea7a9
parent: b275df6974eb030d7d114eb4bfddeff9163311b3
author: yenatch <[email protected]>
date: Wed Jul 31 15:17:35 EDT 2013
more cleanup
--- a/main.asm
+++ b/main.asm
@@ -9322,10 +9322,10 @@
push bc
ld a, [hROMBank]
push af
- ld a, $3
+ ld a, BANK(Functiond244)
rst Bankswitch
- call $5244
+ call Functiond244
pop bc
ld a, b
rst Bankswitch
@@ -20993,10 +20993,10 @@
Functiond27b: ; d27b
ld a, l
- cp $92
+ cp TMsHMsEnd % $100
ret nz
ld a, h
- cp $d8
+ cp TMsHMsEnd / $100
ret
; d283
@@ -21003,19 +21003,19 @@
Functiond283: ; d283
ld c, $14
ld a, e
- cp $92
+ cp TMsHMsEnd % $100
jr nz, .asm_d28e
ld a, d
- cp $d8
+ cp TMsHMsEnd / $100
ret z
.asm_d28e
ld c, $32
ld a, e
- cp $f1
+ cp BallsEnd % $100
jr nz, .asm_d299
ld a, d
- cp $d8
+ cp BallsEnd / $100
ret z
.asm_d299
@@ -21029,7 +21029,7 @@
inc hl
ld a, [CurItem]
ld c, a
- ld b, $0
+ ld b, 0
.asm_d2a5
ld a, [hli]
cp $ff
@@ -33128,7 +33128,6 @@
; 2c059
-
Function2c059: ; 2c059
ld a, [de]
push af
@@ -33188,11 +33187,11 @@
Function2c095: ; 2c095
ld hl, .data_2c0a9
ld de, $d004
- ld bc, $0004
+ ld bc, 4
call CopyBytes
ld hl, $c57a
- ld de, rIE
- jr .asm_2c0f1
+ ld de, -1
+ jr Function2c0f1
.data_2c0a9
db $73
@@ -33199,76 +33198,48 @@
db $77
db $6f
db $76
- db $21
- db $c1
- db $40
- db $11
- db $4
- db $d0
- db $1
- db $4
- db $0
- db $cd
- db $26
- db $30
- db $21
- db $7a
- db $c5
- db $11
- db $ff
- db $ff
- db $18
- db $30
- db $73
- db $5c
- db $6f
- db $76
- db $21
- db $ed
- db $40
- db $11
- db $4
- db $d0
- db $1
- db $4
- db $0
- db $cd
- db $26
- db $30
- db $21
- db $c9
- db $c4
- db $11
- db $1
- db $0
- db $cd
- db $f1
- db $40
- db $fa
- db $2d
- db $d2
- db $3d
- db $c0
- db $fa
- db $4
- db $d2
- db $3d
- db $cd
- db $93
- db $33
- db $c8
- db $21
- db $b5
- db $c4
- db $36
- db $5d
- db $c9
+; 2c0ad
+
+Function2c0ad: ; 2c0ad
+ ld hl, .data_2c0c1
+ ld de, $d004
+ ld bc, 4
+ call CopyBytes
+ ld hl, $c57a
+ ld de, -1
+ jr Function2c0f1
+
+.data_2c0c1
+ db $73, $5c, $6f, $76
+; 2c0c5
+
+Function2c0c5: ; 2c0c5
+ ld hl, .data_2c0ed
+ ld de, $d004
+ ld bc, 4
+ call CopyBytes
+ ld hl, $c4c9
+ ld de, 1
+ call Function2c0f1
+ ld a, [IsInBattle]
+ dec a
+ ret nz
+ ld a, [TempEnemyMonSpecies]
+ dec a
+ call CheckSeenMon
+ ret z
+ ld hl, $c4b5
+ ld [hl], $5d
+ ret
+
+.data_2c0ed
db $6d
db $74
db $78
db $76
+; 2c0f1
-.asm_2c0f1
+Function2c0f1: ; 2c0f1
ld a, [$d004]
ld [hl], a
ld bc, $0014
@@ -33287,7 +33258,6 @@
ld [hl], a
ret
; 2c10d
-
Function2c10d: ; 2c10d
--- a/wram.asm
+++ b/wram.asm
@@ -1705,21 +1705,25 @@
SECTION "Items",BSS[$d859]
TMsHMs: ; d859
ds 57
+TMsHMsEnd
NumItems: ; d892
ds 1
Items: ; d893
ds 41
+ItemsEnd
NumKeyItems: ; d8bc
ds 1
KeyItems: ; d8bd
ds 26
+KeyItemsEnd
NumBalls: ; d8d7
ds 1
Balls: ; d8d8
ds 25
+BallsEnd
SECTION "overworld",BSS[$d95b]
WhichRegisteredItem: ; d95b