It is currently Sun Nov 19, 2017 7:27 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Sat Oct 30, 2010 3:56 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19231
Location: NE Indiana, USA (NTSC)
As long as you aren't looping, all you really need is a table of $4010 and $4012 values. (You can compute the $4013 value from this sample's $4012 value and that of the following sample.) See samples.s in LJ65.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2010 12:16 pm 
Offline

Joined: Wed Nov 10, 2004 10:17 pm
Posts: 142
RJDMC v0.6

-Added a pop-up box when processing is being done
-Added a reverse function
-Data is read in almost 2x as fast
-Quality of "rate" changes is much higher
-Added extra error handling for non-pcm and non-wav files
-Fixed several bugs
-Added "play selection" feature
-DPCM output is always (mod16 + 1) bytes, so looping is more accurate
-Fixed a few of the keypresses not being read properly
-Various improvements to code efficiency
-Fixed all bugs with the trackbars (all scroll 1-per-tick)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 10, 2010 8:58 am 
Offline

Joined: Wed Nov 10, 2004 10:17 pm
Posts: 142
RJDMC v0.9

-Zoom into any area is done
-Operations on zoomed selections are possible
-Modify volume for selection
-Fade volume to x%
-Fixed several bugs, made tons of optimizations (mostly to new functions)
-Zooming on large files is faster
-Fixed some bugs with opening files with additional info in their headers and files that were sampled at odd rates.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2010 7:35 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3950
Why doesn't saving work on my PC? This is very frustrating. I can't even save a file without the program throwing an exception.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 2:41 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
Great tool! I'm thikning how to add the dmc seamlessly into the rom.
Let's see if I've got it right.
Starting in $C000, you can address samples at 64 bytes increments via $4012.
Samples size is set via $4013 and the number written is multiplied by 32 then added 1 to get the sample size.
So, if you have to align samples to 64bytes, there is a trailing waste of 31 bytes after each sample.
The first byte could be used to store the $4012 value of the sample,
(ADDR - $C000)/64, I think the assembler could do that but not sure.
Then the remaining 30 bytes, and this is where RJDMC comes into play, could be data from the sample, pitch, freq, etc (if there's more) in nes format, so you can directly store the value or OR it, padded to 30 bytes (with anything you want, program signature, name, version, etc).
RJDMC could write this file along with the dmc file, so in the code you only have to include the dmc, autocalculate the $4012 address, include the trailer and you have always your samples aligned and it's easy to call them :)
Any toughts about this? :p


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 6:43 am 
Offline

Joined: Wed Nov 10, 2004 10:17 pm
Posts: 142
Dwedit wrote:
Why doesn't saving work on my PC? This is very frustrating. I can't even save a file without the program throwing an exception.


What OS are you using? Is the .net framework fully updated on your machine? That'd be my first guess, as I'm pretty sure the open/save dialogs use 3.5 code while the main form uses more backward compatible stuff.

Try http://4x86.com/RJDMCv0.9a.zip as it has a couple fixes and uses a subset of the .NET framework instead of the whole thing now (apparently this can help with framework-related errors).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 7:09 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3950
I get a lot of "Could not find file, or no file specified" after opening, saving, or even playing a temporary generated file. Source code please? Then I can find out what's making those errors.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 9:00 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19231
Location: NE Indiana, USA (NTSC)
Wave wrote:
Great tool! I'm thikning how to add the dmc seamlessly into the rom.
Let's see if I've got it right.
Starting in $C000, you can address samples at 64 bytes increments via $4012.
Samples size is set via $4013 and the number written is multiplied by 32 then added 1 to get the sample size.

Actually multiplied by 16, but you get the idea.

Quote:
The first byte could be used to store the $4012 value of the sample,
(ADDR - $C000)/64, I think the assembler could do that but not sure.

If you're storing the $4012 value after the end of a compressed wave, then given a wave's ID number, how would you find the end of this wave to be able to find its $4012 value? Most games that I've seen use a table to translate wave ID numbers into $4010/$4012 values. You could call this the "inode table" if you wish. In fact, it can be done with 2 bytes per wave because it's possible to approximate the $4013 value from this wave's $4012 value and that of the next, with the other byte holding the default $4010 value.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 9:11 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
tepples wrote:
Actually multiplied by 16, but you get the idea.

Oh, right.
Sooo, there's a space of 63-15bytes "free" aren't they?

Assuming the trailer can be automaticaly created...
$4012 is the starting address, calculated by the assembler
$4010 is frecuency, given by the program in a trailer in this case
$4013 is size, given by the program in a trailer in this case
Am I wrong?

EDIT: I understand what you were trying to say now.
Given that scenario you could create a table pointer to the trailers easily.


Last edited by Wave on Wed Dec 15, 2010 9:29 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 9:25 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19231
Location: NE Indiana, USA (NTSC)
Wave wrote:
Given that scenario you could create a table pointer to the trailers easily.

Which would take the same space as a table of $4010 and $4012 values. Do you want me to explain how $4013 values could be calculated from $4012 values for any sample that doesn't loop?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 9:33 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
tepples wrote:
Wave wrote:
Given that scenario you could create a table pointer to the trailers easily.

Which would take the same space as a table of $4010 and $4012 values. Do you want me to explain how $4013 values could be calculated from $4012 values for any sample that doesn't loop?

The idea is to have everything calculated and not to modify by hand any value. If you changed a dmc, it would work without code changes (if it fits on rom)
Also, how do you align dmcs to 64 bytes?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 10:33 am 
Offline

Joined: Wed Nov 10, 2004 10:17 pm
Posts: 142
Dwedit wrote:
I get a lot of "Could not find file, or no file specified" after opening, saving, or even playing a temporary generated file. Source code please? Then I can find out what's making those errors.


I'll get that to you within 1-2 days, whenever I turn in my code for the project here at school.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 2:27 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19231
Location: NE Indiana, USA (NTSC)
Wave wrote:
The idea is to have everything calculated and not to modify by hand any value. If you changed a dmc, it would work without code changes (if it fits on rom)

The solution I have calculates the $4012 value from the starting address of the wave in ROM, and then it calculates the $4013 value by subtracting this sample's $4012 value from that of the next and then doing some shifts.

Quote:
Also, how do you align dmcs to 64 bytes?

.align statements in ca65 do this.

For an illustration, have a look at how I handle samples in the source code to LJ65.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 2:39 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
Quote:
The solution I have calculates the $4012 value from the starting address of the wave in ROM, and then it calculates the $4013 value by subtracting this sample's $4012 value from that of the next and then doing some shifts.

Unless you have more than about a dozen of samples, you'd actually waste bytes with this instead of saving them.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2010 3:18 pm 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
tepples wrote:
Wave wrote:
The idea is to have everything calculated and not to modify by hand any value. If you changed a dmc, it would work without code changes (if it fits on rom)

The solution I have calculates the $4012 value from the starting address of the wave in ROM, and then it calculates the $4013 value by subtracting this sample's $4012 value from that of the next and then doing some shifts.

Quote:
Also, how do you align dmcs to 64 bytes?

.align statements in ca65 do this.

For an illustration, have a look at how I handle samples in the source code to LJ65.

So you have to do it manually for each sample?
Wouldn't it be better to have samples padded to 64 bytes and use the trail as I suggested?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group