2014-04-21 11:56:28 +00:00
|
|
|
#include <apple1.h>
|
|
|
|
#include "vicilib.h"
|
|
|
|
#include "sidfile.h"
|
|
|
|
#include "cffa1.h"
|
|
|
|
|
|
|
|
//extern word Destination;
|
|
|
|
|
2014-04-23 21:18:22 +00:00
|
|
|
byte const CFFA_MODULE_FILENAME[] = { 12, 'V', 'I', 'C', 'I', 'O', 'U', 'S', 'C', 'F', 'F', 'A', '1' };
|
|
|
|
|
2014-04-21 11:56:28 +00:00
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
byte keybInput = 0;
|
2014-04-23 21:18:22 +00:00
|
|
|
word fileLength;
|
2014-04-21 11:56:28 +00:00
|
|
|
initVicilib();
|
2014-04-23 21:18:22 +00:00
|
|
|
|
|
|
|
// is CFFA module loaded?
|
|
|
|
|
|
|
|
// if not, is CFFA card present?
|
|
|
|
|
|
|
|
// if it is, try to load VICIOUSCFFA1
|
|
|
|
POKEW(CFFA1_DESTINATION, 0x7000);
|
|
|
|
POKEW(CFFA1_FILENAME, (word)&CFFA_MODULE_FILENAME[0]);
|
|
|
|
if(callCFFA1API(CFFA1_READFILE)!=0) {
|
|
|
|
prints("\rERROR LOADING CFFA1 MODULE\r");
|
|
|
|
}
|
|
|
|
|
2014-04-21 11:56:28 +00:00
|
|
|
while(keybInput!='Q') {
|
|
|
|
prints("\rVICIOUS> ");
|
|
|
|
keybInput = readkey() - 0x80;
|
|
|
|
switch (keybInput) {
|
|
|
|
case 'P':
|
2014-04-23 21:18:22 +00:00
|
|
|
playSidFile(0x1000, 0x2000); // file length is just a guess, it's not known
|
2014-04-21 11:56:28 +00:00
|
|
|
break;
|
|
|
|
case 'S':
|
|
|
|
prints("\rSTOP PLAYING\r");
|
|
|
|
stopPlaying();
|
|
|
|
break;
|
|
|
|
case 'C':
|
|
|
|
stopPlaying();
|
|
|
|
gotoCFFA1();
|
|
|
|
break;
|
|
|
|
case 'L':
|
|
|
|
stopPlaying();
|
2014-04-23 21:18:22 +00:00
|
|
|
if((fileLength = loadFile(0x1000))!=0) {
|
|
|
|
playSidFile(0x1000, fileLength);
|
|
|
|
}
|
2014-04-21 11:56:28 +00:00
|
|
|
break;
|
|
|
|
case 'Q':
|
|
|
|
prints("\rQUIT\r");
|
|
|
|
break;
|
|
|
|
default:
|
2014-04-23 21:18:22 +00:00
|
|
|
prints("\r\r VICIOUS MENU (0.9)\r ------------------\r P - PLAY SID TUNE AT $1000");
|
|
|
|
prints("\r S - STOP PLAYING\r C - CFFA1\r L - LOAD & PLAY SID TUNE\r Q - QUIT\r");
|
2014-04-21 11:56:28 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|