Skip to content

Dotmation support & further optimizations - can now be accepted#47

Merged
mkalkbrenner merged 68 commits into
PPUC:ppucfrom
PastorL69:further_optimizations
Jun 11, 2026
Merged

Dotmation support & further optimizations - can now be accepted#47
mkalkbrenner merged 68 commits into
PPUC:ppucfrom
PastorL69:further_optimizations

Conversation

@PastorL69

@PastorL69 PastorL69 commented Jun 2, 2026

Copy link
Copy Markdown
Member

Newly supported hardware system: Dotmation

After testing the previous huge pio reduction pr #46 for a little longer, it turned out some final corrections were needed, and I now also took the time to reduce the framedetect instructions further.

All systems have been tested with the current code and are confirmed working. The PR can be merged and re-added as lib to ZeDMD.

@PastorL69 PastorL69 changed the title Further optimizations (do not accept yet) Further optimizations - can now be accepted Jun 6, 2026
Comment thread src/dmd_interface.h
if (in_base_pin != SDATA_X16) {
// We only send, so disable the TX FIFO to make the RX FIFO deeper.
// Joining is not possible with data east x16
sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_RX);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be donne to make use of the pio_sm_put function. Remember that the isr is still 4 x 32 bits deep. So we have nothing to worry about.

Comment thread src/pio/dmd_dotloop.pio
jmp x-- lsb_msb_check ; loop for ~65.5 µs (based on 125MHz clkdiv)

set x, 5 ; 0b101
set x, 7 ; 0b111

@PastorL69 PastorL69 Jun 6, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After talking to Vincent, it turned out PinMAME shades for x16 are correct. This corrects the shades as we had it wrong

Comment thread src/dmdreader.cpp
// ---------------------------------

static constexpr uint8_t map_nibble_de_x16(uint8_t p) {
return (p <= 3) ? p : (p == 4) ? 1 : (p == 8) ? 2 : (p == 10) ? 0 : 3;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After talking to Vincent, it turned out PinMAME shades for x16 are correct. This corrects the shades

Comment thread src/dmdreader.cpp
// 1/0/1/0 => 2
// 1/1/0/0 => 2
// 0/0/1/1 => 2
else if (value == 3 || value > 4 ||

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. And now the algo also runs for Capcom HD. We successfully lock in each time, and due to less branches it needs to check now Capcom HD doesn't crash the program!

Comment thread src/dmdreader.h
DMD_SEGA_HD,
DMD_GOTTLIEB,
DMD_ALVING,
DMD_ROMSTAR,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

romstar separate addition as it can't lock in like capcom (different patterns)

@PastorL69 PastorL69 changed the title Further optimizations - can now be accepted Dotmation support & further optimizations - can now be accepted Jun 10, 2026
@mkalkbrenner mkalkbrenner merged commit ef43746 into PPUC:ppuc Jun 11, 2026
4 checks passed
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