Supermodel3-PonMi Edition GUI Full Rewrite:Work in progress.
2025/01/31 update
🏁 Release: Custom Widescreen Overlay Support
We are excited to introduce a dynamic Widescreen Overlay system, allowing users to restore the authentic arcade atmosphere on modern displays.
Feature Highlights:
- Seamless PNG Integration: The emulator now supports custom external overlays. When
widescreen = on, the system automatically renders a PNG image as a top-layer overlay. - Smart Filename Mapping: To ensure cross-platform compatibility, the system looks for PNG files where spaces in the game title are replaced with hyphens (e.g.,
magical-truck-adventure.png).
How to Use:
- Enable
widescreen = onin your configuration. - Create an
/imagefolder in the root directory. - Place your artwork in the folder using the hyphenated naming convention:
- Example: Spikeout Final Edition →
Spikeout-final-edition.png - Example: Scud Race →
Scud-race.png
- The system will automatically detect and display the overlay during gameplay.
⚠️ Network Status & Call for Testers
Project Status: Testing Phase
Currently, no binaries will be distributed as network stability testing is still ongoing. The source code is provided for technical verification and collaborative testing.
Current Test Results:
- 2-Link (Internet): Multiple reports confirm a significant improvement in responsiveness and stability during 1-on-1 internet play.
- 4-Link (RadminVPN): Results are inconsistent. While 4-link play is fully successful and stable in my local environment, some testers report failures when using RadminVPN.
- The Challenge: I have been unable to reproduce these 4-link failures in my own controlled environment. The cause is currently unknown—it may stem from external network jitter, routing overhead, or specific VPN configurations.
Seeking More Testers:
To isolate the cause of the 4-link synchronization issues, we need more data from diverse network environments.
- RadminVPN Users: Note that port forwarding is not required when using RadminVPN.
- How to help: If you have the environment to test 4-link play, please join our community.
Join our Community:
For real-time coordination, feedback, and technical discussion, please join us on Discord.
🏎️ Technical Report: Extreme Optimization of the Model 3 Network Stack
📝 1. Executive Summary
This project focuses on eliminating communication bottlenecks within the Sega Model 3 emulator's Pure Synchronous (Lockstep) architecture. By aggressively optimizing the existing TCP stack, we have successfully reduced software-induced latency to near-zero—leaving only the physical Network Round-Trip Time (RTT) as the limiting factor. Additionally, we achieved a bandwidth reduction of up to 90% through advanced data encoding. You will clearly experience the impact of these optimizations during link play over the Internet. 🚀
⚠️ 2. Background & Challenges
The Model 3's architecture employs a strict lockstep synchronization model, where the engine cannot render the next frame until data from all participants has arrived. This design makes the system highly sensitive to:
- TCP Protocol Latency: Default Nagle’s Algorithm overhead. 🐢
- Processing Overhead: Microsecond-level jitter caused by redundant memory copying and inefficient polling.
- Bandwidth Bottlenecks: Network congestion caused by raw CommRAM (shared memory) data transfers, particularly in data-heavy titles. 📦
🛠️ 3. Key Optimizations
⚡ 3.1. Transport Layer Latency Reduction
- Total Elimination of Nagle’s Algorithm: Forced immediate dispatch of small input packets by applying
TCP_NODELAY. - Strategic Blocking I/O: Replaced polling-based monitoring (Sleep-based loops) with optimized blocking calls. This allows the OS to wake the thread the instant a packet arrives, minimizing the gap between reception and processing. 🔔
🧬 3.2. Protocol Engineering
- Fixed 8-byte Header Protocol: Defined a custom header containing
[Compressed Size]and[Original Size]. This ensures the TCP stream is reconstructed into "logical packets" with maximum speed and reliability. - Atomic Packet Packing: Combined headers and payloads into a single contiguous memory buffer before transmission to reduce system call overhead.
📉 3.3. Delta Encoding & Adaptive Compression
- Delta Encoding (XOR-based): Only the difference between the current and previous frame is extracted. This effectively eliminates the transmission of static memory areas (e.g., background data).
- Real-time zlib Compression: Implemented dynamic compression triggered by an MTU-aware threshold (1500 bytes). This significantly lightens the load for data-intensive titles like Dirt Devils. 🍃
💎 3.4. Throughput & Memory Optimization
- Zero-copy Reception Architecture: Eliminated redundant memory copies from the receive buffer to application memory. Data is landed directly from the OS socket buffer into the target application buffer.
- Static Memory Pooling: Eliminated per-frame memory allocation (
malloc/free) in favor of pre-allocated static buffers, eradicating erratic frame spikes.
🏆 4. Evaluation & Results
The following improvements were observed following the implementation of these optimizations:
- Internal Latency Reduction: Software-induced overhead—previously estimated at approximately 5ms due to OS context switching and standard TCP buffering—has been reduced to under 1ms. This optimization ensures that the application remains responsive even within the strict 16.6ms window required for 60FPS.
- Communication Stability: Jitter within the 16.6ms frame window was suppressed to the microsecond level.
- Cross-Title Compatibility: Confirmed stable, high-speed synchronization across various titles with differing CommRAM sizes, including Spikeout, Dirt Devils, and Ski Champ. 🎮
🏁 5. Conclusion
In a pure synchronous model like the Model 3, this project demonstrates that a meticulously tuned TCP stack is superior to a generic UDP implementation. By maintaining TCP’s inherent order and arrival guarantees while stripping away implementation inefficiencies, we have achieved a low-latency environment that closely mimics a physical link cable. ✨
📢 Important Notice
- Development Report: This project is primarily a technical report regarding network optimization and synchronization.
- No Binaries Provided: To respect intellectual property and focus on the engineering aspect, no pre-compiled binaries will be distributed.
"This is not just an emulation. It's a 25-year-old dream synchronized across the modern web at the speed of light."
