vgmtest.exe &
scroll.exe &
zcroll.exe &
+ inputest.exe &
vrstest.exe
TESTEXEC2 = &
- inputest.exe &
maptest.exe &
fmemtest.exe &
fonttest.exe &
input test\r
*/\r
#include "src/lib/16_in.h"\r
+#include "src/lib/16_tail.h"\r
\r
void\r
main(int argc, char *argv[])\r
global_game_variables_t gvar;\r
player_t player[MaxPlayers];\r
//extern struct inconfig inpu;\r
- dbg_testkeyin=1;\r
+ dbg_testkeyin=0;\r
dbg_testcontrolnoisy=1;\r
- IN_Startup();\r
- IN_Default(0,&player,ctrl_Joystick1);\r
- IN_SetControlType(0,&player,ctrl_Joystick1);\r
- //while(!IN_KeyDown(sc_Escape))\r
+ dbg_noplayerinpu=1;\r
+ if(!dbg_noplayerinpu)\r
+ {\r
+ IN_Startup();\r
+ IN_Default(0,&player,ctrl_Joystick1);\r
+ IN_SetControlType(/*0,*/&player,ctrl_Joystick1);\r
+ }\r
player[0].q=1;\r
player[0].d=2;\r
player[0].persist_aniframe=0;\r
player[0].speed=4;\r
start_timer(&gvar);\r
+ nibbletest();\r
+ if(dbg_noplayerinpu) getch();\r
+ booleantest();\r
+ //printf("nibble size is %u\n", sizeof(nibble));\r
+ if(!dbg_noplayerinpu){\r
+ printf("dbg_testkeyin=%u dbg_testcontrolnoisy=%u dbg_noplayerinpu=%u\nloop if this is not responsive then please KILL or reset machine sorry!!\n", dbg_testkeyin, dbg_testcontrolnoisy, dbg_noplayerinpu);\r
while(!IN_KeyDown(sc_Escape))\r
{\r
- //shinkutxt(&gvar);\r
- IN_ReadControl(0,&player);\r
+ shinkutxt(&gvar);\r
+ IN_ReadControl(/*0,*/&player);\r
#define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1;\r
switch(player[0].d)\r
{\r
//IN_Ack();\r
}\r
}\r
- IN_Shutdown();\r
+ IN_Shutdown(); }\r
//printf("%u\n", in.Keyboard[sc_Escape]);\r
printf("inputest.exe ");\r
printf("version %s\n", VERSION);\r
printf("testkeyin=%u\n", dbg_testkeyin);\r
printf("testcontrolnoisy=%u\n", dbg_testcontrolnoisy);\r
+ printf("dbg_noplayerinpu=%u\n", dbg_noplayerinpu);\r
}\r
+#include "src/lib/16_dbg.h"\r
+//#include "src/16.h"\r
+\r
+\r
+#ifdef __DEBUG__\r
+#ifdef __DEBUG_PM__\r
+boolean dbg_debugpm=0;\r
+#endif\r
+#ifdef __DEBUG_InputMgr__\r
+boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_noplayerinpu=0;\r
+#endif\r
+#endif\r
\r
-#include "src/16.h"\r
\r
// TODO: Could we also provide a build mode to emit debug to the "Bochs E9 hack?"\r
#ifdef DEBUGSERIAL\r
unsigned char _DEBUG_INITed = 0;\r
struct info_8250 *_DEBUG_uart = NULL;\r
\r
-#ifdef __DEBUG__\r
-#ifdef __DEBUG_PM__\r
-boolean dbg_debugpm=0;\r
-#endif\r
-#ifdef __DEBUG_InputMgr__\r
-boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
-#endif\r
-#endif\r
-\r
int _DEBUG_INIT() {\r
if (!_DEBUG_INITed) {\r
unsigned int i;\r
#ifndef _SRC_LIB_16_DBG\r
#define _SRC_LIB_16_DBG\r
\r
-//#define __DEBUG__\r
+#include "src/lib/16_head.h"\r
+#include "src/lib/16_tdef.h"\r
+\r
+#define __DEBUG__\r
+#define __DEBUG_InputMgr__\r
//#define __DEBUG_PM__\r
//#define __DEBUG_MM__\r
\r
+\r
#ifdef __DEBUG__\r
#ifdef __DEBUG_PM__\r
-extern boolean dbg_debugpm=0;\r
+extern boolean dbg_debugpm;\r
#endif\r
#ifdef __DEBUG_InputMgr__\r
-extern boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
+extern boolean dbg_testkeyin,dbg_testcontrolnoisy,dbg_noplayerinpu;\r
#endif\r
#endif\r
\r
typedef signed long int sdiword;\r
\r
typedef enum {false,true} boolean;\r
+typedef enum {ichi,ni,san,yon,go,roku,shichi,hachi,kyu,ju,juichi,juni,jusan,juyon,jugo,juroku} nibble;\r
+//typedef unsigned nibb:4 nibble;\r
+\r
+#define HI_NIBBLE(b) (((b) >> 4) & 0x0F)\r
+#define LO_NIBBLE(b) ((b) & 0x0F)\r
/*typedef unsigned memseg;\r
\r
memptr should be replaced by memseg in code.\r
gvar->mm.mmstarted=0;\r
gvar->pm.PMStarted=0;\r
MM_Startup(gvar);\r
+if(!dbg_noplayerinpu)\r
IN_Startup(gvar);\r
PM_Startup(gvar);\r
PM_UnlockMainMem(gvar);\r
CA_Startup(gvar);\r
#ifdef __WATCOMC__\r
start_timer(gvar);\r
-\r
#endif\r
\r
}\r
void Shutdown16(global_game_variables_t *gvar)\r
{\r
PM_Shutdown(gvar);\r
+if(!dbg_noplayerinpu)\r
IN_Shutdown(gvar);\r
CA_Shutdown(gvar);\r
MM_Shutdown(gvar);\r
#endif\r
\r
//===========================================================================\r
+\r
+const char *nibble_to_binary(nibble x)\r
+{\r
+ static char b[9];\r
+ int z;\r
+\r
+ b[0] = '\0';\r
+ for (z = 8; z > 0; z >>= 1)\r
+ {\r
+ strcat(b, ((x & z) == z) ? "1" : "0");\r
+ }\r
+ return b;\r
+}\r
+\r
+const char *boolean_to_binary(boolean x)\r
+{\r
+ static char b[9];\r
+ int z;\r
+\r
+ b[0] = '\0';\r
+ for (z = 1; z > 0; z >>= 1)\r
+ {\r
+ strcat(b, ((x & z) == z) ? "1" : "0");\r
+ }\r
+ return b;\r
+}\r
+\r
+void nibbletest()\r
+{\r
+ nibble pee;\r
+ printf("nibbletest\n");\r
+ /* nibble to binary string */\r
+ for(pee=0;pee<18;pee++)\r
+ printf(" %u %s\n", pee, nibble_to_binary(pee));\r
+ printf(" sizeof(nibble)=%s\n", nibble_to_binary(sizeof(nibble)));\r
+ printf("end of nibble test\n");\r
+}\r
+\r
+void booleantest()\r
+{\r
+ boolean pee;\r
+ printf("booleantest\n");\r
+ /* boolean to binary string */\r
+ for(pee=0;pee<4;pee++)\r
+ printf(" %u %s\n", pee, boolean_to_binary(pee));\r
+ printf(" sizeof(boolean)=%s\n", boolean_to_binary(sizeof(boolean)));\r
+ printf("end of boolean test\n");\r
+}\r
#ifdef __WATCOMC__\r
void Quit (char *error);\r
#endif\r
+void nibbletest();\r
+void booleantest();\r
\r
#endif\r
byte *palette;\r
} planar_buf_t;\r
\r
-\r
-enum direction {STOP, UP, DOWN, LEFT, RIGHT};\r
typedef struct {\r
int dx, dy; //backwards compait\r
- word id; /* the Identification number of the page~ For layering~ */\r
+ nibble id; /* the Identification number of the page~ For layering~ */\r
byte far* data; /* the data for the page */\r
word sw; /* screen width */\r
word sh; /* screen heigth */\r
word stridew; /*width/4*/\r
word pagesize; /* page size */\r
word pi; /* incremention page by this much to preserve location */\r
- word delta; // How much should we shift the page for smooth scrolling\r
- enum direction d; // Direction we should shift the page\r
+ sword delta; // How much should we shift the page for smooth scrolling\r
+ //enum direction d; // Direction we should shift the page\r
} page_t;\r
typedef struct\r
{\r
}\r
}\r
\r
-unsigned char shinku_fps_indicator_page = 2;\r
boolean pageflipflop = 1;\r
-boolean pageploop = 1;\r
-\r
-/* sync */\r
-void shinku(global_game_variables_t *gv)\r
-{\r
- word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen\r
- word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen\r
- word w = 64, h = 8, col = 7, bgcol = 0, type = 1;\r
- byte o,o2,i;\r
- if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
- {\r
- sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
- //modexClearRegion(&(gv->video.page[shinku_fps_indicator_page]), x, y, w, h, 45);\r
- modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, gv->pee);\r
- gv->kurokku.tiku=0;\r
- }else //copy dat sheet\r
- gv->kurokku.tiku++;\r
-\r
- switch(gv->kurokku.fpscap)\r
- {\r
- case 0:\r
- gv->kurokku.frames_per_second=1;\r
- break;\r
- case 1:\r
- //turn this off if XT\r
- vga_wait_for_vsync();\r
- gv->kurokku.frames_per_second=60;\r
- break;\r
- }\r
- /*\r
- if(pageflipflop){\r
- if(gv->video.r){\r
- if(!pageploop) modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);\r
- modexShowPage(&(gv->video.page[gv->video.p]));\r
- if(!pageploop) gv->video.p=!gv->video.p;\r
- gv->video.r=!gv->video.r;\r
- }\r
- }*/\r
-}\r
\r
void near animatePlayer(map_view_t *pip, player_t *player, sword scrollswitch)\r
{\r
#include "src/lib/16_timer.h"\r
#include "src/lib/wcpu/wcpu.h"\r
#include "src/lib/mapread.h"\r
+#include "src/lib/16_dbg.h"\r
\r
//#define FADE\r
#define MODEX //this is for mode x initiating\r
\r
+boolean dbg_noplayerinpu=1;\r
+\r
//word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
//bitmap_t *p;\r
global_game_variables_t gvar;\r
sword bakapee;\r
pan_t pan;\r
//debugswitches\r
-boolean panswitch=0;\r
+boolean panswitch=1;\r
//extern boolean pageflipflop=1;\r
unsigned int i;\r
const char *cpus;\r
\r
#endif\r
/* input! */\r
+ if(!dbg_noplayerinpu)\r
+ {\r
IN_Startup();\r
IN_Default(0,&player,ctrl_Joystick);\r
//IN_Default(1,&player,ctrl_Joystick);\r
+ }\r
\r
/* save the palette */\r
#ifdef MODEX\r
modexFadeOn(4, gpal);\r
#endif\r
#endif\r
+ if(!dbg_noplayerinpu)\r
while(!IN_KeyDown(sc_Escape) && player[0].hp>0)\r
{\r
shinku(&gvar);\r
//if(IN_KeyDown(11)){ modexPalOverscan(15); }\r
if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break; //incase things go out of sync!\r
}\r
+ else\r
+ while(!kbhit())\r
+ {\r
+ shinku(&gvar);\r
+ }\r
\r
/* fade back to text mode */\r
/* but 1st lets save the game palette~ */\r
#endif\r
VGAmodeX(0, 1, &gvar);\r
#endif\r
+ if(!dbg_noplayerinpu)\r
IN_Shutdown();\r
printf("\nProject 16 scroll.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
#include "src/lib/16_timer.h"\r
#include "src/lib/wcpu/wcpu.h"\r
#include "src/lib/16render.h"\r
+#include "src/lib/16_dbg.h"\r
\r
-//TODO: known issues the array dependent mv stuff and player arrays\r
+#define MODEXZ\r
+boolean dbg_noplayerinpu=1;\r
\r
+//TODO: known issues the array dependent mv stuff and player arrays\r
global_game_variables_t gvar;\r
static map_t map;\r
player_t *player;\r
\r
pan.pn=0;\r
// OK, this one takes hellova time and needs to be done in farmalloc or MM_...\r
- //USE MM AND CA AND PM WWWWWWWW\r
+ //TODO: USE MM AND CA AND PM WWWWWWWW\r
player = malloc(sizeof(player_t));\r
player->ent = malloc(sizeof(entity_t));\r
player->ent->spri = malloc(sizeof(struct sprite));\r
read_vrs(&gvar, "data/spri/chikyuu.vrs", player->ent->spri->spritesheet); printf("sprite loaded\n");\r
\r
// input!\r
+if(!dbg_noplayerinpu)\r
+{\r
IN_Default(0, player,ctrl_Joystick); printf("IN_defaulted\n");\r
+}\r
\r
// save the palette\r
#ifdef FADE\r
#endif\r
textInit();\r
VGAmodeX(bakapee, 1, &gvar);\r
- #ifdef MODEXZ\r
+#ifdef MODEXZ\r
#ifdef FADE\r
modexPalBlack(); //reset the palette~\r
printf("VGA\n");\r
#endif\r
\r
// setup camera and screen~\r
+if(dbg_noplayerinpu)\r
+{\r
+ //sprintf(&gvar.pee, "press a key for video setup");\r
+ strcpy(global_temp_status_text, "press a key for video setup");\r
+ modexprint(mv->page, 0, 64, 1, 7, 0, global_temp_status_text);\r
+ getch();\r
+}\r
modexHiganbanaPageSetup(&gvar.video);\r
mv->page = &gvar.video.page[0];\r
mv->map = ↦\r
mv->video = &gvar.video;\r
mv->pan = &pan;\r
player->ent->spri->x = player->ent->spri->y = 20;\r
- printf("pages ok\n");\r
\r
// set up paging\r
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen\r
modexFadeOn(4, gpal);\r
#endif\r
printf("LOOP\n");\r
+ if(!dbg_noplayerinpu)\r
while(!IN_KeyDown(sc_Escape) && player->hp>0)\r
{\r
shinku(&gvar);\r
player->hp = 0;\r
}\r
\r
+ else\r
+ while(!kbhit())\r
+ {\r
+ shinku(&gvar);\r
+ }\r
+\r
/* fade back to text mode */\r
/* but 1st lets save the game palette~ */\r
#ifdef FADE\r