Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added logicanalyzer/Sleic/Pin-Ball - Sleic 128x32.sal
Binary file not shown.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ board = rpipico2
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
build_flags =
-DRP2350
-DRP2350
Comment thread
PastorL69 marked this conversation as resolved.
Resolved
7 changes: 7 additions & 0 deletions src/dmd_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ void dmd_reader_program_init(float dmd_clkdiv, PIO pio, uint sm, uint offset, pi
sm_config_set_clkdiv(&c, dmd_clkdiv);
}

if (dmd_type == DMD_SLEIC_V1) {
// set DE as the jmp pin for Sleic V1, used to detect MSB or LSB dot.
sm_config_set_jmp_pin(&c, DE);
pio_gpio_init(pio, DE);
pio_sm_set_consecutive_pindirs(pio, sm, DE, 1, false);
}

if (in_base_pin == SDATA_X16) {
pio_gpio_init(pio, SDATA_X16); // Extra data line for Data East X16
pio_gpio_init(pio, SDATA_X16_PADDING); // used as a padding 0 bit
Expand Down
40 changes: 34 additions & 6 deletions src/dmdreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,15 @@ DmdType detect_dmd() {
(rclk < 4400) && (rdata > 125) && (rdata < 140)) {
return DMD_SPINBALL;

// Sleic -> DOTCLK: 599000 | RCLK: 4700 | RDATA: 145
// Sleic V1 -> DOTCLK: 352000 | RCLK: 2625 | RDATA: 80
} else if ((dotclk > 330000) && (dotclk < 375000) && (rclk > 2550) &&
(rclk < 2700) && (rdata > 75) && (rdata < 85)) {
return DMD_SLEIC_V1;

// Sleic V2 -> DOTCLK: 599000 | RCLK: 4700 | RDATA: 145
} else if ((dotclk > 570000) && (dotclk < 630000) && (rclk > 4550) &&
(rclk < 4850) && (rdata > 135) && (rdata < 155)) {
return DMD_SLEIC;
return DMD_SLEIC_V2;

// ROMSTAR -> DOTCLK: 4000000 | RCLK: 15625 | RDATA: 245
} else if ((dotclk > 3900000) && (dotclk < 4100000) && (rclk > 15300) &&
Expand Down Expand Up @@ -695,7 +700,7 @@ void dmd_dma_handler() {
if (source_shiftplanesatmerge) {
if (dmd_type == DMD_SPIKE1) {
v <<= plane;
} else if (dmd_type == DMD_SLEIC) {
} else if (dmd_type == DMD_SLEIC_V2) {
v <<= (source_planesperframe - 1) - plane;
}
}
Expand Down Expand Up @@ -1346,13 +1351,36 @@ bool dmdreader_init(bool return_on_no_detection) {
break;
}

case DMD_SLEIC: {
case DMD_SLEIC_V1: {
uint input_pins[] = {RDATA};
dmdreader_programs_init(
&dmd_reader_sleic_v1_program,
dmd_reader_sleic_v1_program_get_default_config,
&dmd_framedetect_generic_program,
dmd_framedetect_generic_program_get_default_config, input_pins, 1,
0, SDATA);

// load 127 directly to TX fifo
pio_sm_put(dmd_pio, dmd_sm, 127);

source_width = 128;
source_height = 32;
source_bitsperpixel = 2;
target_bitsperpixel = 2;
source_planesperframe = 2;
source_planehistoryperframe = 1;
source_lineoversampling = LINEOVERSAMPLING_NONE;
source_mergeplanes = MERGEPLANES_ADD;
break;
}

case DMD_SLEIC_V2: {
uint input_pins[] = {DE, RDATA};
dmdreader_programs_init(
&dmd_reader_2bpp_program,
dmd_reader_2bpp_program_get_default_config,
&dmd_framedetect_sleic_program,
dmd_framedetect_sleic_program_get_default_config, input_pins, 2,
&dmd_framedetect_sleic_v2_program,
dmd_framedetect_sleic_v2_program_get_default_config, input_pins, 2,
DE, SDATA);

// load 8192 - 1 pixels directly to TX fifo
Expand Down
3 changes: 2 additions & 1 deletion src/dmdreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ enum DmdType : uint8_t {
DMD_ISLAND,
DMD_HOMEPIN,
DMD_SPINBALL,
DMD_SLEIC,
DMD_SLEIC_V1,
DMD_SLEIC_V2,
// CAPCOM needs to be the last two entries:
DMD_CAPCOM,
DMD_CAPCOM_HD,
Expand Down
44 changes: 44 additions & 0 deletions src/pio/dmd_dotloop.pio
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,48 @@ dot_check_loop:
legit_dot:
in pins 1 ; read pin data
jmp x-- dotloop
.wrap

; // ------------------- //
; // dmd_reader_sleic_v1 //
; // ------------------- //

.program dmd_reader_sleic_v1
.wrap_target
set y, 31 ; number of rows
mov isr, null ; clear ISR and reset shift counter

irq clear START_READING_IRQ
wait irq START_READING_IRQ

row_loop:
set x, 5 ; load number of dots to skip (6)
dot_skip_loop:
wait 0 gpio DOTCLK ; no DOTCLK period or faling edge of the previous
wait 1 gpio DOTCLK
jmp x-- dot_skip_loop ; skip 6 dots

mov x, osr ; load number of pixels to read (128)

check_row:
jmp pin msb_row ; Is DE high?
jmp lsb_row ; DE is low -> LSB

msb_row:
wait 0 gpio DOTCLK ; no DOTCLK period or faling edge of the previous
wait 1 gpio DOTCLK ; rising edge
in pins 1 ; read 1 bit pin data
in null 1 ; padding 0 to the output as Sleic is 2bit/px
jmp x-- msb_row
jmp end

lsb_row:
wait 0 gpio DOTCLK ; no DOTCLK period or faling edge of the previous
wait 1 gpio DOTCLK ; raising edge
in null 1 ; padding 0 to the output as Sleic is 2bit/px
in pins 1 ; read 1 bit pin data
jmp x-- lsb_row

end:
jmp y-- row_loop
.wrap
2 changes: 1 addition & 1 deletion src/pio/dmd_framedetect_generic.pio
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.program dmd_framedetect_generic
.wrap_target

; This program is in use by WPC/WPC95, Stern SAM, Stern Whitestar, Gottlieb/Premier, Sega HD and Island
; This program is in use by WPC/WPC95, Sleic V1, Stern SAM, Stern Whitestar, Gottlieb/Premier, Sega HD and Island

wait 0 gpio RDATA
wait 1 gpio RDATA
Expand Down
5 changes: 4 additions & 1 deletion src/pio/dmd_framedetect_sleic.pio
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
.define FRAME_START_IRQ 5

; Frame detection program runs in parallel to the reader program and signals the start of a new frame using an IRQ.
.program dmd_framedetect_sleic

.program dmd_framedetect_sleic_v2
.wrap_target

; This program is in use by Sleic Io Moon

wait_low:
mov x, osr ; set x to 6144
wait 0 gpio DE ; Wait for DE to go low
Expand Down
Loading