Merge remote-tracking branch 'origin/develop' into mergeSuluBravo

This commit is contained in:
Adam Bird 2023-08-13 20:50:59 -04:00
commit 633bec3a1c
210 changed files with 2229 additions and 1699 deletions

View File

@ -15,16 +15,8 @@ If you're having any trouble after reading through this `README`, feel free ask
The Ship does not include any copyrighted assets. You are required to provide a supported copy of the game.
### 1. Check your `sha1`
You can verify you have a supported copy of the game by checking the `sha1` hash. There are many ways to do this, one of the simplest is using the [`hasher-js`](https://github.com/snarfblam/hasher-js) webapp hosted at https://www.romhacking.net/hash/.
| Supported Version | `sha1` |
| - | - |
| PAL 1.1 | `cfbb98d392e4a9d39da8285d10cbef3974c2f012` |
| PAL GC | `0227d7c0074f2d0ac935631990da8ec5914597b4` |
| PAL GC (Debug) | `cee6bc3c2a634b41728f2af8da54d9bf8cc14099` |
| PAL MQ (Debug) | `079b855b943d6ad8bd1eb026c0ed169ecbdac7da` |
| PAL MQ (Debug) | `50bebedad9e0f10746a52b07239e47fa6c284d03` |
### 1. Verify your ROM dump
You can verify you have dumped a supported copy of the game by using the compatibility checker at https://ship.equipment/. If you'd prefer to manually validate your ROM dump, you can cross-reference its `sha1` hash with the hashes [here](docs/supportedHashes.json).
### 2. Download The Ship of Harkinian from [Discord](https://discord.com/invite/shipofharkinian)
The latest release is available in the most recent post in the `#downloads` channel.

191
docs/MODDING.md Normal file
View File

@ -0,0 +1,191 @@
# Modding
> So you would like to create a code mod? _BUCKLE UP_
## Preface
Git is required to be installed. Knowing how to use git is going to help, I will list out commands that should set you on the right but without a general understanding you will likely get stuck if you deviate from the happy path.
General coding knowledge is also usually a requirement. You might be able to get by without, but the more knowledgeable the better, as it will allow you to find what you are looking for and troubleshoot much more easily.
## Making a fork in the road
Your first step is to fork the repository. To do this, you will need a github account. Assuming you have a github account you can navigate to the Shipwright repo [here](https://github.com/HarbourMasters/Shipwright) and press the `Fork` button in the top right of the screen. When that process is complete you should land on a page that looks similar to the original repo, but under your username (eg: `https://github.com/<GITHUB USERNAME>/Shipwright`).
On this page you should see a green `Code` button, click this and copy the URL within. (You may use the github desktop app here as well, but I will not provide instructions for it). Then in your terminal/command prompt you will git clone to a local development folder using the copied URL
```bash
cd <path to where you'll clone (eg, ~/Documents)>
git clone https://github.com/<GITHUB USERNAME>/Shipwright.git
```
At this point, I will now direct you to our [BUILDING](building.md) guide, it will have the most up to date documentation on getting the Ship running on your local machine. Once you have successfully built and launched the executable you may return here.
## Look at all those branches!
Congrats, if you have made it this far! Before we start making changes, you will need to create a new branch. It's recommended that you cut all your branches from the `develop` branch, as that tends to be the most up-to-date. Before cutting a branch make sure you are on the `develop` branch with the following command:
```bash
git checkout develop
```
Then cut your branch with the following command:
```bash
git checkout -b <BRANCH NAME>
```
You can name your branch whatever you want, but it's recommended to name it something that describes the feature you are working on. For example, if you are adding a new feature to the ship, you might name your branch `feature/ship-new-feature`. If you are fixing a bug, you might name your branch `bugfix/ship-bugfix`. If you are adding a new mod, you might name your branch `mod/ship-new-mod`. The important thing is to be descriptive and consistent.
## Making the changes
The limit is your imagination. You can add new features, fix bugs, add new mods, or even change the way the game works. We will demonstrate this by creating a mod that changes the speed of the day/night cycle.
Let's being by finding where the time is updated. Thankfully in the save editor we have a slider already hooked up to the time of day so we can check there for reference. The save editor file is at `soh/soh/Enhancements/debugger/debugSaveEditor.cpp`, if we do a quick search within that file for time we will find the following at line 400:
```cpp
const uint16_t dayTimeMin = 0;
const uint16_t dayTimeMax = 0xFFFF;
ImGui::SliderScalar("Time", ImGuiDataType_U16, &gSaveContext.dayTime, &dayTimeMin, &dayTimeMax);
```
So this tells us that `gSaveContext.dayTime` is what we're looking for. Let's now do a global search for this to see if we can find where it is updated. We find the following in `soh/src/code/z_kankyo.c` line 925:
```cpp
if (IS_DAY || gTimeIncrement >= 0x190) {
gSaveContext.dayTime += gTimeIncrement;
} else {
gSaveContext.dayTime += gTimeIncrement * 2; // time moves twice as fast at night
}
```
We can make a quick change to this code to verify this is indeed what we are looking for, lets multiply the the gTimeIncrement by 10:
```diff
if (IS_DAY || gTimeIncrement >= 0x190) {
- gSaveContext.dayTime += gTimeIncrement;
+ gSaveContext.dayTime += gTimeIncrement * 10;
} else {
- gSaveContext.dayTime += gTimeIncrement * 2; // time moves twice as fast at night
+ gSaveContext.dayTime += gTimeIncrement * 2 * 10; // time moves twice as fast at night
}
```
Rebuild the game and launch it, then load a save file. You should see that the time of day is now moving much faster. Terrific! While we could wrap this up and call it a day, we could make this user configurable by making a few more changes. I think a slider would be good for this, there's a slider in the cheat menu that we can use as a reference. Let's find it in `soh/soh/SohMenuBar.cpp` around line 1120:
```cpp
UIWidgets::EnhancementSliderFloat("Hookshot Reach Multiplier: %.1fx", "##gCheatHookshotReachMultiplier", "gCheatHookshotReachMultiplier", 1.0f, 5.0f, "", 1.0f, false);
```
The float values being passed in here are `minimum`, `maximum`, and `default` respectively. We'll make our minimum 0.2 to allow it to move slower, and our maximum 5.0 to allow it to move up to 5x faster. We'll also set the default to 1.0 so that it doesn't change the behavior by default. Copy this line and paste it below, then make the relevant changes:
```cpp
UIWidgets::EnhancementSliderFloat("Time Multiplier: %.1fx", "##gCheatTimeMultiplier", "gCheatTimeMultiplier", 0.2f, 5.0f, "", 1.0f, false);
```
Now we need to replace our hard coded values with the new variable. We can do this by replacing the `10` with a cvar call
```diff
if (IS_DAY || gTimeIncrement >= 0x190) {
- gSaveContext.dayTime += gTimeIncrement * 10;
+ gSaveContext.dayTime += gTimeIncrement * CVarGetFloat("gCheatTimeMultiplier", 1.0f);
} else {
- gSaveContext.dayTime += gTimeIncrement * 2 * 10;
+ gSaveContext.dayTime += gTimeIncrement * 2 * CVarGetFloat("gCheatTimeMultiplier", 1.0f);
}
```
After rebuilding and launching the game, you should now see a new slider in the cheat menu that allows you to change the speed of the day/night cycle. Nice!
If you're ever not sure about how something would be implemented, you can always look at external resources like the [Cloudmodding Wiki](https://wiki.cloudmodding.com/oot/Main_Page) to get a better perspective.
## Are you committed?
Now that we have made our changes, we need to commit them. First we need to add the files we changed to the staging area. We can do this with the following command:
```bash
git add .
```
This will add all the files we changed to the staging area. If you want to add specific files you can do so by replacing the `.` with the file path. For example, if we only wanted to add the `soh/soh/SohMenuBar.cpp` file we would do the following:
```bash
git add soh/soh/SohMenuBar.cpp
```
Now that we have added our files to the staging area, we need to commit them. We can do this with the following command:
```bash
git commit -m "Add time multiplier cheat"
```
You can verify everything was committed correctly by running the following command:
```bash
git status
```
Now push your changes to your fork with the following command:
```bash
git push origin <BRANCH NAME>
```
## Sharing the treasure
Now that you have made your changes, you can share them with the world! You can do this by creating a pull request to your own fork. You can navigate around in the Github UI to find this, or you can use the following replacing the relevant info:
```
https://github.com/<GITHUB USERNAME>/Shipwright/compare/develop...<BRANCH NAME>
```
From there you should see all of your changes listed, and a big green `Create pull request` button. You can fill out relevant information and a title and create the pull request. Once you have done this the CI will begin building distributables for your changes, and when they are ready they will be added to the bottom of your Pull request description! (See other PRs for examples)
Note: DO NOT MERGE THIS PULL REQUEST. You will want your fork's develop branch to stay in sync with the upstream develop branch. We will go over this in the next section, but all changes should stay on their own branches, with open PR's to continue generating distributables.
## Maintaining your fork'in mod
A month has passed, and new features have been added upstream that you want included in your distribution. You can do this by rebasing your branch on top of the upstream develop branch. You can do this with the following commands:
```bash
# This command will add the upstream repository as a remote, only needs to be done once
git remote add upstream https://github.com/HarbourMasters/Shipwright.git
git checkout develop
git pull upstream develop
git checkout <BRANCH NAME>
git pull origin develop --rebase
```
If you happen to run into merge conflicts, it is outside the scope of this tutorial to explain how to resolve them. If you want to abort the rebase you can run the following command:
```bash
git rebase --abort
```
Assuming all went well, you can now push your changes to your fork with the following command:
```bash
git push origin <BRANCH NAME> --force
```
## Combining multiple mods
You have been working on your mod for a while, and you want to combine it with another mod. You can do this by adding the other mod as a remote, and then merging it into your branch. You can do this with the following commands:
```bash
# This command will add the other repository as a remote, only needs to be done once
git remote add <MOD AUTHOR NAME> https://github.com/<MOD AUTHOR>/Shipwright.git
git checkout <YOUR BRANCH NAME>
git pull <MOD AUTHOR NAME> <MOD AUTHOR BRANCH NAME>
```
If you happen to run into merge conflicts, it is outside the scope of this tutorial to explain how to resolve them. If you want to abort the merge you can run the following command:
```bash
git merge --abort
```
Assuming all went well, you can now push your changes to your fork with the following command:
```bash
git push origin <YOUR BRANCH NAME>
```

26
docs/supportedHashes.json Normal file
View File

@ -0,0 +1,26 @@
[
{
"name": "PAL 1.1",
"sha1": "cfbb98d392e4a9d39da8285d10cbef3974c2f012"
},
{
"name": "PAL GC",
"sha1": "0227d7c0074f2d0ac935631990da8ec5914597b4"
},
{
"name": "PAL GC (Debug)",
"sha1": "cee6bc3c2a634b41728f2af8da54d9bf8cc14099"
},
{
"name": "PAL MQ (Debug)",
"sha1": "079b855b943d6ad8bd1eb026c0ed169ecbdac7da"
},
{
"name": "PAL MQ (Debug)",
"sha1": "50bebedad9e0f10746a52b07239e47fa6c284d03"
},
{
"name": "PAL MQ (Debug)",
"sha1": "cfecfdc58d650e71a200c81f033de4e6d617a9f6"
}
]

View File

@ -548,12 +548,16 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
-Wno-missing-field-initializers
-Wno-parentheses
-Wno-narrowing
-Wno-c++11-narrowing
-Wno-implicit-function-declaration
-Wno-missing-braces
-Wno-incompatible-pointer-types
$<$<COMPILE_LANGUAGE:C>:
-Werror-implicit-function-declaration
-Wno-incompatible-pointer-types
>
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
$<$<COMPILE_LANGUAGE:CXX>:
-Wno-c++11-narrowing
-Wno-deprecated-enum-enum-conversion
>
-pthread
)
@ -570,12 +574,16 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
-Wno-missing-field-initializers
-Wno-parentheses
-Wno-narrowing
-Wno-c++11-narrowing
-Wno-implicit-function-declaration
-Wno-missing-braces
-Wno-incompatible-pointer-types
$<$<COMPILE_LANGUAGE:C>:
-Werror-implicit-function-declaration
-Wno-incompatible-pointer-types
>
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
$<$<COMPILE_LANGUAGE:CXX>:
-Wno-c++11-narrowing
-Wno-deprecated-enum-enum-conversion
>
-pthread
)
@ -592,11 +600,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
-Wno-narrowing
-Wno-switch-outside-range
$<$<COMPILE_LANGUAGE:C>:
-Werror-implicit-function-declaration
-Wno-incompatible-pointer-types
-Wno-discarded-array-qualifiers
-Wno-discarded-qualifiers
-Wno-int-conversion
-Wno-implicit-function-declaration
-Wno-builtin-declaration-mismatch
-Wno-switch-unreachable
-Wno-stringop-overflow
@ -616,7 +624,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
-Wno-parentheses
-Wno-narrowing
-Wno-missing-braces
-Wno-incompatible-pointer-types
$<$<COMPILE_LANGUAGE:C>:
-Werror-implicit-function-declaration
-Wno-incompatible-pointer-types
>
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
-pthread

View File

@ -27,6 +27,8 @@ void gSPDisplayList(Gfx* pkt, Gfx* dl);
void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset);
void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0);
void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr);
void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb);
void cleararena(void);
void bootproc(void);
@ -180,6 +182,7 @@ void __osSetWatchLo(u32);
EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params);
EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params);
void EnItem00_CustomItemsParticles(Actor* Parent, PlayState* play, GetItemEntry giEntry);
void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params);
void EffectBlure_ChangeType(EffectBlure* this, int type);
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2);
@ -553,13 +556,25 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3,
void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2);
s32 Flags_GetEventChkInf(s32 flag);
void Flags_SetEventChkInf(s32 flag);
void Flags_UnsetEventChkInf(s32 flag);
s32 Flags_GetItemGetInf(s32 flag);
void Flags_SetItemGetInf(s32 flag);
void Flags_UnsetItemGetInf(s32 flag);
s32 Flags_GetInfTable(s32 flag);
void Flags_SetInfTable(s32 flag);
void Flags_UnsetInfTable(s32 flag);
s32 Flags_GetEventInf(s32 flag);
void Flags_SetEventInf(s32 flag);
void Flags_UnsetEventInf(s32 flag);
s32 Flags_GetRandomizerInf(RandomizerInf flag);
void Flags_SetRandomizerInf(RandomizerInf flag);
void Flags_UnsetRandomizerInf(RandomizerInf flag);
u16 func_80037C30(PlayState* play, s16 arg1);
s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3);
s32 func_80038290(PlayState* play, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4);
GetItemEntry GetChestGameRandoGetItem(s8 room, s16 ogDrawId, PlayState* play);
s16 GetChestGameRandoGiDrawId(s8 room, s16 ogDrawId, PlayState* play);
// ? func_80038600(?);
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList*);
void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest);
@ -1198,10 +1213,12 @@ Gfx* Gfx_SetupDL_66(Gfx* gfx);
Gfx* func_800947AC(Gfx* gfx);
void Gfx_SetupDL_42Opa(GraphicsContext* gfxCtx);
void Gfx_SetupDL_42Overlay(GraphicsContext* gfxCtx);
void Gfx_SetupDL_42Kal(GraphicsContext* gfxCtx);
void Gfx_SetupDL_27Xlu(GraphicsContext* gfxCtx);
void Gfx_SetupDL_60NoCDXlu(GraphicsContext* gfxCtx);
void Gfx_SetupDL_61Xlu(GraphicsContext* gfxCtx);
void Gfx_SetupDL_56Ptr(Gfx** gfxp);
void Gfx_SetupDL_39Kal(GraphicsContext* gfxp);
Gfx* Gfx_BranchTexScroll(Gfx** gfxp, u32 x, u32 y, s32 width, s32 height);
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y);
Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
@ -1336,6 +1353,7 @@ void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDe
void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, Vec3f* src, Vec3f* dest);
void SkinMatrix_MtxFMtxFMult(MtxF* mfA, MtxF* mfB, MtxF* dest);
void SkinMatrix_GetClear(MtxF** mf);
void SkinMatrix_Clear(MtxF* mf);
void SkinMatrix_MtxFCopy(MtxF* src, MtxF* dest);
s32 SkinMatrix_Invert(MtxF* src, MtxF* dest);
void SkinMatrix_SetScale(MtxF* mf, f32 x, f32 y, f32 z);
@ -2092,6 +2110,7 @@ void PreviewSequence(u16 seqId);
void func_800F5B58(void);
void func_800F5BF0(u8 natureAmbienceId);
void Audio_PlayFanfare(u16);
void Audio_PlayFanfare_Rando(GetItemEntry getItem);
void func_800F5C2C(void);
void func_800F5E18(u8 playerIdx, u16 seqId, u8 fadeTimer, s8 arg3, s8 arg4);
void Audio_SetSequenceMode(u8 seqMode);

View File

@ -88,6 +88,7 @@
#define GET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF)))
#define SET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF)))
#define CLEAR_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF)))
#define GET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] & (1 << ((flag) & 0xF)))
#define SET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF)))
@ -244,14 +245,6 @@ extern GraphicsContext* __gfxCtx;
#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
// #region SOH [WiiU]
#ifdef __WIIU__
#define ASSERT(expression) (void)((!!(expression)) || (_assert(#expression, __FILE__, (unsigned)(__LINE__)), 0))
#else
#define ASSERT(expression) (void)((!!(expression)) || (__assert(#expression, __FILE__, (unsigned)(__LINE__)), 0))
#endif
// #endregion
#define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
do { \
gDPPipeSync(pkt); \
@ -323,6 +316,11 @@ extern GraphicsContext* __gfxCtx;
#define GERUDO_FORTRESS_SMALL_KEY_MAX 4
#define GANONS_CASTLE_SMALL_KEY_MAX (ResourceMgr_IsSceneMasterQuest(SCENE_GANONTIKA) ? 3 : 2)
#define TREASURE_GAME_SMALL_KEY_MAX 6
#define DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(randomizerSettingsKey) \
(Randomizer_GetSettingValue(randomizerSettingsKey) != RO_DUNGEON_ITEM_LOC_STARTWITH && \
Randomizer_GetSettingValue(randomizerSettingsKey) != RO_DUNGEON_ITEM_LOC_VANILLA && \
Randomizer_GetSettingValue(randomizerSettingsKey) != RO_DUNGEON_ITEM_LOC_OWN_DUNGEON)
// #endregion
#endif

View File

@ -178,6 +178,9 @@ typedef struct Actor {
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
/* 0x138 */ ActorResetFunc reset;
/* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom
// #region SOH [General]
/* */ u8 maximumHealth; // Max health value for use with health bars, set on actor init
// #endregion
} Actor; // size = 0x14C
typedef enum {

View File

@ -406,6 +406,9 @@ typedef enum {
FLAG_SCENE_CLEAR,
FLAG_SCENE_COLLECTIBLE,
FLAG_EVENT_CHECK_INF,
FLAG_ITEM_GET_INF,
FLAG_INF_TABLE,
FLAG_EVENT_INF,
FLAG_RANDOMIZER_INF
} FlagType;

View File

@ -389,15 +389,15 @@ typedef enum {
*/
#define EVENTCHKINF_FIRST_SPOKE_TO_MIDO 0x02
#define EVENTCHKINF_03 0x03
#define EVENTCHKINF_COMPLAINED_ABOUT_MIDO 0x03
#define EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD 0x04
#define EVENTCHKINF_DEKU_TREE_OPENED_MOUTH 0x05
#define EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD 0x07
#define EVENTCHKINF_09 0x09
#define EVENTCHKINF_0A 0x0A
#define EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP 0x09
#define EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT 0x0A
#define EVENTCHKINF_0B 0x0B
#define EVENTCHKINF_MET_DEKU_TREE 0x0C
#define EVENTCHKINF_0F 0x0F
#define EVENTCHKINF_SPOKE_TO_MIDO_ABOUT_SARIA 0x0F
#define EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET 0x10
#define EVENTCHKINF_SPOKE_TO_INGO_AT_RANCH_BEFORE_TALON_RETURNS 0x11
#define EVENTCHKINF_OBTAINED_POCKET_EGG 0x12
@ -406,30 +406,31 @@ typedef enum {
#define EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH 0x15
#define EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON 0x16
#define EVENTCHKINF_EPONA_OBTAINED 0x18
#define EVENTCHKINF_OBTAINED_KOKIRI_EMERALD 0x19
#define EVENTCHKINF_RENTED_HORSE_FROM_INGO 0x1B
#define EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH 0x1C
#define EVENTCHKINF_1D 0x1D
#define EVENTCHKINF_1E 0x1E
#define EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB 0x1D
#define EVENTCHKINF_WON_COW_IN_MALONS_RACE 0x1E
#define EVENTCHKINF_20 0x20
#define EVENTCHKINF_21 0x21
#define EVENTCHKINF_22 0x22
#define EVENTCHKINF_23 0x23
#define EVENTCHKINF_25 0x25
#define EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE 0x23
#define EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP 0x25
#define EVENTCHKINF_2A 0x2A
#define EVENTCHKINF_2B 0x2B
#define EVENTCHKINF_2C 0x2C
#define EVENTCHKINF_2D 0x2D
#define EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED 0x2F
#define EVENTCHKINF_30 0x30
#define EVENTCHKINF_31 0x31
#define EVENTCHKINF_SPOKE_TO_A_ZORA 0x30
#define EVENTCHKINF_OBTAINED_RUTOS_LETTER 0x31
#define EVENTCHKINF_32 0x32
#define EVENTCHKINF_33 0x33
#define EVENTCHKINF_37 0x37
#define EVENTCHKINF_38 0x38
#define EVENTCHKINF_39 0x39
#define EVENTCHKINF_3A 0x3A
#define EVENTCHKINF_KING_ZORA_MOVED 0x33
#define EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP 0x37
#define EVENTCHKINF_OBTAINED_SILVER_SCALE 0x38
#define EVENTCHKINF_OPENED_ZORAS_DOMAIN 0x39
#define EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU 0x3A
#define EVENTCHKINF_BEGAN_NABOORU_BATTLE 0x3B
#define EVENTCHKINF_3C 0x3C
#define EVENTCHKINF_FINISHED_NABOORU_BATTLE 0x3C
// 0x40
#define EVENTCHKINF_40_INDEX 4
@ -439,28 +440,29 @@ typedef enum {
#define EVENTCHKINF_41 0x41
#define EVENTCHKINF_42 0x42
#define EVENTCHKINF_43 0x43
#define EVENTCHKINF_OBTAINED_OCARINA_OF_TIME 0x43
#define EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL 0x45
#define EVENTCHKINF_48 0x48
#define EVENTCHKINF_49 0x49
#define EVENTCHKINF_4A 0x4A
#define EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP 0x48
#define EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP 0x49
#define EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP 0x4A
#define EVENTCHKINF_OPENED_THE_DOOR_OF_TIME 0x4B
#define EVENTCHKINF_4C 0x4C
#define EVENTCHKINF_4D 0x4D
#define EVENTCHKINF_4E 0x4E
#define EVENTCHKINF_RAINBOW_BRIDGE_BUILT 0x4D
#define EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS 0x4E
#define EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER 0x4F
#define EVENTCHKINF_50 0x50
#define EVENTCHKINF_51 0x51
#define EVENTCHKINF_52 0x52
#define EVENTCHKINF_54 0x54
#define EVENTCHKINF_55 0x55
#define EVENTCHKINF_LEARNED_MINUET_OF_FOREST 0x50
#define EVENTCHKINF_LEARNED_BOLERO_OF_FIRE 0x51
#define EVENTCHKINF_LEARNED_SERENADE_OF_WATER 0x52
#define EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW 0x54
#define EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT 0x55
#define EVENTCHKINF_LEARNED_SARIAS_SONG 0x57
#define EVENTCHKINF_LEARNED_ZELDAS_LULLABY 0x59
#define EVENTCHKINF_5A 0x5A
#define EVENTCHKINF_5B 0x5B
#define EVENTCHKINF_LEARNED_SUNS_SONG 0x5A
#define EVENTCHKINF_LEARNED_SONG_OF_STORMS 0x5B
#define EVENTCHKINF_5C 0x5C
#define EVENTCHKINF_65 0x65
#define EVENTCHKINF_67 0x67
#define EVENTCHKINF_68 0x68
#define EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL 0x65
#define EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO 0x67
#define EVENTCHKINF_PLAYED_HORSEBACK_ARCHERY 0x68
#define EVENTCHKINF_RAISED_LAKE_HYLIA_WATER 0x69
#define EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO 0x6A
@ -471,7 +473,7 @@ typedef enum {
#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO ((EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX << 4) | EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT)
#define EVENTCHKINF_6E 0x6E
#define EVENTCHKINF_6F 0x6F
#define EVENTCHKINF_SPOKE_TO_KAEPORA_BY_LOST_WOODS 0x6F
#define EVENTCHKINF_BEGAN_GOHMA_BATTLE 0x70
#define EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE 0x71
#define EVENTCHKINF_BEGAN_PHANTOM_GANON_BATTLE 0x72
@ -481,11 +483,11 @@ typedef enum {
#define EVENTCHKINF_BEGAN_BARINA_BATTLE 0x76
#define EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE 0x77
#define EVENTCHKINF_BEGAN_GANONDORF_BATTLE 0x78
#define EVENTCHKINF_80 0x80
#define EVENTCHKINF_82 0x82
#define EVENTCHKINF_8C 0x8C
#define EVENTCHKINF_8D 0x8D
#define EVENTCHKINF_8E 0x8E
#define EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE 0x80
#define EVENTCHKINF_DRAWBRIDGE_OPENED_AFTER_ZELDA_FLED 0x82
#define EVENTCHKINF_PAID_BACK_KEATON_MASK_FEE 0x8C
#define EVENTCHKINF_PAID_BACK_SKULL_MASK_FEE 0x8D
#define EVENTCHKINF_PAID_BACK_SPOOKY_MASK_FEE 0x8E
#define EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE 0x8F
// 0x90-0x93
@ -503,9 +505,9 @@ typedef enum {
CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)
#define EVENTCHKINF_SPOKE_TO_NABOORU_IN_SPIRIT_TEMPLE 0x94
#define EVENTCHKINF_95 0x95
#define EVENTCHKINF_96 0x96
#define EVENTCHKINF_9C 0x9C
#define EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA 0x95
#define EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE 0x96
#define EVENTCHKINF_PLAYED_SONG_FOR_SCARECROW_AS_ADULT 0x9C
#define EVENTCHKINF_ENTERED_HYRULE_FIELD 0xA0
#define EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_TRAIL 0xA1
#define EVENTCHKINF_ENTERED_KAKARIKO_VILLAGE 0xA3
@ -514,10 +516,10 @@ typedef enum {
#define EVENTCHKINF_ENTERED_GORON_CITY 0xA6
#define EVENTCHKINF_ENTERED_TEMPLE_OF_TIME 0xA7
#define EVENTCHKINF_ENTERED_DEKU_TREE 0xA8
#define EVENTCHKINF_A9 0xA9
#define EVENTCHKINF_AA 0xAA
#define EVENTCHKINF_AC 0xAC
#define EVENTCHKINF_AD 0xAD
#define EVENTCHKINF_LEARNED_SONG_OF_TIME 0xA9
#define EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL 0xAA
#define EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT 0xAC
#define EVENTCHKINF_COMPLETED_SPIRIT_TRIAL 0xAD
#define EVENTCHKINF_ENTERED_DODONGOS_CAVERN 0xB0
#define EVENTCHKINF_ENTERED_LAKE_HYLIA 0xB1
#define EVENTCHKINF_ENTERED_GERUDO_VALLEY 0xB2
@ -529,20 +531,20 @@ typedef enum {
#define EVENTCHKINF_ENTERED_DESERT_COLOSSUS 0xB8
#define EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_CRATER 0xB9
#define EVENTCHKINF_ENTERED_GANONS_CASTLE_EXTERIOR 0xBA
#define EVENTCHKINF_BB 0xBB
#define EVENTCHKINF_BC 0xBC
#define EVENTCHKINF_BD 0xBD
#define EVENTCHKINF_BE 0xBE
#define EVENTCHKINF_BF 0xBF
#define EVENTCHKINF_COMPLETED_FOREST_TRIAL 0xBB
#define EVENTCHKINF_COMPLETED_WATER_TRIAL 0xBC
#define EVENTCHKINF_COMPLETED_SHADOW_TRIAL 0xBD
#define EVENTCHKINF_COMPLETED_FIRE_TRIAL 0xBE
#define EVENTCHKINF_COMPLETED_LIGHT_TRIAL 0xBF
#define EVENTCHKINF_NABOORU_ORDERED_TO_FIGHT_BY_TWINROVA 0xC0
#define EVENTCHKINF_C1 0xC1
#define EVENTCHKINF_C3 0xC3
#define EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE 0xC1
#define EVENTCHKINF_DISPELLED_GANONS_TOWER_BARRIER 0xC3
#define EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS 0xC4
#define EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL 0xC5
#define EVENTCHKINF_C6 0xC6
#define EVENTCHKINF_SPOKE_TO_DEKU_TREE_SPROUT 0xC6
#define EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO 0xC7
#define EVENTCHKINF_C8 0xC8
#define EVENTCHKINF_C9 0xC9
#define EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION 0xC8
#define EVENTCHKINF_TIME_TRAVELED_TO_ADULT 0xC9
// 0xD0-0xD6
#define EVENTCHKINF_SONGS_FOR_FROGS_INDEX 13
@ -569,12 +571,12 @@ typedef enum {
#define EVENTCHKINF_SONGS_FOR_FROGS_STORMS ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_STORMS_SHIFT)
// 0xDA-0xDE
#define EVENTCHKINF_DA_DB_DC_DD_DE_INDEX 13
#define EVENTCHKINF_DA_MASK (1 << 10)
#define EVENTCHKINF_DB_MASK (1 << 11)
#define EVENTCHKINF_DC_MASK (1 << 12)
#define EVENTCHKINF_DD_MASK (1 << 13)
#define EVENTCHKINF_DE_MASK (1 << 14)
#define EVENTCHKINF_SKULLTULA_REWARD_INDEX 13
#define EVENTCHKINF_SKULLTULA_REWARD_10_MASK (1 << 10)
#define EVENTCHKINF_SKULLTULA_REWARD_20_MASK (1 << 11)
#define EVENTCHKINF_SKULLTULA_REWARD_30_MASK (1 << 12)
#define EVENTCHKINF_SKULLTULA_REWARD_40_MASK (1 << 13)
#define EVENTCHKINF_SKULLTULA_REWARD_50_MASK (1 << 14)
/*
@ -618,8 +620,8 @@ typedef enum {
#define ITEMGETINF_1B 0x1B
#define ITEMGETINF_1C 0x1C
#define ITEMGETINF_1D 0x1D
#define ITEMGETINF_1E 0x1E
#define ITEMGETINF_1F 0x1F
#define ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE 0x1E
#define ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE 0x1F
#define ITEMGETINF_23 0x23
#define ITEMGETINF_24 0x24
#define ITEMGETINF_25 0x25
@ -794,6 +796,7 @@ typedef enum {
// 0x1D0-0x1DF
#define INFTABLE_1DX_INDEX 29
#define INFTABLE_SWORDLESS 0x1D0
/*
@ -856,7 +859,7 @@ typedef enum {
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT)
#define EVENTINF_10 0x10
#define EVENTINF_MARATHON_ACTIVE 0x10
// 0x20-0x24
#define EVENTINF_20_21_22_23_24_INDEX 2

View File

@ -1,6 +1,8 @@
#pragma once
#include "stdint.h"
#ifdef __cplusplus
#include <libultraship/libultraship.h>
#include <ImGui/imgui.h>
@ -16,3 +18,13 @@ class AudioEditor : public LUS::GuiWindow {
void AudioEditor_RandomizeAll();
void AudioEditor_ResetAll();
extern "C" {
#endif
u16 AudioEditor_GetReplacementSeq(u16 seqId);
#ifdef __cplusplus
}
#endif

View File

@ -257,6 +257,8 @@ static std::map<std::string, CosmeticOption> cosmeticOptions = {
COSMETIC_OPTION("Hud_Minimap", "Minimap", GROUP_HUD, ImVec4( 0, 255, 255, 255), false, true, false),
COSMETIC_OPTION("Hud_MinimapPosition", "Minimap Position", GROUP_HUD, ImVec4(200, 255, 0, 255), false, true, true),
COSMETIC_OPTION("Hud_MinimapEntrance", "Minimap Entrance", GROUP_HUD, ImVec4(200, 0, 0, 255), false, true, true),
COSMETIC_OPTION("Hud_EnemyHealthBar", "Enemy Health Bar", GROUP_HUD, ImVec4(255, 0, 0, 255), true, true, false),
COSMETIC_OPTION("Hud_EnemyHealthBorder", "Enemy Health Border", GROUP_HUD, ImVec4(255, 255, 255, 255), true, false, true),
COSMETIC_OPTION("Title_FileChoose", "File Choose", GROUP_TITLE, ImVec4(100, 150, 255, 255), false, true, false),
COSMETIC_OPTION("Title_NintendoLogo", "Nintendo Logo", GROUP_TITLE, ImVec4( 0, 0, 255, 255), false, true, true),
@ -400,6 +402,10 @@ void CosmeticsUpdateTick() {
newColor.g = sin(frequency * (hue + index) + (2 * M_PI / 3)) * 127 + 128;
newColor.b = sin(frequency * (hue + index) + (4 * M_PI / 3)) * 127 + 128;
newColor.a = 255;
// For alpha supported options, retain the last set alpha instead of overwriting
if (cosmeticOption.supportsAlpha) {
newColor.a = cosmeticOption.currentColor.w * 255;
}
cosmeticOption.currentColor.x = newColor.r / 255.0;
cosmeticOption.currentColor.y = newColor.g / 255.0;
@ -1425,6 +1431,32 @@ void Draw_Placements(){
ImGui::EndTable();
}
}
if (ImGui::CollapsingHeader("Enemy Health Bar position")) {
if (ImGui::BeginTable("enemyhealthbar", 1, FlagsTable)) {
ImGui::TableSetupColumn("Enemy Health Bar settings", FlagsCell, TablesCellsWidth);
Table_InitHeader(false);
std::string posTypeCVar = "gCosmetics.Hud_EnemyHealthBarPosType";
UIWidgets::EnhancementRadioButton("Anchor to Enemy", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_ACTOR);
UIWidgets::Tooltip("This will use enemy on screen position");
UIWidgets::EnhancementRadioButton("Anchor to the top", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_TOP);
UIWidgets::Tooltip("This will make your elements follow the top edge of your game window");
UIWidgets::EnhancementRadioButton("Anchor to the bottom", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_BOTTOM);
UIWidgets::Tooltip("This will make your elements follow the bottom edge of your game window");
DrawPositionSlider("gCosmetics.Hud_EnemyHealthBar", -SCREEN_HEIGHT, SCREEN_HEIGHT, -ImGui::GetWindowViewport()->Size.x / 2, ImGui::GetWindowViewport()->Size.x / 2);
if (UIWidgets::EnhancementSliderInt("Health Bar Width: %d", "##EnemyHealthBarWidth", "gCosmetics.Hud_EnemyHealthBarWidth.Value", 32, 128, "", 64)) {
CVarSetInteger("gCosmetics.Hud_EnemyHealthBarWidth.Changed", 1);
}
UIWidgets::Tooltip("This will change the width of the health bar");
ImGui::SameLine();
if (ImGui::Button("Reset##EnemyHealthBarWidth")) {
CVarClear("gCosmetics.Hud_EnemyHealthBarWidth.Value");
CVarClear("gCosmetics.Hud_EnemyHealthBarWidth.Changed");
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
}
ImGui::NewLine();
ImGui::EndTable();
}
}
}
void DrawSillyTab() {
@ -1539,6 +1571,10 @@ void RandomizeColor(CosmeticOption& cosmeticOption) {
newColor.g = Random(0, 255);
newColor.b = Random(0, 255);
newColor.a = 255;
// For alpha supported options, retain the last set alpha instead of overwriting
if (cosmeticOption.supportsAlpha) {
newColor.a = cosmeticOption.currentColor.w * 255;
}
cosmeticOption.currentColor.x = newColor.r / 255.0;
cosmeticOption.currentColor.y = newColor.g / 255.0;
@ -1607,7 +1643,13 @@ void ResetColor(CosmeticOption& cosmeticOption) {
}
void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
if (ImGui::ColorEdit3(cosmeticOption.label.c_str(), (float*)&cosmeticOption.currentColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) {
bool colorChanged;
if (cosmeticOption.supportsAlpha) {
colorChanged = ImGui::ColorEdit4(cosmeticOption.label.c_str(), (float*)&cosmeticOption.currentColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
} else {
colorChanged = ImGui::ColorEdit3(cosmeticOption.label.c_str(), (float*)&cosmeticOption.currentColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
}
if (colorChanged) {
Color_RGBA8 color;
color.r = cosmeticOption.currentColor.x * 255.0;
color.g = cosmeticOption.currentColor.y * 255.0;
@ -1628,13 +1670,15 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
}
ImGui::SameLine();
bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
if (ImGui::Checkbox(("Rainbow##" + cosmeticOption.label).c_str(), &isRainbow)) {
CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
if (cosmeticOption.supportsRainbow) {
ImGui::SameLine();
bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
if (ImGui::Checkbox(("Rainbow##" + cosmeticOption.label).c_str(), &isRainbow)) {
CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
}
}
ImGui::SameLine();
bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0);

View File

@ -1,4 +1,10 @@
typedef enum {
COLORSCHEME_N64,
COLORSCHEME_GAMECUBE
} DefaultColorScheme;
} DefaultColorScheme;
typedef enum {
ENEMYHEALTH_ANCHOR_ACTOR,
ENEMYHEALTH_ANCHOR_TOP,
ENEMYHEALTH_ANCHOR_BOTTOM,
} EnemyHealthBarAnchorType;

View File

@ -2,6 +2,10 @@
typedef enum {
TEXT_CURSED_SKULLTULA_PEOPLE = 0x22,
TEXT_ITEM_KEY_SMALL = 0x60,
TEXT_ITEM_DUNGEON_MAP = 0x66,
TEXT_ITEM_COMPASS = 0x67,
TEXT_ITEM_KEY_BOSS = 0xC7,
TEXT_DAMPES_DIARY = 0x5003,
TEXT_CHEST_GAME_PROCEED = 0x704C,
TEXT_BUY_BOMBCHU_10_PROMPT = 0x8C,

View File

@ -10,9 +10,14 @@
#include "objects/object_gi_hearts/object_gi_hearts.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
extern "C" void Randomizer_DrawSmallKey(PlayState* play, GetItemEntry* getItemEntry) {
s32 pad;
s8 isColoredKeysEnabled = CVarGetInteger("gRandoMatchKeyColors", 1);
s8 keysCanBeOutsideDungeon = getItemEntry->getItemId == RG_GERUDO_FORTRESS_SMALL_KEY ?
Randomizer_GetSettingValue(RSK_GERUDO_KEYS) != RO_GERUDO_KEYS_VANILLA :
DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_KEYSANITY);
s8 isColoredKeysEnabled = keysCanBeOutsideDungeon && CVarGetInteger("gRandoMatchKeyColors", 1);
s16 color_slot = getItemEntry->getItemId - RG_FOREST_TEMPLE_SMALL_KEY;
s16 colors[9][3] = {
{ 4, 195, 46 }, // Forest Temple
@ -49,7 +54,10 @@ extern "C" void Randomizer_DrawSmallKey(PlayState* play, GetItemEntry* getItemEn
extern "C" void Randomizer_DrawBossKey(PlayState* play, GetItemEntry* getItemEntry) {
s32 pad;
s8 isColoredKeysEnabled = CVarGetInteger("gRandoMatchKeyColors", 1);
s8 keysCanBeOutsideDungeon = getItemEntry->getItemId == RG_GANONS_CASTLE_BOSS_KEY ?
DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_GANONS_BOSS_KEY) :
DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_BOSS_KEYSANITY);
s8 isColoredKeysEnabled = keysCanBeOutsideDungeon && CVarGetInteger("gRandoMatchKeyColors", 1);
s16 color_slot;
color_slot = getItemEntry->getItemId - RG_FOREST_TEMPLE_BOSS_KEY;
s16 colors[6][3] = {

View File

@ -2197,89 +2197,6 @@ GetItemID Randomizer::GetItemIdFromRandomizerGet(RandomizerGet randoGet, GetItem
return (GetItemID)RG_MAGIC_DOUBLE;
}
case RG_DEKU_TREE_MAP:
case RG_DODONGOS_CAVERN_MAP:
case RG_JABU_JABUS_BELLY_MAP:
case RG_FOREST_TEMPLE_MAP:
case RG_FIRE_TEMPLE_MAP:
case RG_WATER_TEMPLE_MAP:
case RG_SPIRIT_TEMPLE_MAP:
case RG_SHADOW_TEMPLE_MAP:
case RG_BOTTOM_OF_THE_WELL_MAP:
case RG_ICE_CAVERN_MAP:
if (GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return GI_MAP;
} else {
return (GetItemID)randoGet;
}
case RG_DEKU_TREE_COMPASS:
case RG_DODONGOS_CAVERN_COMPASS:
case RG_JABU_JABUS_BELLY_COMPASS:
case RG_FOREST_TEMPLE_COMPASS:
case RG_FIRE_TEMPLE_COMPASS:
case RG_WATER_TEMPLE_COMPASS:
case RG_SPIRIT_TEMPLE_COMPASS:
case RG_SHADOW_TEMPLE_COMPASS:
case RG_BOTTOM_OF_THE_WELL_COMPASS:
case RG_ICE_CAVERN_COMPASS:
if (GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return GI_COMPASS;
} else {
return (GetItemID)randoGet;
}
case RG_FOREST_TEMPLE_BOSS_KEY:
case RG_FIRE_TEMPLE_BOSS_KEY:
case RG_WATER_TEMPLE_BOSS_KEY:
case RG_SPIRIT_TEMPLE_BOSS_KEY:
case RG_SHADOW_TEMPLE_BOSS_KEY:
if (GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return GI_KEY_BOSS;
} else {
return (GetItemID)randoGet;
}
case RG_GANONS_CASTLE_BOSS_KEY:
if (GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_STARTWITH ||
GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_VANILLA ||
GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_OWN_DUNGEON) {
return GI_KEY_BOSS;
} else {
return (GetItemID)randoGet;
}
case RG_FOREST_TEMPLE_SMALL_KEY:
case RG_FIRE_TEMPLE_SMALL_KEY:
case RG_WATER_TEMPLE_SMALL_KEY:
case RG_SPIRIT_TEMPLE_SMALL_KEY:
case RG_SHADOW_TEMPLE_SMALL_KEY:
case RG_BOTTOM_OF_THE_WELL_SMALL_KEY:
case RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY:
case RG_GANONS_CASTLE_SMALL_KEY:
if (GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return GI_KEY_SMALL;
} else {
return (GetItemID)randoGet;
}
case RG_GERUDO_FORTRESS_SMALL_KEY:
if (GetRandoSettingValue(RSK_GERUDO_KEYS) == RO_GERUDO_KEYS_VANILLA) {
return GI_KEY_SMALL;
} else {
return (GetItemID)randoGet;
}
case RG_RECOVERY_HEART:
case RG_BUY_HEART:
return GI_HEART;
@ -2437,72 +2354,6 @@ bool Randomizer::IsItemVanilla(RandomizerGet randoGet) {
} else {
return false;
}
case RG_FOREST_TEMPLE_SMALL_KEY:
case RG_FIRE_TEMPLE_SMALL_KEY:
case RG_WATER_TEMPLE_SMALL_KEY:
case RG_SPIRIT_TEMPLE_SMALL_KEY:
case RG_SHADOW_TEMPLE_SMALL_KEY:
case RG_BOTTOM_OF_THE_WELL_SMALL_KEY:
case RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY:
case RG_GANONS_CASTLE_SMALL_KEY:
if (GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_KEYSANITY) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return true;
}
return false;
case RG_GERUDO_FORTRESS_SMALL_KEY:
if (GetRandoSettingValue(RSK_GERUDO_KEYS) != RO_GERUDO_KEYS_VANILLA) {
return false;
}
return true;
case RG_FOREST_TEMPLE_BOSS_KEY:
case RG_FIRE_TEMPLE_BOSS_KEY:
case RG_WATER_TEMPLE_BOSS_KEY:
case RG_SPIRIT_TEMPLE_BOSS_KEY:
case RG_SHADOW_TEMPLE_BOSS_KEY:
if (GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return true;
}
return false;
case RG_GANONS_CASTLE_BOSS_KEY:
if (GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_STARTWITH ||
GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_VANILLA ||
GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == RO_GANON_BOSS_KEY_OWN_DUNGEON) {
return true;
}
return false;
case RG_DEKU_TREE_COMPASS:
case RG_DODONGOS_CAVERN_COMPASS:
case RG_JABU_JABUS_BELLY_COMPASS:
case RG_FOREST_TEMPLE_COMPASS:
case RG_FIRE_TEMPLE_COMPASS:
case RG_WATER_TEMPLE_COMPASS:
case RG_SPIRIT_TEMPLE_COMPASS:
case RG_SHADOW_TEMPLE_COMPASS:
case RG_BOTTOM_OF_THE_WELL_COMPASS:
case RG_ICE_CAVERN_COMPASS:
case RG_DEKU_TREE_MAP:
case RG_DODONGOS_CAVERN_MAP:
case RG_JABU_JABUS_BELLY_MAP:
case RG_FOREST_TEMPLE_MAP:
case RG_FIRE_TEMPLE_MAP:
case RG_WATER_TEMPLE_MAP:
case RG_SPIRIT_TEMPLE_MAP:
case RG_SHADOW_TEMPLE_MAP:
case RG_BOTTOM_OF_THE_WELL_MAP:
case RG_ICE_CAVERN_MAP:
if (GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_STARTWITH ||
GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_VANILLA ||
(GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) == RO_DUNGEON_ITEM_LOC_OWN_DUNGEON &&
GetRandoSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) {
return true;
}
return false;
default:
return false;
}
@ -6072,15 +5923,15 @@ void InitRandoItemTable() {
GET_ITEM(RG_BOTTLE_WITH_BUGS, OBJECT_GI_INSECT, GID_BUG, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER, RG_BOTTLE_WITH_BUGS),
GET_ITEM(RG_BOTTLE_WITH_POE, OBJECT_GI_GHOST, GID_POE, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER, RG_BOTTLE_WITH_POE),
GET_ITEM(RG_BOTTLE_WITH_BIG_POE, OBJECT_GI_GHOST, GID_BIG_POE, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER, RG_BOTTLE_WITH_BIG_POE),
GET_ITEM(RG_GERUDO_FORTRESS_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_FORTRESS_SMALL_KEY),
GET_ITEM(RG_FOREST_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FOREST_TEMPLE_SMALL_KEY),
GET_ITEM(RG_FIRE_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FIRE_TEMPLE_SMALL_KEY),
GET_ITEM(RG_WATER_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_WATER_TEMPLE_SMALL_KEY),
GET_ITEM(RG_SPIRIT_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_SMALL_KEY),
GET_ITEM(RG_SHADOW_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_SMALL_KEY),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_SMALL_KEY),
GET_ITEM(RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY),
GET_ITEM(RG_GANONS_CASTLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GANONS_CASTLE_SMALL_KEY),
GET_ITEM(RG_GERUDO_FORTRESS_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_FORTRESS_SMALL_KEY),
GET_ITEM(RG_FOREST_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FOREST_TEMPLE_SMALL_KEY),
GET_ITEM(RG_FIRE_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FIRE_TEMPLE_SMALL_KEY),
GET_ITEM(RG_WATER_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_WATER_TEMPLE_SMALL_KEY),
GET_ITEM(RG_SPIRIT_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_SMALL_KEY),
GET_ITEM(RG_SHADOW_TEMPLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_SMALL_KEY),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_SMALL_KEY),
GET_ITEM(RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY),
GET_ITEM(RG_GANONS_CASTLE_SMALL_KEY, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_ITEM_KEY_SMALL, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GANONS_CASTLE_SMALL_KEY),
GET_ITEM(RG_GERUDO_FORTRESS_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_FORTRESS_KEY_RING),
GET_ITEM(RG_FOREST_TEMPLE_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FOREST_TEMPLE_KEY_RING),
GET_ITEM(RG_FIRE_TEMPLE_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_FIRE_TEMPLE_KEY_RING),
@ -6090,32 +5941,32 @@ void InitRandoItemTable() {
GET_ITEM(RG_BOTTOM_OF_THE_WELL_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_KEY_RING),
GET_ITEM(RG_GERUDO_TRAINING_GROUNDS_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GERUDO_TRAINING_GROUNDS_KEY_RING),
GET_ITEM(RG_GANONS_CASTLE_KEY_RING, OBJECT_GI_KEY, GID_KEY_SMALL, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_SHORT, ITEM_CATEGORY_SMALL_KEY, MOD_RANDOMIZER, RG_GANONS_CASTLE_KEY_RING),
GET_ITEM(RG_FOREST_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_FOREST_TEMPLE_BOSS_KEY),
GET_ITEM(RG_FIRE_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_FIRE_TEMPLE_BOSS_KEY),
GET_ITEM(RG_WATER_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_WATER_TEMPLE_BOSS_KEY),
GET_ITEM(RG_SPIRIT_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_BOSS_KEY),
GET_ITEM(RG_SHADOW_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_BOSS_KEY),
GET_ITEM(RG_GANONS_CASTLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_GANONS_CASTLE_BOSS_KEY),
GET_ITEM(RG_DEKU_TREE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DEKU_TREE_MAP),
GET_ITEM(RG_DODONGOS_CAVERN_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DODONGOS_CAVERN_MAP),
GET_ITEM(RG_JABU_JABUS_BELLY_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_JABU_JABUS_BELLY_MAP),
GET_ITEM(RG_FOREST_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FOREST_TEMPLE_MAP),
GET_ITEM(RG_FIRE_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FIRE_TEMPLE_MAP),
GET_ITEM(RG_WATER_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_WATER_TEMPLE_MAP),
GET_ITEM(RG_SPIRIT_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_MAP),
GET_ITEM(RG_SHADOW_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_MAP),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_MAP),
GET_ITEM(RG_ICE_CAVERN_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_ICE_CAVERN_MAP),
GET_ITEM(RG_DEKU_TREE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DEKU_TREE_COMPASS),
GET_ITEM(RG_DODONGOS_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DODONGOS_CAVERN_COMPASS),
GET_ITEM(RG_JABU_JABUS_BELLY_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_JABU_JABUS_BELLY_COMPASS),
GET_ITEM(RG_FOREST_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FOREST_TEMPLE_COMPASS),
GET_ITEM(RG_FIRE_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FIRE_TEMPLE_COMPASS),
GET_ITEM(RG_WATER_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_WATER_TEMPLE_COMPASS),
GET_ITEM(RG_SPIRIT_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_COMPASS),
GET_ITEM(RG_SHADOW_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_COMPASS),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_COMPASS),
GET_ITEM(RG_ICE_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_ICE_CAVERN_COMPASS),
GET_ITEM(RG_FOREST_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_FOREST_TEMPLE_BOSS_KEY),
GET_ITEM(RG_FIRE_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_FIRE_TEMPLE_BOSS_KEY),
GET_ITEM(RG_WATER_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_WATER_TEMPLE_BOSS_KEY),
GET_ITEM(RG_SPIRIT_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_BOSS_KEY),
GET_ITEM(RG_SHADOW_TEMPLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_BOSS_KEY),
GET_ITEM(RG_GANONS_CASTLE_BOSS_KEY, OBJECT_GI_BOSSKEY, GID_KEY_BOSS, TEXT_ITEM_KEY_BOSS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_BOSS_KEY, MOD_RANDOMIZER, RG_GANONS_CASTLE_BOSS_KEY),
GET_ITEM(RG_DEKU_TREE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DEKU_TREE_MAP),
GET_ITEM(RG_DODONGOS_CAVERN_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DODONGOS_CAVERN_MAP),
GET_ITEM(RG_JABU_JABUS_BELLY_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_JABU_JABUS_BELLY_MAP),
GET_ITEM(RG_FOREST_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FOREST_TEMPLE_MAP),
GET_ITEM(RG_FIRE_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FIRE_TEMPLE_MAP),
GET_ITEM(RG_WATER_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_WATER_TEMPLE_MAP),
GET_ITEM(RG_SPIRIT_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_MAP),
GET_ITEM(RG_SHADOW_TEMPLE_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_MAP),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_MAP),
GET_ITEM(RG_ICE_CAVERN_MAP, OBJECT_GI_MAP, GID_DUNGEON_MAP, TEXT_ITEM_DUNGEON_MAP, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_ICE_CAVERN_MAP),
GET_ITEM(RG_DEKU_TREE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DEKU_TREE_COMPASS),
GET_ITEM(RG_DODONGOS_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_DODONGOS_CAVERN_COMPASS),
GET_ITEM(RG_JABU_JABUS_BELLY_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_JABU_JABUS_BELLY_COMPASS),
GET_ITEM(RG_FOREST_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FOREST_TEMPLE_COMPASS),
GET_ITEM(RG_FIRE_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_FIRE_TEMPLE_COMPASS),
GET_ITEM(RG_WATER_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_WATER_TEMPLE_COMPASS),
GET_ITEM(RG_SPIRIT_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SPIRIT_TEMPLE_COMPASS),
GET_ITEM(RG_SHADOW_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_COMPASS),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_COMPASS),
GET_ITEM(RG_ICE_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_ITEM_COMPASS, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_ICE_CAVERN_COMPASS),
GET_ITEM(RG_MAGIC_BEAN_PACK, OBJECT_GI_BEAN, GID_BEAN, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER, RG_MAGIC_BEAN_PACK),
GET_ITEM(RG_TYCOON_WALLET, OBJECT_GI_PURSE, GID_WALLET_GIANT, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_LESSER, MOD_RANDOMIZER, RG_TYCOON_WALLET),
GET_ITEM(RG_PROGRESSIVE_BOMBCHUS, OBJECT_GI_BOMB_2, GID_BOMBCHU, 0x33, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER, RG_PROGRESSIVE_BOMBCHUS),

View File

@ -587,7 +587,7 @@ void Entrance_OverrideWeatherState() {
return;
}
// Lon Lon Ranch (No Epona)
if (!Flags_GetEventChkInf(0x18)){ // if you don't have Epona
if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)){ // if you don't have Epona
switch (gSaveContext.entranceIndex) {
case 0x0157: // Lon Lon Ranch from HF
case 0x01F9: // Hyrule Field from LLR
@ -596,7 +596,7 @@ void Entrance_OverrideWeatherState() {
}
}
// Water Temple
if (!(gSaveContext.eventChkInf[4] & 0x0400)) { // have not beaten Water Temple
if (!Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) { // have not beaten Water Temple
switch (gSaveContext.entranceIndex) {
case 0x019D: // Zora River from behind waterfall
case 0x01DD: // Zora River from LW water shortcut
@ -630,7 +630,7 @@ void Entrance_OverrideWeatherState() {
}
}
// Death Mountain Cloudy
if (!(gSaveContext.eventChkInf[4] & 0x0200)) { // have not beaten Fire Temple
if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) { // have not beaten Fire Temple
if (gPlayState->nextEntranceIndex == 0x04D6) { // Lost Woods Goron City Shortcut
gWeatherMode = 2;
return;

View File

@ -1,6 +1,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h"
#include <cassert>
#include <File.h>
#include <libultraship/classes.h>
#include <nlohmann/json.hpp>
@ -44,7 +45,7 @@ std::string GetParameritizedText(std::string key, TextBank bank, const char* arg
size_t index = value.find(searchString);
if (index != std::string::npos) {
ASSERT(arg != nullptr);
assert(arg != nullptr);
value.replace(index, searchString.size(), std::string(arg));
return value;
} else {
@ -60,7 +61,7 @@ std::string GetParameritizedText(std::string key, TextBank bank, const char* arg
size_t index = value.find(searchString);
if (index != std::string::npos) {
ASSERT(arg != nullptr);
assert(arg != nullptr);
value.replace(index, searchString.size(), std::string(arg));
return value;
} else {
@ -76,7 +77,7 @@ std::string GetParameritizedText(std::string key, TextBank bank, const char* arg
size_t index = value.find(searchString);
if (index != std::string::npos) {
ASSERT(arg != nullptr);
assert(arg != nullptr);
value.replace(index, searchString.size(), std::string(arg));
return value;
} else {
@ -159,7 +160,7 @@ void RegisterOnInterfaceUpdateHook() {
auto translation = GetParameritizedText((seconds > 1) ? "seconds_plural" : "seconds_singular", TEXT_BANK_MISC, arg);
announceBuf += snprintf(announceBuf, sizeof(ttsAnnounceBuf), "%s", translation.c_str());
}
ASSERT(announceBuf < ttsAnnounceBuf + sizeof(ttsAnnounceBuf));
assert(announceBuf < ttsAnnounceBuf + sizeof(ttsAnnounceBuf));
SpeechSynthesizer::Instance->Speak(ttsAnnounceBuf, GetLanguageCode());
prevTimer = timer;
}

View File

@ -1952,19 +1952,45 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
CustomMessage messageEntry;
s16 actorParams = 0;
if (gSaveContext.n64ddFlag) {
Player* player = GET_PLAYER(play);
if (textId == TEXT_RANDOMIZER_CUSTOM_ITEM) {
Player* player = GET_PLAYER(play);
if (player->getItemEntry.getItemId == RG_ICE_TRAP) {
u16 iceTrapTextId = Random(0, NUM_ICE_TRAP_MESSAGES);
messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, iceTrapTextId);
if (CVarGetInteger("gLetItSnow", 0)) {
messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, NUM_ICE_TRAP_MESSAGES + 1);
}
} else if (player->getItemEntry.getItemId >= RG_DEKU_TREE_MAP && player->getItemEntry.getItemId <= RG_ICE_CAVERN_MAP) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetMapGetItemMessageWithHint(player->getItemEntry);
} else {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
} else if (textId == TEXT_ITEM_DUNGEON_MAP || textId == TEXT_ITEM_COMPASS) {
if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_STARTING_MAPS_COMPASSES)) {
if (textId == TEXT_ITEM_DUNGEON_MAP) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetMapGetItemMessageWithHint(player->getItemEntry);
} else {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
}
} else if (textId == TEXT_ITEM_KEY_BOSS) {
if (player->getItemEntry.getItemId == RG_GANONS_CASTLE_BOSS_KEY) {
if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_GANONS_BOSS_KEY)) {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
} else {
if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_BOSS_KEYSANITY)) {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
}
} else if (textId == TEXT_ITEM_KEY_SMALL) {
if (player->getItemEntry.getItemId == RG_GERUDO_FORTRESS_SMALL_KEY) {
if (Randomizer_GetSettingValue(RSK_GERUDO_KEYS) != RO_GERUDO_KEYS_VANILLA) {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
} else {
if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_KEYSANITY)) {
messageEntry = Randomizer_GetCustomGetItemMessage(player);
}
}
} else if (textId == TEXT_RANDOMIZER_GOSSIP_STONE_HINTS && Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) != RO_GOSSIP_STONES_NONE &&
(Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == RO_GOSSIP_STONES_NEED_NOTHING ||
(Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == RO_GOSSIP_STONES_NEED_TRUTH &&

View File

@ -52,9 +52,11 @@ uint32_t IsGameMasterQuest();
void DeinitOTR(void);
void VanillaItemTable_Init();
void OTRAudio_Init();
void OTRMessage_Init();
void InitAudio();
void Graph_StartFrame();
void Graph_ProcessGfxCommands(Gfx* commands);
void Graph_ProcessFrame(void (*run_one_game_iter)(void));
void OTRLogString(const char* src);
void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char));
void OTRGetPixelDepthPrepare(float x, float y);

View File

@ -865,6 +865,8 @@ void DrawEnhancementsMenu() {
UIWidgets::PaddedEnhancementCheckbox("Disable Crit wiggle", "gDisableCritWiggle", true, false);
UIWidgets::Tooltip("Disable random camera wiggle at low health");
UIWidgets::PaddedEnhancementCheckbox("Enemy Health Bars", "gEnemyHealthBar", true, false);
UIWidgets::Tooltip("Renders a health bar for enemies when Z-Targeted");
ImGui::EndMenu();
}

View File

@ -50,7 +50,6 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
scene->unk_13 = 0;
//ASSERT(play->sceneSegment != NULL);
//gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
OTRPlay_InitScene(play, spawn);

View File

@ -11,6 +11,7 @@
#include "soh/resource/type/Text.h"
#include <Blob.h>
#include <memory>
#include <cassert>
#include "soh/resource/type/scenecommand/SetCameraSettings.h"
#include "soh/resource/type/scenecommand/SetCutscenes.h"
#include "soh/resource/type/scenecommand/SetStartPositionList.h"
@ -520,7 +521,7 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN
roomCtx->curRoom.segment = NULL;
roomCtx->status = 1;
ASSERT(roomNum < play->numRooms);
assert(roomNum < play->numRooms);
if (roomNum >= play->numRooms)
return 0; // UH OH

View File

@ -1,15 +0,0 @@
#include "global.h"
#ifndef __SWITCH__
#ifdef __WIIU__
void _assert(const char* exp, const char* file, s32 line) {
#else
void __assert(const char* exp, const char* file, s32 line) {
#endif
char msg[256];
osSyncPrintf("Assertion failed: %s, file %s, line %d, thread %d\n", exp, file, line, osGetThreadId(NULL));
sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL));
Fault_AddHungupAndCrashImpl(msg, exp);
}
#endif

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "vt.h"
#include <stdio.h>
#include <assert.h>
StackEntry sDmaMgrStackInfo;
OSMesgQueue sDmaMgrMsgQueue;
@ -123,9 +125,9 @@ end:
s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
s32 ret;
ASSERT(pihandle == gCartHandle);
ASSERT(direction == OS_READ);
ASSERT(mb != NULL);
assert(pihandle == gCartHandle);
assert(direction == OS_READ);
assert(mb != NULL);
if (D_80009460 == 10) {
osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr,
@ -183,14 +185,14 @@ void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, cons
osSyncPrintf(VT_RST);
if (req->filename) {
sprintf(buff1, "DMA ERROR: %s %d", req->filename, req->line);
snprintf(buff1, sizeof(buff1), "DMA ERROR: %s %d", req->filename, req->line);
} else if (sDmaMgrCurFileName) {
sprintf(buff1, "DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine);
snprintf(buff1, sizeof(buff1), "DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine);
} else {
sprintf(buff1, "DMA ERROR: %s", errorName != NULL ? errorName : "???");
snprintf(buff1, sizeof(buff1), "DMA ERROR: %s", errorName != NULL ? errorName : "???");
}
sprintf(buff2, "%07X %08X %X %s", vrom, ram, size, file != NULL ? file : "???");
snprintf(buff2, sizeof(buff1), "%07X %08X %X %s", vrom, ram, size, file != NULL ? file : "???");
Fault_AddHungupAndCrashImpl(buff1, buff2);
}

View File

@ -3,6 +3,7 @@
#ifndef __APPLE__
#include <malloc.h>
#endif
#include <stdlib.h>
#ifndef _MSC_VER
#include <unistd.h>

View File

@ -2,6 +2,7 @@
#include "alloca.h"
#include <string.h>
#include <stdlib.h>
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) {
this->widthSave = width;
@ -474,9 +475,9 @@ void func_800C2FE4(PreRender* this) {
s32 x;
s32 y;
s32 phi_v0;
u8* buffR = alloca(this->width);
u8* buffG = alloca(this->width);
u8* buffB = alloca(this->width);
u8* buffR = malloc(this->width);
u8* buffG = malloc(this->width);
u8* buffB = malloc(this->width);
s32 pad[3];
s32 pxR;
s32 pxG;
@ -538,6 +539,9 @@ void func_800C2FE4(PreRender* this) {
this->fbufSave[x + y * this->width] = pxOut.rgba;
}
}
free(buffR);
free(buffB);
free(buffG);
}
void PreRender_Calc(PreRender* this) {

View File

@ -6,6 +6,7 @@
#include "global.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioCollection.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#define MK_ASYNC_MSG(retData, tableType, id, status) (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (status))
#define ASYNC_TBLTYPE(v) ((u8)(v >> 16))

View File

@ -3,6 +3,8 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
extern char** sequenceMap;
#define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80)

View File

@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
// TODO: can these macros be shared between files? code_800F9280 seems to use
// versions without any casts...

View File

@ -2,6 +2,8 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/audio/AudioEditor.h"
typedef struct {
/* 0x00 */ u16 sfxId;
/* 0x04 */ Vec3f* pos;

View File

@ -2,6 +2,8 @@
#include "global.h"
#include "soh/mixer.h"
#include "soh/Enhancements/audio/AudioEditor.h"
typedef struct {
u8 unk_0;
u8 unk_1; // importance?

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "vt.h"
#include "alloca.h"
#include <stdio.h>
// data
const char* sExceptionNames[] = {
@ -1124,6 +1124,6 @@ void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) {
void Fault_AddHungupAndCrash(const char* filename, u32 line) {
char msg[256];
sprintf(msg, "HungUp %s:%d", filename, line);
snprintf(msg, sizeof(msg), "HungUp %s:%d", filename, line);
Fault_AddHungupAndCrashImpl(msg, NULL);
}

View File

@ -3,6 +3,7 @@
#include "vt.h"
#include "libultraship/bridge.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
SpeedMeter D_801664D0;
struct_801664F0 D_801664F0;
@ -16,6 +17,7 @@ u16 sLastButtonPressed;
int gfx_create_framebuffer(uint32_t width, uint32_t height);
void gfx_texture_cache_clear();
void GameState_FaultPrint(void) {
static char sBtnChars[] = "ABZSuldr*+LRudlr";
s32 i;

View File

@ -3,9 +3,12 @@
#include "regs.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "soh/Enhancements/debugger/colViewer.h"
#include "soh/Enhancements/gameconsole.h"
#include "soh/OTRGlobals.h"
#define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678
@ -16,6 +19,9 @@ FaultClient sGraphFaultClient;
CfbInfo sGraphCfbInfos[3];
FaultClient sGraphUcodeFaultClient;
void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId);
void PadMgr_ThreadEntry(PadMgr* padMgr);
// clang-format off
UCodeInfo D_8012D230[3] = {
//{ UCODE_F3DZEX, D_80155F50 },
@ -461,7 +467,7 @@ static void RunFrame()
{
osSyncPrintf("確保失敗\n"); // "Failure to secure"
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
snprintf(faultMsg, sizeof(faultMsg), "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
}
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
@ -478,15 +484,15 @@ static void RunFrame()
while (GameState_IsRunning(runFrameContext.gameState))
{
uint64_t ticksA, ticksB;
ticksA = GetPerfCounter();
//uint64_t ticksA, ticksB;
//ticksA = GetPerfCounter();
Graph_StartFrame();
PadMgr_ThreadEntry(&gPadMgr);
Graph_Update(&runFrameContext.gfxCtx, runFrameContext.gameState);
ticksB = GetPerfCounter();
//ticksB = GetPerfCounter();
Graph_ProcessGfxCommands(runFrameContext.gfxCtx.workBuffer);

View File

@ -1,16 +1,13 @@
#include "global.h"
#include "vt.h"
#include <string.h>
#include "soh/Enhancements/game-interactor/GameInteractor.h"
//#include <string.h>
#ifdef _MSC_VER
extern void* __cdecl memset(_Out_writes_bytes_all_(_Size) void* _Dst, _In_ int _Val, _In_ size_t _Size);
#endif
s32 D_8012D280 = 1;
void OTRControllerCallback(uint8_t rumble);
OSMesgQueue* PadMgr_LockSerialMesgQueue(PadMgr* padMgr) {
OSMesgQueue* ctrlrQ = NULL;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include <string.h>
#include <assert.h>
#define RSP_DONE_MSG 667
#define RDP_DONE_MSG 668
@ -102,7 +103,7 @@ void Sched_HandleStart(SchedContext* sc) {
void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
s32 type = task->list.t.type;
ASSERT((type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK));
assert((type == M_AUDTASK) || (type == M_GFXTASK) || (type == M_NJPEGTASK) || (type == M_NULTASK));
if (type == M_AUDTASK) {
if (sLogScheduler) {
@ -134,7 +135,7 @@ void Sched_QueueTask(SchedContext* sc, OSScTask* task) {
void Sched_Yield(SchedContext* sc) {
if (!(sc->curRSPTask->state & OS_SC_YIELD)) {
ASSERT(sc->curRSPTask->list.t.type != M_AUDTASK);
assert(sc->curRSPTask->list.t.type != M_AUDTASK);
sc->curRSPTask->state |= OS_SC_YIELD;
@ -153,14 +154,14 @@ OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task) {
if (sc->pendingSwapBuf1 != NULL) {
if (0) {
ASSERT(sc->pendingSwapBuf1 != NULL);
assert(sc->pendingSwapBuf1 != NULL);
}
return NULL;
}
if (sc->pendingSwapBuf2 != NULL) {
if (0) {
ASSERT(sc->pendingSwapBuf2 != NULL);
assert(sc->pendingSwapBuf2 != NULL);
}
return NULL;
}
@ -246,7 +247,7 @@ u32 Sched_IsComplete(SchedContext* sc, OSScTask* task) {
}
void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask) {
ASSERT(sc->curRSPTask == NULL);
assert(sc->curRSPTask == NULL);
if (spTask != NULL) {
if (spTask->list.t.type == M_NULTASK) {
if (spTask->flags & OS_SC_NEEDS_RSP) {
@ -356,7 +357,7 @@ void Sched_HandleRSPDone(SchedContext* sc) {
OSScTask* nextRDP = NULL;
s32 state;
ASSERT(sc->curRSPTask != NULL);
assert(sc->curRSPTask != NULL);
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime;
@ -405,8 +406,8 @@ void Sched_HandleRDPDone(SchedContext* sc) {
s32 state;
gRDPTotalTime = osGetTime() - sRDPStartTime;
ASSERT(sc->curRDPTask != NULL);
ASSERT(sc->curRDPTask->list.t.type == M_GFXTASK);
assert(sc->curRDPTask != NULL);
assert(sc->curRDPTask->list.t.type == M_GFXTASK);
curTask = sc->curRDPTask;
sc->curRDPTask = NULL;
curTask->state &= ~OS_SC_DP;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
// clang-format off
Mtx gMtxClear = {
@ -35,7 +36,7 @@ void Matrix_Push(void) {
void Matrix_Pop(void) {
FrameInterpolation_RecordMatrixPop();
sCurrentMatrix--;
ASSERT(sCurrentMatrix >= sMatrixStack);
assert(sCurrentMatrix >= sMatrixStack);
}
void Matrix_Get(MtxF* dest) {

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
#include "vt.h"
#include <soh/OTRGlobals.h>
#include <assert.h>
#define SS_NULL 0xFFFF
@ -87,7 +88,7 @@ void SSNodeList_SetSSListHead(SSNodeList* nodeList, SSList* ssList, s16* polyId)
void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* polyId) {
u16 newNodeId = DynaSSNodeList_GetNextNodeIdx(nodeList);
ASSERT(newNodeId != SS_NULL);
assert(newNodeId != SS_NULL);
SSNode_SetValue(&nodeList->tbl[newNodeId], polyId, ssList->head);
ssList->head = newNodeId;
}
@ -106,7 +107,7 @@ void DynaSSNodeList_Initialize(PlayState* play, DynaSSNodeList* nodeList) {
void DynaSSNodeList_Alloc(PlayState* play, DynaSSNodeList* nodeList, s32 max) {
nodeList->tbl = THA_AllocEndAlign(&play->state.tha, max * sizeof(SSNode), -2);
ASSERT(nodeList->tbl != NULL);
assert(nodeList->tbl != NULL);
nodeList->max = max;
nodeList->count = 0;
@ -709,7 +710,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nz) * invNormalXZ;
@ -790,7 +791,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16
}
}
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
invNormalXZ = 1.0f / normalXZ;
temp_f16 = fabsf(nx) * invNormalXZ;
@ -2446,11 +2447,11 @@ void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPoly
this->count = 0;
this->tbl = THA_AllocEndAlign(&play->state.tha, tblMax * sizeof(SSNode), -2);
ASSERT(this->tbl != NULL);
assert(this->tbl != NULL);
this->polyCheckTbl = GAMESTATE_ALLOC_MC(&play->state, numPolys);
ASSERT(this->polyCheckTbl != NULL);
assert(this->polyCheckTbl != NULL);
}
/**
@ -2460,7 +2461,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
SSNode* result = &this->tbl[this->count];
this->count++;
ASSERT(this->count < this->max);
assert(this->count < this->max);
if (!(this->count < this->max)) {
return NULL;
}
@ -2473,7 +2474,7 @@ SSNode* SSNodeList_GetNextNode(SSNodeList* this) {
u16 SSNodeList_GetNextNodeIdx(SSNodeList* this) {
u16 new_index = this->count++;
ASSERT(new_index < this->max);
assert(new_index < this->max);
return new_index;
}
@ -2579,7 +2580,7 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
*/
void DynaPoly_AllocPolyList(PlayState* play, CollisionPoly** polyList, s32 numPolys) {
*polyList = THA_AllocEndAlign(&play->state.tha, numPolys * sizeof(CollisionPoly), -2);
ASSERT(*polyList != NULL);
assert(*polyList != NULL);
}
/**
@ -2594,7 +2595,7 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
*/
void DynaPoly_AllocVtxList(PlayState* play, Vec3s** vtxList, s32 numVtx) {
*vtxList = THA_AllocEndAlign(&play->state.tha, numVtx * sizeof(Vec3s), -2);
ASSERT(*vtxList != NULL);
assert(*vtxList != NULL);
}
/**
@ -2811,8 +2812,8 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s
*vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax);
}
ASSERT(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons);
ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices);
assert(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons);
assert(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices);
if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) &&
(BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) {
@ -3245,7 +3246,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz));
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {
@ -3318,7 +3319,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo
poly = &dyna->polyList[polyId];
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
normalXZ = sqrtf(SQ(nx) + SQ(nz));
ASSERT(!IS_ZERO(normalXZ));
assert(!IS_ZERO(normalXZ));
planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos);
if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags)) {

View File

@ -2,6 +2,7 @@
#include "vt.h"
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include <assert.h>
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkBloodFunc)(PlayState*, Collider*, Vec3f*);
@ -71,7 +72,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC,
gDPPipeSync(POLY_OPA_DISP++);
vtxTbl = Graph_Alloc(gfxCtx, 3 * sizeof(Vtx));
ASSERT(vtxTbl != NULL);
assert(vtxTbl != NULL);
vtxTbl[0].n.ob[0] = vA->x;
vtxTbl[0].n.ob[1] = vA->y;
@ -453,7 +454,7 @@ s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, Coll
Collider_SetBase(play, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
ASSERT(dest->elements != NULL);
assert(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
@ -790,7 +791,7 @@ s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, Collider
Collider_SetBase(play, &dest->base, actor, &src->base);
dest->count = src->count;
dest->elements = elements;
ASSERT(dest->elements != NULL);
assert(dest->elements != NULL);
for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count;
destElem++, srcElem++) {
@ -1185,7 +1186,7 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
if (FrameAdvance_IsEnabled(play) == true) {
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sATResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -1210,7 +1211,7 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
*/
s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
if (GameInteractor_SecondCollisionUpdate()) {
return -1;
@ -1264,7 +1265,7 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
if (FrameAdvance_IsEnabled(play) == true) {
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sACResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -1289,7 +1290,7 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
*/
s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider,
s32 index) {
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
if (GameInteractor_SecondCollisionUpdate()) {
return -1;
@ -1344,7 +1345,7 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
@ -1379,7 +1380,7 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
return -1;
}
ASSERT(collider->shape <= COLSHAPE_QUAD);
assert(collider->shape <= COLSHAPE_QUAD);
sOCResetFuncs[collider->shape](play, collider);
if (collider->actor != NULL && collider->actor->update == NULL) {
return -1;
@ -3022,7 +3023,7 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCt
return;
}
ASSERT(info->acHitInfo != NULL);
assert(info->acHitInfo != NULL);
tbl = collider->actor->colChkInfo.damageTable;
if (tbl == NULL) {
damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense;

View File

@ -1,5 +1,6 @@
#include "global.h"
#include <textures/do_action_static/do_action_static.h>
#include <assert.h>
void func_80110990(PlayState* play) {
Map_Destroy(play);
@ -37,7 +38,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
ASSERT(interfaceCtx->parameterSegment != NULL);
assert(interfaceCtx->parameterSegment != NULL);
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
__FILE__, 162);
@ -46,7 +47,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization"
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->doActionSegment != NULL);
assert(interfaceCtx->doActionSegment != NULL);
interfaceCtx->doActionSegment[0] = gAttackDoActionENGTex;
interfaceCtx->doActionSegment[1] = gCheckDoActionENGTex;
@ -59,7 +60,7 @@ void func_801109B0(PlayState* play) {
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->iconItemSegment != NULL);
assert(interfaceCtx->iconItemSegment != NULL);
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
@ -154,7 +155,7 @@ void Message_Init(PlayState* play) {
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x"
ASSERT(msgCtx->textboxSegment != NULL);
assert(msgCtx->textboxSegment != NULL);
Font_LoadOrderedFont(&play->msgCtx.font);

View File

@ -340,13 +340,13 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
}
break;
case 19:
gSaveContext.eventChkInf[6] |= 0x0020;
Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL);
break;
case 20:
gSaveContext.eventChkInf[6] |= 0x0080;
Flags_SetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO);
break;
case 21:
gSaveContext.eventChkInf[6] |= 0x0200;
Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER);
break;
case 22:
D_801614B0.r = 255;
@ -624,8 +624,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
gSaveContext.fw.set = 0;
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
}
if (!(gSaveContext.eventChkInf[4] & 0x20)) {
gSaveContext.eventChkInf[4] |= 0x20;
if (!Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) {
Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL);
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF3;
@ -697,7 +697,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->fadeTransition = 3;
break;
case 18:
gSaveContext.eventChkInf[4] |= 0x8000;
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
play->nextEntranceIndex = 0x0324;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
@ -842,14 +842,14 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->fadeTransition = 17;
break;
case 46:
gSaveContext.eventChkInf[4] |= 0x8000;
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
play->nextEntranceIndex = 0x0324;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
break;
case 47:
Item_Give(play, ITEM_SONG_NOCTURNE);
gSaveContext.eventChkInf[5] |= 0x10;
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW);
play->nextEntranceIndex = 0x00DB;
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF1;
@ -1077,8 +1077,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->fadeTransition = 3;
break;
case 95:
if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) &&
(gSaveContext.eventChkInf[4] & 0x400)) {
if ((Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) &&
(Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP))) {
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF3;
@ -1111,7 +1111,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 5;
} else {
gSaveContext.eventChkInf[12] |= 0x100;
Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION);
play->nextEntranceIndex = 0x0610;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
@ -1233,8 +1233,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->fadeTransition = 2;
break;
case 113:
if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) &&
Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) {
if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL) &&
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FIRE_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_LIGHT_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SPIRIT_TRIAL)) {
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTowerBarrierCs);
play->csCtx.frames = 0;
gSaveContext.cutsceneTrigger = 1;
@ -1257,7 +1257,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
gSaveContext.nextTransitionType = 2;
break;
case 116:
if (gSaveContext.eventChkInf[12] & 0x100) {
if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION)) {
play->nextEntranceIndex = 0x0580;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
@ -2152,39 +2152,39 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
const bool bShouldTowerRandoSkip =
(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE));
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) {
if (!gSaveContext.n64ddFlag) {
Flags_SetEventChkInf(0xAC);
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT);
gSaveContext.entranceIndex = 0x0123;
gSaveContext.cutsceneIndex = 0xFFF0;
}
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) &&
(gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) &&
!Flags_GetEventChkInf(0xAA)) {
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) &&
(Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) &&
!Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) {
if (!gSaveContext.n64ddFlag) {
Flags_SetEventChkInf(0xAA);
Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL);
gSaveContext.cutsceneIndex = 0xFFF0;
}
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) {
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) {
if (!gSaveContext.n64ddFlag) {
Flags_SetEventChkInf(0xC1);
Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE);
Item_Give(play, ITEM_OCARINA_FAIRY);
gSaveContext.entranceIndex = 0x011E;
gSaveContext.cutsceneIndex = 0xFFF0;
}
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) {
if (!gSaveContext.n64ddFlag) {
Flags_SetEventChkInf(0xC4);
Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);
gSaveContext.entranceIndex = 0x0053;
gSaveContext.cutsceneIndex = 0xFFF8;
}
} else if ((!Flags_GetEventChkInf(0xC7) &&
} else if ((!Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO) &&
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO) ||
(bShouldTowerRandoSkip &&
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_FINAL)) {
Flags_SetEventChkInf(0xC7);
Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO);
gSaveContext.entranceIndex = 0x0517;
// In rando, skip the cutscene for the tower falling down after the escape.
if (gSaveContext.n64ddFlag) {

View File

@ -2,6 +2,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
EffectBlureElement* elem;
@ -618,7 +619,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp118;
Vec3f sp10C;
ASSERT(index - 1 >= 0);
assert(index - 1 >= 0);
ratio = (f32)(elem - 1)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index - 1, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);
@ -638,7 +639,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Vec3f sp100;
Vec3f spF4;
ASSERT(index + 2 < this->numElements);
assert(index + 2 < this->numElements);
ratio = (f32)(elem + 2)->timer / (f32)this->elemDuration;
EffectBlure_GetComputedValues(this, index + 2, ratio, &sp1EC, &sp1E4, &sp1DC, &sp1D8);

View File

@ -2,6 +2,7 @@
#include "vt.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
@ -18,7 +19,7 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
sEffectSsInfo.table =
GAMESTATE_ALLOC_MC(&play->state, tableSize * sizeof(EffectSs));
ASSERT(sEffectSsInfo.table != NULL);
assert(sEffectSsInfo.table != NULL);
sEffectSsInfo.searchStartIndex = 0;
sEffectSsInfo.tableSize = tableSize;
@ -175,7 +176,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) {
overlayEntry = &gEffectSsOverlayTable[type];
ASSERT(type < EFFECT_SS_TYPE_MAX);
assert(type < EFFECT_SS_TYPE_MAX);
if (EffectSs_FindSlot(priority, &index) != 0) {
// Abort because we couldn't find a suitable slot to add this effect in

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "z64elf_message.h"
#include <assert.h>
ElfMessage sChildSariaMsgs[] = {
ELF_MSG_STRENGTH_UPG(SKIP, 3, false, 0),
@ -59,7 +60,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
}
LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0);
assert(0);
return false;
}
@ -142,7 +143,7 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
return msg->byte2 | 0x100;
default:
LOG_STRING("企画外 条件"); // "Unplanned conditions"
ASSERT(0);
assert(0);
}
msg++;
}

View File

@ -1,4 +1,5 @@
#include "global.h"
#include <assert.h>
void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
skelCurve->limbCount = 0;
@ -24,7 +25,7 @@ s32 SkelCurve_Init(PlayState* play, SkelAnimeCurve* skelCurve, SkelCurveLimbList
skelCurve->limbList = SEGMENTED_TO_VIRTUAL(limbList->limbs);
skelCurve->transforms = ZELDA_ARENA_MALLOC_DEBUG(sizeof(*skelCurve->transforms) * skelCurve->limbCount);
ASSERT(skelCurve->transforms != NULL);
assert(skelCurve->transforms != NULL);
skelCurve->animCurFrame = 0.0f;
return 1;
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "vt.h"
#include <assert.h>
s32 func_8006CFC0(s32 scene) {
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
@ -47,12 +48,12 @@ void func_8006D0EC(PlayState* play, Player* player) {
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 },
};
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0))) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@ -67,23 +68,23 @@ void func_8006D0EC(PlayState* play, Player* player) {
horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1, true);
horseActor->room = -1;
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
} else if ((gSaveContext.entranceIndex == 1230) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
} else if ((play->sceneNum == gSaveContext.horseData.scene) &&
(((Flags_GetEventChkInf(0x18) != 0) && (!gSaveContext.n64ddFlag ||
(((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!gSaveContext.n64ddFlag ||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) &&
(INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) {
// "Set by existence of horse %d %d %d"
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18),
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED),
DREG(1));
if (func_8006CFC0(gSaveContext.horseData.scene)) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE,
gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y,
gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
if (play->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@ -94,18 +95,18 @@ void func_8006D0EC(PlayState* play, Player* player) {
osSyncPrintf(VT_RST);
func_8006D074(play);
}
} else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
} else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1, true);
ASSERT(horseActor != NULL);
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
assert(horseActor != NULL);
} else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i];
if (horseSpawn->scene == play->sceneNum) {
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type, true);
ASSERT(horseActor != NULL);
assert(horseActor != NULL);
if (play->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
}
@ -113,7 +114,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
break;
}
}
} else if (!Flags_GetEventChkInf(0x18)) {
} else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
if ((DREG(1) == 0) && (play->sceneNum == SCENE_SOUKO) && !IS_DAY) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1, true);
}
@ -155,16 +156,16 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.world.rot.y, 0, 7, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
gSaveContext.horseData.scene = play->sceneNum;
} else if ((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) == 0) && (DREG(1) == 0)) {
player->rideActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@ -194,7 +195,7 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
player->actor.world.rot.y, 0, D_8011F9B8[i].type, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
@ -209,7 +210,7 @@ void func_8006D684(PlayState* play, Player* player) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp, true);
ASSERT(player->rideActor != NULL);
assert(player->rideActor != NULL);
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y;
@ -252,7 +253,7 @@ void func_8006DC68(PlayState* play, Player* player) {
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
(gSaveContext.respawnFlag == 0)) ||
((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
func_8006D684(play, player);
} else {
func_8006D0EC(play, player);

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "vt.h"
#include <assert.h>
#define MARKER_ESCAPE 0x00
#define MARKER_SOI 0xD8
@ -250,7 +251,7 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) {
time = osGetTime();
// (?) I guess MB_SIZE=0x180, PROC_OF_MBS=5 which means data is not a part of JpegWork
ASSERT(workSize >= sizeof(JpegWork));
assert(workSize >= sizeof(JpegWork));
osCreateMesgQueue(&ctx.mq, &ctx.msg, 1);
MsgEvent_SendNullTask();

View File

@ -214,6 +214,11 @@ LightInfo sSGameOverLightInfo;
u8 sGameOverLightsIntensity;
u16 D_8015FDB0;
void LoadSkyboxPalette(SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width,
int height);
void LoadSkyboxTex(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height, int offsetW, int offsetH);
void Skybox_Update(SkyboxContext* skyboxCtx);
s32 func_8006F0A0(s32 a0) {
s32 ret = ((a0 >> 4 & 0x7FF) << D_8011FAF0[a0 >> 15 & 7].unk_00) + D_8011FAF0[a0 >> 15 & 7].unk_04;
@ -2542,19 +2547,19 @@ void Environment_WarpSongLeave(PlayState* play) {
switch (play->nextEntranceIndex) {
case 0x147:
Flags_SetEventChkInf(0xB9);
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_CRATER);
break;
case 0x0102:
Flags_SetEventChkInf(0xB1);
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_LAKE_HYLIA);
break;
case 0x0123:
Flags_SetEventChkInf(0xB8);
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DESERT_COLOSSUS);
break;
case 0x00E4:
Flags_SetEventChkInf(0xB6);
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_GRAVEYARD);
break;
case 0x0053:
Flags_SetEventChkInf(0xA7);
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_TEMPLE_OF_TIME);
break;
case 0x00FC:
break;

View File

@ -4,6 +4,7 @@
#include "textures/parameter_static/parameter_static.h"
#include "textures/map_i_static/map_i_static.h"
#include "textures/map_grand_static/map_grand_static.h"
#include <assert.h>
MapData* gMapData;
@ -398,11 +399,11 @@ void Map_InitData(PlayState* play, s16 room) {
extendedMapIndex = 0x15;
}
} else if (play->sceneNum == SCENE_SPOT09) {
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) {
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
extendedMapIndex = 0x16;
}
} else if (play->sceneNum == SCENE_SPOT12) {
if ((!gSaveContext.n64ddFlag && ((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) ||
if ((!gSaveContext.n64ddFlag && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) ||
(gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) {
extendedMapIndex = 0x17;
}
@ -527,7 +528,7 @@ void Map_Init(PlayState* play) {
// " texture initialization scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneNum,
interfaceCtx->mapSegment, play);
ASSERT(interfaceCtx->mapSegment != NULL);
assert(interfaceCtx->mapSegment != NULL);
switch (play->sceneNum) {
case SCENE_SPOT00:

View File

@ -8,6 +8,8 @@
#include "textures/message_static/message_static.h"
#include "textures/message_texture_static/message_texture_static.h"
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/OTRGlobals.h"
s16 sTextFade = false; // original name: key_off_flag ?
@ -1616,7 +1618,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> 0x1C;
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2))) {
textId = 0xB; // Traded Giant's Knife for Biggoron Sword
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (gSaveContext.eventChkInf[9] & 0x40))) {
} else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) {
textId = 0xB5; // Destroyed Gold Skulltula
}
// Ocarina Staff + Dialog

View File

@ -6,6 +6,7 @@
#include "soh_assets.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include "libultraship/bridge.h"
#include "soh/Enhancements/gameplaystats.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h"
@ -13,15 +14,13 @@
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/enhancementTypes.h"
#ifdef _MSC_VER
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#endif
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
#define DO_ACTION_TEX_WIDTH() 48
#define DO_ACTION_TEX_HEIGHT() 16
@ -1417,7 +1416,7 @@ void Inventory_SwapAgeEquipment(void) {
// When becoming adult, remove swordless flag since we'll get master sword
// Only in rando to keep swordless link bugs in vanilla
if (gSaveContext.n64ddFlag) {
gSaveContext.infTable[29] &= ~1;
Flags_UnsetInfTable(INFTABLE_SWORDLESS);
}
gSaveContext.childEquips.equipment = gSaveContext.equips.equipment;
@ -1471,13 +1470,13 @@ void Inventory_SwapAgeEquipment(void) {
// When becoming child, set swordless flag if player doesn't have kokiri sword
// Only in rando to keep swordless link bugs in vanilla
if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) {
gSaveContext.infTable[29] |= 1;
Flags_SetInfTable(INFTABLE_SWORDLESS);
}
// When using enhancements, set swordless flag if player doesn't have kokiri sword or hasn't equipped a sword yet.
// Then set the child equips button items to item none to ensure kokiri sword is not equipped
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || gSaveContext.infTable[29] & 1)) {
gSaveContext.infTable[29] |= 1;
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || Flags_GetInfTable(INFTABLE_SWORDLESS))) {
Flags_SetInfTable(INFTABLE_SWORDLESS);
gSaveContext.childEquips.buttonItems[0] = ITEM_NONE;
}
@ -1512,7 +1511,7 @@ void Inventory_SwapAgeEquipment(void) {
gSaveContext.equips.equipment = gSaveContext.childEquips.equipment;
gSaveContext.equips.equipment &= 0xFFF0;
// Equips kokiri sword in the inventory screen only if kokiri sword exists in inventory and a sword has been equipped already
if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !(gSaveContext.infTable[29] & 1)) {
if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !Flags_GetInfTable(INFTABLE_SWORDLESS)) {
gSaveContext.equips.equipment |= 0x0001;
}
} else if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) {
@ -1543,7 +1542,7 @@ void Inventory_SwapAgeEquipment(void) {
When becoming child, set swordless flag if player doesn't have kokiri sword
Only in rando to keep swordless link bugs in vanilla*/
if (1 << 0 & gSaveContext.inventory.equipment == 0) {
gSaveContext.infTable[29] |= 1;
Flags_SetInfTable(INFTABLE_SWORDLESS);
}
//zero out items
@ -1558,7 +1557,7 @@ void Inventory_SwapAgeEquipment(void) {
if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) &&
(gSaveContext.equips.buttonItems[0] == ITEM_NONE)) {
gSaveContext.infTable[29] |= 1;
Flags_SetInfTable(INFTABLE_SWORDLESS);
if (gSaveContext.childEquips.equipment == 0) {
// force equip kokiri tunic and boots in scenario gSaveContext.childEquips.equipment is uninitialized
gSaveContext.equips.equipment &= 0xFFF0;
@ -1871,53 +1870,16 @@ u8 Item_Give(PlayState* play, u8 item) {
gSaveContext.inventory.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]);
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
// Boss Key, Compass, and Dungeon Map exceptions for rando.
// Rando should never be able to get here for Link's Pocket unless something goes wrong,
// but we check for a play here so the game won't crash if we do somehow get here.
if (gSaveContext.n64ddFlag && play != NULL) {
if (play->sceneNum == 13) { // ganon's castle -> ganon's tower
gSaveContext.inventory.dungeonItems[10] |= 1;
} else if (play->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
gSaveContext.inventory.dungeonItems[6] |= gBitFlags[item - ITEM_KEY_BOSS];
} else {
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
}
} else {
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
}
gSaveContext.inventory.dungeonItems[gSaveContext.mapIndex] |= gBitFlags[item - ITEM_KEY_BOSS];
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if (item == ITEM_KEY_SMALL) {
// Small key exceptions for rando with keysanity off.
// Rando should never be able to get here for Link's Pocket unless something goes wrong,
// but we check for a play here so the game won't crash if we do somehow get here.
if (gSaveContext.n64ddFlag && play != NULL) {
if (play->sceneNum == 10) { // ganon's tower -> ganon's castle
gSaveContext.sohStats.dungeonKeys[13]++;
if (gSaveContext.inventory.dungeonKeys[13] < 0) {
gSaveContext.inventory.dungeonKeys[13] = 1;
} else {
gSaveContext.inventory.dungeonKeys[13]++;
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
if (play->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
gSaveContext.sohStats.dungeonKeys[6]++;
if (gSaveContext.inventory.dungeonKeys[6] < 0) {
gSaveContext.inventory.dungeonKeys[6] = 1;
} else {
gSaveContext.inventory.dungeonKeys[6]++;
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
}
gSaveContext.sohStats.dungeonKeys[gSaveContext.mapIndex]++;
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1;
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]++;
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) {
if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
Inventory_ChangeUpgrade(UPG_QUIVER, 1);
@ -2155,8 +2117,8 @@ u8 Item_Give(PlayState* play, u8 item) {
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
}
if (!(gSaveContext.itemGetInf[1] & 8)) {
gSaveContext.itemGetInf[1] |= 8;
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
Flags_SetItemGetInf(ITEMGETINF_13);
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
@ -2168,8 +2130,8 @@ u8 Item_Give(PlayState* play, u8 item) {
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
}
if (!(gSaveContext.itemGetInf[1] & 8)) {
gSaveContext.itemGetInf[1] |= 8;
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
Flags_SetItemGetInf(ITEMGETINF_13);
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
@ -2245,8 +2207,8 @@ u8 Item_Give(PlayState* play, u8 item) {
func_80087708(play, 12, 5);
}
if (!(gSaveContext.infTable[25] & 0x100)) {
gSaveContext.infTable[25] |= 0x100;
if (!Flags_GetInfTable(INFTABLE_198)) {
Flags_SetInfTable(INFTABLE_198);
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
@ -2261,8 +2223,8 @@ u8 Item_Give(PlayState* play, u8 item) {
func_80087708(play, 24, 5);
}
if (!(gSaveContext.infTable[25] & 0x100)) {
gSaveContext.infTable[25] |= 0x100;
if (!Flags_GetInfTable(INFTABLE_198)) {
Flags_SetInfTable(INFTABLE_198);
return Return_Item(item, MOD_NONE, ITEM_NONE);
}
@ -2321,7 +2283,7 @@ u8 Item_Give(PlayState* play, u8 item) {
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
if ((item == ITEM_SAW) && CVarGetInteger("gDekuNutUpgradeFix", 0) == 0) {
gSaveContext.itemGetInf[1] |= 0x8000;
Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE);
}
if (item >= ITEM_POCKET_EGG) {
@ -2670,7 +2632,7 @@ u8 Item_CheckObtainability(u8 item) {
} else if (item == ITEM_LONGSHOT) {
return ITEM_NONE;
} else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) {
if (!(gSaveContext.itemGetInf[1] & 0x8)) {
if (!Flags_GetItemGetInf(ITEMGETINF_13)) {
return ITEM_NONE;
} else {
return ITEM_SEEDS;
@ -2685,8 +2647,8 @@ u8 Item_CheckObtainability(u8 item) {
return ITEM_HEART;
} else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) {
// "Magic Pot Get_Inf_Table( 25, 0x0100)=%d"
osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.infTable[25] & 0x100);
if (!(gSaveContext.infTable[25] & 0x100)) {
osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", Flags_GetInfTable(INFTABLE_198));
if (!Flags_GetInfTable(INFTABLE_198)) {
return ITEM_NONE;
} else {
return item;
@ -3644,6 +3606,178 @@ void Interface_DrawMagicBar(PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
static Vtx sEnemyHealthVtx[16];
static Mtx sEnemyHealthMtx[2];
// Build vertex coordinates for a quad command
// In order of top left, top right, bottom left, then bottom right
// Supports flipping the texture horizontally
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH) {
vtxList[0].v.ob[0] = xStart;
vtxList[0].v.ob[1] = yStart;
vtxList[0].v.tc[0] = (flippedH ? width : 0) << 5;
vtxList[0].v.tc[1] = 0 << 5;
vtxList[1].v.ob[0] = xStart + width;
vtxList[1].v.ob[1] = yStart;
vtxList[1].v.tc[0] = (flippedH ? width * 2 : width) << 5;
vtxList[1].v.tc[1] = 0 << 5;
vtxList[2].v.ob[0] = xStart;
vtxList[2].v.ob[1] = yStart + height;
vtxList[2].v.tc[0] = (flippedH ? width : 0) << 5;
vtxList[2].v.tc[1] = height << 5;
vtxList[3].v.ob[0] = xStart + width;
vtxList[3].v.ob[1] = yStart + height;
vtxList[3].v.tc[0] = (flippedH ? width * 2 : width) << 5;
vtxList[3].v.tc[1] = height << 5;
}
// Draws an enemy health bar using the magic bar textures and positions it in a similar way to Z-Targeting
void Interface_DrawEnemyHealthBar(TargetContext* targetCtx, PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
Player* player = GET_PLAYER(play);
Actor* actor = targetCtx->targetedActor;
Vec3f projTargetCenter;
f32 projTargetCappedInvW;
Color_RGBA8 healthbar_red = { 255, 0, 0, 255 };
Color_RGBA8 healthbar_border = { 255, 255, 255, 255 };
s16 healthbar_fillWidth = 64;
s16 healthbar_actorOffset = 40;
s32 healthbar_offsetX = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosX", 0);
s32 healthbar_offsetY = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosY", 0);
s8 anchorType = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarPosType", ENEMYHEALTH_ANCHOR_ACTOR);
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBar.Changed", 0)) {
healthbar_red = CVarGetColor("gCosmetics.Hud_EnemyHealthBar.Value", healthbar_red);
}
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBorder.Changed", 0)) {
healthbar_border = CVarGetColor("gCosmetics.Hud_EnemyHealthBorder.Value", healthbar_border);
}
if (CVarGetInteger("gCosmetics.Hud_EnemyHealthBarWidth.Changed", 0)) {
healthbar_fillWidth = CVarGetInteger("gCosmetics.Hud_EnemyHealthBarWidth.Value", healthbar_fillWidth);
}
OPEN_DISPS(play->state.gfxCtx);
if (targetCtx->unk_48 != 0 && actor != NULL && actor->category == ACTORCAT_ENEMY) {
s16 texHeight = 16;
s16 endTexWidth = 8;
f32 scaleY = -0.75f;
f32 scaledHeight = -texHeight * scaleY;
f32 halfBarWidth = endTexWidth + ((f32)healthbar_fillWidth / 2);
s16 healthBarFill = ((f32)actor->colChkInfo.health / actor->maximumHealth) * healthbar_fillWidth;
if (anchorType == ENEMYHEALTH_ANCHOR_ACTOR) {
// Get actor projected position
func_8002BE04(play, &targetCtx->targetCenterPos, &projTargetCenter, &projTargetCappedInvW);
projTargetCenter.x = (SCREEN_WIDTH / 2) * (projTargetCenter.x * projTargetCappedInvW);
projTargetCenter.x = projTargetCenter.x * (CVarGetInteger("gMirroredWorld", 0) ? -1 : 1);
projTargetCenter.x = CLAMP(projTargetCenter.x, (-SCREEN_WIDTH / 2) + halfBarWidth,
(SCREEN_WIDTH / 2) - halfBarWidth);
projTargetCenter.y = (SCREEN_HEIGHT / 2) * (projTargetCenter.y * projTargetCappedInvW);
projTargetCenter.y = projTargetCenter.y - healthbar_offsetY + healthbar_actorOffset;
projTargetCenter.y = CLAMP(projTargetCenter.y, (-SCREEN_HEIGHT / 2) + (scaledHeight / 2),
(SCREEN_HEIGHT / 2) - (scaledHeight / 2));
} else if (anchorType == ENEMYHEALTH_ANCHOR_TOP) {
projTargetCenter.x = healthbar_offsetX;
projTargetCenter.y = (SCREEN_HEIGHT / 2) - (scaledHeight / 2) - healthbar_offsetY;
} else if (anchorType == ENEMYHEALTH_ANCHOR_BOTTOM) {
projTargetCenter.x = healthbar_offsetX;
projTargetCenter.y = (-SCREEN_HEIGHT / 2) + (scaledHeight / 2) - healthbar_offsetY;
}
// Health bar border end left
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[0], -floorf(halfBarWidth), -texHeight / 2, endTexWidth, texHeight, 0);
// Health bar border middle
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[4], -floorf(halfBarWidth) + endTexWidth, -texHeight / 2,
healthbar_fillWidth, texHeight, 0);
// Health bar border end right
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[8], ceilf(halfBarWidth) - endTexWidth, -texHeight / 2, endTexWidth,
texHeight, 1);
// Health bar fill
Interface_CreateQuadVertexGroup(&sEnemyHealthVtx[12], -floorf(halfBarWidth) + endTexWidth, (-texHeight / 2) + 3,
healthBarFill, 7, 0);
if (((!(player->stateFlags1 & 0x40)) || (actor != player->unk_664)) && targetCtx->unk_44 < 500.0f) {
f32 slideInOffsetY = 0;
// Slide in the health bar from edge of the screen (mimic the Z-Target triangles fly in)
if (anchorType == ENEMYHEALTH_ANCHOR_ACTOR && targetCtx->unk_44 > 120.0f) {
slideInOffsetY = (targetCtx->unk_44 - 120.0f) / 2;
// Slide in from the top if the bar is placed on the top half of the screen
if (healthbar_offsetY - healthbar_actorOffset <= 0) {
slideInOffsetY *= -1;
}
}
// Setup DL for overlay disp
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
Matrix_Translate(projTargetCenter.x, projTargetCenter.y - slideInOffsetY, 0, MTXMODE_NEW);
Matrix_Scale(1.0f, scaleY, 1.0f, MTXMODE_APPLY);
Matrix_ToMtx(&sEnemyHealthMtx[0], __FILE__, __LINE__);
gSPMatrix(OVERLAY_DISP++, &sEnemyHealthMtx[0], G_MTX_MODELVIEW | G_MTX_LOAD);
// Health bar border
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, healthbar_border.r, healthbar_border.g, healthbar_border.b,
healthbar_border.a);
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
gSPVertex(OVERLAY_DISP++, sEnemyHealthVtx, 16, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, endTexWidth, texHeight, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterMidTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, texHeight, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(OVERLAY_DISP++, 4, 6, 7, 5, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, endTexWidth, texHeight, 0,
G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSP1Quadrangle(OVERLAY_DISP++, 8, 10, 11, 9, 0);
// Health bar fill
Matrix_Push();
Matrix_Translate(-0.375f, -0.5f, 0, MTXMODE_APPLY);
Matrix_ToMtx(&sEnemyHealthMtx[1], __FILE__, __LINE__);
gSPMatrix(OVERLAY_DISP++, &sEnemyHealthMtx[1], G_MTX_MODELVIEW | G_MTX_LOAD);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, healthbar_red.r, healthbar_red.g, healthbar_red.b, healthbar_red.a);
gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, texHeight, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(OVERLAY_DISP++, &sEnemyHealthVtx[12], 4, 0);
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
Matrix_Pop();
}
}
CLOSE_DISPS(play->state.gfxCtx);
}
void func_80088AA0(s16 arg0) {
gSaveContext.timerX[1] = 140;
gSaveContext.timerY[1] = 80;
@ -5097,6 +5231,11 @@ void Interface_Draw(PlayState* play) {
if (CVarGetInteger("gMirroredWorld", 0)) {
gSPMatrix(OVERLAY_DISP++, interfaceCtx->view.projectionPtr, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
}
// Render enemy health bar after Z-target to leverage set variables
if (CVarGetInteger("gEnemyHealthBar", 0)) {
Interface_DrawEnemyHealthBar(&play->actorCtx.targetCtx, play);
}
}
Gfx_SetupDL_39Overlay(play->state.gfxCtx);

View File

@ -10,10 +10,12 @@
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include <overlays/actors/ovl_En_Niw/z_en_niw.h>
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include <libultraship/libultraship.h>
#include <time.h>
#include <assert.h>
void* D_8012D1F0 = NULL;
//UNK_TYPE D_8012D1F4 = 0; // unused
@ -33,12 +35,17 @@ PlayState* gPlayState;
s16 gEnPartnerId;
void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn);
void enableBetaQuest();
void disableBetaQuest();
void func_800BC450(PlayState* play) {
Camera_ChangeDataIdx(GET_ACTIVE_CAM(play), play->unk_1242B - 1);
}
void func_800BC490(PlayState* play, s16 point) {
ASSERT(point == 1 || point == 2);
assert(point == 1 || point == 2);
play->unk_1242B = point;
@ -234,7 +241,7 @@ void GivePlayerRandoRewardNocturne(PlayState* play, RandomizerCheck check) {
gSaveContext.entranceIndex == 0x0191 ||
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
!Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(0xAA)) {
!Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
GiveItemEntryWithoutActor(play, getItemEntry);
player->pendingFlag.flagID = 0xAA;
@ -246,7 +253,7 @@ void GivePlayerRandoRewardRequiem(PlayState* play, RandomizerCheck check) {
Player* player = GET_PLAYER(play);
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT) && player != NULL &&
!Player_InBlockingCsMode(play, player)) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemEntryWithoutActor(play, getItemEntry);
@ -433,7 +440,7 @@ void GivePlayerRandoRewardSariaGift(PlayState* play, RandomizerCheck check) {
if (gSaveContext.entranceIndex == 0x05E0) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);
if (!Flags_GetEventChkInf(0xC1) && player != NULL && !Player_InBlockingCsMode(play, player)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE) && player != NULL && !Player_InBlockingCsMode(play, player)) {
GiveItemEntryWithoutActor(play, getItemEntry);
player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF;
player->pendingFlag.flagID = 0xC1;
@ -462,7 +469,7 @@ void Play_Init(GameState* thisx) {
// entranceIndex 0x7A, Castle Courtyard - Day from crawlspace
// entranceIndex 0x400, Zelda's Courtyard
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) &&
!(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) {
!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) {
if (gSaveContext.entranceIndex == 0x7A) {
gSaveContext.entranceIndex = 0x400;
}
@ -560,7 +567,7 @@ void Play_Init(GameState* thisx) {
}
} else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT &&
gSaveContext.sceneSetupIndex < 4) {
gSaveContext.sceneSetupIndex = (gSaveContext.eventChkInf[4] & 0x100) ? 3 : 2;
gSaveContext.sceneSetupIndex = (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) ? 3 : 2;
}
Play_SpawnScene(

View File

@ -8,6 +8,8 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include <stdlib.h>
typedef struct {
/* 0x00 */ u8 flag;
/* 0x02 */ u16 textId;
@ -1712,6 +1714,7 @@ s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
}
#include <overlays/actors/ovl_Demo_Effect/z_demo_effect.h>
void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play);
void Pause_DrawTriforceSpot(PlayState* play, s32 showLightColumn) {
static DemoEffect triforce;

View File

@ -1,4 +1,5 @@
#include "global.h"
#include <assert.h>
Gfx sSetupDL[SETUPDL_MAX][6] = {
{
@ -852,7 +853,7 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
far++;
}
ASSERT(near != far);
assert(near != far);
gDPSetFogColor(gfx++, r, g, b, a);
@ -873,7 +874,7 @@ Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far)
if (far == near) {
far++;
}
ASSERT(near != far);
assert(near != far);
gDPPipeSync(gfx++);
gDPSetFogColor(gfx++, r, g, b, a);

View File

@ -5,6 +5,8 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include <string.h>
#include <assert.h>
void func_80095AB4(PlayState* play, Room* room, u32 flags);
void func_80095D04(PlayState* play, Room* room, u32 flags);
@ -27,6 +29,9 @@ Gfx D_801270B0[] = {
gsSPEndDisplayList(),
};
s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum);
s32 OTRfunc_800973FC(PlayState* play, RoomContext* roomCtx);
void (*sRoomDrawHandlers[])(PlayState* play, Room* room, u32 flags) = {
func_80095AB4,
func_80096F6C,
@ -122,7 +127,7 @@ void func_80095D04(PlayState* play, Room* room, u32 flags) {
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
spA4 = spB8;
ASSERT(polygon2->num <= SHAPE_SORT_MAX);
assert(polygon2->num <= SHAPE_SORT_MAX);
sp78 = polygonDlist;
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
@ -586,7 +591,7 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
roomCtx->curRoom.segment = NULL;
roomCtx->status = 1;
ASSERT(roomNum < play->numRooms);
assert(roomNum < play->numRooms);
size = play->roomList[roomNum].vromEnd - play->roomList[roomNum].vromStart;
roomCtx->unk_34 = (void*)ALIGN16((intptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
@ -629,7 +634,7 @@ void Room_Draw(PlayState* play, Room* room, u32 flags) {
if (room->segment != NULL)
{
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
ASSERT(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers));
assert(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers));
sRoomDrawHandlers[room->meshHeader->base.type](play, room, flags);
}
}

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "vt.h"
#include "soh/ActorDB.h"
#include <assert.h>
RomFile sNaviMsgFiles[];
@ -15,7 +16,7 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (uintptr_t)objectCtx->status[objectCtx->num].segment + size,
objectCtx->spaceEnd);
ASSERT(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
assert(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
(((uintptr_t)objectCtx->status[objectCtx->num].segment + size) < (uintptr_t)objectCtx->spaceEnd)));
DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
@ -153,7 +154,7 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
nextPtr = (void*)ALIGN16((uintptr_t)status->segment + size);
ASSERT(nextPtr < objectCtx->spaceEnd);
assert(nextPtr < objectCtx->spaceEnd);
// "Object exchange free size=%08x"
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (uintptr_t)objectCtx->spaceEnd - (uintptr_t)nextPtr);
@ -284,7 +285,7 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) {
status++;
}
ASSERT(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX);
assert(cmd->objectList.num <= OBJECT_EXCHANGE_BANK_MAX);
while (k < cmd->objectList.num) {
nextPtr = func_800982FC(&play->objectCtx, i, *objectEntry);

View File

@ -2030,7 +2030,7 @@ void func_8009E0B8(PlayState* play) {
spA3 = 255 - (u8)play->roomCtx.unk_74[0];
} else if (gSaveContext.sceneSetupIndex == 6) {
spA0 = play->roomCtx.unk_74[0] + 500;
} else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (gSaveContext.eventChkInf[0] & 0x80)) {
} else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) {
spA0 = 2150;
}
@ -2058,7 +2058,7 @@ void func_8009E54C(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200))) {
if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER))) {
play->roomCtx.unk_74[0] = 87;
}

View File

@ -1,5 +1,8 @@
#include "global.h"
#include "vt.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#define ANIM_INTERP 1
@ -865,7 +868,7 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
char animPath[2048];
sprintf(animPath, "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
snprintf(animPath, sizeof(animPath), "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
//printf("Streaming %s, seg = %08X\n", animPath, linkAnimHeader->segment);
@ -1108,7 +1111,7 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
skelAnime->jointTable = ZELDA_ARENA_MALLOC_DEBUG(allocSize);
skelAnime->morphTable = ZELDA_ARENA_MALLOC_DEBUG(allocSize);
} else {
ASSERT(limbBufCount == limbCount);
assert(limbBufCount == limbCount);
skelAnime->jointTable = (Vec3s*)ALIGN16((uintptr_t)jointTable);
skelAnime->morphTable = (Vec3s*)ALIGN16((uintptr_t)morphTable);
@ -1441,7 +1444,7 @@ s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet
skelAnime->morphTable =
ZELDA_ARENA_MALLOC_DEBUG(skelAnime->limbCount * sizeof(*skelAnime->morphTable));
} else {
ASSERT(limbCount == skelAnime->limbCount);
assert(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}
@ -1477,7 +1480,7 @@ s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader
skelAnime->morphTable =
ZELDA_ARENA_MALLOC_DEBUG(skelAnime->limbCount * sizeof(*skelAnime->morphTable));
} else {
ASSERT(limbCount == skelAnime->limbCount);
assert(limbCount == skelAnime->limbCount);
skelAnime->jointTable = jointTable;
skelAnime->morphTable = morphTable;
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include <assert.h>
/**
* Initialises the Vtx buffers used for limb at index `limbIndex`
@ -53,7 +54,7 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
skin->vtxTable = ZELDA_ARENA_MALLOC_DEBUG(limbCount * sizeof(SkinLimbVtx));
ASSERT(skin->vtxTable != NULL);
assert(skin->vtxTable != NULL);
for (i = 0; i < limbCount; i++) {
SkinLimbVtx* vtxEntry = &skin->vtxTable[i];
@ -71,11 +72,11 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
vtxEntry->buf[0] =
ZELDA_ARENA_MALLOC_DEBUG(animatedLimbData->totalVtxCount * sizeof(Vtx));
ASSERT(vtxEntry->buf[0] != NULL);
assert(vtxEntry->buf[0] != NULL);
vtxEntry->buf[1] =
ZELDA_ARENA_MALLOC_DEBUG(animatedLimbData->totalVtxCount * sizeof(Vtx));
ASSERT(vtxEntry->buf[1] != NULL);
assert(vtxEntry->buf[1] != NULL);
Skin_InitAnimatedLimb(play, skin, i);
}

View File

@ -8,6 +8,8 @@
#define NUM_DUNGEONS 8
#define NUM_COWS 10
void Save_LoadFile(void);
/**
* Initialize new save.
* This save has an empty inventory with 3 hearts and single magic.
@ -153,7 +155,7 @@ void Sram_OpenSave() {
}
// if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter
if ((gSaveContext.eventChkInf[4] & 1) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) {
if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) {
i = gSaveContext.eventChkInf[4] & ~1;
gSaveContext.eventChkInf[4] = i;

View File

@ -3,6 +3,7 @@
#include <string.h>
#include <math.h>
#include <assert.h>
#include "soh/frame_interpolation.h"
@ -176,10 +177,10 @@ void func_800AA550(View* view) {
lrx = view->viewport.rightX - varX;
lry = view->viewport.bottomY - varY;
ASSERT(ulx >= 0);
ASSERT(uly >= 0);
ASSERT(lrx <= SCREEN_WIDTH);
ASSERT(lry <= SCREEN_HEIGHT);
assert(ulx >= 0);
assert(uly >= 0);
assert(lrx <= SCREEN_WIDTH);
assert(lry <= SCREEN_HEIGHT);
OPEN_DISPS(gfxCtx);

View File

@ -1,5 +1,6 @@
#include "global.h"
#include <string.h>
#include <assert.h>
// (Note: 80 = SCREEN_HEIGHT/3, see VisMono_DrawTexture)
// This may not have been kept up-to-date with the code, 1+1+1+80*(7+2+2+3)+1+1 makes more sense
@ -101,7 +102,7 @@ void VisMono_Draw(VisMono* this, Gfx** gfxp) {
LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", monoDL + DLSIZE);
LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE);
}
ASSERT(glistpEnd <= monoDL + DLSIZE);
assert(glistpEnd <= monoDL + DLSIZE);
}
gDPPipeSync(gfx++);
@ -131,6 +132,6 @@ void VisMono_DrawOld(VisMono* this) {
if (!this->monoDl) {
this->monoDl = SYSTEM_ARENA_MALLOC_DEBUG(DLSIZE * sizeof(Gfx));
glistpEnd = VisMono_DrawTexture(this, this->monoDl);
ASSERT(glistpEnd <= this->monoDl + DLSIZE);
assert(glistpEnd <= this->monoDl + DLSIZE);
}
}

View File

@ -2,6 +2,7 @@
#include "vt.h"
#include <stdlib.h>
#include <assert.h>
#include "z64environment.h"
#include "assets/textures/backgrounds/vr_ALVR_static.h"
@ -961,24 +962,24 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
if (skyboxCtx->unk_140 != 0) {
skyboxCtx->dListBuf = GAMESTATE_ALLOC_MC(state, 8 * 150 * sizeof(Gfx));
ASSERT(skyboxCtx->dListBuf != NULL);
assert(skyboxCtx->dListBuf != NULL);
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 256 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AEFC8(skyboxCtx, skyboxId);
} else {
skyboxCtx->dListBuf = GAMESTATE_ALLOC_MC(state, 12 * 150 * sizeof(Gfx));
ASSERT(skyboxCtx->dListBuf != NULL);
assert(skyboxCtx->dListBuf != NULL);
if (skyboxId == SKYBOX_CUTSCENE_MAP) {
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 192 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 6);
} else {
skyboxCtx->roomVtx = GAMESTATE_ALLOC_MC(state, 160 * sizeof(Vtx));
ASSERT(skyboxCtx->roomVtx != NULL);
assert(skyboxCtx->roomVtx != NULL);
func_800AF178(skyboxCtx, 5);
}

View File

@ -80,7 +80,7 @@ s32 BgBdanObjects_GetContactRu1(BgBdanObjects* this, s32 arg1) {
case 0:
return this->cameraSetting == CAM_SET_NORMAL0;
case 4:
return gSaveContext.infTable[20] & 0x40;
return Flags_GetInfTable(INFTABLE_146);
case 3:
return this->cameraSetting == CAM_SET_DUNGEON1;
default:
@ -98,7 +98,7 @@ void BgBdanObjects_SetContactRu1(BgBdanObjects* this, s32 arg1) {
this->cameraSetting = CAM_SET_DUNGEON0;
break;
case 4:
gSaveContext.infTable[20] |= 0x40;
Flags_SetInfTable(INFTABLE_146);
break;
default:
osSyncPrintf("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n");

View File

@ -298,8 +298,8 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
}
if ((wallType == BWALL_DC_ENTRANCE) && (!(Flags_GetEventChkInf(0xB0)))) {
Flags_SetEventChkInf(0xB0);
if ((wallType == BWALL_DC_ENTRANCE) && (!Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) {
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN);
Cutscene_SetSegment(play, gDcOpeningCs);
gSaveContext.cutsceneTrigger = 1;
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);

View File

@ -181,7 +181,7 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) {
sBgDodoagoFirstExplosiveFlag = true;
sBgDodoagoTimer = 50;
}
} else if (Flags_GetEventChkInf(0xB0)) {
} else if (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN)) {
Collider_UpdateCylinder(&this->dyna.actor, &this->colliderMain);
Collider_UpdateCylinder(&this->dyna.actor, &this->colliderLeft);
Collider_UpdateCylinder(&this->dyna.actor, &this->colliderRight);
@ -311,7 +311,7 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) {
void BgDodoago_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
if (Flags_GetEventChkInf(0xB0)) {
if (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN)) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -237,17 +237,17 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
if (play->sceneNum != SCENE_DAIYOUSEI_IZUMI) {
switch (this->fountainType) {
case FAIRY_SPELL_FARORES_WIND:
if (!(gSaveContext.itemGetInf[1] & 0x100)) {
if (!Flags_GetItemGetInf(ITEMGETINF_18)) {
givingReward = true;
}
break;
case FAIRY_SPELL_DINS_FIRE:
if (!(gSaveContext.itemGetInf[1] & 0x200)) {
if (!Flags_GetItemGetInf(ITEMGETINF_19)) {
givingReward = true;
}
break;
case FAIRY_SPELL_NAYRUS_LOVE:
if (!(gSaveContext.itemGetInf[1] & 0x400)) {
if (!Flags_GetItemGetInf(ITEMGETINF_1A)) {
givingReward = true;
}
break;

View File

@ -44,8 +44,8 @@ void BgGateShutter_Init(Actor* thisx, PlayState* play) {
this->somePos.x = thisx->world.pos.x;
this->somePos.y = thisx->world.pos.y;
this->somePos.z = thisx->world.pos.z;
if (((gSaveContext.infTable[7] & 0x40) ||
(!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[4] & 0x20)) ||
if (((Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) ||
(!gSaveContext.n64ddFlag && (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL))) ||
(gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN))) &&
(play->sceneNum == SCENE_SPOT01)) {
thisx->world.pos.x = -89.0f;
@ -66,7 +66,7 @@ void BgGateShutter_Destroy(Actor* thisx, PlayState* play) {
}
void func_8087828C(BgGateShutter* this, PlayState* play) {
if (this->openingState == 1 && !(gSaveContext.infTable[7] & 0x40)) {
if (this->openingState == 1 && !Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) {
this->unk_178 = 2;
this->actionFunc = func_80878300;
} else if (this->openingState == 2) {

View File

@ -51,7 +51,7 @@ void BgGjyoBridge_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE);
if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) {
if (Flags_GetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT) || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) {
this->actionFunc = func_808787A4;
} else {
this->dyna.actor.draw = NULL;
@ -150,7 +150,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, PlayState* play) {
(play->csCtx.npcActions[2]->action == 2)) {
this->dyna.actor.draw = BgGjyoBridge_Draw;
func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId);
gSaveContext.eventChkInf[4] |= 0x2000;
Flags_SetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT);
}
}

View File

@ -6,6 +6,7 @@
#include "z_bg_gnd_iceblock.h"
#include "objects/object_demo_kekkai/object_demo_kekkai.h"
#include <assert.h>
#define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED)
@ -64,7 +65,7 @@ void BgGndIceblock_Init(Actor* thisx, PlayState* play) {
sBlockPositions[1] = 14;
} else {
LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x);
ASSERT(0);
assert(0);
}
}

View File

@ -46,7 +46,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if ((play->sceneNum != SCENE_SPOT20 || !LINK_IS_ADULT) ||
(((gSaveContext.eventChkInf[1] & 0x100)) && (gSaveContext.cutsceneIndex != 0xFFF0))) {
(((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) && (gSaveContext.cutsceneIndex != 0xFFF0))) {
Actor_Kill(&this->dyna.actor);
return;
}

View File

@ -28,6 +28,8 @@ void BgMoriHineri_SpawnBossKeyChest(BgMoriHineri* this, PlayState* play);
void BgMoriHineri_DoNothing(BgMoriHineri* this, PlayState* play);
void func_808A3D58(BgMoriHineri* this, PlayState* play);
s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId);
s16 sBgMoriHineriNextCamIdx = SUBCAM_NONE;
const ActorInit Bg_Mori_Hineri_InitVars = {

View File

@ -57,7 +57,7 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, 3);
if (thisx->params == WINDMILL_ROTATING_GEAR) {
CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader);
if (gSaveContext.eventChkInf[6] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) {
thisx->world.rot.y = 0x400;
} else {
thisx->world.rot.y = 0x80;
@ -111,7 +111,7 @@ void BgRelayObjects_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
if ((this->dyna.actor.params == WINDMILL_ROTATING_GEAR) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
gSaveContext.eventChkInf[6] &= ~0x20;
Flags_UnsetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL);
}
}
@ -182,9 +182,9 @@ void func_808A932C(BgRelayObjects* this, PlayState* play) {
void func_808A939C(BgRelayObjects* this, PlayState* play) {
if (Flags_GetEnv(play, 5)) {
gSaveContext.eventChkInf[6] |= 0x20;
Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL);
}
if (gSaveContext.eventChkInf[6] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) {
Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x400, 8);
} else {
Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x80, 8);

View File

@ -82,7 +82,7 @@ void BgSpot00Hanebasi_Init(Actor* thisx, PlayState* play) {
if (gSaveContext.sceneSetupIndex != 6) {
// Don't close the bridge in rando to accomodate hyrule castle exit
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.n64ddFlag)) {
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && !(gSaveContext.n64ddFlag)) {
this->dyna.actor.shape.rot.x = -0x4000;
}
}
@ -143,7 +143,7 @@ void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, PlayState* play) {
if ((gSaveContext.sceneSetupIndex >= 4) || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) ||
!CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || !CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) ||
(gSaveContext.eventChkInf[8] & 1)) {
(Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE))) {
if (this->dyna.actor.shape.rot.x != 0) {
if (Flags_GetEnv(play, 0) || ((gSaveContext.sceneSetupIndex < 4) && IS_DAY)) {
this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall;
@ -214,14 +214,14 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
if (this->dyna.actor.params == DT_DRAWBRIDGE) {
if (play->sceneNum == SCENE_SPOT00) {
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && LINK_IS_CHILD) {
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && LINK_IS_CHILD) {
Player* player = GET_PLAYER(play);
if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) &&
(player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) &&
(!(Play_InCsMode(play)))) {
gSaveContext.eventChkInf[8] |= 1;
Flags_SetEventChkInf(0x82);
Flags_SetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE);
Flags_SetEventChkInf(EVENTCHKINF_DRAWBRIDGE_OPENED_AFTER_ZELDA_FLED);
this->actionFunc = BgSpot00Hanebasi_DoNothing;
func_8002DF54(play, &player->actor, 8);
play->nextEntranceIndex = 0x00CD;

View File

@ -66,7 +66,7 @@ void func_808AAA50(BgSpot01Fusya* this, PlayState* play) {
this->unk_158 = 100.0f;
}
if (gSaveContext.eventChkInf[6] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) {
this->unk_158 = 1800.0f;
}
thisx->shape.rot.z += this->unk_154;

View File

@ -303,7 +303,7 @@ void BgSpot01Idohashira_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if (gSaveContext.sceneSetupIndex < 4) {
if ((gSaveContext.eventChkInf[5] & 0x10) && LINK_IS_ADULT) {
if ((Flags_GetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW)) && LINK_IS_ADULT) {
Actor_Kill(&this->dyna.actor);
} else {
this->action = 0;

View File

@ -37,7 +37,7 @@ void BgSpot01Idomizu_Init(Actor* thisx, PlayState* play) {
BgSpot01Idomizu* this = (BgSpot01Idomizu*)thisx;
Actor_ProcessInitChain(&this->actor, sInitChain);
if (gSaveContext.eventChkInf[6] & 0x80 || LINK_AGE_IN_YEARS == YEARS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO) || LINK_AGE_IN_YEARS == YEARS_ADULT) {
this->waterHeight = -550.0f;
} else {
this->waterHeight = 52.0f;
@ -50,7 +50,7 @@ void BgSpot01Idomizu_Destroy(Actor* thisx, PlayState* play) {
}
void func_808ABB84(BgSpot01Idomizu* this, PlayState* play) {
if (gSaveContext.eventChkInf[6] & 0x80) {
if (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO)) {
this->waterHeight = -550.0f;
}
play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y;

View File

@ -51,7 +51,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, PlayState* play) {
// child Link has drained the water to the well
if (!LINK_IS_ADULT || (gSaveContext.n64ddFlag &&
Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF &&
Flags_GetEventChkInf(0x67))) {
Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO))) {
Actor_Kill(&this->dyna.actor);
} else {
BgSpot01Idosoko_SetupAction(this, func_808ABF54);

View File

@ -88,7 +88,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
if (((gSaveContext.eventChkInf[1] & 0x2000) && (play->sceneNum == SCENE_SPOT02) &&
if (((Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) && (play->sceneNum == SCENE_SPOT02) &&
(thisx->params == 2)) ||
(LINK_IS_ADULT && (thisx->params == 1))) {
Actor_Kill(thisx);
@ -101,7 +101,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) {
this->actionFunc = func_808ACC34;
thisx->draw = func_808ACCB8;
if (gSaveContext.eventChkInf[1] & 0x2000) {
if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) {
Actor_Kill(thisx);
}
break;
@ -131,7 +131,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) {
// We want to do most of the same things in rando, but we're not in a cutscene and the flag for
// destroying the royal tombstone is already set.
if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0x2000) {
if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION);
this->timer = 25;
pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x;
@ -144,7 +144,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) {
if (play->csCtx.state != 0) {
if (play->csCtx.npcActions[3] != NULL && play->csCtx.npcActions[3]->action == 2) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION);
gSaveContext.eventChkInf[1] |= 0x2000;
Flags_SetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB);
this->timer = 25;
pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y + 30.0f;
@ -220,7 +220,7 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) {
// This is the actionFunc that the game settles on when you load the Graveyard
// When we're in rando and the flag for the gravestone being destroyed gets set,
// set the actionFunc to the function where the gravestone explodes.
if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0X2000) {
if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) {
this->actionFunc = func_808AC908;
}

View File

@ -48,6 +48,8 @@ void BgSpot06Objects_WaterPlaneCutsceneWait(BgSpot06Objects* this, PlayState* pl
void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, PlayState* play);
void BgSpot06Objects_WaterPlaneCutsceneLower(BgSpot06Objects* this, PlayState* play);
s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId);
const ActorInit Bg_Spot06_Objects_InitVars = {
ACTOR_BG_SPOT06_OBJECTS,
ACTORCAT_PROP,
@ -128,7 +130,7 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) {
Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderItem);
if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) {
if (!(gSaveContext.eventChkInf[6] & 0x200)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER)) {
thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_LOWERED;
} else {
thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_RAISED;
@ -154,7 +156,7 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(thisx, sInitChainWaterPlane);
thisx->flags = ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED;
if (LINK_IS_ADULT && !(Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER))) {
if (LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER)) {
if (gSaveContext.sceneSetupIndex < 4) {
this->lakeHyliaWaterLevel = -681.0f;
play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface =
@ -623,7 +625,7 @@ void BgSpot06Objects_WaterPlaneCutsceneLower(BgSpot06Objects* this, PlayState* p
this->dyna.actor.world.pos.y = (this->lakeHyliaWaterLevel + 680.0f) + WATER_LEVEL_RAISED;
}
gSaveContext.eventChkInf[6] &= ~0x200; // Unset the "raised lake hylia water" flag
Flags_UnsetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); // Unset the "raised lake hylia water" flag
play->roomCtx.unk_74[0] = 87; // Remove the moving under water texture from lake hylia ground
if (this->lakeHyliaWaterLevel <= -681.0f) {

View File

@ -64,7 +64,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, PlayState* play) {
return this->dyna.actor.params == 0;
}
carpentersRescued = (gSaveContext.eventChkInf[9] & 0xF) == 0xF;
carpentersRescued = GET_EVENTCHKINF_CARPENTERS_FREE_ALL();
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
switch (this->dyna.actor.params) {
@ -139,7 +139,7 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) {
BgSpot09Obj* this = (BgSpot09Obj*)thisx;
osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params,
gSaveContext.eventChkInf[9] & 0xF);
GET_EVENTCHKINF_CARPENTERS_FREE_ALL());
this->dyna.actor.params &= 0xFF;
if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) {
osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",

View File

@ -110,7 +110,7 @@ s32 func_808B3AAC(BgSpot15Rrbox* this, PlayState* play) {
}
if (rotY < 0x2000 && rotY > -0x6000) {
return gSaveContext.eventChkInf[1] & 0x10;
return Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE);
}
return true;
}

View File

@ -46,7 +46,7 @@ void BgSpot15Saku_Init(Actor* thisx, PlayState* play) {
this->unk_170.x = this->dyna.actor.world.pos.x;
this->unk_170.y = this->dyna.actor.world.pos.y;
this->unk_170.z = this->dyna.actor.world.pos.z;
if (gSaveContext.infTable[7] & 2) {
if (Flags_GetInfTable(INFTABLE_71)) {
this->dyna.actor.world.pos.z = 2659.0f;
}
this->actionFunc = func_808B4930;
@ -59,7 +59,7 @@ void BgSpot15Saku_Destroy(Actor* thisx, PlayState* play) {
}
void func_808B4930(BgSpot15Saku* this, PlayState* play) {
if (this->unk_168 && !(gSaveContext.infTable[7] & 2)) {
if (this->unk_168 && !Flags_GetInfTable(INFTABLE_71)) {
this->timer = 2;
this->actionFunc = func_808B4978;
}

View File

@ -443,7 +443,7 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) {
OnePointCutscene_Init(play, 4180, 50, NULL, MAIN_CAM);
Flags_SetSwitch(play, this->switchFlag);
gSaveContext.eventChkInf[2] |= 8;
Flags_SetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE);
func_808B5A78(this);
} else {

View File

@ -71,7 +71,7 @@ void BgSpot16Doughnut_Init(Actor* thisx, PlayState* play) {
break;
}
osSyncPrintf(VT_FGCOL(CYAN) "%f" VT_RST "\n", this->actor.scale.x);
if (!LINK_IS_ADULT || gSaveContext.eventChkInf[2] & 0x8000) {
if (!LINK_IS_ADULT || Flags_GetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED)) {
this->fireFlag &= ~1;
} else {
this->fireFlag |= 1;

View File

@ -48,7 +48,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) {
if (param == 0) {
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
if (gSaveContext.infTable[16] & 0x200) {
if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) {
this->actionFunc = func_808B95AC;
this->dyna.actor.world.pos.y += 180.0f;
} else {
@ -63,7 +63,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) {
}
}
} else {
if (gSaveContext.infTable[16] & 0x200) {
if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) {
this->dyna.actor.world.pos.x += 125.0f * Math_CosS(this->dyna.actor.world.rot.y);
this->dyna.actor.world.pos.z -= 125.0f * Math_SinS(this->dyna.actor.world.rot.y);
this->actionFunc = func_808B95AC;
@ -94,7 +94,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) {
}
void func_808B9618(BgSpot18Shutter* this, PlayState* play) {
if (gSaveContext.infTable[16] & 0x200) {
if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) {
Actor_SetFocus(&this->dyna.actor, 70.0f);
if (((this->dyna.actor.params >> 8) & 1) == 0) {
this->actionFunc = func_808B9698;

View File

@ -47,7 +47,7 @@ void BgTokiHikari_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BgTokiHikari_DoNothing;
break;
case 1:
if (!(gSaveContext.eventChkInf[4] & 0x800)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) {
this->actionFunc = func_808BA204;
this->unk_14C = 0.0f;
} else {

View File

@ -112,14 +112,14 @@ void BgTokiSwd_Destroy(Actor* thisx, PlayState* play) {
}
void func_808BAF40(BgTokiSwd* this, PlayState* play) {
if (((gSaveContext.eventChkInf[4] & 0x8000) == 0) && (gSaveContext.sceneSetupIndex < 4) &&
if (((Flags_GetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER)) == 0) && (gSaveContext.sceneSetupIndex < 4) &&
Actor_IsFacingAndNearPlayer(&this->actor, 800.0f, 0x7530) && !Play_InCsMode(play)) {
gSaveContext.eventChkInf[4] |= 0x8000;
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
play->csCtx.segment = D_808BBD90;
gSaveContext.cutsceneTrigger = 1;
}
if (!LINK_IS_ADULT || (gSaveContext.eventChkInf[5] & 0x20 && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) {
if (!LINK_IS_ADULT || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) {
if (Actor_HasParent(&this->actor, play)) {
if (!LINK_IS_ADULT) {
Item_Give(play, ITEM_SWORD_MASTER);

View File

@ -143,9 +143,9 @@ void func_808BC864(BgTreemouth* this, PlayState* play) {
}
void func_808BC8B8(BgTreemouth* this, PlayState* play) {
if ((!(Flags_GetEventChkInf(5))) || LINK_IS_ADULT) {
if ((!Flags_GetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH)) || LINK_IS_ADULT) {
if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(0xC)) {
if (Flags_GetEventChkInf(EVENTCHKINF_MET_DEKU_TREE)) {
if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x7530)) {
this->dyna.actor.flags |= ACTOR_FLAG_TARGETABLE;
if (this->dyna.actor.isTargeted) {
@ -156,7 +156,7 @@ void func_808BC8B8(BgTreemouth* this, PlayState* play) {
}
}
} else if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x4E20)) {
Flags_SetEventChkInf(0xC);
Flags_SetEventChkInf(EVENTCHKINF_MET_DEKU_TREE);
play->csCtx.segment = D_808BCE20;
gSaveContext.cutsceneTrigger = 1;
BgTreemouth_SetupAction(this, func_808BC9EC);
@ -188,7 +188,7 @@ void func_808BC9EC(BgTreemouth* this, PlayState* play) {
if (play->msgCtx.choiceIndex == 0) {
play->csCtx.segment = D_808BD520;
Flags_SetEventChkInf(5);
Flags_SetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH);
BgTreemouth_SetupAction(this, func_808BCAF0);
} else {
play->csCtx.segment = D_808BD790;
@ -237,7 +237,7 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
if ((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) {
if (gSaveContext.eventChkInf[0] & 0x80) {
if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD)) {
alpha = 2150;
}
} else { // neeeded to match

View File

@ -42,7 +42,7 @@ void BgUmaJump_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.actor.params == 1) {
if (!Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
Actor_Kill(&this->dyna.actor);
return;
}

View File

@ -353,7 +353,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
this->cameraAt.z = player->actor.world.pos.z;
}
if (gSaveContext.eventChkInf[7] & 2) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) {
if (this->unk_198 == 100) {
this->actor.world.pos.x = -1114.0f;
this->actor.world.pos.z = -2804.0f;
@ -394,7 +394,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
case 4:
Math_SmoothStepToF(&this->unk_20C, 0.0f, 1.0f, 0.01f, 0.0f);
if (gSaveContext.eventChkInf[7] & 2) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) {
phi_f0 = -50.0f;
} else {
phi_f0 = 0.0f;
@ -422,7 +422,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
}
if (this->unk_198 == 0x5A) {
if (!(gSaveContext.eventChkInf[7] & 2)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gKingDodongoTitleCardENGTex), 160, 180, 128, 40, true);
}
@ -441,7 +441,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
this->unk_1DA = 50;
this->unk_1BC = 0;
player->actor.shape.rot.y = -0x4002;
gSaveContext.eventChkInf[7] |= 2;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE);
}
break;
}

View File

@ -350,7 +350,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
this->timers[0] = 0;
this->camData.speedMod = 0.0f;
this->camData.accel = 0.0f;
if (gSaveContext.eventChkInf[7] & 8) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) {
this->introState = BFD_CS_EMERGE;
this->camData.nextEye.x = player2->actor.world.pos.x + 100.0f + 300.0f - 600.0f;
this->camData.nextEye.y = player2->actor.world.pos.y + 100.0f - 50.0f;
@ -471,7 +471,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
osSyncPrintf("WAY_SPD X = %f\n", this->camData.atVel.x);
osSyncPrintf("WAY_SPD Y = %f\n", this->camData.atVel.y);
osSyncPrintf("WAY_SPD Z = %f\n", this->camData.atVel.z);
if ((this->timers[3] > 190) && !(gSaveContext.eventChkInf[7] & 8)) {
if ((this->timers[3] > 190) && !Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) {
Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
}
@ -498,7 +498,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
if (this->timers[3] == 160) {
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
}
if ((this->timers[3] == 130) && !(gSaveContext.eventChkInf[7] & 8)) {
if ((this->timers[3] == 130) && !Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gVolvagiaBossTitleCardENGTex), 160, 180, 128, 40, true);
}
@ -549,7 +549,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
func_8002DF54(play, &this->actor, 7);
this->actionFunc = BossFd_Wait;
this->handoffSignal = FD2_SIGNAL_GROUND;
gSaveContext.eventChkInf[7] |= 8;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE);
}
break;
}

View File

@ -570,7 +570,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->csCamIndex, CAM_STAT_ACTIVE);
this->csCamFov = 60.0f;
if (gSaveContext.eventChkInf[7] & 0x100 || gSaveContext.n64ddFlag || gSaveContext.isBossRush) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || gSaveContext.n64ddFlag || gSaveContext.isBossRush) {
// watched cutscene already, skip most of it
this->csState = 17;
this->csTimer = 0;
@ -1108,12 +1108,12 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(
play->objectCtx.status[Object_GetIndex(&play->objectCtx, OBJECT_GANON)].segment);
if (!(gSaveContext.eventChkInf[7] & 0x100)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gGanondorfTitleCardENGTex), 160, 180, 128, 40, true);
}
gSaveContext.eventChkInf[7] |= 0x100;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE);
}
if (this->csTimer >= 20) {
@ -1540,7 +1540,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) {
if (this->csTimer == 180) {
play->sceneLoadFlag = 0x14;
if ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE) || gSaveContext.isBossRush)) {
Flags_SetEventChkInf(0xC7);
Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO);
play->nextEntranceIndex = 0x517;
}
else {

View File

@ -680,7 +680,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
// entrance of the boss room
if (fabsf(player->actor.world.pos.x - 150.0f) < 60.0f &&
fabsf(player->actor.world.pos.z - 350.0f) < 60.0f) {
if (gSaveContext.eventChkInf[7] & 1) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) {
BossGoma_SetupEncounterState4(this, play);
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_SHUTTER, 164.72f,
-480.0f, 397.68002f, 0, -0x705C, 0, 0x180);
@ -919,13 +919,13 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
if (Animation_OnFrame(&this->skelanime, 40.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_CRY1);
if (!(gSaveContext.eventChkInf[7] & 1)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gGohmaTitleCardENGTex), 160, 180, 128, 40, true);
}
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS);
gSaveContext.eventChkInf[7] |= 1;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE);
}
if (Animation_OnFrame(&this->skelanime, this->currentAnimFrameCount)) {

View File

@ -377,7 +377,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) {
MO_WATER_LEVEL(play) = -500;
return;
}
if (gSaveContext.eventChkInf[7] & 0x10) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_MORPHA_BATTLE)) {
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS);
this->tentMaxAngle = 5.0f;
this->timers[0] = 50;
@ -1445,7 +1445,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
if (this->timers[2] == 130) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gMorphaTitleCardENGTex), 160, 180, 128, 40, true);
gSaveContext.eventChkInf[7] |= 0x10;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_MORPHA_BATTLE);
}
break;
case MO_INTRO_FINISH:

View File

@ -395,7 +395,7 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) {
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, sCutsceneCamera, CAM_STAT_ACTIVE);
Math_Vec3f_Copy(&sCameraAt, &player->actor.world.pos);
if (gSaveContext.eventChkInf[7] & 0x80) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) {
sCameraEye.z = ROOM_CENTER_Z - 100.0f;
}
@ -431,7 +431,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
Play_ChangeCameraStatus(play, sCutsceneCamera, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
Play_ClearCamera(play, sCutsceneCamera);
gSaveContext.eventChkInf[7] |= 0x80;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE);
BossSst_HeadSetupNeutral(this);
this->colliderJntSph.base.ocFlags1 |= OC1_ON;
sHands[LEFT]->colliderJntSph.base.ocFlags1 |= OC1_ON;
@ -454,7 +454,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
this->ready = true;
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
Audio_PlayActorSound2(&sFloor->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
} else if (gSaveContext.eventChkInf[7] & 0x80) {
} else if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) {
sHands[RIGHT]->actor.draw = BossSst_DrawHand;
sHands[LEFT]->actor.draw = BossSst_DrawHand;
this->actor.draw = BossSst_DrawHead;
@ -581,7 +581,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
}
if (this->timer <= 198) {
revealStateTimer = 198 - this->timer;
if ((gSaveContext.eventChkInf[7] & 0x80) && (revealStateTimer <= 44)) {
if ((Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) && (revealStateTimer <= 44)) {
sCameraAt.x += 492.0f * 0.01f;
sCameraAt.y += 200.0f * 0.01f;
sCameraEye.x -= 80.0f * 0.01f;
@ -610,7 +610,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
sCameraEye.y += 125.0f * 0.01f;
sCameraEye.z -= 350.0f * 0.01f;
} else if (revealStateTimer == 85) {
if (!(gSaveContext.eventChkInf[7] & 0x80)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gBongoTitleCardENGTex), 160, 180, 128, 40, true);
}

View File

@ -479,7 +479,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) {
this->actor.naviEnemyId = 0x33;
SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_0070E0, &object_tw_Anim_006F28, NULL, NULL, 0);
if (gSaveContext.eventChkInf[7] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) {
// began twinrova battle
BossTw_SetupFlyTo(this, play);
this->actor.world.pos.x = -600.0f;
@ -497,7 +497,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) {
this->actor.naviEnemyId = 0x32;
SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_01F888, &object_tw_Anim_006F28, NULL, NULL, 0);
if (gSaveContext.eventChkInf[7] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) {
// began twinrova battle
BossTw_SetupFlyTo(this, play);
this->actor.world.pos.x = 600.0f;
@ -519,7 +519,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) {
SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_032020, &object_tw_Anim_0244B4, NULL, NULL, 0);
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_0244B4, -3.0f);
if (gSaveContext.eventChkInf[7] & 0x20) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) {
// began twinrova battle
BossTw_SetupWait(this, play);
} else {
@ -2184,7 +2184,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
play->envCtx.unk_BD = 1;
play->envCtx.unk_D8 = 0.0f;
TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gTwinrovaTitleCardENGTex), 160, 180, 128, 40, true);
gSaveContext.eventChkInf[7] |= 0x20;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE);
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS);
}

View File

@ -638,7 +638,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
0, BOSSVA_DOOR);
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) {
warpId = ACTOR_EN_RU1;
if (gSaveContext.eventChkInf[3] & 0x80) {
if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) {
warpId = ACTOR_DOOR_WARP1;
}
Actor_Spawn(&play->actorCtx, play, warpId, this->actor.world.pos.x, this->actor.world.pos.y,
@ -651,7 +651,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
} else {
this->actor.colChkInfo.damageTable = sDamageTable;
sPhase2Timer = 0xFFFF;
if (gSaveContext.eventChkInf[7] & 0x40) {
if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE)) {
sCsState = INTRO_CALL_BARI;
sDoorState = 100;
func_8002DF54(play, &this->actor, 1);
@ -986,7 +986,7 @@ void BossVa_BodyIntro(BossVa* this, PlayState* play) {
sCameraNextAt.y = 140.0f;
sCameraNextAt.z = -200.0f;
if (!(gSaveContext.eventChkInf[7] & 0x40)) {
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
SEGMENTED_TO_VIRTUAL(gBarinadeTitleCardENGTex), 160, 180, 128, 40, true);
}
@ -1028,7 +1028,7 @@ void BossVa_BodyIntro(BossVa* this, PlayState* play) {
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
func_8002DF54(play, &this->actor, 7);
sCsState++;
gSaveContext.eventChkInf[7] |= 0x40;
Flags_SetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE);
player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
}
break;

View File

@ -11,6 +11,7 @@
#include "objects/object_gnd_magic/object_gnd_magic.h"
#include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h"
#include "soh/frame_interpolation.h"
#include <assert.h>
#define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED
@ -87,7 +88,7 @@ void Demo6K_Init(Actor* thisx, PlayState* play) {
osSyncPrintf("bank_ID = %d\n", objBankIndex);
if (objBankIndex < 0) {
ASSERT(objBankIndex < 0);
assert(objBankIndex < 0);
} else {
this->objBankIndex = objBankIndex;
}
@ -174,7 +175,7 @@ void Demo6K_Init(Actor* thisx, PlayState* play) {
this->unk_293 = params - 14;
break;
default:
ASSERT(0);
assert(0);
break;
}

Some files were not shown because too many files have changed in this diff Show More