mirror of
https://github.com/polpo/picogus.git
synced 2026-10-25 21:40:16 +00:00
Rename MODE_ to CMD_ to be less confusing
This commit is contained in:
1 parent
fb8638eca1
commit
b2fc8ea00d
8 files changed
+305
-304
No files matched your search
+45
-45
@@ -47,56 +47,56 @@ static const char *modenames[8] = {
|
||||
"NE2000"
|
||||
};
|
||||
|
||||
#define MODE_MAGIC 0x00 // Magic string
|
||||
#define MODE_PROTOCOL 0x01 // Protocol version
|
||||
#define MODE_FWSTRING 0x02 // Firmware string
|
||||
#define MODE_BOOTMODE 0x03 // Mode (GUS, OPL, MPU, etc...)
|
||||
#define MODE_GUSPORT 0x04 // GUS Base port
|
||||
#define MODE_OPLPORT 0x05 // Adlib Base port
|
||||
#define MODE_SBPORT 0x06 // SB Base port
|
||||
#define MODE_MPUPORT 0x07 // MPU Base port
|
||||
#define MODE_TANDYPORT 0x08 // Tandy Base port
|
||||
#define MODE_CMSPORT 0x09 // CMS Base port
|
||||
#define MODE_JOYEN 0x0f // enable joystick
|
||||
#define CMD_MAGIC 0x00 // Magic string
|
||||
#define CMD_PROTOCOL 0x01 // Protocol version
|
||||
#define CMD_FWSTRING 0x02 // Firmware string
|
||||
#define CMD_BOOTMODE 0x03 // Mode (GUS, OPL, MPU, etc...)
|
||||
#define CMD_GUSPORT 0x04 // GUS Base port
|
||||
#define CMD_OPLPORT 0x05 // Adlib Base port
|
||||
#define CMD_SBPORT 0x06 // SB Base port
|
||||
#define CMD_MPUPORT 0x07 // MPU Base port
|
||||
#define CMD_TANDYPORT 0x08 // Tandy Base port
|
||||
#define CMD_CMSPORT 0x09 // CMS Base port
|
||||
#define CMD_JOYEN 0x0f // enable joystick
|
||||
|
||||
#define MODE_GUSBUF 0x10 // Audio buffer size
|
||||
#define MODE_GUSDMA 0x11 // DMA interval
|
||||
#define MODE_GUS44K 0x12 // Force 44k
|
||||
#define CMD_GUSBUF 0x10 // Audio buffer size
|
||||
#define CMD_GUSDMA 0x11 // DMA interval
|
||||
#define CMD_GUS44K 0x12 // Force 44k
|
||||
|
||||
#define MODE_WTVOL 0x20 // Wavetable mixer volume
|
||||
#define MODE_MPUDELAY 0x21 // MPU sysex delay
|
||||
#define MODE_MPUFAKE 0x22 // MPU fake all notes off
|
||||
#define CMD_WTVOL 0x20 // Wavetable mixer volume
|
||||
#define CMD_MPUDELAY 0x21 // MPU sysex delay
|
||||
#define CMD_MPUFAKE 0x22 // MPU fake all notes off
|
||||
|
||||
#define MODE_OPLWAIT 0x30 // Adlib speed sensitive fix
|
||||
#define CMD_OPLWAIT 0x30 // Adlib speed sensitive fix
|
||||
|
||||
#define MODE_MOUSEPORT 0x40 // Mouse Base port
|
||||
#define MODE_MOUSEPROTO 0x41 // Mouse protocol
|
||||
#define MODE_MOUSERATE 0x42 // Mouse report rate
|
||||
#define MODE_MOUSESEN 0x43 // Mouse sensitivity
|
||||
#define CMD_MOUSEPORT 0x40 // Mouse Base port
|
||||
#define CMD_MOUSEPROTO 0x41 // Mouse protocol
|
||||
#define CMD_MOUSERATE 0x42 // Mouse report rate
|
||||
#define CMD_MOUSESEN 0x43 // Mouse sensitivity
|
||||
|
||||
#define MODE_NE2KPORT 0x50 // NE2000 Base port
|
||||
#define MODE_WIFISSID 0x51 // WiFi SSID
|
||||
#define MODE_WIFIPASS 0x52 // WiFi password
|
||||
#define MODE_WIFIAPPLY 0x53 // apply WiFi settings
|
||||
#define MODE_WIFISTAT 0x54 // WiFi status
|
||||
#define CMD_NE2KPORT 0x50 // NE2000 Base port
|
||||
#define CMD_WIFISSID 0x51 // WiFi SSID
|
||||
#define CMD_WIFIPASS 0x52 // WiFi password
|
||||
#define CMD_WIFIAPPLY 0x53 // apply WiFi settings
|
||||
#define CMD_WIFISTAT 0x54 // WiFi status
|
||||
|
||||
#define MODE_CDPORT 0x60 // CD base port
|
||||
#define MODE_CDSTATUS 0x61 // Get CD image command status
|
||||
#define MODE_CDERROR 0x62 // Get CD image error
|
||||
#define MODE_CDLIST 0x63 // List CD images
|
||||
#define MODE_CDLOAD 0x64 // Load CD image or get loaded image index
|
||||
#define MODE_CDNAME 0x65 // Get name of loaded CD image
|
||||
#define MODE_CDAUTOADV 0x66 // Set autoadvance for CD image on USB reinsert
|
||||
#define CMD_CDPORT 0x60 // CD base port
|
||||
#define CMD_CDSTATUS 0x61 // Get CD image command status
|
||||
#define CMD_CDERROR 0x62 // Get CD image error
|
||||
#define CMD_CDLIST 0x63 // List CD images
|
||||
#define CMD_CDLOAD 0x64 // Load CD image or get loaded image index
|
||||
#define CMD_CDNAME 0x65 // Get name of loaded CD image
|
||||
#define CMD_CDAUTOADV 0x66 // Set autoadvance for CD image on USB reinsert
|
||||
|
||||
#define MODE_MAINVOL 0x70 // Main Volume
|
||||
#define MODE_OPLVOL 0x71 // Adlib volume
|
||||
#define MODE_SBVOL 0x72 // Sound Blaster volume
|
||||
#define MODE_CDVOL 0x73 // CD Audio Volume
|
||||
#define MODE_GUSVOL 0x74 // GUS Volume
|
||||
#define MODE_PSGVOL 0x75 // PSG Volume
|
||||
#define CMD_MAINVOL 0x70 // Main Volume
|
||||
#define CMD_OPLVOL 0x71 // Adlib volume
|
||||
#define CMD_SBVOL 0x72 // Sound Blaster volume
|
||||
#define CMD_CDVOL 0x73 // CD Audio Volume
|
||||
#define CMD_GUSVOL 0x74 // GUS Volume
|
||||
#define CMD_PSGVOL 0x75 // PSG Volume
|
||||
|
||||
#define MODE_DEFAULTS 0xE0 // Select reset to defaults register
|
||||
#define MODE_SAVE 0xE1 // Select save settings register
|
||||
#define MODE_REBOOT 0xE2 // Select reboot register
|
||||
#define MODE_HWTYPE 0xF0 // Hardware type
|
||||
#define MODE_FLASH 0xFF // Firmware write mode
|
||||
#define CMD_DEFAULTS 0xE0 // Select reset to defaults register
|
||||
#define CMD_SAVE 0xE1 // Select save settings register
|
||||
#define CMD_REBOOT 0xE2 // Select reboot register
|
||||
#define CMD_HWTYPE 0xF0 // Hardware type
|
||||
#define CMD_FLASH 0xFF // Firmware write mode
|
||||
+88
-88
@@ -205,7 +205,7 @@ static int init_gus(void) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
outp(CONTROL_PORT, MODE_GUSPORT); // Select port register
|
||||
outp(CONTROL_PORT, CMD_GUSPORT); // Select port register
|
||||
uint16_t tmp_port = inpw(DATA_PORT_LOW);
|
||||
if (port != tmp_port) {
|
||||
err_ultrasnd();
|
||||
@@ -253,7 +253,7 @@ static int init_sb(void) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
outp(CONTROL_PORT, MODE_SBPORT); // Select port register
|
||||
outp(CONTROL_PORT, CMD_SBPORT); // Select port register
|
||||
uint16_t tmp_port = inpw(DATA_PORT_LOW);
|
||||
if (port != tmp_port) {
|
||||
err_blaster();
|
||||
@@ -290,7 +290,7 @@ static bool wait_for_read(const uint8_t value) {
|
||||
|
||||
static cdrom_image_status_t wait_for_cd_status(void) {
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_CDSTATUS); // Select CD image status register
|
||||
outp(CONTROL_PORT, CMD_CDSTATUS); // Select CD image status register
|
||||
cdrom_image_status_t cd_status;
|
||||
for (uint16_t i = 0; i < 256; ++i) {
|
||||
delay(100);
|
||||
@@ -305,22 +305,22 @@ static cdrom_image_status_t wait_for_cd_status(void) {
|
||||
|
||||
static bool print_cdimage_list(void) {
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_CDLOAD); // Get currently loaded index
|
||||
outp(CONTROL_PORT, CMD_CDLOAD); // Get currently loaded index
|
||||
uint8_t current_index = inp(DATA_PORT_HIGH);
|
||||
printf("Listing CD images on USB drive:\n");
|
||||
|
||||
outp(CONTROL_PORT, MODE_CDLIST); // Select CD image list register
|
||||
outp(CONTROL_PORT, CMD_CDLIST); // Select CD image list register
|
||||
cdrom_image_status_t cd_status = wait_for_cd_status();
|
||||
if (cd_status == CD_STATUS_BUSY) {
|
||||
printf("Timeout getting CD image list\n");
|
||||
return false;
|
||||
} else if (cd_status == CD_STATUS_ERROR) {
|
||||
printf("Error getting CD image list: ");
|
||||
print_string(MODE_CDERROR);
|
||||
print_string(CMD_CDERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
outp(CONTROL_PORT, MODE_CDLIST); // Select CD image list register
|
||||
outp(CONTROL_PORT, CMD_CDLIST); // Select CD image list register
|
||||
char b[256], c, *p = b;
|
||||
uint8_t line = 1;
|
||||
|
||||
@@ -345,14 +345,14 @@ static bool print_cdimage_list(void) {
|
||||
|
||||
|
||||
static int print_cdimage_current(void) {
|
||||
outp(CONTROL_PORT, MODE_CDLOAD); // Get currently loaded index
|
||||
outp(CONTROL_PORT, CMD_CDLOAD); // Get currently loaded index
|
||||
uint8_t current_index = inp(DATA_PORT_HIGH);
|
||||
if (!current_index) {
|
||||
printf("No CD image loaded.\n");
|
||||
return 97;
|
||||
}
|
||||
printf("CD image loaded: ");
|
||||
print_string(MODE_CDNAME);
|
||||
print_string(CMD_CDNAME);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ static int wait_for_cd_load(void) {
|
||||
return 99;
|
||||
} else if ((int8_t)cd_status == CD_STATUS_ERROR) {
|
||||
printf("Error loading CD image: ");
|
||||
print_string(MODE_CDERROR);
|
||||
print_string(CMD_CDERROR);
|
||||
return 98;
|
||||
}
|
||||
return print_cdimage_current();
|
||||
@@ -372,9 +372,9 @@ static int wait_for_cd_load(void) {
|
||||
|
||||
|
||||
static void print_cdemu_status(void) {
|
||||
outp(CONTROL_PORT, MODE_CDAUTOADV); // Select joystick enable register
|
||||
outp(CONTROL_PORT, CMD_CDAUTOADV); // Select joystick enable register
|
||||
uint8_t tmp_uint8 = inp(DATA_PORT_HIGH);
|
||||
outp(CONTROL_PORT, MODE_CDPORT); // Select port register
|
||||
outp(CONTROL_PORT, CMD_CDPORT); // Select port register
|
||||
uint16_t tmp_uint16 = inpw(DATA_PORT_LOW); // Get port
|
||||
printf("CD-ROM emulation on port %x, image auto-advance %s\n", tmp_uint16, tmp_uint8 ? "enabled" : "disabled");
|
||||
|
||||
@@ -383,7 +383,7 @@ static void print_cdemu_status(void) {
|
||||
|
||||
|
||||
static void write_settings(void) {
|
||||
outp(CONTROL_PORT, MODE_SAVE); // Select save settings register
|
||||
outp(CONTROL_PORT, CMD_SAVE); // Select save settings register
|
||||
outp(DATA_PORT_HIGH, 0xff);
|
||||
printf("Settings saved to flash.\n");
|
||||
delay(100);
|
||||
@@ -393,7 +393,7 @@ static void write_settings(void) {
|
||||
static int reboot_to_firmware(const uint8_t value, const bool permanent) {
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
|
||||
outp(CONTROL_PORT, MODE_BOOTMODE); // Select firmware selection register
|
||||
outp(CONTROL_PORT, CMD_BOOTMODE); // Select firmware selection register
|
||||
outp(DATA_PORT_HIGH, value); // Send firmware number and permanent flag
|
||||
delay(100);
|
||||
|
||||
@@ -402,7 +402,7 @@ static int reboot_to_firmware(const uint8_t value, const bool permanent) {
|
||||
write_settings();
|
||||
}
|
||||
printf("Rebooting to fw: %s...\n", modenames[value]);
|
||||
outp(CONTROL_PORT, MODE_REBOOT); // Select reboot register
|
||||
outp(CONTROL_PORT, CMD_REBOOT); // Select reboot register
|
||||
outp(DATA_PORT_HIGH, 0xff);
|
||||
delay(100);
|
||||
|
||||
@@ -412,7 +412,7 @@ static int reboot_to_firmware(const uint8_t value, const bool permanent) {
|
||||
return 99;
|
||||
}
|
||||
printf("PicoGUS detected: Firmware version: ");
|
||||
print_string(MODE_FWSTRING);
|
||||
print_string(CMD_FWSTRING);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -488,7 +488,7 @@ static int write_firmware(const char* fw_filename) {
|
||||
|
||||
// Put card into programming mode
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_FLASH); // Select firmware programming mode
|
||||
outp(CONTROL_PORT, CMD_FLASH); // Select firmware programming mode
|
||||
// Wait a bit for 2nd core on Pico to restart
|
||||
delay(100);
|
||||
if (!wait_for_read(PICO_FIRMWARE_IDLE)) {
|
||||
@@ -528,7 +528,7 @@ static int write_firmware(const char* fw_filename) {
|
||||
return 15;
|
||||
}
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_FLASH); // Select firmware programming mode, which will reboot the card in DONE
|
||||
outp(CONTROL_PORT, CMD_FLASH); // Select firmware programming mode, which will reboot the card in DONE
|
||||
}
|
||||
}
|
||||
print_progress_bar(i + 1, numBlocks);
|
||||
@@ -543,14 +543,14 @@ static int write_firmware(const char* fw_filename) {
|
||||
return 99;
|
||||
}
|
||||
printf("PicoGUS detected: Firmware version: ");
|
||||
print_string(MODE_FWSTRING);
|
||||
print_string(CMD_FWSTRING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void wifi_printStatus(void)
|
||||
{
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_WIFISTAT); // Select WiFi status mode
|
||||
outp(CONTROL_PORT, CMD_WIFISTAT); // Select WiFi status mode
|
||||
outp(DATA_PORT_HIGH, 0); // Write to start getting the status
|
||||
|
||||
printf("WiFi status: ");
|
||||
@@ -801,7 +801,7 @@ static int envGetHex(const char *env, const char *key, const char *delims, int m
|
||||
|
||||
void setBlaster()
|
||||
{
|
||||
int mode = MODE_SBPORT;
|
||||
int mode = CMD_SBPORT;
|
||||
outp(CONTROL_PORT, mode);
|
||||
outpw(DATA_PORT_LOW, (uint16_t)envGetHex("BLASTER", "A", " ", mode));
|
||||
|
||||
@@ -815,7 +815,7 @@ static void cmdSetBlaster(char *argv[], int i, int mode)
|
||||
|
||||
void setUltrasnd()
|
||||
{
|
||||
int mode = MODE_GUSPORT;
|
||||
int mode = CMD_GUSPORT;
|
||||
outp(CONTROL_PORT, mode);
|
||||
outpw(DATA_PORT_LOW, (uint16_t)envGetHex("ULTRASND", "", ",", mode));
|
||||
|
||||
@@ -881,7 +881,7 @@ static void cmdSendMousePort(char *argv[], int i, int mode)
|
||||
return;
|
||||
}
|
||||
|
||||
outp(CONTROL_PORT, MODE_MOUSEPORT);
|
||||
outp(CONTROL_PORT, CMD_MOUSEPORT);
|
||||
outpw(DATA_PORT_LOW, port);
|
||||
|
||||
}
|
||||
@@ -988,41 +988,41 @@ ParseCommand parseCommands[] = {
|
||||
{"/save", cmdSave, 0, ARG_NONE},
|
||||
{"/?", cmdDisplayUsage, 0, ARG_NONE},
|
||||
{"/??", cmdDisplayUsage, 1, ARG_NONE},
|
||||
{"/joy", cmdSendBool, MODE_JOYEN, ARG_REQUIRE},
|
||||
{"/joy", cmdSendBool, CMD_JOYEN, ARG_REQUIRE},
|
||||
{"/mode", cmdSetMode, 0, ARG_REQUIRE},
|
||||
{"/wtvol", cmdSetVol, MODE_WTVOL, ARG_REQUIRE},
|
||||
{"/gus44k", cmdSendBool, MODE_GUS44K, ARG_REQUIRE, "false"},
|
||||
{"/gusbuf", cmdGUSBuffer, MODE_GUSBUF, ARG_REQUIRE, "4"},
|
||||
{"/gusdma", cmdSendUint8, MODE_GUSDMA, ARG_REQUIRE, "0"},
|
||||
{"/gusport", cmdSetUltrasnd, MODE_GUSPORT, ARG_NONE, "240"},
|
||||
{"/sbport", cmdSetBlaster, MODE_SBPORT, ARG_NONE, "220"},
|
||||
{"/oplport", cmdSendPort, MODE_OPLPORT, ARG_REQUIRE, "388"},
|
||||
{"/oplwait", cmdSendBool, MODE_OPLWAIT, ARG_REQUIRE, "false"},
|
||||
{"/mpuport", cmdSendPort, MODE_MPUPORT, ARG_REQUIRE, "330"},
|
||||
{"/mpudelay", cmdSendBool, MODE_MPUDELAY, ARG_REQUIRE, "false"},
|
||||
{"/mpufake", cmdSendBool, MODE_MPUFAKE, ARG_REQUIRE, "false"},
|
||||
{"/tandyport", cmdSendPort, MODE_TANDYPORT, ARG_REQUIRE, "2c0"},
|
||||
{"/cmsport", cmdSendPort, MODE_CMSPORT, ARG_REQUIRE, "220"},
|
||||
{"/mousecom", cmdSendMousePort, MODE_MOUSEPORT, ARG_REQUIRE, "0"},
|
||||
{"/mousesen", cmdSendMouseSen, MODE_MOUSESEN, ARG_REQUIRE, "256"},
|
||||
{"/mouseproto", cmdSendMouseProto, MODE_MOUSEPROTO, ARG_REQUIRE, "0"},
|
||||
{"/mouserate", cmdSendMouseRate, MODE_MOUSERATE, ARG_REQUIRE, "60"},
|
||||
{"/ne2kport", cmdSendPort, MODE_NE2KPORT, ARG_REQUIRE, "300"},
|
||||
{"/wtvol", cmdSetVol, CMD_WTVOL, ARG_REQUIRE},
|
||||
{"/gus44k", cmdSendBool, CMD_GUS44K, ARG_REQUIRE, "false"},
|
||||
{"/gusbuf", cmdGUSBuffer, CMD_GUSBUF, ARG_REQUIRE, "4"},
|
||||
{"/gusdma", cmdSendUint8, CMD_GUSDMA, ARG_REQUIRE, "0"},
|
||||
{"/gusport", cmdSetUltrasnd, CMD_GUSPORT, ARG_NONE, "240"},
|
||||
{"/sbport", cmdSetBlaster, CMD_SBPORT, ARG_NONE, "220"},
|
||||
{"/oplport", cmdSendPort, CMD_OPLPORT, ARG_REQUIRE, "388"},
|
||||
{"/oplwait", cmdSendBool, CMD_OPLWAIT, ARG_REQUIRE, "false"},
|
||||
{"/mpuport", cmdSendPort, CMD_MPUPORT, ARG_REQUIRE, "330"},
|
||||
{"/mpudelay", cmdSendBool, CMD_MPUDELAY, ARG_REQUIRE, "false"},
|
||||
{"/mpufake", cmdSendBool, CMD_MPUFAKE, ARG_REQUIRE, "false"},
|
||||
{"/tandyport", cmdSendPort, CMD_TANDYPORT, ARG_REQUIRE, "2c0"},
|
||||
{"/cmsport", cmdSendPort, CMD_CMSPORT, ARG_REQUIRE, "220"},
|
||||
{"/mousecom", cmdSendMousePort, CMD_MOUSEPORT, ARG_REQUIRE, "0"},
|
||||
{"/mousesen", cmdSendMouseSen, CMD_MOUSESEN, ARG_REQUIRE, "256"},
|
||||
{"/mouseproto", cmdSendMouseProto, CMD_MOUSEPROTO, ARG_REQUIRE, "0"},
|
||||
{"/mouserate", cmdSendMouseRate, CMD_MOUSERATE, ARG_REQUIRE, "60"},
|
||||
{"/ne2kport", cmdSendPort, CMD_NE2KPORT, ARG_REQUIRE, "300"},
|
||||
{"/wifistatus", cmdSendPort, 0, ARG_NONE},
|
||||
{"/wifissid", cmdWifiSSID, MODE_WIFISSID, ARG_REQUIRE},
|
||||
{"/wifipass", cmdWifiPass, MODE_WIFIPASS, ARG_REQUIRE},
|
||||
{"/wifinopass", cmdWifiNoPass, MODE_WIFIPASS, ARG_NONE},
|
||||
{"/cdport", cmdSendPort, MODE_CDPORT, ARG_REQUIRE, "250"},
|
||||
{"/wifissid", cmdWifiSSID, CMD_WIFISSID, ARG_REQUIRE},
|
||||
{"/wifipass", cmdWifiPass, CMD_WIFIPASS, ARG_REQUIRE},
|
||||
{"/wifinopass", cmdWifiNoPass, CMD_WIFIPASS, ARG_NONE},
|
||||
{"/cdport", cmdSendPort, CMD_CDPORT, ARG_REQUIRE, "250"},
|
||||
{"/cdlist", cmdCDList, 0, ARG_NONE},
|
||||
{"/cdload", cmdCDLoad, MODE_CDLOAD, ARG_REQUIRE},
|
||||
{"/cdauto", cmdSendBool, MODE_CDAUTOADV, ARG_REQUIRE, "true"},
|
||||
{"/cdloadname", cmdCDLoadName, MODE_CDNAME, ARG_REQUIRE},
|
||||
{"/mainvol", cmdSetVol, MODE_MAINVOL, ARG_REQUIRE, "100"},
|
||||
{"/oplvol", cmdSetVol, MODE_OPLVOL, ARG_REQUIRE, "80"},
|
||||
{"/sbvol", cmdSetVol, MODE_SBVOL, ARG_REQUIRE, "100"},
|
||||
{"/cdvol", cmdSetVol, MODE_CDVOL, ARG_REQUIRE, "100"},
|
||||
{"/gusvol", cmdSetVol, MODE_GUSVOL, ARG_REQUIRE, "100"},
|
||||
{"/psgvol", cmdSetVol, MODE_PSGVOL, ARG_REQUIRE, "100"},
|
||||
{"/cdload", cmdCDLoad, CMD_CDLOAD, ARG_REQUIRE},
|
||||
{"/cdauto", cmdSendBool, CMD_CDAUTOADV, ARG_REQUIRE, "true"},
|
||||
{"/cdloadname", cmdCDLoadName, CMD_CDNAME, ARG_REQUIRE},
|
||||
{"/mainvol", cmdSetVol, CMD_MAINVOL, ARG_REQUIRE, "100"},
|
||||
{"/oplvol", cmdSetVol, CMD_OPLVOL, ARG_REQUIRE, "80"},
|
||||
{"/sbvol", cmdSetVol, CMD_SBVOL, ARG_REQUIRE, "100"},
|
||||
{"/cdvol", cmdSetVol, CMD_CDVOL, ARG_REQUIRE, "100"},
|
||||
{"/gusvol", cmdSetVol, CMD_GUSVOL, ARG_REQUIRE, "100"},
|
||||
{"/psgvol", cmdSetVol, CMD_PSGVOL, ARG_REQUIRE, "100"},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -1107,16 +1107,16 @@ static uint16_t ctrlGetPort(int mode)
|
||||
|
||||
static void printPicoGus()
|
||||
{
|
||||
printf("USB joystick support %s\n", ctrlGetUint8(MODE_JOYEN) ? "enabled" : "disabled");
|
||||
printf("USB joystick support %s\n", ctrlGetUint8(CMD_JOYEN) ? "enabled" : "disabled");
|
||||
|
||||
if (board_type == PICOGUS_2) {
|
||||
printf("Wavetable volume set to %u\n", ctrlGetUint8(MODE_WTVOL));
|
||||
printf("Wavetable volume set to %u\n", ctrlGetUint8(CMD_WTVOL));
|
||||
}
|
||||
|
||||
uint16_t mpuPort = ctrlGetPort(MODE_MPUPORT);
|
||||
uint16_t mpuPort = ctrlGetPort(CMD_MPUPORT);
|
||||
if (mpuPort) {
|
||||
printf("MPU-401: port %x; sysex delay: %s, ", mpuPort, ctrlGetUint8(MODE_MPUDELAY) ? "on" : "off");
|
||||
printf("fake all notes off: %s\n", ctrlGetUint8(MODE_MPUFAKE) ? "on" : "off");
|
||||
printf("MPU-401: port %x; sysex delay: %s, ", mpuPort, ctrlGetUint8(CMD_MPUDELAY) ? "on" : "off");
|
||||
printf("fake all notes off: %s\n", ctrlGetUint8(CMD_MPUFAKE) ? "on" : "off");
|
||||
} else {
|
||||
printf("MPU-401 disabled\n");
|
||||
}
|
||||
@@ -1129,9 +1129,9 @@ static void printGUSMode()
|
||||
return;
|
||||
}
|
||||
printf("GUS mode: ");
|
||||
printf("Audio buffer: %u samples; ", ctrlGetUint16(MODE_GUSBUF) + 1);
|
||||
printf("Audio buffer: %u samples; ", ctrlGetUint16(CMD_GUSBUF) + 1);
|
||||
|
||||
uint8_t tmp_uint8 = ctrlGetUint8(MODE_GUSDMA);
|
||||
uint8_t tmp_uint8 = ctrlGetUint8(CMD_GUSDMA);
|
||||
if (tmp_uint8 == 0)
|
||||
{
|
||||
printf("DMA interval: default; ");
|
||||
@@ -1141,7 +1141,7 @@ static void printGUSMode()
|
||||
printf("DMA interval: %u us; ", tmp_uint8);
|
||||
}
|
||||
|
||||
tmp_uint8 = ctrlGetUint8(MODE_GUS44K);
|
||||
tmp_uint8 = ctrlGetUint8(CMD_GUS44K);
|
||||
if (tmp_uint8)
|
||||
{
|
||||
printf("Sample rate: fixed 44.1k\n");
|
||||
@@ -1151,13 +1151,13 @@ static void printGUSMode()
|
||||
printf("Sample rate: variable\n");
|
||||
}
|
||||
|
||||
printf("Running in GUS mode on port %x\n", ctrlGetPort(MODE_GUSPORT));
|
||||
printf("Running in GUS mode on port %x\n", ctrlGetPort(CMD_GUSPORT));
|
||||
}
|
||||
|
||||
static void printAdlibMode()
|
||||
{
|
||||
printf("Running in AdLib/OPL2 mode on port %x", ctrlGetPort(MODE_OPLPORT));
|
||||
printf("%s\n", ctrlGetUint8(MODE_OPLWAIT) ? ", wait on" : "");
|
||||
printf("Running in AdLib/OPL2 mode on port %x", ctrlGetPort(CMD_OPLPORT));
|
||||
printf("%s\n", ctrlGetUint8(CMD_OPLWAIT) ? ", wait on" : "");
|
||||
}
|
||||
|
||||
static void printUSBMode()
|
||||
@@ -1168,8 +1168,8 @@ static void printUSBMode()
|
||||
|
||||
static void printPSGMode()
|
||||
{
|
||||
printf("Running in PSG mode (Tandy 3-voice on port %x, ", ctrlGetPort(MODE_TANDYPORT));
|
||||
printf("CMS/Game Blaster on port %x)\n", ctrlGetPort(MODE_CMSPORT));
|
||||
printf("Running in PSG mode (Tandy 3-voice on port %x, ", ctrlGetPort(CMD_TANDYPORT));
|
||||
printf("CMS/Game Blaster on port %x)\n", ctrlGetPort(CMD_CMSPORT));
|
||||
}
|
||||
|
||||
static void printSBMode()
|
||||
@@ -1178,13 +1178,13 @@ static void printSBMode()
|
||||
{
|
||||
return;
|
||||
}
|
||||
printf("Running in Sound Blaster 2.0 mode on port %x ", ctrlGetPort(MODE_SBPORT));
|
||||
outp(CONTROL_PORT, MODE_OPLPORT); // Select port register
|
||||
uint16_t tmp_uint16 = ctrlGetPort(MODE_OPLPORT);
|
||||
printf("Running in Sound Blaster 2.0 mode on port %x ", ctrlGetPort(CMD_SBPORT));
|
||||
outp(CONTROL_PORT, CMD_OPLPORT); // Select port register
|
||||
uint16_t tmp_uint16 = ctrlGetPort(CMD_OPLPORT);
|
||||
if (tmp_uint16)
|
||||
{
|
||||
printf("(AdLib port %x", tmp_uint16);
|
||||
printf("%s)\n", ctrlGetUint8(MODE_OPLWAIT) ? ", wait on" : "");
|
||||
printf("%s)\n", ctrlGetUint8(CMD_OPLWAIT) ? ", wait on" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1195,7 +1195,7 @@ static void printSBMode()
|
||||
|
||||
static void printNE2000Mode()
|
||||
{
|
||||
printf("Running in NE2000 mode on port %x\n", ctrlGetPort(MODE_NE2KPORT));
|
||||
printf("Running in NE2000 mode on port %x\n", ctrlGetPort(CMD_NE2KPORT));
|
||||
wifi_printStatus();
|
||||
}
|
||||
|
||||
@@ -1203,7 +1203,7 @@ static void printMultiMode()
|
||||
{
|
||||
if (gMode == USB_MODE || gMode == PSG_MODE || gMode == ADLIB_MODE)
|
||||
{
|
||||
uint16_t tmp_uint16 = ctrlGetPort(MODE_MOUSEPORT);
|
||||
uint16_t tmp_uint16 = ctrlGetPort(CMD_MOUSEPORT);
|
||||
printf("Serial Mouse ");
|
||||
switch (tmp_uint16)
|
||||
{
|
||||
@@ -1227,10 +1227,10 @@ static void printMultiMode()
|
||||
}
|
||||
if (tmp_uint16 != 0)
|
||||
{
|
||||
printf("Mouse report rate: %d Hz, ", ctrlGetUint8(MODE_MOUSERATE));
|
||||
printf("protocol: %s\n", mouse_protocol_str[ctrlGetUint8(MODE_MOUSEPROTO)]);
|
||||
printf("Mouse report rate: %d Hz, ", ctrlGetUint8(CMD_MOUSERATE));
|
||||
printf("protocol: %s\n", mouse_protocol_str[ctrlGetUint8(CMD_MOUSEPROTO)]);
|
||||
|
||||
tmp_uint16 = ctrlGetUint16(MODE_MOUSESEN);
|
||||
tmp_uint16 = ctrlGetUint16(CMD_MOUSESEN);
|
||||
printf("Mouse sensitivity: %d (%d.%02d)\n", tmp_uint16, (tmp_uint16 >> 8), ((tmp_uint16 & 0xFF) * 100) >> 8);
|
||||
}
|
||||
}
|
||||
@@ -1239,22 +1239,22 @@ static void printMultiMode()
|
||||
static void printVolume()
|
||||
{
|
||||
printf("Volume: ");
|
||||
printf("Main: %u ", ctrlGetUint8(MODE_MAINVOL));
|
||||
printf("Main: %u ", ctrlGetUint8(CMD_MAINVOL));
|
||||
|
||||
if (gMode == GUS_MODE)
|
||||
printf("GUS: %u ", ctrlGetUint8(MODE_GUSVOL));
|
||||
printf("GUS: %u ", ctrlGetUint8(CMD_GUSVOL));
|
||||
|
||||
if (gMode == SB_MODE)
|
||||
printf("SB: %u ", ctrlGetUint8(MODE_SBVOL));
|
||||
printf("SB: %u ", ctrlGetUint8(CMD_SBVOL));
|
||||
|
||||
if (gMode == SB_MODE || gMode == ADLIB_MODE)
|
||||
printf("OPL: %u ", ctrlGetUint8(MODE_OPLVOL));
|
||||
printf("OPL: %u ", ctrlGetUint8(CMD_OPLVOL));
|
||||
|
||||
if (gMode == SB_MODE || gMode == USB_MODE)
|
||||
printf("CD: %u ", ctrlGetUint8(MODE_CDVOL));
|
||||
printf("CD: %u ", ctrlGetUint8(CMD_CDVOL));
|
||||
|
||||
if (gMode == PSG_MODE)
|
||||
printf("PSG: %u ", ctrlGetUint8(MODE_PSGVOL));
|
||||
printf("PSG: %u ", ctrlGetUint8(CMD_PSGVOL));
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1269,13 +1269,13 @@ static init_status initPicoGUS()
|
||||
{
|
||||
// Get magic value from port on PicoGUS that is not on real GUS
|
||||
outp(CONTROL_PORT, 0xCC); // Knock on the door...
|
||||
outp(CONTROL_PORT, MODE_MAGIC); // Select magic string register
|
||||
outp(CONTROL_PORT, CMD_MAGIC); // Select magic string register
|
||||
if (inp(DATA_PORT_HIGH) != 0xDD) {
|
||||
err_pigus();
|
||||
return INIT_NOT_DETECTED;
|
||||
};
|
||||
printf("PicoGUS detected: Firmware version: ");
|
||||
print_string(MODE_FWSTRING);
|
||||
print_string(CMD_FWSTRING);
|
||||
|
||||
outp(CONTROL_PORT, 0x01); // Select protocol version register
|
||||
uint8_t protocol_got = inp(DATA_PORT_HIGH);
|
||||
@@ -1284,10 +1284,10 @@ static init_status initPicoGUS()
|
||||
return INIT_FW_MISMATCH;
|
||||
}
|
||||
|
||||
outp(CONTROL_PORT, MODE_BOOTMODE); // Select mode register
|
||||
outp(CONTROL_PORT, CMD_BOOTMODE); // Select mode register
|
||||
gMode = inp(DATA_PORT_HIGH);
|
||||
|
||||
outp(CONTROL_PORT, MODE_HWTYPE); // Select hardware type register
|
||||
outp(CONTROL_PORT, CMD_HWTYPE); // Select hardware type register
|
||||
board_type = inp(DATA_PORT_HIGH);
|
||||
if (board_type == PICO_BASED) {
|
||||
printf("Hardware: PicoGUS v1.x or PicoGUS Femto\n");
|
||||
@@ -1337,7 +1337,7 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
if (wifichg)
|
||||
ctrlSendUint8("0", MODE_WIFIAPPLY, 0, 255);
|
||||
ctrlSendUint8("0", CMD_WIFIAPPLY, 0, 255);
|
||||
|
||||
printPicoGus();
|
||||
printVolume();
|
||||
|
||||
+1
-1
@@ -608,7 +608,7 @@ cdrom_global_init(void)
|
||||
memset(&cdrom, 0x00, sizeof(cdrom));
|
||||
cdrom.error_str = cdrom_errorstr_get();
|
||||
cdrom.current_sector_samples = (int16_t*)cdrom.audio_sector_buffer;
|
||||
set_volume(MODE_CDVOL);
|
||||
set_volume(CMD_CDVOL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+1
-1
@@ -1889,5 +1889,5 @@ void GUS_Setup() {
|
||||
interp_set_config(interp0, 1, &cfg);
|
||||
#endif
|
||||
clamp_setup();
|
||||
set_volume(MODE_GUSVOL);
|
||||
set_volume(CMD_GUSVOL);
|
||||
}
|
||||
+156
-155
@@ -169,60 +169,60 @@ __force_inline void select_picogus(uint8_t value) {
|
||||
// printf("select picogus %x\n", value);
|
||||
sel_reg = value;
|
||||
switch (sel_reg) {
|
||||
case MODE_MAGIC: // Magic string
|
||||
case MODE_PROTOCOL: // Protocol version
|
||||
case CMD_MAGIC: // Magic string
|
||||
case CMD_PROTOCOL: // Protocol version
|
||||
break;
|
||||
case MODE_FWSTRING: // Firmware string
|
||||
case CMD_FWSTRING: // Firmware string
|
||||
cur_read = 0;
|
||||
break;
|
||||
case MODE_BOOTMODE: // Mode (GUS, OPL, MPU, etc...)
|
||||
case CMD_BOOTMODE: // Mode (GUS, OPL, MPU, etc...)
|
||||
break;
|
||||
case MODE_GUSPORT: // GUS Base port
|
||||
case MODE_OPLPORT: // Adlib Base port
|
||||
case MODE_SBPORT: // SB Base port
|
||||
case MODE_MPUPORT: // MPU Base port
|
||||
case MODE_TANDYPORT: // Tandy Base port
|
||||
case MODE_CMSPORT: // CMS Base port
|
||||
case CMD_GUSPORT: // GUS Base port
|
||||
case CMD_OPLPORT: // Adlib Base port
|
||||
case CMD_SBPORT: // SB Base port
|
||||
case CMD_MPUPORT: // MPU Base port
|
||||
case CMD_TANDYPORT: // Tandy Base port
|
||||
case CMD_CMSPORT: // CMS Base port
|
||||
basePort_low = 0;
|
||||
break;
|
||||
case MODE_JOYEN: // enable joystick
|
||||
case CMD_JOYEN: // enable joystick
|
||||
break;
|
||||
case MODE_GUSBUF: // Audio buffer size
|
||||
case MODE_GUSDMA: // DMA interval
|
||||
case MODE_GUS44K: // Force 44k
|
||||
case CMD_GUSBUF: // Audio buffer size
|
||||
case CMD_GUSDMA: // DMA interval
|
||||
case CMD_GUS44K: // Force 44k
|
||||
break;
|
||||
case MODE_WTVOL: // Wavetable mixer volume
|
||||
case CMD_WTVOL: // Wavetable mixer volume
|
||||
break;
|
||||
case MODE_MPUDELAY: // MPU sysex delay
|
||||
case MODE_MPUFAKE: // MPU fake all notes off
|
||||
case CMD_MPUDELAY: // MPU sysex delay
|
||||
case CMD_MPUFAKE: // MPU fake all notes off
|
||||
break;
|
||||
case MODE_OPLWAIT: // Adlib speed sensitive fix
|
||||
case CMD_OPLWAIT: // Adlib speed sensitive fix
|
||||
break;
|
||||
case MODE_MOUSEPORT:
|
||||
case CMD_MOUSEPORT:
|
||||
basePort_low = 0;
|
||||
break;
|
||||
case MODE_MOUSEPROTO:
|
||||
case MODE_MOUSERATE:
|
||||
case MODE_MOUSESEN:
|
||||
case CMD_MOUSEPROTO:
|
||||
case CMD_MOUSERATE:
|
||||
case CMD_MOUSESEN:
|
||||
break;
|
||||
case MODE_NE2KPORT:
|
||||
case CMD_NE2KPORT:
|
||||
basePort_low = 0;
|
||||
break;
|
||||
case MODE_WIFISSID:
|
||||
case CMD_WIFISSID:
|
||||
memset(settings.WiFi.ssid, 0, sizeof(settings.WiFi.ssid));
|
||||
cur_write = 0;
|
||||
break;
|
||||
case MODE_WIFIPASS:
|
||||
case CMD_WIFIPASS:
|
||||
memset(settings.WiFi.password, 0, sizeof(settings.WiFi.password));
|
||||
cur_write = 0;
|
||||
break;
|
||||
case MODE_WIFIAPPLY:
|
||||
case MODE_WIFISTAT:
|
||||
case CMD_WIFIAPPLY:
|
||||
case CMD_WIFISTAT:
|
||||
break;
|
||||
case MODE_CDPORT: // CMS Base port
|
||||
case CMD_CDPORT: // CMS Base port
|
||||
basePort_low = 0;
|
||||
break;
|
||||
case MODE_CDLIST:
|
||||
case CMD_CDLIST:
|
||||
#ifdef CDROM
|
||||
if (cdrom.image_status == CD_STATUS_IDLE) {
|
||||
cdrom.image_status = CD_STATUS_BUSY;
|
||||
@@ -234,28 +234,28 @@ __force_inline void select_picogus(uint8_t value) {
|
||||
cur_read_idx = 0;
|
||||
#endif
|
||||
break;
|
||||
case MODE_CDSTATUS:
|
||||
case MODE_CDLOAD:
|
||||
case MODE_CDAUTOADV:
|
||||
case MODE_MAINVOL:
|
||||
case MODE_OPLVOL:
|
||||
case MODE_SBVOL:
|
||||
case MODE_CDVOL:
|
||||
case MODE_GUSVOL:
|
||||
case MODE_PSGVOL:
|
||||
case CMD_CDSTATUS:
|
||||
case CMD_CDLOAD:
|
||||
case CMD_CDAUTOADV:
|
||||
case CMD_MAINVOL:
|
||||
case CMD_OPLVOL:
|
||||
case CMD_SBVOL:
|
||||
case CMD_CDVOL:
|
||||
case CMD_GUSVOL:
|
||||
case CMD_PSGVOL:
|
||||
break;
|
||||
case MODE_CDNAME:
|
||||
case CMD_CDNAME:
|
||||
cur_write = 0;
|
||||
case MODE_CDERROR:
|
||||
case CMD_CDERROR:
|
||||
cur_read = 0;
|
||||
break;
|
||||
case MODE_SAVE: // Select save settings register
|
||||
case MODE_REBOOT: // Select reboot register
|
||||
case MODE_DEFAULTS: // Select reset to defaults register
|
||||
case CMD_SAVE: // Select save settings register
|
||||
case CMD_REBOOT: // Select reboot register
|
||||
case CMD_DEFAULTS: // Select reset to defaults register
|
||||
break;
|
||||
case MODE_HWTYPE: // Hardware version
|
||||
case CMD_HWTYPE: // Hardware version
|
||||
break;
|
||||
case MODE_FLASH: // Firmware write mode
|
||||
case CMD_FLASH: // Firmware write mode
|
||||
pico_firmware_start();
|
||||
break;
|
||||
default:
|
||||
@@ -266,17 +266,17 @@ __force_inline void select_picogus(uint8_t value) {
|
||||
|
||||
__force_inline void write_picogus_low(uint8_t value) {
|
||||
switch (sel_reg) {
|
||||
case MODE_GUSPORT: // GUS Base port
|
||||
case MODE_OPLPORT: // Adlib Base port
|
||||
case MODE_SBPORT: // SB Base port
|
||||
case MODE_MPUPORT: // MPU Base port
|
||||
case MODE_TANDYPORT: // Tandy Base port
|
||||
case MODE_CMSPORT: // CMS Base port
|
||||
case MODE_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
case MODE_CDPORT: // USB Mouse port (0 - disabled)
|
||||
case CMD_GUSPORT: // GUS Base port
|
||||
case CMD_OPLPORT: // Adlib Base port
|
||||
case CMD_SBPORT: // SB Base port
|
||||
case CMD_MPUPORT: // MPU Base port
|
||||
case CMD_TANDYPORT: // Tandy Base port
|
||||
case CMD_CMSPORT: // CMS Base port
|
||||
case CMD_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
case CMD_CDPORT: // USB Mouse port (0 - disabled)
|
||||
basePort_low = value;
|
||||
break;
|
||||
case MODE_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
case CMD_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
mouseSensitivity_low = value;
|
||||
break;
|
||||
}
|
||||
@@ -284,128 +284,128 @@ __force_inline void write_picogus_low(uint8_t value) {
|
||||
|
||||
__force_inline void write_picogus_high(uint8_t value) {
|
||||
switch (sel_reg) {
|
||||
case MODE_GUSPORT: // GUS Base port
|
||||
case CMD_GUSPORT: // GUS Base port
|
||||
settings.GUS.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
#ifdef SOUND_GUS
|
||||
gus_port_test = settings.GUS.basePort >> 4 | 0x10;
|
||||
#endif
|
||||
break;
|
||||
case MODE_OPLPORT: // Adlib Base port
|
||||
case CMD_OPLPORT: // Adlib Base port
|
||||
settings.SB.oplBasePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_SBPORT: // SB Base port
|
||||
case CMD_SBPORT: // SB Base port
|
||||
settings.SB.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
#ifdef SOUND_SB
|
||||
sb_port_test = settings.SB.basePort >> 4;
|
||||
#endif
|
||||
break;
|
||||
case MODE_MPUPORT: // MPU Base port
|
||||
case CMD_MPUPORT: // MPU Base port
|
||||
settings.MPU.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_TANDYPORT: // Tandy Base port
|
||||
case CMD_TANDYPORT: // Tandy Base port
|
||||
settings.Tandy.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_CMSPORT: // CMS Base port
|
||||
case CMD_CMSPORT: // CMS Base port
|
||||
settings.CMS.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_JOYEN: // enable joystick
|
||||
case CMD_JOYEN: // enable joystick
|
||||
settings.Joy.basePort = value ? 0x201u : 0xffff;
|
||||
break;
|
||||
case MODE_GUSBUF: // GUS audio buffer size
|
||||
case CMD_GUSBUF: // GUS audio buffer size
|
||||
// Value is sent by pgusinit as the size - 1, so we need to add 1 back to it
|
||||
settings.GUS.audioBuffer = value + 1;
|
||||
#ifdef SOUND_GUS
|
||||
GUS_SetAudioBuffer(settings.GUS.audioBuffer);
|
||||
#endif
|
||||
break;
|
||||
case MODE_GUSDMA: // GUS DMA interval
|
||||
case CMD_GUSDMA: // GUS DMA interval
|
||||
settings.GUS.dmaInterval = value;
|
||||
#ifdef SOUND_GUS
|
||||
GUS_SetDMAInterval(settings.GUS.dmaInterval);
|
||||
#endif
|
||||
break;
|
||||
case MODE_GUS44K: // Force 44k output
|
||||
case CMD_GUS44K: // Force 44k output
|
||||
settings.GUS.force44k = value;
|
||||
#ifdef SOUND_GUS
|
||||
GUS_SetFixed44k(settings.GUS.force44k);
|
||||
#endif
|
||||
break;
|
||||
case MODE_WTVOL: // Wavetable mixer volume
|
||||
case CMD_WTVOL: // Wavetable mixer volume
|
||||
settings.Global.waveTableVolume = value;
|
||||
if (BOARD_TYPE == PICOGUS_2) {
|
||||
m62429->setVolume(M62429_BOTH, settings.Global.waveTableVolume);
|
||||
}
|
||||
break;
|
||||
case MODE_MPUDELAY: // MPU SYSEX delay
|
||||
case CMD_MPUDELAY: // MPU SYSEX delay
|
||||
settings.MPU.delaySysex = value;
|
||||
#ifdef SOUND_MPU
|
||||
MPU401_Init(settings.MPU.delaySysex, settings.MPU.fakeAllNotesOff);
|
||||
#endif
|
||||
break;
|
||||
case MODE_MPUFAKE: // MPU fake all notes off
|
||||
case CMD_MPUFAKE: // MPU fake all notes off
|
||||
settings.MPU.fakeAllNotesOff = value;
|
||||
#ifdef SOUND_MPU
|
||||
MPU401_Init(settings.MPU.delaySysex, settings.MPU.fakeAllNotesOff);
|
||||
#endif
|
||||
break;
|
||||
case MODE_OPLWAIT: // Adlib speed sensitive fix
|
||||
case CMD_OPLWAIT: // Adlib speed sensitive fix
|
||||
settings.SB.oplSpeedSensitive = value;
|
||||
break;
|
||||
case MODE_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
case CMD_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
settings.Mouse.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_MOUSEPROTO: // USB Mouse protocol
|
||||
case CMD_MOUSEPROTO: // USB Mouse protocol
|
||||
settings.Mouse.protocol = value;
|
||||
#ifdef USB_MOUSE
|
||||
sermouse_set_protocol(settings.Mouse.protocol);
|
||||
#endif
|
||||
break;
|
||||
case MODE_MOUSERATE: // USB Mouse Report Rate
|
||||
case CMD_MOUSERATE: // USB Mouse Report Rate
|
||||
settings.Mouse.reportRate = value;
|
||||
#ifdef USB_MOUSE
|
||||
sermouse_set_report_rate_hz(settings.Mouse.reportRate);
|
||||
#endif
|
||||
break;
|
||||
case MODE_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
case CMD_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
settings.Mouse.sensitivity = (value << 8) | (mouseSensitivity_low & 0xFF);
|
||||
#ifdef USB_MOUSE
|
||||
sermouse_set_sensitivity(settings.Mouse.sensitivity);
|
||||
#endif
|
||||
break;
|
||||
case MODE_NE2KPORT: // NE2000 Base port
|
||||
case CMD_NE2KPORT: // NE2000 Base port
|
||||
settings.NE2K.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
break;
|
||||
case MODE_WIFISSID:
|
||||
case CMD_WIFISSID:
|
||||
settings.WiFi.ssid[cur_write++] = value;
|
||||
break;
|
||||
case MODE_WIFIPASS:
|
||||
case CMD_WIFIPASS:
|
||||
settings.WiFi.password[cur_write++] = value;
|
||||
/* printf("%s\n", settings.WiFi.password); */
|
||||
break;
|
||||
case MODE_WIFIAPPLY:
|
||||
case CMD_WIFIAPPLY:
|
||||
printf("Applying wifi settings: %s %s\n", settings.WiFi.ssid, settings.WiFi.password);
|
||||
#ifdef PICOW
|
||||
PG_Wifi_Connect(settings.WiFi.ssid, settings.WiFi.password);
|
||||
#endif
|
||||
break;
|
||||
case MODE_WIFISTAT:
|
||||
case CMD_WIFISTAT:
|
||||
#ifdef PICOW
|
||||
multicore_fifo_push_blocking(FIFO_WIFI_STATUS);
|
||||
#endif
|
||||
break;
|
||||
case MODE_CDPORT: // CD Base port
|
||||
case CMD_CDPORT: // CD Base port
|
||||
settings.CD.basePort = (value || basePort_low) ? ((value << 8) | basePort_low) : 0xFFFF;
|
||||
#ifdef CDROM
|
||||
cdrom_port_test = settings.CD.basePort >> 4;
|
||||
#endif
|
||||
break;
|
||||
#ifdef CDROM
|
||||
case MODE_CDLOAD: // Load CD image
|
||||
case CMD_CDLOAD: // Load CD image
|
||||
cdrom.image_data = value;
|
||||
cdrom.image_status = CD_STATUS_BUSY;
|
||||
cdrom.image_command = CD_COMMAND_IMAGE_LOAD_INDEX;
|
||||
break;
|
||||
case MODE_CDNAME:
|
||||
case CMD_CDNAME:
|
||||
if (!cur_write) {
|
||||
memset(cdrom.image_path, 0, sizeof(cdrom.image_path));
|
||||
}
|
||||
@@ -417,69 +417,69 @@ __force_inline void write_picogus_high(uint8_t value) {
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case MODE_CDAUTOADV: // enable auto advance of CD image on USB reinsert
|
||||
case CMD_CDAUTOADV: // enable auto advance of CD image on USB reinsert
|
||||
settings.CD.autoAdvance = value;
|
||||
#ifdef CDROM
|
||||
cdman_set_autoadvance(settings.CD.autoAdvance);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case MODE_MAINVOL: // Set the volume for CD Audio
|
||||
case CMD_MAINVOL: // Set the volume for CD Audio
|
||||
settings.Volume.mainVol = value;
|
||||
|
||||
#if SOUND_GUS || SOUND_SB || SOUND_OPL || CDROM || SOUND_TANDY || SOUND_CMS
|
||||
set_volume(MODE_MAINVOL);
|
||||
set_volume(CMD_MAINVOL);
|
||||
#endif
|
||||
break;
|
||||
case MODE_OPLVOL: // Set the volume for Adlib
|
||||
case CMD_OPLVOL: // Set the volume for Adlib
|
||||
settings.Volume.oplVol = value;
|
||||
#ifdef SOUND_SB
|
||||
set_volume(MODE_OPLVOL);
|
||||
#ifdef SOUND_OPL
|
||||
set_volume(CMD_OPLVOL);
|
||||
#endif
|
||||
break;
|
||||
case MODE_SBVOL: // Set the volume for Sound Blaster
|
||||
case CMD_SBVOL: // Set the volume for Sound Blaster
|
||||
settings.Volume.sbVol = value;
|
||||
#ifdef SOUND_SB
|
||||
set_volume(MODE_SBVOL);
|
||||
set_volume(CMD_SBVOL);
|
||||
#endif
|
||||
break;
|
||||
case MODE_CDVOL: // Set the volume for CD Audio
|
||||
case CMD_CDVOL: // Set the volume for CD Audio
|
||||
settings.Volume.cdVol = value;
|
||||
#ifdef CDROM
|
||||
set_volume(MODE_CDVOL);
|
||||
set_volume(CMD_CDVOL);
|
||||
#endif
|
||||
break;
|
||||
case MODE_GUSVOL: // Set the volume for GUS
|
||||
case CMD_GUSVOL: // Set the volume for GUS
|
||||
settings.Volume.gusVol = value;
|
||||
#ifdef SOUND_GUS
|
||||
set_volume(MODE_GUSVOL);
|
||||
set_volume(CMD_GUSVOL);
|
||||
#endif
|
||||
break;
|
||||
case MODE_PSGVOL: // Set the volume for PSG
|
||||
case CMD_PSGVOL: // Set the volume for PSG
|
||||
settings.Volume.psgVol = value;
|
||||
#if SOUND_PSG || SOUND_TANDY || SOUND_CMS
|
||||
set_volume(MODE_PSGVOL);
|
||||
#if SOUND_TANDY || SOUND_CMS
|
||||
set_volume(CMD_PSGVOL);
|
||||
#endif
|
||||
break;
|
||||
|
||||
// For multifw
|
||||
case MODE_BOOTMODE:
|
||||
case CMD_BOOTMODE:
|
||||
settings.startupMode = value;
|
||||
printf("requesting startup mode: %u\n", value);
|
||||
break;
|
||||
case MODE_SAVE:
|
||||
case CMD_SAVE:
|
||||
queueSaveSettings = true;
|
||||
break;
|
||||
case MODE_REBOOT:
|
||||
case CMD_REBOOT:
|
||||
watchdog_hw->scratch[3] = settings.startupMode;
|
||||
printf("rebooting into mode: %u\n", settings.startupMode);
|
||||
watchdog_reboot(0, 0, 0);
|
||||
break;
|
||||
case MODE_DEFAULTS:
|
||||
case CMD_DEFAULTS:
|
||||
getDefaultSettings(&settings);
|
||||
processSettings();
|
||||
break;
|
||||
case MODE_FLASH: // Firmware write
|
||||
case CMD_FLASH: // Firmware write
|
||||
pico_firmware_write(value);
|
||||
break;
|
||||
}
|
||||
@@ -487,25 +487,25 @@ __force_inline void write_picogus_high(uint8_t value) {
|
||||
|
||||
__force_inline uint8_t read_picogus_low(void) {
|
||||
switch (sel_reg) {
|
||||
case MODE_GUSPORT: // GUS Base port
|
||||
case CMD_GUSPORT: // GUS Base port
|
||||
return settings.GUS.basePort == 0xFFFF ? 0 : (settings.GUS.basePort & 0xFF);
|
||||
case MODE_OPLPORT: // Adlib Base port
|
||||
case CMD_OPLPORT: // Adlib Base port
|
||||
return settings.SB.oplBasePort == 0xFFFF ? 0 : (settings.SB.oplBasePort & 0xFF);
|
||||
case MODE_SBPORT: // SB Base port
|
||||
case CMD_SBPORT: // SB Base port
|
||||
return settings.SB.basePort == 0xFFFF ? 0 : (settings.SB.basePort & 0xFF);
|
||||
case MODE_MPUPORT: // MPU Base port
|
||||
case CMD_MPUPORT: // MPU Base port
|
||||
return settings.MPU.basePort == 0xFFFF ? 0 : (settings.MPU.basePort & 0xFF);
|
||||
case MODE_TANDYPORT: // Tandy Base port
|
||||
case CMD_TANDYPORT: // Tandy Base port
|
||||
return settings.Tandy.basePort == 0xFFFF ? 0 : (settings.Tandy.basePort & 0xFF);
|
||||
case MODE_CMSPORT: // CMS Base port
|
||||
case CMD_CMSPORT: // CMS Base port
|
||||
return settings.CMS.basePort == 0xFFFF ? 0 : (settings.CMS.basePort & 0xFF);
|
||||
case MODE_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
case CMD_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
return settings.Mouse.basePort == 0xFFFF ? 0 : (settings.Mouse.basePort & 0xFF);
|
||||
case MODE_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
case CMD_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
return settings.Mouse.sensitivity & 0xFF;
|
||||
case MODE_NE2KPORT: // NE2000 Base port (0 - disabled)
|
||||
case CMD_NE2KPORT: // NE2000 Base port (0 - disabled)
|
||||
return settings.NE2K.basePort == 0xFFFF ? 0 : (settings.NE2K.basePort & 0xFF);
|
||||
case MODE_CDPORT: // SB Base port
|
||||
case CMD_CDPORT: // SB Base port
|
||||
return settings.CD.basePort == 0xFFFF ? 0 : (settings.CD.basePort & 0xFF);
|
||||
default:
|
||||
return 0x0;
|
||||
@@ -515,76 +515,76 @@ __force_inline uint8_t read_picogus_low(void) {
|
||||
__force_inline uint8_t read_picogus_high(void) {
|
||||
uint8_t ret;
|
||||
switch (sel_reg) {
|
||||
case MODE_MAGIC: // PicoGUS magic string
|
||||
case CMD_MAGIC: // PicoGUS magic string
|
||||
return 0xdd;
|
||||
case MODE_PROTOCOL: // PicoGUS protocol version
|
||||
case CMD_PROTOCOL: // PicoGUS protocol version
|
||||
return PICOGUS_PROTOCOL_VER;
|
||||
case MODE_FWSTRING: // Firmware string
|
||||
case CMD_FWSTRING: // Firmware string
|
||||
ret = firmware_string[cur_read++];
|
||||
if (ret == 0) { // Null terminated
|
||||
cur_read = 0;
|
||||
}
|
||||
return ret;
|
||||
case MODE_BOOTMODE: // Mode (GUS, OPL, MPU, etc...)
|
||||
case CMD_BOOTMODE: // Mode (GUS, OPL, MPU, etc...)
|
||||
return settings.startupMode;
|
||||
case MODE_GUSPORT: // GUS Base port
|
||||
case CMD_GUSPORT: // GUS Base port
|
||||
return settings.GUS.basePort == 0xFFFF ? 0 : (settings.GUS.basePort >> 8);
|
||||
case MODE_OPLPORT: // Adlib Base port
|
||||
case CMD_OPLPORT: // Adlib Base port
|
||||
return settings.SB.oplBasePort == 0xFFFF ? 0 : (settings.SB.oplBasePort >> 8);
|
||||
case MODE_SBPORT: // SB Base port
|
||||
case CMD_SBPORT: // SB Base port
|
||||
return settings.SB.basePort == 0xFFFF ? 0 : (settings.SB.basePort >> 8);
|
||||
case MODE_MPUPORT: // MPU Base port
|
||||
case CMD_MPUPORT: // MPU Base port
|
||||
return settings.MPU.basePort == 0xFFFF ? 0 : (settings.MPU.basePort >> 8);
|
||||
case MODE_TANDYPORT: // Tandy Base port
|
||||
case CMD_TANDYPORT: // Tandy Base port
|
||||
return settings.Tandy.basePort == 0xFFFF ? 0 : (settings.Tandy.basePort >> 8);
|
||||
case MODE_CMSPORT: // CMS Base port
|
||||
case CMD_CMSPORT: // CMS Base port
|
||||
return settings.CMS.basePort == 0xFFFF ? 0 : (settings.CMS.basePort >> 8);
|
||||
case MODE_JOYEN: // enable joystick
|
||||
case CMD_JOYEN: // enable joystick
|
||||
return settings.Joy.basePort == 0x201u;
|
||||
case MODE_GUSBUF: // GUS audio buffer size
|
||||
case CMD_GUSBUF: // GUS audio buffer size
|
||||
return settings.GUS.audioBuffer - 1;
|
||||
case MODE_GUSDMA: // GUS DMA interval
|
||||
case CMD_GUSDMA: // GUS DMA interval
|
||||
return settings.GUS.dmaInterval;
|
||||
case MODE_GUS44K: // Force 44k output
|
||||
case CMD_GUS44K: // Force 44k output
|
||||
return settings.GUS.force44k;
|
||||
case MODE_WTVOL: // Wavetable mixer volume
|
||||
case CMD_WTVOL: // Wavetable mixer volume
|
||||
return (BOARD_TYPE == PICOGUS_2) ? m62429->getVolume(0) : 0;
|
||||
case MODE_MPUDELAY: // SYSEX delay
|
||||
case CMD_MPUDELAY: // SYSEX delay
|
||||
return settings.MPU.delaySysex;
|
||||
case MODE_MPUFAKE: // MPU fake all notes off
|
||||
case CMD_MPUFAKE: // MPU fake all notes off
|
||||
return settings.MPU.fakeAllNotesOff;
|
||||
case MODE_OPLWAIT: // Adlib speed sensitive fix
|
||||
case CMD_OPLWAIT: // Adlib speed sensitive fix
|
||||
return settings.SB.oplSpeedSensitive;
|
||||
case MODE_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
case CMD_MOUSEPORT: // USB Mouse port (0 - disabled)
|
||||
return settings.Mouse.basePort == 0xFFFF ? 0 : (settings.Mouse.basePort >> 8);
|
||||
case MODE_MOUSEPROTO: // USB Mouse protocol
|
||||
case CMD_MOUSEPROTO: // USB Mouse protocol
|
||||
return settings.Mouse.protocol;
|
||||
case MODE_MOUSERATE: // USB Mouse Report Rate
|
||||
case CMD_MOUSERATE: // USB Mouse Report Rate
|
||||
return settings.Mouse.reportRate;
|
||||
case MODE_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
case CMD_MOUSESEN: // USB Mouse Sensitivity (8.8 fixedpoint)
|
||||
return settings.Mouse.sensitivity >> 8;
|
||||
case MODE_NE2KPORT: // NE2000 Base port
|
||||
case CMD_NE2KPORT: // NE2000 Base port
|
||||
return settings.NE2K.basePort == 0xFFFF ? 0 : (settings.NE2K.basePort >> 8);
|
||||
/*
|
||||
case MODE_WIFISSID:
|
||||
case CMD_WIFISSID:
|
||||
break;
|
||||
case MODE_WIFIPASS:
|
||||
case CMD_WIFIPASS:
|
||||
break;
|
||||
*/
|
||||
case MODE_WIFISTAT:
|
||||
case CMD_WIFISTAT:
|
||||
#ifdef PICOW
|
||||
return PG_Wifi_ReadStatusStr();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
break;
|
||||
case MODE_CDPORT: // CD Base port
|
||||
case CMD_CDPORT: // CD Base port
|
||||
return settings.CD.basePort == 0xFFFF ? 0 : (settings.CD.basePort >> 8);
|
||||
#ifdef CDROM
|
||||
case MODE_CDSTATUS:
|
||||
case CMD_CDSTATUS:
|
||||
// printf("cdstatus %x\n", cdrom.image_status);
|
||||
return cdrom.image_status;
|
||||
case MODE_CDLIST:
|
||||
case CMD_CDLIST:
|
||||
if (cur_read_idx == cdrom.image_count) { // If end of the images
|
||||
cur_read_idx = cur_read = 0;
|
||||
cdrom.image_status = CD_STATUS_IDLE;
|
||||
@@ -598,38 +598,38 @@ __force_inline uint8_t read_picogus_high(void) {
|
||||
cur_read = 0;
|
||||
}
|
||||
return ret;
|
||||
case MODE_CDLOAD: // Load CD image
|
||||
case CMD_CDLOAD: // Load CD image
|
||||
return cdman_current_image_index();
|
||||
case MODE_CDNAME: // Firmware string
|
||||
case CMD_CDNAME: // Firmware string
|
||||
ret = cdrom.image_path[cur_read++];
|
||||
if (ret == 0) { // Null terminated
|
||||
cur_read = 0;
|
||||
}
|
||||
return ret;
|
||||
case MODE_CDERROR: // Error string
|
||||
case CMD_CDERROR: // Error string
|
||||
ret = cdrom.error_str[cur_read++];
|
||||
if (ret == 0) { // Null terminated
|
||||
cur_read = 0;
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
case MODE_CDAUTOADV: // enable joystick
|
||||
case CMD_CDAUTOADV: // enable joystick
|
||||
return settings.CD.autoAdvance;
|
||||
case MODE_MAINVOL: // CD audio volume
|
||||
case CMD_MAINVOL: // CD audio volume
|
||||
return settings.Volume.mainVol;
|
||||
case MODE_OPLVOL: // Adlib volume
|
||||
case CMD_OPLVOL: // Adlib volume
|
||||
return settings.Volume.oplVol;
|
||||
case MODE_SBVOL: // Sound Blaster volume
|
||||
case CMD_SBVOL: // Sound Blaster volume
|
||||
return settings.Volume.sbVol;
|
||||
case MODE_CDVOL: // CD audio volume
|
||||
case CMD_CDVOL: // CD audio volume
|
||||
return settings.Volume.cdVol;
|
||||
case MODE_GUSVOL: // GUS volume
|
||||
case CMD_GUSVOL: // GUS volume
|
||||
return settings.Volume.gusVol;
|
||||
case MODE_PSGVOL: // PSG volume
|
||||
case CMD_PSGVOL: // PSG volume
|
||||
return settings.Volume.psgVol;
|
||||
case MODE_HWTYPE: // Hardware version
|
||||
case CMD_HWTYPE: // Hardware version
|
||||
return BOARD_TYPE;
|
||||
case MODE_FLASH:
|
||||
case CMD_FLASH:
|
||||
// Get status of firmware write
|
||||
return pico_firmware_getStatus();
|
||||
default:
|
||||
@@ -641,16 +641,17 @@ __force_inline uint8_t read_picogus_high(void) {
|
||||
void processSettings(void) {
|
||||
#if defined(SOUND_GUS)
|
||||
settings.startupMode = GUS_MODE;
|
||||
set_volume(MODE_GUSVOL);
|
||||
set_volume(CMD_GUSVOL);
|
||||
#elif (SOUND_TANDY || SOUND_CMS)
|
||||
settings.startupMode = PSG_MODE;
|
||||
set_volume(MODE_PSGVOL);
|
||||
set_volume(CMD_PSGVOL);
|
||||
#elif defined(SOUND_SB)
|
||||
settings.startupMode = SB_MODE;
|
||||
set_volume(MODE_SBVOL);
|
||||
set_volume(CMD_SBVOL);
|
||||
set_volume(CMD_OPLVOL);
|
||||
#elif defined(SOUND_OPL)
|
||||
settings.startupMode = ADLIB_MODE;
|
||||
set_volume(MODE_OPLVOL);
|
||||
set_volume(CMD_OPLVOL);
|
||||
#elif defined(MPU_ONLY)
|
||||
settings.startupMode = MPU_MODE;
|
||||
#elif defined(USB_ONLY)
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ struct audio_buffer_pool *init_audio() {
|
||||
ok = audio_i2s_connect_extra(producer_pool, false, 0, 0, NULL);
|
||||
assert(ok);
|
||||
audio_i2s_set_enabled(true);
|
||||
set_volume(MODE_PSGVOL);
|
||||
set_volume(CMD_PSGVOL);
|
||||
return producer_pool;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -146,7 +146,7 @@ void play_adlib() {
|
||||
puts("starting core 1");
|
||||
// flash_safe_execute_core_init();
|
||||
uint32_t start, end;
|
||||
set_volume(MODE_OPLVOL);
|
||||
set_volume(CMD_OPLVOL);
|
||||
|
||||
#if defined(SOUND_SB) || defined(USB_MOUSE) || defined(SOUND_MPU)
|
||||
// Init PIC on this core so it handles timers
|
||||
@@ -184,7 +184,7 @@ void play_adlib() {
|
||||
uint32_t sb_frac = 0;
|
||||
// uint32_t sb_sample_idx = 0x0;
|
||||
uint32_t sb_left = 0;
|
||||
set_volume(MODE_SBVOL);
|
||||
set_volume(CMD_SBVOL);
|
||||
#endif
|
||||
|
||||
uint32_t cd_left = 0;
|
||||
|
||||
+11
-11
@@ -59,26 +59,26 @@ int32_t scale_sample (int32_t sample, int32_t scale, int clamp) {
|
||||
void set_volume(uint16_t mode) {
|
||||
|
||||
switch (mode){
|
||||
case MODE_MAINVOL:
|
||||
set_volume(MODE_OPLVOL);
|
||||
set_volume(MODE_SBVOL);
|
||||
set_volume(MODE_CDVOL);
|
||||
set_volume(MODE_GUSVOL);
|
||||
set_volume(MODE_PSGVOL);
|
||||
case CMD_MAINVOL:
|
||||
set_volume(CMD_OPLVOL);
|
||||
set_volume(CMD_SBVOL);
|
||||
set_volume(CMD_CDVOL);
|
||||
set_volume(CMD_GUSVOL);
|
||||
set_volume(CMD_PSGVOL);
|
||||
break;
|
||||
case MODE_OPLVOL:
|
||||
case CMD_OPLVOL:
|
||||
opl_volume = set_volume_scale(settings.Volume.oplVol);
|
||||
break;
|
||||
case MODE_SBVOL:
|
||||
case CMD_SBVOL:
|
||||
sb_volume = set_volume_scale(settings.Volume.sbVol);
|
||||
break;
|
||||
case MODE_CDVOL:
|
||||
case CMD_CDVOL:
|
||||
cd_audio_volume = set_volume_scale(settings.Volume.cdVol);
|
||||
break;
|
||||
case MODE_GUSVOL:
|
||||
case CMD_GUSVOL:
|
||||
gus_volume = set_volume_scale(settings.Volume.gusVol);
|
||||
break;
|
||||
case MODE_PSGVOL:
|
||||
case CMD_PSGVOL:
|
||||
psg_volume = set_volume_scale(settings.Volume.psgVol);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user