From c24d053648c03874e12e494b7646636c7d9c1f80 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 31 Dec 2024 19:46:15 +0100 Subject: [PATCH] Update documentation --- docs/Bugs/observed_bugs.md | 6 ++ docs/Features/auto_lba.md | 70 +++++++-------------- docs/docs.md | 15 +++-- include/PSX/Overlay/overlay_declaration.hpp | 8 --- 4 files changed, 38 insertions(+), 61 deletions(-) create mode 100644 docs/Bugs/observed_bugs.md delete mode 100644 include/PSX/Overlay/overlay_declaration.hpp diff --git a/docs/Bugs/observed_bugs.md b/docs/Bugs/observed_bugs.md new file mode 100644 index 00000000..360f0e17 --- /dev/null +++ b/docs/Bugs/observed_bugs.md @@ -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. \ No newline at end of file diff --git a/docs/Features/auto_lba.md b/docs/Features/auto_lba.md index a4f32643..b3d7a376 100644 --- a/docs/Features/auto_lba.md +++ b/docs/Features/auto_lba.md @@ -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 +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 - - // ... - 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 - -// ... -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 - System.cnf -
Application.psexe
+ System.cnf +
Application.psexe
+ Overlay.state ``` \ No newline at end of file diff --git a/docs/docs.md b/docs/docs.md index 477c614a..30637036 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -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) \ No newline at end of file +- [Auto LBAs](./Features/auto_lba.md) + +## Known limitations +- Insufficient documentation + +## Observed bugs +- [Observed bugs](./Bugs/observed_bugs.md) \ No newline at end of file diff --git a/include/PSX/Overlay/overlay_declaration.hpp b/include/PSX/Overlay/overlay_declaration.hpp deleted file mode 100644 index 2fc6a647..00000000 --- a/include/PSX/Overlay/overlay_declaration.hpp +++ /dev/null @@ -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) \ No newline at end of file