From 377bd14ea67d6177250fb401e12d7dfcf44e2cf6 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Wed, 9 Jun 2021 22:54:21 -0500 Subject: Dungeon pokemon/Floor ID JSON Part 1 (#39) * move Thunderwave and Tiny Woods pokemon to json * rule tweaking to actually build tool before parsing JSON * delete .inc pokemon for tiny Woods and Thunderwave * silence git complaining about br_ips and ips_patch * use defines for species and pass the header file for species * convert sinister woods * convert MtThunderPeak * convert silent chasm * add trial floor_id w/ tiny woods * change make rule name to fix compile * MtSteel converted and bugfix * convert few floor headers and great canyon pokemon * code cleanup * unify unkData into UnkTextStruct2 * more code cleanup and some text decomp * doc more funcs and decomp/split some stuff * document more save stuff * more save work and move some data * pika sniped UpdateNatureTotal * decomp a litle and convert a few more dungeons * better scanning for json files * mt freeze and peak --- src/memory_mid.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/memory_mid.c') diff --git a/src/memory_mid.c b/src/memory_mid.c index 32628cb..1eb707c 100644 --- a/src/memory_mid.c +++ b/src/memory_mid.c @@ -15,32 +15,32 @@ void *DoAlloc(struct HeapDescriptor *, s32, u32); void FatalError(u32 *, u32 *, ...) __attribute__((noreturn)); -s32 _LocateSet(struct HeapDescriptor *heap, s32 size, s32 param_3) +s32 _LocateSet(struct HeapDescriptor *heap, s32 size, s32 group) { s32 index; struct HeapDescriptor * uVar2; - s32 uVar3; + s32 atb; if (heap == NULL) { heap = &gMainHeapDescriptor; } // Set some sort flag/attr? - uVar3 = param_3 >> 8 | 1; + atb = group >> 8 | 1; // Reset it? - param_3 = param_3 & 0xff; + group = group & 0xff; - if ((uVar3 & 2) != 0) { - index = MemorySearchFromFront(heap,uVar3,size); + if ((atb & 2) != 0) { + index = MemorySearchFromFront(heap,atb,size); if (index < 0) goto error; - uVar2 = _LocateSetFront(heap,index,uVar3,size,param_3); + uVar2 = _LocateSetFront(heap,index,atb,size,group); return uVar2->freeCount; } else { - index = MemorySearchFromBack(heap,uVar3,size); + index = MemorySearchFromBack(heap,atb,size); if (index < 0) goto error; - uVar2 = _LocateSetBack(heap,index,uVar3,size,param_3); + uVar2 = _LocateSetBack(heap,index,atb,size,group); return uVar2->freeCount; } @@ -49,7 +49,7 @@ error: // atb %02x grp %3d FatalError(&gUnknown_80B7F14, &gUnknown_80B7F20, - heap,size,uVar3,param_3); + heap,size,atb,group); } void *MemoryAlloc(s32 size, s32 b) -- cgit v1.2.3