Commit Graph

219 Commits

Author SHA1 Message Date
scawful
d45f7819e1 refactor(app): reorganize application structure and update includes
- Moved core components such as `Controller` and `Window` from `src/app/core/` to `src/app/` and `src/app/platform/`, respectively, to improve modularity and clarity.
- Updated include paths across the codebase to reflect the new locations of these components.
- Introduced a new foundational core library in `src/core/` for project management and ROM patching logic, enhancing the separation of concerns.
- Adjusted CMake configurations to ensure proper compilation of the new core library and updated dependencies in various modules.

Benefits:
- Streamlines the application structure, making it easier to navigate and maintain.
- Enhances code organization by clearly delineating core functionalities from application-specific logic.
- Improves overall architecture by promoting a clearer separation of concerns between different components.
2025-10-15 20:10:04 -04:00
scawful
01d3e46e87 refactor(build): enhance CMake configurations for protobuf integration
- Updated CMake files to conditionally link against libprotobuf based on the YAZE_PROTOBUF_TARGET variable across various modules (core, net, agent, z3ed).
- Ensured consistent use of the static MSVC runtime to align with vcpkg static triplets.
- Improved clarity in build logs by adding status messages for whole-archive linking conditions.

Benefits:
- Enhances modularity and compatibility of the build system with protobuf.
- Streamlines the build process for different platforms by ensuring appropriate linking based on configuration options.
2025-10-14 09:01:12 -04:00
scawful
6374da6194 refactor(gfx): reorganize graphics includes and introduce new types
- Updated include paths for various graphics-related headers to improve organization and clarity.
- Introduced new types for SNES color, palette, and tile management, enhancing the structure of the graphics subsystem.
- Refactored existing code to utilize the new types, ensuring consistency across the codebase.

Benefits:
- Improves maintainability and readability of the graphics code.
- Facilitates future enhancements and optimizations within the graphics subsystem.
2025-10-13 00:09:34 -04:00
scawful
9e5820a338 feat: Enhance graphics loading and editor synchronization
- Implemented default palette application during graphics data loading to ensure immediate visibility of graphics sheets.
- Refactored GraphicsEditor to queue texture creation without palette management, improving performance and clarity.
- Introduced NotifySheetModified method in Arena to handle texture updates across all editors, ensuring consistency in graphics rendering.
- Enhanced logging for better tracking of graphics sheet modifications and texture operations.
2025-10-09 11:18:43 -04:00
scawful
6c331f1fd0 epic: refactor SDL2_Renderer usage to IRenderer and queued texture rendering
- Updated the testing guide to clarify the testing framework's organization and execution methods, improving user understanding.
- Refactored CMakeLists to include new platform-specific files, ensuring proper integration of the rendering backend.
- Modified main application files to utilize the new IRenderer interface, enhancing flexibility in rendering operations.
- Implemented deferred texture management in various components, allowing for more efficient graphics handling and improved performance.
- Introduced new methods for texture creation and updates, streamlining the rendering process across the application.
- Enhanced logging and error handling in the rendering pipeline to facilitate better debugging and diagnostics.
2025-10-07 17:15:11 -04:00
scawful
b788d93071 refactor: Update Renderer Logic and Introduce Direct Pixel Access Methods
- Removed direct renderer calls from LoadLinkGraphics and LoadAllGraphicsData to prepare for future renderer refactor.
- Added LockTexture and UnlockTexture methods to IRenderer and SDL2Renderer for direct pixel access, enhancing texture management capabilities.
- Updated CMake configuration to include the new SDL2Renderer source file, ensuring proper integration within the graphics backend.
2025-10-07 14:39:36 -04:00
scawful
33f64f38a5 feat: Enhance Logging and Buffer Management in ROM and Editor Components
- Added critical logging for graphics buffer management in LoadAllGraphicsData to prevent data corruption during ROM loads.
- Updated logging levels from INFO to DEBUG across various components for consistency and to reduce log verbosity.
- Refactored texture creation and palette application logic to allow editors to manage their own rendering, improving flexibility and user experience.
- Improved background buffer handling to ensure fresh bitmap creation only when necessary, optimizing performance.
- Enhanced debugging output for canvas and performance tracking, aiding in better diagnostics during development.
2025-10-07 11:56:53 -04:00
scawful
7f71fd9e80 feat: Enhance ROM Loading with Validation and Disassembly Viewer Integration
- Added validation checks for ROM file existence and size constraints (minimum 32KB, maximum 8MB) during loading.
- Integrated a new disassembly viewer to track and display executed instructions, enhancing debugging capabilities.
- Updated CPU class to manage disassembly viewer instances, allowing for real-time instruction logging.
- Improved emulator's CMake configuration to include new source files related to the disassembly viewer.
- Enhanced pixel handling in the PPU to support BGRX format for better compatibility with SDL.
2025-10-06 21:49:12 -04:00
scawful
1c4a82ab7e Refactor logging system to use LOG_* macros
- Updated logging calls in main.cc, rom.cc, and test_manager.cc to utilize the new LOG_* macros for consistency and improved readability.
- Removed deprecated util::logf function and replaced its usage with appropriate logging macros.
- Enhanced logging in TestManager to provide more detailed information about ROM state and testing processes.
- Cleaned up commented-out logf calls in room.cc to streamline the code.
- Adjusted LogManager to support general logging through a new logf function for non-category specific messages.
2025-10-04 15:47:52 -04:00
scawful
02c6985201 feat: Enhance ROM loading options and proposal management
- Introduced `RomLoadOptions` struct to manage various loading configurations for ROM files, including options for stripping headers, populating metadata, and loading Zelda 3 content.
- Updated `Rom::LoadFromFile` and `Rom::LoadFromData` methods to accept `RomLoadOptions`, allowing for more flexible ROM loading behavior.
- Implemented `MaybeStripSmcHeader` function to conditionally remove SMC headers from ROM data.
- Added new command handler `RomInfo` to display basic ROM information, including title and size.
- Created `ProposalRegistry` class to manage agent-generated proposals, including creation, logging, and status updates.
- Enhanced CLI commands to support proposal listing and detailed diff viewing, improving user interaction with agent-generated modifications.
- Updated resource catalog to include new actions for ROM info and agent proposal management.
2025-10-01 18:18:48 -04:00
scawful
9d1845f997 Refactor ROM data handling and improve file saving logic
- Removed redundant copy operation in SaveAllGraphicsData.
- Updated SaveToFile to truncate existing content instead of appending, ensuring a clean write.
- Simplified error handling for file operations.
- Introduced dirty flag management in Write methods to track unsaved changes.
- Added getter and setter for dirty state in the Rom class.
2025-09-13 11:16:47 -04:00
scawful
fdda77c172 Refactor ROM handling and remove SharedRom singleton for improved architecture
- Eliminated the SharedRom class to enhance modularity and reduce global state management.
- Updated various classes to directly manage ROM instances, improving clarity and encapsulation.
- Added new functions for loading messages and colors from ROM, enhancing functionality.
- Refactored Canvas and Editor classes to utilize direct ROM references, streamlining interactions.
- Improved documentation and comments for better code understanding and maintainability.
2025-08-03 17:52:02 -04:00
scawful
b5f6930d38 Refactor window management and renderer integration for improved structure
- Replaced platform backend references with a dedicated Window class for better encapsulation of window and audio device management.
- Updated various files to include the new window header, enhancing clarity and reducing dependencies on the platform backend.
- Removed obsolete platform backend code to streamline the codebase and improve maintainability.
- Refactored controller and editor classes to utilize the new window management system, ensuring consistent handling of window creation and rendering.
2025-08-03 16:09:51 -04:00
scawful
095b3df27e Refactor graphics loading and decompression for consistency
- Updated various graphics loading functions to ensure consistent use of semicolons in ASSIGN_OR_RETURN statements.
- Changed set_filename method in Rom class to accept std::string_view for improved efficiency.
- Enhanced code readability and maintainability across multiple files by standardizing syntax.
2025-05-19 17:15:15 -04:00
scawful
8d34ebf534 Refactor ROM save functionality to use structured settings
- Introduced a new SaveSettings struct to encapsulate parameters for the SaveToFile method, improving clarity and maintainability.
- Updated SaveToFile method signature to accept SaveSettings instead of individual parameters.
- Adjusted SaveRom method in EditorManager to utilize the new SaveSettings struct for better parameter management.
- Removed redundant label loading from LoadFromFile when z3_load is true, streamlining the loading process.
2025-05-13 21:00:53 -04:00
scawful
f75830c06c Add LoadFontGraphics function and update Load2BppGraphics sheet IDs
- Introduced LoadFontGraphics function to handle font graphics loading from ROM data.
- Updated Load2BppGraphics to use hex sheet IDs.
2025-05-10 11:01:24 -04:00
scawful
11504ca4c1 Refactor Renderer access and enhance graphics loading functionality
- Replaced instances of Renderer::GetInstance() with Renderer::Get() for consistency across the codebase.
- Updated various rendering methods to streamline bitmap updates and enhance performance.
- Removed unused includes and comments to improve code clarity and maintainability.
2025-05-08 19:37:48 -04:00
scawful
53f1fa81f3 Refactor ROM class; introduce snes.h for address conversion utilities, enhancing code organization and maintainability. 2025-04-29 13:47:00 -04:00
scawful
114084ef95 Refactor ROM loading and saving methods for clarity and consistency; streamline filename handling, remove unused flags, and rename SaveGroupsToRom to SaveGfxGroups for better readability. 2025-04-29 10:27:35 -04:00
scawful
44e13cf4bb Refactor bitmap palette management across various components to streamline palette setting and improve error handling; remove unnecessary status checks and enhance consistency in palette application methods. 2025-04-17 21:49:47 -04:00
scawful
00d30efbf1 Add short name handling for ROMs in Rom class; update EditorManager to use short names in the ROM selector for improved UI clarity. 2025-04-16 17:33:48 -04:00
scawful
c99a4b0bc4 rename ApplyPalette with SetPalette 2025-03-02 17:06:46 -05:00
scawful
43fc52dec7 Refactor SnesToPc and PcToSnes functions for improved readability and consistency; remove redundant core:: namespace usage 2025-01-22 13:45:58 -05:00
scawful
de53ccae21 Refactor ExperimentFlags to FeatureFlags for consistency across the codebase 2025-01-22 13:41:28 -05:00
scawful
b245b10963 Refactor logging to use util::logf and add log utility header 2025-01-22 13:36:37 -05:00
scawful
50c9223a53 Add hex utility functions and refactor usage in editors 2025-01-22 13:28:21 -05:00
scawful
62e6157864 Refactor GetGraphicsAddress to return uint32_t and remove unnecessary namespace 2025-01-22 10:38:07 -05:00
scawful
809282edad remove nonstandard type aliases 2025-01-19 20:16:40 -05:00
scawful
339df53674 Refactor ROM loading methods 2025-01-18 12:33:33 -05:00
scawful
3fc52cce62 Add zelda.h for game version handling and refactor ROM version management 2025-01-18 00:45:44 -05:00
scawful
9c7f78a228 update z3_dungeon_room public data type internals 2025-01-06 15:48:36 -05:00
Justin Scofield
88198323b3 Refactor ROM handling and update Overworld methods
Updated MessageEditor, RoomEntrance, and Overworld classes to use WriteByte instead of Write for byte values. Refactored ROM class by removing Write and toint16 methods, moving constants, and updating operator[]. Modified Overworld methods to return absl::Status and handle errors. Updated Inventory and OverworldMap methods to use ReadWord instead of toint16.
2025-01-05 21:19:53 -05:00
Justin Scofield
fe0dbd3642 Refactor graphics sheet management with singleton class
Refactor the handling of graphics sheets by introducing a singleton class `GraphicsSheetManager`. This centralizes the management of graphics sheets, replacing direct access through the `Rom` object. Key changes include:

- Updated various methods across multiple classes to use `GraphicsSheetManager::GetInstance()` for accessing and manipulating graphics sheets.
- Introduced standalone functions `LoadLinkGraphics`, `LoadAllGraphicsData`, and `SaveAllGraphicsData` for loading and saving graphics data.
- Refactored the `Rom` class to remove methods and member variables related to graphics sheet management.
- Updated `OverworldEditor` to use `std::array` for `maps_bmp_` and added error handling for `std::bad_alloc` exceptions.
- Improved code modularity and error handling throughout the application.
2025-01-04 20:04:00 -05:00
Justin Scofield
8b54906a51 Merge branch 'master' of https://github.com/scawful/yaze 2024-12-31 19:21:24 -05:00
Justin Scofield
7b00e0838f Fix ROM title extraction in LoadZelda3 function
Resized the `title_` variable to `kTitleStringLength` to ensure it can hold the ROM title string. Used `std::copy` to copy the ROM title from `rom_data_` starting at `kTitleStringOffset` to `kTitleStringOffset + kTitleStringLength` into the `title_` variable. This change ensures that the `title_` variable correctly stores the ROM title extracted from the `rom_data_`.
2024-12-31 18:53:33 -05:00
scawful
308eb4b287 Rename Hyrule Magic compression functions; update deprecation notes 2024-12-31 18:20:18 -05:00
scawful
d3eca0f950 Make ExperimentFlags a singleton, remove inheritance relationships 2024-12-31 18:13:53 -05:00
scawful
54c170373b Change Load2BppGraphics to standalone fn, add mutable_data accessor 2024-12-29 09:58:58 -05:00
scawful
e05e7c35db remove app namespace 2024-12-28 21:28:51 -05:00
scawful
e3ed705336 Refactor tab handling in Dungeon and Graphics editors for improved readability 2024-11-13 09:42:54 -05:00
scawful
12309f460e Refactor SaveAllGraphicsData 2024-11-13 09:40:36 -05:00
scawful
6aadd51a2d Implement SaveAllGraphicsData function to handle graphics sheet saving 2024-11-13 09:30:55 -05:00
scawful
d6a4217118 Change gfx groups from vectors to arrays in Rom 2024-11-02 10:33:39 -05:00
scawful
b22da9edb4 Refactor Rom class to improve code organization and remove unused dependencies 2024-10-11 10:46:06 -04:00
scawful
52c844eb98 Add defer_render to LoadAllGraphicsData, overworld test 2024-08-29 22:45:50 -04:00
scawful
4099d8731d Refactor ROM class to use uint32_t for loop counters in LoadLinkGraphics, LoadAllGraphicsData, LoadGfxGroups, and SaveGroupsToRom methods 2024-08-22 01:28:04 -04:00
scawful
c83d0440d8 cleanup snes_palette stuff 2024-08-21 10:13:13 -04:00
scawful
a8ed9b7f92 remove magic numbers, enforce const correctness 2024-08-20 21:31:59 -04:00
scawful
49611d4944 big cleanup, replace Bytes alias with std::vector<uint8_t> to reduce ambiguity 2024-08-20 12:02:47 -04:00
scawful
97dda2bfd9 chore: Update ReadWritePreconditions for empty data but loaded file 2024-08-14 19:55:57 -04:00