#define false 0
#ifdef WINFONT
+static const TCHAR *epsonprintername;
static HFONT curFont;
static float curFontHorizPoints, curFontVertPoints;
static TCHAR *curFontName;
Bit16u remBytes;
Bit8u column[6];
Bit8u readBytesColumn;
+ int pin9;
} bitGraph;
static Bit8u densk, densl, densy, densz;
static Bit16u curMap[256], charTables[4];
int cindex = 0;
while (c) {
if (c & 1) {
- color_r |= (255 - colors[cindex * 3 + 0]) * pixel / 256;
- color_g |= (255 - colors[cindex * 3 + 1]) * pixel / 256;
- color_b |= (255 - colors[cindex * 3 + 2]) * pixel / 256;
+ color_r |= (255 - colors[cindex * 3 + 0]) * pixel / 255;
+ color_g |= (255 - colors[cindex * 3 + 1]) * pixel / 255;
+ color_b |= (255 - colors[cindex * 3 + 2]) * pixel / 255;
}
cindex++;
c >>= 1;
int Tpage_pitch = page_pitch;
uae_u8 *Tpage = page;
uae_u8 *Tcpage = cpage;
+ int TcolorPrinter = colorPrinted;
write_log (L"EPSONPRINTER: background print thread started\n");
prt_thread_mode = 1;
write_log (L"EPSONPRINTER: HP=%d WP=%d TM=%d LM=%d W=%d H=%d\n",
hz, vz, topmargin, leftmargin, Tpage_w, Tpage_h);
- if (colorPrinted)
+ if (TcolorPrinter)
dc = GetDC (NULL);
- HBITMAP bitmap = CreateCompatibleBitmap (dc, Tpage_w, Tpage_h);
+ HBITMAP bitmap = CreateCompatibleBitmap (dc ? dc : TmemHDC, Tpage_w, Tpage_h);
SelectObject (TmemHDC, bitmap);
BitBlt (TmemHDC, 0, 0, Tpage_w, Tpage_h, NULL, 0, 0, WHITENESS);
// Allocate an array of scanline pointers
row_pointers = (png_bytep*)malloc(Tpage_h*sizeof(png_bytep));
- if (colorPrinted) {
+ if (TcolorPrinter) {
png_set_IHDR(png_ptr, info_ptr, Tpage_w, Tpage_h,
8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
if (page == NULL) {
page = xcalloc (uae_u8, pagesize);
cpage = xcalloc (uae_u8, pagesize);
+ printerDC = CreateDC (NULL, epsonprintername, NULL, NULL);
+ memHDC = CreateCompatibleDC (NULL);
}
curY = topMargin;
memset (page, 0, pagesize);
PrintDlg(&pd);
printerDC = pd.hDC;
#endif
- printerDC = CreateDC (NULL, printername, NULL, NULL);
+ epsonprintername = printername;
+ printerDC = CreateDC (NULL, epsonprintername, NULL, NULL);
if (!printerDC)
return 0;
};
-static void setupBitImage(Bit8u dens, Bit16u numCols)
+static void setupBitImage(Bit8u dens, Bit16u numCols, int pin9)
{
switch (dens)
{
default:
write_log(L"EPSONPRINTER: Unsupported bit image density %i\n", dens);
}
- if (pins == 9)
+ bitGraph.pin9 = false;
+ if (pins == 9) {
+ if (pin9) {
+ bitGraph.pin9 = true;
+ bitGraph.bytesColumn = 2;
+ }
bitGraph.vertDens = 72;
+ }
bitGraph.remBytes = numCols * bitGraph.bytesColumn;
bitGraph.readBytesColumn = 0;
}
case 0x0f: // Select condensed printing (ESC SI)
case 0x23: // Cancel MSB control (ESC #)
case 0x30: // Select 1/8-inch line spacing (ESC 0)
+ case 0x31: // Select 7/72-inch line spacing (ESC 1)
case 0x32: // Select 1/6-inch line spacing (ESC 2)
case 0x34: // Select italic font (ESC 4)
case 0x35: // Cancel italic font (ESC 5)
case 0x4c: // Select 120-dpi graphics (ESC L)
case 0x59: // Select 120-dpi, double-speed graphics (ESC Y)
case 0x5a: // Select 240-dpi graphics (ESC Z)
+ case 0x5e: // Select 60/120-dpi, 9-pin graphics
case 0x5c: // Set relative horizontal print position (ESC \)
case 0x63: // Set horizontal motion index (HMI) (ESC c)
neededParam = 2;
}
break;
case 0x2a: // Select bit image (ESC *)
- setupBitImage(params[0], PARAM16(1));
+ setupBitImage(params[0], PARAM16(1), false);
break;
case 0x2b: // Set n/360-inch line spacing (ESC +)
lineSpacing = (Real64)params[0]/360;
case 0x30: // Select 1/8-inch line spacing (ESC 0)
lineSpacing = (Real64)1/8;
break;
+ case 0x31: // Select 7/72-inch line spacing (ESC 1) 9-pin ONLY
+ lineSpacing = (Real64)7/72;
+ break;
case 0x32: // Select 1/6-inch line spacing (ESC 2)
lineSpacing = (Real64)1/6;
break;
style &= 0xFFFF - STYLE_DOUBLESTRIKE;
break;
case 0x4a: // Advance print position vertically (ESC J n)
- curY += (Real64)((Real64)params[0] / 180);
+ curY += (Real64)((Real64)params[0] / (pins == 9 ? 216 : 180));
if (curY > bottomMargin)
newPage(true);
break;
case 0x4b: // Select 60-dpi graphics (ESC K)
- setupBitImage(densk, PARAM16(0));
+ setupBitImage(densk, PARAM16(0), false);
break;
case 0x4c: // Select 120-dpi graphics (ESC L)
- setupBitImage(densl, PARAM16(0));
+ setupBitImage(densl, PARAM16(0), false);
break;
case 0x4d: // Select 10.5-point, 12-cpi (ESC M)
cpi = 12;
updateFont();
break;
case 0x59: // Select 120-dpi, double-speed graphics (ESC Y)
- setupBitImage(densy, PARAM16(0));
+ setupBitImage(densy, PARAM16(0), false);
break;
case 0x5a: // Select 240-dpi graphics (ESC Z)
- setupBitImage(densz, PARAM16(0));
+ setupBitImage(densz, PARAM16(0), false);
+ break;
+ case 0x5e: // Select 60/120-dpi, 9-pin graphics
+ setupBitImage(densy, PARAM16(0), true);
break;
case 0x5c: // Set relative horizontal print position (ESC \)
{
updateFont();
break;
case 0x242: // Bar code setup and print (ESC (B)
- write_log(L"EPSONPRINTER: Bardcode printing not supported\n");
+ write_log(L"EPSONPRINTER: Barcode printing not supported\n");
// Find out how many bytes to skip
neededParam = PARAM16(0);
numParam = 0;
for (j=7; j>=0; j--)
{
Bit8u pixel = (bitGraph.column[i] >> j) & 0x01;
+ if (bitGraph.pin9 && i == 1 && j == 7)
+ pixel = bitGraph.column[i] & 0x01;
if (pixel != 0)
{
for (yy=0; yy<pixsizeY; yy++)
if (((PIXX + xx) < page_w) && ((PIXY + yy) < page_h)) {
*((Bit8u*)page + PIXX + xx + (PIXY+yy)*page_pitch) = 255;
- *((Bit8u*)cpage + PIXX + xx + (PIXY+yy)*page_pitch) |= 1 < printColor;
+ (*((Bit8u*)cpage + PIXX + xx + (PIXY+yy)*page_pitch)) |= 1 << printColor;
}
}
}
curY += (Real64)1/(Real64)bitGraph.vertDens;
+
+ if (bitGraph.pin9 && i == 1 && j == 7)
+ break;
}
}
else
curX += (Real64)1/(Real64)bitGraph.horizDens;
+ if (printColor)
+ colorPrinted = true;
}
static void blitGlyph(uae_u8 *gbitmap, int width, int rows, int pitch, int destx, int desty, int add)
if (mode < 0)
pfos |= FOS_PICKFOLDERS;
pfd->SetOptions (pfos);
+ opn->nFileOffset = 0;
if (guid)
pfd->SetClientGuid (*guid);
DWORD cnt;
hr = pitema->GetCount (&cnt);
if (SUCCEEDED (hr)) {
- int i;
+ int i, first = true;
for (i = 0; i < cnt; i++) {
IShellItem *pitem;
hr = pitema->GetItemAt (i, &pitem);
WCHAR *path = NULL;
hr = pitem->GetDisplayName (SIGDN_FILESYSPATH, &path);
if (SUCCEEDED (hr)) {
+ TCHAR *ppath = path;
TCHAR *p = opn->lpstrFile;
while (*p)
p += _tcslen (p) + 1;
- if (p - opn->lpstrFile + _tcslen (path) + 2 < opn->nMaxFile) {
- _tcscpy (p, path);
+ TCHAR *pathfilename = _tcsrchr (ppath, '\\');
+ if (pathfilename)
+ pathfilename++;
+ if (first && cnt > 1) {
+ opn->nFileOffset = pathfilename - ppath;
+ _tcscpy (p, ppath);
+ p[opn->nFileOffset - 1] = 0;
+ p += _tcslen (p) + 1;
+ *p = 0;
+ ppath = pathfilename;
+ } else if (cnt > 1) {
+ ppath = pathfilename;
+ } else {
+ ppath = path;
+ }
+ if (!ppath)
+ ppath = path;
+ if (p - opn->lpstrFile + _tcslen (ppath) + 2 < opn->nMaxFile) {
+ _tcscpy (p, ppath);
p[_tcslen (p) + 1] = 0;
}
if (opn->lpstrFileTitle && !opn->lpstrFileTitle[0]) {
if (p && opn->lpstrFileTitle)
_tcscpy (opn->lpstrFileTitle, p);
}
+ first = false;
}
CoTaskMemFree (path);
}
TCHAR init_path[MAX_DPATH] = L"";
BOOL result = FALSE;
TCHAR *amiga_path = NULL, *initialdir = NULL, *defext = NULL;
- TCHAR description[CFG_DESCRIPTION_LENGTH] = L"";
TCHAR *p, *nextp;
int all = 1;
int next;
{
case 0:
case 1:
- getfilter(flag, L"FloppyPath", previousfilter, filtername);
+ getfilter (flag, L"FloppyPath", previousfilter, filtername);
fetch_path (L"FloppyPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[0];
break;
case 2:
case 3:
- getfilter(flag, L"hdfPath", previousfilter, filtername);
+ getfilter (flag, L"hdfPath", previousfilter, filtername);
fetch_path (L"hdfPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[1];
break;
case 6:
case 7:
case 11:
- getfilter(flag, L"KickstartPath", previousfilter, filtername);
+ getfilter (flag, L"KickstartPath", previousfilter, filtername);
fetch_path (L"KickstartPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[2];
break;
case 4:
case 5:
case 8:
- getfilter(flag, L"ConfigurationPath", previousfilter, filtername);
+ getfilter (flag, L"ConfigurationPath", previousfilter, filtername);
fetch_path (L"ConfigurationPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[3];
break;
break;
case 15:
case 16:
- getfilter(flag, L"InputPath", previousfilter, filtername);
+ getfilter (flag, L"InputPath", previousfilter, filtername);
fetch_path (L"InputPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[5];
break;
case 17:
- getfilter(flag, L"CDPath", previousfilter, filtername);
+ getfilter (flag, L"CDPath", previousfilter, filtername);
fetch_path (L"CDPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[6];
break;
setfilter (flag, previousfilter, filtername);
}
- memcpy (full_path2, full_path, sizeof (full_path) / sizeof (TCHAR));
- memcpy (stored_path, full_path, sizeof (stored_path) / sizeof (TCHAR));
+ memcpy (full_path2, full_path, sizeof full_path);
+ memcpy (stored_path, full_path, sizeof stored_path);
next = 0;
nextp = full_path2 + openFileName.nFileOffset;
if (path_out) {
clicked_entry = 0;
pages[HARDDISK_ID] = hDlg;
currentpage = HARDDISK_ID;
+ Button_SetElevationRequiredState (GetDlgItem (hDlg, IDC_NEW_HD), TRUE);
EnableWindow (GetDlgItem (hDlg, IDC_NEW_HD), os_winnt_admin > 1 ? TRUE : FALSE);
case WM_USER:
}
SetDlgItemInt (hDlg, IDC_PRINTERAUTOFLUSH, workprefs.parallel_autoflush_time, FALSE);
idx = workprefs.parallel_matrix_emulation;
+ if (idx >= PARALLEL_MATRIX_EPSON24)
+ idx = PARALLEL_MATRIX_EPSON24;
if (workprefs.parallel_postscript_detection)
idx = 4;
if (workprefs.parallel_postscript_emulation)