/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 pngwen * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 andrius4669 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 pngwen * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 andrius4669 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 pngwen * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 andrius4669 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 pngwen * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 andrius4669 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#include <stdio.h>
-#include "src/lib/16_head.h"
-#include "src/lib/16_ca.h"
-#include "src/lib/16_mm.h"
-#include "src/lib/types.h"
-
-void
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+#include <stdio.h>\r
+#include "src/lib/16_head.h"\r
+#include "src/lib/16_ca.h"\r
+#include "src/lib/16_mm.h"\r
+#include "src/lib/types.h"\r
+\r
+void\r
main(int argc, char *argv[])\r
-{
- int x=420;
- int huge *ptr=&x;
- int *ptr0=&x;
- //void __based(__self) *pee;
- memptr pee;
- void __near *npee;
- void __far *fpee;
- void *dpee;
- __segment segu;
- //word csw=0,dsw=0,esw=0,ssw=0,ipw=0;
-
- _nheapgrow();
- _fheapgrow();
- _heapgrow();
- //ptr=&x;
- printf("&main()=%Fp\n", *argv[0]);
- printf("ptr0=%Fp\n", ptr0);
- //printf("&ptr0=%Fp\n", &ptr0);
- printf("*ptr0=%d\n", *ptr0);
- printf("ptr=%Fp\n", ptr);
- //printf("&ptr=%Fp\n", &ptr);
- printf("*ptr=%d\n", *ptr);
- printf("address of *ptr=%Fp\n", *ptr);
- printf("&x=%Fp\n", &x);
- printf("x=%d\n", x);
- printf("\n");
- /*__asm
- {
- //lea csw,cs
- //lds DS,dsw
- //les ES,esw
-// mov ss,ssw
-// mov ip,ipw
- }*/
- //printf("ip=%u\n", ipw);
- //printf("ss=%u\n", ssw);
- //printf("cs=%u\n", csw);
- //printf("ds=%u\n", dsw);
- //printf("es=%u\n", esw);
- printf("memavl=%u\n", _memavl());
- printf("size of based pee~=%u %FP\n", _bmsize(segu, pee), pee);
- printf("size of default pee~=%u %FP\n", _msize(dpee), dpee);
- printf("size of near pee~=%u %FP\n", _nmsize(npee), npee);
- printf("size of far pee~=%u %FP\n", _fmsize(fpee), fpee);
- printf("pee=%Fp\n", pee);
- printf("npee=%Fp\n", npee);
- printf("&main()=%Fp\n", *argv[0]);
-}
+{\r
+ int x=420;\r
+ int huge *ptr=&x;\r
+ int *ptr0=&x;\r
+ //void __based(__self) *pee;\r
+ memptr pee;\r
+ void __near *npee;\r
+ void __far *fpee;\r
+ void *dpee;\r
+ __segment segu;\r
+ //word csw=0,dsw=0,esw=0,ssw=0,ipw=0;\r
+\r
+ _nheapgrow();\r
+ _fheapgrow();\r
+ _heapgrow();\r
+ //ptr=&x;\r
+ printf("&main()=%Fp\n", *argv[0]);\r
+ printf("ptr0=%Fp\n", ptr0);\r
+ //printf("&ptr0=%Fp\n", &ptr0);\r
+ printf("*ptr0=%d\n", *ptr0);\r
+ printf("ptr=%Fp\n", ptr);\r
+ //printf("&ptr=%Fp\n", &ptr);\r
+ printf("*ptr=%d\n", *ptr);\r
+ printf("address of *ptr=%Fp\n", *ptr);\r
+ printf("&x=%Fp\n", &x);\r
+ printf("x=%d\n", x);\r
+ printf("\n");\r
+ /*__asm\r
+ {\r
+ //lea csw,cs\r
+ //lds DS,dsw\r
+ //les ES,esw\r
+// mov ss,ssw\r
+// mov ip,ipw\r
+ }*/\r
+ //printf("ip=%u\n", ipw);\r
+ //printf("ss=%u\n", ssw);\r
+ //printf("cs=%u\n", csw);\r
+ //printf("ds=%u\n", dsw);\r
+ //printf("es=%u\n", esw);\r
+ printf("memavl=%u\n", _memavl());\r
+ printf("size of based pee~=%u %FP\n", _bmsize(segu, pee), pee);\r
+ printf("size of default pee~=%u %FP\n", _msize(dpee), dpee);\r
+ printf("size of near pee~=%u %FP\n", _nmsize(npee), npee);\r
+ printf("size of far pee~=%u %FP\n", _fmsize(fpee), fpee);\r
+ printf("pee=%Fp\n", pee);\r
+ printf("npee=%Fp\n", npee);\r
+ printf("&main()=%Fp\n", *argv[0]);\r
+}\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
}\r
\r
// printf("*argv[1]=%d\n", *argv[1]);\r
-
+\r
printf("Font type: ");\r
- gets(&ct);
+ gets(&ct);\r
\r
printf("Character: ");\r
gets(&c);\r
if(ct!=1)\r
switch(ct)\r
{\r
- case 48:
+ case 48:\r
printf("type 0\n");\r
t=0;\r
w=14;\r
break;\r
- case 49:
+ case 49:\r
printf("type 1\n");\r
t=1;\r
w=8;\r
break;\r
- case 50:
+ case 50:\r
printf("type 2\n");\r
t=2;\r
w=8;\r
break;\r
- case 51:
+ case 51:\r
printf("type 3\n");\r
t=3;\r
w=16;\r
break;\r
- default:
+ default:\r
printf("type 3\n");\r
t=3;\r
w=16;\r
break;\r
}\r
else\r
- {
+ {\r
printf("type 3\n");\r
t=3;\r
- w=16; \r
+ w=16;\r
}\r
\r
\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include "src/lib/16_snd.h"
-
-void opl2out(word reg, word data)
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#include "src/lib/16_snd.h"\r
+\r
+void opl2out(word reg, word data)\r
{\r
- __asm
+ __asm\r
{\r
mov ax,reg\r
mov dx,word ptr [ADLIB_FM_ADDRESS]\r
mov cx,36\r
@@3: in al,dx\r
loop @@3\r
- }
+ }\r
}\r
\r
-void opl3out(word reg, word data)
+void opl3out(word reg, word data)\r
{\r
- __asm
+ __asm\r
{\r
mov ax,reg\r
mov dx,word ptr [ADLIB_FM_ADDRESS]\r
mov cx,26\r
@@2: in al,dx\r
loop @@2\r
- }
+ }\r
}\r
\r
-void opl3exp(word data)
+void opl3exp(word data)\r
{\r
- __asm
+ __asm\r
{\r
mov ax,data\r
mov dx,word ptr [ADLIB_FM_ADDRESS]\r
out dx,al\r
mov cx,36\r
@@2: in al,dx\r
- loop @@2
+ loop @@2\r
}\r
-}
-
+}\r
+\r
/* Function: FMResest *******************************************************\r
*\r
* Description: quick and dirty sound card reset (zeros all\r
* registers).\r
*\r
*/\r
-void FMReset(void/*int percusiveMode*/)
+void FMReset(void/*int percusiveMode*/)\r
{\r
int i;\r
\r
opl2out(0xBD, 0x20);\r
\r
//FMSetPercusiveMode(percusiveMode);\r
-} /* End of FMReset */
-
+} /* End of FMReset */\r
+\r
/* Function: FMKeyOff *******************************************************\r
*\r
* Parameters: voice - which voice to turn off.\r
* Description: turns off the specified voice.\r
*\r
*/\r
-void FMKeyOff(int voice)
+void FMKeyOff(int voice)\r
{\r
int regNum;\r
\r
* octave.\r
*\r
*/\r
-void FMKeyOn(int voice, int freq, int octave)
+void FMKeyOn(int voice, int freq, int octave)\r
{\r
int regNum, tmp;\r
\r
regNum = 0xA0 + voice % 11;//NUMVOICE;\r
opl2out(regNum, freq & 0xff);\r
regNum = 0xB0 + voice % 11;//NUMVOICE;\r
- tmp = (freq >> 8) | (octave << 2) | 0x20;
+ tmp = (freq >> 8) | (octave << 2) | 0x20;\r
opl2out(regNum, tmp);\r
-} /* End of FMKeyOn */
-
+} /* End of FMKeyOn */\r
+\r
/* Function: FMSetVoice *****************************************************\r
*\r
* Parameters: voiceNum - which voice to set.\r
/* set Feedback/Selectivity */\r
opCellNum = (byte)0xC0 + (byte)voiceNum;\r
opl2out(opCellNum, ins->Feedback);\r
-} /* End of FMSetVoice */
+} /* End of FMSetVoice */\r
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#ifndef __16_SND_H_
-#define __16_SND_H_
-
-#include "src/lib/16_head.h"
-
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#ifndef __16_SND_H_\r
+#define __16_SND_H_\r
+\r
+#include "src/lib/16_head.h"\r
+\r
#define MIN_REGISTER 0x01\r
#define MAX_REGISTER 0xF5\r
#define ADLIB_FM_ADDRESS 0x388 /* adlib address/status register */\r
-#define ADLIB_FM_DATA 0x389 /* adlib data register */
-
+#define ADLIB_FM_DATA 0x389 /* adlib data register */\r
+\r
/*\r
* FM Instrument definition for .SBI files - SoundBlaster instrument\r
* - these are the important parts - we will skip the header, but since\r
byte WaveSelect[2]; /* output waveform distortion */\r
byte Feedback; /* feedback algorithm and strength */\r
} FMInstrument;\r
-
-
-void opl2out(word reg, word data);
-void opl3out(word reg, word data);
-void opl3exp(word data);
-
-void FMReset(void/*int percusiveMode*/);
-void FMKeyOff(int voice);
-void FMKeyOn(int voice, int freq, int octave);
-void FMSetVoice(int voiceNum, FMInstrument *ins);
-
-#endif /*__16_SND_H_*/
+\r
+\r
+void opl2out(word reg, word data);\r
+void opl3out(word reg, word data);\r
+void opl3exp(word data);\r
+\r
+void FMReset(void/*int percusiveMode*/);\r
+void FMKeyOff(int voice);\r
+void FMKeyOn(int voice, int freq, int octave);\r
+void FMSetVoice(int voiceNum, FMInstrument *ins);\r
+\r
+#endif /*__16_SND_H_*/\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
* Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as publipage->shed by
+ * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You page->should have received a copy of the GNU General Public License
+ * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>, or
* write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA.
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
#include "src/lib/mapread.h"\r
-
-#define DUMP
-//#define DUMP_MAP
-
-void
+\r
+#define DUMP\r
+//#define DUMP_MAP\r
+\r
+void\r
main(int argc, char *argv[])\r
{\r
- map_t map;
- short i;
- loadmap("data/test.map", &map);
- #ifdef DUMP
- fprintf(stdout, "map.width= %d\n", map.width);
- fprintf(stdout, "map.height= %d\n", map.height);
- #ifdef DUMP_MAP
- for(i=0; i<(map.width*map.height); i++)
- {
- fprintf(stdout, "%04d[%02d]", i, map.data[i]);
- if(i && !(i%map.width)) fprintf(stdout, "\n");
- }
- fprintf(stdout, "\n");
- #endif
- fprintf(stdout, "&main()=%Fp\n", *argv[0]);
- fprintf(stdout, "&map==%Fp\n", &map);
- fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
- fprintf(stdout, "&map.width==%Fp\n", map.width);
+ map_t map;\r
+ short i;\r
+ loadmap("data/test.map", &map);\r
+ #ifdef DUMP\r
+ fprintf(stdout, "map.width= %d\n", map.width);\r
+ fprintf(stdout, "map.height= %d\n", map.height);\r
+ #ifdef DUMP_MAP\r
+ for(i=0; i<(map.width*map.height); i++)\r
+ {\r
+ fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
+ if(i && !(i%map.width)) fprintf(stdout, "\n");\r
+ }\r
+ fprintf(stdout, "\n");\r
+ #endif\r
+ fprintf(stdout, "&main()=%Fp\n", *argv[0]);\r
+ fprintf(stdout, "&map==%Fp\n", &map);\r
+ fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);\r
+ fprintf(stdout, "&map.width==%Fp\n", map.width);\r
fprintf(stdout, "&map.height==%Fp\n", map.height);\r
- fprintf(stdout, "&map.data==%Fp\n", map.data);
- #endif
- fprintf(stdout, "okies~\n");
+ fprintf(stdout, "&map.data==%Fp\n", map.data);\r
+ #endif\r
+ fprintf(stdout, "okies~\n");\r
}\r
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include <conio.h>
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#include <conio.h>\r
#include "src/lib/fmapread.h"\r
-
-#define DUMP
-//#define DUMP_MAP
-
-void
+\r
+#define DUMP\r
+//#define DUMP_MAP\r
+\r
+void\r
main(int argc, char *argv[])\r
{\r
- map_t map;
- short i;
- char *fmt = "Memory available = %u\n";
- char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";
-
- fprintf(stderr, fmt, _memavl());
- fprintf(stderr, fmt0, _memmax());
- fprintf(stderr, "Size of map var = %u\n", _msize(&map));
- fprintf(stderr, "program always crashes for some reason....");
- getch();
-
- fprintf(stderr, "loading~\n\n");
- loadmap("data/tes0.map", &map);
- fprintf(stderr, "\nokies~\n");
- #ifdef DUMP
- fprintf(stdout, "map.width= %d\n", map.width);
- fprintf(stdout, "map.height= %d\n", map.height);
- #ifdef DUMP_MAP
- for(i=0; i<(map.width*map.height); i++)
- {
- fprintf(stdout, "%04d[%02d]", i, map.data[i]);
- if(i && !(i%map.width)) fprintf(stdout, "\n");
- }
- fprintf(stdout, "\n");
- #endif
- fprintf(stdout, "&main()=%Fp\n", *argv[0]);
- fprintf(stdout, "&map==%Fp\n", &map);
- fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
- fprintf(stdout, "&map.width==%Fp\n", map.width);
+ map_t map;\r
+ short i;\r
+ char *fmt = "Memory available = %u\n";\r
+ char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";\r
+\r
+ fprintf(stderr, fmt, _memavl());\r
+ fprintf(stderr, fmt0, _memmax());\r
+ fprintf(stderr, "Size of map var = %u\n", _msize(&map));\r
+ fprintf(stderr, "program always crashes for some reason....");\r
+ getch();\r
+\r
+ fprintf(stderr, "loading~\n\n");\r
+ loadmap("data/tes0.map", &map);\r
+ fprintf(stderr, "\nokies~\n");\r
+ #ifdef DUMP\r
+ fprintf(stdout, "map.width= %d\n", map.width);\r
+ fprintf(stdout, "map.height= %d\n", map.height);\r
+ #ifdef DUMP_MAP\r
+ for(i=0; i<(map.width*map.height); i++)\r
+ {\r
+ fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
+ if(i && !(i%map.width)) fprintf(stdout, "\n");\r
+ }\r
+ fprintf(stdout, "\n");\r
+ #endif\r
+ fprintf(stdout, "&main()=%Fp\n", *argv[0]);\r
+ fprintf(stdout, "&map==%Fp\n", &map);\r
+ fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);\r
+ fprintf(stdout, "&map.width==%Fp\n", map.width);\r
fprintf(stdout, "&map.height==%Fp\n", map.height);\r
- fprintf(stdout, "&map.data==%Fp\n", map.data);
- #endif
- fprintf(stdout, "okies~\n");
+ fprintf(stdout, "&map.data==%Fp\n", map.data);\r
+ #endif\r
+ fprintf(stdout, "okies~\n");\r
}\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
*
* This file is part of Project 16.
*
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
* write to the Free Software Foundation, Inc., 51 Franklin Street,\r
* Fifth Floor, Boston, MA 02110-1301 USA.\r
*\r
- */
-
-#include <stdio.h>
-
-#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 */
-
-static unsigned int musical_scale[18] = {
- 0x1B0, /* E */
- 0x1CA, /* F */
- 0x1E5, /* f# */
- 0x202, /* G */
- 0x220, /* G# */
- 0x241, /* A */
- 0x263, /* A# */
- 0x287, /* B */
- 0x2AE, /* C */
-
- 0x2B0, /* E */
- 0x2CA, /* F */
- 0x2E5, /* f# */
- 0x302, /* G */
- 0x320, /* G# */
- 0x341, /* A */
- 0x363, /* A# */
- 0x387, /* B */
- 0x3AE, /* C */
-};
-
+ */\r
+\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
+\r
+static unsigned int musical_scale[18] = {\r
+ 0x1B0, /* E */\r
+ 0x1CA, /* F */\r
+ 0x1E5, /* f# */\r
+ 0x202, /* G */\r
+ 0x220, /* G# */\r
+ 0x241, /* A */\r
+ 0x263, /* A# */\r
+ 0x287, /* B */\r
+ 0x2AE, /* C */\r
+\r
+ 0x2B0, /* E */\r
+ 0x2CA, /* F */\r
+ 0x2E5, /* f# */\r
+ 0x302, /* G */\r
+ 0x320, /* G# */\r
+ 0x341, /* A */\r
+ 0x363, /* A# */\r
+ 0x387, /* B */\r
+ 0x3AE, /* C */\r
+};\r
+\r
void main(int argc, char near *argv[])\r
-{
- word i;
+{\r
+ word i;\r
// static FMInstrument testInst =\r
//{\r
//0x00, 0x01, /* modulator frequency multiple... 0x20 */\r
//0x73, 0x73, /* modulator sustain/release... 0x80 */\r
//0x03, 0x00, /* output waveform distortion 0xE0 */\r
//0x36, /* feedback algorithm and strength 0xC0 */\r
-//};
-
- IN_Startup();
- //FMReset();
- //FMSetVoice(0, &testInst);
- if(!init_adlib())
- {
- printf("Cannot init library\n");
- exit(-5);
- }
-
- if (adlib_fm_voices > 9)
- printf("OPL3!\n");
-// vga_bios_set_80x50_text();
-
- memset(adlib_fm,0,sizeof(adlib_fm));
- memset(&adlib_reg_bd,0,sizeof(adlib_reg_bd));
- for (i=0;i < adlib_fm_voices;i++) {
- struct adlib_fm_operator *f;
- f = &adlib_fm[i].mod;
- f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;
- f = &adlib_fm[i].car;
- f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;
- }
-
- for (i=0;i < /*adlib_fm_voices*/1;i++) {
- struct adlib_fm_operator *f;
-
- f = &adlib_fm[i].mod;
- f->mod_multiple = 1;
- f->total_level = 63 - 16;
- f->attack_rate = 15;
- f->decay_rate = 0;
- f->sustain_level = 7;
- f->release_rate = 7;
- f->f_number = musical_scale[i%18];
- f->octave = 4;
- f->key_on = 0;
-
- f = &adlib_fm[i].car;
- f->mod_multiple = 1;
- f->total_level = 63 - 16;
- f->attack_rate = 15;
- f->decay_rate = 0;
- f->sustain_level = 7;
- f->release_rate = 7;
- f->f_number = 0;
- f->octave = 0;
- f->key_on = 0;
- }
-
- adlib_apply_all();
-
- printf("press Z! to noise\npress ESC to quit");
- printf("p");
- while(!IN_qb(1))
- {
- if(IN_qb(44))
- {
- printf("e");
+//};\r
+\r
+ IN_Startup();\r
+ //FMReset();\r
+ //FMSetVoice(0, &testInst);\r
+ if(!init_adlib())\r
+ {\r
+ printf("Cannot init library\n");\r
+ exit(-5);\r
+ }\r
+\r
+ if (adlib_fm_voices > 9)\r
+ printf("OPL3!\n");\r
+// vga_bios_set_80x50_text();\r
+\r
+ memset(adlib_fm,0,sizeof(adlib_fm));\r
+ memset(&adlib_reg_bd,0,sizeof(adlib_reg_bd));\r
+ for (i=0;i < adlib_fm_voices;i++) {\r
+ struct adlib_fm_operator *f;\r
+ f = &adlib_fm[i].mod;\r
+ f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;\r
+ f = &adlib_fm[i].car;\r
+ f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;\r
+ }\r
+\r
+ for (i=0;i < /*adlib_fm_voices*/1;i++) {\r
+ struct adlib_fm_operator *f;\r
+\r
+ f = &adlib_fm[i].mod;\r
+ f->mod_multiple = 1;\r
+ f->total_level = 63 - 16;\r
+ f->attack_rate = 15;\r
+ f->decay_rate = 0;\r
+ f->sustain_level = 7;\r
+ f->release_rate = 7;\r
+ f->f_number = musical_scale[i%18];\r
+ f->octave = 4;\r
+ f->key_on = 0;\r
+\r
+ f = &adlib_fm[i].car;\r
+ f->mod_multiple = 1;\r
+ f->total_level = 63 - 16;\r
+ f->attack_rate = 15;\r
+ f->decay_rate = 0;\r
+ f->sustain_level = 7;\r
+ f->release_rate = 7;\r
+ f->f_number = 0;\r
+ f->octave = 0;\r
+ f->key_on = 0;\r
+ }\r
+\r
+ adlib_apply_all();\r
+\r
+ printf("press Z! to noise\npress ESC to quit");\r
+ printf("p");\r
+ while(!IN_qb(1))\r
+ {\r
+ if(IN_qb(44))\r
+ {\r
+ printf("e");\r
adlib_fm[0].mod.key_on = 1;\r
- //FMKeyOn(0, 0x106, 4);
- }
- else
- {
- adlib_fm[0].mod.key_on = 0;
- //FMKeyOff(0);
- }
+ //FMKeyOn(0, 0x106, 4);\r
+ }\r
+ else\r
+ {\r
+ adlib_fm[0].mod.key_on = 0;\r
+ //FMKeyOff(0);\r
+ }\r
adlib_update_groupA0(0,&adlib_fm[0]);\r
- }
- printf("!\n");
- shutdown_adlib();
- IN_Shutdown();
-}
+ }\r
+ printf("!\n");\r
+ shutdown_adlib();\r
+ IN_Shutdown();\r
+}\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
*\r
* This file is part of Project 16.\r
*\r