]> 4ch.mooo.com Git - 16.git/commitdiff
modified: 16/DOS_GFX.EXE
authorsparky4 <sparky4@4ch.maidlab.jp>
Sun, 18 May 2014 22:33:46 +0000 (17:33 -0500)
committersparky4 <sparky4@4ch.maidlab.jp>
Sun, 18 May 2014 22:33:46 +0000 (17:33 -0500)
modified:   16/Project 16.bfproject
modified:   16/dos_gfx.cpp

16/DOS_GFX.EXE
16/Project 16.bfproject
16/dos_gfx.cpp

index d93fb11fa129b4fb6be1c07f7a678844e63ac2ee..9c028e8d9b88d3a43963d14c1a733245494ff4c1 100644 (file)
Binary files a/16/DOS_GFX.EXE and b/16/DOS_GFX.EXE differ
index e6f1291f3dd78ae29c1785fd698d2b4650262506..8e850a5933a9e25a79ad480dbd75b97f5aecc172 100644 (file)
@@ -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
index 360137edaa436ca905a306b68281dec220c0bee3..a561569a3c3bedd30b10307a0a81e147c0b5b1e7 100644 (file)
@@ -145,48 +145,48 @@ void set320x200x256_X(void)
 \r
                /* By default we want screen refreshing and drawing operations\r
                   to be based at offset 0 in the video segment. */\r
-               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;\r
+\r
+               /*\r
+--------------------\r
+HORIZONTAL SCROLLING\r
+--------------------\r
+Horizontal scrolling is essentially the same as vertical scrolling, all\r
+you do is increment or decrement the VGA offset register by 1 instead of\r
+80 as with vertical scrolling.\r
+\r
+However, horizontal scrolling is complicated by two things\r
+\r
+  1. Incrementing the offset register by one actually scrolls by FOUR\r
+     pixels (and there are FOUR planes on the VGA, what a coincidence)\r
+\r
+  2. You can't draw the image off the screen and then scroll it on\r
+     because of the way the VGA wraps to the next row every 80 bytes\r
+     (80 bytes * 4 planes = 320 pixels), if you tried it, you would\r
+     actually be drawing to the other side of the screen (which is\r
+     entirely visible)\r
+\r
+I'll solve these problems one at a time.\r
+\r
+Firstly, to get the VGA to scroll by only one pixel you use the horizontal\r
+pixel panning (HPP) register. This register resides at\r
+\r
+  PORT:     3C0H\r
+  INDEX:    13h\r
+\r
+and in real life, you use it like this\r
+\r
+----------------- Pixel Panning ---------------\r
+IN PORT 3DAH (this clears an internal\r
+  flip-flop of the VGA)\r
+OUT 13H TO PORT 3C0H\r
+OUT value TO PORT 3C0H (where "value" is the\r
+  number of pixels to offset)\r
+-----------------------------------------------\r
+*/\r
+               inp(0x3DA);\r
+               outpw(0x3C0, 0x13);\r
+               outpw(0x3C0, 0x58);\r
 \r
                }\r
 \r
@@ -278,8 +278,8 @@ void set320x240x256_X(void)
                outpw(0x3D4, 0xAC11);              /* vertical retrace end AND wr.prot */\r
                outpw(0x3D4, 0xDF12);              /* vertical display enable end */\r
                outpw(0x3D4, 0xE715);              /* start vertical blanking */\r
-               outpw(0x3D4, 0x0616);              /* end vertical blanking */
-
+               outpw(0x3D4, 0x0616);              /* end vertical blanking */\r
+\r
                /* Update mode info, so future operations are aware of the\r
                   resolution */\r
                height = 240;\r
@@ -309,117 +309,116 @@ void vScroll(int rows)
        // Scrolling = current start + (rows * bytes in a row)\r
        setVisibleStart(visStart + (rows * width));\r
 }\r
-
+\r
 void scrolly(int bong)\r
-{
+{\r
        int boing=0;\r
-       if(bong<0)
-               boing=-1;
-       else if(bong>0)
-               boing=1;
-       else break;
-\r
-       for(int i=0;i<TILEWH;i++)
-               vScroll(boing)
-}
-\r
-/*
-\r
-
-To implement smooth horizontal scrolling, you would do the following:
-
--------------- Horizontal Scrolling ------------
-FOR X = 0 TO 319 DO
-  SET HPP TO ( X MOD 4 )
-  SET VGA OFFSET TO ( X/4 )
-END FOR
-------------------------------------------------
-
-Okay, no problem at all (although I think you might have to fiddle
-around with the HPP a bit to get it right...try different values and
-see what works :).
-
-So, the next problem is with drawing the images off the screen where
-they aren't visible and then scrolling them on!!! As it turns out,
-there's yet ANOTHER register to accomplish this. This one's called the
-offset register (no, not the one I was talking about before, that one
-was actually the "start address" register) and it's at
-
-  PORT:     3D4H/3D5H
-  OFFSET:   13H
-
-and here's how to use it
-
--------------- Offset Register ---------------
-OUT 13H TO PORT 3D4H
-OUT value TO PORT 3D5H
-----------------------------------------------
-
-Now, what my VGA reference says is that this register holds the number
-of bytes (not pixels) difference between the start address of each row.
-So, in X-mode it normally contains the value 80 (as we remember,
-80 bytes * 4 planes = 320 pixels). This register does not affect the
-VISIBLE width of the display, only the difference between addresses on
-each row.
-
-When we scroll horizontally, we need a little bit of extra working space
-so we can draw off the edge of the screen.
-
-Perhaps a little diagram will clarify it. The following picture is of a
-standard X-mode addressing scheme with the OFFSET register set to 80.
-
-      ROW    OFFSET
-      0         0 ========================
-      1        80 [                      ]
-      2       160 [                      ]
-      ..       .. [       VISIBLE        ]
-                  [        SCREEN        ]
-                  [                      ]
-                  [                      ]
-      ..       .. [                      ]
-      199   15920 ========================
-
-and the next diagram is of a modified addressing scheme with the OFFSET
-register set to 82 (to give us 4 extra pixels on each side of the screen)
-
-ROW    OFFSET
-0         0 ------========================------
-1        82 |   V [                      ]   V |
-2       164 |   I [                      ]   I |
-..       .. | N S [      VISIBLE         ] N S |
-            | O I [       SCREEN         ] O I |
-            | T B [                      ] T B |
-            |   L [                      ]   L |
-..       .. |   E [                      ]   E |
-199   16318 ------========================------
-
-Beautiful!!!
-
-As with vertical scrolling, however, you still have the problem of when
-you reach the bottom of page 4...and it's fixed in the same manner.
-
-I haven't actually managed to get infinite horizontal scrolling working,
-but the method I have just stated will give you a horizontal scrolling
-range of over 200 screens!!!! So if you need more (which is extremely
-unlikely), figure it out yourself.
-
-
-------------------
-COMBINED SCROLLING
-------------------
-To do both horizontal and vertical scrolling, all you have to do is combine
-the two methods with a few little extras (it's always the way isn't it).
-
-You have to start off with the original screen on the current page and the
-next page as well. When you scroll horizontally, you have to draw the edge
-that's coming in to the screen to BOTH pages (that means you'll be drawing
-the incoming edge twice, once for each page). You do this so that when you
-have scrolled vertically down through a complete page, you can jump back
-to the first page and it will (hopefully) have an identical copy, and you
-can then continue scrolling again.
-
-I'm sorry about this being so confusing but it's a bit difficult to explain.
-
+       if(bong<0)\r
+               boing=-1;\r
+       else if(bong>0)\r
+               boing=1;\r
+\r
+       for(int ti=0;ti<TILEWH;ti++)\r
+               vScroll(boing);\r
+}\r
+\r
+/*\r
+\r
+\r
+To implement smooth horizontal scrolling, you would do the following:\r
+\r
+-------------- Horizontal Scrolling ------------\r
+FOR X = 0 TO 319 DO\r
+  SET HPP TO ( X MOD 4 )\r
+  SET VGA OFFSET TO ( X/4 )\r
+END FOR\r
+------------------------------------------------\r
+\r
+Okay, no problem at all (although I think you might have to fiddle\r
+around with the HPP a bit to get it right...try different values and\r
+see what works :).\r
+\r
+So, the next problem is with drawing the images off the screen where\r
+they aren't visible and then scrolling them on!!! As it turns out,\r
+there's yet ANOTHER register to accomplish this. This one's called the\r
+offset register (no, not the one I was talking about before, that one\r
+was actually the "start address" register) and it's at\r
+\r
+  PORT:     3D4H/3D5H\r
+  OFFSET:   13H\r
+\r
+and here's how to use it\r
+\r
+-------------- Offset Register ---------------\r
+OUT 13H TO PORT 3D4H\r
+OUT value TO PORT 3D5H\r
+----------------------------------------------\r
+\r
+Now, what my VGA reference says is that this register holds the number\r
+of bytes (not pixels) difference between the start address of each row.\r
+So, in X-mode it normally contains the value 80 (as we remember,\r
+80 bytes * 4 planes = 320 pixels). This register does not affect the\r
+VISIBLE width of the display, only the difference between addresses on\r
+each row.\r
+\r
+When we scroll horizontally, we need a little bit of extra working space\r
+so we can draw off the edge of the screen.\r
+\r
+Perhaps a little diagram will clarify it. The following picture is of a\r
+standard X-mode addressing scheme with the OFFSET register set to 80.\r
+\r
+      ROW    OFFSET\r
+      0         0 ========================\r
+      1        80 [                      ]\r
+      2       160 [                      ]\r
+      ..       .. [       VISIBLE        ]\r
+                  [        SCREEN        ]\r
+                  [                      ]\r
+                  [                      ]\r
+      ..       .. [                      ]\r
+      199   15920 ========================\r
+\r
+and the next diagram is of a modified addressing scheme with the OFFSET\r
+register set to 82 (to give us 4 extra pixels on each side of the screen)\r
+\r
+ROW    OFFSET\r
+0         0 ------========================------\r
+1        82 |   V [                      ]   V |\r
+2       164 |   I [                      ]   I |\r
+..       .. | N S [      VISIBLE         ] N S |\r
+            | O I [       SCREEN         ] O I |\r
+            | T B [                      ] T B |\r
+            |   L [                      ]   L |\r
+..       .. |   E [                      ]   E |\r
+199   16318 ------========================------\r
+\r
+Beautiful!!!\r
+\r
+As with vertical scrolling, however, you still have the problem of when\r
+you reach the bottom of page 4...and it's fixed in the same manner.\r
+\r
+I haven't actually managed to get infinite horizontal scrolling working,\r
+but the method I have just stated will give you a horizontal scrolling\r
+range of over 200 screens!!!! So if you need more (which is extremely\r
+unlikely), figure it out yourself.\r
+\r
+\r
+------------------\r
+COMBINED SCROLLING\r
+------------------\r
+To do both horizontal and vertical scrolling, all you have to do is combine\r
+the two methods with a few little extras (it's always the way isn't it).\r
+\r
+You have to start off with the original screen on the current page and the\r
+next page as well. When you scroll horizontally, you have to draw the edge\r
+that's coming in to the screen to BOTH pages (that means you'll be drawing\r
+the incoming edge twice, once for each page). You do this so that when you\r
+have scrolled vertically down through a complete page, you can jump back\r
+to the first page and it will (hopefully) have an identical copy, and you\r
+can then continue scrolling again.\r
+\r
+I'm sorry about this being so confusing but it's a bit difficult to explain.\r
+\r
 \r
 */\r
 //---------------------------------------------------\r
@@ -554,10 +553,10 @@ void ssd(int svq){
 /*-----------ding-------------*/\r
 int ding(int q){\r
 \r
-       if(yy<height){\r
+//     if(yy<height){\r
                setActivePage(0);\r
                setVisiblePage(0);\r
-       }\r
+/*     }\r
        if((height)<yy<(height*2)){\r
                setActivePage(1);\r
                setVisiblePage(1);\r
@@ -565,7 +564,7 @@ int ding(int q){
        if((height*2)<yy<(height*3)){\r
                setActivePage(2);\r
                setVisiblePage(2);\r
-       }\r
+       }*/\r
                int d3y;\r
 \r
 //++++  if(q <= 4 && q!=2 && gq == BONK-1) coor = rand()%HGQ;\r
@@ -645,23 +644,27 @@ int ding(int q){
                                                                }\r
                                                }else{\r
                                                                if(!bakax){\r
-                                                                               xx-=TILEWH;\r
+//                                                                             xx-=TILEWH;\r
+                                                                               xx--;\r
                                                                }else if(bakax>1){\r
-                                                                               xx+=TILEWH;\r
+//                                                                             xx+=TILEWH;\r
+                                                                               xx++;\r
                                                                }\r
                                                                if(!bakay){\r
-                                                                               yy-=TILEWH;\r
+//                                                                             yy-=TILEWH;\r
+                                                                               yy--;\r
                                                                }else if(bakay>1){\r
-                                                                               yy+=TILEWH;\r
+//                                                                             yy+=TILEWH;\r
+                                                                               yy++;\r
                                                                }\r
                                                }\r
                                }\r
                                // fixer\r
 //                             if(q!=16){\r
 //if(q!=16)\r
-                                               if(xx<0) xx=width;\r
+                                               if(xx<(0/*-TILEWH*/)) xx=(width/*+TILEWH*/);\r
                                                if(yy<0) yy=(height*3);\r
-                                               if(xx>width) xx=0;\r
+                                               if(xx>(width/*+TILEWH*/)) xx=(0/*-TILEWH*/);\r
                                                if(yy>(height*3)) yy=0;\r
 //                             }\r
 \r
@@ -678,16 +681,19 @@ int ding(int q){
                                // plot the pixel\r
 //----           ppf(xx, yy, coor, vga);\r
                                }else /*if(xx>=0 && xx<width && yy>=0 && yy<(height*3))*/{\r
-                                       putColorBox_X(xx, yy, TILEWH, TILEWH, coor);\r
-//++++0000                                     putPixel_X(xx, yy, coor);\r
+//                                     putColorBox_X(xx, yy, TILEWH, TILEWH, coor);\r
+//++++0000\r
+                                       putPixel_X(xx, yy, coor);\r
                                } \r
 \r
 //----           if(q==2) ppf(rand()%, rand()%height, 0, vga);\r
-                               if(q==2) putColorBox_X(rand()%width, rand()%(height*3), TILEWH, TILEWH, 0);\r
+//                             if(q==2) putColorBox_X(rand()%width, rand()%(height*3), TILEWH, TILEWH, 0);\r
+//++++0000\r
+                               if(q==2) putPixel_X(rand()%width, rand()%(height*3), 0);\r
                                if(q==16) putPixel_X(rand()%width, rand()%(height*3), 0);\r
                                if(q==2||q==4||q==16){ bakax = rand()%3; bakay = rand()%3; }\r
                                gq++;\r
-//if(xx<0||xx>320||yy<0||yy>240)\r
+//if(xx<0||xx>320||yy<0||yy>(height*3))\r
 //       printf("%d %d %d %d %d %d\n", xx, yy, coor, bakax, bakay, getPixel_X(xx,yy));\r
 //       printf("%d\n", getPixel_X(xx,yy));\r
 //0000\r