OSDN Git Service
(root)
/
proj16
/
16.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyleft and need to test and fix newer version of open watcom
[proj16/16.git]
/
src
/
sountest.c
diff --git
a/src/sountest.c
b/src/sountest.c
index
ac8908c
..
9c99e4a
100755
(executable)
--- a/
src/sountest.c
+++ b/
src/sountest.c
@@
-1,5
+1,5
@@
/* Project 16 Source Code~
\r
/* Project 16 Source Code~
\r
- * Copyright (C) 2012-20
17
sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
+ * Copyright (C) 2012-20
22
sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
*
\r
* This file is part of Project 16.
\r
*
\r
*
\r
* This file is part of Project 16.
\r
*
\r
@@
-23,9
+23,9
@@
#include <stdio.h>
\r
\r
#include "src/lib/16_in.h"
\r
#include <stdio.h>
\r
\r
#include "src/lib/16_in.h"
\r
-
//
#include "src/lib/16_snd.h"
\r
-#include "src/lib/doslib/adlib.h"
\r
-#include "src/lib/doslib/8254.h" /* 8254 timer */
\r
+#include "src/lib/16_snd.h"
\r
+//#include <hw/8254/8254.h> /* 8254 timer */
\r
+//#include <hw/adlib/adlib.h>
\r
\r
static unsigned int musical_scale[18] = {
\r
0x1B0, /* E */
\r
\r
static unsigned int musical_scale[18] = {
\r
0x1B0, /* E */
\r
@@
-51,7
+51,10
@@
static unsigned int musical_scale[18] = {
\r
void main(int argc, char near *argv[])
\r
{
\r
\r
void main(int argc, char near *argv[])
\r
{
\r
+ static global_game_variables_t gvar;
\r
word i;
\r
word i;
\r
+ boolean done;
\r
+ ScanCode scan;
\r
// static FMInstrument testInst =
\r
//{
\r
//0x00, 0x01, /* modulator frequency multiple... 0x20 */
\r
// static FMInstrument testInst =
\r
//{
\r
//0x00, 0x01, /* modulator frequency multiple... 0x20 */
\r
@@
-62,14
+65,14
@@
void main(int argc, char near *argv[])
//0x36, /* feedback algorithm and strength 0xC0 */
\r
//};
\r
\r
//0x36, /* feedback algorithm and strength 0xC0 */
\r
//};
\r
\r
- IN_Startup();
\r
//FMReset();
\r
//FMSetVoice(0, &testInst);
\r
if(!init_adlib())
\r
{
\r
printf("Cannot init library\n");
\r
//FMReset();
\r
//FMSetVoice(0, &testInst);
\r
if(!init_adlib())
\r
{
\r
printf("Cannot init library\n");
\r
- exit(-
5
);
\r
+ exit(-
1
);
\r
}
\r
}
\r
+ IN_Startup(&gvar);
\r
\r
if (adlib_fm_voices > 9)
\r
printf("OPL3!\n");
\r
\r
if (adlib_fm_voices > 9)
\r
printf("OPL3!\n");
\r
@@
-114,23
+117,32
@@
void main(int argc, char near *argv[])
adlib_apply_all();
\r
\r
printf("press Z! to noise\npress ESC to quit");
\r
adlib_apply_all();
\r
\r
printf("press Z! to noise\npress ESC to quit");
\r
- printf("p");
\r
-
while(!IN_qb(1)
)
\r
+ printf("
\n
p");
\r
+
for (done = false;!done;
)
\r
{
\r
{
\r
- if(IN_qb(44))
\r
- {
\r
- printf("e");
\r
- adlib_fm[0].mod.key_on = 1;
\r
- //FMKeyOn(0, 0x106, 4);
\r
- }
\r
- else
\r
+ while (!(scan = gvar.in.inst->LastScan))
\r
+ {}
\r
+// SD_Poll();
\r
+
\r
+ IN_ClearKey(scan);
\r
+ switch (scan)
\r
{
\r
{
\r
- adlib_fm[0].mod.key_on = 0;
\r
- //FMKeyOff(0);
\r
+ case sc_Escape:
\r
+ done = true;
\r
+ break;
\r
+ case sc_Z:
\r
+ adlib_fm[0].mod.key_on = 1;
\r
+ //FMKeyOn(0, 0x106, 4);
\r
+ break;
\r
+ default:
\r
+ adlib_fm[0].mod.key_on = 0;
\r
+ //FMKeyOff(0);
\r
+ break;
\r
}
\r
}
\r
+ if(adlib_fm[0].mod.key_on) printf("e");
\r
adlib_update_groupA0(0,&adlib_fm[0]);
\r
}
\r
printf("!\n");
\r
shutdown_adlib();
\r
adlib_update_groupA0(0,&adlib_fm[0]);
\r
}
\r
printf("!\n");
\r
shutdown_adlib();
\r
- IN_Shutdown();
\r
+ IN_Shutdown(
&gvar
);
\r
}
\r
}
\r