]> 4ch.mooo.com Git - 16.git/blobdiff - src/vrstest.c
i am sticking to lardge memory model for speed www
[16.git] / src / vrstest.c
index d00f627b569a239b019760aca7281e0a43280a2e..d0c8e7e2157174a005d5ebc1c34adf716f4cfe9e 100755 (executable)
@@ -49,39 +49,10 @@ void main() {
        uint32_t vrl_size;\r
        int num_of_vrl;\r
        struct vrl1_vgax_header huge *curr_vrl;\r
-       //word w=0;\r
-\r
-       gvar.mm.mmstarted=0;\r
-#ifdef __DEBUG_PM__\r
-       dbg_debugpm=1;\r
-#endif\r
-       // DOSLIB: check our environment\r
-       probe_dos();\r
-\r
-       // DOSLIB: what CPU are we using?\r
-       // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.\r
-       //      So this code by itself shouldn't care too much what CPU it's running on. Except that other\r
-       //      parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for\r
-       //      the CPU to carry out tasks. --J.C.\r
-       cpu_probe();\r
-\r
-       // DOSLIB: check for VGA\r
-       if (!probe_vga()) {\r
-               printf("VGA probe failed\n");\r
-               return;\r
-       }\r
-       // hardware must be VGA or higher!\r
-       if (!(vga_state.vga_flags & VGA_IS_VGA)) {\r
-               printf("This program requires VGA or higher graphics hardware\n");\r
-               return;\r
-       }\r
+       word w=0;\r
 \r
-       //gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
+       Startup16(&gvar);\r
 \r
-       MM_Startup(&gvar);\r
-       PM_Startup(&gvar);\r
-       PM_UnlockMainMem(&gvar);\r
-       CA_Startup(&gvar);\r
        // What should be done by read_vrs:\r
        //sega = (mm.bufferseg);\r
        if(CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &gvar)) baka=1; else baka=0;\r
@@ -144,14 +115,14 @@ void main() {
 \r
        t2 = (*clockw-start)/18.2;\r
 \r
-       modexLoadPalFile("data/spri/chikyuu.pal", &pal);\r
-       modexPalUpdate1(pal);\r
+       /*modexLoadPalFile("data/spri/chikyuu.pal", &pal);\r
+       modexPalUpdate1(pal);*/\r
        for (i = 0; i < 5; i++){\r
        spri.delay = 1; animate_spri(&spri); spri.x += 20; /*sleep(1);*/ }\r
 \r
-       while(!kbhit())\r
+       while(!IN_KeyDown(sc_Escape))\r
        {\r
-               /*switch(w)\r
+               switch(w)\r
                {\r
                        case 1024:\r
                                modexPalUpdate0(pal);\r
@@ -159,18 +130,17 @@ void main() {
                        default:\r
                                w++;\r
                        break;\r
-               }*/\r
+               }\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
        MM_ShowMemory(&gvar);\r
        MM_DumpData(&gvar);\r
        MM_Report_(&gvar);\r
+       Shutdown16(&gvar);\r
        free(spri.sprite_vrl_cont);\r
+       free(vrl_line_offsets);\r
        MM_FreePtr(&bigbuffer, &gvar);\r
        //MM_FreePtr(&((void __based(sega)*)spri.spritesheet->buffer), &mm);\r
-       PM_Shutdown(&gvar);\r
-       CA_Shutdown(&gvar);\r
-       MM_Shutdown(&gvar);\r
        //printf("CPU to VGA: %f\n", t1);\r
        //printf("VGA to VGA: %f\n", t2);\r
        heapdump(&gvar);\r