Repository navigation
MZ-800 joysticks: strobe on 8255 PA4 (joy 1) and PA5 (joy 2) - #23
Conversation
mz_joy800 lowered PA5 for joy 1 and PA6 for joy 2. The MZ-800 Service Manual (8255 table, 4-7 Joystick) assigns PA4 to joystick 1 and PA5 to joystick 2, active low; the ROM's @joyin writes CFh. With the old values a real MZ-800 reads FFh on both ports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfaMrBqpK7kyqn5PJoxRUq
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Good catch @mlukasek, thanks for the PR! |
On a real MZ-800 the joysticks did not work in BomberNet: both ports read FFh.
mz_joy800lowers the wrong 8255 port A bit before the read.Change
c/platform/mz/plat_mz.c,mz_joy800: joy 1 strobe0xDF->0xEF(PA4 low), joy 2 strobe0xBF->0xDF(PA5 low). The comment above the function cites the source.PLAN.md: "port A bit 5/6" -> "bit 4/5".The MZ-800 Service Manual assigns PA4 to the joystick-1 strobe and PA5 to the joystick-2 strobe, both active low (section 4-3, 8255 table; section 4-7 Joystick: "Low active strobes are issued through PA4 (JOY1) of the 8255 and PA5 (JOY2)"). The ROM's
@JOYINwritesCFh, both low. With the old values the code read F0h while strobing joystick 2 (PA5), and F1h while strobing nothing (PA6 is not connected), so the switches never reached the bus.Earlier versions of mz800emu returned the stick state regardless of the strobe, which is why the emulator tests passed.
Testing
STICK/STRIGworked with the same adapter before the fix, while BomberNet did not.+mzprogram reads the ports with themz_joy800sequence while the emulated stick holds all directions and fire. JOY1:DFhreads nothing,EFhreads everything,CFheverything,FFhnothing. JOY2:BFhnothing,DFheverything.🤖 Generated with Claude Code
https://claude.ai/code/session_01QfaMrBqpK7kyqn5PJoxRUq
Summary by CodeRabbit