From 33b8360be4b8b99cdba25603cb9e85f39aae8fba Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 10 Apr 2017 12:15:03 -0500 Subject: [PATCH] p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] MM_ShowMemory is quite buggy on real machines. i need to debug it and fix added a struct printer[gvar.mm is FUCKING HUGE 14402 bytes FAT\!] p16 is needing massive work now... with Ca and other game stuff damn! --- src/lib/scroll16.c | 43 ++++++++++++++++++++++++++++++++++++++++++- src/xcroll.c | 6 +++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index d6c33f34..922ad97f 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -307,7 +307,7 @@ void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr) outp(AC_INDEX, (moo[0].page->dx & 0x03) << 1); vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = moo[0].page->stridew; } - +#if 0 void initMap(map_t *map) { // just a place holder to fill out an alternating pattern @@ -326,6 +326,47 @@ initMap(map_t *map) { tile = tile ? 0 : 1; } } +#endif +void +initMap(map_t *map) { + /* just a place holder to fill out an alternating pattern */ + int x, y; + int i; + int tile = 1; + dbg_maptext=1; + map->tiles = malloc(sizeof(tiles_t)); + + /* create the tile set */ + map->tiles->spri = malloc(sizeof(sprite_t)); + map->tiles->spri->sprite_vrl_cont.vrl_header->width = (TILEWH*2); + map->tiles->spri->sprite_vrl_cont.vrl_header->height= TILEWH; + map->tiles->spri->sprite_vrl_cont.buffer = malloc((TILEWH*2)*TILEWH); + map->tiles->tileHeight = TILEWH; + map->tiles->tileWidth =TILEWH; + map->tiles->rows = 1; + map->tiles->cols = 2; + + i=0; + for(y=0; ytiles->spri->sprite_vrl_cont.buffer[i] = 2;//0x24; + else + map->tiles->spri->sprite_vrl_cont.buffer[i] = 1;//0x34; + i++; + } + } + + i=0; + for(y=0; yheight; y++) { + for(x=0; xwidth; x++) { + map->layerdata[0].data[i] = tile; + tile = tile ? 1 : 2; + i++; + } + tile = tile ? 1 : 2; + } +} //===========================================================================// diff --git a/src/xcroll.c b/src/xcroll.c index 0f4bf060..c968bdf6 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -26,6 +26,7 @@ #include "src/lib/16_dbg.h" #define FADE +//#define NOMAPLOAD //map_view_t mv[4]; static map_t map; @@ -83,13 +84,16 @@ void main(int argc, char *argv[]) //----gvar.player[0].enti.spri.spritesheet = malloc(sizeof(struct vrs_container)); // create the map +#ifndef NOMAPLOAD // fprintf(stderr, "testing map load~ "); CA_loadmap("data/test.map", &map, &gvar); chkmap(&map, 0); // initMap(&map); // printf("chkmap ok "); // fprintf(stderr, "yay map loaded~~\n"); - +#else + initMap(&map); +#endif // data VRS_LoadVRS(bakapee1, &gvar.player[0].enti, &gvar); -- 2.39.5