Skip to content

victor9k: Fix very slow floppy disk performance #13583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

donohoe00
Copy link
Contributor

  • Removed support for the 8048 SCP for the sake of simplicity and maintainability (further rationale in the commit msg)
  • Mimic the SCP reset behaviour, now that the SCP is no longer present
  • Fixes around the reading of signals which can be output by both the SCP and the VIAs

Result is a big speedup: retries/timeouts that were happening previously do not occur, and the system now seems to perform as expected.

@cuavas
Copy link
Member

cuavas commented Apr 24, 2025

I think we’d rather have the 8048 emulation fixed properly rather than removed altogether. We prefer to emulate stuff in more detail where possible, and this should be within MAME’s current capabilities.

@rb6502
Copy link
Contributor

rb6502 commented Apr 25, 2025

I agree, it oughta be possible to get it to work while actually running the 8048. I can probably be convinced to merge this as-is if you'd agree to make another attempt with the 8048 though. We can help you with the MAME-specific details there. I have way more experience syncing things with 8-bit microcontrollers in MAME than anyone ought to, and Vas is good at that sort of thing too.

@donohoe00
Copy link
Contributor Author

I did disassemble the 8048 ROM code (that's how I discovered that some of the signals could be either inputs or outputs), but when it comes to understanding and debugging the servo algorithm, I think I'm in over my head. TBH there's also a motivation issue, since getting the 8048 working properly won't lead to any discernible change in the behavior of the emulated machine :-)

What I'd be willing to do however is see if I can come up with a more targeted fix for the slowness issue by addressing the register reading of the problematic signals, without touching anything related to the 8048.

@donohoe00 donohoe00 force-pushed the victor9k_fdc_perf branch from 697b2fb to 80f33d4 Compare May 1, 2025 21:12
@donohoe00
Copy link
Contributor Author

I've pushed a new, more minimal set of changes, which are functionally equivalent to the old ones, but do not remove any 8048 related code. This leaves the door open to debugging and fixing the drive control algorithm in the future.

@donohoe00 donohoe00 marked this pull request as draft May 6, 2025 12:14
@donohoe00
Copy link
Contributor Author

Converted to draft since I'm making progress on the 8048-related issues.

- Polarity of the reset signal was incorrect
- Hold the 8048 in reset as long as the reset signal is asserted, instead
  of doing a one-shot reset and letting it run.
- Due to all the mirroring in the IO register map, register writes while
  probing for the hard disk controller were hitting the registers of
  the VIA chips in the FDC controller, resulting in SCP resets and whatnot.
- The RDY0/RDY1 and Motor Speed signals can be either inputs or outputs.
  During initialization, these signals are used for things like loading
  speed tables into the SCP.  Look at the direction of the signals from
  the VIA's point of view to determine who should be driving the lines.
- Generate the tach signals going to the SCP correctly.
- After all of the above fixes, we can now use the Ready signals from
  the SCP, and no longer need to bypass it.
@donohoe00 donohoe00 force-pushed the victor9k_fdc_perf branch from 287521e to a3a1573 Compare May 7, 2025 17:46
@donohoe00 donohoe00 marked this pull request as ready for review May 7, 2025 20:04
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.

3 participants