-
Notifications
You must be signed in to change notification settings - Fork 588
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
Introduce extracted/VERSION, with text extracted there #1730
Conversation
I don't understand what's the point of having the am I missing something? maybe some edge case I'm not seeing here? or some future change that will make this necessary? 🤔 |
I think it's more obvious where an include is pulling from as Currently I'm not even sure the latter would work given the include path also has |
I agree with this in principle (extracting assets for different versions into different directories) but I would like to bikeshed the path a bit also. First, why the underscore in Second, I'd also be okay with a different toplevel directory name other than |
I have not read this PR in depth yet, but would like to say I agree that I dont think a leading underscore is needed |
For the purpose of clarification So here is the layout proposed in this PR, with text only
it would generalize to other assets, using the
EDIT: fixed forgotten |
Updated to "future layout v3" Productive discussion on discord happened The general result is a new top level folder Include path would be like in the following structure layouts: I compiled the changes to "future layout v2" (outdated):
but realized while updating this PR I oversimplified message_data.h handling. Here's the "future layout v3" that fixes that:
diff from v2: --- dirlayout_future_v2.txt 2024-02-16 12:40:29.688695211 +0100
+++ dirlayout_future_v3.txt 2024-02-16 12:40:35.436757360 +0100
@@ -1,27 +1,31 @@
-# v2
+# v3
assets/ # note: everything under assets/ committed
objects/
gameplay_keep/
gameplay_keep.c -> [extracted/VERSION/]objects/gameplay_keep/gameplay_keepVtx_00C0A0.vtx.inc , [extracted/VERSION/]objects/gameplay_keep/deku_stick.i8.inc.c
gameplay_keep.h
text/
- nes_message_data_static.c -> [extracted/VERSION/]text/message_data.enc.h
+ nes_message_data_static.c -> [build/VERSION/]assets/text/message_data.enc.h
+ message_data.h -> [extracted/VERSION/]text/message_data.h
xml/
objects/
gameplay_keep.xml
extracted/ # .gitignore'd
VERSION/
baserom/
gameplay_keep
objects/
gameplay_keep/
deku_stick.i8.png # written on make setup for reference, but otherwise unused
deku_stick.i8.inc.c # written on make setup (does *not* depend on the png)
gameplay_keepVtx_00C0A0.vtx.inc
text/
message_data.h
message_data.enc.h # processed from ./message_data.enc.h
build/
VERSION/
baserom/
gameplay_keep.o # objcopy'd from extracted/VERSION/baserom/gameplay_keep
+ assets/
+ text/
+ message_data.enc.h # processed from assets/text/message_data.h For reference, here is "current zeldaret/main layout v1":
|
I found a small issue specific to text processing due to the encoding step done by msgenc.py, e.g. given
the following error happens on make:
Note it says I fixed (worked around) this with Dragorn421@42e4d4a (not in this PR) but it's not super great. Especially hardcoding the ido path because CC is asm-processor-wrapped. And though it works, msgenc.py wasn't written with handling cpp'd input in mind (e.g. take care not to touch linemarker filename strings) Note there is a similar issue in main anyway, errors also report I think I'd probably want to rewrite msgenc.py as well. Handle this in this PR or just live with errors on text stuff compile being reported in message_data.enc.h for now? |
Re: message_enc stuff above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My approval is from the standpoint of "I agree with the idea of these changes" and "works on my machine"
Do encourage build system-savy people to continue to review the internals of this, like is happening above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text system nitpick time
…FINE_MESSAGE_NES` to handle its special behavior
@@ -0,0 +1 @@ | |||
#include "text/message_data.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In view of adding includes below this one for modding, the vanilla text debugger won't recognize them anymore since it stops searching at message 0xFFFD. I suggest adding messages 0xFFFC and 0xFFFD to this header instead of in the extracted header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we still want to extract them, could possibly just add them to a separate message_data_end.h
that gets included below message_data.h
. Then custom text data could go in between.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was considering a footer include as well as an option, extracted or not
Not sure yet what to do, anyone feel free to chip in
I won't get to this immediately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think including them in the committed header works fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d75522b Move messages 0xFFFC, 0xFFFD to committed message_data.h
and explanation comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an opinion on message 0xFFFC, but the build system and structure look good to me
The plan ™️ for assets,
(at least it's what I suggested over a year ago and there are no concerns nor other suggestions)
is to extract from the rom into
extracted/
, and commitassets/**/*.c
files#include
ing from there.extracted/
is fully gitignored.With multiversion I extended this to extract into
extracted/VERSION/
.extracted/VERSION
is added to the include path so that files can include from there using#include "..."
This PR also moves extracting text to
extracted/VERSION/text
. There are also some changes to the message extraction/build logic I had to make to accommodate for that change.The extracted text
extracted/gc-eu-mq-dbg/text/message_data.h
,extracted/gc-eu-mq-dbg/text/message_data_staff.h
is included by now-committed (one line include each)assets/text/message_data.h
andassets/text/message_data_staff.h
(respectively).Note that this means in a modding context messages can be added into git-tracked
assets/text/message_data.h
, and the vanilla messages can be removed simply by removing the include.Discussion/suggestions welcome!