]> 4ch.mooo.com Git - 16.git/commitdiff
vgacamm.exe acts funny hmmm
authorsparky4 <sparky4@cock.li>
Fri, 2 Sep 2016 19:06:23 +0000 (14:06 -0500)
committersparky4 <sparky4@cock.li>
Fri, 2 Sep 2016 19:06:23 +0000 (14:06 -0500)
DEBUG.16W [new file with mode: 0755]
HEAP.16W [new file with mode: 0755]
MMDUMP.16W [new file with mode: 0755]
src/vgacamm.c

diff --git a/DEBUG.16W b/DEBUG.16W
new file mode 100755 (executable)
index 0000000..8a6a4e7
--- /dev/null
+++ b/DEBUG.16W
@@ -0,0 +1,17 @@
+\e[0mSeg:0      Size:9278       Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m0\r
+\e[0m\e[0mSeg:243e       Size:256        Owner:0x618c\r
+\e[44;34m+++++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m\r
+\e[0m\e[0mSeg:253e       Size:401        Owner:0xa1f0\r
+\e[44;34m++++++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m\r
+\e[0m\e[0mSeg:29db       Size:36 Owner:0x0\r
+\e[41;31m++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r
+\e[0m\e[0mSeg:b9ff       Size:9729       Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m\r
+\e[0m\e[0mSeg:e000       Size:8191       Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m
\ No newline at end of file
diff --git a/HEAP.16W b/HEAP.16W
new file mode 100755 (executable)
index 0000000..7d1bacf
--- /dev/null
+++ b/HEAP.16W
@@ -0,0 +1,43 @@
+\r
+       == default ==\r
+\r
+  FREE block at 29fd0016 of size 18\r
+  USED block at 29fd0028 of size 136\r
+  USED block at 29fd00b0 of size 20\r
+  FREE block at 29fd00c4 of size 7992\r
+OK - end of heap\r
+\r
+       == near ==\r
+\r
+  USED block at 19fca226 of size 12\r
+  USED block at 19fca232 of size 326\r
+  USED block at 19fca378 of size 52\r
+  USED block at 19fca3ac of size 20\r
+  USED block at 19fca3c0 of size 20\r
+  USED block at 19fca3d4 of size 20\r
+  USED block at 19fca3e8 of size 20\r
+  USED block at 19fca3fc of size 20\r
+  USED block at 19fca410 of size 23532\r
+OK - end of heap\r
+\r
+       == far ==\r
+\r
+  USED block at 29fd0016 of size 18\r
+  USED block at 29fd0028 of size 136\r
+  USED block at 29fd00b0 of size 20\r
+  USED block at 29fd00c4 of size 7992\r
+OK - end of heap\r
+\r
+Memory Type         Total      Used       Free\r
+----------------  --------   --------   --------\r
+Default                   8166         156       8010\r
+Near              24022        490       23532\r
+Far               8166         156       8010\r
+----------------  --------   --------   --------\r
+coreleft = 23530\r
+farcoreleft = 39564\r
+GetFreeSize = 16052\r
+GetNearFreeSize = 23532\r
+GetFarFreeSize = 16052\r
+memavl = 23530\r
+stackavail = 11829\r
diff --git a/MMDUMP.16W b/MMDUMP.16W
new file mode 100755 (executable)
index 0000000..67baf89
Binary files /dev/null and b/MMDUMP.16W differ
index de14c24d1c2c66224a96cb6df7e62fd5a1d58d4c..39d9280375a97ddbb4bcb78ff64f6dc3b034fa36 100755 (executable)
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
 \r
-global_game_variables_t gvar;\r
-\r
 void main() {\r
-       mminfo_t mm; mminfotype mmi;\r
+       global_game_variables_t gvar;\r
+       //mminfo_t mm; mminfotype mmi;\r
        __segment sega;\r
        void __based(sega)* bigbuffer;\r
        int i;\r
@@ -37,20 +36,14 @@ void main() {
        float t1, t2;\r
        boolean baka;\r
        byte *pal;\r
-       int size, size1;\r
-//     struct sprite spri;\r
-//     vrl1_vgax_offset_t * off, *off1;\r
-//     struct vrs_container vrs;\r
-//     vrl1_vgax_offset_t **vrl_line_offsets;\r
-//     uint32_t huge *vrl_headers_offsets;\r
-//     uint16_t huge *vrl_id_iter;\r
-//     uint32_t vrl_size;\r
-//     int num_of_vrl;\r
-//     struct vrl1_vgax_header huge *curr_vrl;\r
-//     struct vrl_container *vrl;\r
        word w=0;\r
 \r
+       gvar.mm.mmstarted=0;\r
 \r
+       MM_Startup(&gvar.mm, &gvar.mmi);\r
+       CA_Startup(&gvar);\r
+       printf("loading\n");\r
+       if(CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &gvar.mm, &gvar.mmi)) baka=1; else baka=0;\r
 \r
        // DOSLIB: check our environment\r
        probe_dos();\r
@@ -73,63 +66,11 @@ void main() {
                return;\r
        }\r
 \r
-       //bmp = bitmapLoadPcx("data/chikyuu.pcx");\r
        gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
 \r
-       mm.mmstarted=0;\r
-       MM_Startup(&mm, &mmi);\r
-       CA_Startup(&gvar);\r
-       // What should be done by read_vrs:\r
-       //if(CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &mm, &mmi)) baka=1; else baka=0;\r
-\r
-//     // Insert sanity cheks later\r
-//     vrs.buffer = bigbuffer;\r
-//     vrs.data_size = size - sizeof(struct vrl1_vgax_header);\r
-//     num_of_vrl = 0;\r
-//     vrl_id_iter = (uint16_t huge *)(vrs.buffer + vrs.vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]);\r
-//     while(vrl_id_iter[num_of_vrl]){\r
-//             num_of_vrl++;\r
-//     }\r
-//\r
-//     // Allocate memory for vrl line offsets table\r
-//     vrl_line_offsets = malloc(sizeof(vrl1_vgax_offset_t *)*num_of_vrl);\r
-//\r
-//     vrl_headers_offsets = (uint32_t huge *)(vrs.buffer + vrs.vrs_hdr->offset_table[VRS_HEADER_OFFSET_VRS_LIST]);\r
-//     // Calculate line offsets for each vrl\r
-//     for(i = 0; i < num_of_vrl; i++){\r
-//             curr_vrl = (struct vrl1_vgax_header huge *)(vrs.buffer + vrl_headers_offsets[i]);\r
-//\r
-//             // Calc. vrl size as (next_offset - curr_offset)\r
-//             if (i != num_of_vrl - 1){\r
-//                     vrl_size = vrl_headers_offsets[i+1] - vrl_headers_offsets[i] - sizeof(struct vrl1_vgax_header);\r
-//             }\r
-//             // If it's the last vrl, size is (next_vrs_struct_offset - curr_offset)\r
-//             else{\r
-//                     vrl_size = vrs.vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST] - vrl_headers_offsets[i] - sizeof(struct vrl1_vgax_header);\r
-//             }\r
-//             vrl_line_offsets[i] = vrl1_vgax_genlineoffsets(curr_vrl, (byte *)curr_vrl + sizeof(struct vrl1_vgax_header), vrl_size);\r
-//     }\r
-//     vrs.vrl_line_offsets = vrl_line_offsets;\r
-\r
-\r
-       //read_vrs(&gvar, "data/spri/chikyuu.vrs", &vrs);\r
-//     spri.spritesheet = &vrs;\r
-//     spri.sprite_vrl_cont = malloc(sizeof(struct vrl_container));\r
-//     i = set_anim_by_id(&spri, 11);\r
-//     if (i == -1)\r
-//     {\r
-//             return;\r
-//     }\r
-//     spri.x = 5;\r
-//     spri.y = 100;\r
-\r
-//     Uncomment to see broken sprites\r
-/*     sega = mm.bufferseg;\r
-       if(CA_LoadFile("data/spri/CHUBACW1.vrl", &bigbuffer, &mm, &mmi)) baka=1; else baka=0;*/\r
-\r
-       /* clear and draw one sprite and one bitmap */\r
        VGAmodeX(1, 1, &gvar);\r
        modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].sw, gvar.video.page[0].sh, 1);\r
+       //modexHiganbanaPageSetup(&gvar.video);\r
 \r
        /* non sprite comparison */\r
        start = *clockw;\r
@@ -140,9 +81,6 @@ void main() {
 \r
        t2 = (*clockw-start)/18.2;\r
 \r
-       //for (i = 0; i < 5; i++){\r
-       //spri.delay = 1; animate_spri(&spri); spri.x += 20; sleep(2); }\r
-\r
        while(!kbhit())\r
        {\r
                switch(w)\r
@@ -156,13 +94,16 @@ void main() {
                }\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
-       //free(spri.sprite_vrl_cont);\r
-       MM_FreePtr(&bigbuffer, &mm);\r
-       //MM_FreePtr(&((void __based(sega)*)spri.spritesheet->buffer), &mm);\r
-       MM_Shutdown(&mm);\r
+       MM_ShowMemory(&gvar, &gvar.mm);\r
+       MM_DumpData(&gvar.mm);\r
+       MM_FreePtr(&bigbuffer, &gvar.mm);\r
        CA_Shutdown(&gvar);\r
+       MM_Shutdown(&gvar.mm);\r
        //printf("CPU to VGA: %f\n", t1);\r
        //printf("VGA to VGA: %f\n", t2);\r
+       heapdump(&gvar);\r
+       printf("Project 16 emmtest.exe. This is just a test file!\n");\r
+       printf("version %s\n", VERSION);\r
        printf("t1: %f\n", t1);\r
        printf("t2: %f\n", t2);\r
        printf("gvar.video.page[0].width: %u\n", gvar.video.page[0].width);\r