Skip to content

Commit

Permalink
Fix CIC shutdown when saving settings on unmodded consoles
Browse files Browse the repository at this point in the history
Regression caused by fffe499:
When saving the config, to set the video mode, CIC data lines were switched to outputs regardless of whether pair mode was detected or enabled. This caused an unmodded console with original CIC to shut down and require a power cycle.
  • Loading branch information
mrehkopf committed Jun 21, 2023
1 parent 649c528 commit f5c28d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cic.c
Expand Up @@ -57,15 +57,15 @@ void cic_init(int allow_pairmode) {
void cic_pair(int init_vmode, int init_d4) {
cic_videomode(init_vmode);
cic_d4(init_d4);
GPIO_MODE_OUT(SNES_CIC_D0_REG, SNES_CIC_D0_BIT);
GPIO_MODE_OUT(SNES_CIC_D1_REG, SNES_CIC_D1_BIT);
}

void cic_videomode(int value) {
OUT_BIT(SNES_CIC_D0_REG, SNES_CIC_D0_BIT, value);
GPIO_MODE_OUT(SNES_CIC_D0_REG, SNES_CIC_D0_BIT);
}

void cic_d4(int value) {
OUT_BIT(SNES_CIC_D1_REG, SNES_CIC_D1_BIT, value);
GPIO_MODE_OUT(SNES_CIC_D1_REG, SNES_CIC_D1_BIT);
}

0 comments on commit f5c28d8

Please sign in to comment.