Here's an example.... This may be the sanity thing you mentioned ages ago. But anyway>
The time limit for submarine is set 2 times [Both code areas are used on every level at Gold Saucer and in story version)
at
Code: [Select]
Code:
0077F7B2 (table) and again from table at 0077DAB6 (hardcode)
In this case, the table version is the one that is reflected in game.
In other areas, like the enemy submarines energy, it's the hardcode that takes precedence.
I have no idea what is what tbh. I don't think it's a very realistic task to figure out which parts are actually being used. Or perhaps
they all are in different places at different times.
================
The actual map used and some starting values for each mode (0 is the story version) is here:
77F131 (which originates at 77DA14)
Code: [Select]
Code:
0 [77F156] Story versionMap: 00996F10 (Map 7)Data 1: 00988CF8Data 2: 00997F6C 1 [77F191] Mako Battle at Gold SaucerMap: 00994708 (Map 6)Data 1: 00988CF8Data 2: 009957642 [77F1CC] Level 1 at Gold SaucerMap: 00991F00 (Map 5)Data 1: 00988CF8Data 2: 00992F5C3 [77F207] Level 2 at Gold SaucerMap: 0098F6F8 (Map 4)Data 1: 00988CF8Data 2: 009907544 [77F23F] Level 3 at Gold SaucerMap: 0098CEF0 (Map 3)Data 1: 00988CF8Data 2: 0098DF4C5 [77F277] Level 4 at Gold Saucer@Map: 0098A6E8 (Map 2)Data 1: 00988CF8Data 2: 0098B744
Multiple maps at 981000 (unused?)
Notice straight after the maps above is a table
like the one at 997F18
It generally starts with a time value (which is never used to decide the time).
These tables are the enemy submarine data (as far as I can see) in table form.
However, this data is duplicated as hard-code.
I haven't checked yet, but I bet zeroing these tables does nothing to the game.
My only theory is that once upon a time.. there were gonna be 6 unique levels
each with their own time limit. But I can't be sure what is going on really.
========================
What I am doing at the moment is hijacking the code at
Code: [Select]
Code:
77DA14 (mov ax,[00E74760])
Which pulls the current submarine mode (0-5).
With this I can then set my own default values, like time limit (for each level) by forcing my own value over the one that is used (in this case of time limit, the address 980DD0).
The only time limit value used across ALL games is at 980DD0, which is set at 77DAB0.
But given multiple tables exist, is there any way to set the time and some other values from those instead? The real question is... Are the tables (apart from 9884F8) at the following addresses redundant in favour of their hard-coded counterparts?
Code: [Select]
Code:
997F18995710992F089907009884F8 (actual used time limit value is taken from this table)98DEF898B6F0987018 (strangely, time limit value here differs from 8CA0).
Other instances of time limit (8CA0) [i..e, hard-coded versions of above tables]
at:
Code: [Select]
Code:
77F7B2 (hard-code)77FC5E (hard-code) [Corresponds to 987018]780DB6 (hard-code)78346E (hard-code)785B26 (hard-code)787698 (hard-code) and 7876D4 (hard-code) [Prob corresponds to 990700 and 990718]788B56 (hard-code)78A458 (hard-code)