From 6478f675052ce28653a0207c91ac9a7ee90a5346 Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Tue, 11 Aug 2020 13:35:38 -0400 Subject: [PATCH] New pinout for Genesis, Saturn, N64 & GC 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)) --- main/wired/detect.c | 4 ++-- main/wired/nsi.c | 15 ++++++--------- main/wired/sega_io.c | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/main/wired/detect.c b/main/wired/detect.c index e8b87527..252a1ba3 100644 --- a/main/wired/detect.c +++ b/main/wired/detect.c @@ -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] = { diff --git a/main/wired/nsi.c b/main/wired/nsi.c index f28ef6a7..5077034c 100644 --- a/main/wired/nsi.c +++ b/main/wired/nsi.c @@ -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] = { @@ -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); diff --git a/main/wired/sega_io.c b/main/wired/sega_io.c index 6cf74fb3..75708c42 100644 --- a/main/wired/sega_io.c +++ b/main/wired/sega_io.c @@ -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] = {