How peberlein/bulwip works
Main Components to Include:
Core Emulation Layer
• CPU Emulator (represented by cpu.c/cpu.h)
• GPU Emulator (gpu.c)
• Sound Chip Emulator (part of the system emulation)
• Memory Management System
Input/Output Layer
• SDL2 Interface (sdl.c)
• User Interface (ui.c)
• Input Handler (keyboard mappings)
Storage Components
• ROM/GROM Loader
• Cartridge Management System
• SAMS Banking (1MB)
Debug Infrastructure
• Debugger Interface
• Breakpoint Management
• Memory Viewers
• Listing Parser
Use a Layered Architecture Approach
• Blue: Core Emulation Components
• Green: I/O Systems
• Yellow: Storage Systems
• Red: Debug Infrastructure
Specific Implementation Details
• CLZ-based opcode decoding system
• Memory access function pointer system (per 256 bytes)
• 16-bit word memory architecture
• NTSC-CRT subsystem (from the NTSC-CRT directory)
• Component name
• Key responsibilities
• Interface points
• Important optimizations (like instruction loop design)
External Dependencies
• SDL2 library
• ROM/GROM file requirements
• Cartridge file formats
[User Interface Layer]
• ↑↓
[Input/Output Layer]
• ↑↓
[Core Emulation Layer]
• ↑↓
[Storage Layer]
Special Considerations:
Performance Optimizations
• How the instruction loop is contained in a single function
• Register usage optimization
• Memory access optimization strategy
Debug Integration
• How the debugger interfaces with all layers
• Breakpoint system integration
• Memory viewing pathways