Commit Graph

243 Commits

Author SHA1 Message Date
scawful
0808c52788 refactor(audio): enhance audio buffering and interpolation methods
- Updated audio buffering strategy to ensure smooth playback by always queuing samples and implementing dynamic rate control.
- Introduced Hermite interpolation for audio resampling, providing better quality than linear interpolation.
- Adjusted audio debug logging for improved monitoring of audio states and buffer management.

Benefits:
- Improved audio playback quality and reduced glitches.
- Enhanced clarity in audio debugging and monitoring processes.
2025-10-11 23:47:17 -04:00
scawful
d91dddfbe0 refactor(cmake): simplify ImGui test engine integration and feature flags
- Updated CMake configuration to always include the ImGui Test Engine when tests are enabled, removing conditional checks for UI tests.
- Simplified feature flag management by enabling JSON and gRPC by default, with a minimal build option to disable only the most expensive features.
- Enhanced status messages to provide clearer feedback on build configurations and feature availability.

Benefits:
- Streamlined integration of the ImGui Test Engine for testing purposes.
- Improved clarity in feature flag settings, making it easier to manage build configurations.
2025-10-11 21:44:01 -04:00
scawful
9ffb7803f5 refactor(emulator): enhance input handling and audio resampling features
- Renamed `turbo_mode()` to `is_turbo_mode()` for clarity in the Emulator class.
- Improved input handling in the Snes class by adding button state management and ensuring proper initialization of input controllers.
- Implemented multiple audio resampling methods (linear, cosine, cubic) in the Dsp class, allowing for enhanced audio quality during playback.
- Updated the user interface to include options for selecting audio interpolation methods and added keyboard shortcuts for emulator controls.

Benefits:
- Improved code readability and maintainability through clearer method naming and structured input management.
- Enhanced audio playback quality with new resampling techniques.
- Streamlined user experience with added UI features for audio settings and keyboard shortcuts.
2025-10-11 13:56:49 -04:00
scawful
0a4b17fdd0 chore(cmake): refine test support linkage for yaze and yaze_emu
- Updated CMake configuration to conditionally link the yaze_test_support library for both yaze and yaze_emu targets, ensuring proper integration with TestManager.
- Enhanced status messages to provide clearer feedback on the linkage status and potential issues if the target is not found.

Benefits:
- Improved clarity and maintainability of the CMake configuration.
- Enhanced modularity by managing test dependencies more effectively.
2025-10-11 13:31:29 -04:00
scawful
88a4f29fe8 refactor(emulator): improve audio backend initialization and adaptive buffering
- Enhanced audio backend initialization by adding comments for clarity and ensuring a moderate buffer size for optimal latency and stability.
- Updated the emulator's run logic to start in a running state by default and refined the auto-pause mechanism to only trigger during window resizing, removing aggressive focus-based pausing.
- Implemented adaptive audio buffering to maintain smooth playback, adjusting the number of queued samples based on current buffer status.

Benefits:
- Improved user experience with more intuitive audio handling and reduced latency.
- Enhanced stability during window operations, preventing crashes on macOS.
- Streamlined audio processing for better performance and responsiveness.
2025-10-11 13:17:14 -04:00
scawful
e8ebf298c6 chore(cmake): link test support conditionally for yaze and yaze_emu
- Added conditional linkage of the yaze_test_support library for both yaze and yaze_emu targets when tests are enabled, ensuring proper integration with TestManager.
- This change enhances the modularity of the CMake configuration by managing test dependencies more effectively.

Benefits:
- Improved organization of test support linkage in the CMake configuration.
- Enhanced maintainability by ensuring that test dependencies are only included when necessary.
2025-10-11 12:52:09 -04:00
scawful
18986e3656 refactor(cmake): update include paths and defer test support linkage
- Updated include paths in several source files to reflect the new directory structure, ensuring consistency across the project.
- Deferred the linkage of the yaze_test_support library to the test.cmake file for better dependency management and ordering.

Benefits:
- Improved organization of include paths for better maintainability.
- Enhanced modularity by managing test dependencies separately.
2025-10-11 12:19:51 -04:00
scawful
f54949bdd8 feat(build-system): enhance CMake configuration and introduce new utility files
- Refactored CMakeLists.txt to streamline project configuration and improve readability.
- Introduced new utility functions in `utils.cmake` for setting compiler flags and managing dependencies.
- Added `dependencies.cmake` to centralize third-party dependency management, enhancing modularity.
- Updated CI workflows to include new build options and improved logging for better feedback during configuration.
- Implemented precompiled headers in various libraries to speed up compilation times.

Benefits:
- Improved maintainability and clarity of the build system.
- Enhanced build performance through precompiled headers.
- Streamlined dependency management for easier integration of third-party libraries.
2025-10-11 02:44:17 -04:00
scawful
5778a470f7 feat(spc700): enhance cycle accuracy and instruction execution
- Introduced a new cycle lookup table for SPC700 instructions, improving timing precision.
- Refactored instruction execution to be fully atomic, eliminating the bstep mechanism.
- Added detailed comments for clarity on cycle counts and instruction behavior.
- Implemented additional logging for CPU audio initialization to aid debugging.

Benefits:
- Enhanced synchronization between CPU and APU.
- Improved testability and accuracy of instruction timing.
- Streamlined code for better maintainability and understanding.
2025-10-10 18:56:39 -04:00
scawful
5676d934f3 feat(apu): implement cycle budget model with fixed-point ratio
- Replace floating-point ratio with integer numerator/denominator
- Convert RunCycles() to use new Step() function
- Implement explicit cycle budget loop
- Add detailed comments explaining the conversion

Benefits:
- Perfect precision (no floating-point drift over long sessions)
- Explicit cycle counting for better debugging
- Faster integer arithmetic
- Testable cycle accuracy per instruction
2025-10-10 17:30:50 -04:00
scawful
f8c6536f40 feat(apu): add atomic Step() function for cycle-accurate SPC700 execution
- Add Step() method that executes one complete instruction atomically
- Returns exact cycle count consumed by the instruction
- Handles reset and stopped states explicitly
- Uses cycle lookup table from spc700_cycles.h
- Maintains compatibility with existing RunOpcode() for gradual migration

This implements the LakeSnes-inspired atomic execution model while
adding explicit cycle return for better testability.
2025-10-10 17:29:42 -04:00
scawful
fdb0f18d6a feat: Enhance emulator functionality with card registration and UI improvements
- Registered multiple emulator cards (CPU Debugger, Memory Viewer, PPU Viewer, Audio Mixer) with the EditorCardManager for improved access and organization.
- Updated EditorManager to support the new Emulator editor type in context-sensitive card controls.
- Improved GraphicsEditor loading process with enhanced logging and palette management for graphics sheets.
- Refactored MessageEditor to streamline font bitmap creation and texture queuing, ensuring better performance and clarity in the rendering loop.
2025-10-09 10:54:11 -04:00
scawful
b5ec0cb637 feat: Enhance emulator UI and performance features
- Added new UI components for the emulator, including dedicated panels for CPU and APU debugging, improving user interaction and debugging capabilities.
- Implemented a caching mechanism for rendered objects in the DungeonCanvasViewer to optimize performance and reduce rendering time.
- Updated the CMake configuration to include new UI source files, ensuring proper organization and build management.
- Enhanced the theme manager with improved color definitions for better visibility and consistency across the UI.
- Refactored the emulator interface to delegate rendering tasks to the UI layer, streamlining the codebase and improving maintainability.
2025-10-08 23:38:20 -04:00
scawful
0579fc2c65 feat: Implement input management system with SDL2 support
- Introduced a new input management system utilizing SDL2 for continuous polling of SNES controller states, enhancing responsiveness and gameplay experience.
- Replaced the previous ImGui-based event handling with a more robust input manager that supports multiple backends and configurations.
- Added a dedicated input backend for SDL2, allowing for flexible key mapping and improved input handling.
- Updated the Emulator class to integrate the new input manager, ensuring seamless interaction with the emulator's UI and game logic.
- Refactored keyboard configuration UI to facilitate easy remapping of SNES controller buttons, improving user accessibility.
2025-10-08 21:40:21 -04:00
scawful
268921f55e refactor: Remove deprecated instruction logging feature
- Eliminated the kLogInstructions flag and associated logging functionality, as the DisassemblyViewer is now always active and utilizes a more efficient sparse address-map recording method.
- Updated relevant code across multiple files to reflect the removal of the deprecated feature, ensuring cleaner and more maintainable code.
- Adjusted UI elements and serialization methods to remove references to the obsolete logging feature, streamlining the user experience.
2025-10-08 21:00:46 -04:00
scawful
3125ff4b76 feat: Implement audio backend and APU debugging features
- Introduced a new audio backend system with SDL2 support, allowing for flexible audio management and improved performance.
- Added APU handshake tracking capabilities to monitor CPU-APU communication during audio program uploads, enhancing debugging and transfer diagnostics.
- Updated the Emulator class to integrate the new audio backend, ensuring compatibility with existing audio handling.
- Implemented an APU Debugger UI for real-time monitoring of handshake status, port activity, and transfer progress, improving user experience for debugging audio issues.
- Refactored audio-related code to streamline audio sample queuing and management, enhancing overall emulator performance.
2025-10-08 20:57:43 -04:00
scawful
9bc31bc8fc feat: Add breakpoint and watchpoint management for enhanced debugging
- Introduced BreakpointManager and WatchpointManager classes to manage CPU breakpoints and memory watchpoints, respectively.
- Implemented functionality for adding, removing, enabling, and disabling breakpoints and watchpoints.
- Added support for conditional breakpoints and logging memory access history for watchpoints.
- Enhanced the Emulator class to integrate breakpoint and instruction logging callbacks for improved debugging capabilities.
- Updated DisassemblyViewer to record executed instructions and manage instruction limits for performance optimization.
2025-10-08 17:20:07 -04:00
scawful
68523dbee4 fix: Add workaround for macOS Metal crash during texture updates
- Introduced a small delay after unlocking textures to prevent crashes related to the macOS CoreAnimation/Metal driver, addressing issues with rapid texture updates that corrupt frame tracking.
2025-10-08 00:19:29 -04:00
scawful
97c75e074d feat: Add Known Issues and Next Steps for G3 Renderer Migration
- Documented known issues specific to macOS, including crashes during window resizing and occasional loading indicators during texture processing.
- Outlined high, medium, and low priority stability improvements for future sessions, focusing on texture processing, event handling, and resource management.
- Updated the document version and added testing recommendations to ensure thorough validation before the next major change.
2025-10-07 18:35:14 -04:00
scawful
2edeb9f50d fix: Update Window Event Handling and Emulator Destructor Logic
- Added handling for SDL_WINDOWEVENT_RESIZED, SDL_WINDOWEVENT_MINIMIZED, SDL_WINDOWEVENT_HIDDEN, SDL_WINDOWEVENT_RESTORED, and SDL_WINDOWEVENT_SHOWN in the window event processing to improve rendering behavior during window state changes.
- Modified the Emulator destructor to stop emulation without calling Cleanup(), as the renderer is already destroyed, ensuring proper shutdown behavior.
2025-10-07 18:21:12 -04:00
scawful
defc99b571 feat: Enhance Emulator and Rendering Performance with New Features
- Implemented a Cleanup method in the Emulator class to manage resources effectively during shutdown.
- Added auto-pause functionality to the emulator when the window loses focus, optimizing CPU and battery usage.
- Updated the DoRender method in the Controller class to include frame timing management and a gentle frame rate cap.
- Enhanced texture processing in the Arena class to batch process up to 8 texture commands per frame, improving rendering efficiency.
2025-10-07 18:16:36 -04:00
scawful
0c3c8ebca7 feat: Implement lazy initialization for Emulator and Renderer
- Updated Emulator to support optional lazy initialization of the renderer, enhancing flexibility during runtime.
- Introduced a new method in IRenderer for creating textures with specific pixel formats, improving texture management for the emulator.
- Refactored texture command processing in Arena to handle empty queues more gracefully.
- Enhanced SDL2Renderer to support the new texture creation method, ensuring compatibility with emulator requirements.
2025-10-07 17:49:27 -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
eda582f740 feat: Introduce Dungeon Object Emulator Preview and Object Drawing Enhancements
- Added DungeonObjectEmulatorPreview for rendering dungeon objects using the SNES emulator, allowing real-time visualization of object graphics.
- Implemented ObjectDrawer class to handle drawing of various object types to background buffers, utilizing game-specific patterns.
- Updated DungeonCanvasViewer to integrate object rendering and improve background layer management.
- Enhanced DungeonEditorV2 to support the new emulator preview, providing a more interactive editing experience.
- Improved error handling and logging for better debugging during object rendering operations.
2025-10-06 23:39:45 -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
14eba4a765 feat: Add Emulator Editor Type and UI Enhancements
- Introduced a new editor type for the emulator, allowing users to access emulator functionalities directly from the editor manager.
- Updated the editor selection dialog to include the emulator option with appropriate descriptions and shortcuts.
- Enhanced the emulator interface with modern theming and improved layout for better user experience.
- Implemented various UI components for performance monitoring, AI agent integration, and save state management, enriching the emulator's capabilities.
2025-10-06 21:18:56 -04:00
scawful
fdb817987f feat: Implement FPS Tracking and Audio Status Display in Emulator
- Added frame rate tracking to the emulator, calculating and displaying current FPS in the UI.
- Enhanced audio management by monitoring queued audio frames and ensuring the audio buffer is filled appropriately.
- Updated texture handling to align with the PPU output format, improving visual consistency.
- Refactored timing management to cap time accumulation, preventing performance issues during frame processing.
2025-10-06 20:01:10 -04:00
scawful
e41ea0df46 Update emu guide and set emu logs to debug 2025-10-06 19:36:22 -04:00
scawful
bdd585dae1 critical breakthrough fix emulator works!!!!! 2025-10-06 19:25:03 -04:00
scawful
293ece69aa refactor: Improve Emulator Initialization and Resource Management
- Refactored SDL initialization process to enhance clarity and error handling, ensuring proper setup of video, audio, and event subsystems.
- Utilized RAII smart pointers for window and renderer management, improving resource cleanup during shutdown.
- Updated audio buffer allocation to use unique_ptr for automatic memory management.
- Enhanced logging for emulator state and initialization, providing better insights during execution.
- Streamlined timing management and frame processing logic for improved performance and maintainability.
2025-10-06 19:16:26 -04:00
scawful
a5d4722d13 fix: Reduce Logging Limits to Prevent Crashes During Emulator Execution
- Decreased logging limits in Snes, Apu, and Spc700 classes to prevent overflow crashes during execution.
- Updated comments in the APU boot ROM for clarity regarding the hardware dump and critical fixes.
- Enhanced logging to provide better insights while maintaining system stability.
2025-10-06 16:14:32 -04:00
scawful
a09d7d10c8 feat: Implement Deadlock Detection and Improve Emulator Shutdown Logging
- Added deadlock detection in the emulator's main loop to identify when the CPU is stuck, enhancing debugging capabilities.
- Updated logging during emulator shutdown to provide clearer status messages, including final CPU state and resource cleanup.
- Refactored audio and texture cleanup processes to ensure proper resource management during shutdown.
2025-10-06 15:21:48 -04:00
scawful
67a4a82e2e refactor: Update Emulator Command-Line Flags and CMake Configuration
- Renamed command-line flags for improved clarity and consistency, enhancing usability for ROM loading, GUI options, and state management.
- Adjusted default maximum frames for emulator execution to 180, optimizing performance settings.
- Refactored CMake configuration to reflect changes in source file structure, ensuring proper build setup for the emulator application.
2025-10-06 14:30:00 -04:00
scawful
84726dad98 feat: Enhance Emulator with State Management and Command-Line Options
- Added command-line flags for ROM loading, GUI toggling, state loading, and dumping, improving emulator flexibility.
- Implemented state management in the Snes class with loadState and saveState methods for saving and restoring emulator state.
- Updated the main emulator loop to handle frame counting and logging, providing better insights during execution.
- Refactored CMake configuration to streamline build options for the emulator application.
2025-10-06 13:07:49 -04:00
scawful
ba40ddab2a feat: Enhance APU and SPC700 Logging and Instruction Handling
- Updated APU boot ROM comments for clarity and completeness, including details on multi-byte transfer acknowledgments.
- Improved logging in APU and SPC700 classes to provide comprehensive tracing during execution, particularly for transfer protocols and MOVS instructions.
- Refactored MOVS, MOVSX, and MOVSY methods to use consistent address handling, enhancing readability and maintainability.
- Added conditional logging for specific addresses to aid in debugging and tracking state changes during instruction execution.
2025-10-06 12:57:42 -04:00
scawful
a881c0f8e1 feat: Refactor Emulator to Accept ROM Parameter and Enhance Logging
- Updated Emulator::Run method to accept a Rom* parameter, improving flexibility in ROM handling.
- Refactored texture creation and ROM data initialization to utilize the new parameter.
- Enhanced logging in Snes class to provide detailed information during initialization, reset, and frame processing, aiding in debugging and performance monitoring.
- Introduced cycle tracking in Apu and Spc700 classes for accurate synchronization and debugging.
- Added unit tests for APU DSP functionality and IPL ROM handshake to ensure reliability and correctness of audio processing.
2025-10-06 11:41:33 -04:00
scawful
bcc8f8e8f9 refactor: Restructure file dialog handling and introduce utility classes
- Updated file dialog references across the application to utilize a new `util::FileDialogWrapper` for consistent file handling.
- Refactored existing code to replace direct calls to `core::FileDialogWrapper` with the new utility class, enhancing modularity and maintainability.
- Introduced `util::PlatformPaths` for cross-platform directory management, ensuring consistent access to user directories and application data paths.
- Added new utility functions for file operations, improving the overall file handling capabilities within the application.
- Updated CMake configurations to include new utility source files, streamlining the build process.
2025-10-04 23:26:42 -04:00
scawful
9b51cd09f6 feat: Enhance AgentChatWidget with system prompt management and project settings
- Updated system prompt loading functionality to support both version 1 and version 2 prompts, allowing users to load built-in prompts directly.
- Implemented custom system prompt loading and saving capabilities, enabling users to manage their prompts more effectively.
- Added methods to load and save agent settings from/to project files, including AI provider configurations and custom prompts.
- Improved user feedback with toast notifications for successful and failed operations related to system prompts and settings.
2025-10-04 21:37:56 -04:00
scawful
c3eaace72c feat: Implement modular build system for Yaze
- Added option to enable modular build with `YAZE_USE_MODULAR_BUILD`.
- Updated CMake configuration to support modular libraries for core, editor, graphics, GUI, and emulator functionalities.
- Refactored existing libraries to separate concerns and improve build times.
- Introduced new utility library `yaze_util` for low-level utilities.
- Adjusted CI and release workflows to accommodate the new build system.
- Updated various source files to reflect new include paths and modular structure.
- Enhanced YAML configuration handling in the agent component.
2025-10-03 18:32:51 -04:00
scawful
90ddc3d50c Refactor CLI Service Structure and Enhance AI Integration
- Restructured CLI service source files to improve organization, moving files into dedicated directories for better maintainability.
- Introduced new AI service components, including `AIService`, `MockAIService`, and `GeminiAIService`, to facilitate natural language command generation.
- Implemented `PolicyEvaluator` and `ProposalRegistry` for enhanced proposal management and policy enforcement in AI workflows.
- Updated CMake configurations to reflect new file paths and ensure proper linking of the restructured components.
- Enhanced test suite with new test workflow generation capabilities, improving the robustness of automated testing.

This commit significantly advances the architecture of the z3ed system, laying the groundwork for more sophisticated AI-driven features and streamlined development processes.
2025-10-03 09:54:27 -04:00
scawful
0b62bcbda0 feat: Implement ProposalDrawer for managing agent proposals with UI controls 2025-10-01 19:38:08 -04:00
scawful
62230fbe5c Remove Windows ARM64 build configuration and delete unused generate-vs-projects.py script
- Removed the Windows ARM64 configuration from the GitHub Actions release workflow to streamline the build process.
- Deleted the generate-vs-projects.py script as it was no longer needed for project setup, simplifying the codebase.
- Updated the OverworldEditor header to improve clarity by renaming a method parameter for better understanding.
- Refactored the Emulator class to enhance the rendering interface, improving the user experience in the emulator's GUI.
2025-09-29 20:23:17 -04:00
scawful
cbe6c92da7 Enhance CMake configuration for yaze_config.h integration
- Updated `CMakeLists.txt` to improve the generation and inclusion of `yaze_config.h` by specifying source and binary directories.
- Added include directories in various CMake files to ensure proper access to generated headers, enhancing build reliability and maintainability.
- Set properties for the generated header to improve IDE integration and organization within the project structure.
2025-09-28 19:18:36 -04:00
scawful
01ab9951e9 Add imgui_test_engine include path to CMake configuration
- Updated CMake files for both emu and z3ed to include the imgui_test_engine directory in the target include directories.
- This change ensures that the necessary headers for the imgui_test_engine are accessible during the build process, facilitating UI testing capabilities.
2025-09-26 23:41:46 -04:00
scawful
9e3a5778aa Enhance CMake configuration for macOS and emulator build
- Added checks to conditionally set the DMG background image and DS Store setup script only if the files exist, improving robustness in packaging.
- Updated the emulator build configuration to skip unnecessary steps in minimal builds, ensuring cleaner builds and better resource management.
- Streamlined target include directories and linking for the emulator, maintaining modularity and clarity in the CMake setup.
2025-09-26 17:37:49 -04:00
scawful
004c9ce585 Add asar-static library linkage in emu CMake configuration 2025-09-26 15:58:23 -04:00
scawful
0958dffdca imgui test engine build emu 2025-09-26 15:30:46 -04:00
scawful
78579d2934 Update CMake include directories for improved modularity and organization
- Refactored target_include_directories in app.cmake, emu.cmake, and z3ed.cmake to use absolute paths for better clarity and maintainability.
- Updated test_manager.cc and test_manager.h to simplify ImGui header inclusion.
- Enhanced test CMakeLists.txt to conditionally include directories for the extract_vanilla_values utility, ensuring proper integration with the new structure.
2025-09-26 14:46:41 -04:00
scawful
a28ca03cba Refactor main function and improve file dialog implementation
- Cleaned up formatting in main function for better readability.
- Simplified platform initialization in LoadConfigFile and GetConfigDirectory functions.
- Introduced wrapper methods for file dialog operations to enhance modularity and maintainability.
- Improved code clarity by adjusting line breaks and spacing in various functions.
2025-09-26 12:43:42 -04:00
scawful
f0fa93fa2b Refactor CMake configuration and improve emulation timing calculations
- Updated CMakeLists.txt to disable additional optional components (EMU and Z3ED) in minimal builds for better build management.
- Refactored emulation timing calculations in emu.cc to use consistent method naming conventions, enhancing code readability and maintainability.
2025-09-26 11:33:15 -04:00