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 > C64 Productions > SIDBlaster
2025-05-04 19:33
Raistlin

Registered: Mar 2007
Posts: 722
SIDBlaster

A little early perhaps to put here on CSDb as a full release .. but for anyone interested, here's a new tool from me:-

https://github.com/RobertTroughton/SIDBlaster

I have big plans with this.. main features right now (may be buggy!) are:-

- ability to add simple players to SIDs <-- later on of course this will allow full visualisers, SID information and more

- relocation of SIDs. The process used for this is very different to other relocators that I've seen. I essentially do a 10mins emulation of the CPU, running through the SID, checking what's data, what's code, what's read from, what's written to, etc... detecting indirect reads, and where the vectors for those come from ... dealing with "backups" of those vectors and all that nastiness. It's far from perfect .. but it works already with many SIDs and I'll look at other SIDs to see how easy those will be to fixup.

Next tasks:-
- exposing more information to players/visualisers
- allowing import of information/defines from txt files to pass to the visualisers
- adding an "insanity check" to the relocator - so I'll do 10mins' emulation of the SID before and after relocation, recording all the $d4xx writes and making sure they tally up.

Much more to be done ... feedback is of course welcome.

Windows/Ubuntu/Mac releases are there .. though I've only tested Windows - hopefully the others "just work"??
2025-05-04 22:02
acrouzet

Registered: May 2020
Posts: 100
Sounds like a very cool idea. But the name SIDBlaster is already used by PC SID chip hardware, is it not? That may cause confusion.
2025-05-05 07:16
hedning

Registered: Mar 2009
Posts: 4775
Quote: Sounds like a very cool idea. But the name SIDBlaster is already used by PC SID chip hardware, is it not? That may cause confusion.

My thought exactly. I actually own one. :) https://cbmretro.fi/product/sidblaster-usb-nano/
2025-05-05 10:53
iAN CooG

Registered: May 2002
Posts: 3229
I'll give it a go asap
2025-05-05 12:45
Burglar

Registered: Dec 2004
Posts: 1129
interesting project :)

I'm wondering about the relocating bit, I'm a huge fan of lft's Sidreloc V1.0, which hasn't failed me yet. So, why a new tool?
The other usecases sound nice btw.
2025-05-05 13:53
Mixer

Registered: Apr 2008
Posts: 460
Cool project and I like the "insanity check" idea.

I wonder if this could be taken a step further to map out the execution path from the routine call to each sid write and perhaps figure out a way to squeeze more cycles or bytes out of the routines.
2025-05-05 16:52
iAN CooG

Registered: May 2002
Posts: 3229
RSID are not supported, it's not told anywhere, add in the readme a warning at least. Trying to relocate \MUSICIANS\T\Turbocracker_87\Crockets_Theme.sid the message is a bit vague

SIDBlaster.exe -relocate=$1000 Crockets_Theme.sid Crockets_1000.sid

Not a valid SID file!
[2025-05-05 16:50:52] [ERROR] Failed to load file: Crockets_Theme.sid

other than that, if the exe needs java to run kickass, I'm outta here. I won't install java to test if further
2025-05-05 17:13
Raistlin

Registered: Mar 2007
Posts: 722
Quoting acrouzet
the name SIDBlaster is already used


God damn, I knew the name reminded me of something! I'll change it "eventually"... I'm not sure yet how easy it'll be with GitHub etc etc .. or maybe I just start a new repo with a clean copy of the codebase :-)

Quoting Burglar
I'm wondering about the relocating bit, I'm a huge fan of lft's Sidreloc V1.0, which hasn't failed me yet. So, why a new tool?


So, long-term, if I can get more SIDs to be -fully- relocatable, to the point where the generated ASM can be hand-edited without problems.. then that opens up a truckload of options. Optimisation. Direct hooks for visualisers. Etc etc.

Right now, I can blank out unused parts of SID files .. I've seen some SIDs with 8-10% of memory that is never touched .. including branches that are never taken.

By comparison, LFT's relocator is bloody cool. It works very differently though.

Worth noting as well .. what needs to be done to get byte-wise relocation working, full ASM editing, is HARD on many SIDs. Some have, for example, self-modifying code where there might be such as a jump - but where only the low-byte of the jump is changed. Eg:-

ldy $fe
lda $1323, y
sta $1041

$1040: jsr $1100
...
$1323: .byte $00, $03, $09, $10, $18, $20

So basically it will change that $1100 to $1100, $1103, $1109, ..., $1120.

Because the high-byte is never changed, it becomes difficult. Not -impossible- but definitely <i>difficult</i>. It might need the code to be expanded, to do some math to actually calculate the low and high byte.

It's for these sort of reasons, I assume, that LFT chose to only allow whole-page relocation in SIDreloc.

Quoting Mixer
I wonder if this could be taken a step further to map out the execution path from the routine call to each sid write and perhaps figure out a way to squeeze more cycles or bytes out of the routines.


Yes! Absolutely. I need the relocation to be working such that the ASM can be changed, as mentioned above, and then everything like this becomes possible.

Quoting iAN CooG
RSID are not supported, it's not told anywhere, add in the readme a warning at least.


Thanks, Ian! I'll grab that and give it a go later. I'm not quite sure where the code's at for the various formats .. I think I saw somewhere that PSID had v2, v3 and v4.. if so, I'll need to check each if they're still in circulation. That's why I PM'ed you on FB, I thought you'd be a good person to speak to about getting the files and header specs etc :-)


I'm adding stuff to this all the time.. I'm adding the post-relocation SID-write verifying code now.. and will test on some new SIDs ... and then probably get the various other SID formats added in before doing a pass over large chunks of HVSC.

I'll only move this tool to v1.0 once I know that it can cope with 90%+ of HVSC (and emitting errors/warnings for the other <10%).
2025-05-05 17:25
Stone

Registered: Oct 2006
Posts: 176
Quoting hedning
My thought exactly. I actually own one. :) https://cbmretro.fi/product/sidblaster-usb-nano/


I even made a driver for it back in the day, available here on csdb SIDBlaster USB driver BETA

I think this version is obsolete though.

Quoting Raistlin
relocation of SIDs. The process used for this is very different to other relocators that I've seen. I essentially do a 10mins emulation of the CPU, running through the SID, checking what's data, what's code, what's read from, what's written to, etc... detecting indirect reads, and where the vectors for those come from



Not sure how LFT does it in Sidreloc V1.0 but this sounds similar to what I did in SIDdecompiler V0.8 I basically create (through emulation) a graph for each value that is written to the SID chip and by traversing that and applying some heuristics, I try to determine which are vectors that should be relocated. I found that some drivers need to be page-aligned to some extent, e.g because of self-modifying code where only the low-byte is changed in the vector. It's a very interesting project, for sure!
2025-05-05 18:47
Raistlin

Registered: Mar 2007
Posts: 722
Quoting Stone
e.g because of self-modifying code where only the low-byte is changed in the vector


Yep, exactly this. I mentioned this oddity just above. I do plan to tackle this one eventually as well though so that relocation still works without restricting to whole pages .. but I'm not there yet.
2025-05-05 18:52
Raistlin

Registered: Mar 2007
Posts: 722
Quoting Stone
this sounds similar to what I did in SIDdecompiler V0.8


Interesting! That does sound very similar indeed, actually..! We look to have very similar commandline options too.

It's a fun project to work on so I'm definitely going to push ahead and see if I can get the relocation working solidly.
 
... 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
cba
megasoftargentina
Ramon B5/DESiRE
Meikel aka ZUX/Sparks
fieserWolF/Abyss-Con..
iceout/Avatar/HF
Mr. Sex/Byterapers
cobbpg
Guests online: 123
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Coma Light 13  (9.6)
5 Mojo  (9.6)
6 Signal Carnival  (9.6)
7 Edge of Disgrace  (9.6)
8 In Surgery  (9.6)
9 Comaland 100%  (9.6)
10 Uncensored  (9.6)
Top onefile Demos
1 Keine Termine und le..  (9.9)
2 Nine  (9.8)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.5)
7 Charflasher  (9.5)
8 Onscreen 5k  (9.5)
9 Libertongo  (9.5)
10 Dawnfall V1.1  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.2)
5 Artline Designs  (9.2)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Acidchild  (9.7)
4 Cash  (9.6)
5 Violator  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.061 sec.