Skip to content

Commit

Permalink
Add USBSID-Pico config-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
erique committed Feb 10, 2025
1 parent ef7168d commit 46e25eb
Show file tree
Hide file tree
Showing 11 changed files with 3,230 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CFLAGS := -O2 -g -noixemul -m68020 -mregparm=4 -fomit-frame-pointer -DPLAYSID
SOURCE := playsid.asm
INCLUDES := playsid_libdefs.i external.asm resid-68k/resid-68k.s resid-68k/resid-68k.i

TARGET := playsid.library test_blaster
# test_blaster
TARGET := playsid.library test_blaster cfg_usbsid
# test_blaster cfg_usbsid
LISTFILE := playsid.txt

##
Expand Down Expand Up @@ -60,3 +60,6 @@ playsid.library: playsid.library.sym

test_blaster: test_blaster.c sid.c sidblast.c usbsid.c $(GIT_HEADER)
$(GCC) -O2 -noixemul -m68020 --omit-frame-pointer -Wl,-Map,test_blaster.map,--cref $^ -o $@

cfg_usbsid: config-tool/cfg_usbsid.c config-tool/inih/ini.c config-tool/libusb.c $(GIT_HEADER)
$(GCC) -O2 -noixemul -m68020 --omit-frame-pointer -Wl,-Map,cfg_usbsid.map,--cref $^ -o $@ -I config-tool
Binary file added cfg_usbsid
Binary file not shown.
92 changes: 92 additions & 0 deletions config-tool/cfg_skpico.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* USBSID-Pico is a RPi Pico (RP2040) based board for interfacing one or two
* MOS SID chips and/or hardware SID emulators over (WEB)USB with your computer,
* phone or ASID supporting player
*
* cfg_skpico.h
* This file is part of USBSID-Pico (https://github.com/LouDnl/USBSID-Pico)
* File author: LouD
*
* Copyright (c) 2024-2025 LouD
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

const uint8_t init_configmode[3] = { 0x0, 0x1F, 0xFF }; /* Inits and extends config mode */
const uint8_t config_extend[3] = { 0x0, 0x1D, 0xFA }; /* Clear address lines and extend config mode */
const uint8_t config_exit[3] = { 0x0, 0x1D, 0xFB }; /* Exit config mode without reset */
const uint8_t config_update[3] = { 0x0, 0x1D, 0xFE }; /* Update configuration and exit */
const uint8_t config_writeupdate[3] = { 0x0, 0x1D, 0xFF }; /* Update and write configuration and exit */
const uint8_t config_write[3] = { 0x0, 0x1D, 0x0 }; /* Write complete config to memory */
const uint8_t start_config_write[3] = { 0x0, 0x1E, 0x0 }; /* Write single value to config */
const uint8_t set_dac_mode_mono8[3] = { 0x0, 0x1F, 0xFC }; /* Set DAC mode to mono */
const uint8_t set_dac_mode_stereo8[3] = { 0x0, 0x1F, 0xFB }; /* Set DAC mode to stereo */

const uint8_t skpico_default_config[64] = { /* Default SKPico config */
0x1, 0xC, 0x1, 0xE, /* SID 1 */
0,0,0,0, /* -- */
0x3, 0xC, 0x0, 0xE, /* SID 2 */
0x5,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,0,0,0,0,
0,0,
0x0, 0x7, 0x0, 0xF, 0x0,
0,0,
};

unsigned char * config_names[/* 64 */] = {
"CFG_SID1_TYPE", // 0 // 1 // 0 ... 3 // 6581, 8580, 8580+digiboost, none
"CFG_SID1_DIGIBOOST", // 1 // 12 // 0 ... 15, 0x0 ... 0xF
"CFG_REGISTER_READ", // 2 // 1 // Always 1
"CFG_SID1_VOLUME", // 3 // 14 // 0 ... 14, 0x0 ... 0xE
"","","","", // 4 -> 7
"CFG_SID2_TYPE", // 8 // 3 // 0 ... 4 // 6581, 8580, 8580+digiboost, none, FMopl
"CFG_SID2_DIGIBOOST", // 9 // 12 // 0 ... 15, 0x0 ... 0xF
"CFG_SID2_ADDRESS", // 10 // 0 // 0 ... 5 // sidFlags{ CS, A5, A8, A5|A8, A8, A8 }
"CFG_SID2_VOLUME", // 11 // 14 // 0 ... 14, 0x0 ... 0xE
"CFG_SID_PANNING", // 12 // 5 // 0 ... 14, 0x0 ... 0xE
"","","","","","", // 13 -> 18
"","","","","","", // 19 -> 24
"","","","","","", // 25 -> 30
"","","","","","", // 31 -> 36
"","","","","","", // 37 -> 42
"","","","","","", // 43 -> 48
"","","","","","", // 49 -> 54
"","", // 55 -> 56
"CFG_TRIGGER", // 57 // 0 // Paddles
"CFG_SID_BALANCE", // 58 // 7 // 0 ... 14, 0x0 ... 0xE
"CFG_CLOCKSPEED", // 59 // 0 // 0 ... 2 // c64clock{ 985248, 1022727, 1023440 }
"CFG_POT_FILTER", // 60 // 16 // Paddles
"CFG_DIGIDETECT", // 61 // 0 // 0 ... 1
"","", // 62 -> 63
};

unsigned char * sid_types[] = {
"6581", "8580", "8580+digiboost", "none", "FMopl"
};
unsigned char * sid2_address[] = {
"CS", "A5", "A8", "A5|A8", "A8", "A8"
};
unsigned char * clock_speed[] = {
"985248", "1022727", "1023440"
};
const size_t s_config_names = count_of(config_names);
const size_t s_sid_types = count_of(sid_types);
const size_t s_sid2_address = count_of(sid2_address);
const size_t s_clock_speed = count_of(clock_speed);
Loading

0 comments on commit 46e25eb

Please sign in to comment.