From: sparky4 Date: Sun, 18 May 2014 22:33:46 +0000 (-0500) Subject: modified: 16/DOS_GFX.EXE X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=97b8176cd0334c5d7eef117e670b9cfb94735bf7;p=16.git modified: 16/DOS_GFX.EXE modified: 16/Project 16.bfproject modified: 16/dos_gfx.cpp --- diff --git a/16/DOS_GFX.EXE b/16/DOS_GFX.EXE index d93fb11f..9c028e8d 100644 Binary files a/16/DOS_GFX.EXE and b/16/DOS_GFX.EXE differ diff --git a/16/Project 16.bfproject b/16/Project 16.bfproject index e6f1291f..8e850a59 100644 --- a/16/Project 16.bfproject +++ b/16/Project 16.bfproject @@ -1,16 +1,17 @@ c2e.convert_special: 0 e2c.convert_num: 0 -openfiles: /dos/z/16/16/dos_gfx.cpp:17003:16466:1: -openfiles: /dos/z/16/16/dos_gfx.h:102:0:0: -openfiles: /dos/z/16/16/dos_kb.c:0:0:0: +openfiles: /dos/z/16/16/dos_gfx.cpp:19214:18374:1: +openfiles: /dos/z/16/16/dos_gfx.h:380:0:0: +openfiles: /dos/z/16/16/dos_kb.c:658:109:0: openfiles: /dos/z/16/16/dos_kb.h:60:0:0: openfiles: /dos/z/16/16/lib/lib_com.cpp:0:0:0: openfiles: /dos/z/16/16/lib/lib_com.h:0:0:0: -openfiles: /dos/z/16/16/scroll.txt:0:0:0: +openfiles: /dos/z/16/16/scroll.txt:5307:5103:0: openfiles: /dos/z/16/16/project16.txt:1675:0:0: openfiles: /dos/z/16/16/16.txt:0:0:0: openfiles: /dos/z/16/16/lib/x/MXSM.ASM:12781:12781:0: -openfiles: /dos/z/16/16/lib/x/MODEX.H:1885:1601:0: +openfiles: /dos/z/16/16/lib/x/MODEX.H:1768:1601:0: +openfiles: /dos/z/16/16/lib/x/MXPN.ASM:1205:649:0: snr_recursion_level: 0 convertcolumn_horizontally: 0 adv_open_matchname: 0 @@ -25,7 +26,7 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/16/lib/x wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: Visible +ssearch_text: 3DA snr_casesens: 0 view_blocks: 1 name: project 16 @@ -60,17 +61,18 @@ recent_files: file:///dos/z/4x4_16/tile.h recent_files: file:///dos/z/16/16/lib_com.cpp recent_files: file:///dos/z/16/16/lib_com.h recent_files: file:///dos/z/16/16/PCGPE10/SCROLL.TXT -recent_files: file:///dos/z/16/16/dos_kb.h +recent_files: file:///dos/z/16/16/dos_gfx.cpp recent_files: file:///dos/z/16/16/dos_gfx.h +recent_files: file:///dos/z/16/16/dos_kb.h +recent_files: file:///dos/z/16/16/dos_kb.c recent_files: file:///dos/z/16/16/lib/lib_com.cpp recent_files: file:///dos/z/16/16/lib/lib_com.h -recent_files: file:///dos/z/16/16/dos_kb.c -recent_files: file:///dos/z/16/16/dos_gfx.cpp recent_files: file:///dos/z/16/16/project16.txt recent_files: file:///dos/z/16/16/16.txt recent_files: file:///dos/z/16/16/scroll.txt -recent_files: file:///dos/z/16/16/lib/x/MXSM.ASM recent_files: file:///dos/z/16/16/lib/x/MODEX.H +recent_files: file:///dos/z/16/16/lib/x/MXSM.ASM +recent_files: file:///dos/z/16/16/lib/x/MXPN.ASM snr_replacetype: 0 savedir: file:///dos/z/16/16 spell_check_default: 1 @@ -82,10 +84,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: fill_plane -searchlist: red -searchlist: rext -searchlist: rect`- searchlist: fill_plane( searchlist: fmemset searchlist: se @@ -97,6 +95,10 @@ searchlist: 386 searchlist: CRTC_INDEX searchlist: setVisiblePage searchlist: VisiblePage +searchlist: lib/x/MXPN.ASM +searchlist: 3c0 +searchlist: ABS +searchlist: 3DAH autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/16/dos_gfx.cpp b/16/dos_gfx.cpp index 360137ed..a561569a 100644 --- a/16/dos_gfx.cpp +++ b/16/dos_gfx.cpp @@ -145,48 +145,48 @@ void set320x200x256_X(void) /* By default we want screen refreshing and drawing operations to be based at offset 0 in the video segment. */ - actStart = visStart = 0; - - /* --------------------- -HORIZONTAL SCROLLING --------------------- -Horizontal scrolling is essentially the same as vertical scrolling, all -you do is increment or decrement the VGA offset register by 1 instead of -80 as with vertical scrolling. - -However, horizontal scrolling is complicated by two things - - 1. Incrementing the offset register by one actually scrolls by FOUR - pixels (and there are FOUR planes on the VGA, what a coincidence) - - 2. You can't draw the image off the screen and then scroll it on - because of the way the VGA wraps to the next row every 80 bytes - (80 bytes * 4 planes = 320 pixels), if you tried it, you would - actually be drawing to the other side of the screen (which is - entirely visible) - -I'll solve these problems one at a time. - -Firstly, to get the VGA to scroll by only one pixel you use the horizontal -pixel panning (HPP) register. This register resides at - - PORT: 3C0H - INDEX: 13h - -and in real life, you use it like this - ------------------ Pixel Panning --------------- -IN PORT 3DAH (this clears an internal - flip-flop of the VGA) -OUT 13H TO PORT 3C0H -OUT value TO PORT 3C0H (where "value" is the - number of pixels to offset) ------------------------------------------------ -*/ - inp(0x3DA) - outpw(0x3C0, 0x13); - outpw(0x3C0, 0x58); + actStart = visStart = 0; + + /* +-------------------- +HORIZONTAL SCROLLING +-------------------- +Horizontal scrolling is essentially the same as vertical scrolling, all +you do is increment or decrement the VGA offset register by 1 instead of +80 as with vertical scrolling. + +However, horizontal scrolling is complicated by two things + + 1. Incrementing the offset register by one actually scrolls by FOUR + pixels (and there are FOUR planes on the VGA, what a coincidence) + + 2. You can't draw the image off the screen and then scroll it on + because of the way the VGA wraps to the next row every 80 bytes + (80 bytes * 4 planes = 320 pixels), if you tried it, you would + actually be drawing to the other side of the screen (which is + entirely visible) + +I'll solve these problems one at a time. + +Firstly, to get the VGA to scroll by only one pixel you use the horizontal +pixel panning (HPP) register. This register resides at + + PORT: 3C0H + INDEX: 13h + +and in real life, you use it like this + +----------------- Pixel Panning --------------- +IN PORT 3DAH (this clears an internal + flip-flop of the VGA) +OUT 13H TO PORT 3C0H +OUT value TO PORT 3C0H (where "value" is the + number of pixels to offset) +----------------------------------------------- +*/ + inp(0x3DA); + outpw(0x3C0, 0x13); + outpw(0x3C0, 0x58); } @@ -278,8 +278,8 @@ void set320x240x256_X(void) outpw(0x3D4, 0xAC11); /* vertical retrace end AND wr.prot */ outpw(0x3D4, 0xDF12); /* vertical display enable end */ outpw(0x3D4, 0xE715); /* start vertical blanking */ - outpw(0x3D4, 0x0616); /* end vertical blanking */ - + outpw(0x3D4, 0x0616); /* end vertical blanking */ + /* Update mode info, so future operations are aware of the resolution */ height = 240; @@ -309,117 +309,116 @@ void vScroll(int rows) // Scrolling = current start + (rows * bytes in a row) setVisibleStart(visStart + (rows * width)); } - + void scrolly(int bong) -{ +{ int boing=0; - if(bong<0) - boing=-1; - else if(bong>0) - boing=1; - else break; - - for(int i=0;i0) + boing=1; + + for(int ti=0;ti1){ - xx+=TILEWH; +// xx+=TILEWH; + xx++; } if(!bakay){ - yy-=TILEWH; +// yy-=TILEWH; + yy--; }else if(bakay>1){ - yy+=TILEWH; +// yy+=TILEWH; + yy++; } } } // fixer // if(q!=16){ //if(q!=16) - if(xx<0) xx=width; + if(xx<(0/*-TILEWH*/)) xx=(width/*+TILEWH*/); if(yy<0) yy=(height*3); - if(xx>width) xx=0; + if(xx>(width/*+TILEWH*/)) xx=(0/*-TILEWH*/); if(yy>(height*3)) yy=0; // } @@ -678,16 +681,19 @@ int ding(int q){ // plot the pixel //---- ppf(xx, yy, coor, vga); }else /*if(xx>=0 && xx=0 && yy<(height*3))*/{ - putColorBox_X(xx, yy, TILEWH, TILEWH, coor); -//++++0000 putPixel_X(xx, yy, coor); +// putColorBox_X(xx, yy, TILEWH, TILEWH, coor); +//++++0000 + putPixel_X(xx, yy, coor); } //---- if(q==2) ppf(rand()%, rand()%height, 0, vga); - if(q==2) putColorBox_X(rand()%width, rand()%(height*3), TILEWH, TILEWH, 0); +// if(q==2) putColorBox_X(rand()%width, rand()%(height*3), TILEWH, TILEWH, 0); +//++++0000 + if(q==2) putPixel_X(rand()%width, rand()%(height*3), 0); if(q==16) putPixel_X(rand()%width, rand()%(height*3), 0); if(q==2||q==4||q==16){ bakax = rand()%3; bakay = rand()%3; } gq++; -//if(xx<0||xx>320||yy<0||yy>240) +//if(xx<0||xx>320||yy<0||yy>(height*3)) // printf("%d %d %d %d %d %d\n", xx, yy, coor, bakax, bakay, getPixel_X(xx,yy)); // printf("%d\n", getPixel_X(xx,yy)); //0000