]> 4ch.mooo.com Git - 16.git/commitdiff
====++++==== undid the reversion back at b6af468f5932336434d2fd956a30af42b58c20bf...
authorsparky4 <sparky4@cock.li>
Tue, 28 Feb 2017 03:18:05 +0000 (21:18 -0600)
committersparky4 <sparky4@cock.li>
Tue, 28 Feb 2017 03:18:05 +0000 (21:18 -0600)
src/exmmtest.c
src/lib/16_dbg.c
src/lib/16_dbg.h
src/lib/16_in.c
src/lib/16_in.h
src/lib/scroll16.c

index b6efd4ebae120ef0ee01d204c8d6db63d16765fc..881a1356454e69fae62ddcf738fe891da6dcb6d1 100755 (executable)
@@ -221,6 +221,15 @@ PRINTBB; printf("\n\npress any key to continue!\n"); getch();
        printf("press any key to continue!\n"); getch();\r
 #endif\r
 #endif //filereadload\r
+\r
+/*\r
+#ifdef __WATCOMC__\r
+       IN_Shutdown(&gvar);\r
+       ShapeTest (&gvar);\r
+       IN_Startup(&gvar);\r
+#endif\r
+*/\r
+\r
        DebugMemory_(&gvar, 1);\r
        MM_DumpData(&gvar);\r
        MM_Report_(&gvar);\r
index bfa55a5344b8b68655349a94a4d094819589cfb2..576f492b1f47df9f1b8521dbca583b04f5278eff 100755 (executable)
@@ -17,7 +17,7 @@ boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_nointest=0;
 boolean dbg_maptext=0;\r
 byte *dbg_mapdata;\r
 #endif\r
-#endif\r
+#endif //debug\r
 \r
 #ifdef __WATCOMC__\r
 // TODO: Could we also provide a build mode to emit debug to the "Bochs E9 hack?"\r
@@ -91,5 +91,214 @@ void _DEBUGF(const char *fmt,...) {
        _DEBUG(_DEBUGF_TMP);\r
        va_end(va);\r
 }\r
+#endif //serial\r
 #endif //watcomc\r
-#endif\r
+/*\r
+================\r
+=\r
+= ShapeTest\r
+=\r
+================\r
+*/\r
+\r
+#pragma warn -pia\r
+void ShapeTest (global_game_variables_t *gvar)\r
+{\r
+extern word    NumDigi;\r
+extern word    _seg *DigiList;\r
+static char    buf[10];\r
+\r
+       boolean                 done;\r
+       ScanCode                scan;\r
+       int                             i,j;\r
+//     dword           l; word k,x;\r
+       memptr                  addr;\r
+       PageListStruct  far *page;\r
+\r
+//     CenterWindow(20,16);\r
+//     VW_UpdateScreen();\r
+       for (i = 0,done = false;!done;)\r
+       {\r
+//             US_ClearWindow();\r
+//             sound = -1;\r
+\r
+               page = &(gvar->pm.PMPages[i]);\r
+//             US_Print(" Page #");\r
+//             US_PrintUnsigned(i);\r
+               printf(" Page #%u", i);\r
+               if (i < (gvar->pm.fi.PMSpriteStart))\r
+//                     US_Print(" (Wall)");\r
+                       printf(" (Wall)");\r
+/*             else if (i < (gvar->pm.fi.PMSoundStart))\r
+//                     US_Print(" (Sprite)");\r
+                       printf(" (Sprite)");\r
+               else if (i == (gvar->pm.fi.ChunksInFile - 1))\r
+//                     US_Print(" (Sound Info)");\r
+                       printf(" (Sound Info)");\r
+               else\r
+//                     US_Print(" (Sound)");\r
+                       printf(" (Sound)");*/\r
+\r
+//             US_Print("\n XMS: ");\r
+               printf("\n XMS: ");\r
+               if (page->xmsPage != -1)\r
+//                     US_PrintUnsigned(page->xmsPage);\r
+                       printf("%u", page->xmsPage);\r
+               else\r
+//                     US_Print("No");\r
+                       printf("No");\r
+\r
+//             US_Print("\n Main: ");\r
+               if (page->mainPage != -1)\r
+//                     US_PrintUnsigned(page->mainPage);\r
+                       printf("\n Main: %u", page->mainPage);\r
+               else if (page->emsPage != -1)\r
+               {\r
+//                     US_Print("EMS ");\r
+//                     US_PrintUnsigned(page->emsPage);\r
+                       printf("EMS %u", page->emsPage);\r
+               }\r
+               else\r
+//                     US_Print("No");\r
+                       printf("No");\r
+\r
+//             US_Print("\n Last hit: ");\r
+//             US_PrintUnsigned(page->lastHit);\r
+               printf("\n Last hit: %u", page->lastHit);\r
+\r
+//             US_Print("\n Address: ");\r
+               printf("\n Address: ");\r
+               addr = PM_GetPageAddress(i, gvar);\r
+               sprintf(buf,"0x%04x",(word)addr);\r
+//             US_Print(buf);\r
+               printf("%s", buf);\r
+\r
+               if (addr)\r
+               {\r
+/*                     if (i < PMSpriteStart)\r
+                       {\r
+                       //\r
+                       // draw the wall\r
+                       //\r
+                               bufferofs += 32*SCREENWIDTH;\r
+                               postx = 128;\r
+                               postwidth = 1;\r
+                               postsource = ((long)((unsigned)addr))<<16;\r
+                               for (x=0;x<64;x++,postx++,postsource+=64)\r
+                               {\r
+                                       wallheight[postx] = 256;\r
+                                       FarScalePost ();\r
+                               }\r
+                               bufferofs -= 32*SCREENWIDTH;\r
+                       }\r
+                       else if (i < PMSoundStart)\r
+                       {\r
+                       //\r
+                       // draw the sprite\r
+                       //\r
+                               bufferofs += 32*SCREENWIDTH;\r
+                               SimpleScaleShape (160, i-PMSpriteStart, 64);\r
+                               bufferofs -= 32*SCREENWIDTH;\r
+                       }\r
+                       else if (i == ChunksInFile - 1)\r
+                       {\r
+                               US_Print("\n\n Number of sounds: ");\r
+                               US_PrintUnsigned(NumDigi);\r
+                               for (l = j = k = 0;j < NumDigi;j++)\r
+                               {\r
+                                       l += DigiList[(j * 2) + 1];\r
+                                       k += (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;\r
+                               }\r
+                               US_Print("\n Total bytes: ");\r
+                               US_PrintUnsigned(l);\r
+                               US_Print("\n Total pages: ");\r
+                               US_PrintUnsigned(k);\r
+                       }\r
+                       else\r
+                       {\r
+                               byte far *dp = (byte far *)MK_FP(addr,0);\r
+                               for (j = 0;j < NumDigi;j++)\r
+                               {\r
+                                       k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;\r
+                                       if\r
+                                       (\r
+                                               (i >= PMSoundStart + DigiList[j * 2])\r
+                                       &&      (i < PMSoundStart + DigiList[j * 2] + k)\r
+                                       )\r
+                                               break;\r
+                               }\r
+                               if (j < NumDigi)\r
+                               {\r
+//                                     sound = j;\r
+                                       US_Print("\n Sound #");\r
+                                       US_PrintUnsigned(j);\r
+                                       US_Print("\n Segment #");\r
+                                       US_PrintUnsigned(i - PMSoundStart - DigiList[j * 2]);\r
+                               }\r
+                               for (j = 0;j < page->length;j += 32)\r
+                               {\r
+                                       byte v = dp[j];\r
+                                       int v2 = (unsigned)v;\r
+                                       v2 -= 128;\r
+                                       v2 /= 4;\r
+                                       if (v2 < 0)\r
+                                               VWB_Vlin(WindowY + WindowH - 32 + v2,\r
+                                                               WindowY + WindowH - 32,\r
+                                                               WindowX + 8 + (j / 32),BLACK);\r
+                                       else\r
+                                               VWB_Vlin(WindowY + WindowH - 32,\r
+                                                               WindowY + WindowH - 32 + v2,\r
+                                                               WindowX + 8 + (j / 32),BLACK);\r
+                               }\r
+                       }*/\r
+                       printf("\naddr ok\n");\r
+               }\r
+\r
+//             VW_UpdateScreen();\r
+\r
+//             while (!(scan = IN_GetLastScan()))\r
+                       scan = *IN_GetScanName(scan);\r
+//                     SD_Poll();\r
+\r
+               IN_ClearKey(scan);\r
+               switch (scan)\r
+               {\r
+               case sc_LeftArrow:\r
+                       if (i)\r
+                               i--;\r
+                       break;\r
+               case sc_RightArrow:\r
+                       if (++i >= (gvar->pm.fi.ChunksInFile))\r
+                               i--;\r
+                       break;\r
+               case sc_W:      // Walls\r
+                       i = 0;\r
+                       break;\r
+               case sc_S:      // Sprites\r
+//                     i = (gvar->pm.fi.PMSpriteStart);\r
+                       break;\r
+               case sc_D:      // Digitized\r
+//                     i = (gvar->pm.fi.PMSoundStart);\r
+                       break;\r
+               case sc_I:      // Digitized info\r
+                       i = (gvar->pm.fi.ChunksInFile - 1);\r
+                       break;\r
+               case sc_L:      // Load all pages\r
+                       for (j = 0;j < (gvar->pm.fi.ChunksInFile);j++)\r
+                               PM_GetPage(j, gvar);\r
+                       break;\r
+               case sc_P:\r
+//                     if (sound != -1)\r
+//                             SD_PlayDigitized(sound);\r
+                       break;\r
+               case sc_Escape:\r
+                       done = true;\r
+                       break;\r
+               case sc_Enter:\r
+                       PM_GetPage(i, gvar);\r
+                       break;\r
+               }\r
+       }\r
+       //SD_StopDigitized();\r
+}\r
+#pragma warn +pia\r
index 5340313a2439961837db2eeb686d3eaa0670cee3..3d7ef4afe9690e4912e3f18cf8d7af65d1a44c59 100755 (executable)
@@ -3,6 +3,7 @@
 #define _SRC_LIB_16_DBG\r
 \r
 #include "src/lib/16_head.h"\r
+#include "src/lib/16_pm.h"\r
 #include "src/lib/16_tdef.h"\r
 \r
 #define __DEBUG__\r
@@ -53,4 +54,7 @@ static inline int _DEBUG_INIT() {
 }\r
 # endif\r
 #endif //watcomc\r
+\r
+void ShapeTest (global_game_variables_t *gvar);\r
+\r
 #endif // _SRC_LIB_16_DBG\r
index 8d17c37ff27d8950ff024fc8f3f306c5fa6f0cc8..44c6aac1b04169c92e6b5bf7f6b8377235c74d3c 100755 (executable)
@@ -501,11 +501,17 @@ IN_GetJoyButtonsDB(word joy)
 static void\r
 INL_StartKbd()\r
 {\r
+       byte far *lock_key;\r
        INL_KeyHook = 0;        // Clear key hook\r
 \r
        IN_ClearKeysDown();\r
 \r
        OldKeyVect = _dos_getvect(KeyInt);\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
+       OldKeyVect();   // call BIOS keyhandler to change keyboard lights\r
        _dos_setvect(KeyInt,INL_KeyService);\r
 }\r
 \r
@@ -1275,3 +1281,13 @@ boolean IN_qb(byte kee)
        if(inpu.Keyboard[kee]==true) return 1;\r
        else return 0;\r
 }\r
+\r
+ScanCode IN_GetLastScan()\r
+{\r
+       return inpu.LastScan;\r
+}\r
+\r
+ScanCode IN_GetCurCode()\r
+{\r
+       return inst.CurCode;\r
+}\r
index 9bcec25889cdab222c946b820430dff57e889794..b56e9f4640f1c7f54dc73ddc15275f1a7ed528ce 100755 (executable)
@@ -302,5 +302,7 @@ extern boolean IN_UserInput(dword delay,boolean clear);
 extern boolean IN_KeyDown(byte code);\r
 extern void IN_ClearKey(byte code);\r
 extern boolean IN_qb(byte kee);\r
+extern ScanCode IN_GetLastScan();\r
+extern ScanCode IN_GetCurCode();\r
 \r
 #endif\r
index b4523474b50547d84b693ebc3ebc0e88d6cdd997..5ba59ca5cc26e9a6986df54eaf72f4c8b085fbaf 100755 (executable)
@@ -741,6 +741,7 @@ void shinku(global_game_variables_t *gv)
                gv->video.dorender =!gv->video.dorender ;\r
                //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;\r
        }\r
+//++++ PM_NextFrame(gv);\r
 }\r
 \r
 void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn)\r