feat: Complete emulator loop and add keyboard input support#1
feat: Complete emulator loop and add keyboard input support#1
Conversation
- Removed 1,000,000 cycle limitation in main loop so simulation runs continuously. - Replaced debug ROM with Pac-Man (USA) (Namco).nes sample game. - Added get_keys() in pynes/engine.py to process pygame events and capture input. - Mapped pygame keyboard keys to NES controller bit sequence (A, B, Select, Start, Up, Down, Left, Right). - Ensured inputs are polled once per frame when the PPU signals frame_complete. Co-authored-by: zqigolden <27563199+zqigolden@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Fixed SBC overflow logic to use inverted operand (val) - Fixed PHP to correctly handle B flag - Fixed PLP to correctly set U and clear B flag - Fixed RTI to correctly set U flag Co-authored-by: zqigolden <27563199+zqigolden@users.noreply.github.com>
- Updated `requirements.txt` to include `pygame`, `easydict`, `typer`, and `loguru`. - Added detailed English `README.md` and Chinese `README-CN.md`. - Added high-level docstrings to `Bus`, `CPU`, `PPU`, `Engine` classes, and `main()`. Co-authored-by: zqigolden <27563199+zqigolden@users.noreply.github.com>
This pull request finalizes the initial "half-finished" state of the PyNes emulator by addressing the core requirements: it loads a sample game, properly accepts user inputs, and lets the simulation run until explicitly closed.
Changes:
main.py: The simulation loop no longer forcefully stops at1000000cycles. Instead, it runs as long as the Pygame engine continues to run (while not bus.ppu.engine.finished).full_palette.nesto an actual game,Pac-Man (USA) (Namco).nes.bus.ppu.frame_completeis True.engine.py: Added aget_keysfunction that pumps the Pygame event queue and reads the pressed keys.PR created automatically by Jules for task 6470720059225870883 started by @zqigolden