diff options
author | scnorton <scnorton@biociphers.org> | 2017-07-11 11:18:31 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-07-11 11:18:31 -0400 |
commit | e9e2f4f5cf1ca2801d31453eeb6b7ea646f6d48d (patch) | |
tree | 97030033a9cf709c88774443bcd672df05982f87 /src | |
parent | 37ffd07ac741016f8da662f9cf416c82ffd269d7 (diff) |
Futile attempt to get sub_80BBDD0 matching
Diffstat (limited to 'src')
-rw-r--r-- | src/secret_base.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/secret_base.c b/src/secret_base.c index a5074c4e0..c35797168 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -418,6 +418,8 @@ void sub_80BBCCC(u8 flagIn) } #ifdef NONMATCHING +// The only nonmatching property of this function is that the implicit variables &gSaveBlock1 and &roomdecor[decidx] +// are stored in the wrong registers. void sub_80BBDD0(void) { u8 *roomdecor; @@ -437,20 +439,19 @@ void sub_80BBDD0(void) ndecor = 16; } for (decidx=0; decidx<ndecor; decidx++) { - if (roomdecor[decidx] == 0) - continue; - if (gDecorations[roomdecor[decidx]].permission != DECORPERM_SOLID_MAT) - continue; - for (objid=0; objid<gMapHeader.events->mapObjectCount; objid++) { - if (gMapHeader.events->mapObjects[objid].flagId == gSpecialVar_0x8004 + 0xAE) - break; - } - if (objid != gMapHeader.events->mapObjectCount) { + if (roomdecor[decidx] != 0 && gDecorations[roomdecor[decidx]].permission == DECORPERM_SOLID_MAT) + { + for (objid=0; objid<gMapHeader.events->mapObjectCount; objid++) { + if (gMapHeader.events->mapObjects[objid].flagId == gSpecialVar_0x8004 + 0xAE) + break; + } + if (objid == gMapHeader.events->mapObjectCount) + continue; gSpecialVar_0x8006 = roomdecorpos[decidx] >> 4; gSpecialVar_0x8007 = roomdecorpos[decidx] & 0xF; metatile = MapGridGetMetatileBehaviorAt(gSpecialVar_0x8006 + 7, gSpecialVar_0x8007 + 7); - if (sub_80572D8(metatile) == 1 || sub_80572EC(metatile) == 1) { - gScriptResult = gMapHeader.events->mapObjects[objid].graphicsId + 0x3f20; + if (sub_80572D8(metatile) == TRUE || sub_80572EC(metatile) == TRUE) { + gScriptResult = gMapHeader.events->mapObjects[objid].graphicsId + VAR_0x3F20; VarSet(gScriptResult, gDecorations[roomdecor[decidx]].tiles[0]); gScriptResult = gMapHeader.events->mapObjects[objid].localId; FlagReset(gSpecialVar_0x8004 + 0xAE); |