Add round 1 of tests
This commit is contained in:
parent
6a5fe5e024
commit
be463856db
5 changed files with 210 additions and 68 deletions
56
test/testdata.js
Normal file
56
test/testdata.js
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
var XMPlayer = window.XMPlayer;
|
||||
|
||||
// set up basic blank single-channel, single-pattern XM
|
||||
exports.resetXMData = function() {
|
||||
var xm = {};
|
||||
window.XMPlayer.xm = xm;
|
||||
xm.channelinfo = [];
|
||||
xm.songname = "test song";
|
||||
xm.song_looppos = 0;
|
||||
xm.nchan = 1;
|
||||
xm.flags = 1;
|
||||
xm.tempo = 3;
|
||||
xm.bpm = 125;
|
||||
xm.channelinfo.push({
|
||||
number: 0,
|
||||
filterstate: new Float32Array(3),
|
||||
vol: 0,
|
||||
pan: 128,
|
||||
period: 1920 - 48*16,
|
||||
vL: 0, vR: 0,
|
||||
vLprev: 0, vRprev: 0,
|
||||
mute: 0,
|
||||
volE: 0, panE: 0,
|
||||
retrig: 0,
|
||||
vibratodepth: 1,
|
||||
vibratospeed: 1,
|
||||
});
|
||||
xm.songpats = [0];
|
||||
// 1 channel, 2 row blank pattern
|
||||
xm.patterns = [
|
||||
[
|
||||
[[-1, -1, -1, 0, 0]],
|
||||
[[-1, -1, -1, 0, 0]]
|
||||
]
|
||||
];
|
||||
xm.instruments = [];
|
||||
xm.instruments.push({
|
||||
'name': "test instrument",
|
||||
'number': 0,
|
||||
'samples': [
|
||||
{ 'len': 256, 'loop': 0,
|
||||
'looplen': 256, 'note': 0, 'fine': 0,
|
||||
'pan': 128, 'type': 0, 'vol': 64,
|
||||
'sampledata': new Float32Array(256)
|
||||
}
|
||||
],
|
||||
'samplemap': new Uint8Array(96),
|
||||
'env_vol': new XMPlayer.Envelope([0, 64, 1, 0], 2, 0, 0, 0),
|
||||
'env_pan': new XMPlayer.Envelope([0, 32], 0, 0, 0, 0)
|
||||
});
|
||||
// reset song position
|
||||
XMPlayer.cur_songpos = -1;
|
||||
XMPlayer.cur_pat = -1;
|
||||
XMPlayer.cur_tick = xm.tempo;
|
||||
return xm;
|
||||
};
|
||||
Loading…
Reference in a new issue