Skip to content

Commit

Permalink
fix DAC addresses to make stereo replay work correctly
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45316 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
mrdudz committed Aug 24, 2024
1 parent c59cd9c commit 945a009
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions vice/src/userport/userport_digimax.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,22 @@ void userport_digimax_sound_chip_init(void)
digimax_sound_chip_offset = sound_chip_register(&digimax_sound_chip);
}

/*
PA2 low, /PA3 low: DAC #0 (left)
PA2 high, /PA3 low: DAC #1 (right)
PA2 low, /PA3 high: DAC #2 (left)
PA2 high, /PA3 high: DAC #3 (right).
*/

static void userport_digimax_store_pa2(uint8_t value)
{
userport_digimax_address &= 2;
userport_digimax_address &= ~1;
userport_digimax_address |= (value & 1);
}

static void userport_digimax_store_pa3(uint8_t value)
{
userport_digimax_address &= 1;
userport_digimax_address &= ~2;
userport_digimax_address |= ((value & 1) << 1);
}

Expand All @@ -123,16 +130,16 @@ static void userport_digimax_store_pbx(uint8_t value, int pulse)

switch (userport_digimax_address) {
case 0x0:
addr = 2;
break;
case 0x4:
addr = 3;
addr = 1;
break;
case 0x8:
case 0x1:
addr = 0;
break;
case 0xc:
addr = 1;
case 0x2:
addr = 3;
break;
case 0x3:
addr = 2;
break;
}

Expand Down

0 comments on commit 945a009

Please sign in to comment.