Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > CSDb Discussions > ReSID DLL interface?
2019-05-02 17:11
Mindcooler

Registered: Nov 2006
Posts: 28
ReSID DLL interface?

Is there any documentation for the interface for the ReSID/ReSIDFP DLL (thought of using LibReSIDFP.dll from the XSID project), or are there any other docs that can help figuring out how to use it? Or is it a case of RTFC?
2019-05-03 20:26
Mixer

Registered: Apr 2008
Posts: 422
Initialize
repeat:
- write values to emulated sid
- run the emulated sid and receive a chunk of audio data
- play audio out
2019-05-03 22:21
Mindcooler

Registered: Nov 2006
Posts: 28
Yes, I have used the HardSID interface before, so I guess it will be pretty similar, but the HS interface was documented so you could know what parameters to put where. And I guess ReSID is cycle accurate and would be timed/synced with the "real world" in a different way? Like, do you tell out how many cycles to emulate and get out a piece of sound data, or the other way around?
2019-05-04 00:27
JackAsser

Registered: Jun 2002
Posts: 1989
You the source Luke.

Download: https://sourceforge.net/projects/sidplay-residfp/files/libsidpl..

Take a log at sidplayfp.h, it's well documented:
"/**
* Run the emulation and produce samples to play if a buffer is given.
*
* @param buffer pointer to the buffer to fill with samples.
* @param count the size of the buffer measured in 16 bit samples
* or 0 if no output is needed (e.g. Hardsid)
* @return the number of produced samples. If less than requested
* and #isPlaying() is true an error occurred, use #error() to get
* a detailed message.
*/"
2019-05-04 00:40
Mixer

Registered: Apr 2008
Posts: 422
Also, the samplerate and sid clockspeed are given in the initialization parameters. Resid output is resampled to given samplerate, so set it to your audio output rate, and the emulation is realworld synced.
2019-05-04 01:01
Mindcooler

Registered: Nov 2006
Posts: 28
That doesn't look like the interface of the dll I've got:

ReSIDClock
ReSIDClockSilent
ReSIDCreate
ReSIDDestroy
ReSIDEnableFilter
ReSIDInput
ReSIDSetChipModel
ReSIDSetFilter6581Curve
ReSIDSetFilter8580Curve
ReSIDSetSamplingParameters
ReSIDWrite

Is there a official dll built somewhere?
2019-05-04 01:06
Mindcooler

Registered: Nov 2006
Posts: 28
I found the wrapper functions for the XSID DLL, so I guess I can follow the money down the rabbit hole:

https://github.com/M3wP/XSID/blob/master/ReSIDFP/LibReSIDFP.cpp
2019-05-04 11:24
Mixer

Registered: Apr 2008
Posts: 422
Go for it!

I looked at the resid code included in Vice, Goattracker, libsidplay and pyresid. They all have slightly different wrappers for the engine but operate in the same way. I assume that the XSID ReSIDClock() works just like the GT resid clock() one or equivalent gen() in the pyresid.
2019-05-21 20:59
Mindcooler

Registered: Nov 2006
Posts: 28
I got a 6581 running, but I don't get any output from an 8580. I don't get what the difference is; it seems that I need to clock the 8580 for each write I do? What gives?

void SID::write(int offset, unsigned char value)
{
busValue = value;
busValueTtl = modelTTL;

if (model == MOS8580)
{
delayedOffset = offset;
delayedValue = value;
}
else
{
writeImmediate(offset, value);
}
}
2019-05-21 23:42
Krill

Registered: Apr 2002
Posts: 2839
You're trying to write multiple SID registers in the same clock cycle?
2019-05-21 23:45
Mindcooler

Registered: Nov 2006
Posts: 28
Yes, that works fine for 6581. I'd like to keep all time management in the sound driver, not the data write routines. I'm not trying to emulate a c64.
 
... 7 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Fungus/Nostalgia
Wayne/Art Ravers
Mike
thesuperfrog
bisboch/HF
Guests online: 159
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.049 sec.