Skip to content

Commit

Permalink
Update to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gh0stless committed Feb 13, 2021
1 parent 879b438 commit 24f1651
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 47 deletions.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Installation:

versions history
----------------
* v.1.0.1 2021-02-13
- prepared for new V.515 hardsid.dll
- add SID Type Info
* v.1.0 2020-07-18
- 1.0 release
* v.0.9.9 2020-07-09
Expand Down
3 changes: 2 additions & 1 deletion docs/sid.maxref.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml version="1.0.1" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<c74object name="sid" >
Expand Down Expand Up @@ -257,6 +257,7 @@
4 Serial of MyDevice
5 DLL Version
6 SID-Object Version
7 SID Type: 0:unknown 1:6581 2:8580
</description>
</method>
<method name="init">
Expand Down
Binary file modified externals/SID.mxe
Binary file not shown.
Binary file modified externals/SID.mxe64
Binary file not shown.
2 changes: 1 addition & 1 deletion misc/DLL/version.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v.514 (0x2002) july 2020
v.515 (0x2002) february 2021
Binary file added misc/DLL/x64/SIDBlastertool.exe
Binary file not shown.
Binary file modified misc/DLL/x64/hardsid.dll
Binary file not shown.
Binary file added misc/DLL/x86/SIDBlastertool.exe
Binary file not shown.
Binary file modified misc/DLL/x86/hardsid.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion package-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
}
},
"tags" : [ ],
"version" : "1.0",
"version" : "1.0.1",
"website" : "http://www.crazy-midi.de"
}
14 changes: 7 additions & 7 deletions patchers/Sidblaster-GetInfo.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"appversion" : {
"major" : 8,
"minor" : 1,
"revision" : 5,
"revision" : 8,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box",
"rect" : [ -1493.0, 451.0, 538.0, 499.0 ],
"rect" : [ 630.0, 372.0, 538.0, 499.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand Down Expand Up @@ -41,12 +41,12 @@
"boxes" : [ {
"box" : {
"id" : "obj-6",
"linecount" : 6,
"linecount" : 7,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 337.0, 342.0, 150.0, 89.0 ],
"text" : "1 Number of Devices\n2 Number of Instances\n3 MyDevice Number\n4 Serial of MyDevice\n5 DLL Version\n6 SID-Object Version"
"patching_rect" : [ 313.0, 342.0, 215.0, 103.0 ],
"text" : "1 Number of Devices\n2 Number of Instances\n3 MyDevice Number\n4 Serial of MyDevice\n5 DLL Version\n6 SID-Object Version\n7 SIDType (0-none; 1-6581; 2-8580)"
}

}
Expand All @@ -58,7 +58,7 @@
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 108.0, 301.0, 215.0, 22.0 ],
"text" : "2 1 0 A12KSI5Q 514 v.0.9.5"
"text" : "8 1 0 A1600001 515 v.1.0.1 2"
}

}
Expand All @@ -81,7 +81,7 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 8.5, 6.5, 128.0, 20.0 ],
"text" : "SIDBlaster getinfo test"
"text" : "SIDBlaster getinfo"
}

}
Expand Down
4 changes: 2 additions & 2 deletions patchers/Sidblaster-Poti-Demo.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"appversion" : {
"major" : 8,
"minor" : 1,
"revision" : 5,
"revision" : 8,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -117,7 +117,7 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 8.5, 6.5, 222.0, 20.0 ],
"text" : "SIDBlaster Poti read Test demonstration"
"text" : "SIDBlaster Poti read demonstration"
}

}
Expand Down
88 changes: 55 additions & 33 deletions source/SID.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
@file
SID.c - a Max/MSP external for SIDBlaster-USB
© 2016-2020 by Andreas Schumm (gh0stless) for www.crazy-midi.de
v.1.0 2020-07-18
© 2016-2021 by Andreas Schumm (gh0stless) for www.crazy-midi.de
v.1.0.1 2021-02-13
*/

#include "ext.h"
Expand All @@ -11,7 +11,7 @@
#include <stddef.h>
#include "SID.h"

const char* version = "v.1.0";
const char* version = "v.1.0.1";
int Number_Of_Instances = 0;
int Number_Of_Devices = 0;
int DLL_Version = 0;
Expand Down Expand Up @@ -56,35 +56,38 @@ void ext_main(void *r)
hardsiddll = LoadLibrary("hardsid.dll");
if (hardsiddll != 0) {
post("SID: info: hardsid.dll library loaded\n");
HardSID_Version = (lpHardSID_Version)GetProcAddress(hardsiddll, "HardSID_Version");
HardSID_Devices = (lpHardSID_Devices)GetProcAddress(hardsiddll, "HardSID_Devices");
HardSID_Delay = (lpHardSID_Delay)GetProcAddress(hardsiddll, "HardSID_Delay");
HardSID_Write = (lpHardSID_Write)GetProcAddress(hardsiddll, "HardSID_Write");
HardSID_Read = (lpHardSID_Read)GetProcAddress(hardsiddll, "HardSID_Read");
HardSID_Flush = (lpHardSID_Flush)GetProcAddress(hardsiddll, "HardSID_Flush");
HardSID_SoftFlush = (lpHardSID_SoftFlush)GetProcAddress(hardsiddll, "HardSID_SoftFlush");
HardSID_Lock = (lpHardSID_Lock)GetProcAddress(hardsiddll, "HardSID_Lock");
HardSID_Filter = (lpHardSID_Filter)GetProcAddress(hardsiddll, "HardSID_Filter");
HardSID_Reset = (lpHardSID_Reset)GetProcAddress(hardsiddll, "HardSID_Reset");
HardSID_Sync = (lpHardSID_Sync)GetProcAddress(hardsiddll, "HardSID_Sync");
HardSID_Mute = (lpHardSID_Mute)GetProcAddress(hardsiddll, "HardSID_Mute");
HardSID_MuteAll = (lpHardSID_MuteAll)GetProcAddress(hardsiddll, "HardSID_MuteAll");
InitHardSID_Mapper = (lpInitHardSID_Mapper)GetProcAddress(hardsiddll, "InitHardSID_Mapper");
GetHardSIDCount = (lpGetHardSIDCount)GetProcAddress(hardsiddll, "GetHardSIDCount");
WriteToHardSID = (lpWriteToHardSID)GetProcAddress(hardsiddll, "WriteToHardSID");
ReadFromHardSID = (lpReadFromHardSID)GetProcAddress(hardsiddll, "ReadFromHardSID");
MuteHardSID_Line = (lpMuteHardSID_Line)GetProcAddress(hardsiddll, "MuteHardSID_Line");
HardSID_Reset2 = (lpHardSID_Reset2)GetProcAddress(hardsiddll, "HardSID_Reset2");
HardSID_Unlock = (lpHardSID_Unlock)GetProcAddress(hardsiddll, "HardSID_Unlock");
HardSID_Try_Write = (lpHardSID_Try_Write)GetProcAddress(hardsiddll, "HardSID_Try_Write");
HardSID_ExternalTiming = (lpHardSID_ExternalTiming)GetProcAddress(hardsiddll, "HardSID_ExternalTiming");
HardSID_GetSerial = (lpHardSID_GetSerial)GetProcAddress(hardsiddll, "HardSID_GetSerial");

HardSID_Version = (lpHardSID_Version)GetProcAddress(hardsiddll, "HardSID_Version");
HardSID_Devices = (lpHardSID_Devices)GetProcAddress(hardsiddll, "HardSID_Devices");
HardSID_Delay = (lpHardSID_Delay)GetProcAddress(hardsiddll, "HardSID_Delay");
HardSID_Write = (lpHardSID_Write)GetProcAddress(hardsiddll, "HardSID_Write");
HardSID_Read = (lpHardSID_Read)GetProcAddress(hardsiddll, "HardSID_Read");
HardSID_Flush = (lpHardSID_Flush)GetProcAddress(hardsiddll, "HardSID_Flush");
HardSID_SoftFlush = (lpHardSID_SoftFlush)GetProcAddress(hardsiddll, "HardSID_SoftFlush");
HardSID_Lock = (lpHardSID_Lock)GetProcAddress(hardsiddll, "HardSID_Lock");
HardSID_Filter = (lpHardSID_Filter)GetProcAddress(hardsiddll, "HardSID_Filter");
HardSID_Reset = (lpHardSID_Reset)GetProcAddress(hardsiddll, "HardSID_Reset");
HardSID_Sync = (lpHardSID_Sync)GetProcAddress(hardsiddll, "HardSID_Sync");
HardSID_Mute = (lpHardSID_Mute)GetProcAddress(hardsiddll, "HardSID_Mute");
HardSID_MuteAll = (lpHardSID_MuteAll)GetProcAddress(hardsiddll, "HardSID_MuteAll");
InitHardSID_Mapper = (lpInitHardSID_Mapper)GetProcAddress(hardsiddll, "InitHardSID_Mapper");
GetHardSIDCount = (lpGetHardSIDCount)GetProcAddress(hardsiddll, "GetHardSIDCount");
WriteToHardSID = (lpWriteToHardSID)GetProcAddress(hardsiddll, "WriteToHardSID");
ReadFromHardSID = (lpReadFromHardSID)GetProcAddress(hardsiddll, "ReadFromHardSID");
MuteHardSID_Line = (lpMuteHardSID_Line)GetProcAddress(hardsiddll, "MuteHardSID_Line");
HardSID_Reset2 = (lpHardSID_Reset2)GetProcAddress(hardsiddll, "HardSID_Reset2");
HardSID_Unlock = (lpHardSID_Unlock)GetProcAddress(hardsiddll, "HardSID_Unlock");
HardSID_Try_Write = (lpHardSID_Try_Write)GetProcAddress(hardsiddll, "HardSID_Try_Write");
HardSID_ExternalTiming = (lpHardSID_ExternalTiming)GetProcAddress(hardsiddll, "HardSID_ExternalTiming");
HardSID_SetWriteBufferSize = (lpHardSID_SetWriteBufferSize)GetProcAddress(hardsiddll, "Hard_SID_SetWriteBufferSize");
HardSID_GetSerial = (lpHardSID_GetSerial)GetProcAddress(hardsiddll, "HardSID_GetSerial");
HardSID_SetSIDType = (lpHardSID_SetSIDType)GetProcAddress(hardsiddll, "HardSID_SetSIDType");
HardSID_GetSIDType = (lpHardSID_GetSIDType)GetProcAddress(hardsiddll, "HardSID_GetSIDType");

//check version & device count
DLL_Version = (int)HardSID_Version();
Number_Of_Devices = (int)HardSID_Devices();
post("SID: info: dll-version: %ld", (long)DLL_Version);
if ((DLL_Version < 0x0202) || Number_Of_Devices>8) {
if ((DLL_Version < 0x0203) || Number_Of_Devices>8) {
dll_initialized = FALSE;
error("SID: fatal! wrong hardsid.dll version or more than 8 devices");
}
Expand Down Expand Up @@ -166,8 +169,26 @@ void *sid_new(long n) // n = int argument typed into object box (A_DEFLONG) --
}

char serial[9];
HardSID_GetSerial((Uint8)x->My_Device, serial);
post("SID: info: using device No.: %ld with serial: %s", x->My_Device, serial);
HardSID_GetSerial(serial, 9, (Uint8)x->My_Device);
int mytype = 0;
char mytypestring[8];
mytypestring[0] = 0;
mytype = HardSID_GetSIDType(x->My_Device);
switch (mytype) {
case 0:
strcpy_s(mytypestring,8, "unknown");
break;
case 1:
strcpy_s(mytypestring,5, "6581");
break;
case 2:
strcpy_s(mytypestring,5, "8580");
break;
default:
strcpy_s(mytypestring,6, "error");

}
post("SID: info: using device No.: %ld with serial: %s, a %s SID Chip are detected", x->My_Device, serial, mytypestring);

if (cb_init(x, &x->my_cb, MY_BUFFER_SIZE, sizeof(write_event))) {
error("SID: fatal! CB: can't alloc mem");
Expand Down Expand Up @@ -319,15 +340,16 @@ void sid_init(t_sid *x) {

void sid_getinfo(t_sid *x) {
char serialnumber[9];
HardSID_GetSerial(x->My_Device, serialnumber);
t_atom myList[6];
HardSID_GetSerial(serialnumber, 9, x->My_Device);
t_atom myList[7];
atom_setlong (myList, (long)Number_Of_Devices);
atom_setlong (myList+1, (long)Number_Of_Instances);
atom_setlong (myList+2, (long)x->My_Device);
atom_setsym (myList+3, gensym(&serialnumber));
atom_setlong (myList+4, (long)DLL_Version);
atom_setsym (myList+5, gensym(version));
outlet_list(x->x_outlet5, 0L, 6, &myList);
atom_setlong (myList+6, (long)(HardSID_GetSIDType(x->My_Device)));
outlet_list(x->x_outlet5, 0L, 7, &myList);
}

void sid_read(t_sid *x, t_symbol *s, long argc, t_atom *argv) {
Expand Down
12 changes: 11 additions & 1 deletion source/SID.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ typedef void (CALLBACK* lpHardSID_Reset2)(Uint8 DeviceID, Uint8 Volume);
typedef void (CALLBACK* lpHardSID_Unlock)(Uint8 DeviceID);
typedef Uint8 (CALLBACK* lpHardSID_Try_Write)(Uint8 DeviceID, Uint16 Cycles, Uint8 SID_reg, Uint8 Data);
typedef BOOL (CALLBACK* lpHardSID_ExternalTiming)(Uint8 DeviceID);
typedef void (CALLBACK* lpHardSID_GetSerial)(Uint8 DevieID, char* output);
typedef void (CALLBACK* lpHardSID_SetWriteBufferSize)(Uint8 bufferSize);
typedef void (CALLBACK* lpHardSID_GetSerial)(char* output, int buffersize, Uint8 DeviceID);
typedef int (CALLBACK* lpHardSID_SetSIDType)(Uint8 DeviceID, int sidtype);
typedef int (CALLBACK* lpHardSID_GetSIDType)(Uint8 DeviceID);

lpHardSID_Version HardSID_Version = NULL;
lpHardSID_Devices HardSID_Devices = NULL;
Expand All @@ -61,13 +64,20 @@ lpHardSID_Reset2 HardSID_Reset2 = NULL;
lpHardSID_Unlock HardSID_Unlock = NULL;
lpHardSID_Try_Write HardSID_Try_Write = NULL;
lpHardSID_ExternalTiming HardSID_ExternalTiming = NULL;
lpHardSID_SetWriteBufferSize HardSID_SetWriteBufferSize = NULL;
lpHardSID_GetSerial HardSID_GetSerial = NULL;
lpHardSID_SetSIDType HardSID_SetSIDType = NULL;
lpHardSID_GetSIDType HardSID_GetSIDType = NULL;

typedef enum {
HSID_USB_WSTATE_OK = 1, HSID_USB_WSTATE_BUSY,
HSID_USB_WSTATE_ERROR, HSID_USB_WSTATE_END
} HSID_STATE;

enum SID_TYPE {
SID_TYPE_NONE = 0, SID_TYPE_6581, SID_TYPE_8580
};

typedef struct circular_buffer
{
void *buffer; // data buffer
Expand Down
3 changes: 3 additions & 0 deletions source/versions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* v.1.0.1 2021-02-13
- adapted for a new version of the hardsid.dll
- added SIDType to Info
* v.1.0 2020-07-18
- release
* v.0.9.9.3 2020-07-11
Expand Down

0 comments on commit 24f1651

Please sign in to comment.