Jump to content
  • 0

Map working in one scene, but not another.


giadrosich
 Share

Question

Okay, so I have my forest scene that I've been working on. I'm using a clean rom to test injection offsets and exits before I do it all in the main rom.

 

Injecting it into scene 108 it works perfectly, there's no problems at all. However, I want it in Kokiri Forest. So, I use 0288D000 as the injection offset, and scene 085 in Sharp Ocarina to put it in that place. When I do that though, and I either select it from the map select, or walk into it from Hyrule Field, the game freezes up and it never loads.

 

Is there something going on in Kokiri Forest that won't allow this? If I need to post up the scene from Sharp so someone can take a look, I can do so.

 

EDIT: I've also tried it in other places like Kakariko Village and Lost woods. It also freezes in those places.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

First things first, the injection offsets are where your new map's data will be placed in the ROM, it has nothing to do with the map you're replacing - the only thing that determines what location will be replaced in-game is the scene number. Injecting a map with SO basically writes the new scene and room data to certain spots in the ROM (injection offsets), changes the scene table to now point to the new scene, and leaves the original scene and room data alone, which now goes unused.

 

Try to inject it at the default offsets but with the scene set to 85, then try to enter in the game. If that doesn't work, there's something else going on that I'm not sure about right away.

 

Link to comment
Share on other sites

  • 0

Okay, I gave that a shot, I used 02D00000 as the default injection (which is scene 108) and then used scene 85 in Sharp. It still would not load for me, but also did not load in 117 (as I figured it wouldn't, but just as a side note).

 

As for your explanation of it, I've used the injection offset for a room and a scene, for example, granny's potion shop, I used the injection offset for that as well as used the correct scene number. Does it mess up something if I do that? It seemed to work okay for me, that's why I did the same thing with this map. Thanks for explaining the way this works.

 

Would you like me to give you my xml document to look at? I'm not sure what else to try at this point.

Link to comment
Share on other sites

  • 0

It isn't cutscenes that's plauging the game. The engine is loading the wrong data for the entrance index list. Try adding more start positions, or edit the exit table so that the entrance you're using is start position #1. Kokiri forest has at least 11 start positions. First, the engine is reading false data for the entrance index, then trying to load random data from the link positions list.

Link to comment
Share on other sites

  • 0

It isn't cutscenes that's plauging the game. The engine is loading the wrong data for the entrance index list. Try adding more start positions, or edit the exit table so that the entrance you're using is start position #1. Kokiri forest has at least 11 start positions. First, the engine is reading false data for the entrance index, then trying to load random data from the link positions list.

Not sure if I'm understanding you right, so please bear with me.

 

In Sharp, the spawn points are the start positions. I can't seem to edit those in SharpOcarina other than actor/variable, and exit_changer in ZLE2 only deals with...collision exits, from one area to the other. Not sure how to edit the exit table, or what that even is. x.x

 

I did try adding about four more spawn points, but should I add in all 11? I really don't know what to edit though. Sorry if I'm a bit dumb with this. Just frustrated it would work in one scene but not another.

Link to comment
Share on other sites

  • 0

The entrance index is automatically generated by SharpOcarina, it sounds like. Does your map have multiple entrances? Do they have an equivalent in the Kokiri forest? Or is it just a test map? Try putting in 12 starting positions and your map *should* load

Link to comment
Share on other sites

  • 0

I'll take a look at the scene file.

 

EDIT: I've been working with this for quite some time now, seems I finally figured it out...

 

The game somehow knows approximately or exactly (?) how many collision triangles are supposed to be in a particular scene. I changed the number of collision triangles in the collision header to exactly as many as the Kokiri forest has and - it loaded right up.

 

That good feeling when you get something other than a black screen after pressing 'a' on level select, after hours of frustration...

 

 

EDIT2: If the function at 0x8003BF18 returns 1, the map will not load with all the triangles. If it returns 0, it will load fine (?)

 

EDIT3: this function is definitely a switch case case case case default function:

 

 

0x8003BF18 [ALLCAPS NEMU DUMP SORRY]

 

LH V1, 0x00A4 (A0)
LUI A0, 0x8012
LUI V0, 0x8012
ADDIU V0, V0, 0x9E2C
ADDIU A0, A0, 0x9E52
LH T6, 0x0000 (V0)
ADDIU V0, V0, 0x0002
SLTU AT, V0, A0
BNE V1, T6, 0x8003BF48
NOP
JR RA
ADDIU V0, R0, 0x0001
BNEL AT, R0, 0x8003BF30
LH T6, 0x0000 (V0)
OR V0, R0, R0
JR RA
NOP
LUI V1, 0x8012
LUI V0, 0x8012
ADDIU V0, V0, 0x9E94
ADDIU V1, V1, 0x9E54
LH T6, 0x0000 (V1)
BNEL A0, T6, 0x8003BF8C
LH T8, 0x0008 (V1)
LW T7, 0x0004 (V1)
ADDIU V0, R0, 0x0001
JR RA
SW T7, 0x0000 (A1)
LH T8, 0x0008 (V1)
BNEL A0, T8, 0x8003BFA8
LH T0, 0x0010 (V1)
LW T9, 0x000C (V1)
ADDIU V0, R0, 0x0001
JR RA
SW T9, 0x0000 (A1)
LH T0, 0x0010 (V1)
BNEL A0, T0, 0x8003BFC4
LH T2, 0x0018 (V1)
LW T1, 0x0014 (V1)
ADDIU V0, R0, 0x0001
JR RA
SW T1, 0x0000 (A1)
LH T2, 0x0018 (V1)
BNEL A0, T2, 0x8003BFE0
ADDIU V1, V1, 0x0020
LW T3, 0x001C (V1)
ADDIU V0, R0, 0x0001
JR RA
SW T3, 0x0000 (A1)
ADDIU V1, V1, 0x0020
BNEL V1, V0, 0x8003BF70
LH T6, 0x0000 (V1)
OR V0, R0, R0
JR RA
NOP

 

 

EDIT4: This function was definitely handwritten in MIPS assembly by someone in Nintendo - someone who didn't know their stuff. A few instructions are completely unreachable unless there is stack smashing or other nefarious activity going on. And it shows that this function is poorly written - it's callee has many special case handlers which print out debug text (how I wish I had a proper m64+ setup!)

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.