Amiga MOD Packers Described - The Player 5.0a Described
Anim ripped from Digital Illusion's MotorHead
Yeah :) at least in HTML format !.
Anim ripped from Digital Illusion's MotorHead




  Format name : The player 5.0A
Created by : Jarno Paananen (Guru/Sahara Surfers) (1993)

Sources :
*
Own converted MODs with the packer (sent by Gryzor !)

Note: Arg !, such a note packing method !. Pfff ... it took me almost 10 hours to write (and debug) a depacker !. God, how can he use such a mess ?!?. Anyway, I'm not sure if it's the best crunching rate yet, but it certainly is good :). Somehow, I guess he did better with the P60A and P61A ... I'll tell you when I begin them :). I know, however, that it's possible to do yet a bit better ! (I did :)

OFFSET
SIZE (bytes)
COMMENT
0
2
3
-
-
2
1
1
-
-
- (Smp_Addy) Address of the sample data
- (NOP) number of pattern saved
- (NOS) Number of sample (only the first 6 lower bits !) if bit 7 is set to 1, ALL the samples are delta

The following is repeated NOS times
with 6 bytes description for one sample
4
6
7
8
2
1
1
2
- Sample size (/2)
- finetune (0->F)
- volume (0->40h)
- Loop Start / 2
Note: The player removes what's beside the sample loop, so, it saves only the start address. If there's no loop, this value is $FFFF
Note: if the sample size is > $FF00 (this case is impossible under ptk !), you have to NOT this sample size and you'll get the number of sample you have to repeat (the datas are the same). The first possible value is 00 !


NOS*6+4
-
-
-
NOS*6+4
+NOP*8
NOS*6+4
+NOP*8
+Pat_Size
-
NOP*8
-
-
-
?!?
-
?!?
-
-
-
- track table. Each pattern contains 4 tracks and here is the address of the four track per patterns. The first address is $0000
- Pattern table. Each value is (*2). This table ends with $FF
- Tracks datas
(Pat_Size is the size of the pattern list) Each track contains 64 notes. The size is between 4 and 256 bytes


Note Packing :

* case 1 : (flag bit set to 0)
   - flag bit set to 0
  /
 |        Sample
 |        Number
 |        /   \
 |       |     |
 0000-0000  0000-0000  0000-0000
  |      |       |  |  |       |
   \    /         \/    \     /
  relative      effect   effect
    note                 value
   number


* case 2 : (flag bit set to 1)
   - flag byte set to 1
  /
 |        Sample
 |        Number                    value
 |        /   \                    /     \
 |       |     |                  |       |
 0000-0000  0000-0000  0000-0000  0000-0000
  |      |       |  |  |       |
   \    /         \/    \     /
  relative      effect   effect
    note                 value
   number

Note : 'value' is signed. if 'value' is < 80h, then follow 'value' empty rows. if 'value' is > 7Fh, then the current note is repeated 100h-'value' times


* case 3 : (flag bit set to 1)
   - flag byte set to 1
  /
 |              
 |            lines
 |           /     \
 |          |       |
 0000-0000  0000-0000  0000-0000  0000-0000
 |       |             |                  |
  \     /               \                /
    $80                  number of bytes

Note: Yop, that's the main packing goody ... . Well, if the first byte is $80, the second is the number of lines we'll have to repeat, and the last two bytes (a word in this case) is the number of bytes to go back to reach the starting point where to read our lines. Err, substract the number of bytes to the current file pointer position (meaning after having read these 4 bytes) !.
IMPORTANT!: while repeating notes, if you encounter the case 2 (empty rows or one line repeated), IT COUNTS ONLY FOR ONE LINE, whatever the number of empty/repeat row you'll have to do !!!. so much easier ... grrr


For all those cases:
  • Effects with volume slide (5,6,A) are signed. AFF -> A10 A01 -> A01
  • Arpeggio effect number is 8h in this format
  • If the effect is a pattern break/jump, the track ends !


  • relative note number: (Protracker)
    C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
    C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
    C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113

    become : (P50A)
    C-1 to B-1 : 02,04,06,08,0a,0c,0e,10,12,14,16,18
    C-2 to B-2 : 1a,1c,1e,20,22,24,26,28,2a,2c,2e,30
    C-3 to B-3 : 32,34,36,38,3a,3c,3e,40,42,44,46,48

    Information: When you encounter the effect command D or B (pattern break/jump), the track data ends, as stated upward. What's important, is that ALL the other tracks of THIS pattern have the same number of row as the one which ends with the break/jump. As an exemple, if track 0 has a pattern break at line 2, the 3 other tracks have ONLY 3 rows !

    Follow Sample datas


    Note: As described in the sample headers, all the samples are not always saved !. Refer up there to get the point :)
    Note: If the samples are delta, use the following formula :
      'new' and 'old' are both unsigned bytes
      'Sample_Data' is a table of signed bytes
      +-------------------------------------+
      |old=Sample_Data[0]                   |
      |                                     |
      |for i=1 to Sample_Size               |
      |  new = old - Sample_Data[i]         |
      |  Sample_Data[i] = new               |
      |  old = new                          |
      +-------------------------------------+

     

    Click "back" to go back :)