Compare commits

...

7 Commits

Author SHA1 Message Date
Jaby f889325164 Update readme again 2024-12-31 20:07:08 +01:00
Jaby c24d053648 Update documentation 2024-12-31 20:07:07 +01:00
Jaby 79244df874 Update readme 2024-12-31 20:07:07 +01:00
Jaby f480ce64fe Update rust versions 2024-12-31 20:07:06 +01:00
Jaby 98e801b4c7 Update readme 2024-12-31 20:07:06 +01:00
Jaby 51620e2082 Update assets 2024-12-31 20:06:59 +01:00
Jaby eab4558460 Update attributes 2024-12-31 20:03:15 +01:00
28 changed files with 230 additions and 157 deletions

1
.gitattributes vendored
View File

@ -1,3 +1,4 @@
*.xa filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,6 @@
# Observed bugs
- [Observed bugs](#observed-bugs)
- [Deadlock](#deadlock)
## Deadlock
It was observed in `PoolBox` when loading the `FontCycler` overlay that a deadlock occurred. This error has not been observed since. The current theory is that accidentally an old save state in the emulator was loaded.

View File

@ -1,68 +1,40 @@
# Auto LBA
- [Auto LBA](#auto-lba)
- [In Code](#in-code)
- [For CD generation](#for-cd-generation)
## Table of Contents
- [In Code](#in-code)
- [Overlay](#overlay)
- [Main file](#main-file)
- [For CD generation](#for-cd-generation)
To support the `Auto LBA` feature changes need to be applied to the source files and the CD configuration file. The changes for the source files depend on if they are an Overlay or part of the main executable.
---
To support the `Auto LBA` feature changes need to be applied to the source files and the CD configuration file.
## In Code
To use the `Auto LBA` feature the LBAs first need to be defined in either an `enum` or `enum struct`. These need to fit a special pattern.
To use the `Auto LBA` feature the LBAs first need to be defined in either an `enum` or `enum struct`. These need to fit a special pattern. The usage of a `namespace` is recommended.
`__jabyengine_start_lba_request` needs to be the first entry while `__jabyengine_end_lba_request` needs to be the last. Each LBA entry needs to be declared with `__jabyengine_request_lba_for` followed by the name for the enum entry and the file path on the disk.
```c++
#include <PSX/AutoLBA/auto_lba.hpp>
namespace Assets {
enum LBA {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(SYSTEM_CNF, "SYSTEM.CNF"),
__jabyengine_end_lba_request
};
__declare_lba_header(LBA);
enum LBA {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(SYSTEM_CNF, "SYSTEM.CNF"),
__jabyengine_end_lba_request
};
```
### __Overlay__
For use with Overlays you need to include the related header file. You must place this include into the Namespace of your overlay to avoid name clash. Now the `lba` array is accessible.
```c++
namespace Overlay {
#include <PSX/Overlay/overlay_declaration.hpp>
// ...
printf("LBA: %i, Words: %i\n", lba[LBA::SYSTEM_CNF].lba, lba[LBA::SYSTEM_CNF].size_words);
// ...
__declare_overlay_header(execute, LBA);
namespace {
void load() {
printf("LBA: %i, Words: %i\n", lba[LBA::SYSTEM_CNF].lba, lba[LBA::SYSTEM_CNF].size_words);
}
}
}
```
### __Main file__
For use with the main file you need to include the header file and use the `__declare_lba_header` macro with the name of your enum to create the LBA area in any file. The header allows to access the `lba` array with your enum as the index.
```c++
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
// ...
printf("LBA: %i, Words: %i\n", lba[LBA::SYSTEM_CNF].lba, lba[LBA::SYSTEM_CNF].size_words);
// ...
__declare_lba_header(LBA);
```
## For CD generation
To automatically fill the LBA values `psxcdgen_ex` needs to be used.
For the main file the special XML type `Main` needs to be used while specifing the LBA file being used.
For Overlays the instruction will follow...
The attribute `lba_source` automatically fills in the values. It can be used with the XML `Main` and `Overlay` tag.
```xml
<Track>
<File name="SYSTEM.CNF">System.cnf</File>
<Main name="SCES_XXX.XX" lba_source="main.cpp">Application.psexe</Main>
<File name = "SYSTEM.CNF">System.cnf</File>
<Main name = "%PSX_BOOT_FILE%" lba_source = "main.cpp">Application.psexe</Main>
<Overlay name = "OVL.BIN" lba_source = "state.cpp">Overlay.state</Overlay>
</Track>
```

View File

@ -1,7 +1,14 @@
# JabyEngine Documentation
- [JabyEngine Documentation](#jabyengine-documentation)
- [Features](#features)
- [Known limitations](#known-limitations)
- [Observed bugs](#observed-bugs)
## Table of Contents
- [Features](#features)
---
## Features
- [Auto LBAs](./Features/auto_lba.md)
- [Auto LBAs](./Features/auto_lba.md)
## Known limitations
- Insufficient documentation
## Observed bugs
- [Observed bugs](./Bugs/observed_bugs.md)

View File

@ -4,5 +4,4 @@
*.d
*.o
*.lba
**/bin
**/audio/temp/*
**/bin

View File

@ -206,8 +206,8 @@ namespace NormalScene {
FontWriter::new_font_writer.write(cursor.change_position(Make::PositionI16((GPU::Display::Width-VersionLength)/2, 16 + DefaultFont::Info.get_kern_size().height)), Version, GPU::Color24::Green(0xD0), &FontWriter::wiggle);
menu.update(FontWriter::bios_font_writer, cursor, Make::PositionI16(8, 64));
cursor.change_position(Make::PositionI16(doener_fish.position.x + doener_fish.size.width, GPU::Display::Height - 32));
FontWriter::bios_font_writer.write(cursor, "Audio:\n%s", cd_player.is_xa ? "CD-XA" : "CD-DA");
cursor.change_position(Make::PositionI16(doener_fish.position.x + doener_fish.size.width, GPU::Display::Height - 48));
FontWriter::bios_font_writer.write(cursor, "Audio:\n%s\n(SEL/R1/R2)", cd_player.is_xa ? "CD-XA" : "CD-DA");
if(Shared::load_test) {
// Force state change if we are in the load_test state

View File

@ -7,7 +7,7 @@ CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans
# Ressources to convert
## Music tracks
INPUT += $(OUTPUT_DIR)/Evacuation_cdda.xa
INPUT += $(OUTPUT_DIR)/fox.xa
INPUT += $(OUTPUT_DIR)/OnMyOwn_BailBonds.xa
INPUT += $(OUTPUT_DIR)/apple.vag
INPUT += $(OUTPUT_DIR)/blubb-mono.vag
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag
@ -40,14 +40,14 @@ IMG_6921_TIM_FLAGS = tim full16 --clut-pos {384,255} --tex-pos {384,256}
INPUT += $(OUTPUT_DIR)/AllTheJaby.tim
AllTheJaby_TIM_FLAGS = tim full16 --tex-pos {0,0}
$(OUTPUT_DIR)/fox.xa: audio/temp/fox.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ xa
$(OUTPUT_DIR)/%.vag: audio/temp/%.wav
$(OUTPUT_DIR)/%.vag: audio/%.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv --lz4 $< -o $@ vag
$(OUTPUT_DIR)/OnMyOwn_BailBonds.xa: audio/OnMyOwn_BailBonds.mp3
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ xa
$(OUTPUT_DIR)/%.xa: audio/%.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ xa

BIN
examples/PoolBox/assets/audio/Friendship_samp.wav (Stored with Git LFS) Normal file

Binary file not shown.

BIN
examples/PoolBox/assets/audio/OnMyOwn_BailBonds.mp3 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
examples/PoolBox/assets/audio/apple.wav (Stored with Git LFS) Normal file

Binary file not shown.

BIN
examples/PoolBox/assets/audio/blubb-mono.wav (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -47,7 +47,7 @@
<Directory name = "XAAUDIO" hidden = "true">
<InterleavedFile name = "MIX.XA">
<Channel>../assets/bin/Evacuation_cdda.xa</Channel>
<Channel>../assets/bin/fox.xa</Channel>
<Channel>../assets/bin/OnMyOwn_BailBonds.xa</Channel>
</InterleavedFile>
</Directory>
<Directory name = "SFX" hidden = "true">
@ -56,5 +56,5 @@
<File name = "FRIEND.VAG" lz4 = "already">../assets/bin/Friendship_samp.vag</File>
</Directory>
</Filesystem>
<AudioTrack align = "true">../assets/audio/temp/breaking.wav</AudioTrack>
<AudioTrack align = "true">../assets/audio/jlbrock44_Three_Kings_Funk_cdda_ready.wav</AudioTrack>
</PSXCD>

View File

@ -1,8 +0,0 @@
#pragma once
// No include here because this header should be included in a namespace and we don't want multiple namespace definitions of OverlayHeader and OverlayLBA
#include "../AutoLBA/auto_lba_declaration.hpp"
#define __declare_overlay_header(function, enum_struct) \
__declare_lba_header(enum_struct)

View File

@ -1,26 +1,71 @@
# Compatibility
* PS1
* Emulator
- [X] Duckstation
- [X] No$PSX
- [X] Xebra
- [ ] Real Hardware
- PS3
- [ ] Emulator
- [ ] Real Hardware
- [JabyEngine](#jabyengine)
- [About](#about)
- [How to build](#how-to-build)
- [Building `JabyEngine` (without VSCode)](#building-jabyengine-without-vscode)
- [Building support library (without VSCode)](#building-support-library-without-vscode)
- [`FontWriter` (without VSCode)](#fontwriter-without-vscode)
- [Building `PoolBox` (without VSCode)](#building-poolbox-without-vscode)
- [Media creators](#media-creators)
- [JabyEngine](#jabyengine-1)
- [PoolBox](#poolbox)
- [Special thanks](#special-thanks)
# TODO
- [ ] Ko-fi supporter list
- [ ] Support more GTE
- [X] Easy serial code swap
- [X] Support .subst files to be substituted with environment variables
- [X] Support pop-fe
- [ ] PS3 PKG generation tool?
- [ ] PS3 runtime detection?
- [ ] Move DMA code to public include for custom loading of files?
- [ ] Maybe make it an interface with SPU/GPU as a specification...?
- [ ] Could be empty classes that the linker maps to 0 or somewhere
- [ ] Could be a all static struct (I like that better; We are not Nicolas Noble)
- [ ] Redo the IO ports again...?
- [ ] Support better file loading with threads
- [ ] Loading Screen with GPU IO? (Does DMA and IO work together?)
# JabyEngine
## About
JabyEngine is my personal attempt to eventually make my own PS1 game from "ground up". Originally I didn't indented to release this code publicly but recently I decided to give it a try. If you read this, thank you!
## How to build
JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development.
The following environment variables should be set:
* `JABY_ENGINE_PATH`: The path to the root folder of this repo
* `PSX_LICENSE_PATH`: The path to a folder containing the PS1 licenses for generating a CD.
### Building `JabyEngine` (without VSCode)
`make` requires the following values to be passed:
* `BUILD_PROFILE`: `debug`/`release`
* `PSX_TV_FORMAT`: `PAL`/`NTSC`
* `CUSTOM_CONFIG`: Empty or folder name under `./config`
### Building support library (without VSCode)
These projects shall eventually turn into useful extensions for the engine. So far they are more tests then proper code. However `PoolBox` is depended on `FontWriter`.
#### `FontWriter` (without VSCode)
`make` requires the following values to be passed:
* `BUILD_PROFILE`: `debug`/`release`
### Building `PoolBox` (without VSCode)
`PoolBox` is the one and only example project so far.
`make` requires the following values to be passed:
* `BUILD_PROFILE`: `debug`/`release`
* `REGION`: `SCEE`/`SCEA`/`SCEI`
* `CUSTOM_CONFIG`: Empty or folder name under `$(JABY_ENGINE_PATH)/config`
# Media creators
## JabyEngine
| Art | Author |
|-----------------------------------------------------------------|--------|
| `ressources\Splash_ntsc.png` <br/> `ressources\Splash_ntsc.png` | Niuka |
## PoolBox
| Art | Author |
|-----------------------------------------------------------------|-------------|
| `examples\PoolBox\assets\AllTheJaby.png` | Niuka |
| `examples\PoolBox\assets\IconTexture.png` | Charlie Nax |
| `examples\PoolBox\assets\Paco.png` | Paco |
| Music | Author |
|---------------------------------------------------------------------------|---------------------------------------|
| `examples\PoolBox\assets\audio\apple.wav` | ??? |
| `examples\PoolBox\assets\audio\blubb-mono.wav` | ??? |
| `examples\PoolBox\assets\audio\Evacuation_cdda.wav` | Cody the white tiger |
| `examples\PoolBox\assets\audio\Friendship_samp.wav` | From Dragon Quest VII |
| `examples\PoolBox\assets\audio\jlbrock44_Three_Kings_Funk_cdda_ready.wav` | `Three Kings Funk` by spinningmerkaba |
| `examples\PoolBox\assets\audio\OnMyOwn_BailBonds.mp3` | `On My Own` by Bail Bonds |
# Special thanks
* Cody the white tiger
* Nicolas Noble
* Pyravia
* Sickle

View File

@ -14,13 +14,22 @@ define cp_artifact
endef
define cargo_windows_default
$(if $(findstring upgrade,$(CARGO_CMD)),
cargo $(CARGO_CMD) --$(BUILD_PROFILE),
cargo $(CARGO_CMD) --$(BUILD_PROFILE) --target=$(WINDOWS_TARGET)
$(call cp_artifact,$(WINDOWS_ARTIFACT), ../../../bin/$(ARTIFACT).exe)
)
endef
define cargo_unix_default
$(if $(findstring upgrade,$(CARGO_CMD)),
cargo $(CARGO_CMD) --$(BUILD_PROFILE),
cargo $(CARGO_CMD) --$(BUILD_PROFILE) --target=$(UNIX_TARGET)
$(call cp_artifact,$(UNIX_ARTIFACT), ../../../bin/$(ARTIFACT))
)
endef
# Run `cargo install cargo-edit --locked`to support upgrade
# Windows build requires "rustup target add x86_64-pc-windows-gnu" and "sudo apt-get install mingw-w64"

View File

@ -1,4 +1,5 @@
PROJECTS = cpp_out psxfileconv mkoverlay psxcdgen_ex psxreadmap wslpath
SUPPORT_PROJECTS = cdtypes tool_helper
PROJECTS = cpp_out psxfileconv mkoverlay psxcdgen_ex psxreadmap wslpath
.PHONY: $(PROJECTS)
$(foreach var,$(PROJECTS),$(var)):

View File

@ -66,14 +66,14 @@
{
"id": "build cfg",
"type": "pickString",
"options": ["debug", "release"],
"options": ["debug", "release", "compatible", "incompatible"],
"default": "release",
"description": "build configuration"
},
{
"id": "cargo cmd",
"type":"pickString",
"options": ["build", "check", "update", "clean", "run", "tree"],
"options": ["build", "check", "update", "upgrade", "clean", "run", "tree"],
"default": "build",
"description": "cargo command to run"
}

View File

@ -1,6 +1,6 @@
[package]
name = "cdtypes"
version = "0.7.2"
version = "1.0.0"
edition = "2021"
[profile.release]
@ -8,5 +8,5 @@ panic = "abort"
[dependencies]
byteorder = "1.5.0"
chrono = "0.4.31"
paste = "1.0.14"
chrono = "0.4.39"
paste = "1.0.15"

View File

@ -0,0 +1,13 @@
include ../Common.mk
ARTIFACT = cdtypes
.PHONY: $(WINDOWS_ARTIFACT) $(UNIX_ARTIFACT)
$(WINDOWS_ARTIFACT):
$(call cargo_windows_default)
$(UNIX_ARTIFACT):
$(call cargo_unix_default)
all-windows: $(WINDOWS_ARTIFACT)
all: $(UNIX_ARTIFACT)

View File

@ -7,5 +7,5 @@ edition = "2021"
panic = "abort"
[dependencies]
clap = {version = "4.4.11", features = ["derive"]}
clap = {version = "4.5.23", features = ["derive"]}
tool_helper = {path = "../tool_helper"}

View File

@ -7,6 +7,6 @@ edition = "2021"
panic = "abort"
[dependencies]
clap = {version = "4.4.11", features = ["derive"]}
serde_json = "1.0.108"
tool_helper = {path = "../tool_helper"}
clap = {version = "4.5.23", features = ["derive"]}
serde_json = "1.0.134"
tool_helper = {path = "../tool_helper"}

View File

@ -8,10 +8,10 @@ panic = "abort"
[dependencies]
cdtypes = {path = "../cdtypes"}
clap = {version = "4.4.11", features = ["derive"]}
colored = "2.1.0"
clap = {version = "4.5.23", features = ["derive"]}
colored = "2.2.0"
hound = "3.5.1"
no-comment = "0.0.3"
paste = "1.0.14"
paste = "1.0.15"
roxmltree = "0.19.0"
tool_helper = {path = "../tool_helper"}

View File

@ -1,38 +1,38 @@
[package]
name = "psxfileconv"
version = "0.9.0"
edition = "2021"
[profile.release]
panic = "abort"
[features]
default = ["symphonia-all"]
symphonia-all = ["symphonia", "symphonia/all"]
symphonia-isomp4 = ["symphonia", "symphonia/isomp4"]
symphonia-mkv = ["symphonia", "symphonia/mkv"]
symphonia-ogg = ["symphonia", "symphonia/ogg"]
symphonia-wav = ["symphonia", "symphonia/wav"]
symphonia-aac = ["symphonia", "symphonia/aac"]
symphonia-adpcm = ["symphonia", "symphonia/adpcm"]
symphonia-alac = ["symphonia", "symphonia/alac"]
symphonia-flac = ["symphonia", "symphonia/flac"]
symphonia-mpa = ["symphonia", "symphonia/mpa"]
symphonia-mp1 = ["symphonia", "symphonia/mp1"]
symphonia-mp2 = ["symphonia", "symphonia/mp2"]
symphonia-mp3 = ["symphonia", "symphonia/mp3"]
symphonia-pcm = ["symphonia", "symphonia/pcm"]
symphonia-vorbis = ["symphonia", "symphonia/vorbis"]
[dependencies]
bitflags = "2.6.0"
cdtypes = {path = "../cdtypes"}
clap = {version = "4.4.11", features = ["derive"]}
image = "0.24.7"
hound = "3.5.1"
paste = "1.0.14"
png = "0.17.10"
rubato = "0.16.1"
symphonia = {version = "0.5.4", optional = true, default-features = false}
tool_helper = {path = "../tool_helper"}
[package]
name = "psxfileconv"
version = "1.0.0"
edition = "2021"
[profile.release]
panic = "abort"
[features]
default = ["symphonia-all"]
symphonia-all = ["symphonia", "symphonia/all"]
symphonia-isomp4 = ["symphonia", "symphonia/isomp4"]
symphonia-mkv = ["symphonia", "symphonia/mkv"]
symphonia-ogg = ["symphonia", "symphonia/ogg"]
symphonia-wav = ["symphonia", "symphonia/wav"]
symphonia-aac = ["symphonia", "symphonia/aac"]
symphonia-adpcm = ["symphonia", "symphonia/adpcm"]
symphonia-alac = ["symphonia", "symphonia/alac"]
symphonia-flac = ["symphonia", "symphonia/flac"]
symphonia-mpa = ["symphonia", "symphonia/mpa"]
symphonia-mp1 = ["symphonia", "symphonia/mp1"]
symphonia-mp2 = ["symphonia", "symphonia/mp2"]
symphonia-mp3 = ["symphonia", "symphonia/mp3"]
symphonia-pcm = ["symphonia", "symphonia/pcm"]
symphonia-vorbis = ["symphonia", "symphonia/vorbis"]
[dependencies]
bitflags = "2.6.0"
cdtypes = {path = "../cdtypes"}
clap = {version = "4.5.23", features = ["derive"]}
image = "0.24.9"
hound = "3.5.1"
paste = "1.0.15"
png = "0.17.16"
rubato = "0.16.1"
symphonia = {version = "0.5.4", optional = true, default-features = false}
tool_helper = {path = "../tool_helper"}

View File

@ -7,8 +7,8 @@ edition = "2021"
panic = "abort"
[dependencies]
clap = {version = "4.4.11", features = ["derive"]}
clap = {version = "4.5.23", features = ["derive"]}
crossterm = "0.27.0"
ratatui = "0.25.0"
readmap = {version = "*", path = "readmap"}
tool_helper = {version = "*", path = "../tool_helper"}
tool_helper = {version = "*", path = "../tool_helper"}

View File

@ -1,6 +1,6 @@
[package]
name = "tool_helper"
version = "0.9.8"
version = "1.0.0"
edition = "2021"
[profile.release]
@ -9,9 +9,9 @@ panic = "abort"
[dependencies]
byteorder = "1.5.0"
cdtypes = {path = "../cdtypes"}
colored = "2.0.4"
colored = "2.2.0"
envmnt = "0.10.4"
hound = "3.5.1"
lz4 = "1.24.0"
paste = "1.0.14"
wslpath = {path = "../wslpath"}
lz4 = "1.28.0"
paste = "1.0.15"
wslpath = {path = "../wslpath"}

View File

@ -0,0 +1,13 @@
include ../Common.mk
ARTIFACT = tool_helper
.PHONY: $(WINDOWS_ARTIFACT) $(UNIX_ARTIFACT)
$(WINDOWS_ARTIFACT):
$(call cargo_windows_default)
$(UNIX_ARTIFACT):
$(call cargo_unix_default)
all-windows: $(WINDOWS_ARTIFACT)
all: $(UNIX_ARTIFACT)

View File

@ -7,4 +7,4 @@ edition = "2021"
panic = "abort"
[dependencies]
clap = {version = "4.4.7", features = ["derive"]}
clap = {version = "4.5.23", features = ["derive"]}