From e5b0432991544f550f8f72e6477793542c1979b0 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Fri, 23 Jul 2021 23:59:11 -0400 Subject: [PATCH] Change the polarity of the stereo default. I used to default to "bad stereo" which matched the behaviour of mame, GSPlus and the 4soniq card but was against the Apple standard. The mame code has since been fixed and it seems like all other stereo cards are correct (I am unaware of any others that are backwards). So, by default, BuGS will start in the Apple standard L/R mode. If you have saved your settings previously, your option will be preserved correctly. Also, the display considers Apple standard stereo to be L:R while the non-standard to be R:L in the UI. --- .../jrand.xcuserdatad/xcschemes/xcschememanagement.plist | 8 ++++---- BuGS/game.s | 2 +- BuGS/gameSound.s | 7 +++++-- BuGS/settings.c | 8 ++++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist index 6ea693b..07e9596 100644 --- a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ Archive.xcscheme_^#shared#^_ orderHint - 2 + 1 Binary.xcscheme_^#shared#^_ orderHint - 1 + 4 BuGS.xcscheme_^#shared#^_ @@ -22,12 +22,12 @@ DiskImage.xcscheme_^#shared#^_ orderHint - 4 + 3 doNotBuild.xcscheme_^#shared#^_ orderHint - 3 + 2 diff --git a/BuGS/game.s b/BuGS/game.s index d735f17..8caccdc 100644 --- a/BuGS/game.s +++ b/BuGS/game.s @@ -1170,7 +1170,7 @@ staticGameBoard_Options anop _setGameTile TILE_EMPTY lda settings+SETTINGS_SWAP_STEREO_OFFSET - bne staticGameBoard_swapped + beq staticGameBoard_swapped _setGameTile TILE_LETTER_L _setGameTile TILE_SYMBOL_COLON _setGameTile TILE_LETTER_R diff --git a/BuGS/gameSound.s b/BuGS/gameSound.s index 5b4aba4..f832c69 100644 --- a/BuGS/gameSound.s +++ b/BuGS/gameSound.s @@ -33,8 +33,11 @@ SOUND_ONE_SHOT_MODE equ 2 ; $10 should be the left. But based on GSPlus and mame, I see the opposite. Still need ; to check on my HW. But in the end, it could be that some HW demultiplexed them backwards ; so there could be either out there in the wild. -SOUND_RIGHT_SPEAKER equ $10 -SOUND_LEFT_SPEAKER equ $00 +; +; Now I am changing my mind about this. mame has been fixed. I think the 4soniq and GSplus +; are the only ones which are wrong. So, going with the Apple standard here. +SOUND_RIGHT_SPEAKER equ $00 +SOUND_LEFT_SPEAKER equ $10 ; OSC 16 - 19 for L/R channels in swap mode SPIDER_SOUND_ADDR equ $0000 diff --git a/BuGS/settings.c b/BuGS/settings.c index 8dac7c5..d8190a6 100644 --- a/BuGS/settings.c +++ b/BuGS/settings.c @@ -26,7 +26,7 @@ typedef struct tSettingsData { char magic[4]; int version; - Boolean swapStereo; + Boolean stereoCorrect; tHighScore highScores[NUM_HIGH_SCORES]; } tSettingsData; @@ -36,7 +36,7 @@ typedef struct tSettingsData tSettingsData settings = { { 'B', 'u', 'G', 'S' }, 0, - FALSE, + TRUE, { { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0}, @@ -183,7 +183,7 @@ BOOLEAN loadSettings(void) if (success) { - if (settings.swapStereo) + if (!settings.stereoCorrect) { swapStereoChannels(); } @@ -196,6 +196,6 @@ BOOLEAN loadSettings(void) void swapStereoSettings(void) { swapStereoChannels(); - settings.swapStereo = !settings.swapStereo; + settings.stereoCorrect = !settings.stereoCorrect; saveSettings(); }