Giter Club home page Giter Club logo

oot's People

Contributors

adamkiddle avatar angheloalf avatar cadmic avatar dragorn421 avatar ellipticellipsis avatar engineer124 avatar ethteck avatar fig02 avatar gamestabled avatar glankk avatar hensldm avatar i82orbom avatar jack-walker avatar jpburnett avatar krimtonz avatar louist103 avatar maekclena avatar mzxrules avatar petrie911 avatar random06457 avatar revosucks avatar roman971 avatar shawlucas avatar sirius902 avatar synray avatar thar0 avatar tom-overton avatar zelda2773 avatar zelda2774 avatar zelllll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oot's Issues

Error on make

Just downloaded the code and really wanted to try it, but, i am getting the following error when running "make":
Ambient: windows with Ubuntu WSL

cfe: Warning 594: o in #if or #elif
3.8
unknown command line option
cfe: Warning 594: o in #if or #elif
3.8
unknown command line option
cfe: Warning 596:
include/message_data_fmt.h: 135: Unterminated string or character constant
A pr
cfe: libc_impl.c:602: wrapper_sprintf: Assertion `0 && "non-implemented sprintf format"' failed.
Fatal error in: /usr/lib/cfe  child died due to signal 6.
Fatal error in: /usr/lib/cfe  Signal 6
Failed to compile file assets/text/nes_message_data_static.c. Command line:

tools/ido_recomp/linux/7.1/cc -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -I '/mnt/c/Users/Jonatas Copernico/Desktop/Jhonny/oot/assets/text' -o build/assets/text/nes_message_data_static.o /tmp/preprocessed9wcfmqm4.c
Makefile:234: recipe for target 'build/assets/text/nes_message_data_static.o' failed
make: *** [build/assets/text/nes_message_data_static.o] Error 55```

Make Setup doesn't work

I'm building through ubuntu in wsl, and I got an error saying make: *** No rule to make target 'setup'. Stop.

Makefile 67

make -s
Makefile:67: *** Unable to find mips-linux-gnu-ld. Please install or build MIPS binutils, commonly mips-linux-gnu. (or set MIPS_BINUTILS_PREFIX if your MIPS binutils install uses another prefix). Stop.
exit status 2

New assets system

Just need a home for the directory layout we agreed upon, so I can find it again


Productive discussion on discord happened
from https://discord.com/channels/688807550715560050/688851317593997489/1207388581639880745
to https://discord.com/channels/688807550715560050/688851317593997489/1208159004694413312

The general result is a new top level folder extracted/ for extracted things, including assets, text and baserom segments

I compiled the changes to "future layout", see below


in the following directory structure layouts:
[first/part/]second/part paths are where the file does #include "second/part", and CPP resolves it to first/part/second/part (due to first/part being in the include path)

future layout

"future layout v4":

Include path would be like -Ibuild/VERSION -Iextracted/VERSION

# v4
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 -> [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
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

history:

v3->v4: removed extracted/VERSION/text/message_data.enc.h (no clue why it was there)
v2->v3: fix oversimplified text handling. cf #1730 (comment)
v1->v2: cf discord discussion linked above
v1: assets/_extracted/, cf #1730 (comment)

current zeldaret/main layout

For reference.

"current zeldaret/main layout v1":

-Ibuild/gc-eu-mq-dbg

assets/
  objects/  # .gitignore'd
    gameplay_keep/
      gameplay_keep.c -> ./gameplay_keepVtx_00C0A0.vtx.inc , [build/gc-eu-mq-dbg/]assets/objects/gameplay_keep/deku_stick.i8.inc.c
      gameplay_keep.h
      deku_stick.i8.png
      gameplay_keepVtx_00C0A0.vtx.inc
  text/
    message_data.h  # .gitignore'd
    nes_message_data_static.c -> [build/gc-eu-mq-dbg/]assets/text/message_data.enc.h
  xml/
    objects/
      gameplay_keep.xml
baseroms/
  gc-eu-mq-dbg/
    segments/
      gameplay_keep  # written on make setup
build/
  gc-eu-mq-dbg/
    assets/
      objects/
        gameplay_keep/
          deku_stick.i8.inc.c  # processed from assets/objects/gameplay_keep/deku_stick.i8.png on make (depends on the png)
      text/
        message_data.enc.h  # processed from assets/text/message_data.h
    baserom/
      gameplay_keep.o  # objcopy'd from baseroms/gc-eu-mq-dbg/segments/gameplay_keep on make

OoBs memory access bug in FileChoose_LoadGame

https://github.com/zeldaret/oot/blob/master/src/overlays/gamestates/ovl_file_choose/z_file_choose.c#L1501

If swordEquipMask is 0, an out of bounds memory access will occur. This naturally happens when loading a new game, as the player's B button isn't assigned to a sword item, and gSaveContext.equips.equipment's sword bits are 0. The only reason odd behavior doesn't occur on N64 is that the data at index -1 is either a null pointer or padding, effectively becoming a no op

Rename Skeleton types

Context

Skinning

In the context of modern 3d graphics, "skinning" refers to a mesh being deformed by bones (as if the mesh is skin wrapping the bones and the skin stretches to accomodate for bone movements).
There's almost no constraints on how this deform happens, the mesh vertices may be rigged to one or more bones, using weights to blend the transformations. There's also no restrictions on which face(s) the vertex belongs to and how the other vertices on those faces are rigged.

In ancient days (n64 era) however the processing power and complexity level wasn't quite there yet for general use and there were constraints to save processing power.

The three main OoT skeleton types

In oot, there is a generic least-constraints multi-weighted-vertices (a vertex may be influenced by several bones, according to defined weights) skinned skeleton system, SkinSkeleton, which is used for horses.

There is also a widely used single-weighted-vertices (one bone per vertex with weight 1) skinned skeleton FlexSkeleton.
Examples: Link, carpenters...

And finally there is the simplest single-weight non-skinned Skeleton
It is "non-skinned" in that a triangle's vertices may only be deformed by a single bone, so a triangle is never stretched.
Illustration of such a rigged mesh:

mario split into chunks to illustrate single-weight non-skinned 'Skeleton'

Suggested names

After investigating I concluded to suggesting the following name changes:

  • Skeleton -> DisjointedSkeleton
  • FlexSkeleton -> RigidSkeleton
  • SkinSkeleton -> SmoothSkeleton

Note:

  • OoT also has "CurveSkeleton" which not much is known about. It gets little use by the game.
  • MM also has a "c_keyframe" skeleton system which not much is known about, too.

References

Compilation failure on Debian Linux arm/aarch64 due to ido(x86_64) usage

I'm currently trying to see if a ROM can be compiled on a raspberry pi (or any other mostly-normal ARM / Aarch64 system) but compilation fails at when I assume it tries to actually make the N64-MIPS native libraries and code using ido, which can't be executed as it's an x86_64 binary for linux.

Python is v3.9
GCC is 10.2
(Using a frakendebian 'Raspbian 64bit' with more native-64bit programs, but anyways)

Below I am using Revo's GCC9_1 fork in an attempt to see how much further it gets, but for now it is impossible to build. I worked on porting the Super Mario 64 PC Port (April/May2020) 'beta' code to ARM & Pi last year with success, but that project was nearer to completion than this one it seems. llcvt may potentially be failing because of the... whatever it has inside of it (redefinitions?), but even after changing the MIPS-GCC compiler options to '-mabicalls' the ido 5.3 (or 7.1) errors continue as it's x86_64.

`mips-linux-gnu-gcc src/code/mtxuty-cvt.c -c -c -G 0 -nostdinc -Iinclude -Isrc -Iassets -Ibuild -I. -DNON_MATCHING=1 -DNON_EQUIVALENT=1 -DMODDING=1 -DNORMAL_GAMEPLAY=1 -DAVOID_UB=1 -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -mno-abicalls -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -g -mno-explicit-relocs -mno-split-addresses -funsigned-char -I src/code -mips3 -O2 -o build/src/code/mtxuty-cvt.o

tools/ido_recomp/linux/5.3/cc: 1: tools/ido_recomp/linux/5.3/cc: Syntax error: ")" unexpected
make: *** [Makefile:293: build/src/libultra_code_O1/llcvt.o] Error 2
make: *** Waiting for unfinished jobs....
cc1: error: position-independent code requires ‘-mabicalls’
make: *** [Makefile:282: build/src/code/mtxuty-cvt.o] Error 1
cc1: error: position-independent code requires ‘-mabicalls’
make: *** [Makefile:282: build/src/libultra_code_O1/osStopTimer.o] Error 1`

Apparently there's a decompiled? IDO that this linux x86_64 recompiled version comes from, so I'll look at compiling it for aarch64 and armhf

No such file or directory execinfo.h error when trying to install on Cygwin

Trying to set up the decomp with Cygwin according to the instructions but get this upon 4. Setup the ROM and build process
Could somebody help me figure out what's wrong? Also I did run ./fixle.sh before building

$ make setup
make -C tools
make[1]: Entering directory '/home/elbread/oot/tools'
make -C ZAPD
make[2]: Entering directory '/home/elbread/oot/tools/ZAPD'
g++ -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer -DDEPRECATION_ON -O2 -I ZAPD -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils -c -o build/ZAPD/CrashHandler.o ZAPD/CrashHandler.cpp
ZAPD/CrashHandler.cpp:19:10: fatal error: execinfo.h: No such file or directory
19 | #include <execinfo.h>
| ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:116: build/ZAPD/CrashHandler.o] Error 1
make[2]: Leaving directory '/home/elbread/oot/tools/ZAPD'
make[1]: *** [Makefile:21: all] Error 2
make[1]: Leaving directory '/home/elbread/oot/tools'
make: *** [Makefile:265: setup] Error 2

Request: VR Support

Anyone have any idea where I might begin this sort of process? I feel like it's going to be much more than just adding openxr stuff. The engine probably is missing a lot of concepts for vr.

Nonmatching build on mips64-elf

Using mips64-elf results in a nonmatching ROM.

The cause is the . = ALIGN(0x10) in mkldscript.c. With these, the linker inserts extra 00s for some reason where it isnt necessary. Removing these results in OK.

Error when compiling a `*_cutscene_data.c`-like file: `Missing ')' in macro instantiation`

Typical error message

Missing ')' in macro instantiation
when compiling a .c file named like cutscene_data (or holding any cutscene data, supposedly)

Cause

Unknown, determined to be a recomp issue through testing.

(recomp refers to a recompilation of the original compiler, IDO, which behaves the same for what matters, and is used instead of emulating the original for speed reasons)

Fix

Unknown. There are two workarounds though:

Easy hacky workaround (recommended?): Add whitespace in z64cutscene_commands.h

Add whitespace anywhere in the z64cutscene_commands.h file (include/z64cutscene_commands.h),
maybe above or in the LIGHTING macro (#define CS_LIGHTING(...)
(not after any \ character or in the middle of a word!)

Save the file and continue building.

(no one knows why exactly this works)

More proper workaround: Don't use recomp

Emulate original IDO instead of using recomp. This makes building slower. To do so:

  1. Download qemu-irix from https://github.com/zeldaret/oot/releases/tag/0.1q
  2. Place it somewhere, preferably in the WSL filesystem (for example in your home directory ~)
  3. Change the permissions on qemu-irix to make it executable (for example chmod u+x qemu-irix)
  4. Run make with setting QEMU_IRIX to the path to your qemu-irix, and setting ORIG_COMPILER to 1 (for example make QEMU_IRIX=~/qemu-irix ORIG_COMPILER=1)

Typical last logs

People reporting this issue provided the following logs at the end of make output when build fails due to this:

Error: src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c:10: Missing ')' in macro instantiation
Failed to compile file src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c. Command line:

tools/ido_recomp/linux/7.1/cc -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -I /home/tino/Software/modding/ZELDA/DECOMP/oot/src/overlays/actors/ovl_Bg_Toki_Swd -o build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.o /tmp/preprocessedghhjqh8x.c

make: *** [Makefile:318: build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.o] Error 55
Error: src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c:92: Missing ')' in macro instantiation
Failed to compile file src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c. Command line:

tools/ido_recomp/linux/7.1/cc -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -I /home/tino/Software/modding/ZELDA/DECOMP/oot/src/overlays/actors/ovl_Bg_Toki_Swd -o build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.o /tmp/preprocessed0ioli7w1.c

make: *** [Makefile:318: build/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.o] Error 55
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c  -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712  -mips2 -O2 -o build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c
cfe: Error: src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c:26: Missing ')' in macro instantiation
cfe: Error: src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c:26: Missing ')' in macro instantiation
Failed to compile file src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c. Command line:

tools/ido_recomp/linux/7.1/cc -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -I /home/bigwhite/oot/src/overlays/actors/ovl_Demo_Im -o build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o /tmp/preprocessed9eo1owjf.c

Makefile:318: recipe for target 'build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o' failed
make: *** [build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o] Error 55

gcc builds: u64 to f64 casts are broken

(at least on the compiler I use

$ mips-linux-gnu-gcc --version
mips-linux-gnu-gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0

)

Consider this code casting a u64 to a f64:

diff --git a/src/boot/idle.c b/src/boot/idle.c
index 30c244876..93a5f3495 100644
--- a/src/boot/idle.c
+++ b/src/boot/idle.c
@@ -35,6 +35,12 @@ void Main_ThreadEntry(void* arg) {
 }
 
 void Idle_ThreadEntry(void* arg) {
+
+    {
+        static u64 value = 421;
+        osSyncPrintf("Look at my value = %f\n", (f64)value);
+    }
+
     osSyncPrintf("アイドルスレッド(idleproc)実行開始\n");
     osSyncPrintf("作製者    : %s\n", gBuildTeam);
     osSyncPrintf("作成日時  : %s\n", gBuildDate);

It should print something like "Look at my value = 421.0"
But it prints:

Look at my value = 0.000000

asm:

80000650 <Idle_ThreadEntry>:
80000650:       27bdffd8        addiu   sp,sp,-40
80000654:       3c058001        lui     a1,0x8001
80000658:       8ca581b4        lw      a1,-32332(a1)
8000065c:       afb00020        sw      s0,32(sp)
80000660:       00808025        move    s0,a0
80000664:       3c048001        lui     a0,0x8001
80000668:       8c8481b0        lw      a0,-32336(a0)
8000066c:       afbf0024        sw      ra,36(sp)
80000670:       0c001ff7        jal     80007fdc <__floatundidf>
80000674:       00000000        nop
80000678:       f7a00018        sdc1    $f0,24(sp)
8000067c:       8fa7001c        lw      a3,28(sp)
80000680:       3c048001        lui     a0,0x8001
80000684:       24849de8        addiu   a0,a0,-25112
80000688:       0c000798        jal     80001e60 <osSyncPrintf>
8000068c:       8fa60018        lw      a2,24(sp)

for some reason the compiler uses __floatundidf and even seems to call it assuming it takes a u64 (a0 and a1 are filled), but __floatundidf is for u32 (== unsigned long in this case) to f64


gcc bug or bad compile flags?

GBI.H problem

There seems to be an issue with some macro in GBI.h.
Build a rom gives the errors:
include/ultra64/gbi.h: 2713: #ifdef accepts only one identifier as parameter
include/ultra64/gbi.h:3217: Illegal macro parameter name

Missing LICENSE

Cool project!

I see you have no LICENSE file for this project. The default is copyright.

I would suggest releasing the code under the AGPL-3.0-or-later license so that others are encouraged to contribute changes back to your project.

I suggest AGPL-3.0-or-later because this matches the fado dependency. See also the GPL FAQ.

CC0 as proposed in #1194 does not work because fado is under AGPL and ZAPD is under MIT. Individual files could be licensed under the CC0-1.0 license, but not the entire repository.

A barrier to this change would be that ido would need to be moved externally from the repository because of their LICENSE.md

It is also possible that this repository cannot be licensed at all, neither copyright, permissive, or copyleft. See issue 347 on pokered.

I am not a lawyer.

Generalizing Logic for Future OoT Editors

Hi,

This is a project I'm quite interested in. I heard it is close to completion. I know that with a completed source code, the amount of rom hacks will explode exponentially. I haven't looked around, but I would imagine a new OoT editor with access to source code would be in demand soon. Assuming this is true, modifications to the source code to allow easy manipulation / additions to the game should be considered after the first completed release.

I have one small example. See lines 53-56 in oot/src/code/z_game_over.c. There are checks for all possible swords, but with this hard coded, the addition of another sword equipment item could require making changes across several code files. One way generalize this is to define a constant variable tuple in one code file containing all the sword equipment items allowing other code to iterate through them or reference them by index. I would think it would be easier to add a new swords this way.

Unsuccessful `make` on aarch64

After successfully running make setup and then running make I get the following error.

mobian@mobian:~/oot$ make
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/back_of_hand.ci8.png -o build/assets/objects/object_dy_obj/back_of_hand.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/beta_clothes.rgba16.png -o build/assets/objects/object_dy_obj/beta_clothes.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/beta_gradient_1.rgba16.png -o build/assets/objects/object_dy_obj/beta_gradient_1.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/beta_gradient_2.rgba16.png -o build/assets/objects/object_dy_obj/beta_gradient_2.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/boot_pattern.ci8.png -o build/assets/objects/object_dy_obj/boot_pattern.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/ear_1.ci8.png -o build/assets/objects/object_dy_obj/ear_1.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/ear_2.ci8.png -o build/assets/objects/object_dy_obj/ear_2.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/eye_closed.rgba16.png -o build/assets/objects/object_dy_obj/eye_closed.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/eye_half.rgba16.png -o build/assets/objects/object_dy_obj/eye_half.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/eye_open.rgba16.png -o build/assets/objects/object_dy_obj/eye_open.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ia16 -i assets/objects/object_dy_obj/flower.ia16.png -o build/assets/objects/object_dy_obj/flower.ia16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/hair.ci8.png -o build/assets/objects/object_dy_obj/hair.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/leaves_pattern_1.ci8.png -o build/assets/objects/object_dy_obj/leaves_pattern_1.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/leaves_pattern_2.rgba16.png -o build/assets/objects/object_dy_obj/leaves_pattern_2.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/leaves_pattern_3.ci8.png -o build/assets/objects/object_dy_obj/leaves_pattern_3.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/mouth_closed.rgba16.png -o build/assets/objects/object_dy_obj/mouth_closed.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/mouth_open.rgba16.png -o build/assets/objects/object_dy_obj/mouth_open.rgba16.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt i4 -i assets/objects/object_dy_obj/particle.i4.png -o build/assets/objects/object_dy_obj/particle.i4.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt ci8 -i assets/objects/object_dy_obj/skin_gradient.ci8.png -o build/assets/objects/object_dy_obj/skin_gradient.ci8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt i8 -i assets/objects/object_dy_obj/spiral_beam_gradient.i8.png -o build/assets/objects/object_dy_obj/spiral_beam_gradient.i8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt i8 -i assets/objects/object_dy_obj/spiral_beam_pattern.i8.png -o build/assets/objects/object_dy_obj/spiral_beam_pattern.i8.inc.c
tools/ZAPD/ZAPD.out btex -eh -tt rgba16 -i assets/objects/object_dy_obj/tlut.rgba16.png -o build/assets/objects/object_dy_obj/tlut.rgba16.inc.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712  -mips2 -O2 -o build/assets/text/fra_message_data_static.o assets/text/fra_message_data_static.c
Traceback (most recent call last):
  File "/home/mobian/oot/tools/asm_processor/build.py", line 40, in <module>
    subprocess.check_call(compile_cmdline)
  File "/usr/lib/python3.9/subprocess.py", line 368, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: 'tools/ido_recomp/linux/7.1/cc'
make: *** [Makefile:308: build/assets/text/fra_message_data_static.o] Error 1
mobian@mobian:~/oot$ 

'make setup' Error (cc1plus: all warnings being treated as errors)

Something related to ZAPD from what I gather is stopping it from completing. Related to the -Werror or -Wall flags?
(Windows 10 + WSL Debian)

make[2]: Entering directory '/home/fuzzy/oot/tools/ZAPD'
g++ -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer -Werror -DDEPRECATION_ON -O2 -march=native -mtune=native -I ZAPD -I lib/elfio -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils -c -o build/ZAPD/ZPlayerAnimationData.o ZAPD/ZPlayerAnimationData.cpp
In file included from ZAPD/ZPlayerAnimationData.h:6:0,
                 from ZAPD/ZPlayerAnimationData.cpp:1:
ZAPD/ZResource.h:109:56: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual std::string GetBodySourceCode() const;
                                                        ^~~~~
ZAPD/ZResource.h:113:78: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual std::string GetDefaultName(const std::string& prefix) const;
                                                                              ^~~~~
ZAPD/ZResource.h:136:64: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual std::string GetSourceTypeName() const = 0;
                                                                ^
ZAPD/ZResource.h:140:64: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual ZResourceType GetResourceType() const = 0;
                                                                ^
ZAPD/ZResource.h:144:59: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual std::string GetExternalExtension() const;
                                                           ^~~~~
ZAPD/ZResource.h:147:45: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] const std::string& GetName() const;
                                             ^~~~~
ZAPD/ZResource.h:149:48: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] const std::string& GetOutName() const;
                                                ^~~~~
ZAPD/ZResource.h:151:43: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] offset_t GetRawDataIndex() const;
                                           ^~~~~
ZAPD/ZResource.h:155:56: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual size_t GetRawDataSize() const = 0;
                                                        ^
ZAPD/ZResource.h:159:71: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] virtual DeclarationAlignment GetDeclarationAlignment() const;
                                                                       ^~~~~
ZAPD/ZResource.h:165:40: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] bool WasDeclaredInXml() const;
                                        ^~~~~
ZAPD/ZResource.h:166:45: error: ‘nodiscard’ attribute directive ignored [-Werror=attributes]
  [[nodiscard]] StaticConfig GetStaticConf() const;
                                             ^~~~~
cc1plus: all warnings being treated as errors
Makefile:100: recipe for target 'build/ZAPD/ZPlayerAnimationData.o' failed
make[2]: *** [build/ZAPD/ZPlayerAnimationData.o] Error 1
make[2]: Leaving directory '/home/fuzzy/oot/tools/ZAPD'
Makefile:21: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/fuzzy/oot/tools'
Makefile:203: recipe for target 'setup' failed
make: *** [setup] Error 2

Split headers (that means z64.h and functions.h)

z64.h and functions.h contents should be moved to individual relevant proper headers

#1553 does (did) a lot for z64.h but we decided it should be split up into smaller chunks. It can be used as a reference for z64.h

besides better organization, stable headers are desired because what's included affects bss ordering in some way

MacOS compilation

Hi!

I've been trying to compile the project in MacOS (monterrey) and after a few bumps on the road I've stumbled into the following error:

...
mips-linux-gnu-objcopy -I binary -O elf32-big baserom/zoora_scene build/baserom/zoora_scene.o
tools/mkldscript build/spec build/ldscript.txt
cpp -P -xc++ undefined_syms.txt > build/undefined_syms.txt
mips-linux-gnu-ld -T build/undefined_syms.txt -T build/ldscript.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map build/z64.map -o zelda_ocarina_mq_dbg.elf
mips-linux-gnu-ld: não foi possível localizar build/data/unk_80009410.data.o
gmake: *** [Makefile:178: zelda_ocarina_mq_dbg.elf] Error 1
gmake  1335,72s user 379,11s system 82% cpu 34:42,44 total

Do you have any idea what could be wrong? I'm new to the ROM compiling world.

Also, is there any reliable place to download the Master debug ROM? I've got mine from a quite shady website...

Thanks

Incorrect `TextBoxPosition` values in `include/message_data_static.h`?

I noticed that the TextBoxPosition enum in include/message_data_static.h seems to have TEXTBOX_POS_MIDDLE and TEXTBOX_POS_BOTTOM flipped around. It has the former as 3 and the latter as 2, which doesn't match with my experience in-game while working on a PC port, or with the information available on wiki.cloudmodding.com/oot. The only place these values seem to be referenced is in src/code/z_message_PAL.c line 3151, where it seems like it could be placing a message box meant for the middle of the screen down to the bottom instead and vice versa, although I haven't yet found anywhere in game where this actually happens.

I could definitely be missing something, but I haven't been able to figure it out yet.

make setup crashes on low-end pcs

Make setup crashes on low-end pcs, or significantly slows the pc down because of the recent addition of the -j flag. Maybe we can either remove -j, or make it so it does something like -j(Number of cpu cores) because -j without any number makes it run unlimited which crashes on low-end pcs (both my laptop and my desktop, as they are quite old)

Feature: Code of Conduct

Hello, your repository is currently missing the Code of Conduct. If you would like to add that, then I can submit a PR for that. In that case, you need to provide me with a contact address (email address) that needs to be enlisted in the Code of Conduct.

Thanks!

Unsuccessful make on windows 10 WSL 2

setting up: win10 WSL 2 ubuntu 18.04

successfully running 'make setup'
but get error running 'make'
error output:
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.o src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C -DNON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -I. -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -m32 src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.o src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c
gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C -DNON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -I. -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -m32 src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.o src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c
gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C -DNON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -I. -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -m32 src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.o src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c
gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C -DNON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -I. -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -m32 src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.o src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c
gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C -DNON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -I. -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -m32 src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c
python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -o build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c
cfe: Error: src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c:26: Missing ')' in macro instantiation
cfe: Error: src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c:26: Missing ')' in macro instantiation
Failed to compile file src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c. Command line:

tools/ido_recomp/linux/7.1/cc -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712 -mips2 -O2 -I /home/bigwhite/oot/src/overlays/actors/ovl_Demo_Im -o build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o /tmp/preprocessed9eo1owjf.c

Makefile:318: recipe for target 'build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o' failed
make: *** [build/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.o] Error 55

Speed up builds: bypass asm-processor

I've been looking into how to speed up build times. I found that asm-processor adds non negligible overhead (due to python startup and imports, the asm-processor code itself runs in negligible time)


I wrote a C program "crwasmp" https://github.com/Dragorn421/DragoStuff/tree/crwasmp that performs what we currently use asm-processor for, that is

  • replace floats by the IEEE-754 binary representation ("in hex") in CutsceneData
  • convert encoding from utf-8 to euc-jp
  • run ido on the processed source

Note: oot is not using GLOBAL_ASM, the main feature of asm-processor, since gc-eu-mq-dbg was matched

it saves ~25% of time for building src/
(from built, rm -rf build/gc-eu-mq-dbg/src && time make)
in details, on my machine:
make -j1: 71s -> 54s (-24%)
make -j4: 27s -> 20s (-26%)
make -j8: 22s -> 17s (-23%)

This shows we have a lot of time to gain from not using asm-processor in the build process


An option "option-crwasmp" is to introduce above program "crwasmp" into the repo, replacing $(PYTHON) tools/asm_processor/build.py in the Makefile with it.

Another option "option-justusehex" would be to have ZAPD write CutsceneData floats directly as IEEE-754 (possibly with the float value as a comment like 0x42142142 /* 421.0f */).
Then all that's left to do before calling ido is the utf-8 to euc-jp encoding conversion, which is easily done with the iconv program. As a bonus this allows removing #pragma asmproc recurse.

Either way we would still keep asm-processor in the repo, which could selectively be used on specific files (cherry-pick in the makefile), if we do end up reintroducing GLOBAL_ASMs in the repo.

The two options are outlined in more details below

option-crwasmp has been tested, it's what I have right now.
There's no reason to believe option-justusehex would be slower (should be (marginally) faster, even)

option-crwasmp

option-justusehex

  • modify ZAPD to write hex IEEE-754 instead of floats in CutsceneData (e.g. 0x42142142 or 0x42142142 /* 421.0f */ instead of 421.0f), toggled by a config option
    • patch ZAPD upstream
    • pull ZAPD into zeldaret/oot
    • change config to write IEEE-754
  • remove asm-processor usage, instead use the iconv program (pseudo-command: preproc=`mktemp`; iconv -f utf-8 -t euc-jp -o input $preproc; ido FLAGS -o output $preproc; rm -f $preproc)
  • remove no-longer-needed #pragma asmproc recurse

option-donothing

it is an option but please not this one

step 4 -Make setup

Error: Expected a hash of f0b7f35375f9cc8ca1b2d59d78e35405 but got e4952ae1cac3a380d7f9cef3c2845dff. The baserom has probably been tampered, find a new one
make: *** [Makefile:250: setup] Error 1

should I find a new rom and if yes where can I find it that will work suitable?

Can't build due to Segmentation Fault

I was reading this output and at first I thought it may have been a problem with libbfd library because it is a slightly newer version than the one the make file is looking for, more specifically being 2.38 instead of 2.30 but I'm not sure if this is just a warning about the header being a different size than expected or the cause of the problem. Here is the output:

python3 tools/asm_processor/build.py tools/ido_recomp/linux/7.1/cc -- mips-linux-gnu-as -march=vr4300 -32 -Iinclude -- -c -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 649,838,712  -mips2 -O2 -o build/assets/text/nes_message_data_static.o assets/text/nes_message_data_static.c
mips-linux-gnu-objcopy -O binary build/assets/text/nes_message_data_static.o build/assets/text/nes_message_data_static.o.bin
mips-linux-gnu-objcopy: Symbol `_bfd_std_section' has different size in shared object, consider re-linking
mips-linux-gnu-objcopymake: *** [Makefile:309: build/assets/text/nes_message_data_static.o] Segmentation fault (core dumped)
make: *** Deleting file 'build/assets/text/nes_message_data_static.o'

If that is so, then I have a problem with the dependency listed on Ubuntu bionic beaver, which is not even the latest LTS but it is the correct version for mips. If it is not and the problem was on that line of make file, how can that be solved?

Compiling using GCC on WSL2 Ubuntu builds correctly, but produces ROM that crashes on startup

I'm assuming the gcc compiler builds should still produce playable ROMs.

The ido compiler seems to work fine so I'm using that right now, but it would be nice if I could switch to later C standards. The resulting ROM file also seems significantly smaller than the baserom.z64, might just be gcc producing less code though?

To reproduce clone the repo, change the compiler to gcc in the makefile and run make setup & make.

Confusion about which version of the game is needed for building.

For the currently supported master quest build, do you need the master quest version of the game? Or can you use the original game, which is far easier to legally obtain (being that it is on the Wii U as a virtual console game and is available to purchase digitally).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.