Skip to content

Commit

Permalink
Merge pull request #521 from red031000/master
Browse files Browse the repository at this point in the history
sync bag.c with heartgold
  • Loading branch information
red031000 authored Jul 3, 2023
2 parents d58ea76 + bc7153d commit 2f964cb
Show file tree
Hide file tree
Showing 38 changed files with 1,598 additions and 774 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ clean: mostlyclean clean-fs clean-tools
clean-fs:
$(RM) $(filter %.narc %.arc,$(HOSTFS_FILES))
$(RM) $(patsubst %.narc,%.naix,$(patsubst %.arc,%.naix,$(filter %.narc %.arc,$(HOSTFS_FILES))))
$(RM) $(NCGR_CLEAN_LIST) $(NCLR_CLEAN_LIST) $(NCER_CLEAN_LIST) $(FS_CLEAN_LIST)
$(RM) $(NCGR_CLEAN_LIST) $(NCLR_CLEAN_LIST) $(NCER_CLEAN_LIST) $(NANR_CLEAN_LIST) $(FS_CLEAN_LIST)
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' \) -exec $(RM) {} +
$(RM) files/msgdata/msg/narc_*.bin

Expand Down Expand Up @@ -283,6 +283,9 @@ $(NCPR_NCLR_FILES): GFX_FLAGS = -ncpr
%.NCER: %.json
$(GFX) $< $@

%.NANR: %.json
$(GFX) $< $@

%.NSCR: %_map.json
$(GFX) $< $@ $(GFX_FLAGS)

Expand Down
6 changes: 3 additions & 3 deletions arm9/asm/unk_02035068.s
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ _020360EA:
ldr r1, _0203627C ; =UNK_020F2A90
add r0, r7, #0x0
mov r2, #0xb
bl CreateBagView
bl Bag_CreateView
mov r1, #0x7e
lsl r1, r1, #0x2
add r3, r5, #0x0
Expand Down Expand Up @@ -3141,7 +3141,7 @@ _020369C6:
mov r1, #0x4
add r2, sp, #0x8
add r3, #0x1
bl sub_0206F17C
bl BagCursor_Field_PocketGetPosition
mov r0, #0x7e
add r2, sp, #0x8
lsl r0, r0, #0x2
Expand Down Expand Up @@ -3188,7 +3188,7 @@ sub_02036A14: ; 0x02036A14
ldrb r3, [r3, #0x1]
ldr r0, [r0, #0x0]
mov r1, #0x4
bl sub_0206F190
bl BagCursor_Field_PocketSetPosition
mov r1, #0x7e
lsl r1, r1, #0x2
ldr r1, [r4, r1]
Expand Down
2 changes: 1 addition & 1 deletion arm9/asm/unk_020372D4.s
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ sub_02037400: ; 0x02037400
mov r1, #0xb
bl sub_02034A28
mov r0, #0xb
bl sub_0206F164
bl BagCursor_New
add r1, r4, #0x0
add r1, #0x94
str r0, [r1, #0x0]
Expand Down
4 changes: 2 additions & 2 deletions arm9/asm/unk_020377F0.s
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ sub_02037844: ; 0x02037844
bl Save_Bag_Get
ldr r1, _02037898 ; =UNK_020F2BDC
mov r2, #0xb
bl CreateBagView
bl Bag_CreateView
add r3, r5, #0x0
add r3, #0x94
ldr r1, [r5, #0xc]
Expand Down Expand Up @@ -328,7 +328,7 @@ _020378C8:
add r0, r6, #0x0
ldr r1, [r1, #0x0]
mov r2, #0x20
bl CreateBagView
bl Bag_CreateView
add r3, r5, #0x0
add r3, #0x94
ldr r1, [r5, #0xc]
Expand Down
2 changes: 1 addition & 1 deletion arm9/asm/unk_0208898C.s
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sub_020889B0: ; 0x020889B0
str r0, [r4, #0x0]
str r5, [r4, #0x10]
ldr r0, [r4, #0x0]
bl sub_0206F164
bl BagCursor_New
str r0, [r4, #0xc]
ldr r0, [r5, #0x4]
cmp r0, #0x1
Expand Down
28 changes: 14 additions & 14 deletions arm9/global.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5024,22 +5024,22 @@
.extern Bag_PocketNotEmpty
.extern Bag_GetQuantity
.extern Pocket_GetQuantity
.extern CreateBagView
.extern Bag_CreateView
.extern Bag_GetPocketSlotN
.extern Save_Bag_Get
.extern sub_0206F164
.extern sub_0206F17C
.extern sub_0206F18C
.extern sub_0206F190
.extern sub_0206F19C
.extern sub_0206F1A0
.extern sub_0206F1AC
.extern sub_0206F1B0
.extern sub_0206F1B4
.extern sub_0206F1B8
.extern sub_0206F1C0
.extern sub_0206F1E4
.extern sub_0206F1EC
.extern BagCursor_New
.extern BagCursor_Field_PocketGetPosition
.extern BagCursor_Field_GetPocket
.extern BagCursor_Field_PocketSetPosition
.extern BagCursor_Field_SetPocket
.extern BagCursor_Battle_PocketGetPosition
.extern BagCursor_Battle_GetLastUsedItem
.extern BagCursor_Battle_GetLastUsedPocket
.extern BagCursor_Battle_GetPocket
.extern BagCursor_Battle_PocketSetPosition
.extern BagCursor_Battle_Init
.extern BagCursor_Battle_SetLastUsedItem
.extern BagCursor_Battle_SetPocket
.extern sub_0206F3B8
.extern sub_0206F3D8
.extern sub_0207008C
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/06/asm/overlay_06.s
Original file line number Diff line number Diff line change
Expand Up @@ -11163,7 +11163,7 @@ ov06_0223ECF0: ; 0x0223ECF0
bl Save_Bag_Get
ldr r1, _0223ED48 ; =0x0224F47C
mov r2, #0xb
bl CreateBagView
bl Bag_CreateView
add r3, r5, #0
str r0, [r4, #4]
add r3, #0x94
Expand Down
16 changes: 8 additions & 8 deletions arm9/overlays/09/asm/overlay_09.s
Original file line number Diff line number Diff line change
Expand Up @@ -3808,7 +3808,7 @@ _02213CA8:
bl ov11_02230218
add r1, r4, #0
add r2, r6, #0
bl sub_0206F1E4
bl BagCursor_Battle_SetLastUsedItem
pop {r3, r4, r5, r6, r7, pc}

thumb_func_start ov09_02213CB8
Expand Down Expand Up @@ -12685,18 +12685,18 @@ _02218730:
add r1, r5, #0
add r2, r2, r5
add r3, r3, r5
bl sub_0206F1A0
bl BagCursor_Battle_PocketGetPosition
add r0, r5, #1
lsl r0, r0, #0x18
lsr r5, r0, #0x18
cmp r5, #5
blo _02218730
add r0, r6, #0
bl sub_0206F1AC
bl BagCursor_Battle_GetLastUsedItem
ldr r1, [r4]
strh r0, [r1, #0x20]
add r0, r6, #0
bl sub_0206F1B0
bl BagCursor_Battle_GetLastUsedPocket
ldr r1, [r4]
strb r0, [r1, #0x1f]
add r0, r4, #0
Expand Down Expand Up @@ -12873,7 +12873,7 @@ ov09_02218888: ; 0x02218888
ldr r0, [r4]
ldr r0, [r0]
bl ov11_02230218
bl sub_0206F1B4
bl BagCursor_Battle_GetPocket
ldr r1, _02218950 ; =0x0000114D
strb r0, [r4, r1]
add r0, r4, #0
Expand Down Expand Up @@ -13687,7 +13687,7 @@ _02218F4E:
ldrb r2, [r2]
ldrb r3, [r3]
add r1, r4, #0
bl sub_0206F1B8
bl BagCursor_Battle_PocketSetPosition
add r0, r4, #1
lsl r0, r0, #0x18
lsr r4, r0, #0x18
Expand All @@ -13696,7 +13696,7 @@ _02218F4E:
ldr r1, _02218F8C ; =0x0000114D
add r0, r6, #0
ldrb r1, [r5, r1]
bl sub_0206F1EC
bl BagCursor_Battle_SetPocket
_02218F78:
ldr r0, [r5]
mov r1, #1
Expand Down Expand Up @@ -14300,7 +14300,7 @@ ov09_0221944C: ; 0x0221944C
bl ov11_02230218
add r1, r4, #0
add r2, r6, #0
bl sub_0206F1E4
bl BagCursor_Battle_SetLastUsedItem
pop {r3, r4, r5, r6, r7, pc}

thumb_func_start ov09_02219474
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/11/asm/ov11_0222D5C0_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ _0222DC42:
bl ov11_0222FE94
add r0, r4, #0
bl ov11_02230218
bl sub_0206F1C0
bl BagCursor_Battle_Init
mov r0, #5
mov r1, #4
mov r2, #0
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/11/asm/ov11_0223D1DC.s
Original file line number Diff line number Diff line change
Expand Up @@ -4708,7 +4708,7 @@ _0223F598:
bl ov11_02230218
ldrh r1, [r6]
ldrb r2, [r6, #2]
bl sub_0206F1E4
bl BagCursor_Battle_SetLastUsedItem
_0223F5D2:
ldrh r1, [r6]
mov r0, #0x4a
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/14/asm/overlay_14.s
Original file line number Diff line number Diff line change
Expand Up @@ -5810,7 +5810,7 @@ _021DA41E:
bl Save_Bag_Get
ldr r1, _021DA5D8 ; =ov14_021E6264
mov r2, #9
bl CreateBagView
bl Bag_CreateView
mov r1, #0x85
lsl r1, r1, #2
str r0, [r4, r1]
Expand Down
8 changes: 4 additions & 4 deletions arm9/overlays/75/asm/overlay_75.s
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ _021E74AE:
ldr r0, [r0, #0x6c]
add r2, #1
add r3, sp, #0
bl sub_0206F17C
bl BagCursor_Field_PocketGetPosition
add r0, sp, #0
ldrb r0, [r0, #1]
cmp r0, #0
Expand All @@ -1139,7 +1139,7 @@ _021E74F2:
add r0, #0xc4
ldr r0, [r0]
ldr r0, [r0, #0x6c]
bl sub_0206F18C
bl BagCursor_Field_GetPocket
mov r1, #0
mov r3, #0xc
_021E7502:
Expand Down Expand Up @@ -1195,7 +1195,7 @@ _021E7540:
ldr r0, [r0, #0x6c]
lsr r2, r2, #0x18
lsr r3, r3, #0x18
bl sub_0206F190
bl BagCursor_Field_PocketSetPosition
add r4, r4, #1
add r5, #0xc
cmp r4, #8
Expand All @@ -1210,7 +1210,7 @@ _021E7568:
mul r1, r2
add r1, r7, r1
ldrb r1, [r1, #8]
bl sub_0206F19C
bl BagCursor_Field_SetPocket
_021E757E:
pop {r3, r4, r5, r6, r7, pc}
thumb_func_end ov75_021E752C
Expand Down
Loading

0 comments on commit 2f964cb

Please sign in to comment.