]> 4ch.mooo.com Git - 16.git/commitdiff
FACK!
authorsparky4 <sparky4@cock.li>
Tue, 14 Jul 2015 01:15:12 +0000 (20:15 -0500)
committersparky4 <sparky4@cock.li>
Tue, 14 Jul 2015 01:15:12 +0000 (20:15 -0500)
modified:   16.exe
modified:   fonttes0.exe
modified:   maptest.exe
modified:   palettec.exe
modified:   pcxtest.exe
modified:   src/fonttes0.c
modified:   src/lib/modex16.c
modified:   src/lib/modex16.h
modified:   test.exe
modified:   test2.exe

16.exe
fonttes0.exe
maptest.exe
palettec.exe
pcxtest.exe
src/fonttes0.c
src/lib/modex16.c
src/lib/modex16.h
test.exe
test2.exe

diff --git a/16.exe b/16.exe
index f2cbc3ab2e23aebc034f0002ef5ed1e0e729e1e5..e48b8aef3ba9b7b5bdddacd2eabd1ecd6fdf9e08 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 84c525684fe5bf8b00831e181ecc8a7d753c813b..4cc28256a65059b63811f6a3c999605618e1d378 100644 (file)
Binary files a/fonttes0.exe and b/fonttes0.exe differ
index c8fd20c677d35585439ef1a3d2ea47ce86c63f2d..e86cd95d52cd62dd795180ffd56f916f66adbf09 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index 119172a3a3099742b0982d2116eced5288557d01..925e1a651501622da4c6d0655018692a7f5f899e 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index 9794ec35e7e74f32d03971eb1b647b2793db9617..3be4c9071cdb28fe6ba6ed3d05222058b3468d7f 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 4a775a3ad92b53bf5a1a4a75e56de5a4949cc3ce..a59dfc102f62258e9356fc60d5542e0b8660c037 100644 (file)
@@ -170,7 +170,8 @@ void main(int argc, char near *argv[])
                        //printf("j=%d  ", j);
                        //printf("%02x\n", l[i] & j);
                                //modexPutPixel(xp, i, l[i] & j ? 15:0);
-                               modexClearRegion(&page, xp, i, 4, 4, l[i] & j ? 15:0);
+                               //modexpixelwr(xp, i, 0, l[i] & j ? 15:0);
+                               modexClearRegion(&page, xp*4, i*4, 4, 4, l[i] & j ? 15:0);
 //while(!getch());
                        xp++;
                        j>>=1;
index 98fbb628174f4250e56aa4379aaf9d175aa5f82d..2b2818feeb2dcf9ef9aa2ab13c6d9f484e5f66ff 100644 (file)
@@ -942,39 +942,36 @@ no... wait.... no wwww
                free(pal);
 }
 
-void modexPutPixel(word x, word y, byte Color)
+void modexpixelwr(word xx, word yy, word PageBase, word Color)
 {
-// on entry X,Y = location and C = color (0-15)
-//putpixel   proc near uses ax bx cx dx
-// byte offset = Y * (horz_res / 8) + int(X / 8)
-
-// byte offset = Y * (horz_res / 8) + int(X / 8)
-
+       word x=xx;
+       word y=yy;
        __asm
        {
-               mov  ax,y                    // calculate offset
-               mov  dx,80
-               mul  dx                      // ax = y * 80
-               mov  bx,x
-               mov  cl,bl                   // save low byte for below
-               //shr  bx,03
-               add  bx,ax                   // bx = offset this group of 8 pixels
-
-               mov  dx,GC_INDEX                // set to video hardware controller
-
-               and  cl,07h                  // Compute bit mask from X-coordinates
-               xor  cl,07h                  //  and put in ah
-               mov  ah,01h
-               shl  ah,cl
-               mov  al,08h                  // bit mask register
-               out  dx,ax
-
-               mov  ax,0205h                // read mode 0, write mode 2
-               out  dx,ax
-
-               mov  al,es:[bx]              // load to latch register
-               mov  al,Color
-               mov  es:[bx],al              // write to register
+               push    bp                      //preserve caller’s stack frame
+               mov     bp,sp                   //point to local stack frame
+
+               mov     ax,SCREEN_WIDTH
+               mul     [bp+4/*y*/]                  //offset of pixel’s scan line in page
+               mov     bx,[bp+4/*x*/]
+               shr     bx,1
+               shr     bx,1                    //X/4 = offset of pixel in scan line
+               add     bx,ax                   //offset of pixel in page
+               add     bx,[bp+0/*PageBase*/]        //offset of pixel in display memory
+               mov     ax,SCREEN_SEG
+               mov     es,ax                   //point ES:BX to the pixel’s address
+
+               mov     cl,byte ptr [bp+4/*x*/]
+               and     cl,011b                 //CL = pixel’s plane
+               mov     ax,0100h + MAP_MASK     //AL = index in SC of Map Mask reg
+               shl             ah,cl                   //set only the bit for the pixel’s plane to 1
+               mov     dx,SC_INDEX             //set the Map Mask to enable only the
+               out     dx,ax                   // pixel’s plane
+
+               mov     al,byte ptr [bp+15/*Color*/]
+               mov     es:[bx],al              //draw the pixel in the desired color
+
+               pop     bp                      //restore caller’s stack frame
        }
 }
 
index 66330fe166c1c9683a3238ef7b973a191be3a917..d748e4be9acffd9057288a0ad610e6b13256fccf 100644 (file)
@@ -92,7 +92,7 @@ void modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset);
 void modexPalUpdate1(byte *p);
 void modexPalUpdate0(byte *p);
 void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);
-void modexPutPixel(word x, word y, byte Color);
+void modexpixelwr(word xx, word yy, word PageBase, word Color);
 void bputs(/*bmp_t *bmp, */unsigned x, unsigned y, const char *s);
 void modexWaitBorder();
 
index 965a131a41ba722d6bf0802bfcc7b3f224f7b7be..bd8ed8e35f7deeab195909f7909196735549a988 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 6f009cc24933067fc4bfb4543ec883eb0deaf1e4..d54bbbd57c281a6b7cd9b8d1c85ea846493513db 100644 (file)
Binary files a/test2.exe and b/test2.exe differ