Actor: Start list of actor types, add .data to Actor init, document some types, parse more spawn tables.#35
Actor: Start list of actor types, add .data to Actor init, document some types, parse more spawn tables.#35blackgamma7 wants to merge 28 commits into
Conversation
text script for later.
…ean up clanpot data
id actor types
| // NOTE: trying to use unions for these variables for different datatypes (u8[4],u16[2]) | ||
| // may cause mismatch due to "narrowing" | ||
|
|
There was a problem hiding this comment.
I know this is the same comment as below, but moved, but it may be worth better explaining the issue: narrowing is when a wider data type is truncated to fit a smaller data type, ex: s32 -> s16
iirc the discussion on this previously was about a circumstance of 16/8 -> 32 -> 16/8 implied that the source type the compiler saw was smaller, but a literal resulted in int-promotion (ex: lhs is 16 bit but the literal is inherently 32-bit, so it promotes the lhs to 32 bit) which then immediately got narrowed. The tricky part about this is that it caused confusion about the field type because the conversion and odd scheduling around the implicit cast.
There was a problem hiding this comment.
the spacing around {} and // and = are inconsistent
| typedef s32 intptr_t; // sometimes, pointers need to be treated as int's to match. | ||
| typedef u32 uintptr_t; // sometimes, pointers need to be treated as int's to match. |
There was a problem hiding this comment.
| typedef s32 intptr_t; // sometimes, pointers need to be treated as int's to match. | |
| typedef u32 uintptr_t; // sometimes, pointers need to be treated as int's to match. | |
| typedef s32 sptr; // sometimes, pointers need to be treated as int's to match. | |
| typedef u32 uptr; // sometimes, pointers need to be treated as int's to match. |
I think this reads better and is more consistent with existing primitive type typedefs
There was a problem hiding this comment.
I looked through the other decomp projects - they also used the intptr_t typedef. I think using would make it more consistent with them.
| #define SCENE_BEESTHEONE 0x4E | ||
| #define SCENE_INNERSTRUGGLE 0x4F | ||
| #define SCENE_UNK80 0x50 // crash. data suggest more stages were planned for world 5. | ||
| #define SCENE_UNK80 0x50 // crash. data suggest more stages were planned for world 5. Also index of "level clear" graphics. |
There was a problem hiding this comment.
There are 88 scenes. I'm pretty sure this one is a valid scene. Maybe it requires a certain gamestate? It has mostly valid data anyway.
This is what I see in the data at least:
- It's actual collision data is set up coherently
- The functions which are called when the scene is loaded are not null
- It builds the scene collision with collision pages 0000, 0001, 0002 (these blank pages)
- asset rows are populated (besides 4/5, which is unusual I guess)
Since the collision is just pages of zero-bytes, I suspect if you load in with the player, you either get a 'missing 0xC0 blocks' crash or some sort of render crash with bogus assets.
| #define PLAYER_INDEX 0 | ||
|
|
||
| // actor 0 is always the player character, Marina | ||
| #define gMarina gActors[PLAYER_INDEX] |
There was a problem hiding this comment.
| #define gMarina gActors[PLAYER_INDEX] | |
| #define gPlayerActor gActors[PLAYER_INDEX] |
the PC isn't always Marina. Teran also uses this slot (as well as a couple more,) so 'player actor' is probably the better name here.
There was a problem hiding this comment.
I looked at the memory in that area while playing Teran's levels - the type and HP remained Marina's. I think there's some not-yet documented trickery to hide them and give to control to Teran.
This is beautiful. I skimmed through all your changes and no issues stood out. I agree that |
As noted in a previous comment,
Yeah, I didn't want to touch those just yet, lest I break something. |
#definefor Marina player actor