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 Composing > New member does Sidplay2 in Java
2008-01-04 22:34
kenchis

Registered: Jan 2008
Posts: 65
New member does Sidplay2 in Java

Hi folks,

I am a new member of CSDb and want to introduce myself
with a little release.
First, i am very proud to be accepted as a new member of the scene.
For short: I am a C64 fan from 1986 until now.
I was never active in the scene, too less talented maybe, but i learned basic and assembler and did some coding for myself in the past.
One thing from the past i actually do until today is listening the precious SID music of all the talented music artists. So many thanks to all of you for your work
collected in the HVSC.

To listen the new releases from the still active groups i often used sidplay2 for windows or an emulator like CCS64, because my commodore was on the attic.
I am also a Java developer and wanted to have my very own java implementation to create a so called C64 Jukebox.
I decided to create a 1:1 conversion of sidplay2 from C++ to java. It should have all features of the original.
It was a long time work and when it was finished i decided to make it open source, that others can integrate into their java emulators.
Perhaps there will be plugins for many java apps some day or a version running even on a mobile.

If you have any suggestions or feedback (positive or negative) it is welcome.

Have a lot of fun with our hobby,
Ken

http://sourceforge.net/projects/jsidplay2/
 
... 75 posts hidden. Click here to view all posts....
 
2008-01-16 20:15
Stainless Steel

Registered: Mar 2003
Posts: 966
This sounds very interesting i would like
to see a little more sophisticated sidplayer.

But holy shit, it does hog a lot of cpu time.
50%-60% on my core 2 duo 6300.

I assume it runs under Linux just as well, being a Java program ?
2008-01-16 20:22
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Then 63 must be the cycles per line?
Then i will try that way,
thankx :-)


Yup, that's the cycle count on a raster line that doesn't have any DMA fetches.
2008-01-16 20:25
kenchis

Registered: Jan 2008
Posts: 65
Linux is working good!
One time i found a user that did not support little-endian
sound buffers, but many others tried and it works, I dont know if i should support big endian, too.

The CPU amount is 60%, when the graphical display is turned on. The console version is 20%.

The emulation of the chips is the least expensive part, the sound api and GUI with swing is the most expensive CPU consumer.
2008-01-16 20:31
kenchis

Registered: Jan 2008
Posts: 65
Quote: Yup, that's the cycle count on a raster line that doesn't have any DMA fetches.

What exactly are DMA fetches?
I never heard of it.
2008-01-16 20:35
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: What exactly are DMA fetches?
I never heard of it.


It's when the CPU is blocked and another chip is using the full 2mhz of the bus bandwidth. Normally the CPU and the custom chips share the bus in a 1:1 manner, 1 mhz each, but some custom chip operations require a more quick fetch, for instance reading new chars from memory, reading new sprite gfx each raster line...

Also, don't forget to show the raster time properly for multi speed tunes, preferably with raster time per sub-call per frame because sometimes call 1 of 4 in a 4x-tune requires more rastertime than the other 3, which could be interesting to see.
2008-01-16 20:53
kenchis

Registered: Jan 2008
Posts: 65
Quote: It's when the CPU is blocked and another chip is using the full 2mhz of the bus bandwidth. Normally the CPU and the custom chips share the bus in a 1:1 manner, 1 mhz each, but some custom chip operations require a more quick fetch, for instance reading new chars from memory, reading new sprite gfx each raster line...

Also, don't forget to show the raster time properly for multi speed tunes, preferably with raster time per sub-call per frame because sometimes call 1 of 4 in a 4x-tune requires more rastertime than the other 3, which could be interesting to see.


Ok, DMA fetches depend on the operation that is performed.
I am not shure, if this is modeled in sidplay2.
I hope i can ignore that on calculation, if their influence is very small.

But multi speed tunes i must be aware of. But i dont know how to find out.
If i know, that it is a 4x speed i could then show the raster time of each seperate call.
Perhaps i should print out only min max values.
2008-01-16 20:57
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Ok, DMA fetches depend on the operation that is performed.
I am not shure, if this is modeled in sidplay2.
I hope i can ignore that on calculation, if their influence is very small.

But multi speed tunes i must be aware of. But i dont know how to find out.
If i know, that it is a 4x speed i could then show the raster time of each seperate call.
Perhaps i should print out only min max values.


Ignore it ofcourse, it doesn't matter at all.

Nah, graphically show each call as a bar. One line per raster line or so. For 4x tunes, simply have 4 bars etc. Also have min and max values.
2008-01-16 21:11
kenchis

Registered: Jan 2008
Posts: 65
Quote: Ignore it ofcourse, it doesn't matter at all.

Nah, graphically show each call as a bar. One line per raster line or so. For 4x tunes, simply have 4 bars etc. Also have min and max values.


But how to find out if a tune is 4x?
2008-01-16 21:22
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: But how to find out if a tune is 4x?


No idea. The hvsc-guys should know. Send steppe a PM or something.
2008-01-16 21:55
Steppe

Registered: Jan 2002
Posts: 1510
Erm, the easiest way is to read the CIA2 registers $DC04 and $DC05. The total amount of cycles on a PAL C64 is $4CC8 (63 cycles per line times 312 lines). The amount you put into DC04/05 is the amount of cycles the CIA2 reg counts down to 0 before a new interrupt is triggered. So, in effect, take the following formula and you have playspeed:

$4CC7 divided by ($DC05 times 256 plus $DC04). Round that and you should have the proper speed. I'm no coder, I hope that was understandable.
The next problem is how to get that value, as it's a counter, so it doesn't have a constant value. You could either read out the registers for a few frames and take the maximum value or follow the init/play calls for a few instructions and see if you stumble over something like
LDA/X/Y $63
STA/X/Y $DC04
LDA/X/Y $26
STA/X/Y $DC05

That would be a doublespeed tune.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - 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
BOMB/ACRISE
Chesser/Blazon
Fred/Channel 4
Martin Piper
Guests online: 61
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 Jazzcat  (9.5)
3 hedning  (9.4)
4 Elwix  (9.1)
5 Remix  (9.1)

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