From: sparky4 Date: Mon, 9 Jan 2017 16:24:19 +0000 (-0600) Subject: added stuff to help me study 0.exe X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=31f7d5ef5f11def7a113a8a572fc0e29cab03ca2;p=16.git added stuff to help me study 0.exe --- diff --git a/makefile b/makefile index a33741b8..f97d87fa 100755 --- a/makefile +++ b/makefile @@ -100,7 +100,7 @@ UPXQ=-qqq # S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768 Z_FLAGS=-zk0 -zc -zp8 -zm -O_FLAGS=-obmilr -oe=24 -outpack -ei -ohnl+ -zp4 +O_FLAGS=-opmilr -oe=24 -outback -ei -ohnl+ -zp4 T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1##-fo=.$(OBJ) -e=65536 DBUGFLAGS=-fm=$^&.mah -fd=$^& @@ -411,12 +411,12 @@ vomitchan: .symbolic ## #git submodule add mkdl: .symbolic - @cd $(DOSLIB:$(to_os_path)) + @cd $(DOSLIBDIR:$(to_os_path)) @$(DOSLIBMAKEALL) $(DOSLIB_MEMMODE) @cd $(BUILD_ROOT) cldl: .symbolic - @cd $(DOSLIB:$(to_os_path)) + @cd $(DOSLIBDIR:$(to_os_path)) @$(DOSLIBMAKEALL) $(DOSLIB_MEMMODE) clean @cd $(BUILD_ROOT) diff --git a/src/0.c b/src/0.c index 8f18cd8d..ee5f5c44 100755 --- a/src/0.c +++ b/src/0.c @@ -10,9 +10,12 @@ //#define FILENAME_2 "data/default.pal" //#define PATTERN +#define INITTNUM 1 #define DRAWCORNERBOXES \ -modexClearRegion(&gvar.video.page[0], 16, 16, 16, 16, 15); \ -modexClearRegion(&gvar.video.page[0], gvar.video.page[0].sw, gvar.video.page[0].sh, 16, 16, 15); +DRAWOTHERCORNERBOX_TOPLEFT; \ +DRAWOTHERCORNERBOX_TOPRIGHT; \ +DRAWOTHERCORNERBOX_BOTTOMLEFT; \ +DRAWOTHERCORNERBOX_BOTTOMRIGHT; \ static unsigned char palette[768]; player_t player[MaxPlayers]; @@ -28,7 +31,7 @@ int main(int argc,char **argv) unsigned int bufsz; int fd, i; char *bakapee1,*bakapee2; - boolean anim=1,noanim=1; + boolean anim=1,noanim=0; pan.pn=0; bakapee1=malloc(64); @@ -96,17 +99,18 @@ int main(int argc,char **argv) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); -player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx; - player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny; modexShowPage(&(gvar.video.page[pan.pn])); for(i=0;idx = mv[1].page->dx = mv[2].page->dx = mv[3].page->dx = mv->map->tiles->tileWidth; - mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->tiles->tileHeight; - - /* set up the thresholds */ - mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2; - mv[0].dyThresh = mv[1].dyThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileHeight * 2; + mapinitmapview(mv, tx, ty); /* draw the tiles */ modexClearRegion(mv[0].page, 0, 0, mv[0].page->width, mv[0].page->height, 0); @@ -629,11 +621,8 @@ void mapGoTo(map_view_t *mv, int tx, int ty) modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 0, 0, 24, 32); } -void mapGoTo_(map_view_t *mv, int tx, int ty) +void mapinitmapview(map_view_t *mv, int tx, int ty) { - int py; - unsigned int i; - /* set up the coordinates */ mv[0].tx = mv[1].tx = tx; mv[0].ty = mv[1].ty = ty; @@ -643,27 +632,6 @@ void mapGoTo_(map_view_t *mv, int tx, int ty) /* set up the thresholds */ mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2; mv[0].dyThresh = mv[1].dyThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileHeight * 2; - - /* draw the tiles */ - modexClearRegion(mv[0].page, 0, 0, mv[0].page->width, mv[0].page->height, 0); - py=0; - i=mv[0].ty * mv[0].map->width + mv[0].tx; - for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->tiles->tileHeight) { - mapDrawWRow(&mv[0], tx-1, ty, py); - i+=mv->map->width - tx; - } - if(!pageploop) modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); -// { -// unsigned int k,j,o; -// /* fill screen with a distinctive pattern */ -// for (k=0;k < vga_state.vga_width;k++) { -// o = k >> 2; -// vga_write_sequencer(0x02/*map mask*/,1 << (k&3)); -// for (j=0;j < (mv[0].page->height)+(mv[1].page->height)+(mv[2].page->height)+(mv[3].page->height);j++,o += vga_state.vga_stride) -// vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15! -// } -// } - modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 0, 0, 24, 32); } void near diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 32d3987f..75117f5e 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -137,7 +137,7 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid); void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid); sword chkmap(map_t *map, word q); void mapGoTo(map_view_t *mv, int tx, int ty); -void mapGoTo_(map_view_t *mv, int tx, int ty); +void mapinitmapview(map_view_t *mv, int tx, int ty); void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset); void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset); diff --git a/src/tesuto.h b/src/tesuto.h index 1a045a80..df07c5bf 100755 --- a/src/tesuto.h +++ b/src/tesuto.h @@ -15,16 +15,34 @@ if(IN_KeyDown(1+1)){ pan.pn=0; modexShowPage(&(gvar.video.page[pan.pn])); } \ if(IN_KeyDown(2+1)){ pan.pn=1; modexShowPage(&(gvar.video.page[pan.pn])); } \ if(IN_KeyDown(3+1)){ pan.pn=2; modexShowPage(&(gvar.video.page[pan.pn])); } \ - if(IN_KeyDown(4+1)){ pan.pn=3; modexShowPage(&(gvar.video.page[pan.pn])); } - -#define TESUTODRAWBOX \ - modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 15);\ - modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128);\ - modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42);\ - modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128);\ - modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height);\ - modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 47);\ - modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 45);\ + if(IN_KeyDown(4+1)){ pan.pn=3; modexShowPage(&(gvar.video.page[pan.pn])); } \ + if(IN_KeyDown(25)){ modexpdump(mv[1].page); modexShowPage(&(gvar.video.page[1])); IN_UserInput(1,1); } + +////corner markers +#define GVP gvar.video.page[0] +#define GW GVP.width-16 +#define GH GVP.height-16 +#define GE GVP.sw +#define GJ GVP.sh +#define DCBF modexClearRegion(&GVP + +#define DRAWOTHERCORNERBOX_TOPLEFT \ +DCBF, 0, 0, 16, 16, 0); \ +DCBF, 16, 16, 16, 16, 2); + +#define DRAWOTHERCORNERBOX_TOPRIGHT \ +DCBF, GW, 0, 16, 16, 0); \ +DCBF, GE, 16, 16, 16, 2); + +#define DRAWOTHERCORNERBOX_BOTTOMLEFT \ +DCBF, 0, GH, 16, 16, 0); \ +DCBF, 16, GJ, 16, 16, 2); + +#define DRAWOTHERCORNERBOX_BOTTOMRIGHT \ +DCBF, GE, GJ, 16, 16, 2);\ +DCBF, GW, GH, 16, 16, 0); + + typedef unsigned char far *VGA_RAM_PTR; //VGA_RAM_PTR vga_graphics_ram = (VGA_RAM_PTR)MK_FP(0xA000,0x0000); diff --git a/src/vrstest.c b/src/vrstest.c index 2a09e64c..16da3b13 100755 --- a/src/vrstest.c +++ b/src/vrstest.c @@ -32,7 +32,8 @@ extern boolean dbg_notest; static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ -void main() { +void main() +{ static global_game_variables_t gvar; //__segment sega; memptr bigbuffer;