Skip to content

Commit 847012f

Browse files
authored
Official Data East / Sega support (#8)
1 parent 1be301f commit 847012f

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/dmd_interface_desega.pio

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
.define FRAME_START_IRQ 4
99

1010
.define PUBLIC desega_DE DE
11-
.define PUBLIC desega_RDATA RDATA
1211
.define PUBLIC desega_DOTCLK DOTCLK
1312
.define PUBLIC desega_SDATA SDATA
1413

@@ -100,6 +99,8 @@ static inline void dmd_reader_desega_program_init(PIO pio, uint sm, uint offset)
10099
% c-sdk {
101100
static inline void dmd_framedetect_desega_program_init(PIO pio, uint sm, uint offset) {
102101
pio_sm_config c = dmd_framedetect_desega_program_get_default_config(offset);
102+
// DE is used for jump control
103+
sm_config_set_jmp_pin(&c, desega_DE);
103104

104105
// Set the pin direction at the PIO
105106
pio_sm_set_consecutive_pindirs(pio, sm, desega_DE, 1, false);

src/dmd_reader.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,14 @@ int detect_dmd() {
358358
spi_notify_onoff(DMD_WPC);
359359
return DMD_WPC;
360360

361-
} else if ((dotclk > 640000) && (dotclk < 700000) && (de > 5000) &&
362-
(de < 5300) && (rdata > 70) && (rdata < 85)) {
361+
} else if ((dotclk > 630000) && (dotclk < 650000) && (de > 4900) &&
362+
(de < 5100) && (rdata > 75) && (rdata < 2600)) {
363+
printf("Data East/Sega detected\n");
364+
spi_notify_onoff(DMD_DESEGA);
365+
return DMD_DESEGA;
366+
367+
} else if ((dotclk > 645000) && (dotclk < 665000) && (de > 5075) &&
368+
(de < 5200) && (rdata > 75) && (rdata < 85)) {
363369
printf("Stern Whitestar detected\n");
364370
spi_notify_onoff(DMD_WHITESTAR);
365371
return DMD_WHITESTAR;
@@ -375,12 +381,6 @@ int detect_dmd() {
375381
printf("Stern SAM detected\n");
376382
spi_notify_onoff(DMD_SAM);
377383
return DMD_SAM;
378-
379-
} else if ((dotclk > 600000) && (dotclk < 680000) && (de > 4800) &&
380-
(de < 5200) && (rdata > 2500) && (rdata < 2650)) {
381-
printf("Data East/Sega detected\n");
382-
spi_notify_onoff(DMD_DESEGA);
383-
return DMD_DESEGA;
384384
}
385385

386386
spi_notify_onoff(1);

0 commit comments

Comments
 (0)