Commit Graph

1640 Commits

Author SHA1 Message Date
Matt Penny
0fd1954898 Do not hard code build output directory name
The game can now be built in any directory
2024-11-20 23:38:24 -05:00
Matt Penny
bbb6f7b095 Add missing font characters for Polish and Romanian translations
* Also explicitly ignore non-breaking space
* Fail string generation if any font characters are missing
2024-11-20 21:43:01 -05:00
Matt Penny
5d482bbcd8 Sound conversion cleanup
* Use .sox files for ambience_base and tank_turret_loop1 instead of
  hard-coded conversion
* Rename .msox to .sox
  - Format is same and extension is no longer needed to differentiate
* Output transformed sounds to portal_pak_modified instead of build dir
  - Consistent with other conversions, and easy to preview when adding
    new sounds
  - Avoids hard-coding build output directory in .ins files
2024-11-18 23:00:20 -05:00
Matt Penny
e884e283fa CMake cleanup
* Use "strings" instead of "subtitles" for translation-related files and types
* Remove CMAKE preprocessor define
* Remove makefile hack in generate_sound_ids
2024-11-18 21:56:20 -05:00
Matt Penny
fb31e1b2d0 Remove PORTAL64_WITH_DEBUGGER line from debugger.md 2024-11-16 20:01:52 -05:00
Matt Penny
c35e2e64fc Remove Makefile and update build docs 2024-11-16 19:52:30 -05:00
Matt Penny
771c06d934 CMake: finish options for configuring languages
* AUDIO_LANGUAGES and TEXT_LANGUAGES are now validated against
  supported languages
* Alternately, "all" can be specified to include all languages
  (default for TEXT_LANGUAGES)
* Also fixed linker script not regenerating on language change

CMake builds now have parity with the Makefile (and more!)
2024-11-14 23:52:36 -05:00
Matt Penny
8853940a2a CMake: support configurable text languages
* Comma-separated languages can be specified using the TEXT_LANGUAGES
  CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language

As part of this, I cleaned up the string generation script, and fixed
some incorrect Bulgarian HINT_ strings.

TODO:
  * Allow specifying "all" for text/audio language
  * Invalid character validation
2024-11-14 23:50:20 -05:00
Matt Penny
efb83d1923 Use more standard luac file extension when building Skeletool lua files 2024-11-14 23:50:20 -05:00
Matt Penny
1c6efda386 Generate font layout information during build
Removed generated font code from repo to avoid duplication and make
updating fonts cleaner. The files in `assets/fonts/` are the source
of truth.
2024-11-14 23:50:20 -05:00
Matt Penny
00559b6ca3 CMake: support multiple audio languages
* Comma-separated languages can be specified using the AUDIO_LANGUAGES
  CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language

As part of this, I refactored the sound lookup tables to not store
information about non-localized sounds (which previously occupied most
of the table).
2024-11-14 23:50:19 -05:00
Matt Penny
33981fae6a Add CMake variables to enable debugger, display list validator, and RSP profiler 2024-11-14 23:50:19 -05:00
hackgrid
5949334ff0
enable single-language builds besides english (#89) 2024-11-09 03:06:33 -05:00
Matt Penny
1a85c65408 Remove unused editorconfig file 2024-11-07 01:02:53 -05:00
Matt Penny
051f8ada46 Fix inability to override CMake toolchain variables 2024-11-07 00:47:04 -05:00
Matt Penny
d07521f70a CMake: clean up linking
* Linker script file and preprocessing logic moved to subdirectory
* Linker script related flag passing moved to function in toolchain file
* ROM generation logic moved to toolchain file
2024-11-07 00:32:09 -05:00
Matt Penny
13691d919a Move tools into subdirectories 2024-11-06 23:25:02 -05:00
Matt Penny
31ce4e17a0 Game builds with CMake 2024-11-06 01:38:18 -05:00
Matt Penny
13db5ddc5e CMake: generate linker script fragments for segments
* Animations
* Levels
* Dynamic models
* Strings

Started to hook this up to the linker. There are still some errors to fix.
2024-11-05 02:07:16 -05:00
Matt Penny
1df470e87b Add missing include, reenable asserts 2024-11-02 21:14:58 -04:00
Matt Penny
bbc5a686a6 CMake: reorganize code segment into separate library
Required for linker script.

Refactored some asset targets to make this possible.
2024-11-02 21:03:39 -04:00
Matt Penny
6b4222e743 Automatic discovery of libgcc, remove newlib dependency (for now)
Implemented strcpy and strlen, which were all that were needed
(math functions and sprintf are in libultra).

To move further away from libultra, some standard library
implementation - such as newlib - will either need to be added
back later, or if the usage is small, functions can be reimplemented.
For now, removing it makes building easier.
2024-11-02 20:44:58 -04:00
Matt Penny
1bb1a71aae Remove build directory name from includes in main linker script 2024-11-02 02:30:11 -04:00
Matt Penny
a29bb36041 Do not rely on hardcoded directories when linking
* Use preprocessor directives to pass microcode object file paths

* Add build directory to include path when preprocessing, so directory
  name is not needed when including generated linker script fragments

* Pass required files on the command line so wildcard matching can be used

* Also remove special case for creating object file for boot code (use
  incbin in asm file instead)
2024-11-02 02:07:08 -04:00
Haydn Trigg
dd1f1d5b07
Fix spelling of collisionObjectShouldGenerateContacts (#92) 2024-10-30 21:19:54 -04:00
Haydn Trigg
d16bf1ac01
Fix floating point syntax (#91)
* plane.c fix floating point syntax

* Update quaternion.c

* Update matrix.c

* Update collision_scene.c
2024-10-30 21:14:48 -04:00
Matt Penny
11a81e100f Refactor linker script segment generation
* Code for this now lives in one place instead of 3. This will make it
  easier to generate with CMake.
* Simplify subtitle alignment
2024-10-25 02:08:09 -04:00
Matt Penny
4c1484d5e6 Use PROJECT_BINARY_DIR instead of CMAKE_BINARY_DIR 2024-10-22 00:13:54 -04:00
Matt Penny
1a10e45682 Clean up skeletool CMake integration, and use consistent naming
Renamed all instances of skelatool -> skeletool. This is more consistent
than the mixed usage previously, which consequently makes adding the
external project in CMake easier.
2024-10-21 23:29:43 -04:00
Matt Penny
b04e404b0b CMake: finish skeletool integration
* Embed Lua scripts in a cross-platform way (generated C source files)
* Automatically find `luac`
* Automatically build skeletool when building main project
2024-10-21 22:50:17 -04:00
Matt Penny
80a896d508 Namespaced name for imported libultra target 2024-10-19 21:33:42 -04:00
Matt Penny
e61142b902 Build skeletool with CMake 2024-10-19 21:18:15 -04:00
Matt Penny
3b9fba522b Get Skeletool dependencies from system
Do not install while building
2024-10-19 21:18:14 -04:00
Matt Penny
42a9189c95 CMake: get assembly working
* Assemble through `gcc` instead of `as` directly, so source files are
  preprocessed (i.e., `#include`)
* `gcc` does not pass `-I` include directories to `as`. This can
  supposedly be fixed by recompiling `gcc` with `--with-gnu-as`. Popular
  N64 toolchain binary distributions don't do this, and to lower the
  barrier to entry I don't want to force users to have to compile their
  own. Work around it by passing `-Wa,-I`.
* CMake only finds assembly dependencies when preprocessing, not when
  assembling. Use `#include` instead of `.include` to work around this.
  The `.incbin`s used by `sound_data.s` are covered by the
  sound_data_tables target dependency.
2024-10-19 16:30:58 -04:00
Matt Penny
4e9e9d32d6 ASM: simplify, document, start integrating with CMake
* Refactor entry point
* Remove unused code
* Reformat level header to be more clear, and add more comments

Looks like assembling with CMake will require some changes to the
assembler flags, and possibly some manual dependency specification.
2024-10-19 02:38:52 -04:00
Matt Penny
1cb12690b8 Fix UV mapping on elevator bottom edge 2024-10-17 21:20:01 -04:00
Matt Penny
22ea93d19f CMake: automatically find programs used in build
Blender 3.6 and ImageMagick 6 versions are also enforced
2024-10-17 21:04:48 -04:00
Matt Penny
08368ffa25 Remove mpg123 dependency
It was used to convert MP3 -> WAV, which ffmpeg can do.
2024-10-17 18:44:24 -04:00
Matt Penny
86aaad1b3b CMake: suppress sox warnings 2024-10-17 18:20:55 -04:00
Matt Penny
259181f2b5 CMake: add find module for libultra, improve N64 toolchain file
* Less hard-coding when searching for libultra
* Proper compiler, assembler, and linker flags
* Multiple build types
* Support for multi-config generators
2024-10-17 18:14:15 -04:00
Matt Penny
9546c509a8 CMake: generate and link localized strings 2024-10-10 01:14:17 -04:00
Matt Penny
08dc063227 Use proper default material for fleck_ash2
Previously, grav_flare was used (likely due to a copy/paste error),
resulting in a warning during build and unnecessary texture data
being included in the fleck_ash2 generated model.
2024-10-09 22:55:53 -04:00
Matt Penny
ddac6daeff CMake: prevent double work when using parallel make 2024-10-09 22:49:02 -04:00
Matt Penny
87f931a8e4 CMake: link level and model animation data 2024-10-09 21:57:39 -04:00
Matt Penny
6c625e39e6 CMake: link generated code 2024-10-08 00:25:30 -04:00
Matt Penny
1d0b22df61 Generate dynamic model lists with CMake, + refactor
* When building with CMake, dynamic model lists are now generated
* Factored common code out of generate_*_list.js files to deduplicate
* Better separated generated model lists from main game code
    `dynamic_asset_data.c` and `dynamic_animated_asset_data.c`
    previously #included the corresponding generated headers, and
    `dynamic_asset_loader.c` declared externs for the contents.

    This messiness was likely done so the generated code would be built
    automatically (the Makefile globs all C files under `src/`).

    Now, model list data is output to C source files which are built
    explicitly. This, with some refactoring, allows the previously
    mentioned source files and externs to be removed.

    This is a bit hacky in the Makefile but will be automatic under
    CMake by using target properties.
* Reorganized some files under `tools/`
2024-10-05 21:11:49 -04:00
Matt Penny
9643719a31 Fix incorrect variable name for Python executable in CMake build 2024-10-05 02:04:39 -04:00
Matt Penny
e1e6a53aa6 Convert models during CMake build
No generation of dynamic model lists yet
2024-10-05 01:54:55 -04:00
Matt Penny
1e8a4f5458 Remove empty linked list files 2024-10-05 01:24:56 -04:00
Matt Penny
2e6f8ac86b Reflect proper default scene scale in defs.h
This value is set when compiling anyway, but this change makes the value
match for consistency.

Now that the default is the actual intended value, it doesn't need to be
overridden in the Makefile, but since scene scale needs to be passed to
skeletool regardless I'm going to keep the preprocessor define too so
they don't get out of sync.
2024-10-05 01:24:56 -04:00