Skip to content

Commit

Permalink
- Add option to forcibly disable/enable streaming audio emulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Jan 24, 2024
1 parent 429b6c4 commit 73c40e7
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 12 deletions.
22 changes: 21 additions & 1 deletion cube/patches/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dvdpatch: dvd.bin dvd.card.bin
usbgeckopatch: usbgecko.bin
wkfpatch: wkf.bin wkf.card.bin wkf.dtk.bin
fsppatch: fsp.bin fsp.dtk.bin fsp.eth.bin
gcloaderpatch: gcloader-v1.bin gcloader-v1.card.bin gcloader-v2.bin gcloader-v2.card.bin
gcloaderpatch: gcloader-v1.bin gcloader-v1.card.bin gcloader-v2.bin gcloader-v2.card.bin gcloader-v2.dtk.bin

clean:
@rm -f *.bin *.elf *.o
Expand Down Expand Up @@ -565,3 +565,23 @@ gcloader-v2.card.bin:
@$(OBJCOPY) -O binary --set-section-flags .bss.*=alloc,load,contents gcloader-v2.card.elf gcloader-v2.card.bin
@$(BIN2S) -H $(DEST)/gcloader_v2_card_bin.h gcloader-v2.card.bin > $(DEST)/gcloader-v2.card.bin.s
@rm -f *.bin *.elf *.o

gcloader-v2.dtk.bin:
@echo Building GCLoader-v2 Patch + DTK ...
@$(CC) -Os $(OPTS) -c base/base.S
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DDTK -DGCODE
@$(CC) -Os $(OPTS) -c base/audio.c
@$(CC) -Os $(OPTS) -c base/fifo.c
@$(CC) -Os $(OPTS) -c base/frag.c -DDEVICE_PATCHES=1
@$(CC) -Os $(OPTS) -c base/interrupt.c
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c gcloader/gcloader.c -DQUEUE_SIZE=3
@$(CC) -Os $(OPTS) -c usbgecko/uart.c
@$(CC) -Os $(OPTS) -c base/dolphin/os.c
@$(CC) -Os $(OPTS) -c base/memcpy.S
@$(CC) -Os $(OPTS) -o gcloader-v2.dtk.elf -T base/base.ld -T base/common.ld -T base/dolphin/os.ld base.o emulator.o audio.o fifo.o frag.o interrupt.o ipl.o gcloader.o uart.o os.o memcpy.o
@mkdir -p $(DISASM)
@$(OBJDUMP) -D gcloader-v2.dtk.elf > $(DISASM)/gcloader-v2.dtk.txt
@$(OBJCOPY) -O binary --set-section-flags .bss.*=alloc,load,contents gcloader-v2.dtk.elf gcloader-v2.dtk.bin
@$(BIN2S) -H $(DEST)/gcloader_v2_dtk_bin.h gcloader-v2.dtk.bin > $(DEST)/gcloader-v2.dtk.bin.s
@rm -f *.bin *.elf *.o
1 change: 1 addition & 0 deletions cube/swiss/include/patcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ typedef struct FuncPattern
#include "gcloader_v1_card_bin.h"
#include "gcloader_v2_bin.h"
#include "gcloader_v2_card_bin.h"
#include "gcloader_v2_dtk_bin.h"

/* SDK patches */
#include "backwards_memcpy_bin.h"
Expand Down
1 change: 1 addition & 0 deletions cube/swiss/include/swiss.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ typedef struct {
int forceVideoActive;
int forceDTVStatus;
int pauseAVOutput;
int emulateAudioStream;
int emulateReadSpeed;
int emulateMemoryCard;
int emulateEthernet;
Expand Down
21 changes: 21 additions & 0 deletions cube/swiss/source/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ int config_update_global(bool checkConfigDevice) {
fprintf(fp, "Invert Camera Stick=%s\r\n", invertCStickStr[swissSettings.invertCStick]);
fprintf(fp, "Swap Camera Stick=%s\r\n", swapCStickStr[swissSettings.swapCStick]);
fprintf(fp, "Digital Trigger Level=%hhu\r\n", swissSettings.triggerLevel);
fprintf(fp, "Emulate Audio Streaming=%s\r\n", emulateAudioStreamStr[swissSettings.emulateAudioStream]);
fprintf(fp, "Emulate Read Speed=%s\r\n", emulateReadSpeedStr[swissSettings.emulateReadSpeed]);
fprintf(fp, "Emulate Memory Card=%s\r\n", swissSettings.emulateMemoryCard ? "Yes":"No");
fprintf(fp, "Emulate Broadband Adapter=%s\r\n", swissSettings.emulateEthernet ? "Yes":"No");
Expand Down Expand Up @@ -273,6 +274,7 @@ int config_update_game(ConfigEntry* entry, bool checkConfigDevice) {
fprintf(fp, "Invert Camera Stick=%s\r\n", invertCStickStr[entry->invertCStick]);
fprintf(fp, "Swap Camera Stick=%s\r\n", swapCStickStr[entry->swapCStick]);
fprintf(fp, "Digital Trigger Level=%hhu\r\n", entry->triggerLevel);
fprintf(fp, "Emulate Audio Streaming=%s\r\n", emulateAudioStreamStr[entry->emulateAudioStream]);
fprintf(fp, "Emulate Read Speed=%s\r\n", emulateReadSpeedStr[entry->emulateReadSpeed]);
fprintf(fp, "Emulate Broadband Adapter=%s\r\n", entry->emulateEthernet ? "Yes":"No");
fprintf(fp, "Prefer Clean Boot=%s\r\n", entry->preferCleanBoot ? "Yes":"No");
Expand Down Expand Up @@ -310,6 +312,7 @@ void config_defaults(ConfigEntry *entry) {
entry->invertCStick = swissSettings.invertCStick;
entry->swapCStick = swissSettings.swapCStick;
entry->triggerLevel = swissSettings.triggerLevel;
entry->emulateAudioStream = swissSettings.emulateAudioStream;
entry->emulateReadSpeed = swissSettings.emulateReadSpeed;
entry->emulateEthernet = swissSettings.emulateEthernet;
entry->preferCleanBoot = swissSettings.preferCleanBoot;
Expand Down Expand Up @@ -694,6 +697,14 @@ void config_parse_global(char *configData) {
else if(!strcmp("Digital Trigger Level", name)) {
swissSettings.triggerLevel = atoi(value);
}
else if(!strcmp("Emulate Audio Streaming", name)) {
for(int i = 0; i < 3; i++) {
if(!strcmp(emulateAudioStreamStr[i], value)) {
swissSettings.emulateAudioStream = i;
break;
}
}
}
else if(!strcmp("Emulate Read Speed", name)) {
for(int i = 0; i < 3; i++) {
if(!strcmp(emulateReadSpeedStr[i], value)) {
Expand Down Expand Up @@ -1022,6 +1033,14 @@ void config_parse_game(char *configData, ConfigEntry *entry) {
else if(!strcmp("Digital Trigger Level", name)) {
entry->triggerLevel = atoi(value);
}
else if(!strcmp("Emulate Audio Streaming", name)) {
for(int i = 0; i < 3; i++) {
if(!strcmp(emulateAudioStreamStr[i], value)) {
entry->emulateAudioStream = i;
break;
}
}
}
else if(!strcmp("Emulate Read Speed", name)) {
for(int i = 0; i < 3; i++) {
if(!strcmp(emulateReadSpeedStr[i], value)) {
Expand Down Expand Up @@ -1128,6 +1147,7 @@ void config_load_current(ConfigEntry *config) {
swissSettings.invertCStick = config->invertCStick;
swissSettings.swapCStick = config->swapCStick;
swissSettings.triggerLevel = config->triggerLevel;
swissSettings.emulateAudioStream = config->emulateAudioStream;
swissSettings.emulateReadSpeed = config->emulateReadSpeed;
swissSettings.emulateEthernet = config->emulateEthernet;
swissSettings.preferCleanBoot = config->preferCleanBoot;
Expand All @@ -1149,6 +1169,7 @@ void config_unload_current() {
swissSettings.wiirdDebug = backup.wiirdDebug;
swissSettings.sram60Hz = backup.sram60Hz;
swissSettings.sramProgressive = backup.sramProgressive;
swissSettings.emulateAudioStream = backup.emulateAudioStream;
swissSettings.emulateReadSpeed = backup.emulateReadSpeed;
swissSettings.emulateEthernet = backup.emulateEthernet;
swissSettings.preferCleanBoot = backup.preferCleanBoot;
Expand Down
1 change: 1 addition & 0 deletions cube/swiss/source/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ typedef struct {
int invertCStick;
int swapCStick;
int triggerLevel;
int emulateAudioStream;
int emulateReadSpeed;
int emulateEthernet;
int forceCleanBoot;
Expand Down
6 changes: 4 additions & 2 deletions cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ bool deviceHandler_FAT_test_ata_c() {
}

u32 deviceHandler_FAT_emulated_sd() {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING | EMU_BUS_ARBITER;
else if (swissSettings.emulateReadSpeed)
return EMU_READ | EMU_READ_SPEED | EMU_BUS_ARBITER;
Expand All @@ -448,7 +449,8 @@ u32 deviceHandler_FAT_emulated_sd() {
}

u32 deviceHandler_FAT_emulated_ata() {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING | EMU_BUS_ARBITER;
else if (swissSettings.emulateMemoryCard)
return EMU_READ | EMU_MEMCARD | EMU_BUS_ARBITER;
Expand Down
6 changes: 4 additions & 2 deletions cube/swiss/source/devices/fsp/deviceHandler-FSP.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,14 @@ bool deviceHandler_FSP_test() {

u32 deviceHandler_FSP_emulated() {
if (devices[DEVICE_PATCHES] && devices[DEVICE_PATCHES] != devices[DEVICE_CUR]) {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING | EMU_BUS_ARBITER;
else
return EMU_READ | EMU_BUS_ARBITER;
} else {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING | EMU_BUS_ARBITER;
else if (swissSettings.emulateEthernet)
return EMU_READ | EMU_ETHERNET | EMU_BUS_ARBITER;
Expand Down
10 changes: 6 additions & 4 deletions cube/swiss/source/devices/gcloader/deviceHandler-gcloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ bool deviceHandler_GCLoader_test() {

if (swissSettings.hasDVDDrive && driveInfo.rel_date == 0x20196c64) {
if (driveInfo.pad[1] == 'w')
__device_gcloader.features |= (FEAT_WRITE|FEAT_CONFIG_DEVICE|FEAT_PATCHES);
__device_gcloader.features |= (FEAT_WRITE | FEAT_CONFIG_DEVICE | FEAT_PATCHES);
else
__device_gcloader.features &= ~(FEAT_WRITE|FEAT_CONFIG_DEVICE|FEAT_PATCHES);
__device_gcloader.features &= ~(FEAT_WRITE | FEAT_CONFIG_DEVICE | FEAT_PATCHES);

__device_gcloader.quirks = QUIRK_NONE;

Expand Down Expand Up @@ -332,7 +332,9 @@ u32 deviceHandler_GCLoader_emulated() {
else
return EMU_READ | EMU_BUS_ARBITER;
} else {
if (swissSettings.emulateReadSpeed)
if (swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING;
else if (swissSettings.emulateReadSpeed)
return EMU_READ | EMU_READ_SPEED;
else if (swissSettings.emulateMemoryCard &&
!(swissSettings.audioStreaming && (devices[DEVICE_CUR]->quirks & QUIRK_GCLOADER_WRITE_CONFLICT)))
Expand All @@ -355,7 +357,7 @@ DEVICEHANDLER_INTERFACE __device_gcloader = {
.deviceDescription = "Supported File System(s): FAT16, FAT32, exFAT",
.deviceTexture = {TEX_GCLOADER, 115, 72, 120, 80},
.features = FEAT_READ|FEAT_WRITE|FEAT_BOOT_GCM|FEAT_BOOT_DEVICE|FEAT_CONFIG_DEVICE|FEAT_AUTOLOAD_DOL|FEAT_FAT_FUNCS|FEAT_HYPERVISOR|FEAT_PATCHES|FEAT_AUDIO_STREAMING,
.emulable = EMU_READ|EMU_READ_SPEED|EMU_MEMCARD,
.emulable = EMU_READ|EMU_READ_SPEED|EMU_AUDIO_STREAMING|EMU_MEMCARD,
.location = LOC_DVD_CONNECTOR,
.initial = &initial_GCLoader,
.test = deviceHandler_GCLoader_test,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,16 @@ s32 deviceHandler_WKF_deinit(file_handle* file) {

u32 deviceHandler_WKF_emulated() {
if (devices[DEVICE_PATCHES]) {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING | EMU_BUS_ARBITER;
else if (swissSettings.emulateMemoryCard)
return EMU_READ | EMU_MEMCARD | EMU_BUS_ARBITER;
else
return EMU_READ | EMU_BUS_ARBITER;
} else {
if (swissSettings.audioStreaming)
if ((swissSettings.emulateAudioStream == 1 && swissSettings.audioStreaming) ||
swissSettings.emulateAudioStream > 1)
return EMU_READ | EMU_AUDIO_STREAMING;
else
return EMU_READ;
Expand Down
27 changes: 26 additions & 1 deletion cube/swiss/source/gui/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ char *invertCStickStr[] = {"No", "X", "Y", "X&Y"};
char *swapCStickStr[] = {"No", "X", "Y", "X&Y"};
char *disableMCPGameIDStr[] = {"No", "Slot A", "Slot B", "Slot A&B"};
char *disableVideoPatchesStr[] = {"None", "Game", "All"};
char *emulateAudioStreamStr[] = {"Off", "Auto", "On"};
char *emulateReadSpeedStr[] = {"No", "Yes", "Wii"};
char *igrTypeStr[] = {"Disabled", "Reboot", "igr.dol"};
char *aveCompatStr[] = {"CMPV-DOL", "GCVideo", "AVE-RVL", "AVE N-DOL", "AVE P-DOL"};
Expand Down Expand Up @@ -93,7 +94,8 @@ static char *tooltips_game[PAGE_GAME_MAX+1] = {
"Force Polling Rate:\n\nVSync - Highest compatibility\n1000Hz - Lowest input latency",
"Invert Camera Stick:\n\nNo - Leave C Stick as-is (default)\nX - Invert X-axis of the C Stick\nY - Invert Y-axis of the C Stick\nX&Y - Invert both axes of the C Stick",
"Swap Camera Stick:\n\nNo - Leave C Stick as-is (default)\nX - Swap X-axis of the C Stick with the Control Stick\nY - Swap Y-axis of the C Stick with the Control Stick\nX&Y - Swap both axes of the C Stick with the Control Stick",
"Digital Trigger Level:\n\nSets the level where the L/R Button is fully pressed.",
"Digital Trigger Level:\n\nSets the threshold where the L/R Button is fully pressed.",
"Emulate Audio Streaming:\n\nAudio streaming is a hardware feature that allows a compressed\naudio track to be played in the background by the disc drive.\n\nEmulation is necessary for devices not attached to the\nDVD Interface, or for those not implementing it regardless.",
"Emulate Read Speed:\n\nNo - Start transfer immediately (default)\nYes - Delay transfer to simulate the GameCube disc drive\nWii - Delay transfer to simulate the Wii disc drive\n\nThis is necessary to avoid programming mistakes obfuscated\nby the original medium, or for speedrunning.",
"Emulate Broadband Adapter:\n\nOnly available with the File Service Protocol.\n\nPackets not destined for the hypervisor are forwarded to\nthe virtual MAC. The virtual MAC address is the same as\nthe physical MAC. The physical MAC/PHY retain their\nconfiguration from Swiss, including link speed.",
"Prefer Clean Boot:\n\nWhen enabled, the GameCube will be reset and the game\nbooted through normal processes with no changes applied.\nRegion restrictions may be applicable.\n\nOnly available to devices attached to the DVD Interface."
Expand Down Expand Up @@ -318,6 +320,7 @@ uiDrawObj_t* settings_draw_page(int page_num, int option, ConfigEntry *gameConfi
DrawAddChild(page, DrawVertScrollBar(getVideoMode()->fbWidth-45, page_y_ofs, 25, scrollBarHeight, (float)((float)option/(float)(SET_PAGE_4_BACK-1)),scrollBarTabHeight));
DrawAddChild(page, DrawLabel(page_x_ofs_key, 65, "Default Game Settings (4/5):"));
bool enabledVideoPatches = swissSettings.disableVideoPatches < 2;
bool emulatedAudioStream = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_AUDIO_STREAMING);
bool emulatedReadSpeed = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_READ_SPEED);
bool emulatedEthernet = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_ETHERNET);
bool enabledCleanBoot = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->location == LOC_DVD_CONNECTOR);
Expand All @@ -337,6 +340,7 @@ uiDrawObj_t* settings_draw_page(int page_num, int option, ConfigEntry *gameConfi
} else {
sprintf(triggerLevelStr, "%hhu", swissSettings.triggerLevel);
drawSettingEntryString(page, &page_y_ofs, "Digital Trigger Level:", triggerLevelStr, option == SET_DEFAULT_TRIGGER_LEVEL, true);
drawSettingEntryString(page, &page_y_ofs, "Emulate Audio Streaming:", emulateAudioStreamStr[swissSettings.emulateAudioStream], option == SET_DEFAULT_AUDIO_STREAM, emulatedAudioStream);
drawSettingEntryString(page, &page_y_ofs, "Emulate Read Speed:", emulateReadSpeedStr[swissSettings.emulateReadSpeed], option == SET_DEFAULT_READ_SPEED, emulatedReadSpeed);
drawSettingEntryBoolean(page, &page_y_ofs, "Emulate Broadband Adapter:", swissSettings.emulateEthernet, option == SET_DEFAULT_EMULATE_ETHERNET, emulatedEthernet);
drawSettingEntryBoolean(page, &page_y_ofs, "Prefer Clean Boot:", swissSettings.preferCleanBoot, option == SET_DEFAULT_CLEAN_BOOT, enabledCleanBoot);
Expand All @@ -351,6 +355,7 @@ uiDrawObj_t* settings_draw_page(int page_num, int option, ConfigEntry *gameConfi
bool enabledGamePatches = gameConfig != NULL && !gameConfig->forceCleanBoot;
if(enabledGamePatches) {
bool enabledVideoPatches = swissSettings.disableVideoPatches < 2;
bool emulatedAudioStream = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_AUDIO_STREAMING);
bool emulatedReadSpeed = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_READ_SPEED);
bool emulatedEthernet = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_ETHERNET);
bool enabledCleanBoot = devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->location == LOC_DVD_CONNECTOR);
Expand All @@ -370,6 +375,7 @@ uiDrawObj_t* settings_draw_page(int page_num, int option, ConfigEntry *gameConfi
} else {
sprintf(triggerLevelStr, "%hhu", gameConfig->triggerLevel);
drawSettingEntryString(page, &page_y_ofs, "Digital Trigger Level:", triggerLevelStr, option == SET_TRIGGER_LEVEL, true);
drawSettingEntryString(page, &page_y_ofs, "Emulate Audio Streaming:", emulateAudioStreamStr[gameConfig->emulateAudioStream], option == SET_AUDIO_STREAM, emulatedAudioStream);
drawSettingEntryString(page, &page_y_ofs, "Emulate Read Speed:", emulateReadSpeedStr[gameConfig->emulateReadSpeed], option == SET_READ_SPEED, emulatedReadSpeed);
drawSettingEntryBoolean(page, &page_y_ofs, "Emulate Broadband Adapter:", gameConfig->emulateEthernet, option == SET_EMULATE_ETHERNET, emulatedEthernet);
drawSettingEntryBoolean(page, &page_y_ofs, "Prefer Clean Boot:", gameConfig->preferCleanBoot, option == SET_CLEAN_BOOT, enabledCleanBoot);
Expand All @@ -394,6 +400,7 @@ uiDrawObj_t* settings_draw_page(int page_num, int option, ConfigEntry *gameConfi
} else {
sprintf(triggerLevelStr, "%hhu", swissSettings.triggerLevel);
drawSettingEntryString(page, &page_y_ofs, "Digital Trigger Level:", triggerLevelStr, option == SET_TRIGGER_LEVEL, false);
drawSettingEntryString(page, &page_y_ofs, "Emulate Audio Streaming:", emulateAudioStreamStr[swissSettings.emulateAudioStream], option == SET_AUDIO_STREAM, false);
drawSettingEntryString(page, &page_y_ofs, "Emulate Read Speed:", emulateReadSpeedStr[swissSettings.emulateReadSpeed], option == SET_READ_SPEED, false);
drawSettingEntryBoolean(page, &page_y_ofs, "Emulate Broadband Adapter:", swissSettings.emulateEthernet, option == SET_EMULATE_ETHERNET, false);
drawSettingEntryBoolean(page, &page_y_ofs, "Prefer Clean Boot:", swissSettings.preferCleanBoot, option == SET_CLEAN_BOOT, false);
Expand Down Expand Up @@ -748,6 +755,15 @@ void settings_toggle(int page, int option, int direction, ConfigEntry *gameConfi
if(swissSettings.triggerLevel < 0)
swissSettings.triggerLevel = 200;
break;
case SET_DEFAULT_AUDIO_STREAM:
if(devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_AUDIO_STREAMING)) {
swissSettings.emulateAudioStream += direction;
if(swissSettings.emulateAudioStream > 2)
swissSettings.emulateAudioStream = 0;
if(swissSettings.emulateAudioStream < 0)
swissSettings.emulateAudioStream = 2;
}
break;
case SET_DEFAULT_READ_SPEED:
if(devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_READ_SPEED)) {
swissSettings.emulateReadSpeed += direction;
Expand Down Expand Up @@ -863,6 +879,15 @@ void settings_toggle(int page, int option, int direction, ConfigEntry *gameConfi
if(gameConfig->triggerLevel < 0)
gameConfig->triggerLevel = 200;
break;
case SET_AUDIO_STREAM:
if(devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_AUDIO_STREAMING)) {
gameConfig->emulateAudioStream += direction;
if(gameConfig->emulateAudioStream > 2)
gameConfig->emulateAudioStream = 0;
if(gameConfig->emulateAudioStream < 0)
gameConfig->emulateAudioStream = 2;
}
break;
case SET_READ_SPEED:
if(devices[DEVICE_CUR] == NULL || (devices[DEVICE_CUR]->emulable & EMU_READ_SPEED)) {
gameConfig->emulateReadSpeed += direction;
Expand Down
3 changes: 3 additions & 0 deletions cube/swiss/source/gui/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ enum SETTINGS_GAME_DEFAULTS {
SET_DEFAULT_INVERT_CAMERA,
SET_DEFAULT_SWAP_CAMERA,
SET_DEFAULT_TRIGGER_LEVEL,
SET_DEFAULT_AUDIO_STREAM,
SET_DEFAULT_READ_SPEED,
SET_DEFAULT_EMULATE_ETHERNET,
SET_DEFAULT_CLEAN_BOOT,
Expand All @@ -123,6 +124,7 @@ enum SETTINGS_GAME {
SET_INVERT_CAMERA,
SET_SWAP_CAMERA,
SET_TRIGGER_LEVEL,
SET_AUDIO_STREAM,
SET_READ_SPEED,
SET_EMULATE_ETHERNET,
SET_CLEAN_BOOT,
Expand All @@ -144,6 +146,7 @@ extern char *invertCStickStr[];
extern char *swapCStickStr[];
extern char *disableMCPGameIDStr[];
extern char *disableVideoPatchesStr[];
extern char *emulateAudioStreamStr[];
extern char *emulateReadSpeedStr[];
extern char *igrTypeStr[];
extern char *aveCompatStr[];
Expand Down
1 change: 1 addition & 0 deletions cube/swiss/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ int main(int argc, char *argv[])
swissSettings.exiSpeed = 1; // 32MHz
swissSettings.uiVMode = 0; // Auto UI mode
swissSettings.gameVMode = 0; // Auto video mode
swissSettings.emulateAudioStream = 1;
swissSettings.ftpPort = 21;
swissSettings.fspPort = 21;
swissSettings.fspPathMtu = 1500;
Expand Down
4 changes: 4 additions & 0 deletions cube/swiss/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ int install_code(int final)
patch = gcloader_v2_bin;
patchSize = gcloader_v2_bin_size;
break;
case EMU_READ | EMU_AUDIO_STREAMING:
patch = gcloader_v2_dtk_bin;
patchSize = gcloader_v2_dtk_bin_size;
break;
case EMU_READ | EMU_MEMCARD:
patch = gcloader_v2_card_bin;
patchSize = gcloader_v2_card_bin_size;
Expand Down

0 comments on commit 73c40e7

Please sign in to comment.