Updates to clean up and fix the IM-1024 driver.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
* This is implemented by holding a FIFO of unlimited depth in
|
||||
* the IM1024 to receive the data.
|
||||
*
|
||||
* Version: @(#)vid_im1024.c 1.0.1 2019/03/01
|
||||
* Version: @(#)vid_im1024.c 1.0.2 2019/03/02
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* John Elliott, <jce@seasip.info>
|
||||
@@ -100,7 +100,7 @@ static void
|
||||
fifo_write(im1024_t *dev, uint8_t val)
|
||||
{
|
||||
#if 0
|
||||
DEBUG(("fifo_write: %02x [rd=%04x wr=%04x]\n",
|
||||
DEBUG(("IM1024: fifo_write: %02x [rd=%04x wr=%04x]\n",
|
||||
val, dev->fifo_rdptr, dev->fifo_wrptr));
|
||||
#endif
|
||||
|
||||
@@ -108,7 +108,8 @@ fifo_write(im1024_t *dev, uint8_t val)
|
||||
/* FIFO is full. Double its size. */
|
||||
uint8_t *buf;
|
||||
|
||||
DEBUG("fifo_resize: %d to %d\n", dev->fifo_len, 2 * dev->fifo_len);
|
||||
DEBUG("IM1024: fifo_resize: %i to %i\n",
|
||||
dev->fifo_len, 2 * dev->fifo_len);
|
||||
|
||||
buf = realloc(dev->fifo, 2 * dev->fifo_len);
|
||||
if (buf == NULL) return;
|
||||
@@ -141,7 +142,7 @@ fifo_read(im1024_t *dev)
|
||||
if (dev->fifo_rdptr >= dev->fifo_len)
|
||||
dev->fifo_rdptr = 0;
|
||||
|
||||
DBGLOG(1, "fifo_read: %02x\n", ret);
|
||||
DBGLOG(1, "IM1024: fifo_read: %02x\n", ret);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
@@ -162,17 +163,17 @@ input_byte(pgc_t *pgc, uint8_t *result)
|
||||
pgc_sleep(pgc);
|
||||
}
|
||||
|
||||
if (pgc->mapram[0x3ff]) { /* Reset triggered */
|
||||
if (pgc->mapram[0x3ff]) {
|
||||
/* Reset triggered. */
|
||||
pgc_reset(pgc);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (dev->fifo_wrptr == dev->fifo_rdptr) {
|
||||
*result = pgc->mapram[pgc->mapram[0x301]];
|
||||
++pgc->mapram[0x301];
|
||||
} else {
|
||||
pgc->mapram[0x301]++;
|
||||
} else
|
||||
*result = fifo_read(dev);
|
||||
}
|
||||
|
||||
return(1);
|
||||
}
|
||||
@@ -225,7 +226,7 @@ im1024_write(uint32_t addr, uint8_t val, void *priv)
|
||||
if (addr >= 0xC6000 && addr < 0xC6100 && dev->pgc.mapram[0x330] == 1) {
|
||||
fifo_write(dev, val);
|
||||
|
||||
DBGLOG(1, "im1024_write(%02x)\n", val);
|
||||
DBGLOG(1, "IM1024: write(%02x)\n", val);
|
||||
|
||||
if (dev->pgc.waiting_input_fifo) {
|
||||
dev->pgc.waiting_input_fifo = 0;
|
||||
@@ -254,7 +255,7 @@ hndl_imgsiz(pgc_t *pgc)
|
||||
if (! pgc_param_byte(pgc, &a)) return;
|
||||
if (! pgc_param_byte(pgc, &b)) return;
|
||||
|
||||
DEBUG("IMGSIZ %d,%d,%d,%d\n", w, h, a, b);
|
||||
DEBUG("IM1024: IMGSIZ %i,%i,%i,%i\n", w, h, a, b);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +271,30 @@ hndl_iprec(pgc_t *pgc)
|
||||
|
||||
if (! pgc_param_byte(pgc, ¶m)) return;
|
||||
|
||||
DEBUG("IPREC %d\n", param);
|
||||
DEBUG("IM1024: IPREC %i\n", param);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set drawing mode.
|
||||
*
|
||||
* 0 => Draw
|
||||
* 1 => Invert
|
||||
* 2 => XOR (IM-1024)
|
||||
* 3 => AND (IM-1024)
|
||||
*/
|
||||
static void
|
||||
hndl_linfun(pgc_t *pgc)
|
||||
{
|
||||
uint8_t param;
|
||||
|
||||
if (! pgc_param_byte(pgc, ¶m)) return;
|
||||
|
||||
if (param < 4) {
|
||||
pgc->draw_mode = param;
|
||||
DEBUG("IM1024: LINFUN(%i)\n", param);
|
||||
} else
|
||||
pgc_error(pgc, PGC_ERROR_RANGE);
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +308,7 @@ hndl_pan(pgc_t *pgc)
|
||||
if (! pgc_param_word(pgc, &x)) return;
|
||||
if (! pgc_param_word(pgc, &y)) return;
|
||||
|
||||
DEBUG("PAN %d,%d\n", x, y);
|
||||
DEBUG("IM1024: PAN %i,%i\n", x, y);
|
||||
|
||||
pgc->pan_x = x;
|
||||
pgc->pan_y = y;
|
||||
@@ -302,11 +326,11 @@ hndl_pline(pgc_t *pgc)
|
||||
|
||||
if (! pgc_param_byte(pgc, &count)) return;
|
||||
|
||||
DEBUG("PLINE<IM1024> (%d) ", count);
|
||||
DEBUG("IM1024: PLINE (%i) ", count);
|
||||
for (n = 0; n < count; n++) {
|
||||
if (! pgc_param_word(pgc, &x[n])) return;
|
||||
if (! pgc_param_word(pgc, &y[n])) return;
|
||||
DEBUG(" (%d,%d)\n", x[n], y[n]);
|
||||
DEBUG(" (%i,%i)\n", x[n], y[n]);
|
||||
}
|
||||
|
||||
for (n = 1; n < count; n++) {
|
||||
@@ -374,7 +398,7 @@ hndl_blkmov(pgc_t *pgc)
|
||||
if (! pgc_param_word(pgc, &x2)) return;
|
||||
if (! pgc_param_word(pgc, &y2)) return;
|
||||
|
||||
DEBUG("BLKMOV %d,%d,%d,%d,%d,%d\n", x0, y0, x1, y1, x2, y2);
|
||||
DEBUG("IM1024: BLKMOV %i,%i,%i,%i,%i,%i\n", x0, y0, x1, y1, x2, y2);
|
||||
|
||||
/* Disable clipping. */
|
||||
PUSHCLIP
|
||||
@@ -404,7 +428,8 @@ hndl_ellipse(pgc_t *pgc)
|
||||
if (! pgc_param_word(pgc, &x)) return;
|
||||
if (! pgc_param_word(pgc, &y)) return;
|
||||
|
||||
DEBUG("ELLIPSE<IM1024> %d,%d @ %d,%d\n", x, y, pgc->x >> 16, pgc->y >> 16);
|
||||
DEBUG("IM1024: ELLIPSE %i,%i @ %i,%i\n",
|
||||
x, y, pgc->x >> 16, pgc->y >> 16);
|
||||
|
||||
pgc_draw_ellipse(pgc, x << 16, y << 16);
|
||||
}
|
||||
@@ -423,7 +448,7 @@ hndl_move(pgc_t *pgc)
|
||||
pgc->x = x << 16;
|
||||
pgc->y = y << 16;
|
||||
|
||||
DEBUG("MOVE<IM1024> %d,%d\n", x, y);
|
||||
DEBUG("IM1024: MOVE %i,%i\n", x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +462,7 @@ hndl_draw(pgc_t *pgc)
|
||||
if (! pgc_param_word(pgc, &x)) return;
|
||||
if (! pgc_param_word(pgc, &y)) return;
|
||||
|
||||
DEBUG("DRAW<IM1024> %d,%d to %d,%d\n", pgc->x >> 16, pgc->y >> 16, x, y);
|
||||
DEBUG("IM1024: DRAW %i,%i to %i,%i\n", pgc->x >> 16, pgc->y >> 16, x, y);
|
||||
|
||||
pgc_draw_line(pgc, pgc->x, pgc->y, x << 16, y << 16, pgc->line_pattern);
|
||||
pgc->x = x << 16;
|
||||
@@ -461,7 +486,7 @@ hndl_poly(pgc_t *pgc)
|
||||
y = (int32_t *)mem_alloc(as * sizeof(int32_t));
|
||||
|
||||
if (!x || !y) {
|
||||
DEBUG("hndl_poly: malloc failed\n");
|
||||
DEBUG("IM1024: POLY: out of memory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +497,7 @@ hndl_poly(pgc_t *pgc)
|
||||
nx = (int32_t *)realloc(x, 2 * as * sizeof(int32_t));
|
||||
ny = (int32_t *)realloc(y, 2 * as * sizeof(int32_t));
|
||||
if (!x || !y) {
|
||||
DEBUG("hndl_poly: realloc failed\n");
|
||||
DEBUG("IM1024: poly: realloc failed\n");
|
||||
break;
|
||||
}
|
||||
x = nx;
|
||||
@@ -500,7 +525,7 @@ hndl_poly(pgc_t *pgc)
|
||||
parsing = 0;
|
||||
if (pgc->clcur && (pgc->clcur->rdptr+1) < pgc->clcur->wrptr &&
|
||||
pgc->clcur->list[pgc->clcur->rdptr] == 0x30) {
|
||||
DEBUG("hndl_poly: POLY continues!\n");
|
||||
DEBUG("IM1024: POLY continues!\n");
|
||||
parsing = 1;
|
||||
|
||||
/* Swallow the POLY. */
|
||||
@@ -508,7 +533,7 @@ hndl_poly(pgc_t *pgc)
|
||||
}
|
||||
};
|
||||
|
||||
DEBUG("POLY<IM1024> (%i) fill_mode=%d\n", realcount, pgc->fill_mode);
|
||||
DEBUG("IM1024: POLY (%i) fill_mode=%i\n", realcount, pgc->fill_mode);
|
||||
for (n = 0; n < realcount; n++) {
|
||||
DEBUG(" (%i,%i)\n", x[n] >> 16, y[n] >> 16);
|
||||
}
|
||||
@@ -532,17 +557,17 @@ parse_poly(pgc_t *pgc, pgc_cl_t *cl, int c)
|
||||
{
|
||||
uint8_t count;
|
||||
|
||||
DEBUG("parse_poly<IM1024>\n");
|
||||
DEBUG("IM1024: parse_poly\n");
|
||||
|
||||
if (! pgc_param_byte(pgc, &count)) return 0;
|
||||
|
||||
DEBUG("parse_poly<IM1024>: count=%02x\n", count);
|
||||
if (! pgc_commandlist_append(cl, count)) {
|
||||
DEBUG("IM1024: parse_poly: count=%02x\n", count);
|
||||
if (! pgc_cl_append(cl, count)) {
|
||||
pgc_error(pgc, PGC_ERROR_OVERFLOW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUG("parse_poly<IM1024>: parse %d words\n", 2 * count);
|
||||
DEBUG("IM1024: parse_poly: parse %i words\n", 2 * count);
|
||||
|
||||
return pgc_parse_words(pgc, cl, count * 2);
|
||||
}
|
||||
@@ -567,13 +592,13 @@ hndl_rect(pgc_t *pgc)
|
||||
|
||||
if (x0 > x1) { p = x0; x0 = x1; x1 = p; }
|
||||
if (y0 > y1) { q = y0; y0 = y1; y1 = q; }
|
||||
DEBUG("RECT<IM1024> (%d,%d) -> (%d,%d)\n", x0, y0, x1, y1);
|
||||
DEBUG("IM1024: RECT (%i,%i) -> (%i,%i)\n", x0, y0, x1, y1);
|
||||
|
||||
if (pgc->fill_mode) {
|
||||
for (p = y0; p <= y1; p++)
|
||||
pgc_fill_line_r(pgc, x0, x1, p);
|
||||
} else {
|
||||
/* Outline: 4 lines */
|
||||
/* Outline: 4 lines. */
|
||||
p = pgc->line_pattern;
|
||||
p = pgc_draw_line_r(pgc, x0, y0, x1, y0, p);
|
||||
p = pgc_draw_line_r(pgc, x1, y0, x1, y1, p);
|
||||
@@ -597,24 +622,13 @@ hndl_tdefin(pgc_t *pgc)
|
||||
if (! pgc_param_byte(pgc, &rows)) return;
|
||||
if (! pgc_param_byte(pgc, &cols)) return;
|
||||
|
||||
DEBUG("TDEFIN<IM1024> (%d,%d,%d) 0x%02x 0x%02x\n",
|
||||
DEBUG("IM1024: TDEFIN (%i,%i,%i) 0x%02x 0x%02x\n",
|
||||
ch, rows, cols, pgc->mapram[0x300], pgc->mapram[0x301]);
|
||||
|
||||
len = ((cols + 7) / 8) * rows;
|
||||
for (n = 0; n < len; n++) {
|
||||
// char buf[10];
|
||||
|
||||
if (! pgc_param_byte(pgc, &bt)) return;
|
||||
|
||||
// buf[0] = 0;
|
||||
// for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
// if (bt & mask) strcat(buf, "#");
|
||||
// else strcat(buf, "-");
|
||||
// ++x;
|
||||
// if (x == cols) { strcat(buf, "\n"); x = 0; }
|
||||
// }
|
||||
// DEBUG(buf);
|
||||
|
||||
if (n < sizeof(dev->font[ch]))
|
||||
dev->font[ch][n] = bt;
|
||||
}
|
||||
@@ -648,12 +662,13 @@ hndl_twrite(pgc_t *pgc)
|
||||
}
|
||||
|
||||
pgc_sto_raster(pgc, &x0, &y0);
|
||||
DEBUG("TWRITE<IM1024> (%d,%-*.*s) x0=%d y0=%d\n",
|
||||
|
||||
DEBUG("IM1024: TWRITE (%i,%-*.*s) x0=%i y0=%i\n",
|
||||
count, count, count, rbuf, x0, y0);
|
||||
|
||||
for (n = 0; n < count; n++) {
|
||||
wb = (dev->fontx[buf[n]] + 7) / 8;
|
||||
DEBUG("ch=0x%02x w=%d h=%d wb=%d\n",
|
||||
DEBUG("IM1024: ch=0x%02x w=%d h=%i wb=%i\n",
|
||||
buf[n], dev->fontx[buf[n]], dev->fonty[buf[n]], wb);
|
||||
|
||||
for (y = 0; y < dev->fonty[buf[n]]; y++) {
|
||||
@@ -671,7 +686,6 @@ hndl_twrite(pgc_t *pgc)
|
||||
}
|
||||
rbuf[x++] = '\n';
|
||||
rbuf[x++] = 0;
|
||||
// DEBUG(rbuf);
|
||||
}
|
||||
|
||||
x0 += dev->fontx[buf[n]];
|
||||
@@ -692,19 +706,20 @@ hndl_imagew(pgc_t *pgc)
|
||||
|
||||
/* IMAGEW already uses raster coordinates so there is no need to
|
||||
* convert it */
|
||||
DEBUG("IMAGEW<IM1024> (row=%d,col1=%d,col2=%d)\n", row1, col1, col2);
|
||||
DEBUG("IM1024: IMAGEW (row=%i,col1=%i,col2=%i)\n", row1, col1, col2);
|
||||
|
||||
vp_x1 = pgc->vp_x1;
|
||||
vp_y1 = pgc->vp_y1;
|
||||
vp_x2 = pgc->vp_x2;
|
||||
vp_y2 = pgc->vp_y2;
|
||||
/* Disable clipping */
|
||||
|
||||
/* Disable clipping. */
|
||||
pgc->vp_x1 = 0;
|
||||
pgc->vp_y1 = 0;
|
||||
pgc->vp_x2 = pgc->maxw - 1;
|
||||
pgc->vp_y2 = pgc->maxh - 1;
|
||||
|
||||
/* In ASCII mode, what is written is a stream of bytes */
|
||||
/* In ASCII mode, what is written is a stream of bytes. */
|
||||
if (pgc->ascii_mode) {
|
||||
while (col1 <= col2) {
|
||||
if (! pgc_param_byte(pgc, &v1))
|
||||
@@ -717,12 +732,12 @@ hndl_imagew(pgc_t *pgc)
|
||||
return;
|
||||
}
|
||||
|
||||
/* In hex mode, it's RLE compressed */
|
||||
/* In hex mode, it's RLE compressed. */
|
||||
while (col1 <= col2) {
|
||||
if (! pgc_param_byte(pgc, &v1)) return;
|
||||
|
||||
if (v1 & 0x80) {
|
||||
/* Literal run */
|
||||
/* Literal run. */
|
||||
v1 -= 0x7f;
|
||||
while (col1 <= col2 && v1 != 0) {
|
||||
if (! pgc_param_byte(pgc, &v2)) return;
|
||||
@@ -731,7 +746,7 @@ hndl_imagew(pgc_t *pgc)
|
||||
v1--;
|
||||
}
|
||||
} else {
|
||||
/* Repeated run */
|
||||
/* Repeated run. */
|
||||
if (! pgc_param_byte(pgc, &v2)) return;
|
||||
|
||||
v1++;
|
||||
@@ -743,7 +758,7 @@ hndl_imagew(pgc_t *pgc)
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore clipping */
|
||||
/* Restore clipping. */
|
||||
pgc->vp_x1 = vp_x1;
|
||||
pgc->vp_y1 = vp_y1;
|
||||
pgc->vp_x2 = vp_x2;
|
||||
@@ -763,7 +778,8 @@ hndl_dot(pgc_t *pgc)
|
||||
|
||||
pgc_sto_raster(pgc, &x, &y);
|
||||
|
||||
DEBUG("Dot @ %d,%d ink=%d mode=%d\n", x, y, pgc->colour, pgc->draw_mode);
|
||||
DEBUG("IM1024: DOT @ %i,%i ink=%i mode=%i\n",
|
||||
x, y, pgc->color, pgc->draw_mode);
|
||||
|
||||
pgc_plot(pgc, x, y);
|
||||
}
|
||||
@@ -785,7 +801,7 @@ hndl_imagex(pgc_t *pgc)
|
||||
if (! pgc_param_word(pgc, &y1)) return;
|
||||
|
||||
/* IMAGEX already uses raster coordinates so don't convert */
|
||||
DEBUG("IMAGEX<IM1024> (%d,%d,%d,%d)\n", x0,y0,x1,y1);
|
||||
DEBUG("IM1024: IMAGEX (%i,%i,%i,%i)\n", x0,y0,x1,y1);
|
||||
|
||||
for (p = y0; p <= y1; p++) {
|
||||
for (q = x0; q <= x1; q++) {
|
||||
@@ -820,6 +836,8 @@ static const pgc_cmd_t im1024_commands[] = {
|
||||
{ "IMGSIZ", 0x4e, hndl_imgsiz, NULL, 0 },
|
||||
{ "LUT8", 0xe6, pgc_hndl_lut8, NULL, 0 },
|
||||
{ "L8", 0xe6, pgc_hndl_lut8, NULL, 0 },
|
||||
{ "LINFUN", 0xeb, hndl_linfun, pgc_parse_bytes, 1 },
|
||||
{ "LF", 0xeb, hndl_linfun, pgc_parse_bytes, 1 },
|
||||
{ "LUT8RD", 0x53, pgc_hndl_lut8rd,NULL, 0 },
|
||||
{ "L8RD", 0x53, pgc_hndl_lut8rd,NULL, 0 },
|
||||
{ "PAN", 0xb7, hndl_pan, NULL, 0 },
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the PGC driver.
|
||||
*
|
||||
* Version: @(#)vid_pgc.h 1.0.1 2019/03/01
|
||||
* Version: @(#)vid_pgc.h 1.0.2 2019/03/02
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* John Elliott, <jce@seasip.info>
|
||||
@@ -78,17 +78,18 @@ typedef struct pgc {
|
||||
|
||||
pgc_cl_t *clist,
|
||||
*clcur;
|
||||
const pgc_cmd_t *commands;
|
||||
const pgc_cmd_t *master,
|
||||
*commands;
|
||||
|
||||
uint8_t mapram[2048]; /* Host <--> PGC communication buffer */
|
||||
uint8_t mapram[2048]; /* host <> PGC communication buffer */
|
||||
uint8_t *cga_vram;
|
||||
uint8_t *vram;
|
||||
char asc_command[7];
|
||||
uint8_t hex_command;
|
||||
uint32_t palette[256];
|
||||
uint32_t userpal[256];
|
||||
uint32_t maxw, maxh; /* Maximum framebuffer size */
|
||||
uint32_t visw, vish; /* Maximum screen size */
|
||||
uint32_t maxw, maxh; /* maximum framebuffer size */
|
||||
uint32_t visw, vish; /* maximum screen size */
|
||||
uint32_t screenw, screenh;
|
||||
int16_t pan_x, pan_y;
|
||||
uint16_t win_x1, win_x2, win_y1, win_y2;
|
||||
@@ -97,11 +98,11 @@ typedef struct pgc {
|
||||
int16_t line_pattern;
|
||||
uint8_t draw_mode;
|
||||
uint8_t fill_mode;
|
||||
uint8_t colour;
|
||||
uint8_t tjust_h; /* hor alignment 1=left 2=center 3=right*/
|
||||
uint8_t tjust_v; /* vert alignment 1=bottom 2=center 3=top*/
|
||||
uint8_t color;
|
||||
uint8_t tjust_h; /* hor alignment 1=left 2=ctr 3=right*/
|
||||
uint8_t tjust_v; /* vert alignment 1=bottom 2=ctr 3=top*/
|
||||
|
||||
int32_t x, y, z; /* drawing position */
|
||||
int32_t x, y, z; /* drawing position */
|
||||
|
||||
thread_t *pgc_thread;
|
||||
event_t *pgc_wake_thread;
|
||||
@@ -116,7 +117,8 @@ typedef struct pgc {
|
||||
int result_count;
|
||||
|
||||
int fontbase;
|
||||
int linepos, displine;
|
||||
int linepos,
|
||||
displine;
|
||||
int vc;
|
||||
int cgadispon;
|
||||
int con, coff, cursoron, cgablink;
|
||||
@@ -143,14 +145,14 @@ extern void pgc_poll(void *priv);
|
||||
extern void pgc_reset(pgc_t *);
|
||||
extern void pgc_wake(pgc_t *);
|
||||
extern void pgc_sleep(pgc_t *);
|
||||
extern void pgc_close(void *priv);
|
||||
extern void pgc_setdisplay(pgc_t *, int cga);
|
||||
extern void pgc_speed_changed(void *priv);
|
||||
extern void pgc_close(void *priv);
|
||||
extern void pgc_init(pgc_t *,
|
||||
int maxw, int maxh, int visw, int vish,
|
||||
int (*inpbyte)(pgc_t *, uint8_t *));
|
||||
|
||||
/* Misc support functions. */
|
||||
extern uint8_t *pgc_vram_addr(pgc_t *, int16_t x, int16_t y);
|
||||
extern void pgc_sto_raster(pgc_t *, int16_t *x, int16_t *y);
|
||||
extern void pgc_ito_raster(pgc_t *, int32_t *x, int32_t *y);
|
||||
extern void pgc_dto_raster(pgc_t *, double *x, double *y);
|
||||
@@ -162,20 +164,22 @@ extern int pgc_error_string(pgc_t *, const char *val);
|
||||
extern int pgc_error(pgc_t *, int err);
|
||||
|
||||
/* Graphics functions. */
|
||||
extern void pgc_plot(pgc_t *, uint16_t x, uint16_t y);
|
||||
extern uint8_t *pgc_vram_addr(pgc_t *, int16_t x, int16_t y);
|
||||
extern void pgc_write_pixel(pgc_t *, uint16_t x, uint16_t y, uint8_t ink);
|
||||
extern uint8_t pgc_read_pixel(pgc_t *, uint16_t x, uint16_t y);
|
||||
extern uint16_t pgc_draw_line(pgc_t *, int32_t x1, int32_t y1,
|
||||
int32_t x2, int32_t y2, uint16_t linemask);
|
||||
extern void pgc_plot(pgc_t *, uint16_t x, uint16_t y);
|
||||
extern uint16_t pgc_draw_line_r(pgc_t *, int32_t x1, int32_t y1,
|
||||
int32_t x2, int32_t y2, uint16_t linemask);
|
||||
extern void pgc_fill_line_r(pgc_t *, int32_t x0, int32_t x1, int32_t y);
|
||||
extern uint16_t pgc_draw_line(pgc_t *, int32_t x1, int32_t y1,
|
||||
int32_t x2, int32_t y2, uint16_t linemask);
|
||||
extern void pgc_draw_ellipse(pgc_t *, int32_t x, int32_t y);
|
||||
extern void pgc_fill_polygon(pgc_t *,
|
||||
unsigned corners, int32_t *x, int32_t *y);
|
||||
extern void pgc_fill_line_r(pgc_t *, int32_t x0, int32_t x1, int32_t y);
|
||||
|
||||
/* Command and parameter handling functions. */
|
||||
extern int pgc_commandlist_append(pgc_cl_t *, uint8_t v);
|
||||
extern int pgc_clist_byte(pgc_t *, uint8_t *val);
|
||||
extern int pgc_cl_append(pgc_cl_t *, uint8_t v);
|
||||
extern int pgc_parse_bytes(pgc_t *, pgc_cl_t *, int p);
|
||||
extern int pgc_parse_words(pgc_t *, pgc_cl_t *, int p);
|
||||
extern int pgc_parse_coords(pgc_t *, pgc_cl_t *, int p);
|
||||
@@ -186,6 +190,7 @@ extern int pgc_result_byte(pgc_t *, uint8_t val);
|
||||
extern int pgc_result_word(pgc_t *, int16_t val);
|
||||
extern int pgc_result_coord(pgc_t *, int32_t val);
|
||||
|
||||
/* Special overload functions for non-IBM implementations. */
|
||||
extern void pgc_hndl_lut8(pgc_t *);
|
||||
extern void pgc_hndl_lut8rd(pgc_t *);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* W = 3 bus clocks
|
||||
* L = 4 bus clocks
|
||||
*
|
||||
* Version: @(#)video.c 1.0.24 2019/02/11
|
||||
* Version: @(#)video.c 1.0.25 2019/03/02
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -912,31 +912,21 @@ video_load_font(const wchar_t *s, int format)
|
||||
switch (format) {
|
||||
case 0: /* MDA */
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdatm[c][d] = fgetc(fp);
|
||||
(void)fread(&fontdatm[c][0], 1, 8, fp);
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdatm[c][d + 8] = fgetc(fp);
|
||||
#if 0
|
||||
(void)fseek(f, 4096+2048, SEEK_SET);
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdat[c][d] = fgetc(fp);
|
||||
#endif
|
||||
(void)fread(&fontdatm[c][8], 1, 8, fp);
|
||||
break;
|
||||
|
||||
case 1: /* PC200 */
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdatm[c][d] = fgetc(fp);
|
||||
(void)fread(&fontdatm[c][0], 1, 8, fp);
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdatm[c][d + 8] = fgetc(fp);
|
||||
(void)fread(&fontdatm[c][8], 1, 8, fp);
|
||||
(void)fseek(fp, 4096, SEEK_SET);
|
||||
for (c = 0; c < 256; c++) {
|
||||
(void)fread(&fontdat[c][0], 1, 8, fp);
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdat[c][d] = fgetc(fp);
|
||||
for (d = 0; d < 8; d++) (void)fgetc(fp);
|
||||
(void)fgetc(fp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -947,20 +937,17 @@ video_load_font(const wchar_t *s, int format)
|
||||
(void)fseek(fp, 2048, SEEK_SET);
|
||||
}
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 8; d++)
|
||||
fontdat[c][d] = fgetc(fp);
|
||||
(void)fread(&fontdat[c][0], 1, 8, fp);
|
||||
break;
|
||||
|
||||
case 3: /* Wyse 700 */
|
||||
for (c = 0; c < 512; c++)
|
||||
for (d = 0; d < 32; d++)
|
||||
fontdatw[c][d] = fgetc(fp);
|
||||
(void)fread(&fontdatw[c][0], 1, 32, fp);
|
||||
break;
|
||||
|
||||
case 4: /* MDSI Genius */
|
||||
for (c = 0; c < 256; c++)
|
||||
for (d = 0; d < 16; d++)
|
||||
fontdat8x12[c][d] = fgetc(fp);
|
||||
(void)fread(&fontdat8x12[c][0], 1, 16, fp);
|
||||
break;
|
||||
|
||||
case 5: /* Toshiba 3100e */
|
||||
@@ -1007,6 +994,8 @@ video_load_font(const wchar_t *s, int format)
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG("VIDEO: font #%i loaded\n", format);
|
||||
|
||||
(void)fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* "extern" reference to its device into the video.h file,
|
||||
* and add an entry for it into the table here.
|
||||
*
|
||||
* Version: @(#)video_dev.c 1.0.31 2019/03/01
|
||||
* Version: @(#)video_dev.c 1.0.32 2019/03/02
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -68,6 +68,9 @@ static const struct {
|
||||
/* Standard video controllers. */
|
||||
{ "mda", &mda_device },
|
||||
{ "cga", &cga_device },
|
||||
#if defined(DEV_BRANCH)
|
||||
{ "pgc", &pgc_device },
|
||||
#endif
|
||||
{ "ega", &ega_device },
|
||||
{ "vga", &vga_device },
|
||||
{ "hercules", &hercules_device },
|
||||
@@ -102,10 +105,9 @@ static const struct {
|
||||
{ "hercules_plus", &herculesplus_device },
|
||||
{ "incolor", &incolor_device },
|
||||
{ "genius", &genius_device },
|
||||
#if 0
|
||||
{ "pgc", &pgc_device },
|
||||
#endif
|
||||
#if defined(DEV_BRANCH)
|
||||
{ "im1024", &im1024_device },
|
||||
#endif
|
||||
{ "oti037c", &oti037c_device },
|
||||
{ "oti067", &oti067_device },
|
||||
{ "oti077", &oti077_device },
|
||||
|
||||
Reference in New Issue
Block a user