#14685 - Krakken - Sun Jan 11, 2004 9:33 am
Hey,
I've just started making myself a MOD player but have come accross a very strange problem. I'll try to explain it as best I can.
I am trying to load the header of the MOD file into a struct I have made with the help of a file format guide. I have checked and rechecked the guide and all seems well with the header.
The relevant code I am using is below:
The first instrument "appears" to load okay with the data shown as:
NAME: Dream Guitar 1
LENGTH: 16421
FINETUNE: 0
VOLUME: 64
OFFSET: 1917112588
The problem I have is when loading each subsequent sample. For example the second and third samples load as:
NAME: eam Guitar 2 (Should Be: "Dream Guitar 2")
LENGTH: 16384
FINETUNE: 0
VOLUME: 0
OFFSET: 1394625862
NAME: lap Bass (Should Be: "FM Slap Bass")
LENGTH: 0
FINETUNE: 0
VOLUME: 1
OFFSET: 1953391980
As you may have noticed it seems to cut 2 bytes off of each sample struct. To combat this I tried taking away 2 bytes from the sample struct. This produced results where it did the complete opposite and added 2 bytes to each sample struct.
I have no idea why it won't work. Can anyone help? This is what i'm following:
http://www.wotsit.org/search.asp?page=5&s=music (2nd File Down)
Thanks, Nat.
I've just started making myself a MOD player but have come accross a very strange problem. I'll try to explain it as best I can.
I am trying to load the header of the MOD file into a struct I have made with the help of a file format guide. I have checked and rechecked the guide and all seems well with the header.
The relevant code I am using is below:
Code: |
extern const char RES_MOD[]; typedef struct _xSample { char cName[22]; ushort iLength; char cFineTune; uchar cVolume; uint wOffset; } xSample, *pxSample; typedef struct _xMOD { char cTitle[20]; xSample xSampleList[15]; char cPatternCount; char cEndPos; char cPatternTable[128]; } xMOD, *pxMOD; xMOD *xmFile = RES_MOD; |
The first instrument "appears" to load okay with the data shown as:
NAME: Dream Guitar 1
LENGTH: 16421
FINETUNE: 0
VOLUME: 64
OFFSET: 1917112588
The problem I have is when loading each subsequent sample. For example the second and third samples load as:
NAME: eam Guitar 2 (Should Be: "Dream Guitar 2")
LENGTH: 16384
FINETUNE: 0
VOLUME: 0
OFFSET: 1394625862
NAME: lap Bass (Should Be: "FM Slap Bass")
LENGTH: 0
FINETUNE: 0
VOLUME: 1
OFFSET: 1953391980
As you may have noticed it seems to cut 2 bytes off of each sample struct. To combat this I tried taking away 2 bytes from the sample struct. This produced results where it did the complete opposite and added 2 bytes to each sample struct.
I have no idea why it won't work. Can anyone help? This is what i'm following:
http://www.wotsit.org/search.asp?page=5&s=music (2nd File Down)
Thanks, Nat.