From: sparky4 Date: Mon, 13 Mar 2017 16:00:03 +0000 (-0500) Subject: __seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=f6d0f26f669392f2970eb91d744fb88651583cf3;p=16.git __seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd.c so we can use CA MM and PM ][ ca needs huge amounts of work and i should remember what needs to be done soon also i should reverify 16_in.c to make sure it can work with other code of id engine] did some cleanings ans such --- diff --git a/DEBUG.16W b/DEBUG.16W new file mode 100755 index 00000000..3a895a4d --- /dev/null +++ b/DEBUG.16W @@ -0,0 +1,210 @@ +Seg:0 Size:9028 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0000 +Seg:2427 Size:39 Owner:0x0 +++ +Seg:244e Size:256 Owner:0x1d50 +++++ +Seg:254e Size:256 Owner:0x1ba6 +++++ +Seg:264e Size:256 Owner:0x1ba8 +++++ +Seg:274e Size:256 Owner:0x1baa +++++ +Seg:284e Size:256 Owner:0x1bac ++++++ +Seg:294e Size:256 Owner:0x1bae +++++ +Seg:2a4e Size:256 Owner:0x1bb0 +++++ +Seg:2b4e Size:256 Owner:0x1bb2 +++++ +Seg:2c4e Size:256 Owner:0x1bb4 +++++ +Seg:2d4e Size:256 Owner:0x1bb6 ++++++ +Seg:2e4e Size:256 Owner:0x1bb8 +++++ +Seg:2f4e Size:256 Owner:0x1bba +++++ +Seg:304e Size:256 Owner:0x1bbc +++++ +Seg:314e Size:256 Owner:0x1bbe +++++ +Seg:324e Size:256 Owner:0x1bc0 ++++++ +Seg:334e Size:256 Owner:0x1bc2 +++++ +Seg:344e Size:256 Owner:0x1bc4 +++++ +Seg:354e Size:256 Owner:0x1bc6 +++++ +Seg:364e Size:256 Owner:0x1bc8 +++++ +Seg:374e Size:256 Owner:0x1bca ++++++ +Seg:384e Size:256 Owner:0x1bcc +++++ +Seg:394e Size:256 Owner:0x1bce +++++ +Seg:3a4e Size:256 Owner:0x1bd0 +++++ +Seg:3b4e Size:256 Owner:0x1bd2 +++++ +Seg:3c4e Size:256 Owner:0x1bd4 ++++++ +Seg:3d4e Size:256 Owner:0x1bd6 +++++ +Seg:3e4e Size:256 Owner:0x1bd8 +++++ +Seg:3f4e Size:256 Owner:0x1bda +++++ +Seg:404e Size:256 Owner:0x1bdc +++++ +Seg:414e Size:256 Owner:0x1bde ++++++ +Seg:424e Size:256 Owner:0x1be0 +++++ +Seg:434e Size:256 Owner:0x1be2 +++++ +Seg:444e Size:256 Owner:0x1be4 +++++ +Seg:454e Size:256 Owner:0x1be6 +++++ +Seg:464e Size:256 Owner:0x1be8 ++++++ +Seg:474e Size:256 Owner:0x1bea +++++ +Seg:484e Size:256 Owner:0x1bec +++++ +Seg:494e Size:256 Owner:0x1bee +++++ +Seg:4a4e Size:256 Owner:0x1bf0 +++++ +Seg:4b4e Size:256 Owner:0x1bf2 ++++++ +Seg:4c4e Size:256 Owner:0x1bf4 +++++ +Seg:4d4e Size:256 Owner:0x1bf6 +++++ +Seg:4e4e Size:256 Owner:0x1bf8 +++++ +Seg:4f4e Size:256 Owner:0x1bfa +++++ +Seg:504e Size:256 Owner:0x1bfc ++++++ +Seg:514e Size:256 Owner:0x1bfe +++++ +Seg:524e Size:256 Owner:0x1c00 +++++ +Seg:534e Size:256 Owner:0x1c02 +++++ +Seg:544e Size:256 Owner:0x1c04 +++++ +Seg:554e Size:256 Owner:0x1c06 ++++++ +Seg:564e Size:256 Owner:0x1c08 +++++ +Seg:574e Size:256 Owner:0x1c0a +++++ +Seg:584e Size:256 Owner:0x1c0c +++++ +Seg:594e Size:256 Owner:0x1c0e +++++ +Seg:5a4e Size:256 Owner:0x1c10 ++++++ +Seg:5b4e Size:256 Owner:0x1c12 +++++ +Seg:5c4e Size:256 Owner:0x1c14 +++++ +Seg:5d4e Size:256 Owner:0x1c16 +++++ +Seg:5e4e Size:256 Owner:0x1c18 +++++ +Seg:5f4e Size:256 Owner:0x1c1a ++++++ +Seg:604e Size:256 Owner:0x1c1c +++++ +Seg:614e Size:256 Owner:0x1c1e +++++ +Seg:624e Size:256 Owner:0x1c20 +++++ +Seg:634e Size:256 Owner:0x1c22 +++++ +Seg:644e Size:256 Owner:0x1c24 ++++++ +Seg:654e Size:256 Owner:0x1c26 +++++ +Seg:664e Size:256 Owner:0x1c28 +++++ +Seg:674e Size:256 Owner:0x1c2a +++++ +Seg:684e Size:256 Owner:0x1c2c +++++ +Seg:694e Size:256 Owner:0x1c2e ++++++ +Seg:6a4e Size:256 Owner:0x1c30 +++++ +Seg:6b4e Size:256 Owner:0x1c32 +++++ +Seg:6c4e Size:256 Owner:0x1c34 +++++ +Seg:6d4e Size:256 Owner:0x1c36 +++++ +Seg:6e4e Size:256 Owner:0x1c38 ++++++ +Seg:6f4e Size:256 Owner:0x1c3a +++++ +Seg:704e Size:256 Owner:0x1c3c +++++ +Seg:714e Size:256 Owner:0x1c3e +++++ +Seg:724e Size:256 Owner:0x1c40 +++++ +Seg:734e Size:256 Owner:0x1c42 ++++++ +Seg:744e Size:256 Owner:0x1c44 +++++ +Seg:754e Size:256 Owner:0x1c46 +++++ +Seg:764e Size:256 Owner:0x1c48 +++++ +Seg:774e Size:256 Owner:0x1c4a +++++ +Seg:784e Size:256 Owner:0x1c4c ++++++ +Seg:794e Size:256 Owner:0x1c4e +++++ +Seg:7a4e Size:256 Owner:0x1c50 +++++ +Seg:7b4e Size:256 Owner:0x1c52 +++++ +Seg:7c4e Size:256 Owner:0x1c54 +++++ +Seg:7d4e Size:256 Owner:0x1c56 ++++++ +Seg:7e4e Size:256 Owner:0x1c58 +++++ +Seg:7f4e Size:256 Owner:0x1c5a +++++ +Seg:804e Size:256 Owner:0x1c5c +++++ +Seg:814e Size:256 Owner:0x1c5e +++++ +Seg:824e Size:256 Owner:0x1c60 ++++++ +Seg:834e Size:256 Owner:0x1c62 +++++ +Seg:844e Size:256 Owner:0x1c64 +++++ +Seg:854e Size:256 Owner:0x1c66 +++++ +Seg:864e Size:256 Owner:0x1c68 +++++ +Seg:874e Size:256 Owner:0x1c6a ++++++ +Seg:884e Size:256 Owner:0x1c6c +++++ +Seg:894e Size:273 Owner:0x1b7c +++++ +Seg:9d8d Size:25202 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W new file mode 100755 index 00000000..bcb93b47 --- /dev/null +++ b/HEAP.16W @@ -0,0 +1,47 @@ + + == default == + + USED block at 24490016 of size 26 + USED block at 24490030 of size 26 + FREE block at 2449004a of size 38914 + USED block at 2449984c of size 136 + USED block at 244998d4 of size 20 + FREE block at 244998e8 of size 7972 +OK - end of heap + + == near == + + USED block at 1448edc6 of size 12 + USED block at 1448edd2 of size 332 + USED block at 1448ef1e of size 52 + USED block at 1448ef52 of size 20 + USED block at 1448ef66 of size 20 + USED block at 1448ef7a of size 20 + USED block at 1448ef8e of size 20 + USED block at 1448efa2 of size 20 + USED block at 1448efb6 of size 4166 +OK - end of heap + + == far == + + USED block at 24490016 of size 26 + USED block at 24490030 of size 26 + USED block at 2449004a of size 38914 + USED block at 2449984c of size 136 + USED block at 244998d4 of size 20 + USED block at 244998e8 of size 7972 +OK - end of heap + +Memory Type Total Used Free +---------------- -------- -------- -------- +Default 47094 208 46886 +Near 4662 496 4166 +Far 47094 208 46886 +---------------- -------- -------- -------- +HC_coreleft = 4164 +HC_farcoreleft = 458752 +HC_GetFreeSize = 46886 +HC_GetNearFreeSize = 4166 +HC_GetFarFreeSize = 46886 +memavl = 4164 +stackavail = 31606 diff --git a/MMDUMP.16W b/MMDUMP.16W new file mode 100755 index 00000000..4893d8b9 Binary files /dev/null and b/MMDUMP.16W differ diff --git a/db.exe b/db.exe deleted file mode 100755 index 457a9fa1..00000000 Binary files a/db.exe and /dev/null differ diff --git a/fmemtest.exe b/fmemtest.exe deleted file mode 100755 index 589f2c35..00000000 Binary files a/fmemtest.exe and /dev/null differ diff --git a/fontgfx.exe b/fontgfx.exe deleted file mode 100755 index d1b24cf8..00000000 Binary files a/fontgfx.exe and /dev/null differ diff --git a/fonttest.exe b/fonttest.exe deleted file mode 100755 index bc9de1e4..00000000 Binary files a/fonttest.exe and /dev/null differ diff --git a/joytest.exe b/joytest.exe deleted file mode 100755 index 49400b1e..00000000 Binary files a/joytest.exe and /dev/null differ diff --git a/makefile b/makefile index f650f020..2632b8b8 100755 --- a/makefile +++ b/makefile @@ -9,7 +9,6 @@ # -oe - expand user functions inline (-oe=20 is default, adds lots of code) # -oh Enable repeated optimizations # -oi generate certain lib funcs inline -# -oi +Set max inline depth (C++ only, use -oi for C) # -ok Flowing of register save into function flow graph # -ol loop optimizations # -ol+ loop optimizations plus unrolling @@ -107,7 +106,7 @@ UPXQ=-qqq # S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768 Z_FLAGS=-zk0 -zc -zp8 -zm -O_FLAGS=-opnr -oe=24 -oil+ -outback -ohm -zp4##-ei +O_FLAGS=-opn -oe=24 -oil+ -outback -ohm -zp4##-ei -or T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1 -fo=.$(OBJ) ##-e=65536 DBUGFLAGS=-fm=$^&.meh -fd=$^& @@ -207,16 +206,25 @@ SPRIUTILEXEC = & pcxsscut & vrl2vrs & vrsdump -#UTILEXEC += $(SPRIUTILEXEC) +UTILEXEC += $(SPRIUTILEXEC) !endif EXEC = & 16.exe & bakapi.exe & - $(UTILEXEC) & $(TESTEXEC) -all: $(EXEC) $(EXTERNTESTEXEC) +!ifdef __LINUX__ +EXEC += $(SPRIUTILEXEC) +!endif + +ALLEXEC = & + $(EXEC) & + $(UTILEXEC) & + $(TESTEXEC2) & + $(TESTEXEC3) + +all: $(EXEC) testexec: $(EXEC) $(TESTEXEC2) # @@ -361,12 +369,13 @@ ll.$(OBJ): $(SRCLIB)/ll.c $(SRCLIB)/ll.h # clean: .symbolic @if not exist $(DOSLIBDIR)/buildall.sh wmake -h initlibs - @for %f in ($(EXEC)) do @if exist %f $(REMOVECOMMAND) %f + @for %f in ($(ALLEXEC)) do @if exist %f $(REMOVECOMMAND) %f !ifdef __LINUX__ @if exist *.LIB $(REMOVECOMMAND) *.LIB @. src/util/bcexmm.sh @if exist *.EXE $(REMOVECOMMAND) *.EXE @if exist *.OBJ $(REMOVECOMMAND) *.OBJ + @for %f in ($(SPRIUTILEXEC)) do @if exist %f $(REMOVECOMMAND) %f !else @if exist *.o $(REMOVECOMMAND) *.o !endif diff --git a/pcx2vrl b/pcx2vrl deleted file mode 100755 index 4c3afde8..00000000 Binary files a/pcx2vrl and /dev/null differ diff --git a/pcxsscut b/pcxsscut deleted file mode 100755 index be46317c..00000000 Binary files a/pcxsscut and /dev/null differ diff --git a/pcxtest.exe b/pcxtest.exe deleted file mode 100755 index f14e332d..00000000 Binary files a/pcxtest.exe and /dev/null differ diff --git a/pcxtest2.exe b/pcxtest2.exe deleted file mode 100755 index 63e6ab8f..00000000 Binary files a/pcxtest2.exe and /dev/null differ diff --git a/scroll.exe b/scroll.exe deleted file mode 100755 index 71c13659..00000000 Binary files a/scroll.exe and /dev/null differ diff --git a/src/0.c b/src/0.c index 80ff31bb..901d8ef7 100755 --- a/src/0.c +++ b/src/0.c @@ -34,8 +34,6 @@ #define INITTNUM 1 -map_view_t mv[4]; - map_t map;//junk var int main(int argc,char **argv) @@ -104,12 +102,12 @@ int main(int argc,char **argv) IN_Startup(); IN_Default(0,&gvar.player[0],ctrl_Keyboard1); - EN_initPlayer(&gvar.player, 0, &gvar.video); + EN_initPlayer(&gvar.player[0], &gvar.video); /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&mv, &map, &gvar); - ZC_ShowMV(&mv, gvar.video.sp, 0); + ZC_MVSetup(&gvar.mv, &map, &gvar); + ZC_ShowMV(&gvar.mv, gvar.video.sp, 0); // VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw); VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1); @@ -152,7 +150,7 @@ int main(int argc,char **argv) } if(IN_KeyDown(sc_R)){ gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16; - mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM; + gvar.mv[0].tx = gvar.mv[0].ty = gvar.mv[1].tx = gvar.mv[1].ty = INITTNUM; VL_ShowPage(&gvar.video.page[gvar.video.sp], 1, 0); gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; x=y=0; @@ -218,7 +216,7 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header //===========================================================================// - ZC_ShowMV(&mv, 0, 0); + ZC_ShowMV(&gvar.mv, 0, 0); if(!noanim) { /* another handy "demo" effect using VGA write mode 1. * we can take what's on screen and vertically squash it like an old analog TV set turning off. */ @@ -313,7 +311,7 @@ if(!noanim) { printf("\nProject 16 0.exe. This is just a test file!\n"); printf("version %s\n", VERSION); //SCROLLEXITMESG; - printf("mv 0\n- tx=%d ty=%d dx=%d dy=%d\n", mv[0].tx, mv[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy); - printf("mv 1\n- tx=%d ty=%d dx=%d dy=%d\n", mv[1].tx, mv[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy); + printf("mv 0\n- tx=%d ty=%d dx=%d dy=%d\n", gvar.mv[0].tx, gvar.mv[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy); + printf("mv 1\n- tx=%d ty=%d dx=%d dy=%d\n", gvar.mv[1].tx, gvar.mv[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy); return 0; } diff --git a/src/16.c b/src/16.c index a96b1c49..b0ca840a 100755 --- a/src/16.c +++ b/src/16.c @@ -22,15 +22,13 @@ #include "src/16.h" -engi_stat_t engi_stat; - void main(int argc, char *argv[]) { static global_game_variables_t gvar; Startup16(&gvar); - engi_stat = ENGI_RUN; + gvar.engi_stat = ENGI_RUN; /* save the palette */ modexPalSave(gvar.video.dpal); @@ -41,10 +39,10 @@ main(int argc, char *argv[]) // modexPalBlack(); //so player will not see loadings~ IN_Default(0,&gvar.player[0],ctrl_Joystick); //modexprint(&screen, 32, 32, 1, 2, 0, "a", 1); - while(ENGI_EXIT != engi_stat) + while(ENGI_QUIT != gvar.engi_stat) { IN_ReadControl(&gvar.player[0]); - if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; + if(IN_KeyDown(sc_Escape)) gvar.engi_stat = ENGI_QUIT; shinku(&gvar); _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); } diff --git a/src/lib/16_enti.c b/src/lib/16_enti.c index 8011ada3..c66eead0 100755 --- a/src/lib/16_enti.c +++ b/src/lib/16_enti.c @@ -66,17 +66,17 @@ void EN_initentity(entity_t *enti, video_t *video) } //init player! -void EN_initPlayer(player_t *player, word pn, video_t *video) +void EN_initPlayer(player_t *player, video_t *video) { - EN_initentity(&player[pn].enti, video); - player[pn].enti.spri.x = player[0].enti.x-4; - player[pn].enti.spri.y = player[0].enti.y-16; - player[pn].walktype=0; - player[pn].enti.dire=30; + EN_initentity(&player->enti, video); + player->enti.spri.x = player[0].enti.x-4; + player->enti.spri.y = player[0].enti.y-16; + player->walktype=0; + player->enti.dire=30; vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew;//skewing bug - video->sprifilei = set_anim_by_id(&player[pn].enti.spri, player[pn].enti.dire); - animate_spri(&player[pn].enti, video); + video->sprifilei = set_anim_by_id(&player->enti.spri, player->enti.dire); + animate_spri(&player->enti, video); //print_anim_ids(player[0].enti.spri); /* player[0].info.x = player[0].tx; diff --git a/src/lib/16_enti.h b/src/lib/16_enti.h index 9dfbbf09..72c1939c 100755 --- a/src/lib/16_enti.h +++ b/src/lib/16_enti.h @@ -45,6 +45,6 @@ // } entity_t; void EN_initentity(entity_t *enti, video_t *video); -void EN_initPlayer(player_t *player, word pn, video_t *video); +void EN_initPlayer(player_t *player, video_t *video); #endif diff --git a/src/lib/16_in.c b/src/lib/16_in.c index f3a80766..e7ed19ed 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -1,3 +1,24 @@ +/* Project 16 Source Code~ + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * + * This file is part of Project 16. + * + * Project 16 is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Project 16 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ // // ID Engine // ID_IN.c - Input Manager diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 540cc4d4..8978a759 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -1,3 +1,24 @@ +/* Project 16 Source Code~ + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * + * This file is part of Project 16. + * + * Project 16 is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Project 16 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ // // ID Engine // ID_IN.h - Header file for Input Manager diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index ecb3ba52..bb190511 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -43,8 +43,8 @@ if(IN_KeyDown(68/*sc_F10*/)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1); } \ if(IN_KeyDown(sc_F9)){ pagenorendermap=!pagenorendermap; IN_UserInput(1); } \ if(IN_KeyDown(sc_F8)){ gvar.video.bgps=!gvar.video.bgps; IN_UserInput(1); } \ - if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&mv, 0, 1); IN_UserInput(1); } \ - if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&mv, 0, 0); IN_UserInput(1); } \ + if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&gvar.mv, 0, 1); IN_UserInput(1); } \ + if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&gvar.mv, 0, 0); IN_UserInput(1); } \ if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss; IN_UserInput(1); } \ if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]); IN_UserInput(1); } @@ -53,13 +53,13 @@ TAIL_FUNCTIONKEYDRAWJUNK #define TAIL_PANKEYFUNZC \ - ZC_panPageManual(&mv, &gvar.player, 0); + ZC_panPageManual(&gvar.mv, &gvar.player, 0); #define TAIL_FUNCTIONKEYSHOWMV \ - if(IN_KeyDown(1+1)){ gvar.video.sp=0; ZC_ShowMV(&mv, 0, 0); } \ - if(IN_KeyDown(2+1)){ gvar.video.sp=1; ZC_ShowMV(&mv, 0, 0); } \ - if(IN_KeyDown(3+1)){ gvar.video.sp=2; ZC_ShowMV(&mv, 0, 1); } \ - if(IN_KeyDown(4+1)){ gvar.video.sp=3; ZC_ShowMV(&mv, 0, 1); } + if(IN_KeyDown(1+1)){ gvar.video.sp=0; ZC_ShowMV(&gvar.mv, 0, 0); } \ + if(IN_KeyDown(2+1)){ gvar.video.sp=1; ZC_ShowMV(&gvar.mv, 0, 0); } \ + if(IN_KeyDown(3+1)){ gvar.video.sp=2; ZC_ShowMV(&gvar.mv, 0, 1); } \ + if(IN_KeyDown(4+1)){ gvar.video.sp=3; ZC_ShowMV(&gvar.mv, 0, 1); } #define TAIL_FUNCTIONKEYDRAWJUNK \ TAIL_FUNCTIONKEYSHOWMV \ diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 504e6731..e059fedf 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -598,15 +598,16 @@ typedef struct //TODO: USE THIS!!!! //actual global game varables! typedef enum { - ENGI_EXIT, ENGI_QUIT, ENGI_RUN, - ENGI_INPUT, + ENGI_MENU, ENGI_PAUSE } engi_stat_t; +//ENGI_INPUT, typedef struct { + engi_stat_t engi_stat; video_t video; // video settings variable ca_t ca; // ca stuff pm_t pm; // pm stuff @@ -615,7 +616,7 @@ typedef struct mminfo_t mm; mminfotype mmi; // mm stuff //++++ in_info_t in; // 16_in info player_t player[MaxPlayers]; // player vars -//==== word far* clockw; /* 18.2hz clock */ + map_view_t mv[4]; } global_game_variables_t; #ifdef __WATCOMC__ diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 2e5fa42e..7e67b012 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -409,20 +409,21 @@ modexSelectPlane(byte plane) { } void -modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { +modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) +{ word pageOff = (word) page->data; - word xoff=x/4; /* xoffset that begins each row */ - word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ - word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */ - word nextRow = page->stridew-scanCount-1; /* loc of next row */ - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ + word xoff=(x>>2); // xoffset that begins each row + word poffset = pageOff + y*(page->stridew) + xoff; // starting offset + word scanCount=w>>2; // number of iterations per row (excluding right clip) + word nextRow = page->stridew-scanCount-1; // loc of next row + byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; // clips for rectangles not on 4s byte rclip[] = {0x00, 0x01, 0x03, 0x07}; byte left = lclip[x&0x03]; byte right = rclip[(x+w)&0x03]; - /* handle the case which requires an extra group */ + // handle the case which requires an extra group if((x & 0x03) && !((x+w) & 0x03)) { - right=0x0f; + right=0x0f; } //printf("modexClearRegion(x=%u, y=%u, w=%u, h=%u, left=%u, right=%u)\n", x, y, w, h, left, right); @@ -492,17 +493,17 @@ modexCopyPageRegion(page_t *dest, page_t *src, word dx, word dy, word width, word height) { - word doffset = (word)dest->data + dy*(dest->stridew) + dx/4; - word soffset = (word)src->data + sy*(src->stridew) + sx/4; - word scans = vga_state.vga_stride; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww + word doffset = (word)dest->data + dy*(dest->stridew) + (dx>>2); + word soffset = (word)src->data + sy*(src->stridew) + (sx>>2); + word scans = vga_state.vga_stride+8; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww word nextSrcRow = src->stridew - scans - 1; word nextDestRow = dest->stridew - scans - 1; - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ + byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; // clips for rectangles not on 4s byte rclip[] = {0x00, 0x01, 0x03, 0x07}; byte left = lclip[sx&0x03]; byte right = rclip[(sx+width)&0x03]; - /* handle the case which requires an extra group */ + // handle the case which requires an extra group if((sx & 0x03) && !((sx+width) & 0x03)) { right=0x0f; } diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 744e2f4a..7f146fe4 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -80,7 +80,7 @@ #define SCROLLEXITMESG printf("page[0]dxy: %dx%d", gvar.video.page[0].dx, gvar.video.page[0].dy);\ printf("\n\n");\ printf("gvar.player vars:\n");\ - printf(" xy: %dx%d", gvar.player[0].enti.x, gvar.player[0].enti.y); printf(" txy: %dx%d", gvar.player[0].enti.tx, gvar.player[0].enti.ty); printf(" triggxy: %dx%d", gvar.player[0].enti.triggerx, gvar.player[0].enti.triggery); printf(" value: %d\n", mv[1].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))]);\ + printf(" xy: %dx%d", gvar.player[0].enti.x, gvar.player[0].enti.y); printf(" txy: %dx%d", gvar.player[0].enti.tx, gvar.player[0].enti.ty); printf(" triggxy: %dx%d", gvar.player[0].enti.triggerx, gvar.player[0].enti.triggery); printf(" value: %d\n", gvar.mv[1].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))]);\ printf(" hp: %d", (gvar.player[0].enti.hp)); printf(" q: %u", gvar.player[0].enti.q); printf(" info.dir: %u", gvar.player[0].info.dir); printf(" d: %u", gvar.player[0].enti.d); printf(" dire: %u", gvar.player[0].enti.dire);\ printf(" pdir: %u\n", gvar.player[0].pdir); printf(" delay=%u", gvar.player[0].enti.spri.delay);\ printf("\n\n");\ diff --git a/src/scroll.c b/src/scroll.c index 228c1a89..43adbd8d 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -28,7 +28,6 @@ #define MODEX //this is for mode x initiating static map_t map; -map_view_t mv[4]; float t; sword bakapee; //debugswitches @@ -107,16 +106,16 @@ void main(int argc, char *argv[]) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&mv, &map, &gvar); + ZC_MVSetup(&gvar.mv, &map, &gvar); //renderswitch gvar.video.rss=1; /* set up paging */ //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&mv, 0, 0); + mapGoTo(&gvar.mv, 0, 0); - ZC_gvar.playerXYpos(0, 0, &gvar.player, &mv, 0, 1); + ZC_gvar.playerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1); EN_initgvar.player(&gvar.player, 0, &gvar.video); if (gvar.video.sprifilei == -1) { @@ -137,7 +136,7 @@ void main(int argc, char *argv[]) //if(!pageflipflop) VL_ShowPage(mv[1].page, 0, 0);//modexShowPage(mv[1].page); - //else ZC_ShowMV(&mv, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) + //else ZC_ShowMV(&gvar.mv, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) //modexDrawBmp(&gvar.video.page[0], 16, 16, PCXBMPPTR); /* buffer pages */ @@ -170,9 +169,9 @@ void main(int argc, char *argv[]) //gvar.player movement IN_ReadControl(0, &gvar.player); if(!panswitch){ - ZC_walk(&mv, &gvar.player, 0); + ZC_walk(&gvar.mv, &gvar.player, 0); }else{ - PANKEYFUNZC;//panPageManual(&mv, &gvar.player, 0); + PANKEYFUNZC;//panPageManual(&gvar.mv, &gvar.player, 0); //printf(" gvar.player[0].enti.q: %d", gvar.player[0].enti.q); printf(" gvar.player[0].d: %d\n", gvar.player[0].d); } diff --git a/src/test.c b/src/test.c index 37116b28..5464355e 100755 --- a/src/test.c +++ b/src/test.c @@ -31,13 +31,25 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ +void drawboxesmodex(page_t *pg) +{ + modexClearRegion(pg, 0, 0, pg->width, pg->height, 1); + modexClearRegion(pg, 16, 16, pg->sw, pg->sh, 2); + modexClearRegion(pg, 32, 32, pg->sw-32, pg->sh-32, 3); + modexClearRegion(pg, 48, 48, pg->sw-64, pg->sh-64, 2); +} + +void copyboxesmodex(page_t *page, boolean pn) +{ + modexCopyPageRegion(&page[pn], &page[!pn], 0, 0, 0, 0, page[pn].width, page[pn].height); +} + void main(int argc, char *argv[]) { static word paloffset=0; static global_game_variables_t gvar; map_t map; - map_view_t mv[4]; int i, j; word startclk, endclk; @@ -88,7 +100,7 @@ void main(int argc, char *argv[]) //IN_Startup(); IN_Default(0,&gvar.player[0],ctrl_Keyboard1); - EN_initPlayer(&gvar.player, 0, &gvar.video); + EN_initPlayer(&gvar.player[0], &gvar.video); VGAmodeX(1, 1, &gvar); modexPalBlack(); @@ -109,7 +121,7 @@ void main(int argc, char *argv[]) /* set up the page, but with 16 pixels on all borders in offscreen mem */ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&mv, &map, &gvar); + ZC_MVSetup(&gvar.mv, &map, &gvar); /* fill the page with one color, but with a black border */ /*modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[1].width, gvar.video.page[1].height, 15); @@ -123,12 +135,8 @@ void main(int argc, char *argv[]) modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128); modexShowPage(&gvar.video.page[0]);*/ - - modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 1); - modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 2); - modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 3); - modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 2); - modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height); + drawboxesmodex(&gvar.video.page[0]); + copyboxesmodex(&gvar.video.page, 1); modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4); modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6); @@ -141,53 +149,13 @@ void main(int argc, char *argv[]) while(!IN_KeyDown(sc_Escape)) { IN_ReadControl(&gvar.player[0]); - ZC_panPageManual(&mv, &gvar.player, 0); - //[gvar.video.sp] - //ZC_MVSync(&mv); - - /*if(i<5){ - switch (k) - { - case 0: - pee: - // go right - gvar.video.page[gvar.video.sp].dx++; - if(i==5){ if(j>=31){ i++; j=0; goto baka; }else j++; }else - if(j>=32){ k++; j=0; }else j++; - break; - case 1: - // go left - gvar.video.page[gvar.video.sp].dx--; - if(j>=32){ k++; j=0; }else j++; - break; - case 2: - // go up - gvar.video.page[gvar.video.sp].dy++; - if(j>=32){ k++; j=0; }else j++; - break; - case 3: - // go down - gvar.video.page[gvar.video.sp].dy--; - if(j>=32){ k=0; j=0; i++; }else j++; - break; - default: - - break; - }}else{ - if(i==5) goto pee; - baka: - i++; - modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45);*/ -// if(IN_KeyDown(6)) -// { -// modexClearRegion(&gvar.video.page[1], gvar.video.page[1].sw, 16, 8, 4, 45); -// } -// if(IN_KeyDown(4+1)){ + ZC_panPageManual(&gvar.mv, &gvar.player, 0); +// if(IN_KeyDown(sc_5)){ modexClearRegion(&gvar.video.page[1], gvar.video.page[1].sw, 16, 8, 4, 45); } +// if(IN_KeyDown(sc_4)){ // modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128); // modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 42); // modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128); // } - //} TAIL_PANKEYFUN; if(IN_KeyDown(12)) modexClearRegion(&gvar.video.page[0], (gvar.video.page[0].width/2)-4, (gvar.video.page[0].height/2)-16, 24, 32, 15); if(IN_KeyDown(13)) modexClearRegion(&gvar.video.page[1], (gvar.video.page[1].width/2)-4, (gvar.video.page[1].height/2)-16, 24, 32, 15); @@ -202,8 +170,10 @@ void main(int argc, char *argv[]) // if(i>PAL_SIZE) i=0; }//9*/ if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1); }//p + if(IN_KeyDown(sc_I)){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1); }//i + if(IN_KeyDown(sc_O)){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1); }//o //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0); - ZC_ShowMV(&mv, 0, 0); + ZC_ShowMV(&gvar.mv, 0, 0); } endclk = *clockw; @@ -216,7 +186,7 @@ void main(int argc, char *argv[]) printf("Project 16 test.exe. This is just a test file!\n"); printf("version %s\n", VERSION); VL_PrintmodexmemInfo(&gvar.video); - printf("tx=%d ", mv[gvar.video.sp].tx); printf("ty=%d ", mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); + printf("tx=%d ", gvar.mv[gvar.video.sp].tx); printf("ty=%d ", gvar.mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); printf("\n====\n"); printf("0 paloffset= %d\n", paloffset/3); printf("====\n\n"); diff --git a/src/zcroll.c b/src/zcroll.c index 3cc838dc..716cc876 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -28,7 +28,6 @@ #define FADE static map_t map; -map_view_t mv[4]; float t; //debugswitches @@ -118,14 +117,14 @@ void main(int argc, char *argv[]) // setup camera and screen~ modexHiganbanaPageSetup(&gvar.video); - ZC_MVSetup(&mv, &map, &gvar); + ZC_MVSetup(&gvar.mv, &map, &gvar); // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&mv, 0, 0); + mapGoTo(&gvar.mv, 0, 0); - ZC_PlayerXYpos(0, 0, &gvar.player, &mv, 0, 1); - EN_initPlayer(&gvar.player, 0, &gvar.video); + ZC_PlayerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1); + EN_initPlayer(&gvar.player[0], &gvar.video); //print_anim_ids(gvar.player[0].enti.spri); if (gvar.video.sprifilei == -1) { @@ -139,17 +138,17 @@ void main(int argc, char *argv[]) } // while(!IN_KeyDown(sc_Escape) && !IN_KeyDown(sc_Space) && !IN_KeyDown(sc_Enter)){ FUNCTIONKEYSHOWMV } - gvar.video.page[0].tlx=mv[0].tx*TILEWH; - gvar.video.page[0].tly=mv[0].ty*TILEWH; + gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; + gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; shinku(&gvar); -//modexpdump(mv[0].page); +//modexpdump(gvar.mv[0].page); #ifdef FADE modexFadeOn(4, &gvar.video.palette); #endif while(!IN_KeyDown(sc_Escape) && gvar.player[0].enti.hp>0) { - gvar.video.page[0].tlx=mv[0].tx*TILEWH; - gvar.video.page[0].tly=mv[0].ty*TILEWH; + gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; + gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; shinku(&gvar); //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square //to stop scrolling and have the gvar.player position data move to the edge of the screen with respect to the direction @@ -159,7 +158,7 @@ void main(int argc, char *argv[]) IN_ReadControl(&gvar.player[0]); if(!panswitch){ //ZC_walk2(gvar.player[0].ent, mv); - ZC_walk(&mv, &gvar.player, 0); + ZC_walk(&gvar.mv, &gvar.player, 0); }else{ TAIL_PANKEYFUNZC; //printf(" gvar.player[0].enti.q: %d", gvar.player[0].enti.q); printf(" gvar.player[0].d: %d\n", gvar.player[0].d); @@ -167,7 +166,7 @@ void main(int argc, char *argv[]) //the scripting stuff.... //if(((gvar.player[0].enti.triggerx == TRIGGX && gvar.player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) - if(((mv[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) + if(((gvar.mv[0].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(gvar.player[0].enti.tx == 5 && gvar.player[0].enti.ty == 5)) { short i; for(i=800; i>=400; i--) @@ -179,7 +178,7 @@ void main(int argc, char *argv[]) if(gvar.player[0].enti.q == (TILEWH/(gvar.player[0].enti.speed))+1 && gvar.player[0].info.dir != 2 && (gvar.player[0].enti.triggerx == 5 && gvar.player[0].enti.triggery == 5)){ gvar.player[0].enti.hp--; } //debugging binds! - if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(mv[0].page); IN_UserInput(1); } //o + if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1); } //o if(IN_KeyDown(22)){ modexPalUpdate0(&gvar.video.palette); } //u TAIL_FUNCTIONKEYFUNCTIONS diff --git a/test0.exe b/test0.exe deleted file mode 100755 index d3554f97..00000000 Binary files a/test0.exe and /dev/null differ diff --git a/vrl2vrs b/vrl2vrs deleted file mode 100755 index 348d00f5..00000000 Binary files a/vrl2vrs and /dev/null differ diff --git a/vrsdump b/vrsdump deleted file mode 100755 index 1121c2fd..00000000 Binary files a/vrsdump and /dev/null differ diff --git a/wcpu.exe b/wcpu.exe deleted file mode 100755 index da551208..00000000 Binary files a/wcpu.exe and /dev/null differ