Skip to content

Conversation

@arekkusu42
Copy link
Contributor

This PR cleans up more of the Apple IIc:

  • apple2e: IIc does not have internal gameio
    Before this PR, mame [apple2c*, las128*] -listslots shows:
apple2c          gameio           compeyes         Digital Vision ComputerEyes
                                  gizmo            HAL Labs Gizmo
                                  joy              Apple II analog joysticks
                                  paddles          Apple II paddles

The compeyes and gizmo devices require annunciators; even if they are connected via an adaptor, they can't function on real hardware. This commit applies the existing joystick_options from the tk3000 to the IIc (and other Laser clones without internal gameio ports.)

  • apple2e: remove c000_iic_w()
  • apple2e: collapse c000_iic_r()
    These two commits remove 200+ lines of copy-paste. This exposed bugs with unconnected joysticks, Zip Chip registers, and RDIOUDIS/RDHIRES side-effect behaviors. I wrote unit tests, which fail in 0.281:
PDLTest_apple2c_before

PDLTest_251019.zip

After this PR the side-effects match the behavior verified second-hand on IIc hardware:
PdlTest_apple2cfr_HW
(...but the main motivation for this cleanup is that a future PR is going to add 100 lines of Zip Chip emulation that I would rather not copy-paste.)

  • apple2e: fix IIc VBL behavior
    It looks like this has been broken since MESS integration? The IIc Technical Ref has wrong information, but it was corrected in Apple IIc Technical Note #9.

  • apple2e: fix IIc C04x readback
    The previous SWITCHES test now more closely matches results from IIc hardware:
    Switches_apple2cfr_HW

  • apple2e: remove redundant m_cassette_out
    This doesn't affect the IIc, but was noticed by inspection. Previously, mixing reads and writes to C020, or mixing writes to C020 and C02X would have behaved strangely on the IIe, because there were two sets of state tracked (and also m_cassette_out wasn't in the save state.) Sanity test LOAD via apple2e -cass Choplifter.lo.wav continues to work.

Followup mamedev#14307: the IIc (and clones based on this form factor)
do not have an internal 16-pin gameio port, and the annunciators
are not routed to the external joystick connector, thus devices
such as gizmo and compeyes can't work.
Only C078-7F have IIc-specific behavior.  Handle them in common
c000_w, to reduce copy-paste.  Three functional changes:
* Zip Chip C058-5F now work in a non-plus IIc
* Zip Chip C058-5F now side-effect annunciators on the IIe
* C07X now side-effect paddle timers and VBL interrupt on the IIc
Following the pattern of c000_laser_r(), reduce c000_iic_r() to
the minimum set of IIc-specific softswitches and rely on c000_r()
for the rest.  Three functional changes:
* unconnected joysticks now read properly (8021d6b missed the IIc)
* Zip Chip C05B now works the same on the IIc and the IIe
* RDIOUDIS/RDDHIRES now side-effect paddle timers and VBL interrupt
C019 on the IIc behaves quite differently than the IIe or IIgs;
it does not signify that the beam is in VBL, rather it signifies
that a VBL IRQ has fired.  This happens when the beam reaches VBL,
but only if C05B ENVBL is set, and C019 remains set until manually
cleared via accessing C07X.  This is similar to how C041 and C047
work on the IIgs.

Also fix a logic error in laser_mouse_r() breaking VBL polling.
Fix C04x to return the floating bus in the low 7 bits, matching
behavior verified on hardware.
C020 now works identically reading or writing, the same as apple2.
@rb6502 rb6502 merged commit a8dc1e9 into mamedev:master Oct 21, 2025
6 checks passed
@arekkusu42 arekkusu42 deleted the apple2-iic branch October 21, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants