Skip to content

i8256: replace diy clock with device_serial_interface and deal with interrupts#15062

Draft
stonedDiscord wants to merge 1 commit intomamedev:masterfrom
stonedDiscord:i8256f
Draft

i8256: replace diy clock with device_serial_interface and deal with interrupts#15062
stonedDiscord wants to merge 1 commit intomamedev:masterfrom
stonedDiscord:i8256f

Conversation

@stonedDiscord
Copy link
Contributor

From #14478

Also reenables savestates.

@cuavas
Copy link
Member

cuavas commented Mar 5, 2026

device_serial_interface is useful for high-level simulation of devices that use asynchronous serial communication. However, you usually end up digging a hole for yourself if you try to implement detailed UART behaviour on top of it (or God forbid USART behaviour). As such, I'd consider making a UART device more dependent on device_serial_interface to be regressive.

@stonedDiscord
Copy link
Contributor Author

I copied the old implementation from
https://github.com/mamedev/mame/blob/master/src/devices/machine/i8251.cpp#L139
under the assumption that Intel didn't reinvent the wheel.
During testing in the last months it turned out it wasn't working and the one in this PR is working.
The datasheet isn't very thorough on the internals and I don't want to boil my working 8256 in acid so I'm unsure how to do this accurately.

@cuavas
Copy link
Member

cuavas commented Mar 6, 2026

MAME’s 8251 is a terrible starting point, as it’s in dreadful shape. You also copy/pasted a pile of synchronous mode support code which wasn’t necessary But if you look at the history of that file, you’ll see that the device_serial_interface dependency has been reduced over time, not increased. A simple UART is pretty easy to implement directly anyway. It’s mostly a couple of shift registers and counters. The complicated part is the host interface, which device_serial_interface doesn’t help you with.

Anyway, no increased dependency on device_serial_interface in UART devices.

@ajrhacker
Copy link
Contributor

No, the 8256's asynchronous communications interface doesn't work very much like the 8251 USART.

@stonedDiscord stonedDiscord marked this pull request as draft March 6, 2026 08:13
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