Skip to content

Commit

Permalink
New pinout for Genesis, Saturn, N64 & GC
Browse files Browse the repository at this point in the history
Genesis/Saturn: Move TR-2 to pin GPIO16 (Keep IO0 for BOOT switch only)
N64/GC: Move D2 to GPIO5 (Avoid GC weak pull-up issue with GPIO3/RXD)
GC: Move D1 to GPIO19 (Share same detect pin with N64, I39 select between N64 (Hi) & GC (Lo))
  • Loading branch information
darthcloud committed Aug 11, 2020
1 parent 3b28df7 commit 6478f67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions main/wired/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ static const uint8_t detect_pin_high[] = {
};

static const uint8_t system_id_low[][4] = {
{N64, GC, DC, WII_EXT},
{N64, GC, DC, WII_EXT},
{N64, SMS, DC, WII_EXT},
{GC, SMS, DC, WII_EXT},
};

static const uint8_t system_id_high[][4] = {
Expand Down
15 changes: 6 additions & 9 deletions main/wired/nsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ enum {
RMT_MEM_CHANGE
};

static const uint8_t gpio_pin[4][2] = {
{19, 21},
{ 3, 3},
{26, 26},
{27, 27},
static const uint8_t gpio_pin[4] = {
19, 5, 26, 27
};

static const uint8_t rmt_ch[4][2] = {
Expand Down Expand Up @@ -380,10 +377,10 @@ void nsi_init(void) {
RMT.conf_ch[rmt_ch[i][system]].conf1.rx_filter_thres = 0; /* No minimum length */
RMT.conf_ch[rmt_ch[i][system]].conf1.rx_filter_en = 0;

PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio_pin[i][system]], PIN_FUNC_GPIO);
gpio_set_direction(gpio_pin[i][system], GPIO_MODE_INPUT_OUTPUT_OD); /* Bidirectional open-drain */
gpio_matrix_out(gpio_pin[i][system], RMT_SIG_OUT0_IDX + rmt_ch[i][system], 0, 0);
gpio_matrix_in(gpio_pin[i][system], RMT_SIG_IN0_IDX + rmt_ch[i][system], 0);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio_pin[i]], PIN_FUNC_GPIO);
gpio_set_direction(gpio_pin[i], GPIO_MODE_INPUT_OUTPUT_OD); /* Bidirectional open-drain */
gpio_matrix_out(gpio_pin[i], RMT_SIG_OUT0_IDX + rmt_ch[i][system], 0, 0);
gpio_matrix_in(gpio_pin[i], RMT_SIG_IN0_IDX + rmt_ch[i][system], 0);

rmt_set_tx_intr_en(rmt_ch[i][system], 1);
rmt_set_rx_intr_en(rmt_ch[i][system], 1);
Expand Down
2 changes: 1 addition & 1 deletion main/wired/sega_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ enum {

static const uint8_t gpio_pin[2][7] = {
{35, 27, 26, 23, 18, 5, 3},
{36, 0, 33, 25, 22, 21, 19},
{36, 16, 33, 25, 22, 21, 19},
};

static const uint16_t gen_cycle_mask[8][6] = {
Expand Down

0 comments on commit 6478f67

Please sign in to comment.