However, about the pallette data extractor, there's two versions :
Pallette Extractor :
Code: Select all
Set Size 520
FindLoc PALoffset String "PAL data" 0
Math PALoffset += 16
log "Meen.pal" PALoffset SizeCode: Select all
Set Size 390
Math Size -= 6
Set Size2 0
FindLoc PALoffset String "PAL data" 0
Math PALoffset += 16
log "Meen-CDi.pal" PALoffset 3
Math Size += 3
append
Do
Math PALoffset += 4
log "Meen-CDi.pal" PALoffset 3
Math Size2 += 3
While Size2 < SizeEDIT :
Optimized RLE7 Extractor :
Code: Select all
Set FrameSize 0
Set FrameOffset 0 # Offset Used for detecting zeroes.
Set FrameOffset2 0 #Offset2
Set FrameNum 0
Set FrameSep 6
Get Size ASIZE 0
Set NAME String "MeenFrame"
Set Zeros 0 #Used for Zeros
Set Bytes 0
Set LONGBs LONG 0
# Set EndRLEBytes LONG 0x9d080000
Set EndRLEBytes LONG 0x0000089d
FindLoc FrameOffset String "PAL data" 0
Math FrameOffset += 536
Set FrameOffset2 FrameOffset
Math EndRLEBytes = 0
Do
GoTo FrameOffset 0 #Go To Offset
Get Bytes Byte 0 #Get Byte Data
Get LONGBs LONG 0 #Get Long Data
If LONGBs = 0x0000089d then
Set NAME2 = NAME
Math FrameNum += 1
String NAME2 += FrameNum
String NAME2 += ".rle7"
Math FrameSize += 5
log NAME2 FrameOffset2 FrameSize
Math FrameOffset += 2207
Math FrameOffset += 6
Math FrameOffset += 5
Set FrameOffset2 FrameOffset
Set FrameSize 0
Set Bytes 0
Set LONGBs 0
Else
Math FrameOffset += 1
Math FrameSize += 1
EndIf
While FrameOffset < SizeCode: Select all
Set FrameSize 0
Set FrameOffset 0 # Offset Used for detecting zeroes.
Set FrameOffset2 0 #Offset2
Set FrameNum 0
Set FrameSep 6
Set AudioSize 2205
Get Size ASIZE 0
Set NAME String "MeenFrame"
Set Zeros 0 #Used for Zeros
Set Bytes 0
Set LONGBs LONG 0
# Set EndRLEBytes LONG 0x9d080000
Set EndRLEBytes LONG 0x0000089d
FindLoc FrameOffset String "PAL data" 0
Math FrameOffset += 536
Set FrameOffset2 FrameOffset
append
Do
GoTo FrameOffset 0 #Go To Offset
Get Bytes Byte 0 #Get Byte Data
Get LONGBs LONG 0 #Get Long Data
If LONGBs = 0x0000089d then
Math FrameOffset += 5
Set FrameOffset2 FrameOffset
log "MeenAudio.raw" FrameOffset2 AudioSize
Math FrameOffset += 2205
Math FrameOffset += 6
Set FrameOffset2 FrameOffset
Set FrameSize 0
Set Bytes 0
Set LONGBs 0
Else
Math FrameOffset += 1
Math FrameSize += 1
EndIf
While FrameOffset < SizeCode: Select all
set FREQUENCY long 22050
set CHANNELS long 1
set BITS long 8
get SIZE asize
get NAME filename
string NAME += ".wav"
set MEMORY_FILE binary "\x52\x49\x46\x46\x00\x00\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x61\x74\x61\x00\x00\x00\x00"
set RIFFSIZE long SIZE
math RIFFSIZE += 36
set BLOCKALIGN long BITS
set AVGBYTES long FREQUENCY
math BLOCKALIGN /= 8
math BLOCKALIGN *= CHANNELS
math AVGBYTES *= BLOCKALIGN
putvarchr MEMORY_FILE 4 RIFFSIZE long
putvarchr MEMORY_FILE 20 1 short # wFormatTag: Microsoft PCM Format (0x0001)
putvarchr MEMORY_FILE 22 CHANNELS short # wChannels
putvarchr MEMORY_FILE 24 FREQUENCY long # dwSamplesPerSec
putvarchr MEMORY_FILE 28 AVGBYTES long # dwAvgBytesPerSec
putvarchr MEMORY_FILE 32 BLOCKALIGN short # wBlockAlign
putvarchr MEMORY_FILE 34 BITS short # wBitsPerSample
putvarchr MEMORY_FILE 40 SIZE long
append
log NAME 0 44 MEMORY_FILE
log NAME 0 SIZE
