X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fsountest.c;h=e734a8c7cee05b9f722b962f7ca29cb070b4a749;hb=050d28da3358d5c1434fda542ec11adbee182ea5;hp=ac8908c3d9e98a655be49efe4ad4a4a1b43f8537;hpb=17ec26395419ff775f29661e50265dfbccfda3b0;p=16.git diff --git a/src/sountest.c b/src/sountest.c index ac8908c3..e734a8c7 100755 --- a/src/sountest.c +++ b/src/sountest.c @@ -23,9 +23,9 @@ #include #include "src/lib/16_in.h" -//#include "src/lib/16_snd.h" -#include "src/lib/doslib/adlib.h" -#include "src/lib/doslib/8254.h" /* 8254 timer */ +#include "src/lib/16_sd.h" +//#include /* 8254 timer */ +//#include static unsigned int musical_scale[18] = { 0x1B0, /* E */ @@ -51,7 +51,10 @@ static unsigned int musical_scale[18] = { void main(int argc, char near *argv[]) { + static global_game_variables_t gvar; word i; + boolean done; + ScanCode scan; // static FMInstrument testInst = //{ //0x00, 0x01, /* modulator frequency multiple... 0x20 */ @@ -62,13 +65,12 @@ void main(int argc, char near *argv[]) //0x36, /* feedback algorithm and strength 0xC0 */ //}; - IN_Startup(); + IN_Startup(&gvar); //FMReset(); //FMSetVoice(0, &testInst); if(!init_adlib()) { - printf("Cannot init library\n"); - exit(-5); + Quit ("Cannot init library"); } if (adlib_fm_voices > 9) @@ -114,23 +116,32 @@ void main(int argc, char near *argv[]) adlib_apply_all(); printf("press Z! to noise\npress ESC to quit"); - printf("p"); - while(!IN_qb(1)) + printf("\np"); + for (done = false;!done;) { - if(IN_qb(44)) - { - printf("e"); - adlib_fm[0].mod.key_on = 1; - //FMKeyOn(0, 0x106, 4); - } - else + while (!(scan = gvar.in.inst->LastScan)) + {} +// SD_Poll(); + + IN_ClearKey(scan); + switch (scan) { - adlib_fm[0].mod.key_on = 0; - //FMKeyOff(0); + case sc_Escape: + done = true; + break; + case sc_Z: + adlib_fm[0].mod.key_on = 1; + //FMKeyOn(0, 0x106, 4); + break; + default: + adlib_fm[0].mod.key_on = 0; + //FMKeyOff(0); + break; } + if(adlib_fm[0].mod.key_on) printf("e"); adlib_update_groupA0(0,&adlib_fm[0]); } printf("!\n"); shutdown_adlib(); - IN_Shutdown(); + IN_Shutdown(&gvar); }