DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ)
VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
-16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) timer.$(OBJ)
+16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ)
GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ)
mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c
wcl $(FLAGS) -c $(SRCLIB)mapread.c
-timer.$(OBJ): $(SRCLIB)timer.h $(SRCLIB)timer.c
- wcl $(FLAGS) -c $(SRCLIB)timer.c
+16_timer.$(OBJ): $(SRCLIB)16_timer.h $(SRCLIB)16_timer.c
+ wcl $(FLAGS) -c $(SRCLIB)16_timer.c
16_in.$(OBJ): $(SRCLIB)16_in.h $(SRCLIB)16_in.c
wcl $(FLAGS) -c $(SRCLIB)16_in.c
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & 0gwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
void\r
main(int argc, char *argv[])\r
{\r
+ global_game_variables_t gvar;\r
player_t player[MaxPlayers];\r
//extern struct inconfig inpu;\r
testkeyin=0;\r
player[0].d=2;\r
player[0].persist_aniframe=0;\r
player[0].speed=4;\r
- //player[0].kd[0]=2; player[0].kd[1]=2;\r
+ start_timer(&gvar);\r
while(!IN_KeyDown(sc_Escape))\r
{\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
+ 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
//right movement\r
//printf("%u\n", IN_KeyDown(sc_Escape));\r
//if(\r
IN_qb(sc_9);//>0) printf("IN_qb(sc_9)=%u\n", IN_qb(sc_9));\r
+ if(IN_KeyDown(88)) //speed\r
+ {\r
+ switch(gvar.kurokku.fpscap)\r
+ {\r
+ case 0:\r
+ gvar.kurokku.fpscap=1;\r
+ break;\r
+ case 1:\r
+ gvar.kurokku.fpscap=0;\r
+ break;\r
+ }\r
+ //IN_Ack();\r
+ }\r
}\r
IN_Shutdown();\r
//printf("%u\n", in.Keyboard[sc_Escape]);\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
typedef void _seg * memptr;\r
#endif\r
\r
+#define INPUT_STATUS_1 0x03da\r
+\r
/* local function */\r
void wait(clock_t wait);\r
\r
mx = motion_Left,my = motion_Down;\r
else if (Keyboard[def->downright])\r
mx = motion_Right,my = motion_Down;*/\r
- if(DIRECTIONIFELSEGFXTEST)\r
+ if(DIRECTIONIFELSE)\r
{\r
if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]))\r
\r
#include <string.h>\r
#include "src/lib/16_head.h"\r
-#include "src/lib/timer.h"\r
+#include "src/lib/16_timer.h"\r
#include "src/lib/bitmap.h"\r
#include "src/lib/planar.h"\r
\r
//if else for gfxtesting and direction\r
//player[pn].d == 2 ||\r
//player[pn].d != 2 ||\r
-#define DIRECTIONIFELSEGFXTEST (player[pn].info.dir == 2)\r
-#define NDIRECTIONIFELSEGFXTEST (player[pn].info.dir != 2)\r
+#define DIRECTIONIFELSE (player[pn].info.dir == 2)\r
+//#define NDIRECTIONIFELSE (player[pn].info.dir != 2)\r
\r
#define KeyInt 9 // The keyboard ISR number\r
\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
*\r
*/\r
\r
-#include "src/lib/timer.h"\r
+#include "src/lib/16_timer.h"\r
\r
clock_t start_timer(global_game_variables_t *gv)\r
{\r
{\r
return (in_t) / CLOCKS_PER_SEC;\r
}*/\r
+\r
+/* sync */\r
+void shinkutxt(global_game_variables_t *gv)\r
+{\r
+ //float t;\r
+ if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
+ {\r
+ //t=(((*(gv->clock))-gv->clock_start) /18.2);\r
+ sprintf(gv->pee, "%f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
+ fprintf(stderr, "%s\n", gv->pee);\r
+ //(gv->clock_start)=*(gv->clock);\r
+ gv->kurokku.tiku=0;\r
+ }\r
+ gv->kurokku.tiku++;\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
+ WaitPee();\r
+ gv->kurokku.frames_per_second=60;\r
+ break;\r
+ }\r
+}\r
+\r
+void WaitPee()\r
+{\r
+ while(inp(INPUT_STATUS_1) & 8) {\r
+ /* spin */\r
+ }\r
+\r
+ while(!(inp(INPUT_STATUS_1) & 8)) {\r
+ /* spin */\r
+ }\r
+}\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
double ticktock(global_game_variables_t *gv);\r
double time_in_seconds(global_game_variables_t *gv);\r
//double time_in_seconds(time_t in_t);\r
+void shinkutxt(global_game_variables_t *gv);\r
+void WaitPee(void);\r
\r
#endif\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
*\r
* This file is part of Project 16.\r
*\r
* Project 16 is free software; you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 3 of the License, or\r
+ * the Free Software Foundation; either verson 3 of the License, or\r
* (at your option) any later version.\r
*\r
* Project 16 is distributed in the hope that it will be useful,\r
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669
*
* This file is part of Project 16.
*
#define HIGH_ADDRESS 0x0C
#define LOW_ADDRESS 0x0D
#define VRETRACE 0x08
-#define INPUT_STATUS_1 0x03da
+//#define INPUT_STATUS_1 0x03da defined in 16_head
#define DISPLAY_ENABLE 0x01
#define MAP_MASK 0x02
#define PAL_READ_REG 0x03C7 /* Color register, read address */
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669
*
* This file is part of Project 16.
*
/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669
*
* This file is part of Project 16.
*
#include "src/lib/bitmap.h"
#include "src/lib/planar.h"
#include "src/lib/mapread.h"
-#include "src/lib/timer.h"
+#include "src/lib/16_timer.h"
#include "src/lib/wcpu/wcpu.h"
//#define SPRITE
*/
#include "src/lib/scroll16.h"
-#include "src/lib/timer.h"
+#include "src/lib/16_timer.h"
#include "src/lib/wcpu/wcpu.h"
//#define FADE