Skip to content

Commit

Permalink
More assorted fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
allkern committed May 11, 2024
1 parent b33d776 commit 9ad77e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion psx/dev/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,11 @@ void cdrom_cmd_setfilter(psx_cdrom_t* cdrom) {
void cdrom_cmd_setmode(psx_cdrom_t* cdrom) {
cdrom->delayed_command = CDL_NONE;

// Not doing this fixes a graphical issue in
// Castlevania - Symphony of the Night, but breaks
// Road Rash.
// cdrom->ongoing_read_command = CDL_NONE;

switch (cdrom->state) {
case CD_STATE_RECV_CMD: {
if (cdrom->pfifo_index != 1) {
Expand All @@ -825,7 +830,7 @@ void cdrom_cmd_setmode(psx_cdrom_t* cdrom) {
cdrom->mode = PFIFO_POP;

if ((cdrom->mode & MODE_SPEED) != prev_speed)
cdrom->spin_delay = DELAY_1MS * 650;
cdrom->spin_delay = 0; // DELAY_1MS * 650;

cdrom->irq_delay = DELAY_1MS;
cdrom->delayed_command = CDL_SETMODE;
Expand All @@ -842,6 +847,8 @@ void cdrom_cmd_setmode(psx_cdrom_t* cdrom) {
cdrom->irq_delay = DELAY_1MS;
cdrom->delayed_command = cdrom->ongoing_read_command;
cdrom->state = CD_STATE_SEND_RESP2;

return;
}

cdrom->state = CD_STATE_RECV_CMD;
Expand Down
8 changes: 6 additions & 2 deletions psx/input/sda.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ void psxi_sda_on_button_press(void* udata, uint32_t data) {
if (data == PSXI_SW_SDA_ANALOG) {
sda->sa_mode ^= 1;

sda->prev_model = sda->model;
sda->model = sda->sa_mode ? SDA_MODEL_ANALOG_STICK : sda->prev_model;
if (sda->sa_mode) {
sda->prev_model = sda->model;
sda->model = SDA_MODEL_ANALOG_STICK;
} else {
sda->model = sda->prev_model;
}

printf("sda: Switched to %s mode\n", sda->sa_mode ? "analog" : "digital");

Expand Down

0 comments on commit 9ad77e4

Please sign in to comment.