LittleSoundDj: File Management Structure ...

Front Page | Index | Changes | Comments | Users | Registration | Login  Password:  
 

The .sav structure for v3 file management.

FILE MANAGEMENT

=====================
Max number of files = $20


A file is distributed over a number of blocks, each $200 bytes long, lying in the area between $8200 and $1FFFF


Block address calculator:


offset = $8000 + $200*block


SRAM:


8000–80FF : file names ($20*8 bytes)
8100–811F : file versions ($20*1 byte)
8120–813D : empty
813E-813F : SRAM initialization check (set to 'jk' on init)
8140–8140 : active file (0-$1F)
8141–81FF : block allocation table ($ff=empty, 0-$1F=file)

($8141 => block 1, $8142 => block 2, ...)

FILE PACK ALGORITHM


$c0 -> $c0, $c0
run length encoding -> $c0, <byte value>, <times>
$e0 -> $e0, $e0
default instr -> $e0, $f1, <times>
default wave -> $e0, $f0, <times>
block switch -> $e0, <block>
end of file -> $eo, $ff
<byte value> -> <byte value>


the default instrument is: $a8,0,0,$ff,0,0,3,0,0,$d0,0,0,0,$f3,0,0


the default wave is: $8e,$cd,$cc,$bb,$aa,$a9,$99,$88,$87,$76,$66,$55,$54,$43,$32,$31