From: sparky4 Date: Mon, 13 Jul 2015 17:57:03 +0000 (-0500) Subject: modified: 16.exe X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=4b6dfcdf9fc75885fbd15a450041d895088f8f6e;p=16.git 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 --- diff --git a/16.exe b/16.exe index a6418783..f2cbc3ab 100644 Binary files a/16.exe and b/16.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index 40b2c4eb..84c52568 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/maptest.exe b/maptest.exe index cb42cfc7..c8fd20c6 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index bdbd900d..119172a3 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 03194e16..9794ec35 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/fonttes0.c b/src/fonttes0.c index 6b082117..4a775a3a 100644 --- a/src/fonttes0.c +++ b/src/fonttes0.c @@ -169,6 +169,7 @@ void main(int argc, char near *argv[]) //printf("l[i]=%d ", l[i]); //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); //while(!getch()); xp++; diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 1534ed56..98fbb628 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -941,38 +941,42 @@ no... wait.... no wwww printf("chkcolor end~\n"); free(pal); } -/* -; 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) - - 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 ; div by 8 - add bx,ax ; bx = offset this group of 8 pixels - - mov dx,03CEh ; 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 ; +void modexPutPixel(word x, word y, byte 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) - mov al,es:[bx] ; load to latch register - mov al,Color - mov es:[bx],al ; write to register +// byte offset = Y * (horz_res / 8) + int(X / 8) - ret -putpixel endp*/ + __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 + } +} void bputs(/*bmp_t *bmp, */unsigned x, unsigned y, const char *s) { diff --git a/src/lib/modex16.h b/src/lib/modex16.h index f2161174..66330fe1 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -92,6 +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 bputs(/*bmp_t *bmp, */unsigned x, unsigned y, const char *s); void modexWaitBorder(); diff --git a/test.exe b/test.exe index a6e4adf5..965a131a 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index c9401261..6f009cc2 100644 Binary files a/test2.exe and b/test2.exe differ