| |
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.... |
| |
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 ? |
| |
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. |
| |
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. |
| |
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. |
| |
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. |
| |
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.
|
| |
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. |
| |
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?
|
| |
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. |
| |
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 |