X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.c;h=023c440f4ea4248519a99425c35ac79701a57459;hb=7c35eb648613504ac47e5605d79f93112f569134;hp=07eb939ffa5ebc7d2aa2523c00605c842104ff3b;hpb=cdb255713796ffb83b3bc2676e079871c4b47731;p=16.git diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 07eb939f..023c440f 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -292,6 +292,13 @@ void modexHiganbanaPageSetup(video_t *video) modexCalcVmemRemain(video); video->p=0; video->r=1; + video->vh=video->page[0].height+video->page[1].height+video->page[2].height+video->page[3].height; + //doslib origi var + video->omemptr= vga_state.vga_graphics_ram; + video->vga_draw_stride= vga_state.vga_draw_stride; + video->vga_draw_stride_limit= vga_state.vga_draw_stride_limit; + //sprite render switch + video->rss=0; //setup the buffersize video->page[0].dx=video->page[0].dy= @@ -333,8 +340,6 @@ modexShowPage(page_t *page) { outp(AC_INDEX, 0x33); outp(AC_INDEX, (page[0].dx & 0x03) << 1); } - -//another variant //args: page, vertical sync switch, screen resolution switch, page0 switch void VL_ShowPage(page_t *page, boolean vsync, boolean sr) { @@ -1254,6 +1259,56 @@ void modexcls(page_t *page, byte color, byte *Where) _fmemset(Where, color, page->width*(page->height)/4); } +// +// pattern filler from joncampbell123's code +// +void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw) +{ + unsigned int i,j,o, d,h,s; + word w; + + switch(sw) + { + case 0: + w=vga_state.vga_width; + d=0; + s=vga_state.vga_stride; + switch(allsw) + { + case 0: + h=vga_state.vga_height; + break; + case 1: + h=video->vh; + break; + } + break; + default: + w=video->page[pn].width; + d=(0x10000UL - (uint16_t)video->page[pn].data); + s=video->page[pn].stridew; + switch(allsw) + { + case 0: + h=video->page[pn].height; + break; + case 1: + if(!pn) h=video->vh; + else h=video->page[pn].height; + break; + } + break; + } + + /* fill screen/pattern with a distinctive pattern */ + for (i=0;i < w;i++) { + o = (i >> 2) + d; + vga_write_sequencer(0x02/*map mask*/,1 << (i&3)); + for (j=0;j < h;j++,o += s) + vga_state.vga_graphics_ram[o] = (i^j)&15; // VRL samples put all colors in first 15! + } +} + void modexWaitBorder() { while(inp(INPUT_STATUS_1) & 8) { @@ -1265,18 +1320,28 @@ modexWaitBorder() { } } -void modexprintmeminfo(video_t *v) +// +// printings of video memory information +// +void VL_PrintmodexmemInfo(video_t *v) { byte i; - printf("video memory remaining: %u\n", v->vmem_remain); - printf("page "); + +// printf("========================================\n"); + printf("VL_PrintmodexmemInfo:\n"); +// printf("========================================\n"); + printf(" Virtual Screen: %dx", v->page[0].width); printf("%d ", v->page[0].height); printf("Tile: %dx", v->page[0].tilesw); printf("%d", v->page[0].tilesh); printf("=((Virtual Screen)/16)\n"); + printf(" Screen: %dx", v->page[0].sw); printf("%d ", v->page[0].sh); printf("Tile: %dx", v->page[0].tw); printf("%d", v->page[0].th); printf("=((Screen)/16)\n"); + + printf(" Free Video Memory: %u\n", v->vmem_remain); + printf(" page"); for(i=0; inum_of_pages;i++) { printf(" [%u]=", i); printf("(%Fp)", (v->page[i].data)); printf(" size=%u ", v->page[i].pagesize); - printf("w=%lu h=%lu ", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height); - printf("sw=%lu sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh); + printf("w=%-3lu h=%-3lu ", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height); + printf("sw=%-3lu sh=%-3lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh); printf("pi=%u", v->page[i].pi); printf("\n"); }