+++ /dev/null
-@echo off
-wmake all > 16.err
-beep
-echo *********
-echo * done! *
-echo *********
#ifndef _DOSLIB_KB_H_\r
#define _DOSLIB_KB_H_\r
-#include "lib\lib_com.h"\r
+#include "lib\lib_head.h"\r
\r
/* Maximum number of scan codes on keyboard controllers */\r
#define NUM_SCANCODES 128\r
-#include "src\lib\lib_com.h"\r
+//#include "src\lib\lib_head.h"
+#include "lib\lib_head.h"
\r
/* local function */\r
void wait(clock_t wait);\r
-#ifndef _LIBCOM_H_\r
-#define _LIBCOM_H_\r
+#ifndef _LIBHEAD_H_\r
+#define _LIBHEAD_H_\r
#include <dos.h>\r
#include <stdio.h>\r
#include <conio.h> // just for wait\r
\r
void wait(clock_t wait);\r
\r
-#endif/*_LIBCOM_H_*/\r
+#endif/*_LIBHEAD_H_*/\r
for(q=0; q<(TILEWH/SPEED); q++)
{\r
// modexDrawBmp(draw->page, &bmp);
- animatePlayer(show, 1, 1, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 1, 1, player.x, player.y, q, &ptmp);
mapScrollRight(draw, SPEED);
modexShowPage(draw->page);\r
- mapScrollRight(show, SPEED);\r
- SWAP(draw, show);\r
+// mapScrollRight(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.tx++;
}
{
player.x+=SPEED;
// modexDrawBmp(draw->page, player.x, player.y, &bmp);
- animatePlayer(show, 1, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 1, 0, player.x, player.y, q, &ptmp);
modexShowPage(draw->page);
SWAP(draw, show);
}
for(q=0; q<(TILEWH/SPEED); q++)
{
// modexDrawBmp(draw->page, player.x-((q+1)*SPEED), player.y, &bmp);
- animatePlayer(show, 3, 1, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 3, 1, player.x, player.y, q, &ptmp);
mapScrollLeft(draw, SPEED);
modexShowPage(draw->page);\r
- mapScrollLeft(show, SPEED);\r
- SWAP(draw, show);\r
+// mapScrollLeft(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.tx--;\r
}
{
player.x-=SPEED;
// modexDrawBmp(draw->page, player.x, player.y, &bmp);
- animatePlayer(show, 3, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 3, 0, player.x, player.y, q, &ptmp);
modexShowPage(draw->page);
SWAP(draw, show);
}
for(q=0; q<(TILEWH/SPEED); q++)
{
// modexDrawBmp(draw->page, player.x, player.y+((q+1)*SPEED), &bmp);
- animatePlayer(show, 2, 1, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 2, 1, player.x, player.y, q, &ptmp);
mapScrollDown(draw, SPEED);
modexShowPage(draw->page);\r
- mapScrollDown(show, SPEED);\r
- SWAP(draw, show);\r
+// mapScrollDown(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.ty++;
}
{
player.y+=SPEED;
// modexDrawBmp(draw->page, player.x, player.y, &bmp);
- animatePlayer(show, 2, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 2, 0, player.x, player.y, q, &ptmp);
modexShowPage(draw->page);
- SWAP(draw, show);
+// SWAP(draw, show);
}
player.ty++;
}\r
for(q=0; q<(TILEWH/SPEED); q++)
{\r
// modexDrawBmp(draw->page, player.x, player.y-((q+1)*SPEED), &bmp);
- animatePlayer(show, 0, 1, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 0, 1, player.x, player.y, q, &ptmp);
mapScrollUp(draw, SPEED);
modexShowPage(draw->page);
- mapScrollUp(show, SPEED);\r
- SWAP(draw, show);\r
+// mapScrollUp(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.ty--;
}
{
player.y-=SPEED;
// modexDrawBmp(draw->page, player.x, player.y, &bmp);
- animatePlayer(show, 0, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(draw, 0, 0, player.x, player.y, q, &ptmp);
modexShowPage(draw->page);
- SWAP(draw, show);
+// SWAP(draw, show);
}
player.ty--;
}\r
+++ /dev/null
-#include <stdio.h>\r
-\r
-#include "fixed32.hpp"\r
-\r
-Fixed32 SinTab[256];\r
-Fixed32 CosTab[256];\r
-\r
-\r
-void\r
-initFixed32(void)\r
-{\r
- FILE *fp;\r
-\r
- fp = fopen("sintab.dat", "rb");\r
- fread(SinTab, 4, 256, fp);\r
- fread(CosTab, 4, 256, fp);\r
- fclose(fp);\r
-}\r
-\r
-\r
-Fixed32\r
-FixedMul(Fixed32 num1, Fixed32 num2)\r
-{\r
- long Mm1, Mm2;\r
- short int MM, mm;\r
- short int hi1, hi2, lo1, lo2;\r
-\r
- hi1 = (num1 >> 16);\r
- hi2 = (num2 >> 16);\r
- lo1 = (num1 & 0xFFFF);\r
- lo2 = (num2 & 0xFFFF);\r
-\r
- MM = (hi1 * hi2);\r
- Mm1 = (lo2 * hi1);\r
- Mm2 = (lo1 * hi2);\r
- mm = (lo1 * lo2);\r
-\r
- return (Mm1 + Mm2 + mm + (((long)MM) << 16));\r
-}\r
-\r
-\r
-Fixed32\r
-FixedDiv(Fixed32 numer, Fixed32 denom)\r
-{\r
- return (numer / ROUND_FIXED_TO_INT(denom));\r
-}\r
-\r
-\r
-void\r
-CosSin(Iangle theta, Fixed32 *Cos, Fixed32 *Sin)\r
-{\r
- *Sin = SinTab[theta];\r
- *Cos = CosTab[theta];\r
-}\r
-\r
-\r
-/* ASM fixedpoint math routines\r
-;--------------------------------------------------\r
-; Sqrt - Fixed Point Square Root (High/Normal Precision)\r
-; IN : ecx\r
-; OUT : eax\r
-; Modified : ebx,ecx,edx\r
-Sqrt PROC\r
-\r
-;This is the High Precision version for the sqrt.\r
-;It gives the optimal 8.16 precision but takes\r
-;a little longer (24 iterations, 48 bits intead of\r
-;16 iterations and 32 bits)\r
-\r
- xor eax,eax ;eax is root\r
- mov ebx,40000000h\r
-sqrt1:\r
- mov edx,ecx ;edx = val\r
- sub edx,ebx ;val - bitsqr\r
- jb sqrt2\r
- sub edx,eax ;val - root\r
- jb sqrt2\r
- mov ecx,edx ;val >= (root+bitsqr) -> accept subs\r
- shr eax,1 ;root >> 1\r
- or eax,ebx ;root | bitsqr\r
- shr ebx,2 ;bitsqr>>2\r
- jnz sqrt1\r
- jz sqrt5\r
-sqrt2:\r
- shr eax,1 ;val < (root+bitsqr) -> dont change val\r
- shr ebx,2 ;bitsqr>>2\r
- jnz sqrt1\r
-; we now have the 8.8 precision\r
-\r
-sqrt5:\r
- mov ebx,00004000h\r
- shl eax,16\r
- shl ecx,16\r
-sqrt3:\r
- mov edx,ecx ;edx = val\r
- sub edx,ebx ;val - bitsqr\r
- jb sqrt4\r
- sub edx,eax ;val - root\r
- jb sqrt4\r
- mov ecx,edx ;val >= (root+bitsqr) -> accept subs\r
- shr eax,1 ;root >> 1\r
- or eax,ebx ;root | bitsqr\r
- shr ebx,2 ;bitsqr>>2\r
- jnz sqrt3\r
- ret\r
-sqrt4:\r
- shr eax,1 ;val < (root+bitsqr) -> dont change val\r
- shr ebx,2 ;bitsqr>>2\r
- jnz sqrt3\r
- ret\r
-\r
-Sqrt ENDP\r
-*/\r
-\r
+++ /dev/null
-#ifndef FIXEDPOINT_HPP\r
- #define FIXEDPOINT_HPP\r
-\r
-typedef long Fixed32; // 16.16 FixedPoint\r
-typedef unsigned char Iangle; // Integer angle (0..255)\r
-\r
-/* Macros for Type Conversion */\r
-#define INT_TO_FIXED(x) ((x) << 16)\r
-#define FIXED_TO_INT(x) ((x) >> 16)\r
-#define ROUND_FIXED_TO_INT(x) (((x) + 0x8000) >> 16)\r
-\r
-// Loads Fixed32 datafiles\r
-void initFixed32(void);\r
-\r
-// Common math functions\r
-Fixed32 FixedMul(Fixed32 num1, Fixed32 num2);\r
-Fixed32 FixedDiv(Fixed32 numer, Fixed32 denom);\r
-void CosSin(Iangle theta, Fixed32 *Cos, Fixed32 *Sin);\r
-\r
-Fixed32 FixedMulASM(Fixed32 num1, Fixed32 num2);\r
-#pragma aux FixedMulASM = \\r
- "imul edx" \\r
- "add eax, 8000h" \\r
- "adc edx, 0" \\r
- "shrd eax, edx, 16" \\r
- parm caller [eax] [edx] \\r
- value [eax] \\r
- modify [eax edx];\r
-\r
-Fixed32 FixedDivASM(Fixed32 numer, Fixed32 denom); // No rounding!\r
-#pragma aux FixedDivASM = \\r
- "xor eax, eax" \\r
- "shrd eax, edx, 16" \\r
- "sar edx, 16" \\r
- "idiv ebx" \\r
- parm caller [edx] [ebx] \\r
- value [eax] \\r
- modify [eax ebx edx];\r
-\r
-#endif\r
-\r
+++ /dev/null
-wcl386 test modex xprim xpal xblitbuf fixed32\r
-erase *.obj\r
+++ /dev/null
-#include <conio.h>\r
-#include <dos.h>\r
-#include <mem.h>\r
-\r
-#include "modex.hpp"\r
-\r
-#define ATTRCON_ADDR 0x3C0\r
-#define MISC_ADDR 0x3C2\r
-#define VGAENABLE_ADDR 0x3C3\r
-#define SEQU_ADDR 0x3C4\r
-#define GRACON_ADDR 0x3CE\r
-#define CRTC_ADDR 0x3D4\r
-#define STATUS_ADDR 0x3DA\r
-\r
-unsigned short width, height, widthBytes, num_pages;\r
-unsigned short pageSize, activeStart, visibleStart;\r
-unsigned char write_plane, read_plane;\r
-unsigned char *RowsX[600];\r
-unsigned char line_head[4] = { 0xFF, 0x0E, 0x0C, 0x08 };\r
-unsigned char line_tail[4] = { 0x00, 0x01, 0x03, 0x07 };\r
-unsigned short plane_mask[4] = { PLANE_0, PLANE_1, PLANE_2, PLANE_3 };\r
-unsigned short read_mask[4] = { READ_PLANE_0, READ_PLANE_1,\r
- READ_PLANE_2, READ_PLANE_3 };\r
-unsigned short text_mask[16] = { 0x0002, 0x0102, 0x0202, 0x0302,\r
- 0x0402, 0x0502, 0x0602, 0x0702,\r
- 0x0802, 0x0902, 0x0A02, 0x0B02,\r
- 0x0C02, 0x0D02, 0x0E02, 0x0F02 };\r
-unsigned short page_offset[5];\r
-unsigned short page_mask_high[5];\r
-unsigned short page_mask_low[5];\r
-\r
-\r
-unsigned short ModeX_256x224regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x3f,\r
- 0x3d4, 0x02, 0x40,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x4a,\r
- 0x3d4, 0x05, 0x9a,\r
- 0x3d4, 0x06, 0x0b,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0xda,\r
- 0x3d4, 0x11, 0x9c,\r
- 0x3d4, 0x12, 0xbf,\r
- 0x3d4, 0x13, 0x20,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xc7,\r
- 0x3d4, 0x16, 0x04,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_256x240regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x3f,\r
- 0x3d4, 0x02, 0x40,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x4e,\r
- 0x3d4, 0x05, 0x96,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x20,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_256x256regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x3f,\r
- 0x3d4, 0x02, 0x40,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x4a,\r
- 0x3d4, 0x05, 0x9a,\r
- 0x3d4, 0x06, 0x23,\r
- 0x3d4, 0x07, 0xb2,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x61,\r
- 0x3d4, 0x10, 0x0a,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xff,\r
- 0x3d4, 0x13, 0x20,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x07,\r
- 0x3d4, 0x16, 0x1a,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_256x480regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x3f,\r
- 0x3d4, 0x02, 0x40,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x4e,\r
- 0x3d4, 0x05, 0x96,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x20,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_320x200regs[75] =\r
-{\r
- 0x3c2, 0x00, 0x63,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x4f,\r
- 0x3d4, 0x02, 0x50,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x54,\r
- 0x3d4, 0x05, 0x80,\r
- 0x3d4, 0x06, 0xbf,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0x9c,\r
- 0x3d4, 0x11, 0x8e,\r
- 0x3d4, 0x12, 0x8f,\r
- 0x3d4, 0x13, 0x28,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x96,\r
- 0x3d4, 0x16, 0xb9,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_320x240regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x4f,\r
- 0x3d4, 0x02, 0x50,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x54,\r
- 0x3d4, 0x05, 0x80,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x28,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_320x400regs[75] =\r
-{\r
- 0x3c2, 0x00, 0x63,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x4f,\r
- 0x3d4, 0x02, 0x50,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x54,\r
- 0x3d4, 0x05, 0x80,\r
- 0x3d4, 0x06, 0xbf,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0x9c,\r
- 0x3d4, 0x11, 0x8e,\r
- 0x3d4, 0x12, 0x8f,\r
- 0x3d4, 0x13, 0x28,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x96,\r
- 0x3d4, 0x16, 0xb9,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_320x480regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe3,\r
- 0x3d4, 0x00, 0x5f,\r
- 0x3d4, 0x01, 0x4f,\r
- 0x3d4, 0x02, 0x50,\r
- 0x3d4, 0x03, 0x82,\r
- 0x3d4, 0x04, 0x54,\r
- 0x3d4, 0x05, 0x80,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x28,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x200regs[75] =\r
-{\r
- 0x3c2, 0x00, 0x67,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0xbf,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0x9c,\r
- 0x3d4, 0x11, 0x8e,\r
- 0x3d4, 0x12, 0x8f,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x96,\r
- 0x3d4, 0x16, 0xb9,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x240regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x41,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x270regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0x30,\r
- 0x3d4, 0x07, 0xf0,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x61,\r
- 0x3d4, 0x10, 0x20,\r
- 0x3d4, 0x11, 0xa9,\r
- 0x3d4, 0x12, 0x1b,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x1f,\r
- 0x3d4, 0x16, 0x2f,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x360regs[75] =\r
-{\r
- 0x3c2, 0x00, 0x67,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0xbf,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0x88,\r
- 0x3d4, 0x11, 0x85,\r
- 0x3d4, 0x12, 0x67,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x6d,\r
- 0x3d4, 0x16, 0xba,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x400regs[75] =\r
-{\r
- 0x3c2, 0x00, 0x67,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0xbf,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0x9c,\r
- 0x3d4, 0x11, 0x8e,\r
- 0x3d4, 0x12, 0x8f,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x96,\r
- 0x3d4, 0x16, 0xb9,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_360x480regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x6b,\r
- 0x3d4, 0x01, 0x59,\r
- 0x3d4, 0x02, 0x5a,\r
- 0x3d4, 0x03, 0x8e,\r
- 0x3d4, 0x04, 0x5e,\r
- 0x3d4, 0x05, 0x8a,\r
- 0x3d4, 0x06, 0x0d,\r
- 0x3d4, 0x07, 0x3e,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0xea,\r
- 0x3d4, 0x11, 0xac,\r
- 0x3d4, 0x12, 0xdf,\r
- 0x3d4, 0x13, 0x2d,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0xe7,\r
- 0x3d4, 0x16, 0x06,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_376x282regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x6e,\r
- 0x3d4, 0x01, 0x5d,\r
- 0x3d4, 0x02, 0x5e,\r
- 0x3d4, 0x03, 0x91,\r
- 0x3d4, 0x04, 0x62,\r
- 0x3d4, 0x05, 0x8f,\r
- 0x3d4, 0x06, 0x62,\r
- 0x3d4, 0x07, 0xf0,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x61,\r
- 0x3d4, 0x10, 0x37,\r
- 0x3d4, 0x11, 0x89,\r
- 0x3d4, 0x12, 0x33,\r
- 0x3d4, 0x13, 0x2f,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x3c,\r
- 0x3d4, 0x16, 0x5c,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_376x564regs[75] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x6e,\r
- 0x3d4, 0x01, 0x5d,\r
- 0x3d4, 0x02, 0x5e,\r
- 0x3d4, 0x03, 0x91,\r
- 0x3d4, 0x04, 0x62,\r
- 0x3d4, 0x05, 0x8f,\r
- 0x3d4, 0x06, 0x62,\r
- 0x3d4, 0x07, 0xf0,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x60,\r
- 0x3d4, 0x10, 0x37,\r
- 0x3d4, 0x11, 0x89,\r
- 0x3d4, 0x12, 0x33,\r
- 0x3d4, 0x13, 0x2f,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x3c,\r
- 0x3d4, 0x16, 0x5c,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_400x300regs[78] =\r
-{\r
- 0x3c2, 0x00, 0xa7,\r
- 0x3d4, 0x00, 0x71,\r
- 0x3d4, 0x01, 0x63,\r
- 0x3d4, 0x02, 0x64,\r
- 0x3d4, 0x03, 0x92,\r
- 0x3d4, 0x04, 0x65,\r
- 0x3d4, 0x05, 0x82,\r
- 0x3d4, 0x06, 0x46,\r
- 0x3d4, 0x07, 0x1f,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x40,\r
- 0x3d4, 0x10, 0x31,\r
- 0x3d4, 0x11, 0x80,\r
- 0x3d4, 0x12, 0x2b,\r
- 0x3d4, 0x13, 0x32,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x2f,\r
- 0x3d4, 0x16, 0x44,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x02, 0x0f,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-unsigned short ModeX_400x600regs[78] =\r
-{\r
- 0x3c2, 0x00, 0xe7,\r
- 0x3d4, 0x00, 0x70,\r
- 0x3d4, 0x01, 0x63,\r
- 0x3d4, 0x02, 0x64,\r
- 0x3d4, 0x03, 0x92,\r
- 0x3d4, 0x04, 0x65,\r
- 0x3d4, 0x05, 0x82,\r
- 0x3d4, 0x06, 0x70,\r
- 0x3d4, 0x07, 0xf0,\r
- 0x3d4, 0x08, 0x00,\r
- 0x3d4, 0x09, 0x60,\r
- 0x3d4, 0x10, 0x5b,\r
- 0x3d4, 0x11, 0x8c,\r
- 0x3d4, 0x12, 0x57,\r
- 0x3d4, 0x13, 0x32,\r
- 0x3d4, 0x14, 0x00,\r
- 0x3d4, 0x15, 0x58,\r
- 0x3d4, 0x16, 0x70,\r
- 0x3d4, 0x17, 0xe3,\r
- 0x3c4, 0x01, 0x01,\r
- 0x3c4, 0x02, 0x0f,\r
- 0x3c4, 0x04, 0x06,\r
- 0x3ce, 0x05, 0x40,\r
- 0x3ce, 0x06, 0x05,\r
- 0x3c0, 0x10, 0x41,\r
- 0x3c0, 0x13, 0x00\r
-};\r
-\r
-\r
-void\r
-calc_rows(void)\r
-{\r
- int i;\r
-\r
- // Each byte addresses four pixels, so the width of a scan line\r
- // in *bytes* is one fourth of the number of pixels on a line.\r
- widthBytes = width / 4;\r
-\r
- pageSize = (widthBytes * height);\r
-\r
- for (i=0; i < height; i++) {\r
- RowsX[i] = (unsigned char *)((0xA000 << 4) + (widthBytes * i));\r
- }\r
-\r
- // Clear entire video memory, by selecting all four planes, then\r
- // writing 0 to entire segment.\r
- outpw(SEQU_ADDR, ALL_PLANES);\r
- memset((unsigned char *)(0xA000 << 4), 0x00, 0x00010000);\r
-\r
- // By default we want screen refreshing and drawing operations\r
- // to be based at offset 0 in the video segment.\r
- activeStart = visibleStart = 0;\r
-\r
- // Set current plane to invalid value\r
- write_plane = -1;\r
- read_plane = -1;\r
-\r
- // How many pages fit in 256K VGA Card?\r
- num_pages = ((64 * 1024) / pageSize);\r
-\r
- for (i=0; i < num_pages; i++) {\r
- page_offset[i] = (pageSize * i);\r
- page_mask_high[i] = (0x0C | (page_offset[i] & 0xFF00));\r
- page_mask_low[i] = (0x0D | ((page_offset[i] & 0x00FF) << 8));\r
- }\r
-}\r
-\r
-\r
-// setBaseXMode() does the initialization to make the VGA ready to\r
-// accept any combination of configuration register settings. This\r
-// involves enabling writes to index 0 to 7 of the CRT controller (port\r
-// 0x3D4), by clearing the most significant bit (bit 7) of index 0x11.\r
-void\r
-setBaseXMode(void)\r
-{\r
- int temp;\r
- union REGS r;\r
-\r
- r.x.eax = 0x0013;\r
- int386(0x10, &r, &r);\r
-\r
- outp(0x3D4, 0x11);\r
- temp = inp(0x3D5) & 0x7F;\r
- outp(0x3D4, 0x11);\r
- outp(0x3D5, temp);\r
-}\r
-\r
-\r
-void\r
-outReg(unsigned short *r)\r
-{\r
- switch (r[0]) {\r
- // First handle special cases:\r
-\r
- case ATTRCON_ADDR:\r
- // reset read/write flip-flop\r
- inp(STATUS_ADDR);\r
- outp(ATTRCON_ADDR, r[1] | 0x20);\r
- // ensure VGA output is enabled\r
- outp(ATTRCON_ADDR, r[2]);\r
- break;\r
-\r
- case MISC_ADDR:\r
- case VGAENABLE_ADDR:\r
- // Copy directly to port\r
- outp(r[0], r[2]);\r
- break;\r
-\r
- case SEQU_ADDR:\r
- case GRACON_ADDR:\r
- case CRTC_ADDR:\r
- default:\r
- // Index to port\r
- outp(r[0], r[1]);\r
- // Value to port+1\r
- outp(r[0] + 1, r[2]);\r
- break;\r
- }\r
-}\r
-\r
-void\r
-outRegArray(unsigned short *r, int n)\r
-{\r
- while (n--) {\r
- outReg(r);\r
- r += 3;\r
- }\r
-}\r
-\r
-\r
-void\r
-set80x25(void)\r
-{\r
- union REGS r;\r
- r.x.eax = 0x0003;\r
-\r
- int386(0x10, &r, &r);\r
-}\r
-\r
-void\r
-set256x224x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_256x224regs, 25);\r
-\r
- width = 256;\r
- height = 224;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set256x240x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_256x240regs, 25);\r
-\r
- width = 256;\r
- height = 240;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set256x256x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_256x256regs, 25);\r
-\r
- width = 256;\r
- height = 256;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set256x480x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_256x480regs, 25);\r
-\r
- width = 256;\r
- height = 480;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set320x200x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_320x200regs, 25);\r
-\r
- width = 320;\r
- height = 200;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set320x240x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_320x240regs, 25);\r
-\r
- width = 320;\r
- height = 240;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set320x400x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_320x400regs, 25);\r
-\r
- width = 320;\r
- height = 400;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set320x480x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_320x480regs, 25);\r
-\r
- width = 320;\r
- height = 480;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x200x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x200regs, 25);\r
-\r
- width = 360;\r
- height = 200;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x240x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x240regs, 25);\r
-\r
- width = 360;\r
- height = 240;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x270x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x270regs, 25);\r
-\r
- width = 360;\r
- height = 270;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x360x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x360regs, 25);\r
-\r
- width = 360;\r
- height = 360;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x400x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x400regs, 25);\r
-\r
- width = 360;\r
- height = 400;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set360x480x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_360x480regs, 25);\r
-\r
- width = 360;\r
- height = 480;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set376x282x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_376x282regs, 25);\r
-\r
- width = 376;\r
- height = 282;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set376x564x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_376x564regs, 25);\r
-\r
- width = 376;\r
- height = 564;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set400x300x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_400x300regs, 26);\r
-\r
- width = 400;\r
- height = 300;\r
-\r
- calc_rows();\r
-}\r
-\r
-void\r
-set400x600x256_X(void)\r
-{\r
- setBaseXMode();\r
- outRegArray(ModeX_400x600regs, 26);\r
-\r
- width = 400;\r
- height = 600;\r
-\r
- calc_rows();\r
-}\r
-\r
-\r
-COORD\r
-get_xres(void)\r
-{\r
- return width;\r
-}\r
-\r
-\r
-COORD\r
-get_yres(void)\r
-{\r
- return height;\r
-}\r
-\r
-\r
-void\r
-set_write_plane(unsigned short int plane_mask)\r
-{\r
- write_plane = -1;\r
- outpw(SEQU_ADDR, plane_mask);\r
-}\r
-\r
-\r
-void\r
-set_read_plane(unsigned short int plane_mask)\r
-{\r
- read_plane = -1;\r
- outpw(GRACON_ADDR, plane_mask);\r
-}\r
-\r
+++ /dev/null
-#ifndef MODEX_HPP\r
- #define MODEX_HPP\r
-\r
-#include "xtypes.hpp"\r
-\r
-// Some defines\r
-#define PLANE_0 0x0102\r
-#define PLANE_1 0x0202\r
-#define PLANE_2 0x0402\r
-#define PLANE_3 0x0802\r
-#define ALL_PLANES 0x0F02\r
-#define READ_PLANE_0 0x0004\r
-#define READ_PLANE_1 0x0104\r
-#define READ_PLANE_2 0x0204\r
-#define READ_PLANE_3 0x0304\r
-\r
-\r
-// External Variables needed by graphics routines\r
-extern unsigned short width, height, widthBytes, num_pages;\r
-extern unsigned short activeStart, visibleStart, pageSize;\r
-extern unsigned char write_plane, read_plane;\r
-extern unsigned char *RowsX[600];\r
-extern unsigned char line_head[4];\r
-extern unsigned char line_tail[4];\r
-extern unsigned short plane_mask[4];\r
-extern unsigned short read_mask[4];\r
-extern unsigned short text_mask[16];\r
-extern unsigned short page_offset[5];\r
-extern unsigned short page_mask_high[5];\r
-extern unsigned short page_mask_low[5];\r
-\r
-\r
-// Return to text mode\r
-void set80x25(void);\r
-\r
-// Set various ModeX resolutions\r
-void set256x224x256_X(void);\r
-void set256x240x256_X(void);\r
-void set256x256x256_X(void);\r
-void set256x480x256_X(void);\r
-void set320x200x256_X(void);\r
-void set320x240x256_X(void);\r
-void set320x400x256_X(void);\r
-void set320x480x256_X(void);\r
-void set360x200x256_X(void);\r
-void set360x240x256_X(void);\r
-void set360x270x256_X(void);\r
-void set360x360x256_X(void);\r
-void set360x400x256_X(void);\r
-void set360x480x256_X(void);\r
-void set376x282x256_X(void);\r
-void set376x564x256_X(void);\r
-void set400x300x256_X(void);\r
-void set400x600x256_X(void);\r
-\r
-COORD get_xres(void);\r
-COORD get_yres(void);\r
-\r
-void set_write_plane(unsigned short int plane_mask);\r
-void set_read_plane(unsigned short int plane_mask);\r
-\r
-#endif\r
-\r
+++ /dev/null
-#include <conio.h>\r
-#include <dos.h>\r
-#include <mem.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <time.h>\r
-\r
-#include "fixed32.hpp"\r
-#include "modex.hpp"\r
-#include "xprim.hpp"\r
-#include "xpal.hpp"\r
-#include "xblitbuf.hpp"\r
-\r
-#define FIRE_DEMO 0\r
-#define ROTATE_DEMO 0\r
-#define MONSTER_DEMO_ONE 0\r
-#define MONSTER_DEMO_TWO 0\r
-#define MATH_DEMO 0\r
-\r
-int\r
-monster_demo1(void)\r
-{\r
- clock_t begin, end;\r
- short int i;\r
- blitbuf sprite_image, blit_image;\r
-\r
- clearX(0);\r
-\r
- load_blitbufPCX("chikyuu.pcx", &sprite_image);\r
- aligned_bitblitX(0, 20, &sprite_image);\r
- getch();\r
-\r
- blit_image.image = NULL;\r
-\r
- i=99;\r
-\r
- begin = clock();\r
-\r
- while (i > 0) {\r
- scale_blitbuf(120 + (i << 1), (i << 1), &sprite_image, &blit_image);\r
- boxX((99 - i), (119 - i), (220 + i), (120 + i), 0);\r
- vanilla_bitblitX(100 - i, 120 - i, &blit_image);\r
- i--;\r
- }\r
-\r
- end = clock();\r
-\r
- i=120;\r
- while (i > 0) {\r
- scale_blitbuf(i, 2, &sprite_image, &blit_image);\r
-\r
- putpixelX(159 - (i >> 1), 119, 0);\r
- putpixelX(159 - (i >> 1), 120, 0);\r
- putpixelX(160 + (i >> 1), 119, 0);\r
- putpixelX(160 + (i >> 1), 120, 0);\r
-\r
- vanilla_bitblitX(160 - (i >> 1), 119, &blit_image);\r
- delay(10);\r
- i -= 2;\r
- }\r
-\r
- filledboxX(156, 119, 163, 120, 0);\r
- putpixelX(159, 120, 1);\r
- delay(250);\r
- putpixelX(159, 120, 0);\r
-\r
- filledboxX(156, 119, 163, 120, 0);\r
- clear_blitbuf(&sprite_image);\r
- clear_blitbuf(&blit_image);\r
-\r
- getch();\r
-\r
- return (end - begin);\r
-}\r
-\r
-\r
-void\r
-monster_demo2(void)\r
-{\r
- short int i;\r
- blitbuf sprite_image, blit_image;\r
-\r
- clearX(0);\r
-\r
- load_blitbufPCX("chikyuu.pcx", &sprite_image);\r
- aligned_bitblitX(0, 20, &sprite_image);\r
- getch();\r
-\r
- blit_image.image = NULL;\r
-\r
- i=99;\r
- while (i) {\r
- vertical_scale_blitbuf((i << 1), &sprite_image, &blit_image);\r
- boxX(0, (119 - i), 319, (120 + i), 0);\r
- aligned_bitblitX(0, 120 - i, &blit_image);\r
- i--;\r
- }\r
-\r
- filledboxX(0, 120, 319, 120, 0);\r
-\r
- i=318;\r
- while (i > 0) {\r
- scale_blitbuf(i, 1, &blit_image, &sprite_image);\r
-\r
- putpixelX(159 - (i >> 1), 119, 0);\r
- putpixelX(159 - (i >> 1), 120, 0);\r
- putpixelX(160 + (i >> 1), 119, 0);\r
- putpixelX(160 + (i >> 1), 120, 0);\r
-\r
- vanilla_bitblitX(160 - (i >> 1), 119, &sprite_image);\r
- delay(5);\r
- i -= 2;\r
- }\r
-\r
- filledboxX(156, 119, 163, 120, 0);\r
- putpixelX(159, 120, 1);\r
- delay(250);\r
- putpixelX(159, 120, 0);\r
- filledboxX(156, 119, 163, 120, 0);\r
- clear_blitbuf(&sprite_image);\r
- clear_blitbuf(&blit_image);\r
-\r
- getch();\r
-}\r
-\r
-\r
-void\r
-fire_demo(void)\r
-{\r
- #define V_WIDTH 80\r
- #define V_HEIGHT 50\r
- #define BUF_WIDTH 80\r
- #define BUF_HEIGHT 56\r
- #define REWIND (V_WIDTH * 3)\r
- #define BUF_SIZE (BUF_WIDTH * BUF_HEIGHT)\r
-\r
-unsigned char fire_pal[768] = {\r
- 0, 0, 0, 0, 0, 24, 0, 0, 24, 0, 0, 28,\r
- 0, 0, 32, 0, 0, 32, 0, 0, 36, 0, 0, 40,\r
- 8, 0, 40, 16, 0, 36, 24, 0, 36, 32, 0, 32,\r
- 40, 0, 28, 48, 0, 28, 56, 0, 24, 64, 0, 20,\r
- 72, 0, 20, 80, 0, 16, 88, 0, 16, 96, 0, 12,\r
- 104, 0, 8, 112, 0, 8, 120, 0, 4, 128, 0, 0,\r
- 128, 0, 0, 132, 0, 0, 136, 0, 0, 140, 0, 0,\r
- 144, 0, 0, 144, 0, 0, 148, 0, 0, 152, 0, 0,\r
- 156, 0, 0, 160, 0, 0, 160, 0, 0, 164, 0, 0,\r
- 168, 0, 0, 172, 0, 0, 176, 0, 0, 180, 0, 0,\r
- 184, 4, 0, 188, 4, 0, 192, 8, 0, 196, 8, 0,\r
- 200, 12, 0, 204, 12, 0, 208, 16, 0, 212, 16, 0,\r
- 216, 20, 0, 220, 20, 0, 224, 24, 0, 228, 24, 0,\r
- 232, 28, 0, 236, 28, 0, 240, 32, 0, 244, 32, 0,\r
- 252, 36, 0, 252, 36, 0, 252, 40, 0, 252, 40, 0,\r
- 252, 44, 0, 252, 44, 0, 252, 48, 0, 252, 48, 0,\r
- 252, 52, 0, 252, 52, 0, 252, 56, 0, 252, 56, 0,\r
- 252, 60, 0, 252, 60, 0, 252, 64, 0, 252, 64, 0,\r
- 252, 68, 0, 252, 68, 0, 252, 72, 0, 252, 72, 0,\r
- 252, 76, 0, 252, 76, 0, 252, 80, 0, 252, 80, 0,\r
- 252, 84, 0, 252, 84, 0, 252, 88, 0, 252, 88, 0,\r
- 252, 92, 0, 252, 96, 0, 252, 96, 0, 252, 100, 0,\r
- 252, 100, 0, 252, 104, 0, 252, 104, 0, 252, 108, 0,\r
- 252, 108, 0, 252, 112, 0, 252, 112, 0, 252, 116, 0,\r
- 252, 116, 0, 252, 120, 0, 252, 120, 0, 252, 124, 0,\r
- 252, 124, 0, 252, 128, 0, 252, 128, 0, 252, 132, 0,\r
- 252, 132, 0, 252, 136, 0, 252, 136, 0, 252, 140, 0,\r
- 252, 140, 0, 252, 144, 0, 252, 144, 0, 252, 148, 0,\r
- 252, 152, 0, 252, 152, 0, 252, 156, 0, 252, 156, 0,\r
- 252, 160, 0, 252, 160, 0, 252, 164, 0, 252, 164, 0,\r
- 252, 168, 0, 252, 168, 0, 252, 172, 0, 252, 172, 0,\r
- 252, 176, 0, 252, 176, 0, 252, 180, 0, 252, 180, 0,\r
- 252, 184, 0, 252, 184, 0, 252, 188, 0, 252, 188, 0,\r
- 252, 192, 0, 252, 192, 0, 252, 196, 0, 252, 196, 0,\r
- 252, 200, 0, 252, 200, 0, 252, 204, 0, 252, 208, 0,\r
- 252, 208, 0, 252, 208, 0, 252, 208, 0, 252, 208, 0,\r
- 252, 212, 0, 252, 212, 0, 252, 212, 0, 252, 212, 0,\r
- 252, 216, 0, 252, 216, 0, 252, 216, 0, 252, 216, 0,\r
- 252, 216, 0, 252, 220, 0, 252, 220, 0, 252, 220, 0,\r
- 252, 220, 0, 252, 224, 0, 252, 224, 0, 252, 224, 0,\r
- 252, 224, 0, 252, 228, 0, 252, 228, 0, 252, 228, 0,\r
- 252, 228, 0, 252, 228, 0, 252, 232, 0, 252, 232, 0,\r
- 252, 232, 0, 252, 232, 0, 252, 236, 0, 252, 236, 0,\r
- 252, 236, 0, 252, 236, 0, 252, 240, 0, 252, 240, 0,\r
- 252, 240, 0, 252, 240, 0, 252, 240, 0, 252, 244, 0,\r
- 252, 244, 0, 252, 244, 0, 252, 244, 0, 252, 248, 0,\r
- 252, 248, 0, 252, 248, 0, 252, 248, 0, 252, 252, 0,\r
- 252, 252, 4, 252, 252, 8, 252, 252, 12, 252, 252, 16,\r
- 252, 252, 20, 252, 252, 24, 252, 252, 28, 252, 252, 32,\r
- 252, 252, 36, 252, 252, 40, 252, 252, 40, 252, 252, 44,\r
- 252, 252, 48, 252, 252, 52, 252, 252, 56, 252, 252, 60,\r
- 252, 252, 64, 252, 252, 68, 252, 252, 72, 252, 252, 76,\r
- 252, 252, 80, 252, 252, 84, 252, 252, 84, 252, 252, 88,\r
- 252, 252, 92, 252, 252, 96, 252, 252, 100, 252, 252, 104,\r
- 252, 252, 108, 252, 252, 112, 252, 252, 116, 252, 252, 120,\r
- 252, 252, 124, 252, 252, 124, 252, 252, 128, 252, 252, 132,\r
- 252, 252, 136, 252, 252, 140, 252, 252, 144, 252, 252, 148,\r
- 252, 252, 152, 252, 252, 156, 252, 252, 160, 252, 252, 164,\r
- 252, 252, 168, 252, 252, 168, 252, 252, 172, 252, 252, 176,\r
- 252, 252, 180, 252, 252, 184, 252, 252, 188, 252, 252, 192,\r
- 252, 252, 196, 252, 252, 200, 252, 252, 204, 252, 252, 208,\r
- 252, 252, 208, 252, 252, 212, 252, 252, 216, 252, 252, 220,\r
- 252, 252, 224, 252, 252, 228, 252, 252, 232, 252, 252, 236,\r
- 252, 252, 240, 252, 252, 244, 252, 252, 248, 252, 252, 252\r
-};\r
-\r
- unsigned char *screen;\r
- unsigned char *flamebuf_ptr;\r
- unsigned char *flamebuf;\r
- unsigned char temp;\r
- unsigned short int i, j, skip;\r
- unsigned char temp_byte;\r
-\r
- set_paletteX(fire_pal);\r
- set_write_plane(ALL_PLANES);\r
- flamebuf = new unsigned char[BUF_SIZE];\r
- skip = V_WIDTH;\r
-\r
- // Initialize the video buffer to 0's\r
- memset(flamebuf, 0, BUF_SIZE);\r
-\r
- while (!kbhit()) {\r
- // Transform current buffer\r
- flamebuf_ptr = flamebuf;\r
- i = (BUF_HEIGHT - 2);\r
- while (i--) {\r
- *flamebuf_ptr = (*(flamebuf_ptr + BUF_WIDTH) +\r
- *(flamebuf_ptr + (BUF_WIDTH - 1)) +\r
- *(flamebuf_ptr + (BUF_WIDTH + 1)) +\r
- *(flamebuf_ptr + (BUF_WIDTH * 2))) >> 2;\r
-\r
- flamebuf_ptr += BUF_WIDTH;\r
- temp = *flamebuf_ptr;\r
- if (temp > 11) {\r
- *flamebuf_ptr -= 12;\r
- } else if (temp > 3) {\r
- *flamebuf_ptr -= 4;\r
- } else {\r
- *flamebuf_ptr = 0;\r
- }\r
- flamebuf_ptr += (1 - BUF_WIDTH);\r
-\r
- j = (BUF_WIDTH - 2);\r
- while (j--) {\r
- *flamebuf_ptr = (*(flamebuf_ptr + BUF_WIDTH) +\r
- *(flamebuf_ptr + (BUF_WIDTH - 1)) +\r
- *(flamebuf_ptr + (BUF_WIDTH + 1)) +\r
- *(flamebuf_ptr + (BUF_WIDTH * 2))) >> 2;\r
-\r
- flamebuf_ptr += BUF_WIDTH;\r
- temp = *flamebuf_ptr;\r
- if (temp > 11) {\r
- *flamebuf_ptr -= 12;\r
- } else if (temp > 3) {\r
- *flamebuf_ptr -= 4;\r
- } else {\r
- *flamebuf_ptr = 0;\r
- }\r
- flamebuf_ptr += (1 - BUF_WIDTH);\r
- }\r
-\r
- *flamebuf_ptr = (*(flamebuf_ptr + BUF_WIDTH) +\r
- *(flamebuf_ptr + (BUF_WIDTH - 1)) +\r
- *(flamebuf_ptr + (BUF_WIDTH * 2)) +\r
- *(flamebuf_ptr + (BUF_WIDTH * 2) +\r
- (BUF_WIDTH - 1))) >> 2;\r
-\r
- flamebuf_ptr += BUF_WIDTH;\r
- temp = *flamebuf_ptr;\r
- if (temp > 11) {\r
- *flamebuf_ptr -= 12;\r
- } else if (temp > 3) {\r
- *flamebuf_ptr -= 4;\r
- } else {\r
- *flamebuf_ptr = 0;\r
- }\r
- flamebuf_ptr += (1 - BUF_WIDTH);\r
- }\r
-\r
- // Set new bottom line with random white or black\r
- temp = 0;\r
- flamebuf_ptr = flamebuf + (BUF_WIDTH * (BUF_HEIGHT - 2));\r
-\r
- j = BUF_WIDTH;\r
- temp = 0;\r
- while (j--) {\r
- // We change the value 1/4 of the time\r
- if ((rand() & 0x03) == 3) {\r
- temp = (255 - temp);\r
- }\r
-\r
- *(flamebuf_ptr + BUF_WIDTH) = temp;\r
- *flamebuf_ptr++ = temp;\r
- }\r
-\r
- // Write the buffer to the screen\r
-// wait_for_retrace();\r
- screen = RowsX[40];\r
- flamebuf_ptr = flamebuf;\r
- i = V_HEIGHT;\r
- while (i--) {\r
- j = V_WIDTH;\r
- while (j--) {\r
- temp_byte = *flamebuf_ptr++;\r
- *screen = temp_byte;\r
- screen += skip;\r
- *screen = temp_byte;\r
- screen += skip;\r
- *screen = temp_byte;\r
- screen += skip;\r
- *screen++ = temp_byte;\r
- screen -= REWIND;\r
- }\r
- screen += REWIND;\r
- }\r
- }\r
-\r
- getch();\r
-\r
- delete flamebuf;\r
-}\r
-\r
-\r
-void\r
-main(void)\r
-{\r
- FILE *fp;\r
- char ch;\r
- unsigned char pal[768];\r
- COORD x1, y1, x2, y2;\r
- Iangle theta1, theta2;\r
- Fixed32 trigSin, trigCos;\r
- blitbuf blit_image, sprite_image;\r
- clock_t begin, end;\r
- short int x, y, temp, done;\r
- long i, time1, time2, time3, count, mtime;\r
- BYTE *ptr1;\r
- BYTE *ptr2;\r
-\r
- set320x240x256_X();\r
- clearX(0);\r
-\r
- getch();\r
-\r
- temp = loadfontX("vga8x8.fnt");\r
-\r
- if (temp) {\r
- putstringX(0, 0, "Hello!", 2);\r
- } else {\r
- return;\r
- }\r
-\r
- getch();\r
-\r
-#if ROTATE_DEMO\r
- get_BIOSpaletteX(pal, 0);\r
- set_paletteX(pal, 0);\r
-\r
- clearX(0);\r
- for (x=0; x < 320; x++) {\r
- for (y=0; y < 240; y++) {\r
- putpixelX(x, y, (x & 0xFF));\r
- }\r
- }\r
-\r
- getch();\r
-\r
- while (!kbhit()) {\r
- wait_for_retrace();\r
- rot_palette(-1);\r
- }\r
-\r
- getch();\r
-#endif\r
-\r
- load_blitbufPCX("chikyuu.pcx", &blit_image);\r
- scale_blitbuf(160, 100, &blit_image);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- clearX(0);\r
-\r
- getch();\r
-\r
- scale_blitbuf(224, 140, &blit_image);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- greyscale_blitbuf(&blit_image);\r
- grey_paletteX();\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- clearX(0);\r
-\r
- getch();\r
-\r
- scale_blitbuf(160, 100, &blit_image);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- clear_blitbuf(&blit_image);\r
- load_blitbufPCX("chikyuu.pcx", &blit_image);\r
- greyscale_blitbuf(&blit_image);\r
- smooth64_paletteX(1, 0, 1);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- flip_vertical_blitbuf(&blit_image);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- getch();\r
-\r
- clear_blitbuf(&blit_image);\r
- load_blitbufPCX("chikyuu.pcx", &blit_image);\r
- aligned_bitblitX(0, 0, &blit_image);\r
-\r
- done = 0;\r
- while (!done) {\r
- ch = getch();\r
- switch (ch) {\r
- case 'q':\r
- case 'Q':\r
- done = 1;\r
- break;\r
-\r
- case '+':\r
- brighten_paletteX(1, 1, 1);\r
- break;\r
-\r
- case '-':\r
- brighten_paletteX(-1, -1, -1);\r
- break;\r
-\r
- case '<':\r
- stretch_paletteX(11, 11, 11);\r
- break;\r
-\r
- case '>':\r
- stretch_paletteX(24, 24, 24);\r
- break;\r
-\r
- case 'S':\r
- case 's':\r
- save_blitbufPCX("dump.pcx", &blit_image);\r
- break;\r
-\r
- case 'L':\r
- case 'l':\r
- load_blitbufPCX("chikyuu.pcx", &blit_image);\r
- break;\r
-\r
- case 'R':\r
- brighten_paletteX(1, 0, 0);\r
- break;\r
-\r
- case 'G':\r
- brighten_paletteX(0, 1, 0);\r
- break;\r
-\r
- case 'B':\r
- brighten_paletteX(0, 0, 1);\r
- break;\r
-\r
- case 'r':\r
- brighten_paletteX(-1, 0, 0);\r
- break;\r
-\r
- case 'g':\r
- brighten_paletteX(0, -1, 0);\r
- break;\r
-\r
- case 'b':\r
- brighten_paletteX(0, 0, -1);\r
- break;\r
-\r
- }\r
- }\r
-\r
- clearX(0);\r
- srand(0);\r
- grey_paletteX();\r
-\r
- begin = clock();\r
-\r
- for (i=0; i < 10000; i++) {\r
- x1 = rand() % 320;\r
- y1 = rand() % 200;\r
- x2 = rand() % 320;\r
- y2 = rand() % 200;\r
-\r
- lineX(x1, y1, x2, y2, (i & 0x3F));\r
- }\r
-\r
- end = clock();\r
-\r
- time1 = (end - begin);\r
-\r
- begin = end;\r
-\r
- for (i=0; i < 10000; i++) {\r
- x1 = rand() % 320;\r
- y1 = rand() % 200;\r
- x2 = rand() % 320;\r
- y2 = rand() % 200;\r
-\r
- temp = ((x1 + x2 + y1 + y2) & 0x3F);\r
- }\r
-\r
- end = clock();\r
-\r
- time2 = (end - begin);\r
-\r
- getch();\r
-\r
- for (i=0; i < 120; i++) {\r
- filledboxX(i, i, (319-i), (239-i), (i & 0x3F));\r
- }\r
-\r
- getch();\r
-\r
- load_blitbufPCX("chikyuu.pcx", &sprite_image);\r
- transparent_bitblitX(100, 100, &sprite_image);\r
-\r
- getch();\r
-\r
- clearX(0);\r
- clear_blitbuf(&blit_image);\r
- scale_blitbuf(152, 168, &sprite_image);\r
- alloc_blitbuf(&blit_image, 152, 168);\r
-\r
- // 152x168 image\r
- aligned_bitblitX(84, 36, &sprite_image);\r
- getch();\r
-\r
- initFixed32();\r
-\r
- theta1=0;\r
- count=0;\r
-\r
- begin = clock();\r
-\r
- while (!kbhit()) {\r
- ptr1 = sprite_image.image;\r
- ptr2 = blit_image.image;\r
- theta2 = theta1;\r
-\r
- y=168;\r
- while (y--) {\r
- CosSin(theta2, &trigCos, &trigSin);\r
- scale_scanline(ptr1, ptr2, 152, 152, (trigCos >> 10) + 88);\r
-#if 0\r
- memcpy(ptr2+152, ptr2, 152);\r
- ptr1 += 304;\r
- ptr2 += 304;\r
- theta2 += 4;\r
- y--;\r
-#else\r
- ptr1 += 152;\r
- ptr2 += 152;\r
- theta2 += 2;\r
-#endif\r
- }\r
-\r
- theta1 += 2;\r
-\r
- aligned_bitblitX(84, 36, &blit_image);\r
- count++;\r
- }\r
-\r
- end = clock();\r
-\r
- getch();\r
- getch();\r
-\r
- clear_blitbuf(&blit_image);\r
- clear_blitbuf(&sprite_image);\r
-\r
-#if FIRE_DEMO\r
- clearX(0);\r
- fire_demo();\r
-#endif\r
-\r
-#if MONSTER_DEMO_ONE\r
- mtime = monster_demo1();\r
-#endif\r
-\r
-#if MONSTER_DEMO_TWO\r
- monster_demo2();\r
-#endif\r
-\r
- set80x25();\r
-\r
-/*#if MATH_DEMO\r
- Fixed32 c1, c2, c3, a1, a2, a3;\r
-\r
- c1 = INT_TO_FIXED(50);\r
- c2 = INT_TO_FIXED(70);\r
- c3 = INT_TO_FIXED(50 * 70);\r
-\r
- a1 = FixedMul(c1, c2);\r
- a2 = FixedMulASM(c1, c2);\r
-\r
- printf("MUL C version = %d\n", FIXED_TO_INT(a1));\r
- printf("MUL ASM version = %d\n", FIXED_TO_INT(a2));\r
-\r
- getch();\r
-\r
- a1 = FixedDiv(c3, c1);\r
- a2 = FixedDivASM(c3, c1);\r
-\r
- printf("DIV C version = %d\n", FIXED_TO_INT(a1));\r
- printf("DIV ASM version = %d\n", FIXED_TO_INT(a2));\r
-\r
- getch();\r
-#endif*/\r
-\r
- temp = (time1 - time2);\r
- printf("10000 lines took %4d ticks\n", time1);\r
- printf("rand() overhead = %4d ticks\n", time2);\r
- printf("Time in lineX = %4d ticks\n", temp);\r
- printf("%d lines per second!\n\n", (10000 * 1000) / (55 * temp));\r
-\r
- temp = (end-begin);\r
- printf("Buddha = %4d blits\n", count);\r
- printf(" = %4d per second\n", (count * 1000) / (55 * temp));\r
- printf("Buddha = %4d scanline stretches\n", (count * 168));\r
- printf(" = %4d per second!\n\n", (count * 168000) / (55 * temp));\r
-\r
- printf("Monster took %d ticks for 99 frames\n", mtime);\r
-}\r
-\r
+++ /dev/null
-#include <conio.h>\r
-#include <mem.h>\r
-#include <stdio.h>\r
-\r
-#include "xtypes.hpp"\r
-#include "modex.hpp"\r
-#include "xpal.hpp"\r
-#include "xblitbuf.hpp"\r
-\r
-#define SEQU_ADDR 0x3C4\r
-#define GRACON_ADDR 0x3CE\r
-\r
-\r
-void\r
-clear_blitbuf(blitbuf *buf)\r
-{\r
- buf->xsize = 0;\r
- buf->ysize = 0;\r
-\r
- delete buf->image;\r
-}\r
-\r
-\r
-void\r
-fill_blitbuf(BYTE color, blitbuf *buf)\r
-{\r
- memset(buf->image, color, buf->xsize * buf->ysize);\r
-}\r
-\r
-\r
-void\r
-alloc_blitbuf(blitbuf *buf, DIST xsize, DIST ysize)\r
-{\r
- buf->xsize = xsize;\r
- buf->ysize = ysize;\r
- buf->image = new BYTE[xsize * ysize];\r
-}\r
-\r
-\r
-void\r
-lin_2_pln_blitbuf(blitbuf *buf)\r
-{\r
- int i, j, size;\r
- BYTE *oldbuf;\r
- BYTE *newbuf;\r
- BYTE *src_ptr;\r
- BYTE *dest_ptr;\r
-\r
- oldbuf = buf->image;\r
-\r
- size = (buf->xsize * buf->ysize);\r
- newbuf = new BYTE[size];\r
- size = (size >> 2);\r
-\r
- dest_ptr = newbuf;\r
-\r
- for (i=0; i < 4; i++) {\r
- src_ptr = oldbuf + i;\r
-\r
- j=size;\r
- while (j--) {\r
- *dest_ptr++ = *src_ptr;\r
- src_ptr += 4;\r
- }\r
- }\r
-\r
- buf->image = newbuf;\r
- delete oldbuf;\r
-}\r
-\r
-\r
-void\r
-pln_2_lin_blitbuf(blitbuf *buf)\r
-{\r
- int i, j, size;\r
- BYTE *oldbuf;\r
- BYTE *newbuf;\r
- BYTE *src_ptr;\r
- BYTE *dest_ptr;\r
-\r
- oldbuf = buf->image;\r
-\r
- size = (buf->xsize * buf->ysize);\r
- newbuf = new BYTE[size];\r
- size = (size >> 2);\r
-\r
- src_ptr = oldbuf;\r
- for (i=0; i < 4; i++) {\r
- dest_ptr = newbuf + i;\r
-\r
- j=size;\r
- while (j--) {\r
- *dest_ptr = *src_ptr++;\r
- dest_ptr += 4;\r
- }\r
- }\r
-\r
- buf->image = newbuf;\r
- delete oldbuf;\r
-}\r
-\r
-\r
-void\r
-vanilla_bitblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int ysize, plane, i, j, loop, skip, rewind, len;\r
- short int xsize[4];\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- // Length of bitmap in each plane\r
- plane = (x & 3);\r
- i = buf->xsize + plane - 1;\r
- xsize[0] = ((i--) >> 2);\r
- xsize[1] = ((i--) >> 2);\r
- xsize[2] = ((i--) >> 2);\r
- xsize[3] = (i >> 2) + 1;\r
-\r
- for (i=plane; i < 3; i++) {\r
- xsize[i]++;\r
- }\r
-\r
- ysize = buf->ysize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
- write_plane = -1;\r
-\r
- for (loop = 0; loop < 4; loop++) {\r
- len = xsize[plane];\r
- rewind = buf->xsize - (len << 2);\r
- skip = widthBytes - len;\r
- buf_ptr = buf->image + loop;\r
- vga_ptr = base_vga;\r
-\r
- outpw(SEQU_ADDR, plane_mask[plane++]);\r
- if (plane == 4) {\r
- plane = 0;\r
- base_vga++;\r
- }\r
-\r
- i=ysize;\r
- while (i--) {\r
- j=len;\r
- while (j--) {\r
- *vga_ptr++ = *buf_ptr;\r
- buf_ptr += 4;\r
- }\r
-\r
- buf_ptr += rewind;\r
- vga_ptr += skip;\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-vanilla_getblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- // Do nothing\r
-}\r
-\r
-\r
-void\r
-aligned_bitblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int i, j, plane, skip, xsize, ysize;\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- xsize = (buf->xsize >> 2);\r
- ysize = buf->ysize;\r
- skip = widthBytes - xsize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
-\r
- for (plane=0; plane < 4; plane++) {\r
- buf_ptr = buf->image + plane;\r
- vga_ptr = base_vga;\r
-\r
- outpw(SEQU_ADDR, plane_mask[plane]);\r
-\r
- i=ysize;\r
- while (i--) {\r
- j=xsize;\r
- while (j--) {\r
- *vga_ptr++ = *buf_ptr;\r
- buf_ptr += 4;\r
- }\r
- vga_ptr += skip;\r
- }\r
- }\r
-\r
- write_plane = 3;\r
-}\r
-\r
-\r
-void\r
-aligned_getblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int i, j, plane, skip, xsize, ysize;\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- xsize = (buf->xsize >> 2);\r
- ysize = buf->ysize;\r
- skip = widthBytes - xsize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
-\r
- for (plane=0; plane < 4; plane++) {\r
- buf_ptr = buf->image + plane;\r
- vga_ptr = base_vga;\r
-\r
- outpw(GRACON_ADDR, read_mask[plane]);\r
-\r
- i=ysize;\r
- while (i--) {\r
- j=xsize;\r
- while (j--) {\r
- *buf_ptr = *vga_ptr++;\r
- buf_ptr += 4;\r
- }\r
- vga_ptr += skip;\r
- }\r
- }\r
-\r
- read_plane = 3;\r
-}\r
-\r
-\r
-void\r
-transparent_bitblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int i, j, plane, skip, xsize, ysize;\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- xsize = (buf->xsize >> 2);\r
- ysize = buf->ysize;\r
- skip = widthBytes - xsize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
-\r
- for (plane=0; plane < 4; plane++) {\r
- buf_ptr = buf->image + plane;\r
- vga_ptr = base_vga;\r
-\r
- outpw(SEQU_ADDR, plane_mask[plane]);\r
-\r
- i=ysize;\r
- while (i--) {\r
- j=xsize;\r
- while (j--) {\r
- if (*buf_ptr) {\r
- *vga_ptr = *buf_ptr;\r
- }\r
- vga_ptr++;\r
- buf_ptr += 4;\r
- }\r
- vga_ptr += skip;\r
- }\r
- }\r
-\r
- write_plane = 3;\r
-}\r
-\r
-\r
-void\r
-planar_bitblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int i, plane, xsize, ysize;\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- xsize = (buf->xsize >> 2);\r
- ysize = buf->ysize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
- buf_ptr = buf->image;\r
-\r
- for (plane=0; plane < 4; plane++) {\r
- vga_ptr = base_vga;\r
-\r
- outpw(SEQU_ADDR, plane_mask[plane]);\r
-\r
- i=ysize;\r
- while (i--) {\r
- memcpy(vga_ptr, buf_ptr, xsize);\r
- vga_ptr += widthBytes;\r
- buf_ptr += xsize;\r
- }\r
- }\r
-\r
- write_plane = 3;\r
-}\r
-\r
-\r
-void\r
-planar_getblitX(COORD x, COORD y, blitbuf *buf)\r
-{\r
- short int i, plane, xsize, ysize;\r
- BYTE *base_vga;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- xsize = (buf->xsize >> 2);\r
- ysize = buf->ysize;\r
- base_vga = RowsX[y] + (x >> 2) + activeStart;\r
- buf_ptr = buf->image;\r
-\r
- for (plane=0; plane < 4; plane++) {\r
- vga_ptr = base_vga;\r
-\r
- outpw(GRACON_ADDR, read_mask[plane]);\r
-\r
- i=ysize;\r
- while (i--) {\r
- memcpy(buf_ptr, vga_ptr, xsize);\r
- vga_ptr += widthBytes;\r
- buf_ptr += xsize;\r
- }\r
- }\r
-\r
- read_plane = 3;\r
-}\r
-\r
-\r
-void\r
-wide_bitblitX(COORD y, blitbuf *buf)\r
-{\r
- short int bufsize;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- write_plane = 3;\r
- buf_ptr = buf->image;\r
- vga_ptr = RowsX[y] + activeStart;\r
- bufsize = (buf->ysize * widthBytes);\r
-\r
- outpw(SEQU_ADDR, PLANE_0);\r
- memcpy(vga_ptr, buf_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(SEQU_ADDR, PLANE_1);\r
- memcpy(vga_ptr, buf_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(SEQU_ADDR, PLANE_2);\r
- memcpy(vga_ptr, buf_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(SEQU_ADDR, PLANE_3);\r
- memcpy(vga_ptr, buf_ptr, bufsize);\r
-}\r
-\r
-\r
-void\r
-wide_getblitX(COORD y, blitbuf *buf)\r
-{\r
- short int bufsize;\r
- BYTE *vga_ptr;\r
- BYTE *buf_ptr;\r
-\r
- read_plane = 3;\r
- buf_ptr = buf->image;\r
- vga_ptr = RowsX[y] + activeStart;\r
- bufsize = (buf->ysize * widthBytes);\r
-\r
- outpw(GRACON_ADDR, READ_PLANE_0);\r
- memcpy(buf_ptr, vga_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(GRACON_ADDR, READ_PLANE_1);\r
- memcpy(buf_ptr, vga_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(GRACON_ADDR, READ_PLANE_2);\r
- memcpy(buf_ptr, vga_ptr, bufsize);\r
- buf_ptr += bufsize;\r
-\r
- outpw(GRACON_ADDR, READ_PLANE_3);\r
- memcpy(buf_ptr, vga_ptr, bufsize);\r
-}\r
-\r
-\r
-void\r
-save_blitbufPCX(char *fname, blitbuf *buf)\r
-{\r
- FILE *fp;\r
- unsigned int i, size, temp_int;\r
- BYTE VGA_pal[768];\r
- BYTE *buf_ptr;\r
- BYTE temp_char, match, count;\r
-\r
- fp = fopen(fname, "wb");\r
-\r
- if (fp != NULL) {\r
- // Write manufacturer's byte\r
- temp_char = 10;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write version of PCX. 5 = 256 color (PCX Version 5.0)\r
- temp_char = 5;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write encoding type, always 1 for RLE.\r
- temp_char = 1;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write bits_per_pixel = 8.\r
- temp_char = 8;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write starting X and Y coords\r
- temp_int = 0;\r
- fwrite(&temp_int, 2, 1, fp);\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Write X size\r
- temp_int = (buf->xsize - 1);\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Write Y size\r
- temp_int = (buf->ysize - 1);\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Do HRES and VRES **\r
- temp_int = buf->xsize;\r
- fwrite(&temp_int, 2, 1, fp);\r
- temp_int = buf->ysize;\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Write 16 color palette, not used.\r
- temp_int = 0;\r
- i=24;\r
- while (i--) {\r
- fwrite(&temp_int, 2, 1, fp);\r
- }\r
-\r
- // Write vmode byte.\r
- temp_char = 0;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write bit_planes\r
- temp_char = 1;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- // Write bytes_per_line\r
- temp_int = buf->xsize;\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Write palette type\r
- temp_int = 1;\r
- fwrite(&temp_int, 2, 1, fp);\r
-\r
- // Write junk filler\r
- temp_int = 0;\r
- i=29;\r
- while (i--) {\r
- fwrite(&temp_int, 2, 1, fp);\r
- }\r
-\r
- // Write the actual image\r
- buf_ptr = buf->image;\r
- size = (buf->xsize * buf->ysize);\r
-\r
- count = 0;\r
- match = *buf_ptr;\r
-\r
- i=size;\r
- while (i--) {\r
- temp_char = *buf_ptr++;\r
-\r
- if ((temp_char == match) && (count < 63)) {\r
- count++;\r
- } else {\r
- if ((count == 1) && (match < 192)) {\r
- // Write single byte\r
- fwrite(&match,1,1,fp);\r
- } else {\r
- // Write run of pixels\r
- count += 192;\r
- fwrite(&count, 1, 1, fp);\r
- fwrite(&match, 1, 1, fp);\r
- }\r
- count = 1;\r
- match = temp_char;\r
- }\r
- }\r
-\r
- if ((count == 1) && (match < 192)) {\r
- // Write single byte\r
- fwrite(&match,1,1,fp);\r
- } else {\r
- // Write run of pixels\r
- count += 192;\r
- fwrite(&count, 1, 1, fp);\r
- fwrite(&match, 1, 1, fp);\r
- }\r
-\r
- // Write palette verification byte\r
- temp_char = 12;\r
- fwrite(&temp_char, 1, 1, fp);\r
-\r
- get_paletteX(VGA_pal);\r
-\r
- // Write 256 color palette\r
- fwrite(VGA_pal, 1, 768, fp);\r
-\r
- fclose(fp);\r
- }\r
-}\r
-\r
-\r
-int\r
-load_blitbufPCX(char *fname, blitbuf *buf)\r
-{\r
- FILE *fp;\r
- int size;\r
- BYTE VGA_pal[768];\r
- BYTE PCX_byte, RLE_byte;\r
- BYTE *buf_ptr;\r
- BYTE *end_of_buf;\r
-\r
- fp = fopen(fname, "rb");\r
-\r
- if (fp == NULL) {\r
- buf->xsize = 0;\r
- buf->ysize = 0;\r
- buf->image = NULL;\r
- return 0;\r
- } else {\r
- fseek(fp, 8, SEEK_SET);\r
- fread(&buf->xsize, 2, 1, fp);\r
- fread(&buf->ysize, 2, 1, fp);\r
-\r
- buf->xsize++;\r
- buf->ysize++;\r
-\r
- size = (buf->xsize * buf->ysize);\r
-\r
- buf->image = new BYTE[size];\r
- buf_ptr = buf->image;\r
- end_of_buf = buf_ptr + size;\r
-\r
- // Load 256 color PCX palette\r
- fseek(fp, -768, SEEK_END);\r
- fread(VGA_pal, 1, 768, fp);\r
-\r
- set_paletteX(VGA_pal);\r
-\r
- fseek(fp, 128, SEEK_SET);\r
-\r
- while (buf_ptr < end_of_buf) {\r
- // Read next packet\r
- fread(&PCX_byte, 1, 1, fp);\r
-\r
- if (PCX_byte < 192) {\r
- // Raw Pixel\r
- *buf_ptr++ = PCX_byte;\r
- } else {\r
- // RLE Pixels\r
- PCX_byte = PCX_byte & 0x3F;\r
- fread(&RLE_byte, 1, 1, fp);\r
- memset(buf_ptr, RLE_byte, PCX_byte);\r
- buf_ptr += PCX_byte;\r
- }\r
- }\r
-\r
- fclose(fp);\r
- return 1;\r
- }\r
-}\r
-\r
-\r
-void\r
-scale_blitbuf(DIST dest_x, DIST dest_y, blitbuf *buf1, blitbuf *buf2)\r
-{\r
- unsigned long ErrorAccX, ErrorAccY, ErrorAdjX, ErrorAdjY;\r
- DIST oldx, oldy, newx, newy;\r
- short int i, j, count;\r
- BYTE *src_base;\r
- BYTE *src_ptr;\r
- BYTE *dest_ptr;\r
- BYTE *newbuf;\r
-\r
- oldx = buf1->xsize;\r
- oldy = buf1->ysize;\r
- newx = dest_x;\r
- newy = dest_y;\r
-\r
- newbuf = new BYTE[newx * newy];\r
-\r
- src_base = buf1->image;\r
- dest_ptr = newbuf;\r
-\r
- // My bitmap scaling routine. As you probably noticed, it's\r
- // pretty Bresenhammy!\r
-\r
- ErrorAccY = 0x8000;\r
-\r
- if (newx > oldx) {\r
- // Biggering\r
- ErrorAdjX = ((((unsigned long)newx) << 16) /\r
- (((unsigned long)oldx)));\r
-\r
- ErrorAdjY = ((((unsigned long)newy) << 16) /\r
- (((unsigned long)oldy)));\r
-\r
- i=oldy;\r
- while (i--) {\r
- ErrorAccX = 0x8000;\r
- src_ptr = src_base;\r
-\r
- j=oldx;\r
- while (j--) {\r
- ErrorAccX += ErrorAdjX;\r
- if (count = (ErrorAccX >> 16)) {\r
- ErrorAccX &= 0xFFFFL;\r
- while (count--) {\r
- *dest_ptr++ = *src_ptr;\r
- }\r
- }\r
- src_ptr++;\r
- }\r
-\r
- ErrorAccY += ErrorAdjY;\r
- count = (ErrorAccY >> 16) - 1;\r
- while (count--) {\r
- memcpy(dest_ptr, dest_ptr - newx, newx);\r
- dest_ptr += newx;\r
- }\r
- ErrorAccY &= 0xFFFFL;\r
- src_base += oldx;\r
- }\r
- } else {\r
- // Smallering\r
- ErrorAdjX = ((((unsigned long)oldx) << 16) /\r
- (((unsigned long)newx)));\r
-\r
- ErrorAdjY = ((((unsigned long)oldy) << 16) /\r
- (((unsigned long)newy)));\r
-\r
- i=newy;\r
- while (i--) {\r
- ErrorAccX = 0x8000;\r
- src_ptr = src_base;\r
-\r
- j=newx;\r
- while (j--) {\r
- *dest_ptr++ = *src_ptr;\r
- ErrorAccX += ErrorAdjX;\r
- src_ptr += (ErrorAccX >> 16);\r
- ErrorAccX &= 0xFFFFL;\r
- }\r
-\r
- ErrorAccY += ErrorAdjY;\r
- src_base += (oldx * (ErrorAccY >> 16));\r
- ErrorAccY &= 0xFFFFL;\r
- }\r
- }\r
-\r
- if (buf2 == NULL) {\r
- delete buf1->image;\r
- buf1->xsize = newx;\r
- buf1->ysize = newy;\r
- buf1->image = newbuf;\r
- } else {\r
- if (buf2->image != NULL) {\r
- delete buf2->image;\r
- }\r
- buf2->xsize = newx;\r
- buf2->ysize = newy;\r
- buf2->image = newbuf;\r
- }\r
-}\r
-\r
-\r
-void\r
-vertical_scale_blitbuf(DIST dest_y, blitbuf *buf1, blitbuf *buf2)\r
-{\r
- unsigned long ErrorAccY, ErrorAdjY;\r
- DIST xsize, oldy, newy;\r
- short int i, count;\r
- BYTE *src_ptr;\r
- BYTE *dest_ptr;\r
- BYTE *newbuf;\r
-\r
- xsize = buf1->xsize;\r
- oldy = buf1->ysize;\r
- newy = dest_y;\r
-\r
- newbuf = new BYTE[xsize * newy];\r
-\r
- src_ptr = buf1->image;\r
- dest_ptr = newbuf;\r
-\r
- // My bitmap scaling routine. As you probably noticed, it's\r
- // pretty Bresenhammy!\r
-\r
- ErrorAccY = 0x8000;\r
- ErrorAdjY = ((((unsigned long)newy) << 16) /\r
- (((unsigned long)oldy)));\r
-\r
- if (newy >= oldy) {\r
- // Biggering\r
- i=oldy;\r
- while (i--) {\r
- ErrorAccY += ErrorAdjY;\r
- if (count = (ErrorAccY >> 16)) {\r
- ErrorAccY &= 0xFFFFL;\r
-\r
- while (count--) {\r
- memcpy(dest_ptr, src_ptr, xsize);\r
- dest_ptr += xsize;\r
- }\r
- }\r
-\r
- src_ptr += xsize;\r
- }\r
- } else {\r
- // Smallering\r
- i=oldy;\r
- while (i--) {\r
- ErrorAccY += ErrorAdjY;\r
- if (ErrorAccY & ~0xFFFFL) {\r
- ErrorAccY &= 0xFFFFL;\r
- memcpy(dest_ptr, src_ptr, xsize);\r
- dest_ptr += xsize;\r
- }\r
-\r
- src_ptr += xsize;\r
- }\r
- }\r
-\r
- if (buf2 == NULL) {\r
- delete buf1->image;\r
- buf1->ysize = newy;\r
- buf1->image = newbuf;\r
- } else {\r
- if (buf2->image != NULL) {\r
- delete buf2->image;\r
- }\r
- buf2->xsize = xsize;\r
- buf2->ysize = newy;\r
- buf2->image = newbuf;\r
- }\r
-}\r
-\r
-\r
-void\r
-greyscale_blitbuf(blitbuf *buf)\r
-{\r
- BYTE temp_pal[768];\r
- BYTE *buf_ptr;\r
- BYTE *temp;\r
- BYTE r, g;\r
- unsigned int i;\r
-\r
- buf_ptr = buf->image;\r
-\r
- get_paletteX(temp_pal, 0);\r
-\r
- for (i = (buf->xsize * buf->ysize); i; i--) {\r
- temp = temp_pal + ((*buf_ptr) * 3);\r
- r = *temp++;\r
- g = *temp++;\r
-\r
- *buf_ptr++ = ((r * 19) + (g * 37) + (*temp << 3)) >> 6;\r
- }\r
-}\r
-\r
-\r
-void\r
-RGB_blitbuf(blitbuf *buf)\r
-{\r
- BYTE temp_pal[768];\r
- BYTE *buf_ptr;\r
- BYTE *temp;\r
- BYTE r, g, b;\r
- unsigned int i;\r
-\r
- buf_ptr = buf->image;\r
-\r
- get_paletteX(temp_pal, 0);\r
-\r
- for (i = (buf->xsize * buf->ysize); i; i--) {\r
- temp = temp_pal + ((*buf_ptr) * 3);\r
- r = (*temp) + 4;\r
- temp++;\r
- g = (*temp) + 4;\r
- temp++;\r
- b = (*temp) + 8;\r
-\r
- *buf_ptr++ = ((r >> 3) << 5) + ((g >> 3) << 2) + (b >> 4);\r
- }\r
-}\r
-\r
-\r
-void\r
-flip_vertical_blitbuf(blitbuf *buf)\r
-{\r
- BYTE *top;\r
- BYTE *bottom;\r
- BYTE *temp;\r
- DIST i, x, y;;\r
-\r
- x = buf->xsize;\r
- y = buf->ysize;\r
-\r
- temp = new BYTE[x];\r
-\r
- top = buf->image;\r
- bottom = buf->image + (x * (y-1));\r
-\r
- i = (y >> 1);\r
- while (i--) {\r
- memcpy(temp, top, x);\r
- memcpy(top, bottom, x);\r
- memcpy(bottom, temp, x);\r
- top += x;\r
- bottom -= x;\r
- }\r
-\r
- delete temp;\r
-}\r
-\r
-\r
-void\r
-flip_horizontal_blitbuf(blitbuf *buf)\r
-{\r
- BYTE *buf_ptr;\r
- BYTE *temp_ptr;\r
- BYTE *temp;\r
- DIST i, j, x;\r
-\r
- x = buf->xsize;\r
-\r
- temp = new BYTE[x];\r
-\r
- buf_ptr = buf->image;\r
-\r
- i = buf->ysize;\r
- while (i--) {\r
- memcpy(temp, buf_ptr, x);\r
- temp_ptr = temp + (x - 1);\r
- j=x;\r
- while (j--) {\r
- *buf_ptr++ = *temp_ptr--;\r
- }\r
- }\r
-\r
- delete temp;\r
-}\r
-\r
-\r
-void\r
-brighten_blitbuf(SBYTE factor, blitbuf *buf)\r
-{\r
- BYTE *buf_ptr;\r
- short int scratch;\r
- unsigned int i;\r
-\r
- buf_ptr = buf->image;\r
-\r
- for (i = (buf->xsize * buf->ysize); i; i--) {\r
- scratch = (*buf_ptr + factor);\r
- if (scratch <= 0) {\r
- *buf_ptr++ = 0;\r
- } else if (scratch >= 63) {\r
- *buf_ptr++ = 63;\r
- } else {\r
- *buf_ptr++ = scratch;\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-stretch_blitbuf(BYTE factor, blitbuf *buf)\r
-{\r
- BYTE *buf_ptr;\r
- short int scratch;\r
- unsigned int i;\r
-\r
- buf_ptr = buf->image;\r
-\r
- for (i = (buf->xsize * buf->ysize); i; i--) {\r
- scratch = ((((*buf_ptr - 32) * factor) + 8) >> 4) + 32;\r
- if (scratch <= 0) {\r
- *buf_ptr++ = 0;\r
- } else if (scratch >= 63) {\r
- *buf_ptr++ = 63;\r
- } else {\r
- *buf_ptr++ = scratch;\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-pixelize(DIST pixfactor, blitbuf *buf)\r
-{\r
- // Do nothing\r
-}\r
-\r
-\r
-void\r
-GREYconvolve_blitbuf(BYTE *kernel, blitbuf *buf)\r
-{\r
- // Do nothing\r
-}\r
-\r
-\r
-void\r
-RGBconvolve_blitbuf(BYTE *kernel, blitbuf *buf)\r
-{\r
- // Do nothing\r
-}\r
-\r
-\r
-void\r
-scale_scanline(BYTE *source, BYTE *dest, DIST smap_size, DIST dmap_size,\r
- DIST dline_size)\r
-{\r
- unsigned long ErrorAcc, ErrorAdj;\r
- short int i, temp, invert;\r
-\r
- ErrorAcc = 0x8000;\r
-\r
- // Prepare for backwards scanlines\r
- if (dline_size >= 0) {\r
- invert = 0;\r
- } else {\r
- invert = 1;\r
- dline_size = -dline_size;\r
- }\r
-\r
- if (dline_size > smap_size) {\r
- // Biggering\r
- if (smap_size == 0) {\r
- return;\r
- }\r
- ErrorAdj = ((((unsigned long)dline_size) << 16) /\r
- (((unsigned long)smap_size)));\r
-\r
- i=smap_size;\r
- while (i--) {\r
- ErrorAcc += ErrorAdj;\r
- temp = (ErrorAcc >> 16);\r
- ErrorAcc &= 0xFFFFL;\r
- while (temp--) {\r
- *dest++ = *source;\r
- }\r
- source++;\r
- }\r
- } else {\r
- // Smallering\r
- if (dline_size == 0) {\r
- memset(dest, 0, dmap_size);\r
- } else {\r
- temp = dmap_size - dline_size;\r
- i = temp >> 1;\r
- temp -= i;\r
- while (i--) {\r
- *dest++ = 0;\r
- }\r
-\r
- ErrorAdj = ((((unsigned long)smap_size) << 16) /\r
- (((unsigned long)dline_size)));\r
-\r
- i=dline_size;\r
-\r
- while (i--) {\r
- *dest++ = *source;\r
- ErrorAcc += ErrorAdj;\r
- source += (ErrorAcc >> 16);\r
- ErrorAcc &= 0xFFFFL;\r
- }\r
-\r
- while (temp--) {\r
- *dest++ = 0;\r
- }\r
- }\r
- }\r
-}\r
-\r
-\r
-int\r
-load_blitbufRAW(char *rawname, char *palname, blitbuf *buf)\r
-{\r
- FILE *fp;\r
- BYTE VGA_pal[768];\r
-\r
- fp = fopen(rawname, "rb");\r
-\r
- if (fp == NULL) {\r
- buf->xsize = 0;\r
- buf->ysize = 0;\r
- buf->image = NULL;\r
- return 0;\r
- } else {\r
- buf->xsize = 320;\r
- buf->ysize = 200;\r
- buf->image = new BYTE[64000L];\r
-\r
- // Load image\r
- fread(buf->image, 64000L, 1, fp);\r
-\r
- if (palname == NULL) {\r
- fread(VGA_pal, 1, 768, fp);\r
- set_paletteX(VGA_pal);\r
- fclose(fp);\r
- } else {\r
- fclose(fp);\r
- fp = fopen(palname, "rb");\r
- if (fp != NULL) {\r
- fread(VGA_pal, 1, 768, fp);\r
- set_paletteX(VGA_pal);\r
- fclose(fp);\r
- }\r
- }\r
-\r
- return 1;\r
- }\r
-}\r
-\r
+++ /dev/null
-#ifndef X_BLITBUF_HPP\r
- #define X_BLITBUF_HPP\r
-\r
-// Basic BlitBuf functions\r
-void clear_blitbuf(blitbuf *buf);\r
-void fill_blitbuf(BYTE color, blitbuf *buf);\r
-void alloc_blitbuf(blitbuf *buf, DIST xsize, DIST ysize);\r
-void lin_2_pln_blitbuf(blitbuf *buf);\r
-void pln_2_lin_blitbuf(blitbuf *buf);\r
-\r
-// Adjust color in blitbuf\r
-void greyscale_blitbuf(blitbuf *buf);\r
-void RGB_blitbuf(blitbuf *buf);\r
-void brighten_blitbuf(SBYTE factor, blitbuf *buf);\r
-void stretch_blitbuf(BYTE factor, blitbuf *buf); // factor = 1/16 units\r
-\r
-// Image processing: These expect a linear blitbuf\r
-void scale_blitbuf(DIST dest_x, DIST dest_y,\r
- blitbuf *buf1, blitbuf *buf2 = NULL);\r
-void vertical_scale_blitbuf(DIST dest_y, blitbuf *buf1, blitbuf *buf2 = NULL);\r
-void flip_vertical_blitbuf(blitbuf *buf);\r
-void flip_horizontal_blitbuf(blitbuf *buf);\r
-void pixelize(DIST pixfactor, blitbuf *buf); // Not written yet\r
-void scale_scanline(BYTE *source, BYTE *dest, DIST smap_size,\r
- DIST dmap_size, DIST dline_size);\r
-\r
-// Image Convolution by a 3x3 kernel (linear)\r
-void GREYconvolve_blitbuf(BYTE *kernel, blitbuf *buf); // Not written yet\r
-void RGBconvolve_blitbuf(BYTE *kernel, blitbuf *buf); // Not written yet\r
-\r
-// Vanilla blits can be any size, anywhere\r
-void vanilla_bitblitX(COORD x, COORD y, blitbuf *buf);\r
-void vanilla_getblitX(COORD x, COORD y, blitbuf *buf);\r
-\r
-// Transparent blits must be aligned and 0 is the "transparent" value\r
-void transparent_bitblitX(COORD x, COORD y, blitbuf *buf);\r
-\r
-// Aligned blits must have X and XSIZE evenly divisible by 4\r
-void aligned_bitblitX(COORD x, COORD y, blitbuf *buf);\r
-void aligned_getblitX(COORD x, COORD y, blitbuf *buf);\r
-\r
-// Planar blits must be aligned and also be ordered in 4-planar fashion\r
-void planar_bitblitX(COORD x, COORD y, blitbuf *buf);\r
-void planar_getblitX(COORD x, COORD y, blitbuf *buf);\r
-\r
-// Wide blits must be planar and are assumed to be as wide as the screen\r
-void wide_bitblitX(COORD y, blitbuf *buf);\r
-void wide_getblitX(COORD y, blitbuf *buf);\r
-\r
-// PCX functions\r
-void save_blitbufPCX(char *fname, blitbuf *buf);\r
-int load_blitbufPCX(char *fname, blitbuf *buf);\r
-\r
-// RAW file functions (320x200 only)\r
-int load_blitbufRAW(char *rawname, char *palname, blitbuf *buf);\r
-\r
-#endif\r
-\r
+++ /dev/null
-#include <conio.h>\r
-#include <dos.h>\r
-#include <mem.h>\r
-\r
-#include "modex.hpp"\r
-#include "xpal.hpp"\r
-\r
-BYTE Xpal[768];\r
-\r
-void\r
-set_paletteX(BYTE *pal, FLAG downgrade)\r
-{\r
- short int i;\r
- BYTE *buf;\r
-\r
- memcpy(Xpal, pal, 768);\r
-\r
- buf = Xpal;\r
- if (downgrade) {\r
- i=768;\r
- while (i--) {\r
- *buf++ = (*buf >> 2);\r
- }\r
- }\r
-\r
- outp(0x03c8, 0); // Start with color 0\r
- buf = Xpal;\r
- i=256;\r
- while (i--) {\r
- outp(0x03c9, *buf++);\r
- outp(0x03c9, *buf++);\r
- outp(0x03c9, *buf++);\r
- }\r
-}\r
-\r
-\r
-void\r
-get_paletteX(BYTE *pal, FLAG upgrade)\r
-{\r
- int i;\r
-\r
- memcpy(pal, Xpal, 768);\r
-\r
- if (upgrade) {\r
- i=768;\r
- while (i--) {\r
- *pal++ = (*pal << 2);\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-get_BIOSpaletteX(BYTE *pal, FLAG upgrade)\r
-{\r
- int i;\r
- union REGS r;\r
-\r
- r.x.eax = 0x1017;\r
- r.x.ebx = 0;\r
- r.x.ecx = 256;\r
- r.x.edx = (unsigned long) pal;\r
-\r
- int386(0x10, &r, &r);\r
-\r
- if (upgrade) {\r
- i=768;\r
- while (i--) {\r
- *pal++ = (*pal << 2);\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-photo_negativeX(void)\r
-{\r
- short int i;\r
- BYTE temp_pal[768];\r
- BYTE *temp;\r
-\r
- get_paletteX(temp_pal, 0);\r
- temp = temp_pal;\r
-\r
- for (i=0; i < 256; i++) {\r
- *temp++ = (64 - (*temp));\r
- *temp++ = (64 - (*temp));\r
- *temp++ = (64 - (*temp));\r
- }\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-void\r
-grey_paletteX(void)\r
-{\r
- smooth64_paletteX(1, 1, 1);\r
-}\r
-\r
-\r
-void\r
-RGB_paletteX(void)\r
-{\r
- BYTE r, g, b;\r
- BYTE temp_pal[768];\r
- BYTE *temp;\r
-\r
- temp = temp_pal;\r
-\r
- for (r=0; r < 8; r++) {\r
- for (g=0; g < 8; g++) {\r
- for (b=0; b < 4; b++) {\r
- *temp++ = (r << 3);\r
- *temp++ = (g << 3);\r
- *temp++ = (b << 4);\r
- }\r
- }\r
- }\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-void\r
-smooth64_paletteX(BYTE r, BYTE g, BYTE b)\r
-{\r
- short int i;\r
- BYTE temp_pal[768];\r
- BYTE *temp;\r
-\r
- memset(temp_pal, 0, 768);\r
-\r
-\r
- if (r) {\r
- temp = temp_pal;\r
- for (i=0; i < 64; i++) {\r
- *temp = i;\r
- temp += 3;\r
- }\r
- }\r
-\r
- if (g) {\r
- temp = temp_pal + 1;\r
- for (i=0; i < 64; i++) {\r
- *temp = i;\r
- temp += 3;\r
- }\r
- }\r
-\r
- if (b) {\r
- temp = temp_pal + 2;\r
- for (i=0; i < 64; i++) {\r
- *temp = i;\r
- temp += 3;\r
- }\r
- }\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-void\r
-brighten_paletteX(SBYTE r, SBYTE g, SBYTE b)\r
-{\r
- short int i, j, scratch;\r
- BYTE temp_pal[768];\r
- BYTE *temp;\r
- SBYTE dummy[3];\r
-\r
- get_paletteX(temp_pal, 0);\r
- temp = temp_pal;\r
-\r
- dummy[0] = r;\r
- dummy[1] = g;\r
- dummy[2] = b;\r
-\r
- for (i=0; i < 256; i++) {\r
- for (j=0; j < 3; j++) {\r
- scratch = *temp + dummy[j];\r
- if (scratch <= 0) {\r
- *temp++ = 0;\r
- } else if (scratch >= 63) {\r
- *temp++ = 63;\r
- } else {\r
- *temp++ = scratch;\r
- }\r
- }\r
- }\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-void\r
-stretch_paletteX(BYTE r, BYTE g, BYTE b)\r
-{\r
- short int i, j, scratch;\r
- BYTE temp_pal[768];\r
- BYTE *temp;\r
- BYTE dummy[3];\r
-\r
- get_paletteX(temp_pal, 0);\r
- temp = temp_pal;\r
-\r
- dummy[0] = r;\r
- dummy[1] = g;\r
- dummy[2] = b;\r
-\r
- for (i=0; i < 256; i++) {\r
- for (j=0; j < 3; j++) {\r
- scratch = ((((*temp - 32) * dummy[j]) + 8) >> 4) + 32;\r
- if (scratch <= 0) {\r
- *temp++ = 0;\r
- } else if (scratch >= 63) {\r
- *temp++ = 63;\r
- } else {\r
- *temp++ = scratch;\r
- }\r
- }\r
- }\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-void\r
-rot_palette(BYTE dist)\r
-{\r
- int shift, i;\r
- BYTE temp_pal[768];\r
-\r
- shift = (dist * 3);\r
- memcpy(temp_pal, Xpal + shift, 768 - shift);\r
- memcpy(temp_pal + (768 - shift), Xpal, shift);\r
-\r
- set_paletteX(temp_pal, 0);\r
-}\r
-\r
-\r
-BYTE\r
-find_RGB(BYTE r, BYTE g, BYTE b)\r
-{\r
- long shortest_dist, temp_dist;\r
- short int i, shortest_pal;\r
-\r
- shortest_pal = 0;\r
- shortest_dist = (r - Xpal[0]) * (r - Xpal[0]) +\r
- (g - Xpal[1]) * (g - Xpal[1]) +\r
- (b - Xpal[2]) * (b - Xpal[2]);\r
-\r
- for (i=1; i < 256; i++) {\r
- temp_dist = (r - Xpal[(i * 3) + 0]) * (r - Xpal[(i * 3) + 0]) +\r
- (g - Xpal[(i * 3) + 1]) * (g - Xpal[(i * 3) + 1]) +\r
- (b - Xpal[(i * 3) + 2]) * (b - Xpal[(i * 3) + 2]);\r
-\r
- if (temp_dist < shortest_dist) {\r
- shortest_dist = temp_dist;\r
- shortest_pal = i;\r
- }\r
- }\r
-\r
- return i;\r
-}\r
-\r
+++ /dev/null
-#ifndef X_PALETTE_HPP\r
- #define X_PALETTE_HPP\r
-\r
-#include "xtypes.hpp"\r
-\r
-// Palette setting/getting functions\r
-void set_paletteX(BYTE *pal, FLAG downgrade = 1);\r
-void get_paletteX(BYTE *pal, FLAG upgrade = 1);\r
-void get_BIOSpaletteX(BYTE *pal, FLAG upgrade = 1);\r
-\r
-// Palette adjusting functions\r
-void photo_negativeX(void);\r
-void grey_paletteX(void);\r
-void RGB_paletteX(void);\r
-void smooth64_paletteX(BYTE r, BYTE g, BYTE b);\r
-void brighten_paletteX(SBYTE r, SBYTE g, SBYTE b);\r
-void stretch_paletteX(BYTE r, BYTE g, BYTE b); // 1/16 units\r
-\r
-// Misc palette functions\r
-void rot_palette(BYTE distance);\r
-BYTE find_RGB(BYTE r, BYTE g, BYTE b);\r
-\r
-#endif\r
-\r
+++ /dev/null
-#include <conio.h>\r
-#include <dos.h>\r
-#include <mem.h>\r
-#include <stdio.h>\r
-\r
-#include "modex.hpp"\r
-#include "xprim.hpp"\r
-\r
-#define SEQU_ADDR 0x3C4\r
-#define GRACON_ADDR 0x3CE\r
-#define CRTC_ADDR 0x3D4\r
-#define STATUS_ADDR 0x3DA\r
-\r
-BYTE Xfont[2048];\r
-\r
-\r
-void\r
-wait_for_retrace(void)\r
-{\r
- while (!(inp(STATUS_ADDR) & 0x08));\r
-}\r
-\r
-\r
-void\r
-setDrawPage(unsigned int page)\r
-{\r
- activeStart = page_offset[page];\r
-}\r
-\r
-\r
-void\r
-setVisiblePage(unsigned int page)\r
-{\r
- // setVisibleStart() tells the VGA from which byte to fetch the first\r
- // pixel when starting refresh at the top of the screen.\r
- visibleStart = page_offset[page];\r
-\r
- // set high byte\r
- outpw(CRTC_ADDR, page_mask_high[page]);\r
-\r
- // set low byte\r
- outpw(CRTC_ADDR, page_mask_low[page]);\r
-}\r
-\r
-\r
-void\r
-clearX(BYTE color)\r
-{\r
- outpw(SEQU_ADDR, 0x0F02);\r
- memset((unsigned char *)(0xA000 << 4) + activeStart, color, 0x00010000);\r
-}\r
-\r
-\r
-void\r
-putpixelX(COORD x, COORD y, BYTE color)\r
-{\r
- BYTE temp;\r
-\r
- if (write_plane != (temp = (x & 3))) {\r
- write_plane = temp;\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- }\r
-\r
- *(RowsX[y] + (x >> 2) + activeStart) = color;\r
-}\r
-\r
-\r
-BYTE\r
-getpixelX(COORD x, COORD y)\r
-{\r
- BYTE temp;\r
-\r
- if (read_plane != (temp = (x & 3))) {\r
- read_plane = temp;\r
- outpw(GRACON_ADDR, read_mask[temp]);\r
- }\r
-\r
- return (*(RowsX[y] + (x >> 2) + activeStart));\r
-}\r
-\r
-\r
-void\r
-internal_vert_lineX(COORD x, COORD top_y, int len, BYTE color)\r
-{\r
- BYTE *ptr;\r
- BYTE temp;\r
-\r
- if (write_plane != (temp = (x & 3))) {\r
- write_plane = temp;\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- }\r
-\r
- ptr = RowsX[top_y] + (x >> 2) + activeStart;\r
-\r
- while (len--) {\r
- *ptr = color;\r
- ptr += widthBytes;\r
- }\r
-}\r
-\r
-\r
-void\r
-internal_horiz_lineX(COORD left_x, COORD y, int len, BYTE color)\r
-{\r
- BYTE *ptr;\r
- BYTE temp;\r
-\r
- ptr = RowsX[y] + (left_x >> 2) + activeStart;\r
-\r
- // Set current plane to invalid value\r
- write_plane = -1;\r
-\r
- if (temp = (left_x & 3)) {\r
- outp(SEQU_ADDR, 0x02);\r
- outp(0x3C5, line_head[temp]);\r
- *ptr++ = color;\r
- len -= (4 - temp);\r
- }\r
-\r
- if (temp = (len >> 2)) {\r
- outpw(SEQU_ADDR, 0x0F02);\r
-\r
- len &= 3;\r
-\r
- memset(ptr, color, temp);\r
- ptr += temp;\r
- }\r
-\r
- if (len) {\r
- outp(SEQU_ADDR, 0x02);\r
- outp(0x3C5, line_tail[len]);\r
- *ptr = color;\r
- }\r
-}\r
-\r
-\r
-void\r
-boxX(COORD x1, COORD y1, COORD x2, COORD y2, BYTE color)\r
-{\r
- int xsize, ysize;\r
-\r
- xsize = (x2 - x1) + 1;\r
- internal_horiz_lineX(x1, y1, xsize, color);\r
- internal_horiz_lineX(x1, y2, xsize, color);\r
-\r
- y1++;\r
- ysize = (y2 - y1);\r
-\r
- internal_vert_lineX(x1, y1, ysize, color);\r
- internal_vert_lineX(x2, y1, ysize, color);\r
-}\r
-\r
-\r
-void\r
-filledboxX(COORD x1, COORD y1, COORD x2, COORD y2, BYTE color)\r
-{\r
- BYTE *base_ptr;\r
- BYTE *ptr;\r
- BYTE temp;\r
- short int i, xsize, ysize;\r
-\r
- // Set current plane to invalid value\r
- write_plane = -1;\r
-\r
- xsize = (x2 - x1) + 1;\r
- ysize = (y2 - y1) + 1;\r
-\r
- if (ysize == 1) {\r
- internal_horiz_lineX(x1, y1, xsize, color);\r
- return;\r
- }\r
-\r
- base_ptr = RowsX[y1] + (x1 >> 2) + activeStart;\r
-\r
- if (temp = (x1 & 3)) {\r
- outp(SEQU_ADDR, 0x02);\r
- outp(0x3C5, line_head[temp]);\r
- ptr = base_ptr;\r
- i=ysize;\r
- while (i--) {\r
- *ptr = color;\r
- ptr += widthBytes;\r
- }\r
- xsize -= (4 - temp);\r
- base_ptr++;\r
- }\r
-\r
- if (temp = (xsize >> 2)) {\r
- outpw(SEQU_ADDR, 0x0F02);\r
-\r
- xsize &= 3;\r
- ptr = base_ptr;\r
- i=ysize;\r
- while (i--) {\r
- memset(ptr, color, temp);\r
- ptr += widthBytes;\r
- }\r
- base_ptr += temp;\r
- }\r
-\r
- if (xsize) {\r
- outp(SEQU_ADDR, 0x02);\r
- outp(0x3C5, line_tail[xsize]);\r
- while (ysize--) {\r
- *base_ptr = color;\r
- base_ptr += widthBytes;\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-circleX(COORD x, COORD y, DIST r, BYTE color)\r
-{\r
- int ix, iy, d, deltaE, deltaSE;\r
-\r
- ix = 0;\r
- iy = r;\r
- d = 1 - r;\r
- deltaE = 3;\r
- deltaSE = (-2 * r) + 5;\r
-\r
- putpixelX(x + ix, y + iy, color);\r
- putpixelX(x + ix, y - iy, color);\r
- putpixelX(x + iy, y + ix, color);\r
- putpixelX(x + iy, y - ix, color);\r
- putpixelX(x - ix, y + iy, color);\r
- putpixelX(x - ix, y - iy, color);\r
- putpixelX(x - iy, y + ix, color);\r
- putpixelX(x - iy, y - ix, color);\r
-\r
- while (iy > ix++) {\r
- if (d < 0) {\r
- d += deltaE;\r
- deltaE += 2;\r
- deltaSE += 2;\r
- } else {\r
- d += deltaSE;\r
- deltaE += 2;\r
- deltaSE += 4;\r
- iy--;\r
- }\r
-\r
- putpixelX(x + ix, y + iy, color);\r
- putpixelX(x + ix, y - iy, color);\r
- putpixelX(x + iy, y + ix, color);\r
- putpixelX(x + iy, y - ix, color);\r
- putpixelX(x - ix, y + iy, color);\r
- putpixelX(x - ix, y - iy, color);\r
- putpixelX(x - iy, y + ix, color);\r
- putpixelX(x - iy, y - ix, color);\r
- }\r
-}\r
-\r
-\r
-void\r
-filledcircleX(COORD x, COORD y, DIST r, BYTE color)\r
-{\r
- int ix, iy, d, deltaE, deltaSE;\r
-\r
- ix = 0;\r
- iy = r;\r
- d = 1 - r;\r
- deltaE = 3;\r
- deltaSE = (-2 * r) + 5;\r
-\r
- internal_horiz_lineX(x - ix, y + iy, (ix << 1) + 1, color);\r
- internal_horiz_lineX(x - ix, y - iy, (ix << 1) + 1, color);\r
- internal_horiz_lineX(x - iy, y + ix, (iy << 1) + 1, color);\r
- internal_horiz_lineX(x - iy, y - ix, (iy << 1) + 1, color);\r
-\r
- while (iy > ix++) {\r
- if (d < 0) {\r
- d += deltaE;\r
- deltaE += 2;\r
- deltaSE += 2;\r
- } else {\r
- d += deltaSE;\r
- deltaE += 2;\r
- deltaSE += 4;\r
- iy--;\r
- }\r
-\r
- internal_horiz_lineX(x - ix, y + iy, (ix << 1) + 1, color);\r
- internal_horiz_lineX(x - ix, y - iy, (ix << 1) + 1, color);\r
- internal_horiz_lineX(x - iy, y + ix, (iy << 1) + 1, color);\r
- internal_horiz_lineX(x - iy, y - ix, (iy << 1) + 1, color);\r
- }\r
-}\r
-\r
-\r
-void\r
-internal_xmajor(BYTE *vga_ptr, short int len, short int yskip,\r
- unsigned long ErrorAcc, unsigned long ErrorAdj, BYTE color)\r
-{\r
- if (len) {\r
- len--;\r
- while (len--) {\r
- *vga_ptr++ = color;\r
- ErrorAcc += ErrorAdj;\r
-\r
- if (ErrorAcc & ~0xFFFFL) {\r
- ErrorAcc &= 0xFFFFL;\r
- vga_ptr += yskip;\r
- }\r
- }\r
- *vga_ptr = color;\r
- }\r
-}\r
-\r
-\r
-void\r
-internal_middle(BYTE *vga_ptr, short int len, short int yskip,\r
- unsigned long ErrorAcc, unsigned long ErrorAdj, BYTE color)\r
-{\r
- if (len) {\r
- len--;\r
- while (len--) {\r
- *vga_ptr++ = color;\r
- ErrorAcc += ErrorAdj;\r
- vga_ptr += (yskip * (ErrorAcc >> 16));\r
- ErrorAcc &= 0xFFFFL;\r
- }\r
- *vga_ptr = color;\r
- }\r
-}\r
-\r
-\r
-void\r
-internal_ymajor(BYTE *vga_ptr, short int len, short int yskip,\r
- unsigned long ErrorAcc, unsigned long ErrorAdj, BYTE color)\r
-{\r
- unsigned long TinyAdj;\r
- short int i;\r
-\r
- if (len) {\r
- TinyAdj = (ErrorAdj >> 2);\r
- ErrorAdj -= TinyAdj;\r
-\r
- len--;\r
- while (len--) {\r
- ErrorAcc += TinyAdj;\r
- i = (ErrorAcc >> 16);\r
- ErrorAcc &= 0xFFFFL;\r
-\r
- while (i--) {\r
- *vga_ptr = color;\r
- vga_ptr += yskip;\r
- }\r
-\r
- ErrorAcc += ErrorAdj;\r
- vga_ptr += (yskip * (ErrorAcc >> 16)) + 1;\r
- ErrorAcc &= 0xFFFFL;\r
- }\r
- ErrorAcc += TinyAdj;\r
- i = (ErrorAcc >> 16);\r
- while (i--) {\r
- *vga_ptr = color;\r
- vga_ptr += yskip;\r
- }\r
- }\r
-}\r
-\r
-\r
-void\r
-lineX(COORD x1, COORD y1, COORD x2, COORD y2, BYTE color)\r
-{\r
- unsigned long ErrorAcc, ErrorAdj, TinyAdj;\r
- short int i, DeltaX, DeltaY, yskip;\r
- short int len[4];\r
- BYTE *vga_ptr;\r
- COORD temp;\r
-\r
- // Mode X 4-way folded Bresenham line function - by David Boeren\r
-\r
- // Set invalid plane, because we're screwing with the plane mask\r
- write_plane = -1;\r
-\r
- // Make sure the line runs left to right\r
- if (x1 > x2) {\r
- temp = x1; x1 = x2; x2 = temp;\r
- temp = y1; y1 = y2; y2 = temp;\r
- }\r
-\r
- DeltaX = (x2 - x1);\r
- DeltaY = (y2 - y1);\r
-\r
- if (DeltaY >= 0) {\r
- yskip = widthBytes;\r
- } else {\r
- DeltaY = -DeltaY; // Make DeltaY positive\r
- yskip = -widthBytes;\r
- }\r
-\r
- if (DeltaX == 0) {\r
- // Vertical Line (and one pixel lines)\r
- if (yskip > 0) {\r
- internal_vert_lineX(x1, y1, (DeltaY + 1), color);\r
- } else {\r
- internal_vert_lineX(x1, y2, (DeltaY + 1), color);\r
- }\r
- return;\r
- }\r
-\r
- if (DeltaY == 0) {\r
- // Horizontal Line\r
- internal_horiz_lineX(x1, y1, (DeltaX + 1), color);\r
- return;\r
- }\r
-\r
- vga_ptr = RowsX[y1] + (x1 >> 2) + activeStart;\r
- ErrorAcc = 0x8000;\r
-\r
- // Length of sub-line in each plane\r
- temp = (x1 & 3);\r
- i = DeltaX + temp;\r
- len[0] = ((i--) >> 2);\r
- len[1] = ((i--) >> 2);\r
- len[2] = ((i--) >> 2);\r
- len[3] = (i >> 2) + 1;\r
-\r
- for (i=temp; i < 3; i++) {\r
- len[i]++;\r
- }\r
-\r
- if ((DeltaX >> 2) >= DeltaY) {\r
- // X-Major line (0.00 < slope <= 0.25)\r
- ErrorAdj = ((((unsigned long)DeltaY << 18) / (unsigned long)DeltaX));\r
- TinyAdj = (ErrorAdj >> 2);\r
- while (i--) {\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_xmajor(vga_ptr, len[temp++], yskip, ErrorAcc, ErrorAdj, color);\r
- if (temp == 4) {\r
- temp = 0;\r
- vga_ptr++;\r
- }\r
- ErrorAcc += TinyAdj;\r
- if (ErrorAcc & ~0xFFFFL) {\r
- ErrorAcc &= 0xFFFFL;\r
- vga_ptr += yskip;\r
- }\r
- }\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_xmajor(vga_ptr, len[temp], yskip, ErrorAcc, ErrorAdj, color);\r
- } else if (DeltaX >= DeltaY) {\r
- // Middle line (0.25 < slope <= 1.00)\r
- ErrorAdj = ((((unsigned long)DeltaY << 18) / (unsigned long)DeltaX));\r
- TinyAdj = (ErrorAdj >> 2);\r
- while (i--) {\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_middle(vga_ptr, len[temp++], yskip, ErrorAcc, ErrorAdj, color);\r
- if (temp == 4) {\r
- temp = 0;\r
- vga_ptr++;\r
- }\r
- ErrorAcc += TinyAdj;\r
- if (ErrorAcc & ~0xFFFFL) {\r
- vga_ptr += yskip;\r
- ErrorAcc &= 0xFFFFL;\r
- }\r
- }\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_middle(vga_ptr, len[temp], yskip, ErrorAcc, ErrorAdj, color);\r
- } else {\r
- // Y-Major line (slope > 1)\r
- ErrorAdj = ((((unsigned long)(DeltaY+1) << 18) /\r
- (unsigned long)(DeltaX+1)));\r
- TinyAdj = (ErrorAdj >> 2);\r
- while (i--) {\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_ymajor(vga_ptr, len[temp++], yskip, ErrorAcc, ErrorAdj, color);\r
- if (temp == 4) {\r
- temp = 0;\r
- vga_ptr++;\r
- }\r
- ErrorAcc += TinyAdj;\r
- vga_ptr += (yskip * (ErrorAcc >> 16));\r
- ErrorAcc &= 0xFFFFL;\r
- }\r
- outpw(SEQU_ADDR, plane_mask[temp]);\r
- internal_ymajor(vga_ptr, len[temp], yskip, ErrorAcc, ErrorAdj, color);\r
- }\r
-}\r
-\r
-\r
-int\r
-loadfontX(char *fname)\r
-{\r
- FILE *fp;\r
-\r
- fp = fopen(fname, "rb");\r
-\r
- if (fp == NULL) {\r
- return 0;\r
- } else {\r
- fread(Xfont, 8, 256, fp);\r
- fclose(fp);\r
- return 1;\r
- }\r
-}\r
-\r
-\r
-void\r
-putchX(COORD x, COORD y, char c, BYTE color)\r
-{\r
- int i;\r
- BYTE *vga_ptr;\r
- BYTE *font_ptr;\r
- BYTE temp;\r
-\r
- // 8x8 font\r
- vga_ptr = RowsX[y << 3] + (x << 1) + activeStart;\r
- write_plane = -1;\r
-\r
- font_ptr = Xfont + (c << 3);\r
-\r
- i=8;\r
- while (i--) {\r
- temp = *font_ptr++;\r
- outpw(SEQU_ADDR, text_mask[temp & 0x0F]);\r
- *vga_ptr++ = color;\r
-\r
- outpw(SEQU_ADDR, text_mask[temp >> 4]);\r
- *vga_ptr-- = color;\r
- vga_ptr += widthBytes;\r
- }\r
-}\r
-\r
-\r
-void\r
-putstringX(COORD x, COORD y, char *str, BYTE color)\r
-{\r
- int i, skip;\r
- BYTE *vga_ptr;\r
- BYTE *font_ptr;\r
- BYTE c, temp;\r
-\r
- // 8x8 font\r
- vga_ptr = RowsX[y << 3] + (x << 1) + activeStart;\r
- write_plane = -1;\r
-\r
- skip = 2 - (widthBytes << 3);\r
-\r
- while (c = *str++) {\r
- font_ptr = Xfont + (c << 3);\r
-\r
- i=8;\r
- while (i--) {\r
- temp = *font_ptr++;\r
- outpw(SEQU_ADDR, text_mask[temp & 0x0F]);\r
- *vga_ptr++ = color;\r
-\r
- outpw(SEQU_ADDR, text_mask[temp >> 4]);\r
- *vga_ptr-- = color;\r
- vga_ptr += widthBytes;\r
- }\r
-\r
- vga_ptr += skip;\r
- }\r
-}\r
-\r
+++ /dev/null
-#ifndef X_PRIMITIVES_HPP\r
- #define X_PRIMITIVES_HPP\r
-\r
-#include "xtypes.hpp"\r
-\r
-// Waits for vertical retrace\r
-void wait_for_retrace(void);\r
-\r
-// Page setting functions\r
-void setDrawPage(unsigned int page);\r
-void setVisiblePage(unsigned int page);\r
-\r
-// Screen clearing functions\r
-void clearX(BYTE color);\r
-\r
-// Drawing functions\r
-void putpixelX(COORD x, COORD y, BYTE color);\r
-BYTE getpixelX(COORD x, COORD y);\r
-void boxX(COORD x1, COORD y1, COORD x2, COORD y2, BYTE color);\r
-void filledboxX(COORD x1, COORD y1, COORD x2, COORD y2, BYTE color);\r
-void circleX(COORD x, COORD y, DIST r, BYTE color);\r
-void filledcircleX(COORD x, COORD y, DIST r, BYTE color);\r
-void lineX(COORD lx1, COORD ly1, COORD lx2, COORD ly2, BYTE color);\r
-\r
-// Text output functions\r
-int loadfontX(char *fname);\r
-void putchX(COORD x, COORD y, char c, BYTE color);\r
-void putstringX(COORD x, COORD y, char *str, BYTE color);\r
-\r
-#endif\r
-\r
+++ /dev/null
-#ifndef XTYPES_HPP\r
- #define XTYPES_HPP\r
-\r
-typedef unsigned char BYTE;\r
-typedef signed char SBYTE;\r
-typedef unsigned char FLAG;\r
-typedef unsigned short COORD;\r
-typedef unsigned short DIST;\r
-\r
-struct blitbuf {\r
- DIST xsize;\r
- DIST ysize;\r
- BYTE *image;\r
-};\r
-\r
-#endif\r
-\r
+++ /dev/null
-c2e.convert_special: 0
-e2c.convert_num: 0
-openfiles: /dos/z/16/doc/project.txt:19:0:0:
-openfiles: /dos/z/16/src/eng_core.cpp:0:4107:1:
-openfiles: /dos/z/16/src/eng_core.h:0:0:0:
-openfiles: /dos/z/16/src/eng_comm.cpp:0:0:0:
-openfiles: /dos/z/16/src/eng_comm.h:0:0:0:
-openfiles: /dos/z/16/src/lib/dos_comm.c:0:0:0:
-openfiles: /dos/z/16/src/lib/dos_comm.h:0:0:0:
-openfiles: /dos/z/16/src/eng_gfx.cpp:0:0:0:
-openfiles: /dos/z/16/src/eng_gfx.h:0:0:0:
-openfiles: /dos/z/16/src/lib/dos_gfx.cpp:0:0:0:
-openfiles: /dos/z/16/src/lib/dos_gfx.h:0:0:0:
-openfiles: /dos/z/16/src/eng_snd.cpp:0:0:0:
-openfiles: /dos/z/16/src/eng_snd.h:0:0:0:
-openfiles: /dos/z/16/src/lib/dos_opl2.cpp:0:0:0:
-openfiles: /dos/z/16/src/lib/opl2.h:0:0:0:
-openfiles: /dos/z/16/src/lib/lib_com.cpp:0:0:0:
-openfiles: /dos/z/16/src/lib/lib_com.h:0:0:0:
-openfiles: /dos/z/16/src/eng_ai.cpp:0:0:0:
-openfiles: /dos/z/16/src/eng_ai.h:0:0:0:
-openfiles: /dos/z/16/src/timer.cpp:0:0:0:
-openfiles: /dos/z/16/src/timer.h:0:0:0:
-openfiles: /dos/z/16/src/engine.h:0:0:0:
-openfiles: /dos/z/16/src/main.cpp:0:0:0:
-openfiles: /dos/z/16/doc/ojoww.cpp:0:0:0:
-openfiles: /dos/z/16/doc/char.txt:0:0:0:
-snr_recursion_level: 0
-convertcolumn_horizontally: 0
-adv_open_matchname: 0
-show_mbhl: 1
-view_line_numbers: 1
-fb_show_backup_f: 0
-htmlbar_thumbnailwidth: 300
-view_left_panel: 0
-default_mime_type: text/plain
-e2c.convert_xml: 1
-c2e.convert_iso: 0
-opendir: file:///dos/z/16/doc
-wrap_text_default: 0
-bookmarks_filename_mode: 1
-snr_casesens: 0
-view_blocks: 1
-name: Project 16
-convertcolumn_separator:
-convertcolumn_fillempty:
-replacelist: NUM_SCANCODES
-replacelist: keer
-replacelist: keep
-replacelist: kee
-replacelist: keyp
-fb_show_hidden_f: 0
-editor_tab_width: 4
-template: /usr/share/bluefish/templates/C_Header_GPL
-show_visible_spacing: 0
-view_statusbar: 1
-display_right_margin: 0
-c2e.IE_apos_workaround: 0
-outputb_scroll_mode: 0
-leftpanel_active_tab: 1
-enable_syntax_scan: 1
-ssearch_regex: 0
-e2c.convert_iso: 0
-ssearch_casesens: 0
-charmap_block: 11
-recent_files: file:///dos/z/16/remake.sh
-recent_files: file:///dos/z/16/16.sh
-recent_files: file:///dos/z/16/16.bat
-recent_files: file:///dos/z/16/remake.bat
-recent_files: file:///dos/z/16/ojowwww.cpp
-recent_files: file:///dos/z/16/doc/project.txt
-recent_files: file:///dos/z/16/src/eng_core.cpp
-recent_files: file:///dos/z/16/src/eng_gfx.cpp
-recent_files: file:///dos/z/16/src/eng_core.h
-recent_files: file:///dos/z/16/src/lib/dos_comm.c
-recent_files: file:///dos/z/16/src/lib/dos_comm.h
-recent_files: file:///dos/z/16/src/eng_comm.h
-recent_files: file:///dos/z/16/src/eng_comm.cpp
-recent_files: file:///dos/z/16/src/eng_gfx.h
-recent_files: file:///dos/z/16/src/lib/lib_com.cpp
-recent_files: file:///dos/z/16/src/eng_snd.h
-recent_files: file:///dos/z/16/src/eng_snd.cpp
-recent_files: file:///dos/z/16/src/lib/dos_gfx.h
-recent_files: file:///dos/z/16/src/lib/opl2.h
-recent_files: file:///dos/z/16/src/lib/dos_gfx.cpp
-recent_files: file:///dos/z/16/src/lib/dos_opl2.cpp
-recent_files: file:///dos/z/16/src/lib/lib_com.h
-recent_files: file:///dos/z/16/src/eng_ai.h
-recent_files: file:///dos/z/16/src/eng_ai.cpp
-recent_files: file:///dos/z/16/src/timer.h
-recent_files: file:///dos/z/16/src/timer.cpp
-recent_files: file:///dos/z/16/src/main.cpp
-recent_files: file:///dos/z/16/src/engine.h
-recent_files: file:///dos/z/16/doc/ojoww.cpp
-recent_files: file:///dos/z/16/doc/char.txt
-snr_replacetype: 0
-savedir: file:///dos/z/16/doc
-spell_check_default: 1
-spell_insert_entities: 0
-last_filefilter:
-htmlbar_notebooktab: 0
-view_blockstack: 1
-snr_escape_chars: 0
-htmlbar_view: 0
-spell_lang: en
-ssearch_dotmatchall: 0
-searchlist: keynum
-searchlist: key
-searchlist: scankey
-searchlist: keep
-searchlist: keer
-searchlist: keyWasPressed
-searchlist: keyIsPressed
-searchlist: scanCode
-searchlist: KeyPressed
-searchlist: kee
-autocomplete: 1
-outputb_show_all_output: 0
-bookmarks_show_mode: 0
-snippets_show_as_menu: 1
-adv_open_recursive: 0
-encoding: UTF-8
-e2c.convert_special: 0
-autoindent: 1
-fb_viewmode: 0
-filegloblist: *.xml
-filegloblist: *.txt
-filegloblist: *.shtml
-filegloblist: *.py
-filegloblist: *.pl
-filegloblist: *.php
-filegloblist: *.js
-filegloblist: *.java
-filegloblist: *.htm
-filegloblist: *.html
-filegloblist: *.h
-filegloblist: *.css
-filegloblist: *.cpp
-filegloblist: *.cgi
-filegloblist: *.c
-fb_focus_follow: 1
-ssearch_unescape: 0
-c2e.convert_symbol: 0
-snr_dotmatchall: 0
-c2e.convert_xml: 1
-editor_indent_wspaces: 0
-view_cline: 0
-snr_type: 0
-snr_scope: 0
-bmarksearchmode: 0
-view_main_toolbar: 1
-e2c.convert_symbol: 0
--- /dev/null
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "bitmap.h"\r
+#include "modex16.h"\r
+\r
+static struct pcxHeader {\r
+ byte id;\r
+ byte version;\r
+ byte encoding;\r
+ byte bpp;\r
+ word xmin;\r
+ word ymin;\r
+ word xmax;\r
+ word ymax;\r
+ word hres;\r
+ word vres;\r
+ byte pal16[48];\r
+ byte res1;\r
+ word bpplane;\r
+ word palType;\r
+ word hScreenSize;\r
+ word vScreenSize;\r
+ byte padding[54];\r
+} head;\r
+\r
+\r
+static void loadPcxStage1(FILE *file, bitmap_t *result) {\r
+ long bufSize;\r
+ int index;\r
+ byte count, val;\r
+ long int pos;\r
+\r
+ /* read the header */\r
+ fread(&head, sizeof(char), sizeof(struct pcxHeader), file);\r
+\r
+ /* get the width and height */\r
+ result->width = head.xmax - head.xmin + 1;\r
+ result->height = head.ymax - head.ymin + 1;\r
+\r
+ /* make sure this is 8bpp */\r
+ if(head.bpp != 8) {\r
+ printf("I only know how to handle 8bpp pcx files!\n");\r
+ fclose(file);\r
+ exit(-2);\r
+ }\r
+}\r
+\r
+\r
+static void loadPcxPalette(FILE *file, bitmap_t *result) {\r
+ byte val;\r
+ int index;\r
+\r
+ /* handle the palette */\r
+ fseek(file, -769, SEEK_END);\r
+ val = fgetc(file);\r
+ result->palette = modexNewPal();\r
+ if(head.version == 5 && val == 12) {\r
+ /* use the vga palette */\r
+ for(index=0; !feof(file) && index < PAL_SIZE; index++) {\r
+ val = fgetc(file);\r
+ result->palette[index] = val >> 2;\r
+ }\r
+ } else {\r
+ /* use the 16 color palette */\r
+ for(index=0; index<48; index++) {\r
+ result->palette[index] = head.pal16[index];\r
+ }\r
+ }\r
+}\r
+\r
+\r
+bitmap_t\r
+bitmapLoadPcx(char *filename) {\r
+ FILE *file;\r
+ bitmap_t result;\r
+ long bufSize;\r
+ int index;\r
+ byte count, val;\r
+\r
+ /* open the PCX file for reading */\r
+ file = fopen(filename, "rb");\r
+ if(!file) {\r
+ printf("Could not open %s for reading.\n", filename);\r
+ exit(-2);\r
+ }\r
+\r
+ /* load the first part of the pcx file */\r
+ loadPcxStage1(file, &result);\r
+\r
+ /* allocate the buffer */\r
+ bufSize = result.width * result.height;\r
+ result.data = malloc(bufSize);\r
+ if(!result.data) {\r
+ printf("Could not allocate memory for bitmap data.");\r
+ fclose(file);\r
+ exit(-1);\r
+ }\r
+\r
+ /* read the buffer in */\r
+ index = 0;\r
+ do {\r
+ /* get the run length and the value */\r
+ count = fgetc(file);\r
+ if(0xC0 == (count & 0xC0)) { /* this is the run count */\r
+ count &= 0x3f;\r
+ val = fgetc(file);\r
+ } else {\r
+ val = count;\r
+ count = 1;\r
+ }\r
+\r
+ /* write the pixel the specified number of times */\r
+ for(; count && index < bufSize; count--,index++) {\r
+ result.data[index] = val;\r
+ }\r
+ } while(index < bufSize);\r
+\r
+ loadPcxPalette(file, &result);\r
+\r
+ fclose(file);\r
+\r
+ return result;\r
+}\r
+\r
+\r
+tileset_t\r
+bitmapLoadPcxTiles(char *filename, word twidth, word theight) {\r
+ tileset_t ts;\r
+ FILE *file;\r
+ bitmap_t result;\r
+ int i;\r
+\r
+ /* open the PCX file for reading */\r
+ file = fopen(filename, "rb");\r
+ if(!file) {\r
+ printf("Could not open %s for reading.\n", filename);\r
+ exit(-2);\r
+ }\r
+\r
+ /* load the first part of the pcx file */\r
+ loadPcxStage1(file, &result);\r
+\r
+ /* get the number of tiles and set up the result structure */\r
+ ts.twidth = twidth;\r
+ ts.theight = theight;\r
+ ts.ntiles = (result.width/twidth) * (result.height/theight);\r
+ ts.palette = result.palette;\r
+\r
+ /* allocate the pixel storage for the tiles */\r
+ ts.data = malloc(sizeof(byte*) * ts.ntiles);\r
+ ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight);\r
+ for(i=1; i < ts.ntiles; i++) {\r
+ ts.data[i] = ts.data[i-1] + twidth * theight;\r
+ }\r
+ \r
+ /* finish off the file */\r
+ loadPcxPalette(file, &result);\r
+\r
+ fclose(file);\r
+\r
+ return ts;\r
+}\r
--- /dev/null
+/*\r
+ * Functions and types for loading and manipulating bitmaps.\r
+ */\r
+#ifndef BITMAP_H\r
+#define BITMAP_H\r
+#include "types.h"\r
+typedef struct {\r
+ byte *data;\r
+ word width;\r
+ word height;\r
+ byte *palette;\r
+} bitmap_t;\r
+\r
+typedef struct {\r
+ byte **data;\r
+ word ntiles; /* the number of tiles */\r
+ word twidth; /* width of the tiles */\r
+ word theight; /* height of the tiles */\r
+ byte *palette; /* palette for the tile set */\r
+} tileset_t;\r
+\r
+bitmap_t bitmapLoadPcx(char *filename);\r
+tileset_t bitmapLoadPcxTiles(char *filename, word twidth, word theight);\r
+#endif\r
+++ /dev/null
-OBJS=main.obj timer.obj eng_ai.obj eng_snd.obj eng_comm.obj &
- eng_core.obj eng_gfx.obj dos_comm.obj dos_gfx.obj &
- dos_opl2.obj lib_com.obj
-
-CC=*wcc
-CFLAGS=-i"C:\FDOS\WATCOM/H" -w4 -e25 -zkl -zq -otexan -ol -ol+ &
- -oh -om -d2 -bt=dos -ml
-
-CXX=*wpp
-CXXFLAGS=-i="C:\FDOS\WATCOM/H" -w4 -e25 -zkl -zq -otexan -ol -ol+ &
- -oh -om -d2 -bt=dos -ml -xs -xr
-
-LD=*wlink
-LDFLAGS=d all sys dos op m op maxe=25 op q op symf
-
-all : core16.exe
-
-clean : .symbolic
- @del *.obj
- @del core16.exe
- @del *.err
- @del *.smp
-
-core16.exe : $(OBJS)
- $(LD) $(LDFLAGS) name core16 file {$(OBJS)}
-
-.c : src/;src/lib
-.cpp : src/;src/lib
-
-.cpp.obj : .autodepend
- $(CXX) $< -fo=$@ $(CXXFLAGS)
-.c.obj : .autodepend
- $(CC) $< -fo=$@ $(CFLAGS)
-$(OBJS) :
--- /dev/null
+c2e.convert_special: 0
+e2c.convert_num: 0
+openfiles: /dos/z/16/doc/project.txt:0:0:0:
+openfiles: /dos/z/16/scroll.c:82:0:1:
+snr_recursion_level: 0
+convertcolumn_horizontally: 0
+adv_open_matchname: 0
+show_mbhl: 1
+view_line_numbers: 1
+fb_show_backup_f: 0
+htmlbar_thumbnailwidth: 300
+view_left_panel: 0
+default_mime_type: text/plain
+e2c.convert_xml: 1
+c2e.convert_iso: 0
+opendir: file:///dos/z/16
+wrap_text_default: 0
+bookmarks_filename_mode: 1
+ssearch_text: mapScrollRight
+snr_casesens: 1
+view_blocks: 1
+name: project 16
+replacelist: てすと
+replacelist: \t
+replacelist: putPixel_X
+replacelist: SCREEN_WIDTH
+replacelist: SCREEN_HEIGHT
+fb_show_hidden_f: 0
+editor_tab_width: 4
+show_visible_spacing: 1
+view_statusbar: 1
+display_right_margin: 0
+c2e.IE_apos_workaround: 0
+outputb_scroll_mode: 0
+leftpanel_active_tab: 0
+enable_syntax_scan: 1
+ssearch_regex: 0
+e2c.convert_iso: 0
+ssearch_casesens: 0
+charmap_block: 1
+recent_files: file:///dos/z/16/16/lib/x/MXPN.ASM
+recent_files: file:///dos/z/4x4_16/!/c/TUT10.C
+recent_files: file:///dos/z/16/16/lib/x/MXVS.ASM
+recent_files: file:///dos/z/16/16/lib/x/MAKEFILE
+recent_files: file:///dos/z/16/16/lib/x/MODEX.DEF
+recent_files: file:///dos/z/4x4_16/modex/DEMO01.PAS
+recent_files: file:///dos/z/16/16/lib/x/MXCR.ASM
+recent_files: file:///dos/z/4x4_16/modex/DEMO07.PAS
+recent_files: file:///dos/z/16/16/scrasm/MAIN.ASM
+recent_files: file:///dos/z/16/16/lib/x/MXBB.ASM
+recent_files: file:///dos/z/16/src/lib/dos_gfx.h
+recent_files: file:///dos/z/16/16/lib/intro/lib.c
+recent_files: file:///dos/z/16/src/lib/dos_gfx.cpp
+recent_files: file:///dos/z/16/16/modex16/MODEX16.H
+recent_files: file:///dos/z/16/16/modex16/MODEX16.C
+recent_files: file:///dos/z/4x4_16/w_modex/MODEX.CPP
+recent_files: file:///dos/z/16/16/TYPES.H
+recent_files: file:///dos/z/16/16/lib/TYPES.H
+recent_files: file:///dos/z/16/16/test.c
+recent_files: file:///dos/z/16/16/MODEX16.H
+recent_files: file:///dos/z/16/16/MODEX16.C
+recent_files: file:///dos/z/16/16/lib/types.h
+recent_files: file:///dos/z/16/16/modex16/PCXTEST.C
+recent_files: file:///dos/z/16/16/lib/MODEX16.C
+recent_files: file:///dos/z/16/16/lib/MODEX16.H
+recent_files: file:///dos/z/16/16/modex16/SCROLL.C
+recent_files: file:///dos/z/16/src/lib/dos_comm.c
+recent_files: file:///dos/z/16/src/eng_comm.cpp
+recent_files: file:///dos/z/16/src/eng_comm.h
+recent_files: file:///dos/z/16/src/lib/dos_comm.h
+recent_files: file:///dos/z/16/16/modex16/lib/lib_com.h
+recent_files: file:///dos/z/16/16/modex16/lib/lib_com.cpp
+recent_files: file:///dos/z/16/16/modex16/modex16.h
+recent_files: file:///dos/z/16/16/modex16/scroll.c
+recent_files: file:///dos/z/16/16/modex16/dos_kb.c
+recent_files: file:///dos/z/16/16/dos_gfx.cpp
+recent_files: file:///dos/z/16/16/dos_gfx.h
+recent_files: file:///dos/z/16/16/modex16/makefile
+recent_files: file:///dos/z/16/16/dos_kb.c
+recent_files: file:///dos/z/16/16/TEST.C
+recent_files: file:///dos/z/16/16/dos_kb.h
+recent_files: file:///dos/z/16/16/lib/lib_com.cpp
+recent_files: file:///dos/z/16/16/lib/lib_com.h
+recent_files: file:///dos/z/16/16/16.txt
+recent_files: file:///dos/z/16/16/lib/x/MODEX.H
+recent_files: file:///dos/z/16/16/modex16/dos_kb.h
+recent_files: file:///dos/z/16/doc/16.16
+recent_files: file:///dos/z/16/doc/16story.txt
+recent_files: file:///dos/z/16/doc/project.txt
+recent_files: file:///dos/z/16/scroll.c
+snr_replacetype: 0
+savedir: file:///dos/z/16/16/modex16
+spell_check_default: 1
+spell_insert_entities: 0
+last_filefilter:
+htmlbar_notebooktab: 0
+view_blockstack: 1
+snr_escape_chars: 0
+htmlbar_view: 0
+spell_lang: en
+ssearch_dotmatchall: 0
+searchlist: QUADWH
+searchlist: pdump
+searchlist: #include "modex16.h"\r\n#include <stdio.h>\r\n\r\nword far* clock= (word far*) 0x046C; /* 18.2hz clock */\r\n\r\nvoid main() {\r\n#include "modex16.h"\r\n#include <stdio.h>\r\n\r\nword far* clock= (word far*) 0x046C; /* 18.2hz clock */\r\n\r\nvoid main() {\r\n
+searchlist: extern
+searchlist: VGA
+searchlist: vga
+searchlist: clock
+searchlist: setvideo
+searchlist: gq
+searchlist: SC_INDEX
+searchlist: draw
+searchlist: int index
+searchlist: map.dat
+searchlist: 32
+searchlist: mapScrollRight
+autocomplete: 1
+outputb_show_all_output: 0
+bookmarks_show_mode: 0
+snippets_show_as_menu: 1
+adv_open_recursive: 0
+encoding: SHIFT_JIS
+e2c.convert_special: 0
+autoindent: 1
+fb_viewmode: 0
+filegloblist: *.txt
+filegloblist: *.shtml
+filegloblist: *.py
+filegloblist: *.pl
+filegloblist: *.php
+filegloblist: *.js
+filegloblist: *.java
+filegloblist: *.htm
+filegloblist: *.html
+filegloblist: *.h
+filegloblist: *.css
+filegloblist: *.cpp
+filegloblist: *.cgi
+filegloblist: *.c
+filegloblist: *
+recent_dirs: file:///dos/z/16/16
+fb_focus_follow: 1
+ssearch_unescape: 0
+c2e.convert_symbol: 0
+snr_dotmatchall: 0
+c2e.convert_xml: 1
+editor_indent_wspaces: 0
+view_cline: 0
+snr_type: 0
+snr_scope: 0
+bmarksearchmode: 0
+view_main_toolbar: 1
+e2c.convert_symbol: 0
Open watcom to compile the code of project 16\r
-/ = main engine code (branched off due to lack of understanding of C++)\r
+/ = copy of pngwen's code\r
16/ = the current code sparky4 is working with\r
-16/modex16/ = pngwen's code\r
+16/modex16/ = pngwen's code archived\r
\r
TODO not in particular order~:\r
almost done 1. SCROLLING!!!!!!!\r
2. Fix pngwen's pcx rendering code it dose not render large relolution pcx files well at all!\r
-3. document an understrand how the main engine code works!\r
-4. movement and player movement when reaching edge of map\r
-5. sprite rendering\r
+3. Erase player sprite when moving and tweak it\r
+DONE 4. movement and player movement when reaching edge of map\r
+DONE 5. sprite rendering\r
6. text box rendering\r
7. text rendering\r
8. map loading\r
10. map and item interation\r
11. item inventory~\r
\r
+To compile:
+You need Open Watcom stable to compile and just run wmake
\ No newline at end of file
+++ /dev/null
-Open Watcom Linker Version 1.9\r
-Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.\r
-Created on: 14/02/24 12:05:08\r
-Executable Image: core16.exe\r
-creating a DOS executable\r
-\r
-\r
- +------------+\r
- | Groups |\r
- +------------+\r
-\r
-Group Address Size\r
-===== ======= ====\r
-\r
-DGROUP 0fd4:0000 000017b0\r
-\r
-\r
-\r
- +--------------+\r
- | Segments |\r
- +--------------+\r
-\r
-Segment Class Group Address Size\r
-======= ===== ===== ======= ====\r
-\r
-main_TEXT CODE AUTO 0000:0000 000000de\r
-timer_TEXT CODE AUTO 0000:00e0 000001b4\r
-eng_ai_TEXT CODE AUTO 0000:02a0 00000013\r
-eng_snd_TEXT CODE AUTO 0000:02c0 00000077\r
-eng_comm_TEXT CODE AUTO 0000:0340 00000035\r
-eng_core_TEXT CODE AUTO 0000:0380 0000067b\r
-eng_gfx_TEXT CODE AUTO 0000:0a00 00000013\r
-dos_comm_TEXT CODE AUTO 0000:0a20 000002ab\r
-dos_gfx_TEXT CODE AUTO 0000:0cd0 00001d7e\r
-dos_opl2_TEXT CODE AUTO 0000:2a50 000004ae\r
-lib_com_TEXT CODE AUTO 0000:2f00 00000063\r
-cppdata_TEXT CODE AUTO 0000:2f70 00000000\r
-fsregist_TEXT CODE AUTO 0000:2f70 000003c1\r
-undefed_TEXT CODE AUTO 0000:3340 00000013\r
-cstrt086_TEXT CODE AUTO 0000:3354 00000000\r
-_TEXT CODE AUTO 0000:3360 00008352\r
-cmodel_TEXT CODE AUTO 0000:b6b2 00000000\r
-fsroot_TEXT CODE AUTO 0000:b6c0 0000000b\r
-iofefg_TEXT CODE AUTO 0000:b6d0 00000142\r
-_8087086_TEXT CODE AUTO 0000:b812 00000000\r
-manendl_TEXT CODE AUTO 0000:b820 00000020\r
-ioicout_TEXT CODE AUTO 0000:b840 000000a5\r
-ostincch_TEXT CODE AUTO 0000:b8f0 000000b4\r
-ostinomn_TEXT CODE AUTO 0000:b9b0 00000014\r
-stabdtor_TEXT CODE AUTO 0000:b9d0 000003d5\r
-stabdisp_TEXT CODE AUTO 0000:bdb0 00000349\r
-fatalerr_TEXT CODE AUTO 0000:c100 00000025\r
-crwd086_TEXT CODE AUTO 0000:c126 00000000\r
-seg086_TEXT CODE AUTO 0000:c126 00000000\r
-i4m_TEXT CODE AUTO 0000:c126 00000000\r
-i4d_TEXT CODE AUTO 0000:c126 00000000\r
-ini87086_TEXT CODE AUTO 0000:c126 00000000\r
-iofnoefg_TEXT CODE AUTO 0000:c130 00000014\r
-_i_fcvt__TEXT CODE AUTO 0000:c144 00000005\r
-ostput_TEXT CODE AUTO 0000:c150 000000e8\r
-ostflush_TEXT CODE AUTO 0000:c240 00000058\r
-sdfconfp_TEXT CODE AUTO 0000:c2a0 0000001e\r
-stablcl_TEXT CODE AUTO 0000:c2c0 00000005\r
-ostconsf_TEXT CODE AUTO 0000:c2d0 00000105\r
-ostdestr_TEXT CODE AUTO 0000:c3e0 000000f4\r
-sdfdestr_TEXT CODE AUTO 0000:c4e0 000000f5\r
-moddtorr_TEXT CODE AUTO 0000:c5e0 00000000\r
-ostopfx_TEXT CODE AUTO 0000:c5e0 00000072\r
-iouwrtit_TEXT CODE AUTO 0000:c660 0000034a\r
-iossetst_TEXT CODE AUTO 0000:c9b0 00000071\r
-stabtrav_TEXT CODE AUTO 0000:ca30 000001f3\r
-callterm_TEXT CODE AUTO 0000:cc30 0000004f\r
-allocexc_TEXT CODE AUTO 0000:cc80 000004be\r
-stabadt_TEXT CODE AUTO 0000:d140 00000127\r
-tsequiv_TEXT CODE AUTO 0000:d270 00000191\r
-xiyi_TEXT CODE AUTO 0000:d402 00000000\r
-pure_err_TEXT CODE AUTO 0000:d410 00000028\r
-vfun_err_TEXT CODE AUTO 0000:d440 00000028\r
-stfconde_TEXT CODE AUTO 0000:d470 0000006e\r
-stfdsgtn_TEXT CODE AUTO 0000:d4e0 00000088\r
-stfdspun_TEXT CODE AUTO 0000:d570 000000ce\r
-stfpbfai_TEXT CODE AUTO 0000:d640 00000004\r
-sdfoverf_TEXT CODE AUTO 0000:d650 0000021a\r
-sdfundrf_TEXT CODE AUTO 0000:d870 00000190\r
-stfsbuf_TEXT CODE AUTO 0000:da00 00000082\r
-stfseeko_TEXT CODE AUTO 0000:da90 0000000c\r
-stfseekp_TEXT CODE AUTO 0000:daa0 00000022\r
-sdfsync_TEXT CODE AUTO 0000:dad0 0000002e\r
-stfdoall_TEXT CODE AUTO 0000:db00 00000040\r
-stabmod_TEXT CODE AUTO 0000:db40 0000007a\r
-iosinit_TEXT CODE AUTO 0000:dbc0 00000062\r
-iosconde_TEXT CODE AUTO 0000:dc30 00000012\r
-iosdestr_TEXT CODE AUTO 0000:dc50 000000b2\r
-opdel_TEXT CODE AUTO 0000:dd10 0000000e\r
-dtorarst_TEXT CODE AUTO 0000:dd20 0000002f\r
-opdelarr_TEXT CODE AUTO 0000:dd50 00000005\r
-stfdestr_TEXT CODE AUTO 0000:dd60 0000002e\r
-opnewarr_TEXT CODE AUTO 0000:dd90 00000005\r
-iosfail_TEXT CODE AUTO 0000:dda0 0000000a\r
-stabthrw_TEXT CODE AUTO 0000:ddb0 00000da5\r
-dointr_TEXT CODE AUTO 0000:eb56 00000000\r
-bittest_TEXT CODE AUTO 0000:eb60 00000047\r
-termnate_TEXT CODE AUTO 0000:ebb0 00000051\r
-exc_pr_TEXT CODE AUTO 0000:ec10 000001bd\r
-areaexc_TEXT CODE AUTO 0000:edd0 00000000\r
-tssize_TEXT CODE AUTO 0000:edd0 00000053\r
-bufld086_TEXT CODE AUTO 0000:ee24 00000000\r
-fpe87_TEXT CODE AUTO 0000:ee24 00000000\r
-prwdata_TEXT CODE AUTO 0000:ee30 00000000\r
-stfsetb_TEXT CODE AUTO 0000:ee30 0000008a\r
-ioufrxal_TEXT CODE AUTO 0000:eec0 00000034\r
-opnew_TEXT CODE AUTO 0000:ef00 0000007a\r
-unexpect_TEXT CODE AUTO 0000:ef80 000000c0\r
-stjmp086_TEXT CODE AUTO 0000:f040 00000000\r
-stabinit_TEXT CODE AUTO 0000:f040 00000104\r
-ljmpinit_TEXT CODE AUTO 0000:f150 00000016\r
-file086_TEXT CODE AUTO 0000:f166 00000000\r
-ljmpdtor_TEXT CODE AUTO 0000:f170 000000a5\r
-error086_TEXT CODE AUTO 0000:f216 00000000\r
-stfsync_TEXT CODE AUTO 0000:f220 00000022\r
-main_DATA1 FAR_CONST AUTO 0f25:0000 00000026\r
-eng_core_DATA1 FAR_CONST AUTO 0f27:0006 00000014\r
-eng_core_DATA2 FAR_CONST AUTO 0f27:001a 000000f2\r
-dos_gfx_DATA1 FAR_CONST AUTO 0f27:010c 0000004b\r
-dos_opl2_DATA1 FAR_CONST AUTO 0f27:0157 00000016\r
-undefed_DATA1 FAR_CONST AUTO 0f27:016d 0000002c\r
-iofefg_DATA1 FAR_CONST AUTO 0f40:000a 00000000\r
-manendl_DATA1 FAR_CONST AUTO 0f40:000a 00000000\r
-ioicout_DATA1 FAR_CONST AUTO 0f41:0000 00000076\r
-ostincch_DATA1 FAR_CONST AUTO 0f48:0006 00000000\r
-ostinomn_DATA1 FAR_CONST AUTO 0f48:0006 00000000\r
-iofnoefg_DATA1 FAR_CONST AUTO 0f48:0006 00000000\r
-iofnoefg_DATA1 FAR_CONST AUTO 0f48:0006 00000028\r
-ostput_DATA1 FAR_CONST AUTO 0f4a:000e 00000000\r
-ostflush_DATA1 FAR_CONST AUTO 0f4a:000e 00000000\r
-sdfconfp_DATA1 FAR_CONST AUTO 0f4a:000e 00000044\r
-ostconsf_DATA1 FAR_CONST AUTO 0f4a:0052 00000040\r
-ostdestr_DATA1 FAR_CONST AUTO 0f54:0000 00000034\r
-sdfdestr_DATA1 FAR_CONST AUTO 0f54:0040 0000002c\r
-ostopfx_DATA1 FAR_CONST AUTO 0f5a:000c 00000000\r
-iouwrtit_DATA1 FAR_CONST AUTO 0f5a:000c 00000000\r
-iossetst_DATA1 FAR_CONST AUTO 0f5b:0000 00000056\r
-callterm_DATA1 FAR_CONST AUTO 0f60:0006 00000041\r
-allocexc_DATA1 FAR_CONST AUTO 0f65:0000 00000046\r
-allocexc_DATA2 FAR_CONST AUTO 0f69:0006 0000002b\r
-stabadt_DATA1 FAR_CONST AUTO 0f6d:0000 00000026\r
-pure_err_DATA1 FAR_CONST AUTO 0f6f:0006 0000001e\r
-vfun_err_DATA1 FAR_CONST AUTO 0f6f:0024 00000032\r
-stfconde_DATA1 FAR_CONST AUTO 0f74:0006 0000003a\r
-stfdsgtn_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfdspun_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfpbfai_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-sdfoverf_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-sdfundrf_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfsbuf_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfseeko_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfseekp_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-sdfsync_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-stfdoall_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-iosinit_DATA1 FAR_CONST AUTO 0f74:0040 00000000\r
-iosconde_DATA1 FAR_CONST AUTO 0f74:0040 00000012\r
-iosdestr_DATA1 FAR_CONST AUTO 0f7a:0000 00000036\r
-opdel_DATA1 FAR_CONST AUTO 0f7a:0040 00000000\r
-opdelarr_DATA1 FAR_CONST AUTO 0f7a:0040 00000000\r
-stfdestr_DATA1 FAR_CONST AUTO 0f7e:0000 00000000\r
-opnewarr_DATA1 FAR_CONST AUTO 0f7e:0000 00000000\r
-iosfail_DATA1 FAR_CONST AUTO 0f7e:0000 00000000\r
-stabthrw_DATA1 FAR_CONST AUTO 0f7e:0000 000001da\r
-stabthrw_DATA2 FAR_CONST AUTO 0f9b:000a 000001c7\r
-termnate_DATA1 FAR_CONST AUTO 0f9b:01d1 00000022\r
-stfsetb_DATA1 FAR_CONST AUTO 0fba:0004 00000000\r
-ioufrxal_DATA1 FAR_CONST AUTO 0fba:0004 00000000\r
-opnew_DATA1 FAR_CONST AUTO 0fbb:0000 00000000\r
-unexpect_DATA1 FAR_CONST AUTO 0fbb:0000 0000000a\r
-unexpect_DATA2 FAR_CONST AUTO 0fbb:000a 00000023\r
-stfsync_DATA1 FAR_CONST AUTO 0fbd:000e 00000000\r
-main_DATA2 FAR_DATA AUTO 0fbd:000e 00000014\r
-FAR_DATA FAR_DATA AUTO 0fbd:0022 00000000\r
-ioicout_DATA1 FAR_DATA AUTO 0fbd:0022 00000063\r
-sdfconfp_DATA1 FAR_DATA AUTO 0fbd:0085 00000016\r
-ostconsf_DATA1 FAR_DATA AUTO 0fbd:009b 00000010\r
-ostdestr_DATA1 FAR_DATA AUTO 0fbd:00ab 00000000\r
-sdfdestr_DATA1 FAR_DATA AUTO 0fbd:00ab 00000000\r
-iossetst_DATA1 FAR_DATA AUTO 0fbd:00ab 00000033\r
-allocexc_DATA3 FAR_DATA AUTO 0fbd:00de 00000014\r
-stabadt_DATA2 FAR_DATA AUTO 0fbd:00f2 00000011\r
-stfconde_DATA1 FAR_DATA AUTO 0fbd:0103 00000000\r
-iosconde_DATA1 FAR_DATA AUTO 0fbd:0103 00000000\r
-iosdestr_DATA1 FAR_DATA AUTO 0fbd:0103 00000000\r
-stfdestr_DATA1 FAR_DATA AUTO 0fbd:0103 00000000\r
-stabthrw_DATA3 FAR_DATA AUTO 0fbd:0103 00000068\r
-unexpect_DATA3 FAR_DATA AUTO 0fbd:016b 00000000\r
-_NULL BEGDATA DGROUP 0fd4:0000 00000020\r
-_AFTERNULL BEGDATA DGROUP 0fd6:0000 00000002\r
-CONST DATA DGROUP 0fd6:0002 000000f0\r
-CONST2 DATA DGROUP 0fe5:0002 00000132\r
-_DATA DATA DGROUP 0ff9:0000 000007e2\r
-STRINGS DATA DGROUP 1077:0002 00000000\r
-XIB DATA DGROUP 1077:0002 00000000\r
-XI DATA DGROUP 1077:0002 0000004e\r
-XIE DATA DGROUP 107c:0000 00000000\r
-YIB DATA DGROUP 107c:0000 00000000\r
-YI DATA DGROUP 107c:0000 00000012\r
-YIE DATA DGROUP 107d:0002 00000000\r
-DATA DATA DGROUP 107d:0002 00000000\r
-_emu_init_start EMU DGROUP 107d:0002 00000000\r
-_emu_init_end EMU DGROUP 107d:0002 00000000\r
-_BSS BSS DGROUP 107e:0000 00000506\r
-STACK STACK DGROUP 10cf:0000 00000800\r
-\r
-\r
- +----------------+\r
- | Memory Map |\r
- +----------------+\r
-\r
-* = unreferenced symbol\r
-+ = symbol only referenced locally\r
-\r
-Address Symbol\r
-======= ======\r
-\r
-Module: main.obj(C:\Z\16\src\main.cpp)\r
-0000:0000 main_\r
-Module: timer.obj(C:\Z\16\src\timer.cpp)\r
-0000:00e0 far engine::Timer::Timer()\r
-0000:010c long unsigned far engine::Timer::start_timer()\r
-0000:0150 double far engine::Timer::elapsed_timer()\r
-0000:01a6+ double far engine::Timer::time_in_seconds()\r
-0000:01f0+ double far engine::Timer::time_in_seconds( long unsigned )\r
-0000:0238+ long unsigned far engine::Timer::_time()\r
-0000:0268 far engine::Timer::~Timer()\r
-Module: eng_ai.obj(C:\Z\16\src\eng_ai.cpp)\r
-0000:02a0 void far engine::do_artificial_intelligence()\r
-Module: eng_snd.obj(C:\Z\16\src\eng_snd.cpp)\r
-0000:02c0 void far engine::do_sound()\r
-Module: eng_comm.obj(C:\Z\16\src\eng_comm.cpp)\r
-0000:0340 __anonymous_enum far engine::do_communication()\r
-Module: eng_core.obj(C:\Z\16\src\eng_core.cpp)\r
-0000:0380 far engine::Core::Core()\r
-0000:0490+ void far engine::Core::update()\r
-0000:0500+ void far engine::Core::sound()\r
-0000:051e+ void far engine::Core::graphics()\r
-0000:053c+ void far engine::Core::comm()\r
-0000:0560+ void far engine::Core::ai()\r
-0000:057e+ __anonymous_enum far engine::Core::_msg()\r
-0000:05a2 void far engine::Core::run()\r
-0000:05ea+ bool far engine::Core::init()\r
-0000:08ca+ void far engine::Core::release()\r
-0000:08f6+ void far engine::Core::input()\r
-0000:0916+ void far engine::Core::sync()\r
-0000:09ae far engine::Core::~Core()\r
-Module: eng_gfx.obj(C:\Z\16\src\eng_gfx.cpp)\r
-0000:0a00 void far engine::do_graphics()\r
-Module: dos_comm.obj(C:\Z\16\src\lib\dos_comm.c)\r
-0000:0a20+ newkb_\r
-0000:0b00 setkb_\r
-0000:0c7c keyp_\r
-Module: dos_gfx.obj(C:\Z\16\src\lib\dos_gfx.cpp)\r
-0000:0cd0+ void far setvideo( char unsigned, int )\r
-0000:0d6e+ void far setvbuff( int )\r
-0000:0e02+ void far updatevbuff()\r
-0000:0e44+ void far cls( char unsigned, char unsigned far * )\r
-0000:0e7e+ void far clearscr()\r
-0000:0ebc+ void far plotpixel( int, int, char unsigned, char unsigned far * )\r
-0000:0f0a+ void far ppf( int, int, char unsigned, char unsigned far * )\r
-0000:0f4a+ void far BlockMove()\r
-0000:1046+ void far eraseplayer( int, int )\r
-0000:1098+ void far drawplayer( int, int, int )\r
-0000:10ec+ int far colortest()\r
-0000:113e+ int far colorz()\r
-0000:1190+ void far ssd( int )\r
-0000:1232+ void far pdump( int )\r
-0000:1328+ void far tulip()\r
-0000:273a+ int far ding( int )\r
-0fd4:0254+ char unsigned far * far vga\r
-0fd4:0258+ int far gq\r
-0fd4:0ba6+ char unsigned far * far vaddr\r
-0fd4:0baa+ int far old_mode\r
-0fd4:0bac+ int far q\r
-0fd4:0bae+ int far bakax\r
-0fd4:0bb0+ int far bakay\r
-0fd4:0bb2+ int far xx\r
-0fd4:0bb4+ int far yy\r
-0fd4:0bb6+ int far sx\r
-0fd4:0bb8+ int far sy\r
-0fd4:0bba+ char unsigned far coor\r
-Module: dos_opl2.obj(C:\Z\16\src\lib\dos_opl2.cpp)\r
-0000:2a50+ void far WriteFM( int, int )\r
-0000:2ab2+ int far ReadFM()\r
-0000:2ad6 int far AdlibExists()\r
-0000:2b70 void far FMReset()\r
-0000:2bc4 void far FMKeyOff( int )\r
-0000:2bfc void far FMKeyOn( int, int, int )\r
-0000:2c62+ void far FMVoiceVolume( int, int )\r
-0000:2c94+ void far FMSetVoice( int, __5rfh0rFMInstrument far * )\r
-0fd4:026c+ short unsigned far Notes[]\r
-0000:2dfc void far fmtest()\r
-0000:2eae+ int far soundtest()\r
-0fd4:0bbc+ int far sq\r
-Module: lib_com.obj(C:\Z\16\src\lib\lib_com.cpp)\r
-0000:2f00 void far wait( long unsigned )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(cppdata)\r
-0fd4:0bbe __wint_thread_data\r
-0fd4:0be2 __compiled_under_generic\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(fsregist)\r
-0000:2f70+ __wcpp_4_dispatch_dummy__\r
-0000:2faa __wcpp_4_fs_lookup__\r
-0000:30da __wcpp_4_fs_handler_rtn__\r
-0000:3264 __wcpp_4_unwind_global__\r
-0000:32dc __wcpp_4_raise_exception__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(undefed)\r
-0000:3340 __wcpp_4_undefed_cdtor__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(cstart)\r
-0fd4:0000* __nullarea\r
-0fd4:02a6* __ovlflag\r
-0fd4:02a7* __intno\r
-0fd4:02a8* __ovlvec\r
-0000:3360 _cstart_\r
-0000:3437* _Not_Enough_Memory_\r
-0000:354a __exit_\r
-0000:3569 __do_exit_with_msg__\r
-0000:35bc __GETDS\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(cmodel)\r
-0000:35c6 _big_code_\r
-0000:35c6* CodeModelMismatch\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(fsroot)\r
-0fd4:0a32 ___wcpp_4_data_init_fs_root_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(clockdos)\r
-0000:35c6+ __ibm_bios_get_ticks_\r
-0000:363c clock_\r
-Module: c:\fdos\WATCOM/lib286/dos\emu87.lib(initemu)\r
-0000:8000 FJSRQQ\r
-0000:0632 FISRQQ\r
-0000:1632* FIERQQ\r
-0000:5c32 FIDRQQ\r
-0000:a23d FIWRQQ\r
-0000:c000 FJCRQQ\r
-0000:4000* FJARQQ\r
-0000:0e32 FICRQQ\r
-0000:fe32* FIARQQ\r
-0000:369c __init_87_emulator\r
-0000:372d* __fini_87_emulator\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fltused)\r
-0fd4:02dc _fltused_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iofefg)\r
-0000:b720 std::istream far & far operator >>( std::istream far &, smanip<long far > const far & )\r
-0000:b760 std::istream far & far operator >>( std::istream far &, smanip<int far > const far & )\r
-0000:b7a0 std::ostream far & far operator <<( std::ostream far &, smanip<long far > const far & )\r
-0000:b7e0 std::ostream far & far operator <<( std::ostream far &, smanip<int far > const far & )\r
-0fd4:0a4a __ppfltused_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(_8087)\r
-0fd4:02de __8087\r
-0fd4:02df __real87\r
-0fd4:02e0 __dos87emucall\r
-0fd4:02e2 __dos87real\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(sound)\r
-0000:37a4 sound_\r
-0000:3840 nosound_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(delay)\r
-0000:3860 delay_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(manendl)\r
-0000:b820 std::ostream far & far std::endl( std::ostream far & )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ioicout)\r
-0fd4:0c28 std::ostream near std::cout\r
-0000:b89e+ far cout_initfini::cout_initfini()\r
-0000:b8ac+ far cout_initfini::~cout_initfini()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostincch)\r
-0000:b8f0 std::ostream far & far std::ostream::operator <<( char const far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostinomn)\r
-0000:b9b0 std::ostream far & far std::ostream::operator <<( std::ostream far & (far *)())\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(inp)\r
-0000:39bf inp_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(outp)\r
-0000:39c7 outp_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(printf)\r
-0000:39d1 printf_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(d_setvec)\r
-0000:3a00 _dos_setvect_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(d_getvec)\r
-0000:3a0d _dos_getvect_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(intx086)\r
-0000:3a18+ int86x_\r
-0000:3ab2 int86_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(ffree)\r
-0000:3adf* _ffree_\r
-0000:3adf free_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(calloc)\r
-0000:3b25 calloc_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(exit)\r
-0000:3b68+ __null_int23_exit_\r
-0000:3b69 exit_\r
-0000:3b9a* _exit_\r
-0fd4:02e4+ ___int23_exit\r
-0fd4:02e8 ___FPE_handler_exit\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(rand)\r
-0000:3bba rand_\r
-0000:3bfc* srand_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(kbhit)\r
-0000:3c20 kbhit_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabdtor)\r
-0000:bd58 __wcpp_4_destruct_internal__\r
-0000:bd76* __wcpp_4_destruct_all__\r
-0000:bd78* __wcpp_4_destruct__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabdisp)\r
-0000:c086 __wcpp_4_dispatchable__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(fatalerr)\r
-0000:c100 __wcpp_4_fatal_runtime_error__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(cmain086)\r
-0000:3c36 __CMain\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(initrtns)\r
-0000:3c9c __InitRtns\r
-0000:3c9c* __FInitRtns\r
-0000:3cf7 __FiniRtns\r
-0000:3cf7* __FFiniRtns\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(xmsg)\r
-0000:3d5b __exit_with_msg_\r
-0000:3d60 __fatal_runtime_error_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(crwdata)\r
-0fd4:02f0 __curbrk\r
-0fd4:02f8 __STACKLOW\r
-0fd4:02fa __STACKTOP\r
-0fd4:02fc __cbyte\r
-0fd4:02fe __child\r
-0fd4:0300 __no87\r
-0fd4:030e ___FPE_handler\r
-0fd4:02f2 __psp\r
-0fd4:0302 __get_ovl_stack\r
-0fd4:0306 __restore_ovl_stack\r
-0fd4:030a __close_ovl_file\r
-0fd4:0312 __LpCmdLine\r
-0fd4:0316 __LpPgmName\r
-0fd4:02f4 __osmajor\r
-0fd4:02f5 __osminor\r
-0fd4:02f6 __osmode\r
-0fd4:02f7 __HShift\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(dosseg)\r
-0000:3d7e __DOSseg__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(i4m)\r
-0000:3d80 __I4M\r
-0000:3d80 __U4M\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(i4d)\r
-0000:3d98 __I4D\r
-0000:3de7 __U4D\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(init8087)\r
-0000:3e6c __init_8087_emu\r
-0000:3e72 __x87id\r
-Module: c:\fdos\WATCOM/lib286/dos\emu87.lib(emu8087)\r
-0000:3fc2 __int34\r
-0000:3fff __int3c\r
-Module: c:\fdos\WATCOM/lib286/dos\emu87.lib(dosinit)\r
-0000:68ea ___dos87emucall\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(setefg)\r
-0000:6928 __setEFGfmt_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iofnoefg)\r
-0fd4:0384 void (far * far __EFG_cnvs2d)( char far *, double far * )\r
-0fd4:0388 int (far * far __EFG_cnvd2f)( double far *, float far * )\r
-0fd4:038c void (far * far __EFG_LDcvt)( __g4aa8long_double far *, cvt_info far *, char far * )\r
-0fd4:0390 char far * (far * far __EFG_fcvt)( double, int, int far *, int far * )\r
-0fd4:0394 void (far * far __EFG__FDLD)( double near *, __g4aa8long_double near * )\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(cnvs2d)\r
-0000:6946 __cnvs2d_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(cnvd2f)\r
-0000:6985 __cnvd2f_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(ldcvt)\r
-0000:6b5f _LDScale10x_\r
-0000:70ce __LDcvt_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(_i_fcvt_)\r
-0000:c144 _fcvt_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(cnvd2ld)\r
-0000:7601 __cnvd2ld_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(chk8087)\r
-0000:7632* _fpreset_\r
-0000:765d __init_8087_\r
-0000:7690+ __default_sigfpe_handler_\r
-0000:76a3 __chk8087_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(nonibm)\r
-0000:7715+ __is_nonIBM_\r
-0fd4:0424 ___NonIBM\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostput)\r
-0000:c150 std::ostream far & far std::ostream::put( char )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostflush)\r
-0000:c240 std::ostream far & far std::ostream::flush()\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(iobaddr)\r
-0000:775c __get_std_stream_\r
-0000:775c* __get_std_file_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(sdfconfp)\r
-0000:c2a0 far stdiobuf::stdiobuf( __iobuf far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stablcl)\r
-0000:c2c0 __wcpp_4_lcl_register__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostconsf)\r
-0000:c2d0 far std::ostream::ostream( std::streambuf far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostdestr)\r
-0000:c3e0 far std::ostream::~ostream()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(sdfdestr)\r
-0000:c4e0 far stdiobuf::~stdiobuf()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(moddtorr)\r
-0fd4:0a86 ___wcpp_4_data_module_dtor_ref_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ostopfx)\r
-0000:c5e0 int far std::ostream::do_opfx()\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(strlen)\r
-0000:777a strlen_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iouwrtit)\r
-0000:c660 int far __WATCOM_ios::writeitem( std::ostream far &, char const far *, int, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iossetst)\r
-0000:c9f0+ far std::ios::failure::failure( std::ios::failure const far & )\r
-0000:ca00+ far std::ios::failure::~failure()\r
-0000:ca10+ far __WATCOM_exception::__WATCOM_exception( __WATCOM_exception const far & )\r
-0000:ca20+ far __WATCOM_exception::~__WATCOM_exception()\r
-0000:c9b0 void far std::ios::setstate( int )\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(iob)\r
-0fd4:0426 ___iob\r
-0fd4:058e* __fmode\r
-0fd4:0c56 ___OpenStreams\r
-0fd4:0c5a ___ClosedStreams\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fprtf)\r
-0000:77a9 __fprtf_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(intr)\r
-0000:7874 intr_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(segread)\r
-0000:7888 segread_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(nmalloc)\r
-0000:78a8 _nmalloc_\r
-0fd4:0590 ___nheapbeg\r
-0fd4:0592 ___MiniHeapRover\r
-0fd4:0594 ___LargestSizeB4MiniHeapRover\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(mem)\r
-0000:7980 __MemAllocator\r
-0000:7a4a __MemFree\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fmalloc)\r
-0000:7ba7* _fmalloc_\r
-0000:7ba7 malloc_\r
-0fd4:0596+ ___fheap\r
-0fd4:0598 ___fheapRover\r
-0fd4:059a ___LargestSizeB4Rover\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(nfree)\r
-0000:7cb5 _nfree_\r
-0fd4:0c5e+ ___MiniHeapFreeRover\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabtrav)\r
-0000:ca30 __wcpp_4_stab_entry__\r
-0000:ca4a* __wcpp_4_stab_trav_comp__\r
-0000:cb70 __wcpp_4_stab_trav_init__\r
-0000:cb9e __wcpp_4_stab_trav_next__\r
-0000:cc14 __wcpp_4_stab_trav_move__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(callterm)\r
-0000:cc30 __wcpp_4_corrupted_stack__\r
-0000:cc48 __wcpp_4_call_terminate__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(allocexc)\r
-0000:cc92 __wcpp_4_alloc_exc__\r
-0000:cf52 __wcpp_4_free_exc__\r
-0000:cfc6 __wcpp_4_find_active__\r
-0000:d030 __wcpp_4_dtor_free_exc__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabadt)\r
-0000:d140+ void far * far dtor_the_array( _RTARCTOR far * )\r
-0000:d1b0+ far _RTARCTOR::~_RTARCTOR()\r
-0000:d1d0 __wcpp_4_dtor_array__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(tsequiv)\r
-0000:d270 __wcpp_4_ts_refed__\r
-0000:d290+ __wcpp_4_ts_pnted__\r
-0000:d2ba __wcpp_4_ts_equiv__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(enterdb)\r
-0000:7db0 __EnterWVIDEO_\r
-0fd4:059c+ ___WD_Present\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(___argc)\r
-0fd4:0c60 ____Argv\r
-0fd4:0c64 ____Argc\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(amblksiz)\r
-0fd4:059e __amblksiz\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(sgdef086)\r
-0fd4:0a32 __Start_XI\r
-0fd4:0a80 __End_XI\r
-0fd4:0a80 __Start_YI\r
-0fd4:0a92 __End_YI\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(8087cw)\r
-0fd4:05a0 __8087cw\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(noefgfmt)\r
-0fd4:05a2 ___EFG_printf\r
-0fd4:05a6 ___EFG_scanf\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(efgfmt)\r
-0000:7de7 _EFG_Format_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(strtod)\r
-0000:84f0+ __Strtold_\r
-0000:869f strtod_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(ldclass)\r
-0000:884b __LDClass_\r
-0000:8899* _FLClass_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(efcvt)\r
-0000:88f6* ecvt_\r
-0000:8930 fcvt_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(save8087)\r
-0fd4:05aa ___Save8087\r
-0fd4:05ae ___Rest8087\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(grabfp87)\r
-0000:8973 __GrabFP87_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(pure_err)\r
-0000:d410 __wcpp_4_pure_error__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(vfun_err)\r
-0000:d440 __wcpp_4_undef_vfun__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfconde)\r
-0000:d470 far std::streambuf::streambuf()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfdsgtn)\r
-0000:d4e0 int far std::streambuf::do_sgetn( char far *, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfdspun)\r
-0000:d570 int far std::streambuf::do_sputn( char const far *, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfpbfai)\r
-0000:d640 int far std::streambuf::pbackfail( int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(sdfoverf)\r
-0000:d650 int far stdiobuf::overflow( int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(sdfundrf)\r
-0000:d870 int far stdiobuf::underflow()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfsbuf)\r
-0000:da00 std::streambuf far * far std::streambuf::setbuf( char far *, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfseeko)\r
-0000:da90 long far std::streambuf::seekoff( long, int, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfseekp)\r
-0000:daa0 long far std::streambuf::seekpos( long, int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(sdfsync)\r
-0000:dad0 int far stdiobuf::sync()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfdoall)\r
-0000:db00 int far std::streambuf::doallocate()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabmod)\r
-0000:db40 __wcpp_4_module_dtor__\r
-0000:db96 __wcpp_4_mod_register__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iosinit)\r
-0000:dbc0 void far std::ios::init( std::streambuf far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iosconde)\r
-0000:dc30 far std::ios::ios()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iosdestr)\r
-0000:dc50 far std::ios::~ios()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(opdel)\r
-0000:dd10 void far operator delete( void far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(dtorarst)\r
-0000:dd20 __wcpp_4_dtor_array_store__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(opdelarr)\r
-0000:dd50 void far operator delete []( void far * )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfdestr)\r
-0000:dd60 far std::streambuf::~streambuf()\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(flush)\r
-0000:89a5 __flush_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(memcpy)\r
-0000:8ad8 memcpy_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(opnewarr)\r
-0000:dd90 void far * far operator new []( int unsigned )\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(memset)\r
-0000:8afa memset_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(iosfail)\r
-0000:dda0 far std::ios::failure::failure( int )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabthrw)\r
-0000:e740+ far std::exception::exception()\r
-0000:e7a0+ far std::exception::exception( std::exception const far & )\r
-0000:e820+ far std::exception::exception( char const far * )\r
-0000:e880+ far std::exception::~exception()\r
-0000:e920+ char const far * far std::exception::what() const\r
-0000:e990+ far std::bad_exception::bad_exception()\r
-0000:ea10+ far std::bad_exception::bad_exception( std::bad_exception const far & )\r
-0000:ea70+ far std::bad_exception::~bad_exception()\r
-0000:e582* __wcpp_4_rethrow__\r
-0000:e5e4* __wcpp_4_catch_done__\r
-0000:e678 __wcpp_4_throw__\r
-0000:e6d6* __wcpp_4_throw_zero__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(initfile)\r
-0000:8b11 __InitFiles_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(ioexit)\r
-0000:8c67* fcloseall_\r
-0000:8c6e __full_io_exit_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fputc)\r
-0000:8c78 fputc_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(ioalloc)\r
-0000:8d48 __ioalloc_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(prtf)\r
-0000:8de3 __prtf_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(dointr)\r
-0000:9c0c _DoINTR_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(nmemneed)\r
-0000:9f85 __nmemneed_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(grownear)\r
-0000:a00d __LastFree_\r
-0000:a08a __ExpandDGROUP_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(hpgrw086)\r
-0000:a19b __CMain_nheapgrow_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(growseg)\r
-0000:a1a0 __GrowSeg_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(allocseg)\r
-0000:a292 __AllocSeg_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fmemneed)\r
-0000:a329 __fmemneed_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(bittest)\r
-0000:eb60 __wcpp_4_bit_test__\r
-0000:eb84 __wcpp_4_bit_off__\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(termnate)\r
-0000:ebb0 void far std::terminate()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(exc_pr)\r
-0000:ec10 far _EXC_PR::_EXC_PR( _RTCTL far *, RW_DTREG far *, EXCSTATE )\r
-0000:ec94 far _EXC_PR::~_EXC_PR()\r
-0000:ecb4 far _EXC_PR_FREE::_EXC_PR_FREE( _RTCTL far *, RW_DTREG far *, EXCSTATE, ACTIVE_EXC far * )\r
-0000:ece2 far _EXC_PR_FREE::~_EXC_PR_FREE()\r
-0000:ed24 far _EXC_PR_DTOR::_EXC_PR_DTOR( _RTCTL far *, RW_DTREG far *, EXCSTATE, ACTIVE_EXC far * )\r
-0000:ed46 far _EXC_PR_FNEXC::_EXC_PR_FNEXC( _RTCTL far *, RW_DTREG far *, RW_DTREG far *, ACTIVE_EXC far * )\r
-0000:ed94 far _EXC_PR_FNEXC::~_EXC_PR_FNEXC()\r
-0000:ed98 far _EXC_PR_DTOR::~_EXC_PR_DTOR()\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(areaexc)\r
-0fd4:05d0 ___EXC_AREA\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(tssize)\r
-0000:ede2 __wcpp_4_ts_size__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(strcmp)\r
-0000:a32c strcmp_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(istable)\r
-0fd4:0112 __IsTable\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(tolower)\r
-0000:a354 tolower_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(bufld086)\r
-0000:a362 __ZBuf2LD\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(seterrno)\r
-0000:a42a __set_errno_\r
-0000:a43e* __set_EDOM_\r
-0000:a450 __set_ERANGE_\r
-0000:a462* __set_EINVAL_\r
-0000:a477 __set_doserrno_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(inf_nan)\r
-0fd4:0214* ___f_infinity\r
-0fd4:0218* ___f_posqnan\r
-0fd4:021c ___d_infinity\r
-0fd4:0224 ___d_posqnan\r
-0fd4:022c* ___ld_infinity\r
-0fd4:0234* ___ld_posqnan\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(hugeval)\r
-0fd4:023c __HugeValue\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(cvtbuf)\r
-0000:a483 __CVTBuffer_\r
-Module: c:\fdos\WATCOM/lib286\math87l.lib(cvt)\r
-0000:a48a __cvt_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fpe87)\r
-0000:a528 __Init_FPE_handler_\r
-0000:a561 __Fini_FPE_handler_\r
-0000:a598* __FPEHandler\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(prwdata)\r
-0fd4:0e92 __wint_pure_error_flag\r
-0fd4:0e94 __wint_undef_vfun_flag\r
-0fd4:0e96 __wint_module_init\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fwrite)\r
-0000:a825 fwrite_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fflush)\r
-0000:aa20 fflush_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(memmove)\r
-0000:aa35 memmove_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fgetc)\r
-0000:aaab+ __fill_buffer_\r
-0000:ab7b+ __filbuf_\r
-0000:ab9f fgetc_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfsetb)\r
-0000:ee30 void far std::streambuf::setb( char far *, char far *, int )\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(liballoc)\r
-0000:ac40 _plib_malloc_\r
-0000:ac45 _plib_free_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ioufrxal)\r
-0000:eec0 void far __WATCOM_ios::free_xalloc_storage( std::ios far * )\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(lseekdos)\r
-0000:ac4a __lseek_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(qwrit)\r
-0000:ac88 __qwrite_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fsync)\r
-0000:ace5 fsync_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(opnew)\r
-0000:ef00 void far * far operator new( int unsigned )\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(unexpect)\r
-0000:ef80 void far std::unexpected()\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(setjmp)\r
-0000:acea* _setjmp_\r
-0000:ad3f longjmp_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stabinit)\r
-0000:f040 __wcpp_4_exc_setup__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(stack086)\r
-0000:ad9c stackavail_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ljmpinit)\r
-0fd4:0a6e ___wcpp_4_data_init_longjmp_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fclose)\r
-0000:adaa+ __doclose_\r
-0000:ae5d __shutdown_stream_\r
-0000:ae77* fclose_\r
-0fd4:0e9a+ ___RmTmpFileFn\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(freefp)\r
-0000:aec2 __freefp_\r
-0000:af3d __purgefp_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(chktty)\r
-0000:af7e __chktty_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(wctomb)\r
-0000:afa9 wctomb_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(itoa)\r
-0000:afd2+ utoa_\r
-0000:b02f itoa_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(lltoa)\r
-0000:b053 ulltoa_\r
-0000:b138* lltoa_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(strupr)\r
-0000:b19a strupr_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(ltoa)\r
-0000:b1bc ultoa_\r
-0000:b22b* ltoa_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(mbisdbcs)\r
-0fd4:0e9e ___IsDBCS\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(mbislead)\r
-0000:b25a* _ismbblead_\r
-0fd4:0ea0 ___MBCSIsTable\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(heapen)\r
-0000:b276* _heapenable_\r
-0fd4:09e6 ___heap_enabled\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(sbrk)\r
-0000:b287* sbrk_\r
-0000:b297 __brk_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(heapgrow)\r
-0000:b301* _heapgrow_\r
-0000:b301* _fheapgrow_\r
-0000:b302 _nheapgrow_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(errno)\r
-0000:b37c __get_errno_ptr_\r
-0000:b383 __get_doserrno_ptr_\r
-0fd4:0fa2+ _errno\r
-0fd4:0fa4+ __doserrno\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(fpeint)\r
-0fd4:09e8 ___FPE_int\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(flushall)\r
-0000:b3a2 __flushall_\r
-0000:b3ff flushall_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(gtche)\r
-0000:b404 getche_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(qread)\r
-0000:b41e __qread_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(dosret)\r
-0000:b43e* _dosretax_\r
-0000:b443* _dosret0_\r
-0000:b44a __set_errno_dos_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(iomode)\r
-0000:b4a8 __GetIOMode_\r
-0000:b4cd __SetIOMode_nogrow_\r
-0fd4:09fe+ ___NFiles\r
-0fd4:0a00+ ___init_mode\r
-0fd4:0a28+ ___io_mode\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(dosfile)\r
-0000:b4f0* _dos_close_\r
-0000:b4fe _dos_commit_\r
-0000:b50d* _dos_open_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(ljmphdl)\r
-0fd4:0a2c ___longjmp_handler\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(ljmpdtor)\r
-0000:f20e __wcpp_4_lj_handler__\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(_clse)\r
-0000:b533 __close_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(isatt)\r
-0000:b566 isatty_\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(alphabet)\r
-0fd4:00ec ___Alphabet\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(mbinit)\r
-0000:b5c4 __mbinit_\r
-0fd4:0a30+ ___MBCodePage\r
-Module: c:\fdos\WATCOM/lib286/dos\clibl.lib(doserror)\r
-0000:b6a0 __doserror_\r
-Module: c:\fdos\WATCOM/lib286\plbxl.lib(stfsync)\r
-0000:f220 int far std::streambuf::sync()\r
-\r
-\r
- +--------------------+\r
- | Libraries Used |\r
- +--------------------+\r
-\r
-c:\fdos\WATCOM/lib286/dos\clibl.lib\r
-c:\fdos\WATCOM/lib286\plbxl.lib\r
-c:\fdos\WATCOM/lib286\math87l.lib\r
-c:\fdos\WATCOM/lib286/dos\emu87.lib\r
-\r
-\r
- +-----------------------+\r
- | Linker Statistics |\r
- +-----------------------+\r
-\r
-Stack size: 0800 (2048.)\r
-Memory size: 000114f0 (70896.)\r
-Entry point address: 0000:3360\r
-Link time: 00:01.73\r
/* Thanks to Alex Russell for example code */
-/* Thanks to Gary Neal for example code */\r
-#include "src\lib\dos_comm.h"
+/* Thanks to Gary Neal for example code */
+#include "dos_kb.h"
// keyboard buffer
static byte key[NUM_SCANCODES]; // pressed
static byte kea[NUM_SCANCODES]; // released
-#ifdef __cplusplus /* Function must be declared C style */\r
-extern "C" {\r
+#ifdef __cplusplus /* Function must be declared C style */
+extern "C" {
#endif
static void interrupt (far *oldkb)(void) = NULL; /* BIOS keyboard handler */
-#ifdef __cplusplus\r
-}\r
-#endif\r
-/*****************NEW KEYBOARD 09h ISR***********************/\r
+#ifdef __cplusplus
+}
+#endif
+
+/*
+ * Comment out the following #define if you don't want the testing main()
+ * to be included.
+ */
+//#define TESTING
+#define TESTING2
+
+/*****************NEW KEYBOARD 09h ISR***********************/
void interrupt newkb(void){
byte kee;
- register char qx;\r
+ register char qx;
kee = inp(0x60); /* Read the keyboard scan code */
- /* Clear keyboard controller on XT machines */\r
- qx = inp(0x61); /* Get keyboard control register */\r
- qx |= 0x82;\r
- outp(0x61, qx); /* Toggle acknowledge bit high */\r
- qx &= 0x7F;\r
- outp(0x61, qx); /* Toggle acknowledge bit low */
+ /* Clear keyboard controller on XT machines */
+ qx = inp(0x61); /* Get keyboard control register */
+ qx |= 0x82;
+ outp(0x61, qx); /* Toggle acknowledge bit high */
+ qx &= 0x7F;
+ outp(0x61, qx); /* Toggle acknowledge bit low */
/* Interpret the scan code and set our flags */
-//tt
- printf("%d[%d]\n",kee,key[kee]);
- if(kee & 0x80)\r
- key[kee & 0x7F] = 0; // a key is released\r
- else\r
+ #ifdef TESTING2
+ //printf("%d[%d]\n",kee,key[kee]);
+ printf("\0"); // bug
+ #endif
+ if(kee & 0x80)
+ key[kee & 0x7F] = 0; // a key is released
+ else
key[kee] = kea[kee] = 1; // a key is pressed
- /* Acknowledge the interrupt to the programmable interrupt controller */\r
- outp(0x20, 0x20); /* Signal non specific end of interrupt */\r
-}\r
-\r
-/* ---------------------- init_keyboard() ---------------- April 17,1993 */\r
-/* restore the bios keyboard handler */\r
-/* ---------------------- deinit_keyboard() -------------- April 17,1993 */\r
+ /* Acknowledge the interrupt to the programmable interrupt controller */
+ outp(0x20, 0x20); /* Signal non specific end of interrupt */
+}
+
+/* ---------------------- init_keyboard() ---------------- April 17,1993 */
+/* restore the bios keyboard handler */
+/* ---------------------- deinit_keyboard() -------------- April 17,1993 */
void setkb(int vq){
- int i; /* Index variable */\r
+ int i; /* Index variable */
if(!vq){ // deinitiation
- /* Abort if our function pointer has no valid address */\r
+ /* Abort if our function pointer has no valid address */
if(oldkb == NULL) return;
/* Set address in our function pointer in interrupt vector table */
_dos_setvect(9, oldkb);
- /* Reset our function pointer to contain no valid address */\r
+ /* Reset our function pointer to contain no valid address */
oldkb = NULL;
+ #ifdef TESTING
/* Print the key heap */
printf("\n");
for(i=0; i<NUM_SCANCODES; i++){
if(key[i]==1)printf("====");
printf(",\n");
}
+ #endif
}else if(vq == 1){ // initiation
byte far *lock_key;
- /* Abort if our function pointer has a valid address. */\r
- if(oldkb != NULL) return;\r
+ /* Abort if our function pointer has a valid address. */
+ if(oldkb != NULL) return;
- /* Clear the keyboard buttons state arrays */\r
- for(i = 0; i < NUM_SCANCODES; i++)\r
+ /* Clear the keyboard buttons state arrays */
+ for(i = 0; i < NUM_SCANCODES; i++)
key[i] = kea[i] = 0;
-\r
- /* save old BIOS key board handler */\r
- oldkb = _dos_getvect(9);\r
-\r
- // turn off num-lock via BIOS\r
- lock_key = MK_FP(0x040, 0x017); // Pointing to the address of the bios shift state keys\r
- *lock_key&=(~(16 | 32 | 64)); // toggle off the locks by changing the values of the 4th, 5th, and 6th bits of the address byte of 0040:0017\r
- oldkb(); // call BIOS keyhandler to change keyboard lights\r
-
- /* setup our own handler */\r
- _dos_setvect(9, newkb);\r
- }\r
-}\r
-\r
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\r
- * keyp *\r
- * *\r
- * Returns the status of the key requested. *\r
- * The status is 1 if the key is pressed or has been pressed since the *\r
- * last call to this function for that particular key. *\r
-\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\r
-int keyp(byte c){\r
- register char retVal;\r
-\r
- /* Key value in range of keyboard keys available */\r
- c &= 0x7F;\r
-
- /* Get the status of the key requested */\r
- retVal = key[c] | kea[c];\r
-\r
- /* Reset the was pressed status for the requested key */\r
+
+ /* save old BIOS key board handler */
+ oldkb = _dos_getvect(9);
+
+ // turn off num-lock via BIOS
+ lock_key = MK_FP(0x040, 0x017); // Pointing to the address of the bios shift state keys
+ *lock_key&=(~(16 | 32 | 64)); // toggle off the locks by changing the values of the 4th, 5th, and 6th bits of the address byte of 0040:0017
+ oldkb(); // call BIOS keyhandler to change keyboard lights
+
+ /* setup our own handler */
+ _dos_setvect(9, newkb);
+ }
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
+ * keyp *
+ * *
+ * Returns the status of the key requested. *
+ * The status is 1 if the key is pressed or has been pressed since the *
+ * last call to this function for that particular key. *
+\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+int keyp(byte c){
+ register char retVal;
+
+ /* Key value in range of keyboard keys available */
+ c &= 0x7F;
+
+ /* Get the status of the key requested */
+ retVal = key[c] | kea[c];
+
+ /* Reset the was pressed status for the requested key */
kea[c] = 0;
- /* Return the requested key's state */\r
- return retVal;\r
-}\r
+ /* Return the requested key's state */
+ return retVal;
+}
+
+
+/*
+ * The library testing routines follows below.
+ */
+
+#ifdef TESTING
+
+/*
+ * Library test (program) entry point.
+ */
+
+void main(void)
+{
+ byte q;
+ setkb(1);
+ while(!keyp(1))
+ {
+ keyp(q);
+ }
+ setkb(0);
+}
+
+#endif
-#ifndef _DOSLIB_COMM_H_\r
-#define _DOSLIB_COMM_H_\r
-#include "src\lib\lib_com.h"
-
+#ifndef _DOSLIB_KB_H_\r
+#define _DOSLIB_KB_H_\r
+#include "lib\lib_head.h"\r
+\r
/* Maximum number of scan codes on keyboard controllers */\r
-#define NUM_SCANCODES 128
-
+#define NUM_SCANCODES 128\r
+\r
#ifdef __cplusplus /* Functions must be declared C style */\r
extern "C" {\r
#endif\r
void interrupt far newkb(void);\r
-//extern void interrupt (far *oldkb)(void);
+//extern void interrupt (far *oldkb)(void);\r
void setkb(int vq);\r
-int keyp(byte c);
-
+int keyp(byte c);\r
+\r
/* Define macro */\r
-//#define kepn(c) key[c & 0x7F]
-
+//#define kepn(c) key[c & 0x7F]\r
+\r
#ifdef __cplusplus\r
}\r
-#endif
+#endif\r
\r
-#endif/*_DOSLIB_COMM_H_*/
+#endif/*_DOSLIB_KB_H_*/\r
-//#include "src\lib\lib_com.h"
-#include "lib\lib_com.h"
+//#include "src\lib\lib_head.h"
+#include "lib\lib_head.h"
\r
/* local function */\r
void wait(clock_t wait);\r
-#ifndef _LIBCOM_H_\r
-#define _LIBCOM_H_\r
+#ifndef _LIBHEAD_H_\r
+#define _LIBHEAD_H_\r
#include <dos.h>\r
#include <stdio.h>\r
#include <conio.h> // just for wait\r
-#include <time.h> // just for wait\r
+#include <time.h> // just for wait
+#include "types.h"\r
\r
/* Control codes for all keys on the keyboard */\r
//here temperarly\r
#define KEY_MENU (0x75)\r
\r
\r
-typedef unsigned char byte;\r
+//typedef unsigned char byte;
+//typedef unsigned int word;
+//typedef unsigned short syte;\r
\r
void wait(clock_t wait);\r
\r
-#endif/*_LIBCOM_H_*/\r
+#endif/*_LIBHEAD_H_*/\r
--- /dev/null
+FLAGS=-0 \r
+all: test.exe pcxtest.exe test2.exe scroll.exe\r
+\r
+scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj\r
+ wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj\r
+scroll.obj: scroll.c\r
+ wcl $(FLAGS) -c scroll.c\r
+test.exe: test.obj modex16.obj bitmap.obj\r
+ wcl $(FLAGS) test.obj modex16.obj bitmap.obj\r
+ \r
+test2.exe: test2.obj modex16.obj bitmap.obj\r
+ wcl $(FLAGS) test2.obj modex16.obj bitmap.obj\r
+ \r
+pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj\r
+ wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj\r
+\r
+test.obj: test.c modex16.h\r
+ wcl $(FLAGS) -c test.c\r
+ \r
+test2.obj: test2.c modex16.h\r
+ wcl $(FLAGS) -c test2.c\r
+ \r
+pcxtest.obj: pcxtest.c modex16.h\r
+ wcl $(FLAGS) -c pcxtest.c\r
+\r
+modex16.obj: modex16.h modex16.c\r
+ wcl $(FLAGS) -c modex16.c\r
+\r
+dos_kb.obj: dos_kb.h dos_kb.c\r
+ wcl $(FLAGS) -c dos_kb.c\r
+\r
+bitmap.obj: bitmap.h bitmap.c\r
+ wcl $(FLAGS) -c bitmap.c\r
+ \r
+clean: \r
+ del *.obj\r
+ del *.exe\r
--- /dev/null
+#include <dos.h>\r
+#include <string.h>\r
+#include <mem.h>\r
+#include <conio.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "modex16.h"\r
+\r
+\r
+byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */\r
+\r
+static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette);\r
+static byte tmppal[PAL_SIZE];\r
+\r
+static void\r
+vgaSetMode(byte mode)\r
+{\r
+ union REGS regs;\r
+\r
+ regs.h.ah = SET_MODE;\r
+ regs.h.al = mode;\r
+ int86(VIDEO_INT, ®s, ®s);\r
+}\r
+\r
+\r
+/* -========================= Entry Points ==========================- */\r
+void\r
+modexEnter() {\r
+ word i;\r
+ dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */\r
+ word CRTParms[] = {\r
+ 0x0d06, /* vertical total */\r
+ 0x3e07, /* overflow (bit 8 of vertical counts) */\r
+ 0x4109, /* cell height (2 to double-scan */\r
+ 0xea10, /* v sync start */\r
+ 0xac11, /* v sync end and protect cr0-cr7 */\r
+ 0xdf12, /* vertical displayed */\r
+ 0x0014, /* turn off dword mode */\r
+ 0xe715, /* v blank start */\r
+ 0x0616, /* v blank end */\r
+ 0xe317 /* turn on byte mode */\r
+ };\r
+ int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]);\r
+\r
+ /* TODO save current video mode and palette */\r
+ vgaSetMode(VGA_256_COLOR_MODE);\r
+\r
+ /* disable chain4 mode */\r
+ outpw(SC_INDEX, 0x0604);\r
+\r
+ /* synchronous reset while setting Misc Output */\r
+ outpw(SC_INDEX, 0x0100);\r
+\r
+ /* select 25 MHz dot clock & 60 Hz scanning rate */\r
+ outp(MISC_OUTPUT, 0xe3);\r
+\r
+ /* undo reset (restart sequencer) */\r
+ outpw(SC_INDEX, 0x0300);\r
+\r
+ /* reprogram the CRT controller */\r
+ outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */\r
+ outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */\r
+\r
+ /* send the CRTParms */\r
+ for(i=0; i<CRTParmCount; i++) {\r
+ outpw(CRTC_INDEX, CRTParms[i]);\r
+ }\r
+\r
+ /* clear video memory */\r
+ outpw(SC_INDEX, 0x0f02);\r
+ for(i=0; i<0x8000; i++) {\r
+ ptr[i] = 0x0000;\r
+ }\r
+}\r
+\r
+\r
+void\r
+modexLeave() {\r
+ /* TODO restore original mode and palette */\r
+ vgaSetMode(TEXT_MODE);\r
+}\r
+\r
+\r
+page_t\r
+modexDefaultPage() {\r
+ page_t page;\r
+\r
+ /* default page values */\r
+ page.data = VGA;\r
+ page.dx = 0;\r
+ page.dy = 0;\r
+ page.width = SCREEN_WIDTH;\r
+ page.height = SCREEN_HEIGHT;\r
+\r
+ return page;\r
+}\r
+\r
+/* returns the next page in contiguous memory\r
+ * the next page will be the same size as p, by default\r
+ */\r
+page_t\r
+modexNextPage(page_t *p) {\r
+ page_t result;\r
+\r
+ result.data = p->data + (p->width/4)*p->height; /* compute the offset */\r
+ result.dx = 0;\r
+ result.dy = 0;\r
+ result.width = p->width;\r
+ result.height = p->height;\r
+\r
+ return result;\r
+}\r
+\r
+\r
+void\r
+modexShowPage(page_t *page) {\r
+ word high_address;\r
+ word low_address;\r
+ word offset;\r
+ byte crtcOffset;\r
+\r
+ /* calculate offset */\r
+ offset = (word) page->data;\r
+ offset += page->dy * (page->width >> 2 );\r
+ offset += page->dx >> 2;\r
+\r
+ /* calculate crtcOffset according to virtual width */\r
+ crtcOffset = page->width >> 3;\r
+\r
+ high_address = HIGH_ADDRESS | (offset & 0xff00);\r
+ low_address = LOW_ADDRESS | (offset << 8);\r
+\r
+ /* wait for appropriate timing and then program CRTC */\r
+ while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
+ outpw(CRTC_INDEX, high_address);\r
+ outpw(CRTC_INDEX, low_address);\r
+ outp(CRTC_INDEX, 0x13);\r
+ outp(CRTC_DATA, crtcOffset);\r
+\r
+ /* wait for one retrace */\r
+ while (!(inp(INPUT_STATUS_1) & VRETRACE)); \r
+\r
+ /* do PEL panning here */\r
+ outp(AC_INDEX, 0x33);\r
+ outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+}\r
+\r
+\r
+void\r
+modexPanPage(page_t *page, int dx, int dy) {\r
+ page->dx = dx;\r
+ page->dy = dy;\r
+}\r
+\r
+\r
+void\r
+modexSelectPlane(byte plane) {\r
+ outp(SC_INDEX, MAP_MASK); /* select plane */\r
+ outp(SC_DATA, plane);\r
+}\r
+\r
+\r
+void\r
+modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) {\r
+ word pageOff = (word) page->data;\r
+ word xoff=x/4; /* xoffset that begins each row */\r
+ word scanCount=w/4; /* number of iterations per row (excluding right clip)*/\r
+ word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */\r
+ word nextRow = page->width/4-scanCount-1; /* loc of next row */\r
+ byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */\r
+ byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
+ byte left = lclip[x&0x03];\r
+ byte right = rclip[(x+w)&0x03];\r
+\r
+ /* handle the case which requires an extra group */\r
+ if((x & 0x03) && !((x+w) & 0x03)) {\r
+ right=0x0f;\r
+ }\r
+\r
+ __asm {\r
+ MOV AX, SCREEN_SEG ; go to the VGA memory\r
+ MOV ES, AX\r
+ MOV DI, poffset ; go to the first pixel\r
+ MOV DX, SC_INDEX ; point to the map mask\r
+ MOV AL, MAP_MASK\r
+ OUT DX, AL\r
+ INC DX\r
+ MOV AL, color ; get ready to write colors\r
+ SCAN_START:\r
+ MOV CX, scanCount ; count the line\r
+ MOV BL, AL ; remember color\r
+ MOV AL, left ; do the left clip\r
+ OUT DX, AL ; set the left clip\r
+ MOV AL, BL ; restore color\r
+ STOSB ; write the color\r
+ DEC CX\r
+ JZ SCAN_DONE ; handle 1 group stuff\r
+\r
+ ;-- write the main body of the scanline\r
+ MOV BL, AL ; remember color\r
+ MOV AL, 0x0f ; write to all pixels\r
+ OUT DX, AL\r
+ MOV AL, BL ; restore color\r
+ REP STOSB ; write the color\r
+ SCAN_DONE:\r
+ MOV BL, AL ; remeber color\r
+ MOV AL, right\r
+ OUT DX, AL ; do the right clip\r
+ MOV AL, BL ; restore color\r
+ STOSB ; write pixel\r
+ ADD DI, nextRow ; go to the next row\r
+ DEC h\r
+ JNZ SCAN_START\r
+ }\r
+}\r
+\r
+\r
+void\r
+modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) {\r
+ /* draw the region (the entire freakin bitmap) */\r
+ modexDrawBmpRegion(page, x, y, 0, 0, bmp->width, bmp->height, bmp);\r
+}\r
+\r
+\r
+void\r
+modexDrawBmpRegion(page_t *page, int x, int y,\r
+ int rx, int ry, int rw, int rh, bitmap_t *bmp) {\r
+ word poffset = (word) page->data + y*(page->width/4) + x/4;\r
+ byte *data = bmp->data;\r
+ word bmpOffset = (word) data + ry * bmp->width + rx;\r
+ word width = rw;\r
+ word height = rh;\r
+ byte plane = 1 << ((byte) x & 0x03);\r
+ word scanCount = width/4 + (width%4 ? 1 :0);\r
+ word nextPageRow = page->width/4 - scanCount;\r
+ word nextBmpRow = (word) bmp->width - width;\r
+ word rowCounter;\r
+ byte planeCounter = 4;\r
+\r
+ __asm {\r
+ MOV AX, SCREEN_SEG ; go to the VGA memory\r
+ MOV ES, AX\r
+\r
+ MOV DX, SC_INDEX ; point at the map mask register\r
+ MOV AL, MAP_MASK ;\r
+ OUT DX, AL ;\r
+\r
+ PLANE_LOOP:\r
+ MOV DX, SC_DATA ; select the current plane\r
+ MOV AL, plane ;\r
+ OUT DX, AL ;\r
+\r
+ ;-- begin plane painting\r
+ MOV AX, height ; start the row counter\r
+ MOV rowCounter, AX ; \r
+ MOV DI, poffset ; go to the first pixel\r
+ MOV SI, bmpOffset ; go to the bmp pixel\r
+ ROW_LOOP:\r
+ MOV CX, width ; count the columns\r
+ SCAN_LOOP:\r
+ MOVSB ; copy the pixel\r
+ SUB CX, 3 ; we skip the next 3\r
+ ADD SI, 3 ; skip the bmp pixels\r
+ LOOP SCAN_LOOP ; finish the scan\r
+\r
+ MOV AX, nextPageRow\r
+ ADD DI, AX ; go to the next row on screen\r
+ MOV AX, nextBmpRow\r
+ ADD SI, AX ; go to the next row on bmp\r
+\r
+ DEC rowCounter\r
+ JNZ ROW_LOOP ; do all the rows\r
+ ;-- end plane painting\r
+\r
+ MOV AL, plane ; advance to the next plane\r
+ SHL AL, 1 ;\r
+ AND AL, 0x0f ; mask the plane properly\r
+ MOV plane, AL ; store the plane\r
+\r
+ INC bmpOffset ; start bmp at the right spot\r
+\r
+ DEC planeCounter\r
+ JNZ PLANE_LOOP ; do all 4 planes\r
+ }\r
+}\r
+\r
+\r
+void\r
+modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp) {\r
+ /* draw the whole sprite */\r
+ modexDrawSpriteRegion(page, x, y, 0, 0, bmp->width, bmp->height, bmp);\r
+}\r
+\r
+void\r
+modexDrawSpriteRegion(page_t *page, int x, int y,\r
+ int rx, int ry, int rw, int rh, bitmap_t *bmp) {\r
+ word poffset = (word)page->data + y*(page->width/4) + x/4;\r
+ byte *data = bmp->data;\r
+ word bmpOffset = (word) data + ry * bmp->width + rx;\r
+ word width = rw;\r
+ word height = rh;\r
+ byte plane = 1 << ((byte) x & 0x03);\r
+ word scanCount = width/4 + (width%4 ? 1 :0);\r
+ word nextPageRow = page->width/4 - scanCount;\r
+ word nextBmpRow = (word) bmp->width - width;\r
+ word rowCounter;\r
+ byte planeCounter = 4;\r
+\r
+ __asm {\r
+ MOV AX, SCREEN_SEG ; go to the VGA memory\r
+ MOV ES, AX\r
+\r
+ MOV DX, SC_INDEX ; point at the map mask register\r
+ MOV AL, MAP_MASK ;\r
+ OUT DX, AL ;\r
+\r
+ PLANE_LOOP:\r
+ MOV DX, SC_DATA ; select the current plane\r
+ MOV AL, plane ;\r
+ OUT DX, AL ;\r
+\r
+ ;-- begin plane painting\r
+ MOV AX, height ; start the row counter\r
+ MOV rowCounter, AX ; \r
+ MOV DI, poffset ; go to the first pixel\r
+ MOV SI, bmpOffset ; go to the bmp pixel\r
+ ROW_LOOP:\r
+ MOV CX, width ; count the columns\r
+ SCAN_LOOP:\r
+ LODSB\r
+ DEC SI\r
+ CMP AL, 0\r
+ JNE DRAW_PIXEL ; draw non-zero pixels\r
+\r
+ INC DI ; skip the transparent pixel\r
+ ADD SI, 1\r
+ JMP NEXT_PIXEL\r
+ DRAW_PIXEL:\r
+ MOVSB ; copy the pixel\r
+ NEXT_PIXEL:\r
+ SUB CX, 3 ; we skip the next 3\r
+ ADD SI, 3 ; skip the bmp pixels\r
+ LOOP SCAN_LOOP ; finish the scan\r
+\r
+ MOV AX, nextPageRow\r
+ ADD DI, AX ; go to the next row on screen\r
+ MOV AX, nextBmpRow\r
+ ADD SI, AX ; go to the next row on bmp\r
+\r
+ DEC rowCounter\r
+ JNZ ROW_LOOP ; do all the rows\r
+ ;-- end plane painting\r
+\r
+ MOV AL, plane ; advance to the next plane\r
+ SHL AL, 1 ;\r
+ AND AL, 0x0f ; mask the plane properly\r
+ MOV plane, AL ; store the plane\r
+\r
+ INC bmpOffset ; start bmp at the right spot\r
+\r
+ DEC planeCounter\r
+ JNZ PLANE_LOOP ; do all 4 planes\r
+ }\r
+}\r
+\r
+\r
+/* copy a region of video memory from one page to another.\r
+ * It assumes that the left edge of the tile is the same on both\r
+ * regions and the memory areas do not overlap.\r
+ */\r
+void\r
+modexCopyPageRegion(page_t *dest, page_t *src,\r
+ word sx, word sy,\r
+ word dx, word dy,\r
+ word width, word height)\r
+{\r
+ word doffset = (word)dest->data + dy*(dest->width/4) + dx/4;\r
+ word soffset = (word)src->data + sy*(src->width/4) + sx/4;\r
+ word scans = width/4;\r
+ word nextSrcRow = src->width/4 - scans - 1;\r
+ word nextDestRow = dest->width/4 - scans - 1;\r
+ byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */\r
+ byte rclip[] = {0x0f, 0x01, 0x03, 0x07};\r
+ byte left = lclip[sx&0x03];\r
+ byte right = rclip[(sx+width)&0x03];\r
+\r
+ __asm {\r
+ MOV AX, SCREEN_SEG ; work in the vga space\r
+ MOV ES, AX ;\r
+ MOV DI, doffset ;\r
+ MOV SI, soffset ;\r
+\r
+ MOV DX, GC_INDEX ; turn off cpu bits\r
+ MOV AX, 0008h ;\r
+ OUT DX, AX\r
+\r
+ MOV AX, SC_INDEX ; point to the mask register\r
+ MOV DX, AX ;\r
+ MOV AL, MAP_MASK ;\r
+ OUT DX, AL ;\r
+ INC DX ;\r
+\r
+ ROW_START:\r
+ PUSH DS\r
+ MOV AX, ES\r
+ MOV DS, AX\r
+ MOV CX, scans ; the number of latches\r
+\r
+ MOV AL, left ; do the left column\r
+ OUT DX, AL ;\r
+ MOVSB ;\r
+ DEC CX ;\r
+\r
+ MOV AL, 0fh ; do the inner columns\r
+ OUT DX, AL\r
+ REP MOVSB ; copy the pixels\r
+\r
+ MOV AL, right ; do the right column\r
+ OUT DX, AL\r
+ MOVSB\r
+ POP DS\r
+\r
+ MOV AX, SI ; go the start of the next row\r
+ ADD AX, nextSrcRow ;\r
+ MOV SI, AX ;\r
+ MOV AX, DI ;\r
+ ADD AX, nextDestRow ;\r
+ MOV DI, AX ;\r
+\r
+ DEC height ; do the rest of the actions\r
+ JNZ ROW_START ;\r
+\r
+ MOV DX, GC_INDEX+1 ; go back to CPU data\r
+ MOV AL, 0ffh ; none from latches\r
+ OUT DX, AL ;\r
+ }\r
+}\r
+\r
+\r
+/* fade and flash */\r
+void\r
+modexFadeOn(word fade, byte *palette) {\r
+ fadePalette(-fade, 64, 64/fade+1, palette);\r
+}\r
+\r
+\r
+void\r
+modexFadeOff(word fade, byte *palette) {\r
+ fadePalette(fade, 0, 64/fade+1, palette);\r
+}\r
+\r
+\r
+void\r
+modexFlashOn(word fade, byte *palette) {\r
+ fadePalette(fade, -64, 64/fade+1, palette);\r
+}\r
+\r
+\r
+void\r
+modexFlashOff(word fade, byte *palette) {\r
+ fadePalette(-fade, 0, 64/fade+1, palette);\r
+}\r
+\r
+\r
+static void\r
+fadePalette(sbyte fade, sbyte start, word iter, byte *palette) {\r
+ word i;\r
+ byte dim = start;\r
+\r
+ /* handle the case where we just update */\r
+ if(iter == 0) {\r
+ modexPalUpdate(palette);\r
+ return;\r
+ }\r
+\r
+ while(iter > 0) { /* FadeLoop */\r
+ for(i=0; i<PAL_SIZE; i++) { /* loadpal_loop */\r
+ tmppal[i] = palette[i] - dim;\r
+ if(tmppal[i] > 127) {\r
+ tmppal[i] = 0;\r
+ } else if(tmppal[i] > 63) {\r
+ tmppal[i] = 63;\r
+ }\r
+ }\r
+ modexPalUpdate(tmppal);\r
+ iter--;\r
+ dim += fade;\r
+ }\r
+}\r
+\r
+\r
+/* save and load */\r
+void\r
+modexPalSave(byte *palette) {\r
+ int i;\r
+\r
+ outp(PAL_READ_REG, 0); /* start at palette entry 0 */\r
+ for(i=0; i<PAL_SIZE; i++) {\r
+ palette[i] = inp(PAL_DATA_REG); /* read the palette data */\r
+ }\r
+}\r
+\r
+\r
+byte *\r
+modexNewPal() {\r
+ byte *ptr;\r
+ ptr = malloc(PAL_SIZE);\r
+\r
+ /* handle errors */\r
+ if(!ptr) {\r
+ printf("Could not allocate palette.\n");\r
+ exit(-1);\r
+ }\r
+\r
+ return ptr;\r
+}\r
+\r
+\r
+void\r
+modexLoadPalFile(byte *filename, byte **palette) {\r
+ FILE *file;\r
+ byte *ptr;\r
+\r
+ /* free the palette if it exists */\r
+ if(*palette) {\r
+ free(*palette);\r
+ }\r
+\r
+ /* allocate the new palette */\r
+ *palette = modexNewPal();\r
+\r
+ /* open the file */\r
+ file = fopen(filename, "rb");\r
+ if(!file) {\r
+ printf("Could not open palette file: %s\n", filename);\r
+ exit(-2);\r
+ }\r
+\r
+ /* read the file */\r
+ ptr = *palette;\r
+ while(!feof(file)) {\r
+ *ptr++ = fgetc(file);\r
+ }\r
+\r
+ fclose(file);\r
+}\r
+\r
+\r
+void\r
+modexSavePalFile(char *filename, byte *pal) {\r
+ unsigned int i;\r
+ FILE *file;\r
+\r
+ /* open the file for writing */\r
+ file = fopen(filename, "wb");\r
+ if(!file) {\r
+ printf("Could not open %s for writing\n", filename);\r
+ exit(-2);\r
+ }\r
+\r
+ /* write the data to the file */\r
+ fwrite(pal, 1, PAL_SIZE, file);\r
+ fclose(file);\r
+}\r
+\r
+\r
+/* blanking */\r
+void\r
+modexPalBlack() {\r
+ fadePalette(-1, 64, 1, tmppal);\r
+}\r
+\r
+\r
+void\r
+modexPalWhite() {\r
+ fadePalette(-1, -64, 1, tmppal);\r
+}\r
+\r
+\r
+/* utility */\r
+void\r
+modexPalUpdate(byte *p) {\r
+ int i;\r
+ modexWaitBorder();\r
+ outp(PAL_WRITE_REG, 0); /* start at the beginning of palette */\r
+ for(i=0; i<PAL_SIZE/2; i++) {\r
+ outp(PAL_DATA_REG, p[i]);\r
+ }\r
+ modexWaitBorder(); /* waits one retrace -- less flicker */\r
+ for(i=PAL_SIZE/2; i<PAL_SIZE; i++) {\r
+ outp(PAL_DATA_REG, p[i]);\r
+ }\r
+}\r
+\r
+\r
+void\r
+modexWaitBorder() {\r
+ while(inp(INPUT_STATUS_1) & 8) {\r
+ /* spin */\r
+ }\r
+\r
+ while(!(inp(INPUT_STATUS_1) & 8)) {\r
+ /* spin */\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Functions for handling modex and doing other basic graphics stuff.\r
+ */\r
+#ifndef MODEX16_H\r
+#define MODEX16_H\r
+#include <conio.h>\r
+#include "types.h"\r
+#include "bitmap.h"\r
+\r
+/* -========================== Types & Macros ==========================- */\r
+#define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2))\r
+#define PLANE(x) (1<< (x&3))\r
+#define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02)\r
+\r
+typedef struct {\r
+ byte far* data; /* the data for the page */\r
+ word dx; /* col we are viewing on the virtual screen */\r
+ word dy; /* row we are viewing on the virtual screen */\r
+ word width; /* virtual width of the page */\r
+ word height; /* virtual height of the page */\r
+} page_t;\r
+\r
+/* -============================ Functions =============================- */\r
+/* mode switching, page, and plane functions */\r
+void modexEnter();\r
+void modexLeave();\r
+page_t modexDefaultPage();\r
+page_t modexNextPage(page_t *p);\r
+void modexShowPage(page_t *page);\r
+void modexPanPage(page_t *page, int dx, int dy);\r
+void modexSelectPlane(byte plane);\r
+void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color);\r
+void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp);\r
+void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp);\r
+void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+\r
+/* Palette fade and flash effects */\r
+void modexFadeOn(word fade, byte *palette);\r
+void modexFadeOff(word fade, byte *palette);\r
+void modexFlashOn(word fade, byte *palette);\r
+void modexFlashOff(word fade, byte *palette);\r
+\r
+/* palette loading and saving */\r
+void modexPalSave(byte *palette);\r
+byte *modexNewPal();\r
+void modexLoadPalFile(char *filename, byte **palette);\r
+void modexSavePalFile(char *filename, byte *palette);\r
+\r
+/* fixed palette functions */\r
+void modexPalBlack();\r
+void modexPalWhite();\r
+\r
+/* utility functions */\r
+void modexPalUpdate(byte *p);\r
+void modexWaitBorder();\r
+\r
+/* -======================= Constants & Vars ==========================- */\r
+extern byte far* VGA; /* The VGA Memory */\r
+#define SCREEN_SEG 0xa000\r
+#define VIDEO_INT 0x10\r
+#define SET_MODE 0x00\r
+#define VGA_256_COLOR_MODE 0x13\r
+#define TEXT_MODE 0x03\r
+#define SCREEN_WIDTH 320\r
+#define SCREEN_HEIGHT 240\r
+#define PAGE_SIZE (word)(SCREEN_WIDTH/4 * SCREEN_HEIGHT)\r
+\r
+#define AC_INDEX 0x03c0\r
+#define SC_INDEX 0x03c4\r
+#define SC_DATA 0x03c5\r
+#define CRTC_INDEX 0x03d4\r
+#define CRTC_DATA 0x03d5\r
+#define GC_INDEX 0x03ce\r
+#define MISC_OUTPUT 0x03c2\r
+#define HIGH_ADDRESS 0x0C\r
+#define LOW_ADDRESS 0x0D\r
+#define VRETRACE 0x08\r
+#define INPUT_STATUS_1 0x03da\r
+#define DISPLAY_ENABLE 0x01\r
+#define MAP_MASK 0x02\r
+#define PAL_READ_REG 0x03C7 /* Color register, read address */\r
+#define PAL_WRITE_REG 0x03C8 /* Color register, write address */\r
+#define PAL_DATA_REG 0x03C9 /* Color register, data port */\r
+#define PAL_SIZE (256 * 3)\r
+#endif\r
--- /dev/null
+#include "modex16.h"\r
+\r
+void\r
+main() {\r
+ byte *pal;\r
+\r
+ modexEnter();\r
+\r
+ pal = modexNewPal();\r
+ modexPalSave(pal);\r
+\r
+ modexSavePalFile("gfx.pal", pal);\r
+\r
+ modexLeave();\r
+\r
+}\r
--- /dev/null
+#include <stdio.h>\r
+#include "modex16.h"\r
+#include "bitmap.h"\r
+\r
+word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
+void\r
+oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {\r
+ byte plane;\r
+ word px, py;\r
+ word offset;\r
+\r
+ /* TODO Make this fast. It's SLOOOOOOW */\r
+ for(plane=0; plane < 4; plane++) {\r
+ modexSelectPlane(PLANE(plane+x));\r
+ for(px = plane; px < bmp->width; px+=4) {\r
+ offset=px;\r
+ for(py=0; py<bmp->height; py++) {\r
+ if(!sprite || bmp->data[offset])\r
+ page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
+ offset+=bmp->width;\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+void main() {\r
+ bitmap_t bmp;\r
+ int i;\r
+ page_t page;\r
+ word start;\r
+ float t1, t2;\r
+\r
+ page=modexDefaultPage();\r
+\r
+ bmp = bitmapLoadPcx("46113319.pcx");\r
+ modexEnter();\r
+\r
+ /* fix up the palette and everything */\r
+ modexPalUpdate(bmp.palette);\r
+\r
+ /* clear and draw one sprite and one bitmap */\r
+ modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
+\r
+ /* non sprite comparison */\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
+ }\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ modexDrawBmp(&page, 20, 20, &bmp);\r
+ }\r
+ t1 = (*clock-start) /18.2;\r
+\r
+ start = *clock;\r
+ for(i=0; i<100; i++) {\r
+ modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);\r
+ }\r
+ t2 = (*clock-start)/18.2;\r
+\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ oldDrawBmp(VGA, 20, 20, &bmp, 1);\r
+ }\r
+\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ modexDrawSprite(&page, 20, 20, &bmp);\r
+ }\r
+ modexLeave();\r
+\r
+ printf("CPU to VGA: %f\n", t1);\r
+ printf("VGA to VGA: %f\n", t2);\r
+ return;\r
+}\r
+++ /dev/null
-wmake clean
+++ /dev/null
-wsample core16.exe\r
-setres 80 50\r
-wprof core16.smp\r
--- /dev/null
+#include "modex16.h"\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "dos_kb.h"\r
+\r
+//word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
+typedef struct {\r
+ bitmap_t *data;\r
+ word tileHeight;\r
+ word tileWidth;\r
+ unsigned int rows;\r
+ unsigned int cols;\r
+ //unsigned int tilex,tiley; // tile position on the map\r
+} tiles_t;\r
+\r
+\r
+typedef struct {\r
+ byte *data;\r
+ tiles_t *tiles;\r
+ int width;\r
+ int height;\r
+} map_t;\r
+\r
+\r
+typedef struct {\r
+ map_t *map;\r
+ page_t *page;\r
+ int tx; //appears to be the top left tile position on the viewable screen map\r
+ int ty; //appears to be the top left tile position on the viewable screen map
+ word dxThresh; //????\r
+ word dyThresh; //????\r
+} map_view_t;\r
+\r
+struct {
+ int x; //player exact position on the viewable map\r
+ int y; //player exact position on the viewable map\r
+ int tx; //player tile position on the viewable map\r
+ int ty; //player tile position on the viewable map
+ int hp; //hitpoints of the player\r
+} player;\r
+\r
+\r
+map_t allocMap(int w, int h);\r
+void initMap(map_t *map);\r
+void mapScrollRight(map_view_t *mv, byte offset);\r
+void mapScrollLeft(map_view_t *mv, byte offest);\r
+void mapScrollUp(map_view_t *mv, byte offset);\r
+void mapScrollDown(map_view_t *mv, byte offset);\r
+void mapGoTo(map_view_t *mv, int tx, int ty);\r
+void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);\r
+void mapDrawRow(map_view_t *mv, int tx, int ty, word y);\r
+void mapDrawCol(map_view_t *mv, int tx, int ty, word x);
+void animatePlayer(map_view_t *mv, short d1, short d2, int x, int y, int ls, bitmap_t *bmp);\r
+\r
+#define TILEWH 16\r
+#define QUADWH (TILEWH/4)
+#define SPEED 2
+
+//place holder definitions
+#define MAPX 40
+#define MAPY 30\r
+#define SWAP(a, b) tmp=a; a=b; b=tmp;\r
+void main() {\r
+ bitmap_t ptmp; // player sprite\r
+ int q=0;\r
+ page_t screen, screen2;\r
+ map_t map;\r
+ map_view_t mv, mv2;\r
+ map_view_t *draw, *show, *tmp;\r
+ byte *ptr;\r
+\r
+ setkb(1);\r
+ /* create the map */\r
+ map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly\r
+ initMap(&map);\r
+ mv.map = ↦
+ mv2.map = ↦\r
+\r
+ /* draw the tiles */\r
+ ptr = map.data;
+ ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite\r
+ modexEnter();
+ modexPalUpdate(ptmp.palette);\r
+ screen = modexDefaultPage();\r
+ screen.width += (TILEWH*2);\r
+ mv.page = &screen;\r
+ screen2=modexNextPage(mv.page);\r
+ mv2.page = &screen2;\r
+ modexShowPage(mv.page);\r
+\r
+ /* set up paging */\r
+ show = &mv;\r
+ draw = &mv2;\r
+// draw = &mv;
+
+//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
+ mapGoTo(draw, 0, 0);
+ mapGoTo(show, 0, 0);\r
+
+ //TODO: put player in starting position of spot\r
+ //default player position on the viewable map
+ player.tx = draw->tx + 10;
+ player.ty = draw->ty + 8;
+ player.x = player.tx*TILEWH;
+ player.y = player.ty*TILEWH;
+ modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp);
+
+ modexShowPage(draw->page);\r
+ while(!keyp(1))
+ {\r
+ //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
+ //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction\r
+ //when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map
+
+ //TODO: render the player properly with animation and sprite sheet
+ if(keyp(77))
+ {
+// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp);
+ if(draw->tx >= 0 && draw->tx+20 < MAPX && player.tx == draw->tx + 10)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {\r
+// modexDrawBmp(draw->page, &bmp);
+ animatePlayer(draw, 1, 1, player.x, player.y, q, &ptmp);
+ mapScrollRight(draw, SPEED);
+ modexShowPage(draw->page);\r
+// mapScrollRight(show, SPEED);\r
+// SWAP(draw, show);\r
+ }
+ player.tx++;
+ }
+ else if(player.tx < MAPX)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+ player.x+=SPEED;
+// modexDrawBmp(draw->page, player.x, player.y, &bmp);
+ animatePlayer(draw, 1, 0, player.x, player.y, q, &ptmp);
+ modexShowPage(draw->page);
+ SWAP(draw, show);
+ }
+ player.tx++;
+ }\r
+ }\r
+\r
+ if(keyp(75))
+ {
+// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp);
+ if(draw->tx > 0 && draw->tx+20 <= MAPX && player.tx == draw->tx + 10)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+// modexDrawBmp(draw->page, player.x-((q+1)*SPEED), player.y, &bmp);
+ animatePlayer(draw, 3, 1, player.x, player.y, q, &ptmp);
+ mapScrollLeft(draw, SPEED);
+ modexShowPage(draw->page);\r
+// mapScrollLeft(show, SPEED);\r
+// SWAP(draw, show);\r
+ }
+ player.tx--;\r
+ }
+ else if(player.tx > 1)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+ player.x-=SPEED;
+// modexDrawBmp(draw->page, player.x, player.y, &bmp);
+ animatePlayer(draw, 3, 0, player.x, player.y, q, &ptmp);
+ modexShowPage(draw->page);
+ SWAP(draw, show);
+ }
+ player.tx--;
+ }
+ }\r
+\r
+ if(keyp(80))
+ {
+// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp);
+ if(draw->ty >= 0 && draw->ty+15 < MAPY && player.ty == draw->ty + 8)
+ {\r
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+// modexDrawBmp(draw->page, player.x, player.y+((q+1)*SPEED), &bmp);
+ animatePlayer(draw, 2, 1, player.x, player.y, q, &ptmp);
+ mapScrollDown(draw, SPEED);
+ modexShowPage(draw->page);\r
+// mapScrollDown(show, SPEED);\r
+// SWAP(draw, show);\r
+ }
+ player.ty++;
+ }
+ else if(player.ty < MAPY)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+ player.y+=SPEED;
+// modexDrawBmp(draw->page, player.x, player.y, &bmp);
+ animatePlayer(draw, 2, 0, player.x, player.y, q, &ptmp);
+ modexShowPage(draw->page);
+// SWAP(draw, show);
+ }
+ player.ty++;
+ }\r
+ }\r
+\r
+ if(keyp(72))
+ {
+ if(draw->ty > 0 && draw->ty+15 <= MAPY && player.ty == draw->ty + 8)
+ {\r
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {\r
+// modexDrawBmp(draw->page, player.x, player.y-((q+1)*SPEED), &bmp);
+ animatePlayer(draw, 0, 1, player.x, player.y, q, &ptmp);
+ mapScrollUp(draw, SPEED);
+ modexShowPage(draw->page);
+// mapScrollUp(show, SPEED);\r
+// SWAP(draw, show);\r
+ }
+ player.ty--;
+ }
+ else if(player.ty > 1)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {
+ player.y-=SPEED;
+// modexDrawBmp(draw->page, player.x, player.y, &bmp);
+ animatePlayer(draw, 0, 0, player.x, player.y, q, &ptmp);
+ modexShowPage(draw->page);
+// SWAP(draw, show);
+ }
+ player.ty--;
+ }\r
+ }\r
+// modexDrawBmp(draw->page, player.x, player.y, &bmp);\r
+ //modexShowPage(draw->page);\r
+\r
+ }\r
+
+ modexLeave();\r
+ setkb(0);
+ printf("Project 16 scroll.exe\n");
+ printf("tx: %d\n", draw->tx);
+ printf("ty: %d\n", draw->ty);
+ printf("player.x: %d\n", player.x);
+ printf("player.y: %d\n", player.y);
+ printf("player.tx: %d\n", player.tx);
+ printf("player.ty: %d\n", player.ty);
+}\r
+\r
+\r
+map_t\r
+allocMap(int w, int h) {\r
+ map_t result;\r
+\r
+ result.width =w;\r
+ result.height=h;\r
+ result.data = malloc(sizeof(byte) * w * h);\r
+\r
+ return result;\r
+}\r
+\r
+\r
+void\r
+initMap(map_t *map) {\r
+ /* just a place holder to fill out an alternating pattern */\r
+ int x, y;\r
+ int i;\r
+ int tile = 1;\r
+ map->tiles = malloc(sizeof(tiles_t));\r
+\r
+ /* create the tile set */\r
+ map->tiles->data = malloc(sizeof(bitmap_t));\r
+ map->tiles->data->width = (TILEWH*2);\r
+ map->tiles->data->height= TILEWH;\r
+ map->tiles->data->data = malloc((TILEWH*2)*TILEWH);\r
+ map->tiles->tileHeight = TILEWH;\r
+ map->tiles->tileWidth =TILEWH;\r
+ map->tiles->rows = 1;\r
+ map->tiles->cols = 2;\r
+\r
+ i=0;\r
+ for(y=0; y<TILEWH; y++) {\r
+ for(x=0; x<(TILEWH*2); x++) {\r
+ if(x<TILEWH)\r
+ map->tiles->data->data[i] = 0x24;\r
+ else\r
+ map->tiles->data->data[i] = 0x34;\r
+ i++;\r
+ }\r
+ }\r
+\r
+ i=0;\r
+ for(y=0; y<map->height; y++) {\r
+ for(x=0; x<map->width; x++) {\r
+ map->data[i] = tile;\r
+ tile = tile ? 0 : 1;\r
+ i++;\r
+ }\r
+ tile = tile ? 0 : 1;\r
+ }\r
+}\r
+\r
+\r
+void\r
+mapScrollRight(map_view_t *mv, byte offset) {\r
+ word x, y; /* coordinate for drawing */\r
+\r
+ /* increment the pixel position and update the page */\r
+ mv->page->dx += offset;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv->page->dx >= mv->dxThresh ) {\r
+ /* go forward one tile */\r
+ mv->tx++;\r
+ /* Snap the origin forward */\r
+ mv->page->data += 4;\r
+ mv->page->dx = mv->map->tiles->tileWidth;\r
+\r
+\r
+ /* draw the next column */\r
+ x= SCREEN_WIDTH + mv->map->tiles->tileWidth;\r
+ mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x);\r
+ }\r
+}\r
+\r
+\r
+void\r
+mapScrollLeft(map_view_t *mv, byte offset) {\r
+ word x, y; /* coordinate for drawing */\r
+\r
+ /* increment the pixel position and update the page */\r
+ mv->page->dx -= offset;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv->page->dx == 0) {\r
+ /* go backward one tile */\r
+ mv->tx--;\r
+ \r
+ /* Snap the origin backward */\r
+ mv->page->data -= 4;\r
+ mv->page->dx = mv->map->tiles->tileWidth;\r
+\r
+ /* draw the next column */\r
+ mapDrawCol(mv, mv->tx-1, mv->ty-1, 0);\r
+ }\r
+}\r
+\r
+\r
+void\r
+mapScrollUp(map_view_t *mv, byte offset) {\r
+ word x, y; /* coordinate for drawing */\r
+\r
+ /* increment the pixel position and update the page */\r
+ mv->page->dy -= offset;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv->page->dy == 0 ) {\r
+ /* go down one tile */\r
+ mv->ty--;\r
+ /* Snap the origin downward */\r
+ mv->page->data -= mv->page->width*4;\r
+ mv->page->dy = mv->map->tiles->tileHeight;\r
+\r
+\r
+ /* draw the next row */\r
+ y= 0;\r
+ mapDrawRow(mv, mv->tx-1 , mv->ty-1, y);\r
+ }\r
+}\r
+\r
+\r
+void\r
+mapScrollDown(map_view_t *mv, byte offset) {\r
+ word x, y; /* coordinate for drawing */\r
+\r
+ /* increment the pixel position and update the page */\r
+ mv->page->dy += offset;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv->page->dy >= mv->dyThresh ) {\r
+ /* go down one tile */\r
+ mv->ty++;\r
+ /* Snap the origin downward */\r
+ mv->page->data += mv->page->width*4;\r
+ mv->page->dy = mv->map->tiles->tileHeight;\r
+\r
+\r
+ /* draw the next row */\r
+ y= SCREEN_HEIGHT + mv->map->tiles->tileHeight;\r
+ mapDrawRow(mv, mv->tx-1 , mv->ty+15, y);\r
+ }\r
+\r
+}\r
+\r
+\r
+void\r
+mapGoTo(map_view_t *mv, int tx, int ty) {\r
+ int px, py;\r
+ unsigned int i;\r
+\r
+ /* set up the coordinates */\r
+ mv->tx = tx;\r
+ mv->ty = ty;\r
+ mv->page->dx = mv->map->tiles->tileWidth;\r
+ mv->page->dy = mv->map->tiles->tileHeight;\r
+\r
+ /* set up the thresholds */\r
+ mv->dxThresh = mv->map->tiles->tileWidth * 2;\r
+ mv->dyThresh = mv->map->tiles->tileHeight * 2;\r
+\r
+ /* draw the tiles */\r
+ modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0);\r
+ py=0;\r
+ i=mv->ty * mv->map->width + mv->tx;\r
+ for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) {\r
+ mapDrawRow(mv, tx-1, ty, py);\r
+ i+=mv->map->width - tx;\r
+ }\r
+}\r
+\r
+\r
+void\r
+mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) {\r
+ word rx;\r
+ word ry;\r
+ rx = (i % t->cols) * t->tileWidth;\r
+ ry = (i / t->cols) * t->tileHeight;\r
+ modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, t->data);\r
+}\r
+\r
+\r
+void \r
+mapDrawRow(map_view_t *mv, int tx, int ty, word y) {\r
+ word x;\r
+ int i;\r
+\r
+ /* the position within the map array */\r
+ i=ty * mv->map->width + tx;\r
+ for(x=0; x<SCREEN_WIDTH+mv->dxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) {\r
+ if(i>=0) {\r
+ /* we are in the map, so copy! */\r
+ mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);\r
+ }\r
+ i++; /* next! */\r
+ }\r
+}\r
+\r
+\r
+void \r
+mapDrawCol(map_view_t *mv, int tx, int ty, word x) {\r
+ int y;\r
+ int i;\r
+\r
+ /* location in the map array */\r
+ i=ty * mv->map->width + tx;\r
+\r
+ /* We'll copy all of the columns in the screen, \r
+ i + 1 row above and one below */\r
+ for(y=0; y<SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {\r
+ if(i>=0) {\r
+ /* we are in the map, so copy away! */\r
+ mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);\r
+ }\r
+ i += mv->map->width;\r
+ }\r
+}\r
+
+void animatePlayer(map_view_t *mv, short d1, short d2, int x, int y, int ls, bitmap_t *bmp)
+{
+ int qq;
+
+ if(d2==0) qq = 0;
+ else qq = ((ls+1)*SPEED);
+ switch (d1)
+ {
+ case 0:
+ //up
+ if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
+ if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp);
+ if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp);
+ if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp);
+ break;
+ case 1:
+ // right
+ //right
+ if(ls<2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
+ if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp);
+ if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp);
+ if(ls>6) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp);
+ break;
+ case 2:
+ //down
+ if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
+ if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp);
+ if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp);
+ if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp);
+ break;
+ case 3:
+ //left
+ if(ls<2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
+ if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp);
+ if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp);
+ if(ls>6) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp);
+ break;
+ }
+}
+++ /dev/null
-#include "src\eng_ai.h"\r
-#include <iostream>\r
-\r
-namespace engine {\r
-\r
- void do_artificial_intelligence()\r
- {\r
- //artificial intelligence here\r
-//==== std::cout << "A.I. HERE" << std::endl;\r
- }\r
-\r
-}
\ No newline at end of file
+++ /dev/null
-#ifndef _ENGINE_ARTIFICIAL_INTELLIGENCE_H_\r
-#define _ENGINE_ARTIFICIAL_INTELLIGENCE_H_\r
-\r
-namespace engine {\r
- void do_artificial_intelligence();\r
-}\r
-\r
-#endif/*_ENGINE_ARTIFICIAL_INTELLIGENCE_H_*/
\ No newline at end of file
+++ /dev/null
-#include "src\eng_comm.h"\r
-#include <iostream>\r
-\r
-namespace engine {\r
-\r
- engine_message do_communication()\r
- /*{\r
- //communication here\r
-//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
- int msg;\r
- std::cout << "Enter 1 for continue." << std::endl;\r
- std::cin >> msg;\r
- return msg == 1 ? ENGINE_RUN : ENGINE_QUIT;\r
- }*/\r
- /*engine_message do_communication(bool *input)\r
- {\r
- //communication here\r
-//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
- return input['e'] == true ? ENGINE_QUIT : ENGINE_RUN;\r
- }*/\r
- //engine_message do_communication(byte input)\r
- {\r
- //communication here\r
-//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
- //if(input) printf("%03d\n", input);
- return keyp(1) == 1 ? ENGINE_QUIT : ENGINE_RUN;\r
- }\r
-\r
-}
\ No newline at end of file
+++ /dev/null
-#ifndef _ENGINE_COMMUNICATION_H_\r
-#define _ENGINE_COMMUNICATION_H_\r
-\r
-#include "src\engine.h"
-#include "src\lib\dos_comm.h"\r
-\r
-namespace engine {\r
- engine_message do_communication();\r
-// engine_message do_communication(byte input);\r
-}\r
-\r
-#endif/*_ENGINE_COMMUNICATION_H_*/
\ No newline at end of file
+++ /dev/null
-#include "src\eng_core.h"\r
-\r
-#include "src\eng_snd.h"\r
-#include "src\eng_gfx.h"\r
-#include "src\eng_comm.h"\r
-#include "src\eng_ai.h"\r
-\r
-#include <iostream>\r
-\r
-//#include "src\lib\dos_gfx.h"\r
-//#include "src\lib\opl2.h"\r
-//#include "src\lib\dos_comm.h"\r
-\r
-namespace engine{\r
-\r
- Core::Core()\r
- {\r
- // Hardware Initiation\r
- this->init();\r
- \r
- //default constructor\r
- this->msg = ENGINE_RUN;\r
- this->timer.start_timer();\r
- this->frames_per_second = 60;\r
-\r
- // Global Variables\r
- this->mode = 4; // test global variable\r
- this->x = 0; // X\r
- this->y = 0; // Y\r
- \r
- // Start setttings of flags. I hope I got the same\r
- // logic as it was before, with the STL list.\r
- this->graphics_flag = true;\r
- this->comm_flag = true;\r
- this->release_flag = false;\r
- }\r
-\r
- void Core::update()\r
- {
- /*for (std::list<void(Core::*)()>::iterator i = fp->begin(); i != fp->end(); i++)\r
- //for (std::list<void(core::*)()>::iterator i = this->fp.begin(); i != this->fp.end(); i++)\r
- {\r
- (this->*(*i))();\r
- }*/\r
- // call update functions, instead of traversing a function pointer\r
- // list. Remove this comment!\r
- sound();\r
- if ( graphics_flag )\r
- graphics();\r
- if ( comm_flag )\r
- comm();\r
- ai();\r
- if ( release_flag )\r
- release();\r
- }\r
-\r
- void Core::sound()\r
- {\r
- //wrap sound lib\r
- do_sound();\r
- }\r
- void Core::graphics()\r
- {\r
- //int num_frames = 60;\r
- //double fps = 1.0 / num_frames;\r
- //double now = this->timer.elapsed_timer();\r
- //std::cout << "fps: " << fps << " now: " << now << std::endl;\r
- //if (this->timer.elapsed_timer() >= fps)\r
- //{\r
- //wrap graphics lib\r
- do_graphics();\r
- //this->timer.start_timer();\r
- //}\r
- }\r
- void Core::comm()\r
- {\r
- //int num_frames = 60;\r
- //double fps = 1.0 / num_frames;\r
- //double now = this->timer.elapsed_timer();\r
- //std::cout << "fps: " << fps << " now: " << now << std::endl;\r
- //if (this->timer.elapsed_timer() >= fps)\r
- //{\r
- //wrap comm lib\r
- this->msg = do_communication();\r
- //this->timer.start_timer();\r
- //}\r
- }\r
- void Core::ai()\r
- {\r
- //wrap A.I. lib\r
- do_artificial_intelligence();\r
- }\r
-\r
- engine_message Core::_msg()\r
- {\r
- return this->msg;\r
- }\r
-\r
- void Core::run()\r
- {\r
-//---- int i = 0;\r
- while (ENGINE_EXIT != this->msg)\r
- {\r
- //next line for purely testing purposes\r
-//---- i++;if(i==600){char a;std::cin >> a;this->keeq[a] = true;i=0;}\r
- this->sync();\r
- this->input();\r
- this->update();\r
- }\r
- }\r
-\r
- bool Core::init(){\r
- bool xz = 0; // error switch...\r
- std::cout << "VIDEO INITIATION" << std::endl;\r
-//____working on mode x setvideo(0x13, 1);\r
-//____working on mode x setvbuff(1);\r
- std::cout << "Checking for Adlib sound card...." << std::endl;\r
- if(!AdlibExists()){\r
- std::cout << "not found." << std::endl;\r
- xz = 1;\r
- }\r
- std::cout << "found." << std::endl;\r
- std::cout << "OPL2 INITIATION" << std::endl;\r
- fmtest();\r
- std::cout << "\nPress ESC to quit the game engine core test." << std::endl;\r
- std::cout << "1 - 9 for graphical tests!" << std::endl;\r
- std::cout << "space bar for control and sprite test!" << std::endl;\r
- std::cout << "z key for noise!" << std::endl;\r
- //std::cout << "Press press any key to continue!" << std::endl;\r
- //getch();\r
- std::cout << "INPUT INITIATION" << std::endl;\r
- setkb(1);\r
- std::cout << "INITIATION" << std::endl;\r
- return xz;\r
- }\r
-\r
- void Core::release()\r
- {\r
- //release contexts and set engine to exit\r
-//____working on mode x setvideo(0x03, 0);\r
-//____working on mode x setvbuff(0);\r
- setkb(0);\r
- FMReset();\r
- this->msg = ENGINE_EXIT;\r
- }\r
-\r
- void Core::input(){\r
- //retrieve input device information\r
- //dummy 'w' and 'p' down, t up\r
-//---- bool dummy_input_available = true;\r
-//---- if(dummy_input_available)\r
-//---- {\r
-//---- std::cout << "key down" << std::endl;\r
-//---- this->keeq['w'] = true;\r
-//---- this->keeq['p'] = true;\r
-//---- this->keeq['t'] = false;\r
- //notify engine that input occured\r
- this->msg = ENGINE_INPUT;\r
-//---- }\r
-//---- else\r
-//---- {\r
-//---- std::cout << "key up" << std::endl;\r
-//---- this->msg = ENGINE_RUN;\r
-//---- }\r
- }\r
-\r
- void Core::sync()\r
- {\r
- if (this->timer.elapsed_timer() >= (1.0 / this->frames_per_second))\r
- {\r
- //int a;std::cin >> a;\r
- graphics_flag = true;\r
- this->timer.start_timer();\r
-//==== std::cout << "GRAPHICS GRAPHICS GRAPHICS GRAPHICS GRAPHICS" << std::endl;
-//____ updatevbuff();\r
- }\r
- else\r
- {\r
- graphics_flag = false;\r
- }\r
- if (ENGINE_INPUT == this->msg)\r
- {\r
- comm_flag = true;\r
- }\r
- else\r
- {\r
- comm_flag = false;\r
- }\r
- if (ENGINE_QUIT == this->msg)\r
- {\r
- release_flag = true;\r
- }\r
- }\r
-\r
- Core::~Core()\r
- {\r
- //deconstructor\r
- }\r
-\r
-}\r
+++ /dev/null
-#ifndef _ENGINE_CORE_H_\r
-#define _ENGINE_CORE_H_\r
-\r
-#include "src\engine.h"\r
-#include "src\timer.h"\r
-\r
-namespace engine {\r
- class Core\r
- {\r
- public:\r
- Core();\r
- void update();\r
- void sound();\r
- void graphics();\r
- void comm();\r
- void ai();\r
- engine_message _msg();\r
- void run();\r
- bool init();\r
- void release();\r
- void input();\r
- void sync();\r
- ~Core();\r
-\r
- protected:\r
- private:\r
- engine_message msg;
- /*std::list<void(Core::*)()> *fp;*/\r
- Timer timer;\r
-// unsigned char key[256];\r
- int frames_per_second;\r
- //std::list<void(core::*)()> fp;\r
-/* int xxxx = 0;\r
- int yyyy = 0;*/\r
- int mode;\r
- int x;\r
- int y;\r
-\r
- // Because we removed the function pointer STL list:\r
- bool graphics_flag, comm_flag, release_flag;\r
- };\r
-}\r
-\r
-#endif/*_ENGINE_CORE_H_*/\r
+++ /dev/null
-#include "src\eng_gfx.h"\r
-#include <iostream>\r
-\r
-#ifdef __cplusplus /* Functions must be declared C style */\r
-extern "C" {\r
-#endif\r
-extern void interrupt far newkb(void);\r
-extern int keyp(byte c);\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-namespace engine {\r
-\r
- void do_graphics()\r
- {\r
- //graphics here\r
-//==== std::cout << "GRAPHICS HERE" << std::endl;\r
- static int xxxx = 0; //I am confused!!!\r
- static int yyyy = 0; //I am confused!!!\r
- //static int mode = 10; //I am confused!!!
- static int paldump = 0; //switch variable\r
- //if(12 >= kee && kee >= 2) mode = kee - 1;\r
- /*if(keyp(2)) mode = 1;\r
- if(keyp(3)) mode = 2;\r
- if(keyp(4)) mode = 3;\r
- if(keyp(5)) mode = 4;\r
- if(keyp(6)) mode = 5;\r
- if(keyp(7)) mode = 6;\r
- if(keyp(8)) mode = 7;\r
- if(keyp(9)) mode = 8;\r
- if(keyp(10)) mode = 9;\r
- if(keyp(11)) mode = 10;\r
- if(keyp(12)) mode = 11;*/
-//____ if(keyp(47) && paldump == 8) paldump = 0;\r
-//____ else if(keyp(47)) paldump++;
- /* working on code overall!
- if(keyp(57) && mode == 10) mode = 0;\r
- else if(keyp(57) && mode == 0) mode = 10;\r
- if(mode > 0){\r
- ding(mode);\r
- }else{*/
-//____ if(keyp(KEY_C)) tulip();
-/*____ if(keyp(KEY_UP) || keyp(KEY_DOWN) || keyp(KEY_LEFT) || keyp(KEY_RIGHT)) eraseplayer(xxxx, yyyy);\r
- if(keyp(KEY_UP)){\r
- if(--yyyy < 0) yyyy = 0;\r
- }else if(keyp(KEY_DOWN)){\r
- if(++yyyy >= SH) yyyy = SH - 1;\r
- }\r
- if(keyp(KEY_LEFT)){\r
- if(--xxxx < 0) xxxx = 0;\r
- }\r
- if(keyp(KEY_RIGHT)){\r
- if(++xxxx >= SW) xxxx = SW - 1;\r
- }\r
- drawplayer(xxxx, yyyy, 14);\r
- //}
- if(paldump) pdump(paldump);____*/
- /*clearscr();\r
- BlockMove();*/
- }\r
-\r
-}\r
+++ /dev/null
-#ifndef _ENGINE_GRAPHICS_H_\r
-#define _ENGINE_GRAPHICS_H_\r
-\r
-#include "src\lib\dos_gfx.h"\r
-\r
-namespace engine {\r
- void do_graphics();\r
-}\r
-\r
-#endif/*_ENGINE_GRAPHICS_H_*/
\ No newline at end of file
+++ /dev/null
-#include "src\eng_snd.h"\r
-#include <iostream>\r
-\r
-#ifdef __cplusplus /* Functions must be declared C style */\r
-extern "C" {\r
-#endif\r
-extern void interrupt far newkb(void);\r
-extern int keyp(byte c);\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-namespace engine {\r
-\r
- void do_sound()\r
- {\r
- //sound here\r
-//==== std::cout << "SOUND HERE" << std::endl;\r
- if(keyp(44)){\r
- FMKeyOn(0, 0x106, 4);\r
- }//else if(!keyp(44)) FMKeyOff(0);\r
- if(keyp(KEY_A)) FMKeyOff(0);\r
- if(keyp(KEY_X)){\r
- sound(440);\r
- delay(100);\r
- nosound();\r
- }else if(keyp(KEY_X+0x80)) nosound();\r
- }\r
-\r
-}\r
+++ /dev/null
-#ifndef _ENGINE_SOUND_H_\r
-#define _ENGINE_SOUND_H_\r
-\r
-#include "src\lib\opl2.h"\r
-\r
-namespace engine {\r
- void do_sound();\r
-}\r
-\r
-#endif/*_ENGINE_SOUND_H_*/
\ No newline at end of file
+++ /dev/null
-#ifndef _ENGINE_H_\r
-#define _ENGINE_H_
-
-typedef enum {\r
- ENGINE_EXIT,\r
- ENGINE_QUIT,\r
- ENGINE_RUN,\r
- ENGINE_INPUT\r
-} engine_message;\r
-#endif
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// TUTPROG4.CPP - VGA Trainer Program 4 (in Turbo C++ 3.0) //\r
-// //\r
-// "The VGA Trainer Program" is written by Denthor of Asphyxia. However it //\r
-// was limited to Pascal only in its first run. All I have done is taken //\r
-// his original release, translated it to C++ and touched up a few things. //\r
-// I take absolutely no credit for the concepts presented in this code and //\r
-// am NOT the person to ask for help if you are having trouble. //\r
-// //\r
-// Program Notes : This program implements virtual screens, a great way //\r
-// to update your screen. //\r
-// //\r
-// For this particular program, I have found the compiler //\r
-// option -mc (Compact memory model) to work better than //\r
-// -ml (Large memory model). However, you must use -mc or //\r
-// greater. //\r
-// Also, you might want to go under "Options...Debugger" //\r
-// and increase your programs Heap size to >64k. I don't //\r
-// know if <64k will lock your system, but I had problems. //\r
-// //\r
-// Author : Grant Smith (Denthor) - denthor@beastie.cs.und.ac.za //\r
-// Translator : Christopher G. Mann - r3cgm@dax.cc.uakron.edu //\r
-// //\r
-// Last Modified : December 23, 1994 //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-#include "src\lib\dos_gfx.h"\r
-\r
-// declare a pointer to the offset of the Virtual Screen\r
-byte *vaddr = NULL;\r
-// declare a pointer to the offset of the VGA memory\r
-byte *vga = (byte *) MK_FP(VMEM, 0);\r
-int old_mode;\r
-//color てすと\r
-int gq = LGQ;\r
-//てすと\r
-int q = 0;\r
-int bakax = 0, bakay = 0;\r
-int xx = 0, yy = 0, sx = 0, sy = 0;\r
-byte coor;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// setvideo() - This function Manages the video modes //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-void setvideo(byte mode, int vq){\r
- union REGS in, out;\r
-\r
- if(!vq){ // deinit the video\r
- // change to the video mode we were in before we switched to mode 13h\r
- in.h.ah = 0x00;\r
- in.h.al = old_mode;\r
- int86(0x10, &in, &out);\r
- }else if(vq == 1){ // init the video\r
- // get old video mode\r
- in.h.ah = 0xf;\r
- int86(0x10, &in, &out);\r
- old_mode = out.h.al;\r
-\r
- // enter mode\r
- in.h.ah = 0x00;\r
- in.h.al = mode;\r
- // vesa\r
- //in.x.ax = 0x4f02;\r
- //in.x.bx = mode;\r
- int86(0x10, &in, &out);\r
- }\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// setvbuff() - This manages the memory needed for the virtual screen. //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-// manages the buffer/virtual screen\r
-void setvbuff(int vq){\r
- if(!vq){\r
- free(vaddr);\r
- }else if(vq == 1){\r
- vaddr = (byte *) calloc(SW*SH, 1);\r
-\r
- if(vaddr == NULL){\r
- setvideo(0x03, 1);\r
- cout << "Not enough video memory available, exiting program....";\r
- exit(1);\r
- }\r
- }\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// updatevbuff() - This flips the virtual screen to the VGA screen. //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-// updates the buffer/virtual screen\r
-void updatevbuff(){\r
-/* // wait for vertical re-trace\r
- while(inportb(INPUT_STATUS_0) & 8);\r
- while(!(inportb(INPUT_STATUS_0) & 8));*/\r
-\r
- // copy everything to video memory\r
- _fmemcpy(vga, vaddr, SW*SH);\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// cls() - This clears the screen to the specified color, on the VGA or on //\r
-// the Virtual screen. //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-void cls(byte color, byte *Where){\r
- _fmemset(Where, color, SW*SH);\r
-}\r
-\r
-// clears the entire video output\r
-void clearscr(){\r
- cls(0, vga);\r
- cls(0, vaddr);\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// plotpixel() - This puts a pixel at X,Y using color Col, on VGA or the //\r
-// Virtual Screen; //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-void plotpixel(int x, int y, byte color, byte *Where){\r
- memset(Where+(x+(y*SW)),color,1);\r
-}\r
-\r
-// king_crimson's code\r
-void ppf(int x, int y, byte color, byte *Where) {\r
- byte far *vidptr;\r
- vidptr = (byte far *)(Where + y*SW + x);\r
- *vidptr = color;\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// BlockMove() - This tests various ways of moving a block around the //\r
-// screen. //\r
-// //\r
-/////////////////////////////////////////////////////////////////////////////\r
-//てすと\r
-void BlockMove(){\r
- int loop1, loop2, loop3;\r
-\r
- // This draws a block directly to the VGA with no flipping\r
- for(loop1=1; loop1<271; loop1++){\r
- for(loop2=1; loop2<51; loop2++)\r
- for(loop3=1; loop3<51; loop3++)\r
- plotpixel(loop1+loop2,loop3,32, vga);\r
- cls(0,vga);\r
- }\r
-\r
- //`\r
- for(loop1=1; loop1<281; loop1++){\r
- for(loop2=1; loop2<41; loop2++)\r
- for(loop3=1; loop3<41; loop3++)\r
- plotpixel(loop1+loop2,loop3,14, vaddr);\r
- //updatevbuff();\r
- cls(0,vaddr);\r
- }\r
-\r
-/* // This draws to the virtual screen, waits for retrace, then flips to VGA\r
- for(loop1=1; loop1<51; loop1++){\r
- for(loop2=1; loop2<51; loop2++)\r
- for(loop3=1; loop3<51; loop3++)\r
- plotpixel(loop1+loop2,loop3,32, vaddr);\r
-// WaitRetrace();\r
- updatevbuff();\r
- cls(0,vaddr);\r
- }*/\r
-}\r
-\r
-void eraseplayer(int x = 160, int y = 100){\r
- memset(vaddr+(x+(y*SW)),gq-1,1);\r
-}\r
-\r
-void drawplayer(int x = 160, int y = 100, int color = 0){\r
- memset(vaddr+(x+(y*SW)),color,1);\r
-}\r
-\r
-//color てすと\r
-int colortest(){\r
- if(gq < NUM_COLORS){\r
- cls(gq, vaddr);\r
- gq++;\r
- }else gq = 0;\r
- return gq;\r
-}\r
-\r
-//color てすと\r
-int colorz(){\r
- if(gq < HGQ){\r
- cls(gq, vaddr);\r
- gq++;\r
- }else gq = LGQ;\r
- return gq;\r
-}\r
-\r
-//slow spectrum down\r
-void ssd(int svq){\r
- if(sy < SH+1){\r
- if(sx < SW+1){\r
- //plotpixel(xx, yy, coor, vga);\r
- ppf(sx, sy, coor, vga);\r
- //printf("%d %d %d %d\n", sx, sy, svq, coor);\r
- sx++;\r
- }else sx = 0;\r
- if(sx == SW){\r
- sy++;\r
- if(svq == 7) coor++;\r
- if(sy == SH && svq == 8) coor = rand()%NUM_COLORS;\r
- }\r
- }else sy = 0;\r
-}\r
-
-//inefficient pallette dumping
-void pdump(int mult){
- int palq=mult*16;
- int palcol=0;
- for(int paly=0; paly<palq; paly++){
- for(int palx=0; palx<palq; palx++){
- for(int iy=0; iy<mult; iy++){
- for(int ix=0; ix<mult; ix++){
- ppf((SW-palq)+palx+ix, paly+iy, palcol, vaddr);
- }
- }
- for(int i=1; i<mult; i++) palx++;
- palcol++;
- }
- for(int i=1; i<mult; i++) paly++;
- }
-}
-
-//draw a tulip inifficiently
-void tulip(){
- cls(0,vaddr);
- std::cout << "01 Story of Chikyuu" << std::endl;
- //22 lines
- int tx = (SW/2)-16;
- int ty = (SH/2)-22;
- gq = 0;
- ppf(tx+8, ty, 37, vaddr); ty++;
- ppf(tx+7, ty, 37, vaddr); ppf(tx+8, ty, 37, vaddr); ty++;
- ppf(tx+6, ty, 37, vaddr); ppf(tx+7, ty, 37, vaddr); ppf(tx+8, ty, 40, vaddr); ppf(tx+9, ty, 37, vaddr); ty++;
- ppf(tx+2, ty, 40, vaddr); ppf(tx+5, ty, 37, vaddr); ppf(tx+6, ty, 37, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 40, vaddr); ppf(tx+9, ty, 38, vaddr); ppf(tx+12, ty, 37, vaddr); ty++;
- ppf(tx+3, ty, 40, vaddr); ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 37, vaddr); ppf(tx+6, ty, 38, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 38, vaddr); ppf(tx+9, ty, 40, vaddr); ppf(tx+10, ty, 38, vaddr); ppf(tx+11, ty, 37, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- ppf(tx+3, ty, 40, vaddr); ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 40, vaddr); ppf(tx+6, ty, 44, vaddr); ppf(tx+7, ty, 38, vaddr); ppf(tx+8, ty, 44, vaddr); ppf(tx+9, ty, 40, vaddr); ppf(tx+10, ty, 37, vaddr); ppf(tx+11, ty, 40, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- //7
- ppf(tx+3, ty, 40, vaddr); ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 40, vaddr); ppf(tx+6, ty, 44, vaddr); ppf(tx+7, ty, 44, vaddr); ppf(tx+8, ty, 40, vaddr); ppf(tx+9, ty, 44, vaddr); ppf(tx+10, ty, 37, vaddr); ppf(tx+11, ty, 40, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- ppf(tx+3, ty, 40, vaddr); ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 40, vaddr); ppf(tx+6, ty, 40, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 40, vaddr); ppf(tx+9, ty, 44, vaddr); ppf(tx+10, ty, 40, vaddr); ppf(tx+11, ty, 40, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 40, vaddr); ppf(tx+6, ty, 40, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 40, vaddr); ppf(tx+9, ty, 44, vaddr); ppf(tx+10, ty, 40, vaddr); ppf(tx+11, ty, 40, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 40, vaddr); ppf(tx+6, ty, 40, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 4, vaddr); ppf(tx+9, ty, 44, vaddr); ppf(tx+10, ty, 40, vaddr); ppf(tx+11, ty, 40, vaddr); ppf(tx+12, ty, 40, vaddr); ty++;
- //11
- ppf(tx+4, ty, 40, vaddr); ppf(tx+5, ty, 4, vaddr); ppf(tx+6, ty, 40, vaddr); ppf(tx+7, ty, 40, vaddr); ppf(tx+8, ty, 4, vaddr); ppf(tx+9, ty, 40, vaddr); ppf(tx+10, ty, 40, vaddr); ppf(tx+11, ty, 4, vaddr); ppf(tx+12, ty, 4, vaddr); ty++;
- //12
- ppf(tx+4, ty, 4, vaddr); ppf(tx+5, ty, 4, vaddr); ppf(tx+6, ty, 40, vaddr); ppf(tx+7, ty, 4, vaddr); ppf(tx+8, ty, 4, vaddr); ppf(tx+9, ty, 40, vaddr); ppf(tx+10, ty, 40, vaddr); ppf(tx+11, ty, 4, vaddr); ppf(tx+15, ty, 2, vaddr); ty++;
- ppf(tx, ty, 45, vaddr); ppf(tx+5, ty, 4, vaddr); ppf(tx+6, ty, 4, vaddr); ppf(tx+7, ty, 4, vaddr); ppf(tx+8, ty, 4, vaddr); ppf(tx+9, ty, 4, vaddr); ppf(tx+10, ty, 4, vaddr); ppf(tx+13, ty, 2, vaddr); ppf(tx+14, ty, 2, vaddr); ppf(tx+15, ty, 2, vaddr); ty++;
- //14
- ppf(tx, ty, 45, vaddr); ppf(tx+1, ty, 2, vaddr); ppf(tx+6, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+8, ty, 2, vaddr); ppf(tx+12, ty, 2, vaddr); ppf(tx+13, ty, 2, vaddr); ppf(tx+14, ty, 45, vaddr); ty++;
- ppf(tx, ty, 45, vaddr); ppf(tx+1, ty, 45, vaddr); ppf(tx+2, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+11, ty, 2, vaddr); ppf(tx+12, ty, 2, vaddr); ppf(tx+13, ty, 2, vaddr); ppf(tx+14, ty, 45, vaddr); ty++;
- ppf(tx+1, ty, 45, vaddr); ppf(tx+2, ty, 2, vaddr); ppf(tx+3, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+10, ty, 2, vaddr); ppf(tx+11, ty, 2, vaddr); ppf(tx+12, ty, 2, vaddr); ppf(tx+13, ty, 45, vaddr); ppf(tx+14, ty, 2, vaddr); ty++;
- ppf(tx+1, ty, 45, vaddr); ppf(tx+2, ty, 45, vaddr); ppf(tx+3, ty, 2, vaddr); ppf(tx+4, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+10, ty, 2, vaddr); ppf(tx+11, ty, 2, vaddr); ppf(tx+12, ty, 45, vaddr); ppf(tx+13, ty, 2, vaddr); ty++;
- ppf(tx+1, ty, 45, vaddr); ppf(tx+2, ty, 45, vaddr); ppf(tx+3, ty, 45, vaddr); ppf(tx+4, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+9, ty, 2, vaddr); ppf(tx+10, ty, 2, vaddr); ppf(tx+11, ty, 45, vaddr); ppf(tx+12, ty, 2, vaddr); ppf(tx+13, ty, 2, vaddr); ty++;
- ppf(tx+2, ty, 45, vaddr); ppf(tx+3, ty, 45, vaddr); ppf(tx+4, ty, 45, vaddr); ppf(tx+5, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+9, ty, 2, vaddr); ppf(tx+10, ty, 45, vaddr); ppf(tx+11, ty, 2, vaddr); ppf(tx+11, ty, 2, vaddr); ppf(tx+12, ty, 2, vaddr); ty++;
- ppf(tx+3, ty, 45, vaddr); ppf(tx+4, ty, 45, vaddr); ppf(tx+5, ty, 45, vaddr); ppf(tx+6, ty, 2, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+8, ty, 2, vaddr); ppf(tx+9, ty, 45, vaddr); ppf(tx+10, ty, 2, vaddr); ty++;
- ppf(tx+5, ty, 45, vaddr); ppf(tx+7, ty, 45, vaddr); ppf(tx+8, ty, 2, vaddr); ty++;
- ppf(tx+7, ty, 45, vaddr);
-}
-\r
-/*-----------ding-------------*/\r
-int ding(int q){\r
- int d3y;\r
-\r
- if(q <= 4 && gq == BONK-1) coor = rand()%NUM_COLORS;\r
-\r
- if(q == 5){ colortest(); return gq; }\r
- if(q == 10){ colorz(); return gq; }\r
- if(q == 11){ colorz(); delay(100); return gq; }\r
- if(q == 8){ ssd(q); /*printf("%d\n", coor);*/ }\r
- if(q == 6){\r
- coor = rand()%NUM_COLORS;\r
- cls(coor, vaddr);\r
- //updatevbuff();\r
- }\r
-\r
- if(q == 7 || q== 9){\r
- if(gq < HGQ){\r
- if(q == 7) ssd(q);\r
- if(q == 9){ ssd(q); coor++; }\r
- gq++;\r
- }else gq = LGQ;\r
- }\r
- if(q<5 && gq<BONK){ // the number variable make the colors more noticable\r
- if(q==1){\r
- if(xx==SW){bakax=0;}\r
- if(xx==0){bakax=1;}\r
- if(yy==SH){bakay=0;}\r
- if(yy==0){bakay=1;}\r
- }else if(q==3){\r
- if(xx!=SW||yy!=SH){\r
- if(xx==0){bakax=1;bakay=-1;d3y=1;}\r
- if(yy==0){bakax=1;bakay=0;d3y=1;}\r
- if(xx==SW){bakax=-1;bakay=-1;d3y=1;}\r
- if(yy==SH){bakax=1;bakay=0;d3y=1;}\r
- }else if(xx==SW&&yy==SH) xx=yy=0;\r
- }\r
- if(q==3){\r
- if(d3y){\r
- if(bakay<0){\r
- yy--;\r
- d3y--;\r
- }else\r
- if(bakay>0){\r
- yy++;\r
- d3y--;\r
- }\r
- }\r
- if(bakax<0){\r
- xx--;\r
- }else\r
- if(bakax>0){\r
- xx++;\r
- }\r
- }else{\r
- if(!bakax){\r
- xx--;\r
- }else{\r
- xx++;\r
- }\r
- if(!bakay){\r
- yy--;\r
- }else{\r
- yy++;\r
- }\r
- }\r
- // plot the pixel\r
- ppf(xx, yy, coor, vga);\r
- if(q==2) ppf(rand()%SW, rand()%SH, 0, vga);\r
- if(q==2||q==4){ bakax = rand()&0x1; bakay = rand()&0x1; }\r
- gq++;\r
-// printf("%d %d %d %d\n", xx, yy, gq, coor);\r
- }else gq = LGQ;\r
- return gq;\r
-}
+++ /dev/null
-#ifndef _DOSLIB_GFX_H_\r
-#define _DOSLIB_GFX_H_\r
-#include <iostream.h>\r
-#include <stdlib.h>\r
-#include "src\lib\lib_com.h"\r
-\r
-#define SW 320 // width in pixels of vga mode\r
-#define SH 200 // height in pixels of vga mode\r
-#define NUM_COLORS 256 // number of colors in vga mode\r
-//static lgq=NUM_COLORS/(1/8)\r
-//static hgq=NUM_COLORS/(1/8)\r
-/*#define SW 320\r
-#define SH 200\r
-#define NUM_COLORS 4*/ // cga\r
-#define BONK 400\r
-#define LGQ 32\r
-#define HGQ 56\r
-#define VMEM 0xA000 // = vga\r
-//#define VMEM 0xB800 // = cga\r
-//#define VMOD 0x13\r
-\r
-void setvideo(byte mode, int vq);\r
-void setvbuff(int vq);\r
-void updatevbuff();\r
-void cls(byte color, byte *Where);\r
-void clearscr();\r
-void plotpixel(int x, int y, byte color, byte *Where);\r
-void plotpixelfast(int x, int y, byte color, byte *Where);\r
-void BlockMove();\r
-void eraseplayer(int x, int y);\r
-void drawplayer(int x, int y, int color);\r
-int colortest();\r
-int colorz();\r
-void ssd(int svq);
-void pdump(int mult);
-void tulip();
-int ding(int q);
-\r
-#endif/*_DOSLIB_GFX_H_*/\r
+++ /dev/null
-/* C Source File: ADLIB *****************************************************\r
-\r
-Author: Kevin A. Lee\r
-\r
-Last Amended: 27th March, 1993\r
-\r
-Description: Low-level interface to the Adlib (or compatible)\r
-FM sound card. All information gleaned from\r
-Jeffrey S. Lee's "Programming the Adlib/Sound\r
-Blaster FM Music Chips". See Lee's document for\r
-further information.\r
-Compiled succesfully under Turbo C, Borland C++,\r
-and Microsoft Quick C (all latest versions).\r
-\r
-****************************************************************************/\r
-#include "src\lib\opl2.h"\r
-
-//sound てすと
-int sq = 0;
-\r
-/* Function: WriteFM ********************************************************\r
-*\r
-* Parameters: reg - which FM register to write to.\r
-* value - value to write.\r
-*\r
-* Description: writes a value to the specified register and\r
-* waits for the "official" recommended periods.\r
-*\r
-*/\r
-void WriteFM(int reg, int value){\r
- int i;\r
-\r
- outp(ADLIB_FM_ADDRESS, (byte)reg); /* set up the register */\r
- for (i = 0; i < 6; i++) inp(ADLIB_FM_ADDRESS); /* wait 12 cycles */\r
- outp(ADLIB_FM_DATA, (byte)value); /* write out the value */\r
- for(i = 0; i < 35; i++) inp(ADLIB_FM_ADDRESS); /* wait 84 cycles */\r
-} /* End of WriteFM */\r
-\r
-/* Function: ReadFM *********************************************************\r
-*\r
-* Returns: the value in the status register.\r
-*\r
-* Description: return a value in the status register.\r
-*\r
-*/\r
-int ReadFM(void){\r
- return(inp(ADLIB_FM_ADDRESS));\r
-} /* End of ReadFM */\r
-\r
-/* Function: AdlibExists ****************************************************\r
-*\r
-* Returns: 1 (true) if an Adlib compatible sound card\r
-* is present, else 0 (false).\r
-*\r
-* Description: determines whether an Adlib (or compatible)\r
-* sound card is present.\r
-*\r
-*/\r
-int AdlibExists(void){\r
- int stat1, stat2;\r
-\r
- WriteFM(0x04, 0x60); /* reset both timers */\r
- WriteFM(0x04, 0x80); /* enable timer interrupts */\r
- stat1 = ReadFM(); /* read status register */\r
- WriteFM(0x02, 0xFF);\r
- WriteFM(0x04, 0x21); /* start timer 1 */\r
-// wait(80); /* could do something useful*/\r
- stat2 = ReadFM(); /* read status register */\r
- WriteFM(0x04, 0x60); /* reset both timers */\r
- WriteFM(0x04, 0x80); /* enable timer interrupts */\r
-\r
- if(((stat1 & 0xE0) == 0x00) && ((stat2 & 0xE0) == 0xC0)) return(1);\r
- return(0);\r
-} /* End of AdlibExists */\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*/){\r
- int i;\r
-\r
- /* zero all registers */\r
- for(i = MIN_REGISTER; i < MAX_REGISTER+1; i++) WriteFM(i, 0);\r
-\r
- /* allow FM chips to control the waveform of each operator */\r
- WriteFM(0x01, 0x20);\r
-\r
- /* set rhythm enabled (6 melodic voices, 5 percussive) */\r
- WriteFM(0xBD, 0x20);\r
-\r
- //FMSetPercusiveMode(percusiveMode);\r
-} /* End of FMReset */\r
-/*\r
-void FMSetPercusiveMode(int state){\r
- if(state){\r
- WriteFM(0xBD, 0x20);\r
- currentBDContents = 0x20;\r
- percussiveMode = 1;\r
- voiceModulator[7] = 16;\r
- voiceModulator[8] = 14;\r
- // we have to set the freq of voice 7 & 8 for the white noise gen.\r
- // these frequency choices could certainly be better\r
- WriteFM(0xa7, 1844 & 0xff);\r
- WriteFM(0xb7, 1844 >> 8);\r
- WriteFM(0xa8, 3764 & 0xff);\r
- WriteFM(0xb8, 3764 >> 8);\r
- }else{\r
- WriteFM(0xBD, 0);\r
- percussiveMode = 0;\r
- currentBDContents = 0;\r
- voiceModulator[7] = 13;\r
- voiceModulator[8] = 14;\r
- }\r
-}\r
-*/\r
-/* Function: FMKeyOff *******************************************************\r
-*\r
-* Parameters: voice - which voice to turn off.\r
-*\r
-* Description: turns off the specified voice.\r
-*\r
-*/\r
-void FMKeyOff(int voice){\r
- int regNum;\r
-\r
- /* turn voice off */\r
- regNum = 0xB0 + voice % NUMVOICE;\r
- WriteFM(regNum, 0x0E);\r
-} /* End of FMKeyOff */\r
-\r
-/* Function: FMKeyOn *******************************************************\r
-*\r
-* Parameters: voice - which voice to turn on.\r
-* freq - its frequency (note).\r
-* octave - its octave.\r
-*\r
-* Description: turns on a voice of specfied frequency and\r
-* octave.\r
-*\r
-*/\r
-void FMKeyOn(int voice, int freq, int octave){\r
- int regNum, tmp;\r
-\r
- regNum = 0xA0 + voice % NUMVOICE;\r
- WriteFM(regNum, freq & 0xff);\r
- regNum = 0xB0 + voice % NUMVOICE;\r
- tmp = (freq >> 8) | (octave << 2) | 0x20;
- WriteFM(regNum, tmp);\r
-} /* End of FMKeyOn */\r
-\r
-/* Function: FMVoiceVolume **************************************************\r
-*\r
-* Parameters: voice - which voice to set volume of\r
-* vol - new volume value (experiment).\r
-*\r
-* Description: sets the volume of a voice to the specified\r
-* value in the range (0-63)?\r
-*\r
-*/\r
-void FMVoiceVolume(int voice, int vol){\r
- int regNum;\r
-\r
- regNum = 0x40 + voice % NUMVOICE;\r
- WriteFM(regNum, vol);\r
-} /* End of FMVoiceVolume */\r
-\r
-/* Function: FMSetVoice *****************************************************\r
-*\r
-* Parameters: voiceNum - which voice to set.\r
-* ins - instrument to set voice.\r
-*\r
-* Description: sets the instrument of a voice.\r
-*\r
-*/\r
-void FMSetVoice(int voiceNum, FMInstrument *ins){\r
- int opCellNum, cellOffset;\r
-\r
- voiceNum %= NUMVOICE;\r
- cellOffset = voiceNum % 3 + ((voiceNum / 3) << 3);\r
-\r
- /* set sound characteristic */\r
- opCellNum = 0x20 + (char)cellOffset;\r
- WriteFM(opCellNum, ins->SoundCharacteristic[0]);\r
- opCellNum += 3;\r
- WriteFM(opCellNum, ins->SoundCharacteristic[1]);\r
-\r
- /* set level/output */\r
- opCellNum = 0x40 + (char)cellOffset;\r
- WriteFM(opCellNum, ins->Level[0]);\r
- opCellNum += 3;\r
- WriteFM(opCellNum, ins->Level[1]);\r
-\r
- /* set Attack/Decay */\r
- opCellNum = 0x60 + (char)cellOffset;\r
- WriteFM(opCellNum, ins->AttackDecay[0]);\r
- opCellNum += 3;\r
- WriteFM(opCellNum, ins->AttackDecay[1]);\r
-\r
- /* set Sustain/Release */\r
- opCellNum = 0x80 + (char)cellOffset;\r
- WriteFM(opCellNum, ins->SustainRelease[0]);\r
- opCellNum += 3;\r
- WriteFM(opCellNum, ins->SustainRelease[1]);\r
-\r
- /* set Wave Select */\r
- opCellNum = 0xE0 + (char)cellOffset;\r
- WriteFM(opCellNum, ins->WaveSelect[0]);\r
- opCellNum += 3;\r
- WriteFM(opCellNum, ins->WaveSelect[1]);\r
-\r
- /* set Feedback/Selectivity */\r
- opCellNum = (byte)0xC0 + (byte)voiceNum;\r
- WriteFM(opCellNum, ins->Feedback);\r
-} /* End of FMSetVoice */\r
-\r
-/* Function: LoadSBI ********************************************************\r
-*\r
-* Parameters: fileName - name of .SBI file.\r
-* ins - variable to place data in.\r
-*\r
-* Description: loads a .SBI into the instrument structure.\r
-*\r
-*/\r
-//int LoadSBI(char fileName[], FMInstrument *ins){\r
-// int i;\r
-// FILE *fp;\r
-// size_t structSize = sizeof(FMInstrument);\r
-//\r
-// if ((fp = fopen(fileName, "rb")) == NULL) return (0);\r
-//\r
-// /* skip the header - or do we? */\r
-// for (i = 0; i < 36; i++) fgetc(fp);\r
-//\r
-// /* read the data */\r
-// fread(ins, structSize, 1, fp);\r
-//\r
-// fclose(fp);\r
-// return (1);\r
-//} /* End of LoadSBI */\r
-
-unsigned short Notes[] = {\r
- 19327 , /* C b */\r
- 18242 , /* C */\r
- 17218 , /* C # ( D b ) */\r
- 16252 , /* D */\r
- 15340 , /* D # ( E b ) */\r
- 14479 , /* E ( F b ) */\r
- 13666 , /* F ( E # ) */\r
- 12899 , /* F # ( G b ) */\r
- 12175 , /* G */\r
- 11492 , /* G # ( A b ) */\r
- 10847 , /* A */\r
- 10238 , /* A # ( B b ) */\r
- 9664 , /* B ( C b ) */\r
- 9121 , /* B # */\r
- 0\r
-};
-\r
-/* test of the routines */\r
-void fmtest(){\r
- enum SCALE test[] = { D4, E4, F4, G4, A4, B4, C4 };\r
-// enum SCALE oct4[] = { 493.88, 466.16, 440, 415.3, 392, 369.99, 349.23, 329.63, 311.13, 293.66, 277.18, 261.63 };\r
- static FMInstrument testInst =\r
-{\r
-0x00, 0x01, /* modulator frequency multiple... 0x20 */\r
-0x00, 0x00, /* modulator frequency level... 0x40 */\r
-0xF0, 0xF0, /* modulator attack/decay... 0x60 */\r
-0x73, 0x73, /* modulator sustain/release... 0x80 */\r
-0x03, 0x00, /* output waveform distortion 0xE0 */\r
-0x36, /* feedback algorithm and strength 0xC0 */\r
-};\r
- int i;\r
- printf("Now testing tune....\n");\r
-// printf("just hit any key 7 times.\n");\r
- FMReset();\r
- FMSetVoice(0, &testInst);
- //extra
-// WriteFM(0xB0, 0x09);
-// WriteFM(0xB3, 0x07);
- //extra
- for(i = 0; i < 7; i++){\r
- FMKeyOn(0, test[i], 4);
- sound(test[i]);\r
- wait(20);\r
-// getche();
- FMKeyOff(0);
- nosound();\r
- wait(1);\r
- }\r
-}
-
-//sound てすと
-int soundtest(){
- enum SCALE test[] = { D4, E4, F4, G4, A4, B4, C4 };\r
- //FMKeyOn(0, test[sq], 4);
- if(sq < 7){\r
- sq++;\r
- }else sq = 0;
- FMKeyOff(0);
- return sq;
-}
\ No newline at end of file
+++ /dev/null
-#ifndef _DOSLIB_SND_H_\r
-#define _DOSLIB_SND_H_\r
-/* C Header File: ADLIB *****************************************************\r
-\r
-Author: Kevin A. Lee\r
-\r
-Last Amended: 27th April, 1993\r
-\r
-Description: Low-level interface to the Adlib (or compatible)\r
- FM sound card. All information gleaned from\r
- Jeffrey S. Lee's "Programming the Adlib/Sound\r
- Blaster FM Music Chips". See Lee's document for\r
- further information.\r
-\r
-Compiled succesfully under Turbo C, Borland C++,\r
-and Microsoft Quick C (all latest versions).\r
-\r
-****************************************************************************/\r
-#include "src\lib\lib_com.h"\r
-\r
-#define NUMVOICE 11\r
-#define FACTOR 1193180\r
-#define OCTAVE 4
-\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 */\r
-\r
-/*\r
-static int percussiveMode = 0,currentBDContents = 0;\r
-//static int opTable[18] = {0,1,2,3,4,5,8,9,10,11,12,13,16,17,18,19,20,21};\r
-static int voiceModulator[11] = {0,1,2,6,7,8,12,16,14,17,13};\r
-static int voiceCarrier[9] = {3,4,5,9,10,11,15,16,17};\r
-*/\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
-* I am not sure where it starts and ends so I have had to guess.\r
-* However it SEEMS! to work. Each array has two values, one for\r
-* each operator.\r
-*/\r
-typedef struct{\r
- byte SoundCharacteristic[2]; /* modulator frequency multiple... */\r
- byte Level[2]; /* modulator frequency level... */\r
- byte AttackDecay[2]; /* modulator attack/decay... */\r
- byte SustainRelease[2]; /* modulator sustain/release... */\r
- byte WaveSelect[2]; /* output waveform distortion */\r
- byte Feedback; /* feedback algorithm and strength */\r
-} FMInstrument;\r
-\r
-/*\r
-* Enumerated F-Numbers (in octave 4) for the chromatic scale.\r
-*/\r
-/*enum oct{\r
- B4 = 493.88,\r
- B4b = 466.16,\r
- A4 = 440,\r
- A4b = 415.3,\r
- G4 = 392,\r
- G4b = 369.99,\r
- F4 = 349.23,\r
- E4 = 329.63,\r
- E4b = 311.13,\r
- D4 = 293.66,\r
- D4b = 277.18,\r
- C4 = 261.63,\r
- A0 = 27.50\r
-};*/\r
-enum SCALE{\r
- B4 = 0x1EE,\r
- B4b = 0x1D2,\r
- A4 = 440,\r
- A4b = 0x19F,\r
- G4 = 0x188,\r
- G4b = 0x172,\r
- F4 = 0x15D,\r
- E4 = 0x14A,\r
- E4b = 0x137,\r
- D4 = 0x126,\r
- D4b = 0x115,\r
- C4 = 0x106,\r
- A0 = 0x7F2\r
-};
-\r
-/* function prototyping */\r
-void WriteFM(int reg, int value);\r
-int ReadFM(void);\r
-int AdlibExists(void);\r
-void FMReset(/*int percusiveMode*/); /* Resets the card, quiets all voices, sets the percussive mode state */\r
-void FMKeyOff(int voice);\r
-void FMKeyOn(int voice, int freq, int octave);\r
-void FMVoiceVolume(int voice, int vol);\r
-void FMSetVoice(int voiceNum, FMInstrument *ins);\r
-/* Remember: percussion instruments must be assigned only to the correct voice number. */\r
-//void FMSetPercusiveMode(int state);\r
-//int LoadSBI(char filename[], FMInstrument *ins);\r
-void fmtest(void);
-int soundtest();\r
-#endif/*_DOSLIB_SND_H_*/
\ No newline at end of file
+++ /dev/null
-// 16 core version 0.0009.84a // wwww
-//Game name: "話の地球"//very 1st game
-//Series name: "CRAZY ACORN PROJECT"//temperary name
-//Working name: "Project 16"//\r
-#include <list>\r
-#include <iostream>\r
-#include <stdlib.h>\r
-\r
-#include "src\eng_core.h"\r
-\r
-int main(/*int argc, const char* argv[]*/)\r
-{\r
-\r
- engine::Core c;\r
- c.run();\r
-\r
- //int a;\r
- //std::cin >> a;\r
- return EXIT_SUCCESS;\r
-}
\ No newline at end of file
+++ /dev/null
-#include "src\timer.h"\r
-#include <time.h>\r
-\r
-namespace engine {\r
- Timer::Timer()\r
- {\r
- //default constructor\r
- }\r
-\r
- clock_t Timer::start_timer()\r
- {\r
- //time(&(this->t));\r
- this->t = clock();\r
- return this->t;\r
- }\r
-\r
- double Timer::elapsed_timer()\r
- {\r
- return static_cast<double>(clock() - this->t) / CLOCKS_PER_SEC;//difftime(time(NULL), this->t);\r
- }\r
-\r
- double Timer::time_in_seconds()\r
- {\r
- return static_cast<double>(this->t) / CLOCKS_PER_SEC;\r
- }\r
-\r
- double Timer::time_in_seconds(time_t in_t)\r
- {\r
- return static_cast<double>(in_t) / CLOCKS_PER_SEC;\r
- }\r
-\r
- clock_t Timer::_time()\r
- {\r
- return this->t;\r
- }\r
-\r
- Timer::~Timer()\r
- {\r
- //deconstructor\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-#ifndef _TIMER_H_\r
-#define _TIMER_H_\r
-#include <time.h>\r
-\r
-namespace engine {\r
- class Timer\r
- {\r
- public:\r
- Timer();\r
- clock_t start_timer();\r
- double elapsed_timer();\r
- double time_in_seconds();\r
- double time_in_seconds(time_t in_t);\r
- clock_t _time();\r
- ~Timer();\r
- protected:\r
- private:\r
- clock_t t;\r
- };\r
-}\r
-\r
-#endif
\ No newline at end of file
--- /dev/null
+#include "modex16.h"\r
+#include <stdio.h>\r
+\r
+word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
+void main() {\r
+ int i, j;\r
+ word start, end;\r
+ page_t page, page2;\r
+ byte *pal, *pal2=NULL;\r
+\r
+ /* load our palette */\r
+ modexLoadPalFile("gfx.pal", &pal2);\r
+\r
+ /* save the palette */\r
+ pal = modexNewPal();\r
+ modexPalSave(pal);\r
+ modexFadeOff(1, pal);\r
+ modexPalBlack();\r
+\r
+ modexEnter();\r
+ modexPalBlack();\r
+\r
+ /* set up the page, but with 16 pixels on all borders in offscreen mem */\r
+ page=modexDefaultPage();\r
+ page2 = modexNextPage(&page);\r
+ page.width += 32;\r
+ page.height += 32;\r
+\r
+\r
+ /* fill the page with one color, but with a black border */\r
+ modexShowPage(&page2);\r
+ modexClearRegion(&page, 16, 16, SCREEN_WIDTH, SCREEN_HEIGHT, 128);\r
+ modexClearRegion(&page, 32, 32, SCREEN_WIDTH-32, SCREEN_HEIGHT-32, 42);\r
+ modexClearRegion(&page, 48, 48, SCREEN_WIDTH-64, SCREEN_HEIGHT-64, 128);\r
+ modexShowPage(&page);\r
+\r
+ /* fade in */\r
+ modexFadeOn(1, pal2);\r
+\r
+\r
+ start = *clock;\r
+ for(i=0; i<5; i++) {\r
+ /* go right */\r
+ for(j=0; j<32; j++) {\r
+ page.dx++;\r
+ modexShowPage(&page);\r
+ }\r
+ /* go left */\r
+ for(j=0; j<32; j++) {\r
+ page.dx--;\r
+ modexShowPage(&page);\r
+ }\r
+ /* go up */\r
+ for(j=0; j<32; j++) {\r
+ page.dy++;\r
+ modexShowPage(&page);\r
+ }\r
+\r
+ /* go down */\r
+ for(j=0; j<32; j++) {\r
+ page.dy--;\r
+ modexShowPage(&page);\r
+ }\r
+ }\r
+\r
+ end = *clock;\r
+\r
+ /* fade back to text mode */\r
+ modexFadeOff(1, pal2);\r
+ modexPalBlack();\r
+ modexLeave();\r
+ modexPalBlack();\r
+ modexFadeOn(1, pal);\r
+}\r
--- /dev/null
+#include "modex16.h"\r
+\r
+word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
+void main() {\r
+ int i;\r
+ word start;\r
+ page_t page;\r
+\r
+ page=modexDefaultPage();\r
+\r
+ modexEnter();\r
+ start = *clock;\r
+ for(i=0; i<500; i++) {\r
+ modexShowPage(&page);\r
+ }\r
+ modexLeave();\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Just some handy typedefs that make it easier to think about the low\r
+ * level code\r
+ */\r
+\r
+typedef unsigned char byte;\r
+typedef unsigned short word;\r
+typedef unsigned long dword;\r
+typedef signed char sbyte;\r
+typedef signed short sword;\r
+typedef signed long sdword;\r
+++ /dev/null
-del *.err\r
-del *.smp\r
-wmake -f proj16.mk -e -h > 16.err\r
+++ /dev/null
-FIL dos_comm.obj,eng_ai.obj,eng_comm.obj,eng_core.obj,eng_gfx.obj,eng_snd.obj,dos_gfx.obj,dos_opl2.obj,lib_com.obj,main.obj,timer.obj\r
-\r
+++ /dev/null
-project : C:\Z\16\core16.exe .SYMBOLIC\r
-\r
-!include C:\Z\16\proj16.mk1\r
+++ /dev/null
-!define BLANK ""\r
-C:\Z\16\dos_comm.obj : C:\Z\16\src\lib\dos_comm.c .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wcc src\lib\dos_comm.c -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol&\r
- -ol+ -oh -om -d2 -bt=dos -fo=.obj -ml\r
-\r
-C:\Z\16\eng_ai.obj : C:\Z\16\src\eng_ai.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\eng_ai.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -ol&\r
-+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\eng_comm.obj : C:\Z\16\src\eng_comm.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\eng_comm.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -&\r
-ol+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\eng_core.obj : C:\Z\16\src\eng_core.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\eng_core.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -&\r
-ol+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\eng_gfx.obj : C:\Z\16\src\eng_gfx.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\eng_gfx.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -o&\r
-l+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\eng_snd.obj : C:\Z\16\src\eng_snd.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\eng_snd.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -o&\r
-l+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\dos_gfx.obj : C:\Z\16\src\lib\dos_gfx.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\lib\dos_gfx.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -o&\r
-l -ol+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\dos_opl2.obj : C:\Z\16\src\lib\dos_opl2.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\lib\dos_opl2.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -&\r
-ol -ol+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\lib_com.obj : C:\Z\16\src\lib\lib_com.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\lib\lib_com.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -o&\r
-l -ol+ -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\main.obj : C:\Z\16\src\main.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\main.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -ol+ &\r
--oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\timer.obj : C:\Z\16\src\timer.cpp .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- *wpp src\timer.cpp -i="c:\fdos\WATCOM/h" -w4 -e25 -zkl -zq -otexan -ol -ol+&\r
- -oh -om -d2 -bt=dos -fo=.obj -ml -xs -xr\r
-\r
-C:\Z\16\core16.exe : C:\Z\16\dos_comm.obj C:\Z\16\eng_ai.obj C:\Z\16\eng_com&\r
-m.obj C:\Z\16\eng_core.obj C:\Z\16\eng_gfx.obj C:\Z\16\eng_snd.obj C:\Z\16\d&\r
-os_gfx.obj C:\Z\16\dos_opl2.obj C:\Z\16\lib_com.obj C:\Z\16\main.obj C:\Z\16&\r
-\timer.obj C:\Z\16\src\eng_ai.h C:\Z\16\src\eng_comm.h C:\Z\16\src\eng_core.&\r
-h C:\Z\16\src\eng_gfx.h C:\Z\16\src\eng_snd.h C:\Z\16\src\engine.h C:\Z\16\s&\r
-rc\lib\dos_comm.h C:\Z\16\src\lib\dos_gfx.h C:\Z\16\src\lib\lib_com.h C:\Z\1&\r
-6\src\lib\opl2.h C:\Z\16\src\timer.h .AUTODEPEND\r
- @C:\r
- cd C:\Z\16\r
- @%write core16.lk1 FIL dos_comm.obj,eng_ai.obj,eng_comm.obj,eng_core.obj,en&\r
-g_gfx.obj,eng_snd.obj,dos_gfx.obj,dos_opl2.obj,lib_com.obj,main.obj,timer.ob&\r
-j\r
- @%append core16.lk1 \r
- *wlink name core16 d all sys dos op m op maxe=25 op q op symf @core16.lk1\r
-\r
+++ /dev/null
-40\r
-targetIdent\r
-0\r
-MProject\r
-1\r
-MComponent\r
-0\r
-2\r
-WString\r
-3\r
-EXE\r
-3\r
-WString\r
-5\r
-de6e9\r
-1\r
-0\r
-1\r
-4\r
-MCommand\r
-0\r
-5\r
-MCommand\r
-0\r
-6\r
-MItem\r
-10\r
-core16.exe\r
-7\r
-WString\r
-3\r
-EXE\r
-8\r
-WVList\r
-0\r
-9\r
-WVList\r
-2\r
-10\r
-ActionStates\r
-11\r
-WString\r
-5\r
-&Make\r
-12\r
-WVList\r
-0\r
-13\r
-ActionStates\r
-14\r
-WString\r
-7\r
-Sam&ple\r
-15\r
-WVList\r
-0\r
--1\r
-1\r
-1\r
-0\r
-16\r
-WPickList\r
-25\r
-17\r
-MItem\r
-3\r
-*.c\r
-18\r
-WString\r
-4\r
-COBJ\r
-19\r
-WVList\r
-8\r
-20\r
-MRState\r
-21\r
-WString\r
-3\r
-WCC\r
-22\r
-WString\r
-37\r
-?????No double-byte character support\r
-1\r
-0\r
-23\r
-MRState\r
-24\r
-WString\r
-3\r
-WCC\r
-25\r
-WString\r
-22\r
-?????Current code page\r
-1\r
-1\r
-26\r
-MRState\r
-27\r
-WString\r
-3\r
-WCC\r
-28\r
-WString\r
-21\r
-?????No optimizations\r
-1\r
-0\r
-29\r
-MRState\r
-30\r
-WString\r
-3\r
-WCC\r
-31\r
-WString\r
-26\r
-?????Fastest possible code\r
-1\r
-1\r
-32\r
-MCState\r
-33\r
-WString\r
-3\r
-WCC\r
-34\r
-WString\r
-23\r
-?????Loop optimizations\r
-1\r
-1\r
-35\r
-MCState\r
-36\r
-WString\r
-3\r
-WCC\r
-37\r
-WString\r
-19\r
-?????Loop unrolling\r
-1\r
-1\r
-38\r
-MCState\r
-39\r
-WString\r
-3\r
-WCC\r
-40\r
-WString\r
-33\r
-?????Allow repeated optimizations\r
-1\r
-1\r
-41\r
-MCState\r
-42\r
-WString\r
-3\r
-WCC\r
-43\r
-WString\r
-23\r
-?????Math optimizations\r
-1\r
-1\r
-44\r
-WVList\r
-0\r
--1\r
-1\r
-1\r
-0\r
-45\r
-MItem\r
-18\r
-src\lib\dos_comm.c\r
-46\r
-WString\r
-4\r
-COBJ\r
-47\r
-WVList\r
-0\r
-48\r
-WVList\r
-0\r
-17\r
-1\r
-1\r
-0\r
-49\r
-MItem\r
-5\r
-*.cpp\r
-50\r
-WString\r
-6\r
-CPPOBJ\r
-51\r
-WVList\r
-8\r
-52\r
-MRState\r
-53\r
-WString\r
-3\r
-WPP\r
-54\r
-WString\r
-37\r
-?????No double-byte character support\r
-1\r
-0\r
-55\r
-MRState\r
-56\r
-WString\r
-3\r
-WPP\r
-57\r
-WString\r
-22\r
-?????Current code page\r
-1\r
-1\r
-58\r
-MRState\r
-59\r
-WString\r
-3\r
-WPP\r
-60\r
-WString\r
-21\r
-?????No optimizations\r
-1\r
-0\r
-61\r
-MRState\r
-62\r
-WString\r
-3\r
-WPP\r
-63\r
-WString\r
-26\r
-?????Fastest possible code\r
-1\r
-1\r
-64\r
-MCState\r
-65\r
-WString\r
-3\r
-WPP\r
-66\r
-WString\r
-23\r
-?????Loop optimizations\r
-1\r
-1\r
-67\r
-MCState\r
-68\r
-WString\r
-3\r
-WPP\r
-69\r
-WString\r
-19\r
-?????Loop unrolling\r
-1\r
-1\r
-70\r
-MCState\r
-71\r
-WString\r
-3\r
-WPP\r
-72\r
-WString\r
-33\r
-?????Allow repeated optimizations\r
-1\r
-1\r
-73\r
-MCState\r
-74\r
-WString\r
-3\r
-WPP\r
-75\r
-WString\r
-23\r
-?????Math optimizations\r
-1\r
-1\r
-76\r
-WVList\r
-1\r
-77\r
-ActionStates\r
-78\r
-WString\r
-5\r
-&Make\r
-79\r
-WVList\r
-1\r
-80\r
-MCState\r
-81\r
-WString\r
-5\r
-WMAKE\r
-82\r
-WString\r
-26\r
-?????Echo progress of work\r
-1\r
-1\r
--1\r
-1\r
-1\r
-0\r
-83\r
-MItem\r
-14\r
-src\eng_ai.cpp\r
-84\r
-WString\r
-6\r
-CPPOBJ\r
-85\r
-WVList\r
-0\r
-86\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-87\r
-MItem\r
-16\r
-src\eng_comm.cpp\r
-88\r
-WString\r
-6\r
-CPPOBJ\r
-89\r
-WVList\r
-0\r
-90\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-91\r
-MItem\r
-16\r
-src\eng_core.cpp\r
-92\r
-WString\r
-6\r
-CPPOBJ\r
-93\r
-WVList\r
-0\r
-94\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-95\r
-MItem\r
-15\r
-src\eng_gfx.cpp\r
-96\r
-WString\r
-6\r
-CPPOBJ\r
-97\r
-WVList\r
-0\r
-98\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-99\r
-MItem\r
-15\r
-src\eng_snd.cpp\r
-100\r
-WString\r
-6\r
-CPPOBJ\r
-101\r
-WVList\r
-0\r
-102\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-103\r
-MItem\r
-19\r
-src\lib\dos_gfx.cpp\r
-104\r
-WString\r
-6\r
-CPPOBJ\r
-105\r
-WVList\r
-0\r
-106\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-107\r
-MItem\r
-20\r
-src\lib\dos_opl2.cpp\r
-108\r
-WString\r
-6\r
-CPPOBJ\r
-109\r
-WVList\r
-0\r
-110\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-111\r
-MItem\r
-19\r
-src\lib\lib_com.cpp\r
-112\r
-WString\r
-6\r
-CPPOBJ\r
-113\r
-WVList\r
-0\r
-114\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-115\r
-MItem\r
-12\r
-src\main.cpp\r
-116\r
-WString\r
-6\r
-CPPOBJ\r
-117\r
-WVList\r
-0\r
-118\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-119\r
-MItem\r
-13\r
-src\timer.cpp\r
-120\r
-WString\r
-6\r
-CPPOBJ\r
-121\r
-WVList\r
-0\r
-122\r
-WVList\r
-0\r
-49\r
-1\r
-1\r
-0\r
-123\r
-MItem\r
-3\r
-*.h\r
-124\r
-WString\r
-3\r
-NIL\r
-125\r
-WVList\r
-0\r
-126\r
-WVList\r
-0\r
--1\r
-1\r
-0\r
-0\r
-127\r
-MItem\r
-12\r
-src\eng_ai.h\r
-128\r
-WString\r
-3\r
-NIL\r
-129\r
-WVList\r
-0\r
-130\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-131\r
-MItem\r
-14\r
-src\eng_comm.h\r
-132\r
-WString\r
-3\r
-NIL\r
-133\r
-WVList\r
-0\r
-134\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-135\r
-MItem\r
-14\r
-src\eng_core.h\r
-136\r
-WString\r
-3\r
-NIL\r
-137\r
-WVList\r
-0\r
-138\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-139\r
-MItem\r
-13\r
-src\eng_gfx.h\r
-140\r
-WString\r
-3\r
-NIL\r
-141\r
-WVList\r
-0\r
-142\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-143\r
-MItem\r
-13\r
-src\eng_snd.h\r
-144\r
-WString\r
-3\r
-NIL\r
-145\r
-WVList\r
-0\r
-146\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-147\r
-MItem\r
-12\r
-src\engine.h\r
-148\r
-WString\r
-3\r
-NIL\r
-149\r
-WVList\r
-0\r
-150\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-151\r
-MItem\r
-18\r
-src\lib\dos_comm.h\r
-152\r
-WString\r
-3\r
-NIL\r
-153\r
-WVList\r
-0\r
-154\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-155\r
-MItem\r
-17\r
-src\lib\dos_gfx.h\r
-156\r
-WString\r
-3\r
-NIL\r
-157\r
-WVList\r
-0\r
-158\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-159\r
-MItem\r
-17\r
-src\lib\lib_com.h\r
-160\r
-WString\r
-3\r
-NIL\r
-161\r
-WVList\r
-0\r
-162\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-163\r
-MItem\r
-14\r
-src\lib\opl2.h\r
-164\r
-WString\r
-3\r
-NIL\r
-165\r
-WVList\r
-0\r
-166\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
-167\r
-MItem\r
-11\r
-src\timer.h\r
-168\r
-WString\r
-3\r
-NIL\r
-169\r
-WVList\r
-0\r
-170\r
-WVList\r
-0\r
-123\r
-1\r
-1\r
-0\r
+++ /dev/null
-40\r
-projectIdent\r
-0\r
-VpeMain\r
-1\r
-WRect\r
--40\r
-0\r
-10320\r
-9946\r
-2\r
-MProject\r
-3\r
-MCommand\r
-0\r
-4\r
-MCommand\r
-0\r
-1\r
-5\r
-WFileName\r
-10\r
-proj16.tgt\r
-6\r
-WVList\r
-1\r
-7\r
-VComponent\r
-8\r
-WRect\r
-0\r
-0\r
-5700\r
-4293\r
-0\r
-0\r
-9\r
-WFileName\r
-10\r
-proj16.tgt\r
-0\r
-0\r
-7\r
+++ /dev/null
-ide2make -p proj16.wpj -h 8 proj16.tgt\r