Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OoT] Refactor scene_table_c.py #272

Merged
merged 9 commits into from
Apr 22, 2024
Merged

Conversation

Yanis42
Copy link
Contributor

@Yanis42 Yanis42 commented Jan 3, 2024

I was too annoyed of people complaining about how the scene table has issues with HackerOoT because of how weird Fast64 handled that file, so basically started over from nothing

This new version is removing the "Enable HackerOoT Features" requirement and should keep any preprocessor things (ifdefs, includes, etc) and any comment (including multi-line ones), basically everything that isn't an actual scene entry

It should work properly but I haven't done extended testing yet and there's 2 minor issues right now (that I will fix soon™, also I need to cleanup a bit):

  • custom scenes doesn't update the index in the comment before the entry properly
  • exporting multiple times with a vanilla scene adds extra newlines

The benefits of this new code is improved readability and less lines (saved 26 ones)

Note: I know the spec export has minor issues (and I hate it) but that will be part of a dedicated PR

@Yanis42 Yanis42 added oot Has to do with the Ocarina of Time 64 side codebase Code maintenance/cleanup labels Jan 3, 2024
@Dragorn421
Copy link
Contributor

Thanks!

Bug reports below about scene numbering, but you seem to also have noticed one so probably will be fixed in one go

Deleting a scene breaks numbering

For example deleting deku tree:

diff --git a/include/tables/scene_table.h b/include/tables/scene_table.h
index 0337e1252..282dfda32 100644
--- a/include/tables/scene_table.h
+++ b/include/tables/scene_table.h
@@ -9,7 +9,6 @@
  *    - Argument 5: ? (Unknown)
  *    - Argument 6: ? (Unknown)
  */
-/* 0x00 */ DEFINE_SCENE(ydan_scene, g_pn_06, SCENE_DEKU_TREE, SDC_DEKU_TREE, 1, 2)
 /* 0x01 */ DEFINE_SCENE(ddan_scene, g_pn_08, SCENE_DODONGOS_CAVERN, SDC_DODONGOS_CAVERN, 1, 3)
 /* 0x02 */ DEFINE_SCENE(bdan_scene, g_pn_07, SCENE_JABU_JABU, SDC_JABU_JABU, 1, 4)
 /* 0x03 */ DEFINE_SCENE(Bmori1_scene, g_pn_01, SCENE_FOREST_TEMPLE, SDC_FOREST_TEMPLE, 2, 5)

then the first scene starts at 0x01

Added scenes start numbering one early

For example adding two scenes:

diff --git a/include/tables/scene_table.h b/include/tables/scene_table.h
index 0337e1252..0d2156a29 100644
--- a/include/tables/scene_table.h
+++ b/include/tables/scene_table.h
@@ -120,3 +120,5 @@
 /* 0x6B */ DEFINE_SCENE(hairal_niwa2_scene, g_pn_12, SCENE_HAIRAL_NIWA2, SDC_CASTLE_COURTYARD_GUARDS, 0, 0)
 /* 0x6C */ DEFINE_SCENE(sasatest_scene, none, SCENE_SASATEST, SDC_DEFAULT, 0, 0)
 /* 0x6D */ DEFINE_SCENE(testroom_scene, none, SCENE_TESTROOM, SDC_DEFAULT, 0, 0)
+// Added scenes
+/* 0x6D */ DEFINE_SCENE(mydefnewscen_scene, none, SCENE_MYDEFNEWSCEN, SDC_DEKU_TREE, 0, 0)
+/* 0x6E */ DEFINE_SCENE(againsnne_scene, none, SCENE_AGAINSNNE, SDC_DEKU_TREE, 0, 0)

for some reason the first one added uses 0x6D which is already SCENE_TESTROOM

@Yanis42
Copy link
Contributor Author

Yanis42 commented Jan 3, 2024

there's still newline issues but the other ones should be fixed

@Yanis42
Copy link
Contributor Author

Yanis42 commented Jan 7, 2024

newline issues should be fixed now, I also found some issues related to exporting and removing custom scenes and they should be fixed too

I also added some comments and descriptions for the missing classes/functions (when the name's not self-explanatory at least)

I have hope in this being good to go

This was referenced Feb 7, 2024
Copy link
Contributor

@sauraen sauraen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exporting a scene in HackerOoT works on this branch. I have not tried deleting scenes as I don't want to break my game.

@sauraen sauraen merged commit 5af3b49 into Fast-64:main Apr 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codebase Code maintenance/cleanup oot Has to do with the Ocarina of Time 64 side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants