More cleanups.

Changes to make the FDC work with single-sided drives.
Changes to show user 160/180 and 320/360K drives are the same.
More changes that deal with VNC (new VNC lib in progress)
Fixed bugs in New Image code.
Fixed screenshots not working.
This commit is contained in:
waltje
2018-05-14 17:51:07 -04:00
parent cfda8ef931
commit d136e28136
26 changed files with 278 additions and 4551 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk
* controller.
*
* Version: @(#)fdc.c 1.0.12 2018/05/08
* Version: @(#)fdc.c 1.0.13 2018/05/14
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -425,7 +425,7 @@ fdc_get_rwc(fdc_t *fdc, int drive)
void
fdc_update_rwc(fdc_t *fdc, int drive, int rwc)
{
fdc_log("FDD %c: New RWC is %i\n", 0x41 + drive, rwc);
fdc_log("FDC: %c: new RWC is %i\n", 0x41 + drive, rwc);
fdc->rwc[drive] = rwc;
fdc_rate(fdc, drive);
}
@@ -448,7 +448,7 @@ fdc_update_boot_drive(fdc_t *fdc, int boot_drive)
void
fdc_update_densel_polarity(fdc_t *fdc, int densel_polarity)
{
fdc_log("FDC: New DENSEL polarity is %i\n", densel_polarity);
fdc_log("FDC: new DENSEL polarity is %i\n", densel_polarity);
fdc->densel_polarity = densel_polarity;
fdc_update_rates(fdc);
}
@@ -464,7 +464,7 @@ fdc_get_densel_polarity(fdc_t *fdc)
void
fdc_update_densel_force(fdc_t *fdc, int densel_force)
{
fdc_log("FDC: New DENSEL force is %i\n", densel_force);
fdc_log("FDC: new DENSEL force is %i\n", densel_force);
fdc->densel_force = densel_force;
fdc_update_rates(fdc);
}
@@ -473,7 +473,7 @@ fdc_update_densel_force(fdc_t *fdc, int densel_force)
void
fdc_update_drvrate(fdc_t *fdc, int drive, int drvrate)
{
fdc_log("FDD %c: New drive rate is %i\n", 0x41 + drive, drvrate);
fdc_log("FDD %c: new drive rate is %i\n", 0x41 + drive, drvrate);
fdc->drvrate[drive] = drvrate;
fdc_rate(fdc, drive);
}
@@ -622,7 +622,7 @@ fdc_rate(fdc_t *fdc, int drive)
fdd_set_rate(drive, fdc->drvrate[drive], fdc->rate);
fdc_log("FDD %c: Setting rate: %i, %i, %i (%i, %i)\n",
fdc_log("FDD %c: setting rate: %i, %i, %i (%i, %i)\n",
0x41 + drive, fdc->drvrate[drive], fdc->rate,
fdc_get_densel(fdc, drive),
fdc->rwc[drive], fdc->densel_force);
@@ -646,7 +646,7 @@ fdc_seek(fdc_t *fdc, int drive, int params)
{
fdd_seek(real_drive(fdc, drive), params);
fdc->time = 5000 * (1LL << TIMER_SHIFT);
fdc->time = 5000LL * (1 << TIMER_SHIFT);
fdc->stat |= (1 << fdc->drive);
}
@@ -731,7 +731,7 @@ fdc_sis(fdc_t *fdc)
fdc->res[10] = fdc->pcn[fdc->res[9] & 3];
fdc_log("Sense interrupt status: 2 parameters to go\n");
fdc_log("FDC: sense interrupt status: 2 parameters to go\n");
fdc->paramstogo = 2;
}
@@ -743,7 +743,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
int drive, i, drive_num;
fdc_log("Write FDC %04X %02X\n", addr, val);
fdc_log("FDC: write %04X %02X\n", addr, val);
cycles -= ISA_CYCLES(8);
@@ -862,7 +862,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
fdc->command = val;
fdc->stat |= 0x10;
fdc_log("Starting FDC command %02X\n",fdc->command);
fdc_log("FDC: starting command %02X\n",fdc->command);
switch (fdc->command & 0x1f) {
case 0x01: /*Mode*/
@@ -937,7 +937,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
break;
case 0x08: /*Sense interrupt status*/
fdc_log("fdc->fintr = %i, fdc->reset_stat = %i\n", fdc->fintr, fdc->reset_stat);
fdc_log("FDC: fintr = %i, fdc->reset_stat = %i\n", fdc->fintr, fdc->reset_stat);
fdc->lastdrive = fdc->drive;
fdc->pos = 0;
fdc_sis(fdc);
@@ -1024,7 +1024,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
}
}
if (fdc->pnum == fdc->ptot) {
fdc_log("Got all params %02X\n", fdc->command);
fdc_log("FDC: got all params %02X\n", fdc->command);
fdc->interrupt = fdc->command & 0x1F;
timer_clock();
fdc->time = 1024LL * (1LL << TIMER_SHIFT);
@@ -1037,6 +1037,10 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
fdc->read_track_sector.id.h = fdc->params[2];
fdc->read_track_sector.id.r = 1;
fdc->read_track_sector.id.n = fdc->params[4];
if ((fdc->head & 0x01) && !fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_noidam(fdc);
return;
}
fdd_readsector(real_drive(fdc, fdc->drive), SECTOR_FIRST, fdc->params[1], fdc->head, fdc->rate, fdc->params[4]);
break;
@@ -1066,6 +1070,10 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
case 5: /*Write data*/
case 9: /*Write deleted data*/
fdc_io_command_phase1(fdc, 1);
if ((fdc->head & 0x01) && !fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_noidam(fdc);
return;
}
fdd_writesector(real_drive(fdc, fdc->drive), fdc->sector, fdc->params[1], fdc->head, fdc->rate, fdc->params[4]);
break;
@@ -1073,6 +1081,10 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
case 0x19: /*Scan low or equal*/
case 0x1D: /*Scan high or equal*/
fdc_io_command_phase1(fdc, 1);
if ((fdc->head & 0x01) && !fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_noidam(fdc);
return;
}
fdd_comparesector(real_drive(fdc, fdc->drive), fdc->sector, fdc->params[1], fdc->head, fdc->rate, fdc->params[4]);
break;
@@ -1082,10 +1094,14 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
case 6: /*Read data*/
case 0xC: /*Read deleted data*/
fdc_io_command_phase1(fdc, 0);
fdc_log("Reading sector (drive %i) (%i) (%i %i %i %i) (%i %i %i)\n", fdc->drive, fdc->params[0], fdc->params[1], fdc->params[2], fdc->params[3], fdc->params[4], fdc->params[5], fdc->params[6], fdc->params[7]);
if ((fdc->head & 0x01) && !fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_noidam(fdc);
return;
}
fdc_log("FDC: reading sector (drive %i) (%i) (%i %i %i %i) (%i %i %i)\n", fdc->drive, fdc->params[0], fdc->params[1], fdc->params[2], fdc->params[3], fdc->params[4], fdc->params[5], fdc->params[6], fdc->params[7]);
if (((dma_mode(2) & 0x0C) == 0x00) && !(fdc->flags & FDC_FLAG_PCJR) && fdc->dma) {
/* DMA is in verify mode, treat this like a VERIFY command. */
fdc_log("Verify-mode read!\n");
fdc_log("FDC: verify-mode read!\n");
fdc->tc = 1;
fdc->deleted |= 2;
}
@@ -1101,7 +1117,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
drive_num = real_drive(fdc, fdc->drive);
/* Three conditions under which the command should fail. */
if (!fdd_get_flags(drive_num) || (drive_num >= FDD_NUM) || !motoron[drive_num] || fdd_track0(drive_num)) {
fdc_log("Failed recalibrate\n");
fdc_log("FDC: failed recalibrate\n");
if (!fdd_get_flags(drive_num) || (drive_num >= FDD_NUM) || !motoron[drive_num])
fdc->st0 = 0x70 | (fdc->params[0] & 3);
else
@@ -1115,8 +1131,8 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
}
if ((real_drive(fdc, fdc->drive) != 1) || fdc->drv2en)
fdc_seek(fdc, fdc->drive, -fdc->max_track);
fdc_log("Recalibrating...\n");
fdc->time = 5000LL;
fdc_log("FDC: recalibrating...\n");
fdc->time = 5000LL * (1 << TIMER_SHIFT);
break;
case 0x0d: /*Format*/
@@ -1169,7 +1185,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
fdc_seek(fdc, fdc->drive, -fdc->params[1]);
fdc->pcn[fdc->params[0] & 3] -= fdc->params[1];
}
fdc->time = 5000LL;
fdc->time = 5000LL * (1 << TIMER_SHIFT);
} else {
fdc->st0 = 0x20 | (fdc->params[0] & 7);
fdc->interrupt = -3;
@@ -1179,9 +1195,9 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
break;
}
} else {
fdc_log("Seeking to track %i (PCN = %i)...\n", fdc->params[1], fdc->pcn[fdc->params[0] & 3]);
fdc_log("FDC: seeking to track %i (PCN = %i)...\n", fdc->params[1], fdc->pcn[fdc->params[0] & 3]);
if ((fdc->params[1] - fdc->pcn[fdc->params[0] & 3]) == 0) {
fdc_log("Failed seek\n");
fdc_log("FDC: failed seek\n");
fdc->st0 = 0x20 | (fdc->params[0] & 7);
fdc->interrupt = -3;
timer_clock();
@@ -1191,8 +1207,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
}
fdc_seek(fdc, fdc->drive, fdc->params[1] - fdc->pcn[fdc->params[0] & 3]);
fdc->pcn[fdc->params[0] & 3] = fdc->params[1];
fdc->time = 5000LL;
fdc_log("fdc->time = %i\n", fdc->time);
fdc->time = 5000LL * (1 << TIMER_SHIFT);
}
break;
@@ -1307,7 +1322,7 @@ fdc_read(uint16_t addr, void *priv)
}
fdc->stat &= ~0x80;
if (fdc->paramstogo) {
fdc_log("%i parameters to go\n", fdc->paramstogo);
fdc_log("FDC: %i parameters to go\n", fdc->paramstogo);
fdc->paramstogo--;
ret = fdc->res[10 - fdc->paramstogo];
if (!fdc->paramstogo)
@@ -1338,7 +1353,7 @@ fdc_read(uint16_t addr, void *priv)
default:
break;
}
fdc_log("Read FDC %04X %02X\n", addr, ret);
fdc_log("FDC: read %04X %02X\n", addr, ret);
return(ret);
}
@@ -1386,7 +1401,7 @@ fdc_poll_common_finish(fdc_t *fdc, int compare, int st5)
fdc->res[8]=fdc->head;
fdc->res[9]=fdc->sector;
fdc->res[10]=fdc->params[4];
fdc_log("Read/write finish (%02X %02X %02X %02X %02X %02X %02X)\n" , fdc->res[4], fdc->res[5], fdc->res[6], fdc->res[7], fdc->res[8], fdc->res[9], fdc->res[10]);
fdc_log("FDC: read/write finish (%02X %02X %02X %02X %02X %02X %02X)\n" , fdc->res[4], fdc->res[5], fdc->res[6], fdc->res[7], fdc->res[8], fdc->res[9], fdc->res[10]);
ui_sb_icon_update(SB_FLOPPY | fdc->drive, 0);
fdc->paramstogo = 7;
}
@@ -1420,7 +1435,7 @@ fdc_callback(void *priv)
int old_sector = 0;
fdc->time = 0LL;
fdc_log("fdc_callback(): %i\n", fdc->interrupt);
fdc_log("FDC: callback(%i)\n", fdc->interrupt);
switch (fdc->interrupt) {
case -3: /*End of command with interrupt*/
fdc_int(fdc);
@@ -1461,7 +1476,9 @@ fdc_callback(void *priv)
return;
case 4: /*Sense drive status*/
fdc->res[10] = (fdc->params[0] & 7) | 0x28;
fdc->res[10] = (fdc->params[0] & 7) | 0x20;
if (fdd_is_double_sided(real_drive(fdc, fdc->drive)))
fdc->res[10] |= 0x08;
if ((real_drive(fdc, fdc->drive) != 1) || fdc->drv2en) {
if (fdd_track0(real_drive(fdc, fdc->drive)))
fdc->res[10] |= 0x10;
@@ -1554,10 +1571,14 @@ fdc_callback(void *priv)
fdc_poll_readwrite_finish(fdc, compare);
return;
}
if ((fdc->command & 0x80) && (fdd_get_head(real_drive(fdc, fdc->drive)) == 0)) {
if ((fdd_get_head(real_drive(fdc, fdc->drive)) == 0)) {
fdc->sector = 1;
fdc->head |= 1;
fdd_set_head(real_drive(fdc, fdc->drive), 1);
if (!fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_noidam(fdc);
return;
}
}
} else if (fdc->sector < fdc->params[5])
fdc->sector++;
@@ -1710,10 +1731,14 @@ fdc_error(fdc_t *fdc, int st5, int st6)
fdc->fintr = 0;
fdc->stat = 0xD0;
fdc->st0 = fdc->res[4] = 0x40 | (fdd_get_head(real_drive(fdc, fdc->drive)) ? 4 : 0) | fdc->rw_drive;
if (fdc->head && !fdd_is_double_sided(real_drive(fdc, fdc->drive))) {
fdc_log("FDC: head 1 on 1-sided drive\n");
fdc->st0 |= 0x08;
}
fdc->res[5] = st5;
fdc->res[6] = st6;
fdc_log("FDC Error: %02X %02X %02X\n", fdc->res[4], fdc->res[5], fdc->res[6]);
fdc_log("FDC: ERROR: %02X %02X %02X\n", fdc->res[4], fdc->res[5], fdc->res[6]);
switch(fdc->interrupt) {
case 0x02:
case 0x05:
@@ -2171,7 +2196,7 @@ fdc_init(const device_t *info)
else
fdc->dma_ch = 2;
fdc_log("FDC added: %04X (flags: %08X)\n", fdc->base_address, fdc->flags);
fdc_log("FDC: %04X (flags: %08X)\n", fdc->base_address, fdc->flags);
timer_add(fdc_callback, &fdc->time, &fdc->time, fdc);

View File

@@ -8,9 +8,7 @@
*
* Implementation of the floppy drive emulation.
*
* TODO: Implement the ENABLE_FDD_LOG stuff.
*
* Version: @(#)fdd.c 1.0.12 2018/05/06
* Version: @(#)fdd.c 1.0.13 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -41,7 +39,9 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include "../../emu.h"
#include "../../machines/machine.h"
#include "../../mem.h"
@@ -177,13 +177,13 @@ static const struct
0, 0, "None", "none"
},
{ /*5.25" 1DD*/
43, FLAG_RPM_300 | FLAG_525 | FLAG_HOLE0, "5.25\" 180k", "525_1dd"
43, FLAG_RPM_300 | FLAG_525 | FLAG_HOLE0, "5.25\" 160/180K", "525_1dd"
},
{ /*5.25" DD*/
43, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0, "5.25\" 360k", "525_2dd"
43, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0, "5.25\" 320/360K", "525_2dd"
},
{ /*5.25" QD*/
86, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "5.25\" 720k", "525_2qd"
86, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "5.25\" 720K", "525_2qd"
},
{ /*5.25" HD PS/2*/
86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "5.25\" 1.2M PS/2", "525_2hd_ps2"
@@ -195,10 +195,10 @@ static const struct
86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M 300/360 RPM", "525_2hd_dualrpm"
},
{ /*3.5" 1DD*/
86, FLAG_RPM_300 | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 360k", "35_1dd"
86, FLAG_RPM_300 | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 360K", "35_1dd"
},
{ /*3.5" DD*/
86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 720k", "35_2dd"
86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 720K", "35_2dd"
},
{ /*3.5" HD PS/2*/
86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "3.5\" 1.44M PS/2", "35_2hd_ps2"
@@ -221,6 +221,22 @@ static const struct
};
void
fdd_log(const char *fmt, ...)
{
#ifdef ENABLE_FDC_LOG
va_list ap;
if (fdd_do_log)
{
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
const char *fdd_getname(int type)
{
return drive_types[type].name;
@@ -354,7 +370,7 @@ int fdd_can_read_medium(int drive)
{
int hole = fdd_hole(drive);
hole = 1 << (hole + 3);
hole = 1 << (hole + 4);
return (drive_types[fdd[drive].type].flags & hole) ? 1 : 0;
}
@@ -406,11 +422,16 @@ int fdd_is_double_sided(int drive)
void fdd_set_head(int drive, int head)
{
fdd[drive].head = head;
if (head && !fdd_is_double_sided(drive))
fdd[drive].head = 0;
else
fdd[drive].head = head;
}
int fdd_get_head(int drive)
{
if (!fdd_is_double_sided(drive))
return 0;
return fdd[drive].head;
}
@@ -453,7 +474,9 @@ int fdd_load(int drive, const wchar_t *fn)
wchar_t *p;
FILE *f;
pclog("FDD: loading drive %d with '%ls'\n", drive, fn);
#ifdef ENABLE_FDD_LOG
fdd_log("FDD: loading drive %d with '%ls'\n", drive, fn);
#endif
if (!fn) return(0);
p = plat_get_extension(fn);
@@ -482,7 +505,9 @@ int fdd_load(int drive, const wchar_t *fn)
c++;
}
no_load:
pclog("FDD: could not load '%ls' %s\n",fn,p);
#ifdef ENABLE_FDD_LOG
fdd_log("FDD: could not load '%ls' %s\n",fn,p);
#endif
drive_empty[drive] = 1;
fdd_set_head(drive, 0);
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
@@ -493,7 +518,9 @@ no_load:
void fdd_close(int drive)
{
pclog("FDD: closing drive %d\n", drive);
#ifdef ENABLE_FDD_LOG
fdd_log("FDD: closing drive %d\n", drive);
#endif
if (loaders[driveloaders[drive]].close)
loaders[driveloaders[drive]].close(drive);

View File

@@ -8,7 +8,7 @@
*
* Definitions for the floppy drive emulation.
*
* Version: @(#)fdd.h 1.0.5 2018/04/10
* Version: @(#)fdd.h 1.0.6 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -78,6 +78,7 @@ extern int64_t floppytime;
extern int fdd_swap;
extern void fdd_log(const char *fmt, ...);
extern void fdd_do_seek(int drive, int track);
extern void fdd_forced_seek(int drive, int track_diff);
extern void fdd_seek(int drive, int track_diff);

View File

@@ -9,7 +9,7 @@
* Implementation of the FDI floppy stream image format
* interface to the FDI2RAW module.
*
* Version: @(#)fdd_fdi.c 1.0.4 2018/05/06
* Version: @(#)fdd_fdi.c 1.0.5 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -319,8 +319,6 @@ fdi_load(int drive, const wchar_t *fn)
char header[26];
fdi_t *dev;
writeprot[drive] = fwriteprot[drive] = 1;
/* Allocate a drive block. */
dev = (fdi_t *)malloc(sizeof(fdi_t));
memset(dev, 0x00, sizeof(fdi_t));
@@ -331,6 +329,8 @@ fdi_load(int drive, const wchar_t *fn)
return(0);
}
writeprot[drive] = fwriteprot[drive] = 1;
d86f_unregister(drive);
fread(header, 1, 25, dev->f);
@@ -338,7 +338,7 @@ fdi_load(int drive, const wchar_t *fn)
header[25] = 0;
if (strcmp(header, "Formatted Disk Image file") != 0) {
/* This is a Japanese FDI file. */
pclog("fdi_load(): Japanese FDI file detected, redirecting to IMG loader\n");
fdd_log("FDI: Japanese FDI file detected, redirecting to IMG loader\n");
fclose(dev->f);
free(dev);
return(img_load(drive, fn));
@@ -370,8 +370,6 @@ fdi_load(int drive, const wchar_t *fn)
drives[drive].seek = fdi_seek;
pclog("Loaded as FDI\n");
return(1);
}

View File

@@ -8,7 +8,7 @@
*
* Implementation of the IMD floppy image format.
*
* Version: @(#)fdd_imd.c 1.0.8 2018/05/06
* Version: @(#)fdd_imd.c 1.0.9 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -594,8 +594,6 @@ imd_load(int drive, const wchar_t *fn)
d86f_unregister(drive);
writeprot[drive] = 0;
/* Allocate a drive block. */
dev = (imd_t *)malloc(sizeof(imd_t));
memset(dev, 0x00, sizeof(imd_t));
@@ -607,7 +605,8 @@ imd_load(int drive, const wchar_t *fn)
return(0);
}
writeprot[drive] = 1;
}
} else
writeprot[drive] = 0;
if (ui_writeprot[drive])
writeprot[drive] = 1;
@@ -616,12 +615,12 @@ imd_load(int drive, const wchar_t *fn)
fseek(dev->f, 0, SEEK_SET);
fread(&magic, 1, 4, dev->f);
if (magic != 0x20444D49) {
pclog("IMD: Not a valid ImageDisk image\n");
fdd_log("IMD: not a valid ImageDisk image\n");
fclose(dev->f);
free(dev);;
return(0);
} else {
pclog("IMD: Valid ImageDisk image\n");
fdd_log("IMD: valid ImageDisk image\n");
}
fseek(dev->f, 0, SEEK_END);
@@ -633,22 +632,20 @@ imd_load(int drive, const wchar_t *fn)
buffer2 = strchr(buffer, 0x1A);
if (buffer2 == NULL) {
pclog("IMD: No ASCII EOF character\n");
fdd_log("IMD: no ASCII EOF found!\n");
fclose(dev->f);
free(dev);
return(0);
} else {
pclog("IMD: ASCII EOF character found at offset %08X\n", buffer2 - buffer);
fdd_log("IMD: ASCII EOF found at offset %08X\n", buffer2 - buffer);
}
buffer2++;
if ((buffer2 - buffer) == fsize) {
pclog("IMD: File ends after ASCII EOF character\n");
fdd_log("IMD: file ends after ASCII EOF\n");
fclose(dev->f);
free(dev);
return(0);
} else {
pclog("IMD: File continues after ASCII EOF character\n");
}
dev->start_offs = (buffer2 - buffer);
@@ -760,7 +757,7 @@ imd_load(int drive, const wchar_t *fn)
dev->disk_flags |= (3 << 5);
if ((raw_tsize - track_total + (mfm ? 146 : 73)) < (minimum_gap3 + minimum_gap4)) {
/* If we can't fit the sectors with a reasonable minimum gap even at 2% slower RPM, abort. */
pclog("IMD: Unable to fit the %i sectors in a track\n", track_spt);
fdd_log("IMD: unable to fit the %i sectors in a track\n", track_spt);
fclose(dev->f);
free(dev);
imd[drive] = NULL;

View File

@@ -13,7 +13,7 @@
* re-merged with the other files. Much of it is generic to
* all formats.
*
* Version: @(#)fdd_img.c 1.0.10 2018/05/09
* Version: @(#)fdd_img.c 1.0.12 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -624,8 +624,6 @@ img_load(int drive, const wchar_t *fn)
d86f_unregister(drive);
writeprot[drive] = 0;
/* Allocate a drive block. */
dev = (img_t *)malloc(sizeof(img_t));
memset(dev, 0x00, sizeof(img_t));
@@ -638,7 +636,8 @@ img_load(int drive, const wchar_t *fn)
return(0);
}
writeprot[drive] = 1;
}
} else
writeprot[drive] = 0;
if (ui_writeprot[drive])
writeprot[drive] = 1;
@@ -651,7 +650,7 @@ img_load(int drive, const wchar_t *fn)
if (! wcscasecmp(ext, L"FDI")) {
/* This is a Japanese FDI image, so let's read the header */
pclog("img_load(): File is a Japanese FDI image...\n");
fdd_log("FDD: image file type is Japanese FDI\n");
fseek(dev->f, 0x10, SEEK_SET);
(void)fread(&bpb_bps, 1, 2, dev->f);
fseek(dev->f, 0x0C, SEEK_SET);
@@ -686,7 +685,7 @@ img_load(int drive, const wchar_t *fn)
if ((first_byte == 0x1A) && (second_byte == 'F') &&
(third_byte == 'D') && (fourth_byte == 'F')) {
/* This is a FDF image. */
pclog("img_load(): File is a FDF image...\n");
fdd_log("FDD: image file type is FDF\n");
fwriteprot[drive] = writeprot[drive] = 1;
fclose(dev->f);
dev->f = plat_fopen(fn, L"rb");
@@ -707,10 +706,10 @@ img_load(int drive, const wchar_t *fn)
/* Skip first 3 bytes - their meaning is unknown to us but could be a checksum. */
first_byte = fgetc(dev->f);
fread(&track_bytes, 1, 2, dev->f);
pclog("Block header: %02X %04X ", first_byte, track_bytes);
fdd_log("FDD: block header: %02X %04X ", first_byte, track_bytes);
/* Read the length of encoded data block. */
fread(&track_bytes, 1, 2, dev->f);
pclog("%04X\n", track_bytes);
fdd_log("%04X\n", track_bytes);
}
if (feof(dev->f)) break;
@@ -761,10 +760,10 @@ img_load(int drive, const wchar_t *fn)
/* Skip first 3 bytes - their meaning is unknown to us but could be a checksum. */
first_byte = fgetc(dev->f);
fread(&track_bytes, 1, 2, dev->f);
pclog("Block header: %02X %04X ", first_byte, track_bytes);
fdd_log("FDD: block header: %02X %04X ", first_byte, track_bytes);
/* Read the length of encoded data block. */
fread(&track_bytes, 1, 2, dev->f);
pclog("%04X\n", track_bytes);
fdd_log("%04X\n", track_bytes);
}
if (feof(dev->f)) break;
@@ -825,7 +824,7 @@ img_load(int drive, const wchar_t *fn)
if (((first_byte == 'C') && (second_byte == 'Q')) ||
((first_byte == 'c') && (second_byte == 'q'))) {
pclog("img_load(): File is a CopyQM image...\n");
fdd_log("FDD: image file type is CopyQM\n");
fwriteprot[drive] = writeprot[drive] = 1;
fclose(dev->f);
dev->f = plat_fopen(fn, L"rb");
@@ -890,13 +889,12 @@ img_load(int drive, const wchar_t *fn)
}
}
}
pclog("Finished reading CopyQM image data\n");
cqm = 1;
dev->disk_at_once = 1;
first_byte = *dev->disk_data;
} else {
pclog("img_load(): File is a raw image...\n");
fdd_log("FDD: image file type is RAW\n");
dev->disk_at_once = 0;
/* Read the BPB */
@@ -922,27 +920,29 @@ jump_if_fdf:
dev->sides = 2;
dev->sector_size = 2;
pclog("BPB reports %i sides and %i bytes per sector (%i sectors total)\n",
fdd_log("FDD: BPB reports %i sides, %i bytes per sector (%i sectors total)\n",
bpb_sides, bpb_bps, bpb_total);
guess = (bpb_sides < 1);
guess = guess || (bpb_sides > 2);
guess = guess || (bpb_sides < 1 || bpb_sides > 2);
guess = guess || (bpb_total == 0);
guess = guess || !bps_is_valid(bpb_bps);
guess = guess || !first_byte_is_valid(first_byte);
guess = guess || !fdd_get_check_bpb(drive);
guess = guess && !fdi;
guess = guess && !cqm;
if (guess) {
/*
* The BPB is giving us a wacky number of sides and/or bytes
* per sector, therefore it is most probably not a BPB at all,
* so we have to guess the parameters from file size.
*/
if (size <= (160*1024)) {
if (size <= (160*1024)) { /* 1DD 160K */
dev->sectors = 8;
dev->tracks = 40;
dev->sides = 1;
} else if (size <= (180*1024)) {
} else if (size <= (180*1024)) { /* 1DD 180K */
dev->sectors = 9;
dev->tracks = 40;
dev->sides = 1;
@@ -950,10 +950,7 @@ jump_if_fdf:
dev->sectors = 9;
dev->tracks = 70;
dev->sides = 1;
} else if (size <= (320*1024)) {
dev->sectors = 8;
dev->tracks = 40;
} else if (size <= (320*1024)) {
} else if (size <= (320*1024)) { /* 2DD 320K */
dev->sectors = 8;
dev->tracks = 40;
} else if (size <= (360*1024)) { /*DD 360K*/
@@ -1049,7 +1046,7 @@ jump_if_fdf:
dev->sectors = 42;
dev->tracks = 86;
} else {
pclog("Image is bigger than can fit on an ED floppy, ejecting...\n");
fdd_log("FDD: image file size too large; ejecting\n");
fclose(dev->f);
free(dev);
return(0);
@@ -1098,13 +1095,13 @@ jump_if_fdf:
dev->dmf = 0;
}
pclog("Image parameters: bit rate 300: %f, temporary rate: %i, hole: %i, DMF: %i, XDF type: %i\n", bit_rate_300, temp_rate, dev->disk_flags >> 1, dev->dmf, dev->xdf_type);
fdd_log("FDD: image parameters: bit rate 300: %f, temporary rate: %i, hole: %i, DMF: %i, XDF type: %i\n", bit_rate_300, temp_rate, dev->disk_flags >> 1, dev->dmf, dev->xdf_type);
break;
}
}
if (temp_rate == 0xFF) {
pclog("Image is bigger than can fit on an ED floppy, ejecting...\n");
fdd_log("FDD: invalid media configuration; ejecting\n");
fclose(dev->f);
free(dev);
return(0);
@@ -1116,7 +1113,7 @@ jump_if_fdf:
else
dev->gap3_size = gap3_sizes[temp_rate][dev->sector_size][dev->sectors];
if (! dev->gap3_size) {
pclog("ERROR: Floppy image of unknown format was inserted into drive %c:!\n", drive + 0x41);
fdd_log("FDD: unknown media format in drive %c:\n", drive + 0x41);
fclose(dev->f);
free(dev);
return(0);
@@ -1139,7 +1136,7 @@ jump_if_fdf:
dev->is_cqm = cqm;
pclog("Disk flags: %i, track flags: %i\n",
fdd_log("FDD: disk flags: %02x, track flags: %02x\n",
dev->disk_flags, dev->track_flags);
/* Set up the drive unit. */

View File

@@ -8,7 +8,7 @@
*
* Implementation of the PCjs JSON floppy image format.
*
* Version: @(#)fdd_json.c 1.0.6 2018/05/06
* Version: @(#)fdd_json.c 1.0.7 2018/05/14
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -182,7 +182,7 @@ handle(json_t *dev, char *name, char *str)
static int
unexpect(int c, int state, int level)
{
pclog("JSON: Unexpected '%c' in state %d/%d.\n", c, state, level);
fdd_log("JSON: unexpected '%c' in state %d/%d.\n", c, state, level);
return(-1);
}
@@ -196,13 +196,13 @@ load_image(json_t *dev)
char *ptr;
if (dev->f == NULL) {
pclog("JSON: no file loaded!\n");
fdd_log("JSON: no file loaded!\n");
return(0);
}
/* Initialize. */
for (i=0; i<NTRACKS; i++) {
for (j=0; j<NSIDES; j++)
for (i = 0; i < NTRACKS; i++) {
for (j = 0; j < NSIDES; j++)
memset(dev->sects[i][j], 0x00, sizeof(sector_t));
}
dev->track = dev->side = dev->dmf = 0; /* "dmf" is "sector#" */
@@ -373,7 +373,7 @@ json_seek(int drive, int track)
int interleave_type;
if (dev->f == NULL) {
pclog("JSON: seek: no file loaded!\n");
fdd_log("JSON: seek: no file loaded!\n");
return;
}
@@ -412,7 +412,7 @@ json_seek(int drive, int track)
pos = d86f_prepare_pretrack(drive, side, 0);
for (sector=0; sector<dev->spt[track][side]; sector++) {
for (sector = 0; sector < dev->spt[track][side]; sector++) {
if (interleave_type == 0) {
rsec = dev->sects[track][side][sector].sector;
asec = sector;
@@ -476,7 +476,7 @@ set_sector(int drive, int side, uint8_t c, uint8_t h, uint8_t r, uint8_t n)
dev->side = side;
/* Now loop over all sector ID's on this side to find our sector. */
for (i=0; i<dev->spt[c][side]; i++) {
for (i = 0; i < dev->spt[c][side]; i++) {
if ((dev->sects[dev->track][side][i].track == c) &&
(dev->sects[dev->track][side][i].side == h) &&
(dev->sects[dev->track][side][i].sector == r) &&
@@ -535,15 +535,15 @@ json_load(int drive, const wchar_t *fn)
/* Load all sectors from the image file. */
if (! load_image(dev)) {
pclog("JSON: failed to initialize\n");
fdd_log("JSON: failed to initialize\n");
(void)fclose(dev->f);
free(dev);
images[drive] = NULL;
return(0);
}
pclog("JSON(%d): %ls (%i tracks, %i sides, %i sectors)\n",
drive, fn, dev->tracks, dev->sides, dev->spt[0][0]);
fdd_log("JSON(%d): %ls (%i tracks, %i sides, %i sectors)\n",
drive, fn, dev->tracks, dev->sides, dev->spt[0][0]);
/*
* If the image has more than 43 tracks, then
@@ -566,7 +566,7 @@ json_load(int drive, const wchar_t *fn)
temp_rate = 0xff;
sec = &dev->sects[0][0][0];
for (i=0; i<6; i++) {
for (i = 0; i < 6; i++) {
if (dev->spt[0][0] > fdd_max_sectors[sec->size][i]) continue;
bit_rate = fdd_bit_rates_300[i];
@@ -599,7 +599,7 @@ json_load(int drive, const wchar_t *fn)
}
if (temp_rate == 0xff) {
pclog("JSON: invalid image (temp_rate=0xff)\n");
fdd_log("JSON: invalid image (temp_rate=0xff)\n");
(void)fclose(dev->f);
dev->f = NULL;
free(dev);
@@ -619,7 +619,7 @@ json_load(int drive, const wchar_t *fn)
dev->gap3_len = fdd_get_gap3_size(temp_rate,sec->size,dev->spt[0][0]);
if (! dev->gap3_len) {
pclog("JSON: image of unknown format was inserted into drive %c:!\n",
fdd_log("JSON: image of unknown format was inserted into drive %c:!\n",
'C'+drive);
(void)fclose(dev->f);
dev->f = NULL;
@@ -632,9 +632,9 @@ json_load(int drive, const wchar_t *fn)
if (temp_rate & 0x04)
dev->track_flags |= 0x20; /* RPM */
pclog(" disk_flags: 0x%02x, track_flags: 0x%02x, GAP3 length: %i\n",
fdd_log(" disk_flags: 0x%02x, track_flags: 0x%02x, GAP3 length: %i\n",
dev->disk_flags, dev->track_flags, dev->gap3_len);
pclog(" bit rate 300: %.2f, temporary rate: %i, hole: %i, DMF: %i\n",
fdd_log(" bit rate 300: %.2f, temporary rate: %i, hole: %i, DMF: %i\n",
bit_rate, temp_rate, (dev->disk_flags >> 1), dev->dmf);
/* Set up handlers for 86F layer. */
@@ -675,10 +675,10 @@ json_close(int drive)
d86f_unregister(drive);
/* Release all the sector buffers. */
for (t=0; t<256; t++) {
for (h=0; h<2; h++) {
for (t = 0; t < 256; t++) {
for (h = 0; h < 2; h++) {
memset(dev->sects[t][h], 0x00, sizeof(sector_t));
for (s=0; s<256; s++) {
for (s = 0; s < 256; s++) {
if (dev->sects[t][h][s].data != NULL)
free(dev->sects[t][h][s].data);
dev->sects[t][h][s].data = NULL;

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Teledisk floppy image format.
*
* Version: @(#)fdd_td0.c 1.0.7 2018/05/06
* Version: @(#)fdd_td0.c 1.0.8 2018/05/14
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -611,7 +611,7 @@ td0_initialize(int drive)
int i, j, k;
if (dev->f == NULL) {
pclog("TD0: Attempted to initialize without loading a file first\n");
fdd_log("TD0: attempted to initialize without loading a file first\n");
return(0);
}
@@ -619,12 +619,12 @@ td0_initialize(int drive)
file_size = ftell(dev->f);
if (file_size < 12) {
pclog("TD0: File is too small to even contain the header\n");
fdd_log("TD0: file is too small to even contain the header\n");
return(0);
}
if (file_size > TD0_MAX_BUFSZ) {
pclog("TD0: File exceeds the maximum size\n");
fdd_log("TD0: file exceeds the maximum size\n");
return(0);
}
@@ -633,13 +633,13 @@ td0_initialize(int drive)
head_count = header[9];
if (header[0] == 't') {
pclog("TD0: File is compressed\n");
fdd_log("TD0: file is compressed\n");
disk_decode.fdd_file = dev->f;
state_init_Decode(&disk_decode);
disk_decode.fdd_file_offset = 12;
state_Decode(&disk_decode, dev->imagebuf, TD0_MAX_BUFSZ);
} else {
pclog("TD0: File is uncompressed\n");
fdd_log("TD0: file is uncompressed\n");
fseek(dev->f, 12, SEEK_SET);
fread(dev->imagebuf, 1, file_size - 12, dev->f);
}
@@ -650,14 +650,14 @@ td0_initialize(int drive)
track_spt = dev->imagebuf[offset];
if (track_spt == 255) {
/* Empty file? */
pclog("TD0: File has no tracks\n");
fdd_log("TD0: file has no tracks\n");
return(0);
}
density = (header[5] >> 1) & 3;
if (density == 3) {
pclog("TD0: Unknown density\n");
fdd_log("TD0: unknown density\n");
return(0);
}
@@ -725,7 +725,7 @@ td0_initialize(int drive)
size = 128 << hs[3];
if ((total_size + size) >= TD0_MAX_BUFSZ) {
pclog("TD0: Processed buffer overflow\n");
fdd_log("TD0: processed buffer overflow\n");
return(0);
}
@@ -735,7 +735,7 @@ td0_initialize(int drive)
offset += 3;
switch (hs[8]) {
default:
pclog("TD0: Image uses an unsupported sector data encoding\n");
fdd_log("TD0: image uses an unsupported sector data encoding\n");
return(0);
case 0:
@@ -803,7 +803,7 @@ td0_initialize(int drive)
dev->disk_flags |= (3 << 5);
if ((raw_tsize - track_size + (fm ? 73 : 146)) < (minimum_gap3 + minimum_gap4)) {
/* If we can't fit the sectors with a reasonable minimum gap even at 2% slower RPM, abort. */
pclog("TD0: Unable to fit the %i sectors in a track\n", track_spt);
fdd_log("TD0: unable to fit the %i sectors in a track\n", track_spt);
return 0;
}
}
@@ -814,7 +814,7 @@ td0_initialize(int drive)
}
if ((dev->disk_flags & 0x60) == 0x60)
pclog("TD0: Disk will rotate 2% below perfect RPM\n");
fdd_log("TD0: disk will rotate 2% below perfect RPM\n");
dev->tracks = track_count + 1;
@@ -836,7 +836,7 @@ td0_initialize(int drive)
dev->current_side_flags[0] = dev->side_flags[0][0];
dev->current_side_flags[1] = dev->side_flags[0][1];
pclog("TD0: File loaded: %i tracks, %i sides, disk flags: %02X, side flags: %02X, %02X, GAP3 length: %02X\n", dev->tracks, dev->sides, dev->disk_flags, dev->current_side_flags[0], dev->current_side_flags[1], dev->gap3_len);
fdd_log("TD0: file loaded: %i tracks, %i sides, disk flags: %02X, side flags: %02X, %02X, GAP3 length: %02X\n", dev->tracks, dev->sides, dev->disk_flags, dev->current_side_flags[0], dev->current_side_flags[1], dev->gap3_len);
return(1);
}
@@ -1135,12 +1135,12 @@ td0_load(int drive, const wchar_t *fn)
fwriteprot[drive] = writeprot[drive];
if (! dsk_identify(drive)) {
pclog("TD0: Not a valid Teledisk image\n");
fdd_log("TD0: not a valid Teledisk image\n");
fclose(dev->f);
dev->f = NULL;
return(0);
} else {
pclog("TD0: Valid Teledisk image\n");
fdd_log("TD0: valid Teledisk image\n");
}
/* Allocate the processing buffers. */
@@ -1151,13 +1151,11 @@ td0_load(int drive, const wchar_t *fn)
memset(dev->processed_buf, 0x00, i);
if (! td0_initialize(drive)) {
pclog("TD0: Failed to initialize\n");
fdd_log("TD0: failed to initialize\n");
fclose(dev->f);
free(dev->imagebuf);
free(dev->processed_buf);
return(0);
} else {
pclog("TD0: Initialized successfully\n");
}
/* Attach this format to the D86F engine. */

View File

@@ -8,7 +8,7 @@
*
* Define the various UI functions.
*
* Version: @(#)ui.h 1.0.9 2018/05/11
* Version: @(#)ui.h 1.0.10 2018/05/13
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -185,7 +185,7 @@ extern void dlg_about(void);
extern int dlg_settings(int ask);
extern void dlg_status(void);
extern void dlg_status_update(void);
extern void dlg_new_floppy(int idm, int tag);
extern void dlg_new_image(int drive, int part, int is_zip);
extern void dlg_sound_gain(void);
extern int dlg_file(const wchar_t *filt, const wchar_t *ifn,
wchar_t *fn, int save);
@@ -205,7 +205,7 @@ extern void plat_endblit(void);
/* Floppy image creation. */
extern int floppy_create_86f(const wchar_t *, int8_t sz, int8_t rpm_mode);
extern int floppy_create_image(const wchar_t *, int8_t sz, int8_t is_zip, int8_t is_fdi);
extern int floppy_create_image(const wchar_t *, int8_t sz, int8_t is_fdi);
extern int zip_create_image(const wchar_t *, int8_t sz, int8_t is_zdi);
#ifdef __cplusplus

View File

@@ -12,7 +12,7 @@
* format handlers, and re-integrated with that code. This is
* just the wrong place for it..
*
* Version: @(#)ui_new_floppy.c 1.0.2 2018/05/06
* Version: @(#)ui_new_image.c 1.0.3 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -199,7 +199,7 @@ floppy_create_86f(const wchar_t *fn, int8_t ds, int8_t rpm_mode)
/* This function should be moved to the Floppy Image format handler. */
int
floppy_create_image(const wchar_t *fn, int8_t ds, int8_t is_zip, int8_t is_fdi)
floppy_create_image(const wchar_t *fn, int8_t ds, int8_t is_fdi)
{
const disk_size_t *dp = &disk_sizes[ds];
uint8_t *empty;
@@ -230,8 +230,7 @@ floppy_create_image(const wchar_t *fn, int8_t ds, int8_t is_zip, int8_t is_fdi)
fat2_offs = fat1_offs + fat_size;
zero_bytes = fat2_offs + fat_size + root_dir_bytes;
/* FIXME: is_zip is _always_ 0 ... */
if (!is_zip && is_fdi) {
if (is_fdi) {
empty = (uint8_t *)malloc(base);
memset(empty, 0x00, base);
@@ -250,57 +249,55 @@ floppy_create_image(const wchar_t *fn, int8_t ds, int8_t is_zip, int8_t is_fdi)
empty = (uint8_t *)malloc(total_size);
memset(empty, 0x00, zero_bytes);
if (!is_zip) {
memset(empty + zero_bytes, 0xF6, total_size - zero_bytes);
memset(empty + zero_bytes, 0xF6, total_size - zero_bytes);
empty[0x00] = 0xEB; /* Jump to make MS-DOS happy. */
empty[0x01] = 0x58;
empty[0x02] = 0x90;
empty[0x00] = 0xEB; /* jump to make DOS happy */
empty[0x01] = 0x58;
empty[0x02] = 0x90;
empty[0x03] = 0x38; /* '86BOX5.0' OEM ID. */
empty[0x04] = 0x36;
empty[0x05] = 0x42;
empty[0x06] = 0x4F;
empty[0x07] = 0x58;
empty[0x08] = 0x35;
empty[0x09] = 0x2E;
empty[0x0A] = 0x30;
empty[0x03] = (uint8_t)'V'; /* OEM ID */
empty[0x04] = (uint8_t)'A';
empty[0x05] = (uint8_t)'R';
empty[0x06] = (uint8_t)'C';
empty[0x07] = (uint8_t)'E';
empty[0x08] = (uint8_t)'M';
empty[0x09] = (uint8_t)'5';
empty[0x0A] = (uint8_t)'0';
*(uint16_t *) &(empty[0x0B]) = (uint16_t) sector_bytes;
*(uint8_t *) &(empty[0x0D]) = (uint8_t) dp->spc;
*(uint16_t *) &(empty[0x0E]) = (uint16_t) 1;
*(uint8_t *) &(empty[0x10]) = (uint8_t) dp->num_fats;
*(uint16_t *) &(empty[0x11]) = (uint16_t) dp->root_dir_entries;
*(uint16_t *) &(empty[0x13]) = (uint16_t) total_sectors;
*(uint8_t *) &(empty[0x15]) = (uint8_t) dp->media_desc;
*(uint16_t *) &(empty[0x16]) = (uint16_t) dp->spfat;
*(uint8_t *) &(empty[0x18]) = (uint8_t) dp->sectors;
*(uint8_t *) &(empty[0x1A]) = (uint8_t) dp->sides;
*(uint16_t *) &(empty[0x0B]) = (uint16_t) sector_bytes;
*(uint8_t *) &(empty[0x0D]) = (uint8_t) dp->spc;
*(uint16_t *) &(empty[0x0E]) = (uint16_t) 1;
*(uint8_t *) &(empty[0x10]) = (uint8_t) dp->num_fats;
*(uint16_t *) &(empty[0x11]) = (uint16_t) dp->root_dir_entries;
*(uint16_t *) &(empty[0x13]) = (uint16_t) total_sectors;
*(uint8_t *) &(empty[0x15]) = (uint8_t) dp->media_desc;
*(uint16_t *) &(empty[0x16]) = (uint16_t) dp->spfat;
*(uint8_t *) &(empty[0x18]) = (uint8_t) dp->sectors;
*(uint8_t *) &(empty[0x1A]) = (uint8_t) dp->sides;
empty[0x26] = 0x29; /* ')' followed by randomly-generated volume serial number. */
empty[0x27] = random_generate();
empty[0x28] = random_generate();
empty[0x29] = random_generate();
empty[0x2A] = random_generate();
empty[0x26] = 0x29; /* ')' followed by random serial number */
empty[0x27] = random_generate();
empty[0x28] = random_generate();
empty[0x29] = random_generate();
empty[0x2A] = random_generate();
memset(&(empty[0x2B]), 0x20, 11);
memset(&(empty[0x2B]), 0x20, 11);
empty[0x36] = 'F';
empty[0x37] = 'A';
empty[0x38] = 'T';
empty[0x39] = '1';
empty[0x3A] = '2';
empty[0x3B] = ' ';
empty[0x3C] = ' ';
empty[0x3D] = ' ';
empty[0x36] = (uint8_t)'F';
empty[0x37] = (uint8_t)'A';
empty[0x38] = (uint8_t)'T';
empty[0x39] = (uint8_t)'1';
empty[0x3A] = (uint8_t)'2';
empty[0x3B] = (uint8_t)' ';
empty[0x3C] = (uint8_t)' ';
empty[0x3D] = (uint8_t)' ';
empty[0x1FE] = 0x55;
empty[0x1FF] = 0xAA;
empty[0x1FE] = 0x55;
empty[0x1FF] = 0xAA;
empty[fat1_offs + 0x00] = empty[fat2_offs + 0x00] = empty[0x15];
empty[fat1_offs + 0x01] = empty[fat2_offs + 0x01] = 0xFF;
empty[fat1_offs + 0x02] = empty[fat2_offs + 0x02] = 0xFF;
}
empty[fat1_offs + 0x00] = empty[fat2_offs + 0x00] = empty[0x15];
empty[fat1_offs + 0x01] = empty[fat2_offs + 0x01] = 0xFF;
empty[fat1_offs + 0x02] = empty[fat2_offs + 0x02] = 0xFF;
fwrite(empty, 1, total_size, f);
@@ -443,7 +440,7 @@ zip_create_image(const wchar_t *fn, int8_t ds, int8_t is_zdi)
*(uint32_t *) &(empty[0x4020]) = 0x0002FFE0;
*(uint16_t *) &(empty[0x4024]) = 0x0080;
empty[0x4026] = 0x29; /* ')' followed by randomly-generated volume serial number. */
empty[0x4026] = 0x29; /* ')' followed by random serial number */
empty[0x4027] = random_generate();
empty[0x4028] = random_generate();
empty[0x4029] = random_generate();
@@ -452,11 +449,11 @@ zip_create_image(const wchar_t *fn, int8_t ds, int8_t is_zdi)
memset(&(empty[0x402B]), 0x00, 0x000B);
memset(&(empty[0x4036]), 0x20, 0x0008);
empty[0x4036] = 'F';
empty[0x4037] = 'A';
empty[0x4038] = 'T';
empty[0x4039] = '1';
empty[0x403A] = '6';
empty[0x4036] = (uint8_t)'F';
empty[0x4037] = (uint8_t)'A';
empty[0x4038] = (uint8_t)'T';
empty[0x4039] = (uint8_t)'1';
empty[0x403A] = (uint8_t)'6';
empty[0x41FE] = 0x55;
empty[0x41FF] = 0xAA;
@@ -513,7 +510,7 @@ zip_create_image(const wchar_t *fn, int8_t ds, int8_t is_zdi)
*(uint32_t *) &(empty[0x4020]) = 0x000777E0;
*(uint16_t *) &(empty[0x4024]) = 0x0080;
empty[0x4026] = 0x29; /* ')' followed by randomly-generated volume serial number. */
empty[0x4026] = 0x29; /* ')' followed by random serial number */
empty[0x4027] = random_generate();
empty[0x4028] = random_generate();
empty[0x4029] = random_generate();
@@ -522,11 +519,11 @@ zip_create_image(const wchar_t *fn, int8_t ds, int8_t is_zdi)
memset(&(empty[0x402B]), 0x00, 0x000B);
memset(&(empty[0x4036]), 0x20, 0x0008);
empty[0x4036] = 'F';
empty[0x4037] = 'A';
empty[0x4038] = 'T';
empty[0x4039] = '1';
empty[0x403A] = '6';
empty[0x4036] = (uint8_t)'F';
empty[0x4037] = (uint8_t)'A';
empty[0x4038] = (uint8_t)'T';
empty[0x4039] = (uint8_t)'1';
empty[0x403A] = (uint8_t)'6';
empty[0x41FE] = 0x55;
empty[0x41FF] = 0xAA;

View File

@@ -8,7 +8,7 @@
*
* Common UI support functions for the Status Bar module.
*
* Version: @(#)ui_stbar.c 1.0.7 2018/05/11
* Version: @(#)ui_stbar.c 1.0.8 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -804,7 +804,7 @@ ui_sb_menu_command(int idm, int tag)
part = find_tag(SB_FLOPPY | drive);
if (part == -1) break;
dlg_new_floppy(idm, part);
dlg_new_image(drive, part, 0);
break;
case IDM_FLOPPY_IMAGE_EXISTING:
@@ -948,7 +948,7 @@ ui_sb_menu_command(int idm, int tag)
part = find_tag(SB_ZIP | drive);
if (part == -1) break;
dlg_new_floppy(drive | 0x80, part);
dlg_new_image(drive, part, 1);
break;
case IDM_ZIP_IMAGE_EXISTING:

View File

@@ -8,7 +8,7 @@
*
* Handle the various video renderer modules.
*
* Version: @(#)ui_vidapi.c 1.0.1 2018/05/09
* Version: @(#)ui_vidapi.c 1.0.2 2018/05/13
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -195,6 +195,7 @@ vidapi_screenshot(void)
(void)time(&now);
info = localtime(&now);
memset(path, 0x00, sizeof(path));
plat_append_filename(path, usr_path, SCREENSHOT_PATH);
if (! plat_dir_check(path))
@@ -202,7 +203,7 @@ vidapi_screenshot(void)
wcscat(path, L"\\");
wcsftime(fn, 128, L"%Y%m%d_%H%M%S.png", info);
wcsftime(fn, sizeof_w(fn), L"%Y%m%d_%H%M%S.png", info);
wcscat(path, fn);
if (plat_vidapis[vid_api]->screenshot != NULL)

View File

@@ -8,7 +8,7 @@
*
* Application resource script for Windows.
*
* Version: @(#)VARCem.rc 1.0.28 2018/05/11
* Version: @(#)VARCem.rc 1.0.29 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1032,7 +1032,7 @@ BEGIN
IDS_2156 "%" PRIu64
IDS_2157 "%" PRIu64 " MB (CHS: %u, %u, %u)"
IDS_2158 "Floppy %i (%s): %ls"
IDS_2159 "All images\0*.0??;*.1??;*.360;*.720;*.86f;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.ima;*.json;*.td0;*.*fd?;*.xdf\0Advanced sector images\0*.imd;*.json;*.td0\0Basic sector images\0*.0??;*.1??;*.360;*.720;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.xdf;*.*fd?\0Flux images\0*.fdi\0Surface images\0*.86f\0All files\0*.*\0"
IDS_2159 "All images\0*.0??;*.1??;*.360;*.720;*.86f;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.json;*.td0;*.*fd?;*.xdf\0Advanced sector images\0*.imd;*.json;*.td0\0Basic sector images\0*.0??;*.1??;*.360;*.720;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.xdf;*.*fd?\0Flux images\0*.fdi\0Surface images\0*.86f\0All files\0*.*\0"
IDS_2160 "Configuration files\0*.varc\0All files\0*.*\0"
IDS_2161 "&New image..."
IDS_2162 "&Existing image..."

View File

@@ -8,7 +8,7 @@
#
# Makefile for Windows systems using the MinGW32 environment.
#
# Version: @(#)Makefile.mingw 1.0.44 2018/05/10
# Version: @(#)Makefile.mingw 1.0.45 2018/05/13
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
@@ -467,7 +467,7 @@ else
win_ddraw.o win_d3d.o $(SDLOBJ) \
win_dialog.o win_about.o win_status.o \
win_settings.o win_devconf.o win_snd_gain.o \
win_new_floppy.o
win_new_image.o
endif
@@ -540,7 +540,7 @@ CXXFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
MAINOBJ := pc.o config.o misc.o random.o timer.o io.o mem.o \
rom.o rom_load.o device.o nvr.o $(VNCOBJ) $(RDPOBJ)
UIOBJ += ui_main.o ui_new_floppy.o ui_stbar.o ui_vidapi.o
UIOBJ += ui_main.o ui_new_image.o ui_stbar.o ui_vidapi.o
SYSOBJ := dma.o nmi.o pic.o pit.o ppi.o pci.o mca.o mcr.o \
memregs.o nvr_at.o nvr_ps2.o

View File

@@ -1,261 +0,0 @@
unsigned char default8x16FontData[4096+1]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,
0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00,
0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00,
0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00,
0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00,
0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00,
0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0xe7,0xff,0xff,0xdb,0xc3,0xc3,0xc3,0xc3,0xc3,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00,
0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xff,0xdb,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x3c,0x66,0xc3,0xc3,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0xff,0xc3,0x86,0x0c,0x18,0x30,0x60,0xc1,0xc3,0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00,
0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00,
0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,
0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xe6,0xff,0xdb,0xdb,0xdb,0xdb,0xdb,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00,
0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xc3,0x66,0x3c,0x18,0x3c,0x66,0xc3,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00,
0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00,
0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00,
0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6e,0x3b,0x1b,0x7e,0xd8,0xdc,0x77,0x00,0x00,0x00,0x00,
0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00,
0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00,
0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x18,0x18,0x7e,0xc3,0xc0,0xc0,0xc0,0xc3,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00,
0x00,0x00,0xc3,0x66,0x3c,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0xfc,0x66,0x66,0x7c,0x62,0x66,0x6f,0x66,0x66,0x66,0xf3,0x00,0x00,0x00,0x00,
0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xce,0x9b,0x06,0x0c,0x1f,0x00,0x00,
0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x96,0x3e,0x06,0x06,0x00,0x00,
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,
0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,
0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00,
0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00,
0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00,
0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00,
0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x0e,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00,
0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
int default8x16FontMetaData[256*5+1]={
0,8,16,0,0,16,8,16,0,0,32,8,16,0,0,48,8,16,0,0,64,8,16,0,0,80,8,16,0,0,96,8,16,0,0,112,8,16,0,0,128,8,16,0,0,144,8,16,0,0,160,8,16,0,0,176,8,16,0,0,192,8,16,0,0,208,8,16,0,0,224,8,16,0,0,240,8,16,0,0,256,8,16,0,0,272,8,16,0,0,288,8,16,0,0,304,8,16,0,0,320,8,16,0,0,336,8,16,0,0,352,8,16,0,0,368,8,16,0,0,384,8,16,0,0,400,8,16,0,0,416,8,16,0,0,432,8,16,0,0,448,8,16,0,0,464,8,16,0,0,480,8,16,0,0,496,8,16,0,0,512,8,16,0,0,528,8,16,0,0,544,8,16,0,0,560,8,16,0,0,576,8,16,0,0,592,8,16,0,0,608,8,16,0,0,624,8,16,0,0,640,8,16,0,0,656,8,16,0,0,672,8,16,0,0,688,8,16,0,0,704,8,16,0,0,720,8,16,0,0,736,8,16,0,0,752,8,16,0,0,768,8,16,0,0,784,8,16,0,0,800,8,16,0,0,816,8,16,0,0,832,8,16,0,0,848,8,16,0,0,864,8,16,0,0,880,8,16,0,0,896,8,16,0,0,912,8,16,0,0,928,8,16,0,0,944,8,16,0,0,960,8,16,0,0,976,8,16,0,0,992,8,16,0,0,1008,8,16,0,0,1024,8,16,0,0,1040,8,16,0,0,1056,8,16,0,0,1072,8,16,0,0,1088,8,16,0,0,1104,8,16,0,0,1120,8,16,0,0,1136,8,16,0,0,1152,8,16,0,0,1168,8,16,0,0,1184,8,16,0,0,1200,8,16,0,0,1216,8,16,0,0,1232,8,16,0,0,1248,8,16,0,0,1264,8,16,0,0,1280,8,16,0,0,1296,8,16,0,0,1312,8,16,0,0,1328,8,16,0,0,1344,8,16,0,0,1360,8,16,0,0,1376,8,16,0,0,1392,8,16,0,0,1408,8,16,0,0,1424,8,16,0,0,1440,8,16,0,0,1456,8,16,0,0,1472,8,16,0,0,1488,8,16,0,0,1504,8,16,0,0,1520,8,16,0,0,1536,8,16,0,0,1552,8,16,0,0,1568,8,16,0,0,1584,8,16,0,0,1600,8,16,0,0,1616,8,16,0,0,1632,8,16,0,0,1648,8,16,0,0,1664,8,16,0,0,1680,8,16,0,0,1696,8,16,0,0,1712,8,16,0,0,1728,8,16,0,0,1744,8,16,0,0,1760,8,16,0,0,1776,8,16,0,0,1792,8,16,0,0,1808,8,16,0,0,1824,8,16,0,0,1840,8,16,0,0,1856,8,16,0,0,1872,8,16,0,0,1888,8,16,0,0,1904,8,16,0,0,1920,8,16,0,0,1936,8,16,0,0,1952,8,16,0,0,1968,8,16,0,0,1984,8,16,0,0,2000,8,16,0,0,2016,8,16,0,0,2032,8,16,0,0,2048,8,16,0,0,2064,8,16,0,0,2080,8,16,0,0,2096,8,16,0,0,2112,8,16,0,0,2128,8,16,0,0,2144,8,16,0,0,2160,8,16,0,0,2176,8,16,0,0,2192,8,16,0,0,2208,8,16,0,0,2224,8,16,0,0,2240,8,16,0,0,2256,8,16,0,0,2272,8,16,0,0,2288,8,16,0,0,2304,8,16,0,0,2320,8,16,0,0,2336,8,16,0,0,2352,8,16,0,0,2368,8,16,0,0,2384,8,16,0,0,2400,8,16,0,0,2416,8,16,0,0,2432,8,16,0,0,2448,8,16,0,0,2464,8,16,0,0,2480,8,16,0,0,2496,8,16,0,0,2512,8,16,0,0,2528,8,16,0,0,2544,8,16,0,0,2560,8,16,0,0,2576,8,16,0,0,2592,8,16,0,0,2608,8,16,0,0,2624,8,16,0,0,2640,8,16,0,0,2656,8,16,0,0,2672,8,16,0,0,2688,8,16,0,0,2704,8,16,0,0,2720,8,16,0,0,2736,8,16,0,0,2752,8,16,0,0,2768,8,16,0,0,2784,8,16,0,0,2800,8,16,0,0,2816,8,16,0,0,2832,8,16,0,0,2848,8,16,0,0,2864,8,16,0,0,2880,8,16,0,0,2896,8,16,0,0,2912,8,16,0,0,2928,8,16,0,0,2944,8,16,0,0,2960,8,16,0,0,2976,8,16,0,0,2992,8,16,0,0,3008,8,16,0,0,3024,8,16,0,0,3040,8,16,0,0,3056,8,16,0,0,3072,8,16,0,0,3088,8,16,0,0,3104,8,16,0,0,3120,8,16,0,0,3136,8,16,0,0,3152,8,16,0,0,3168,8,16,0,0,3184,8,16,0,0,3200,8,16,0,0,3216,8,16,0,0,3232,8,16,0,0,3248,8,16,0,0,3264,8,16,0,0,3280,8,16,0,0,3296,8,16,0,0,3312,8,16,0,0,3328,8,16,0,0,3344,8,16,0,0,3360,8,16,0,0,3376,8,16,0,0,3392,8,16,0,0,3408,8,16,0,0,3424,8,16,0,0,3440,8,16,0,0,3456,8,16,0,0,3472,8,16,0,0,3488,8,16,0,0,3504,8,16,0,0,3520,8,16,0,0,3536,8,16,0,0,3552,8,16,0,0,3568,8,16,0,0,3584,8,16,0,0,3600,8,16,0,0,3616,8,16,0,0,3632,8,16,0,0,3648,8,16,0,0,3664,8,16,0,0,3680,8,16,0,0,3696,8,16,0,0,3712,8,16,0,0,3728,8,16,0,0,3744,8,16,0,0,3760,8,16,0,0,3776,8,16,0,0,3792,8,16,0,0,3808,8,16,0,0,3824,8,16,0,0,3840,8,16,0,0,3856,8,16,0,0,3872,8,16,0,0,3888,8,16,0,0,3904,8,16,0,0,3920,8,16,0,0,3936,8,16,0,0,3952,8,16,0,0,3968,8,16,0,0,3984,8,16,0,0,4000,8,16,0,0,4016,8,16,0,0,4032,8,16,0,0,4048,8,16,0,0,4064,8,16,0,0,4080,8,16,0,0,};
rfbFontData default8x16Font = { default8x16FontData, default8x16FontMetaData };

File diff suppressed because it is too large Load Diff

View File

@@ -1,796 +0,0 @@
#ifndef RFB_H
#define RFB_H
/*
* rfb.h - header file for RFB DDX implementation.
*/
/*
* Copyright (C) 2002 RealVNC Ltd.
* OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.
* Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
* All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#if(defined __cplusplus)
extern "C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rfb/rfbproto.h>
#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef __MINGW32__
#include <winsock2.h>
#endif
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
#include <pthread.h>
#if 0 /* debugging */
#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
#define MUTEX(mutex) pthread_mutex_t (mutex)
#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
#define COND(cond) pthread_cond_t (cond)
#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
#define IF_PTHREADS(x) x
#else
#define LOCK(mutex) pthread_mutex_lock(&(mutex));
#define UNLOCK(mutex) pthread_mutex_unlock(&(mutex));
#define MUTEX(mutex) pthread_mutex_t (mutex)
#define INIT_MUTEX(mutex) pthread_mutex_init(&(mutex),NULL)
#define TINI_MUTEX(mutex) pthread_mutex_destroy(&(mutex))
#define TSIGNAL(cond) pthread_cond_signal(&(cond))
#define WAIT(cond,mutex) pthread_cond_wait(&(cond),&(mutex))
#define COND(cond) pthread_cond_t (cond)
#define INIT_COND(cond) pthread_cond_init(&(cond),NULL)
#define TINI_COND(cond) pthread_cond_destroy(&(cond))
#define IF_PTHREADS(x) x
#endif
#else
#define LOCK(mutex)
#define UNLOCK(mutex)
#define MUTEX(mutex)
#define INIT_MUTEX(mutex)
#define TINI_MUTEX(mutex)
#define TSIGNAL(cond)
#define WAIT(cond,mutex) this_is_unsupported
#define COND(cond)
#define INIT_COND(cond)
#define TINI_COND(cond)
#define IF_PTHREADS(x)
#endif
/* end of stuff for autoconf */
/* if you use pthreads, but don't define LIBVNCSERVER_HAVE_LIBPTHREAD, the structs
get all mixed up. So this gives a linker error reminding you to compile
the library and your application (at least the parts including rfb.h)
with the same support for pthreads. */
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
#ifdef LIBVNCSERVER_HAVE_LIBZ
#define rfbInitServer rfbInitServerWithPthreadsAndZRLE
#else
#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE
#endif
#else
#ifdef LIBVNCSERVER_HAVE_LIBZ
#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE
#else
#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE
#endif
#endif
struct _rfbClientRec;
struct _rfbScreenInfo;
struct rfbCursor;
enum rfbNewClientAction {
RFB_CLIENT_ACCEPT,
RFB_CLIENT_ON_HOLD,
RFB_CLIENT_REFUSE
};
typedef void (*rfbKbdAddEventProcPtr) (rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl);
typedef void (*rfbKbdReleaseAllKeysProcPtr) (struct _rfbClientRec* cl);
typedef void (*rfbPtrAddEventProcPtr) (int buttonMask, int x, int y, struct _rfbClientRec* cl);
typedef void (*rfbSetXCutTextProcPtr) (char* str,int len, struct _rfbClientRec* cl);
typedef struct rfbCursor* (*rfbGetCursorProcPtr) (struct _rfbClientRec* pScreen);
typedef rfbBool (*rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
typedef rfbBool (*rfbPasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
typedef enum rfbNewClientAction (*rfbNewClientHookPtr)(struct _rfbClientRec* cl);
typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl);
typedef struct {
uint32_t count;
rfbBool is16; /* is the data format short? */
union {
uint8_t* bytes;
uint16_t* shorts;
} data; /* there have to be count*3 entries */
} rfbColourMap;
/*
* Per-screen (framebuffer) structure. There can be as many as you wish,
* each serving different clients. However, you have to call
* rfbProcessEvents for each of these.
*/
typedef struct _rfbScreenInfo
{
int width;
int paddedWidthInBytes;
int height;
int depth;
int bitsPerPixel;
int sizeInBytes;
rfbPixel blackPixel;
rfbPixel whitePixel;
/* some screen specific data can be put into a struct where screenData
* points to. You need this if you have more than one screen at the
* same time while using the same functions.
*/
void* screenData;
/* The following two members are used to minimise the amount of unnecessary
drawing caused by cursor movement. Whenever any drawing affects the
part of the screen where the cursor is, the cursor is removed first and
then the drawing is done (this is what the sprite routines test for).
Afterwards, however, we do not replace the cursor, even when the cursor
is logically being moved across the screen. We only draw the cursor
again just as we are about to send the client a framebuffer update.
We need to be careful when removing and drawing the cursor because of
their relationship with the normal drawing routines. The drawing
routines can invoke the cursor routines, but also the cursor routines
themselves end up invoking drawing routines.
Removing the cursor (rfbUndrawCursor) is eventually achieved by
doing a CopyArea from a pixmap to the screen, where the pixmap contains
the saved contents of the screen under the cursor. Before doing this,
however, we set cursorIsDrawn to FALSE. Then, when CopyArea is called,
it sees that cursorIsDrawn is FALSE and so doesn't feel the need to
(recursively!) remove the cursor before doing it.
Putting up the cursor (rfbDrawCursor) involves a call to
PushPixels. While this is happening, cursorIsDrawn must be FALSE so
that PushPixels doesn't think it has to remove the cursor first.
Obviously cursorIsDrawn is set to TRUE afterwards.
Another problem we face is that drawing routines sometimes cause a
framebuffer update to be sent to the RFB client. When the RFB client is
already waiting for a framebuffer update and some drawing to the
framebuffer then happens, the drawing routine sees that the client is
ready, so it calls rfbSendFramebufferUpdate. If the cursor is not drawn
at this stage, it must be put up, and so rfbSpriteRestoreCursor is
called. However, if the original drawing routine was actually called
from within rfbSpriteRestoreCursor or rfbSpriteRemoveCursor we don't
want this to happen. So both the cursor routines set
dontSendFramebufferUpdate to TRUE, and all the drawing routines check
this before calling rfbSendFramebufferUpdate. */
rfbBool cursorIsDrawn; /* TRUE if the cursor is currently drawn */
rfbBool dontSendFramebufferUpdate; /* TRUE while removing or drawing the
cursor */
/* additions by libvncserver */
rfbPixelFormat serverFormat;
rfbColourMap colourMap; /* set this if rfbServerFormat.trueColour==FALSE */
const char* desktopName;
char thisHost[255];
rfbBool autoPort;
int port;
SOCKET listenSock;
int maxSock;
int maxFd;
#ifdef __MINGW32__
struct fd_set allFds;
#else
fd_set allFds;
#endif
rfbBool socketInitDone;
SOCKET inetdSock;
rfbBool inetdInitDone;
int udpPort;
SOCKET udpSock;
struct _rfbClientRec* udpClient;
rfbBool udpSockConnected;
struct sockaddr_in udpRemoteAddr;
int maxClientWait;
/* http stuff */
rfbBool httpInitDone;
rfbBool httpEnableProxyConnect;
int httpPort;
char* httpDir;
SOCKET httpListenSock;
SOCKET httpSock;
rfbPasswordCheckProcPtr passwordCheck;
void* authPasswdData;
/* If rfbAuthPasswdData is given a list, this is the first
view only password. */
int authPasswdFirstViewOnly;
/* send only this many rectangles in one update */
int maxRectsPerUpdate;
/* this is the amount of milliseconds to wait at least before sending
* an update. */
int deferUpdateTime;
#ifdef TODELETE
char* screen;
#endif
rfbBool alwaysShared;
rfbBool neverShared;
rfbBool dontDisconnect;
struct _rfbClientRec* clientHead;
/* cursor */
int cursorX, cursorY,oldCursorX,oldCursorY,underCursorBufferLen;
char* underCursorBuffer;
rfbBool dontConvertRichCursorToXCursor;
struct rfbCursor* cursor;
/* the frameBufferhas to be supplied by the serving process.
* The buffer will not be freed by
*/
char* frameBuffer;
rfbKbdAddEventProcPtr kbdAddEvent;
rfbKbdReleaseAllKeysProcPtr kbdReleaseAllKeys;
rfbPtrAddEventProcPtr ptrAddEvent;
rfbSetXCutTextProcPtr setXCutText;
rfbGetCursorProcPtr getCursorPtr;
rfbSetTranslateFunctionProcPtr setTranslateFunction;
/* newClientHook is called just after a new client is created */
rfbNewClientHookPtr newClientHook;
/* displayHook is called just before a frame buffer update */
rfbDisplayHookPtr displayHook;
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
MUTEX(cursorMutex);
rfbBool backgroundLoop;
#endif
/* if TRUE, an ignoring signal handler is installed for SIGPIPE */
rfbBool ignoreSIGPIPE;
/* if not zero, only a slice of this height is processed every time
* an update should be sent. This should make working on a slow
* link more interactive. */
int progressiveSliceHeight;
} rfbScreenInfo, *rfbScreenInfoPtr;
/*
* rfbTranslateFnType is the type of translation functions.
*/
typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
rfbPixelFormat *out,
char *iptr, char *optr,
int bytesBetweenInputLines,
int width, int height);
/* region stuff */
struct sraRegion;
typedef struct sraRegion* sraRegionPtr;
/*
* Per-client structure.
*/
typedef void (*ClientGoneHookPtr)(struct _rfbClientRec* cl);
typedef struct _rfbClientRec {
/* back pointer to the screen */
rfbScreenInfoPtr screen;
/* private data. You should put any application client specific data
* into a struct and let clientData point to it. Don't forget to
* free the struct via clientGoneHook!
*
* This is useful if the IO functions have to behave client specific.
*/
void* clientData;
ClientGoneHookPtr clientGoneHook;
SOCKET sock;
char *host;
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
pthread_t client_thread;
#endif
/* Possible client states: */
enum {
RFB_PROTOCOL_VERSION, /* establishing protocol version */
RFB_AUTHENTICATION, /* authenticating */
RFB_INITIALISATION, /* sending initialisation messages */
RFB_NORMAL /* normal protocol messages */
} state;
rfbBool reverseConnection;
rfbBool onHold;
rfbBool readyForSetColourMapEntries;
rfbBool useCopyRect;
int preferredEncoding;
int correMaxWidth, correMaxHeight;
rfbBool viewOnly;
/* The following member is only used during VNC authentication */
uint8_t authChallenge[CHALLENGESIZE];
/* The following members represent the update needed to get the client's
framebuffer from its present state to the current state of our
framebuffer.
If the client does not accept CopyRect encoding then the update is
simply represented as the region of the screen which has been modified
(modifiedRegion).
If the client does accept CopyRect encoding, then the update consists of
two parts. First we have a single copy from one region of the screen to
another (the destination of the copy is copyRegion), and second we have
the region of the screen which has been modified in some other way
(modifiedRegion).
Although the copy is of a single region, this region may have many
rectangles. When sending an update, the copyRegion is always sent
before the modifiedRegion. This is because the modifiedRegion may
overlap parts of the screen which are in the source of the copy.
In fact during normal processing, the modifiedRegion may even overlap
the destination copyRegion. Just before an update is sent we remove
from the copyRegion anything in the modifiedRegion. */
sraRegionPtr copyRegion; /* the destination region of the copy */
int copyDX, copyDY; /* the translation by which the copy happens */
sraRegionPtr modifiedRegion;
/* As part of the FramebufferUpdateRequest, a client can express interest
in a subrectangle of the whole framebuffer. This is stored in the
requestedRegion member. In the normal case this is the whole
framebuffer if the client is ready, empty if it's not. */
sraRegionPtr requestedRegion;
/* The following member represents the state of the "deferred update" timer
- when the framebuffer is modified and the client is ready, in most
cases it is more efficient to defer sending the update by a few
milliseconds so that several changes to the framebuffer can be combined
into a single update. */
struct timeval startDeferring;
/* translateFn points to the translation function which is used to copy
and translate a rectangle from the framebuffer to an output buffer. */
rfbTranslateFnType translateFn;
char *translateLookupTable;
rfbPixelFormat format;
/*
* UPDATE_BUF_SIZE must be big enough to send at least one whole line of the
* framebuffer. So for a max screen width of say 2K with 32-bit pixels this
* means 8K minimum.
*/
#define UPDATE_BUF_SIZE 30000
char updateBuf[UPDATE_BUF_SIZE];
int ublen;
/* statistics */
int bytesSent[MAX_ENCODINGS];
int rectanglesSent[MAX_ENCODINGS];
int lastRectMarkersSent;
int lastRectBytesSent;
int cursorShapeBytesSent;
int cursorShapeUpdatesSent;
int cursorPosBytesSent;
int cursorPosUpdatesSent;
int framebufferUpdateMessagesSent;
int rawBytesEquivalent;
int keyEventsRcvd;
int pointerEventsRcvd;
#ifdef LIBVNCSERVER_HAVE_LIBZ
/* zlib encoding -- necessary compression state info per client */
struct z_stream_s compStream;
rfbBool compStreamInited;
uint32_t zlibCompressLevel;
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight encoding -- preserve zlib streams' state for each client */
z_stream zsStruct[4];
rfbBool zsActive[4];
int zsLevel[4];
int tightCompressLevel;
int tightQualityLevel;
#endif
#endif
rfbBool enableLastRectEncoding; /* client supports LastRect encoding */
rfbBool enableCursorShapeUpdates; /* client supports cursor shape updates */
rfbBool enableCursorPosUpdates; /* client supports cursor position updates */
rfbBool useRichCursorEncoding; /* rfbEncodingRichCursor is preferred */
rfbBool cursorWasChanged; /* cursor shape update should be sent */
rfbBool cursorWasMoved; /* cursor position update should be sent */
rfbBool useNewFBSize; /* client supports NewFBSize encoding */
rfbBool newFBSizePending; /* framebuffer size was changed */
#ifdef LIBVNCSERVER_BACKCHANNEL
rfbBool enableBackChannel; /* custom channel for special clients */
#endif
struct _rfbClientRec *prev;
struct _rfbClientRec *next;
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
/* whenever a client is referenced, the refCount has to be incremented
and afterwards decremented, so that the client is not cleaned up
while being referenced.
Use the functions rfbIncrClientRef(cl) and rfbDecrClientRef(cl);
*/
int refCount;
MUTEX(refCountMutex);
COND(deleteCond);
MUTEX(outputMutex);
MUTEX(updateMutex);
COND(updateCond);
#endif
#ifdef LIBVNCSERVER_HAVE_LIBZ
void* zrleData;
#endif
/* if progressive updating is on, this variable holds the current
* y coordinate of the progressive slice. */
int progressiveSliceY;
} rfbClientRec, *rfbClientPtr;
/*
* This macro is used to test whether there is a framebuffer update needing to
* be sent to the client.
*/
#define FB_UPDATE_PENDING(cl) \
((!(cl)->enableCursorShapeUpdates && !(cl)->screen->cursorIsDrawn) || \
((cl)->enableCursorShapeUpdates && (cl)->cursorWasChanged) || \
((cl)->useNewFBSize && (cl)->newFBSizePending) || \
((cl)->enableCursorPosUpdates && (cl)->cursorWasMoved) || \
!sraRgnEmpty((cl)->copyRegion) || !sraRgnEmpty((cl)->modifiedRegion))
/*
* Macros for endian swapping.
*/
#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
#define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \
(((l) & 0x00ff00)))
#define Swap32(l) (((l) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
((l) << 24))
extern char rfbEndianTest;
#define Swap16IfLE(s) (rfbEndianTest ? Swap16(s) : (s))
#define Swap24IfLE(l) (rfbEndianTest ? Swap24(l) : (l))
#define Swap32IfLE(l) (rfbEndianTest ? Swap32(l) : (l))
/* sockets.c */
extern int rfbMaxClientWait;
extern void rfbInitSockets(rfbScreenInfoPtr rfbScreen);
extern void rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen);
extern void rfbCloseClient(rfbClientPtr cl);
extern int rfbReadExact(rfbClientPtr cl, char *buf, int len);
extern int rfbReadExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout);
extern int rfbWriteExact(rfbClientPtr cl, const char *buf, int len);
extern void rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec);
extern int rfbConnect(rfbScreenInfoPtr rfbScreen, char* host, int port);
extern int rfbConnectToTcpAddr(char* host, int port);
extern int rfbListenOnTCPPort(int port);
extern int rfbListenOnUDPPort(int port);
/* rfbserver.c */
/* Routines to iterate over the client list in a thread-safe way.
Only a single iterator can be in use at a time process-wide. */
typedef struct rfbClientIterator *rfbClientIteratorPtr;
extern void rfbClientListInit(rfbScreenInfoPtr rfbScreen);
extern rfbClientIteratorPtr rfbGetClientIterator(rfbScreenInfoPtr rfbScreen);
extern rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator);
extern void rfbReleaseClientIterator(rfbClientIteratorPtr iterator);
extern void rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,int sock);
extern rfbClientPtr rfbNewClient(rfbScreenInfoPtr rfbScreen,int sock);
extern rfbClientPtr rfbNewUDPClient(rfbScreenInfoPtr rfbScreen);
extern rfbClientPtr rfbReverseConnection(rfbScreenInfoPtr rfbScreen,char *host, int port);
extern void rfbClientConnectionGone(rfbClientPtr cl);
extern void rfbProcessClientMessage(rfbClientPtr cl);
extern void rfbClientConnFailed(rfbClientPtr cl, char *reason);
extern void rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,int sock);
extern void rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen);
extern rfbBool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion);
extern rfbBool rfbSendRectEncodingRaw(rfbClientPtr cl, int x,int y,int w,int h);
extern rfbBool rfbSendUpdateBuf(rfbClientPtr cl);
extern void rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len);
extern rfbBool rfbSendCopyRegion(rfbClientPtr cl,sraRegionPtr reg,int dx,int dy);
extern rfbBool rfbSendLastRectMarker(rfbClientPtr cl);
extern rfbBool rfbSendNewFBSize(rfbClientPtr cl, int w, int h);
extern rfbBool rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, int nColours);
extern void rfbSendBell(rfbScreenInfoPtr rfbScreen);
void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len);
#ifdef LIBVNCSERVER_BACKCHANNEL
extern void rfbSendBackChannel(rfbScreenInfoPtr s,char* message,int len);
#endif
/* translate.c */
extern rfbBool rfbEconomicTranslate;
extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
rfbPixelFormat *out,
char *iptr, char *optr,
int bytesBetweenInputLines,
int width, int height);
extern rfbBool rfbSetTranslateFunction(rfbClientPtr cl);
extern rfbBool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours);
extern void rfbSetClientColourMaps(rfbScreenInfoPtr rfbScreen, int firstColour, int nColours);
/* httpd.c */
extern void rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen);
extern void rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen);
/* auth.c */
extern void rfbAuthNewClient(rfbClientPtr cl);
extern void rfbAuthProcessClientMessage(rfbClientPtr cl);
/* rre.c */
extern rfbBool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h);
/* corre.c */
extern rfbBool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h);
/* hextile.c */
extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
int h);
#ifdef LIBVNCSERVER_HAVE_LIBZ
/* zlib.c */
/* Minimum zlib rectangle size in bytes. Anything smaller will
* not compress well due to overhead.
*/
#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)
/* Set maximum zlib rectangle size in pixels. Always allow at least
* two scan lines.
*/
#define ZLIB_MAX_RECT_SIZE (128*256)
#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \
( min * 2 ) : ZLIB_MAX_RECT_SIZE )
extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
int h);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight.c */
#define TIGHT_DEFAULT_COMPRESSION 6
extern rfbBool rfbTightDisableGradient;
extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h);
extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
#endif
#endif
/* cursor.c */
typedef struct rfbCursor {
/* set this to true if LibVNCServer has to free this cursor */
rfbBool cleanup, cleanupSource, cleanupMask, cleanupRichSource;
unsigned char *source; /* points to bits */
unsigned char *mask; /* points to bits */
unsigned short width, height, xhot, yhot; /* metrics */
unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */
unsigned short backRed, backGreen, backBlue; /* device-independent colour */
unsigned char *richSource; /* source bytes for a rich cursor */
} rfbCursor, *rfbCursorPtr;
extern unsigned char rfbReverseByte[0x100];
extern rfbBool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/);
extern rfbBool rfbSendCursorPos(rfbClientPtr cl);
extern void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap);
extern rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString);
extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
extern void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor);
extern void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor);
extern void rfbFreeCursor(rfbCursorPtr cursor);
extern void rfbDrawCursor(rfbScreenInfoPtr rfbScreen);
extern void rfbUndrawCursor(rfbScreenInfoPtr rfbScreen);
extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld);
/* cursor handling for the pointer */
extern void rfbDefaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
/* zrle.c */
#ifdef LIBVNCSERVER_HAVE_LIBZ
extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h);
extern void rfbFreeZrleData(rfbClientPtr cl);
#endif
/* stats.c */
extern void rfbResetStats(rfbClientPtr cl);
extern void rfbPrintStats(rfbClientPtr cl);
/* font.c */
typedef struct rfbFontData {
unsigned char* data;
/*
metaData is a 256*5 array:
for each character
(offset,width,height,x,y)
*/
int* metaData;
} rfbFontData,* rfbFontDataPtr;
int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,rfbPixel colour);
void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,rfbPixel colour);
/* if colour==backColour, background is transparent */
int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
int rfbWidthOfString(rfbFontDataPtr font,const char* string);
int rfbWidthOfChar(rfbFontDataPtr font,unsigned char c);
void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int* y2);
/* this returns the smallest box enclosing any character of font. */
void rfbWholeFontBBox(rfbFontDataPtr font,int *x1, int *y1, int *x2, int *y2);
/* dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16 */
rfbFontDataPtr rfbLoadConsoleFont(char *filename);
/* free a dynamically loaded font */
void rfbFreeFont(rfbFontDataPtr font);
/* draw.c */
/* You have to call rfbUndrawCursor before using these functions */
void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col);
void rfbDrawPixel(rfbScreenInfoPtr s,int x,int y,rfbPixel col);
void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col);
/* selbox.c */
/* this opens a modal select box. list is an array of strings, the end marked
with a NULL.
It returns the index in the list or -1 if cancelled or something else
wasn't kosher. */
typedef void (*SelectionChangedHookPtr)(int _index);
extern int rfbSelectBox(rfbScreenInfoPtr rfbScreen,
rfbFontDataPtr font, char** list,
int x1, int y1, int x2, int y2,
rfbPixel foreColour, rfbPixel backColour,
int border,SelectionChangedHookPtr selChangedHook);
/* cargs.c */
extern void rfbUsage(void);
extern void rfbPurgeArguments(int* argc,int* position,int count,char *argv[]);
extern rfbBool rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]);
extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[]);
/* main.c */
extern void rfbLogEnable(int enabled);
typedef void (*rfbLogProc)(const char *format, ...);
extern rfbLogProc rfbLog, rfbErr;
extern void rfbLogPerror(const char *str);
void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy);
void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy);
void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy);
void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy);
void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2);
void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion);
void rfbDoNothingWithClient(rfbClientPtr cl);
enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl);
/* to check against plain passwords */
rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len);
/* functions to make a vnc server */
extern rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
int width,int height,int bitsPerSample,int samplesPerPixel,
int bytesPerPixel);
extern void rfbInitServer(rfbScreenInfoPtr rfbScreen);
extern void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen,char *framebuffer,
int width,int height, int bitsPerSample,int samplesPerPixel,
int bytesPerPixel);
extern void rfbScreenCleanup(rfbScreenInfoPtr screenInfo);
/* functions to accept/refuse a client that has been put on hold
by a NewClientHookPtr function. Must not be called in other
situations. */
extern void rfbStartOnHoldClient(rfbClientPtr cl);
extern void rfbRefuseOnHoldClient(rfbClientPtr cl);
/* call one of these two functions to service the vnc clients.
usec are the microseconds the select on the fds waits.
if you are using the event loop, set this to some value > 0, so the
server doesn't get a high load just by listening. */
extern void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground);
extern void rfbProcessEvents(rfbScreenInfoPtr screenInfo,long usec);
#endif
#if(defined __cplusplus)
}
#endif

View File

@@ -1,204 +0,0 @@
#ifndef RFBCLIENT_H
#define RFBCLIENT_H
/*
* Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved.
* Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
* vncviewer.h
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <rfb/rfbproto.h>
#include <rfb/keysym.h>
#define rfbClientSwap16IfLE(s) \
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
#define rfbClientSwap32IfLE(l) \
(*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
(((l) & 0x000000ff) << 24)) : (l))
#define FLASH_PORT_OFFSET 5400
#define LISTEN_PORT_OFFSET 5500
#define TUNNEL_PORT_OFFSET 5500
#define SERVER_PORT_OFFSET 5900
#define DEFAULT_SSH_CMD "/usr/bin/ssh"
#define DEFAULT_TUNNEL_CMD \
(DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
#define DEFAULT_VIA_CMD \
(DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
/* vncrec */
typedef struct {
FILE* file;
struct timeval tv;
rfbBool readTimestamp;
rfbBool doNotSleep;
} rfbVNCRec;
typedef struct {
rfbBool shareDesktop;
rfbBool viewOnly;
const char* encodingsString;
rfbBool useBGR233;
int nColours;
rfbBool forceOwnCmap;
rfbBool forceTrueColour;
int requestedDepth;
int compressLevel;
int qualityLevel;
rfbBool enableJPEG;
rfbBool useRemoteCursor;
} AppData;
struct _rfbClient;
typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*BellProc)(struct _rfbClient* client);
typedef struct _rfbClient {
uint8_t* frameBuffer;
int width, height;
int endianTest;
AppData appData;
const char* programName;
char* serverHost;
int serverPort; /* if -1, then use file recorded by vncrec */
rfbBool listenSpecified;
int listenPort, flashPort;
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough
to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes.
Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.
Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */
#define RFB_BUFFER_SIZE (640*480)
char buffer[RFB_BUFFER_SIZE];
/* rfbproto.c */
int sock;
rfbBool canUseCoRRE;
rfbBool canUseHextile;
char *desktopName;
rfbPixelFormat format;
rfbServerInitMsg si;
char *serverCutText;
rfbBool newServerCutText;
/* sockets.c */
#define RFB_BUF_SIZE 8192
char buf[RFB_BUF_SIZE];
char *bufoutptr;
int buffered;
/* cursor.c */
uint8_t *rcSource, *rcMask;
/* private data pointer */
void* clientData;
rfbVNCRec* vncRec;
/* hooks */
HandleCursorPosProc HandleCursorPos;
SoftCursorLockAreaProc SoftCursorLockArea;
SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
GotFrameBufferUpdateProc GotFrameBufferUpdate;
/* the pointer returned by GetPassword will be freed after use! */
GetPasswordProc GetPassword;
MallocFrameBufferProc MallocFrameBuffer;
BellProc Bell;
} rfbClient;
/* cursor.c */
extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
/* listen.c */
extern void listenForIncomingConnections(rfbClient* viewer);
/* rfbproto.c */
extern rfbBool rfbEnableClientLogging;
typedef void (*rfbClientLogProc)(const char *format, ...);
extern rfbClientLogProc rfbClientLog,rfbClientErr;
extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
extern rfbBool InitialiseRFBConnection(rfbClient* client);
extern rfbBool SetFormatAndEncodings(rfbClient* client);
extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
extern rfbBool SendFramebufferUpdateRequest(rfbClient* client,
int x, int y, int w, int h,
rfbBool incremental);
extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask);
extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down);
extern rfbBool SendClientCutText(rfbClient* client,char *str, int len);
extern rfbBool HandleRFBServerMessage(rfbClient* client);
extern void PrintPixelFormat(rfbPixelFormat *format);
/* sockets.c */
extern rfbBool errorMessageOnReadFailure;
extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n);
extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port);
extern int ConnectClientToTcpAddr(unsigned int host, int port);
extern int AcceptTcpConnection(int listenSock);
extern rfbBool SetNonBlocking(int sock);
extern rfbBool StringToIPAddr(const char *str, unsigned int *addr);
extern rfbBool SameMachine(int sock);
extern int WaitForMessage(rfbClient* client,unsigned int usecs);
/* vncviewer.c */
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
void rfbClientCleanup(rfbClient* client);
#endif

View File

@@ -1,344 +0,0 @@
#ifndef _RFB_RFBCONFIG_H
# define _RFB_RFBCONFIG_H
/* Enable 24 bit per pixel in native framebuffer */
#ifndef LIBVNCSERVER_ALLOW24BPP
# define LIBVNCSERVER_ALLOW24BPP 1
#endif
/* Enable BackChannel communication */
#ifndef LIBVNCSERVER_BACKCHANNEL
# define LIBVNCSERVER_BACKCHANNEL 1
#endif
/* Use ffmpeg (for vnc2mpg) */
/* #undef LIBVNCSERVER_FFMPEG */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#ifndef LIBVNCSERVER_HAVE_ARPA_INET_H
# define LIBVNCSERVER_HAVE_ARPA_INET_H 1
#endif
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef LIBVNCSERVER_HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#ifndef LIBVNCSERVER_HAVE_FCNTL_H
# define LIBVNCSERVER_HAVE_FCNTL_H 1
#endif
/* Define to 1 if you have the `fork' function. */
/* #undef LIBVNCSERVER_HAVE_FORK */
/* Define to 1 if you have the `ftime' function. */
#ifndef LIBVNCSERVER_HAVE_FTIME
#define LIBVNCSERVER_HAVE_FTIME 1
#endif
/* Define to 1 if you have the `gethostbyname' function. */
#ifndef LIBVNCSERVER_HAVE_GETHOSTBYNAME
#define LIBVNCSERVER_HAVE_GETHOSTBYNAME 1
#endif
/* Define to 1 if you have the `gethostname' function. */
#ifndef LIBVNCSERVER_HAVE_GETHOSTNAME
#define LIBVNCSERVER_HAVE_GETHOSTNAME 1
#endif
/* Define to 1 if you have the `gettimeofday' function. */
#ifndef LIBVNCSERVER_HAVE_GETTIMEOFDAY
#define LIBVNCSERVER_HAVE_GETTIMEOFDAY 1
#endif
/* Define to 1 if you have the `inet_ntoa' function. */
#ifndef LIBVNCSERVER_HAVE_INET_NTOA
#define LIBVNCSERVER_HAVE_INET_NTOA 1
#endif
/* Define to 1 if you have the <inttypes.h> header file. */
#ifndef LIBVNCSERVER_HAVE_INTTYPES_H
#define LIBVNCSERVER_HAVE_INTTYPES_H 1
#endif
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
/* #undef LIBVNCSERVER_HAVE_LIBJPEG */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef LIBVNCSERVER_HAVE_LIBNSL */
/* Define to 1 if you have the `pthread' library (-lpthread). */
#ifndef LIBVNCSERVER_HAVE_LIBPTHREAD
#ifndef _WIN32
# define LIBVNCSERVER_HAVE_LIBPTHREAD 1
#endif
#endif
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef LIBVNCSERVER_HAVE_LIBSOCKET */
/* Define to 1 if you have the `z' library (-lz). */
#ifndef LIBVNCSERVER_HAVE_LIBZ
#define LIBVNCSERVER_HAVE_LIBZ 1
#endif
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#ifndef LIBVNCSERVER_HAVE_MALLOC
#define LIBVNCSERVER_HAVE_MALLOC 1
#endif
/* Define to 1 if you have the `memmove' function. */
#ifndef LIBVNCSERVER_HAVE_MEMMOVE
#define LIBVNCSERVER_HAVE_MEMMOVE 1
#endif
/* Define to 1 if you have the <memory.h> header file. */
#ifndef LIBVNCSERVER_HAVE_MEMORY_H
#define LIBVNCSERVER_HAVE_MEMORY_H 1
#endif
/* Define to 1 if you have the `memset' function. */
#ifndef LIBVNCSERVER_HAVE_MEMSET
#define LIBVNCSERVER_HAVE_MEMSET 1
#endif
/* Define to 1 if you have the `mkfifo' function. */
/* #unndef LIBVNCSERVER_HAVE_MKFIFO */
/* Define to 1 if you have the <netdb.h> header file. */
#ifndef LIBVNCSERVER_HAVE_NETDB_H
#define LIBVNCSERVER_HAVE_NETDB_H 1
#endif
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef LIBVNCSERVER_HAVE_NETINET_IN_H */
/* Define to 1 if you have the `select' function. */
#ifndef LIBVNCSERVER_HAVE_SELECT
#define LIBVNCSERVER_HAVE_SELECT 1
#endif
/* Define to 1 if you have the `setsid' function. */
/* #undef LIBVNCSERVER_HAVE_SETSID */
/* Define to 1 if you have the `socket' function. */
#ifndef LIBVNCSERVER_HAVE_SOCKET
#define LIBVNCSERVER_HAVE_SOCKET 1
#endif
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
/* #undef LIBVNCSERVER_HAVE_STAT_EMPTY_STRING_BUG */
/* Define to 1 if you have the <stdint.h> header file. */
#ifndef LIBVNCSERVER_HAVE_STDINT_H
#define LIBVNCSERVER_HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#ifndef LIBVNCSERVER_HAVE_STDLIB_H
#define LIBVNCSERVER_HAVE_STDLIB_H 1
#endif
/* Define to 1 if you have the `strchr' function. */
#ifndef LIBVNCSERVER_HAVE_STRCHR
#define LIBVNCSERVER_HAVE_STRCHR 1
#endif
/* Define to 1 if you have the `strcspn' function. */
#ifndef LIBVNCSERVER_HAVE_STRCSPN
#define LIBVNCSERVER_HAVE_STRCSPN 1
#endif
/* Define to 1 if you have the `strdup' function. */
#ifndef LIBVNCSERVER_HAVE_STRDUP
#define LIBVNCSERVER_HAVE_STRDUP 1
#endif
/* Define to 1 if you have the `strerror' function. */
#ifndef LIBVNCSERVER_HAVE_STRERROR
#define LIBVNCSERVER_HAVE_STRERROR 1
#endif
/* Define to 1 if you have the `strftime' function. */
#ifndef LIBVNCSERVER_HAVE_STRFTIME
#define LIBVNCSERVER_HAVE_STRFTIME 1
#endif
/* Define to 1 if you have the <strings.h> header file. */
#ifndef LIBVNCSERVER_HAVE_STRINGS_H
#define LIBVNCSERVER_HAVE_STRINGS_H 1
#endif
/* Define to 1 if you have the <string.h> header file. */
#ifndef LIBVNCSERVER_HAVE_STRING_H
#define LIBVNCSERVER_HAVE_STRING_H 1
#endif
/* Define to 1 if you have the `strstr' function. */
#ifndef LIBVNCSERVER_HAVE_STRSTR
#define LIBVNCSERVER_HAVE_STRSTR 1
#endif
/* Define to 1 if you have the <syslog.h> header file. */
/* #undef LIBVNCSERVER_HAVE_SYSLOG_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef LIBVNCSERVER_HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef LIBVNCSERVER_HAVE_SYS_STAT_H
#define LIBVNCSERVER_HAVE_SYS_STAT_H 1
#endif
/* Define to 1 if you have the <sys/timeb.h> header file. */
#ifndef LIBVNCSERVER_HAVE_SYS_TIMEB_H
#define LIBVNCSERVER_HAVE_SYS_TIMEB_H 1
#endif
/* Define to 1 if you have the <sys/time.h> header file. */
#ifndef LIBVNCSERVER_HAVE_SYS_TIME_H
#define LIBVNCSERVER_HAVE_SYS_TIME_H 1
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
#ifndef LIBVNCSERVER_HAVE_SYS_TYPES_H
#define LIBVNCSERVER_HAVE_SYS_TYPES_H 1
#endif
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#ifndef LIBVNCSERVER_HAVE_SYS_WAIT_H
#define LIBVNCSERVER_HAVE_SYS_WAIT_H 1
#endif
/* Define to 1 if you have the <unistd.h> header file. */
#ifndef LIBVNCSERVER_HAVE_UNISTD_H
#define LIBVNCSERVER_HAVE_UNISTD_H 1
#endif
/* Define to 1 if you have the `vfork' function. */
/* #undef LIBVNCSERVER_HAVE_VFORK */
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef LIBVNCSERVER_HAVE_VFORK_H */
/* Define to 1 if you have the `vprintf' function. */
#ifndef LIBVNCSERVER_HAVE_VPRINTF
#define LIBVNCSERVER_HAVE_VPRINTF 1
#endif
/* Define to 1 if `fork' works. */
/* #undef LIBVNCSERVER_HAVE_WORKING_FORK */
/* Define to 1 if `vfork' works. */
/* #undef LIBVNCSERVER_HAVE_WORKING_VFORK */
/* XKEYBOARD extension build environment present */
/* #undef LIBVNCSERVER_HAVE_XKEYBOARD */
/* MIT-SHM extension build environment present */
/* #undef LIBVNCSERVER_HAVE_XSHM */
/* XTEST extension build environment present */
/* #undef LIBVNCSERVER_HAVE_XTEST */
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
/* #undef LIBVNCSERVER_LSTAT_FOLLOWS_SLASHED_SYMLINK */
/* Name of package */
#ifndef LIBVNCSERVER_PACKAGE
#define LIBVNCSERVER_PACKAGE "LibVNCServer"
#endif
/* Define to the address where bug reports for this package should be sent. */
#ifndef LIBVNCSERVER_PACKAGE_BUGREPORT
#define LIBVNCSERVER_PACKAGE_BUGREPORT "http://sourceforge.net/projects/libvncserver"
#endif
/* Define to the full name of this package. */
#ifndef LIBVNCSERVER_PACKAGE_NAME
#define LIBVNCSERVER_PACKAGE_NAME "LibVNCServer"
#endif
/* Define to the full name and version of this package. */
#ifndef LIBVNCSERVER_PACKAGE_STRING
#define LIBVNCSERVER_PACKAGE_STRING "LibVNCServer 0.7"
#endif
/* Define to the one symbol short name of this package. */
#ifndef LIBVNCSERVER_PACKAGE_TARNAME
#define LIBVNCSERVER_PACKAGE_TARNAME "libvncserver"
#endif
/* Define to the version of this package. */
#ifndef LIBVNCSERVER_PACKAGE_VERSION
#define LIBVNCSERVER_PACKAGE_VERSION "0.7"
#endif
/* The number of bytes in type char */
/* #undef LIBVNCSERVER_SIZEOF_CHAR */
/* The number of bytes in type int */
/* #undef LIBVNCSERVER_SIZEOF_INT */
/* The number of bytes in type long */
/* #undef LIBVNCSERVER_SIZEOF_LONG */
/* The number of bytes in type short */
/* #undef LIBVNCSERVER_SIZEOF_SHORT */
/* The number of bytes in type void* */
/* #undef LIBVNCSERVER_SIZEOF_VOIDP */
/* Define to 1 if you have the ANSI C header files. */
#ifndef LIBVNCSERVER_STDC_HEADERS
#define LIBVNCSERVER_STDC_HEADERS 1
#endif
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#ifndef LIBVNCSERVER_TIME_WITH_SYS_TIME
#define LIBVNCSERVER_TIME_WITH_SYS_TIME 1
#endif
/* Version number of package */
#ifndef LIBVNCSERVER_VERSION
#define LIBVNCSERVER_VERSION "0.7"
#endif
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef LIBVNCSERVER_WORDS_BIGENDIAN */
/* Define to 1 if the X Window System is missing or not being used. */
#ifndef LIBVNCSERVER_X_DISPLAY_MISSING
#define LIBVNCSERVER_X_DISPLAY_MISSING 1
#endif
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef _libvncserver_const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef _libvncserver_inline */
#endif
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef _libvncserver_malloc */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef _libvncserver_pid_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef _libvncserver_size_t */
/* The type for socklen */
/* #undef _libvncserver_socklen_t */
/* Define as `fork' if `vfork' does not work. */
/* #undef _libvncserver_vfork */
/* once: _RFB_RFBCONFIG_H */
#endif

View File

@@ -1,17 +0,0 @@
#ifndef _RFB_RFBINT_H
#define _RFB_RFBINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "LibVNCServer 0.7"
/* generated using a gnu compiler version gcc (Debian 4.9.2-10) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
#include <stdint.h>
/* system headers have good uint64_t */
#ifndef _HAVE_UINT64_T
#define _HAVE_UINT64_T
#endif
/* once */
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,62 +0,0 @@
#ifndef SRAREGION_H
#define SRAREGION_H
/* -=- SRA - Simple Region Algorithm
* A simple rectangular region implementation.
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
*/
/* -=- sraRect */
typedef struct _rect {
int x1;
int y1;
int x2;
int y2;
} sraRect;
typedef struct sraRegion sraRegion;
/* -=- Region manipulation functions */
extern sraRegion *sraRgnCreate();
extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
extern void sraRgnDestroy(sraRegion *rgn);
extern void sraRgnMakeEmpty(sraRegion *rgn);
extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src);
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect,
unsigned long flags);
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
extern rfbBool sraRgnEmpty(const sraRegion *rgn);
extern sraRegion *sraRgnBBox(const sraRegion *src);
/* -=- rectangle iterator */
typedef struct sraRectangleIterator {
rfbBool reverseX,reverseY;
int ptrSize,ptrPos;
struct sraSpan** sPtrs;
} sraRectangleIterator;
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY);
extern rfbBool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
void sraRgnPrint(const sraRegion *s);
/* -=- Rectangle clipper (for speed) */
extern rfbBool sraClipRect(int *x, int *y, int *w, int *h,
int cx, int cy, int cw, int ch);
#endif

View File

@@ -8,7 +8,7 @@
#
# Makefile for Windows using Visual Studio 2015.
#
# Version: @(#)Makefile.VC 1.0.30 2018/05/10
# Version: @(#)Makefile.VC 1.0.32 2018/05/13
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
@@ -383,9 +383,9 @@ ifneq ($(VNC), n)
ifneq ($(VNC_PATH), )
OPTS += -I$(VNC_PATH)/include/msvc -I$(VNC_PATH)/include
ifeq ($(X64), y)
LOPTS += LIBPATH:$(VNC_PATH)\lib\x64
LOPTS += -LIBPATH:$(VNC_PATH)\lib\x64
else
LOPTS += LIBPATH:$(VNC_PATH)\lib\x86
LOPTS += -LIBPATH:$(VNC_PATH)\lib\x86
endif
endif
ifeq ($(VNC), y)
@@ -401,9 +401,9 @@ ifneq ($(RDP), n)
ifneq ($(RDP_PATH), )
OPTS += -I$(RDP_PATH)/include/msvc -I$(RDP_PATH)/include
ifeq ($(X64), y)
LOPTS += LIBPATH:$(RDP_PATH)\lib\x64
LOPTS += -LIBPATH:$(RDP_PATH)\lib\x64
else
LOPTS += LIBPATH:$(RDP_PATH)\lib\x86
LOPTS += -LIBPATH:$(RDP_PATH)\lib\x86
endif
endif
ifeq ($(RDP), y)
@@ -419,13 +419,13 @@ ifneq ($(PNG), n)
ifneq ($(PNG_PATH), )
OPTS += -I$(PNG_PATH)/include/msvc -I$(PNG_PATH)/include
ifeq ($(X64), y)
LOPTS += LIBPATH:$(PNG_PATH)\lib\x64
LOPTS += -LIBPATH:$(PNG_PATH)\lib\x64
else
LOPTS += LIBPATH:$(PNG_PATH)\lib\x86
LOPTS += -LIBPATH:$(PNG_PATH)\lib\x86
endif
endif
ifeq ($(RDP), y)
LIBS += libpng16.lib zlib.lib
ifeq ($(PNG), y)
LIBS += libpng16_dll.lib #zlib.lib
endif
endif
@@ -439,7 +439,7 @@ else
win_ddraw.obj win_d3d.obj $(SDLOBJ) \
win_dialog.obj win_about.obj win_status.obj \
win_settings.obj win_devconf.obj win_snd_gain.obj \
win_new_floppy.obj
win_new_image.obj
endif
@@ -506,7 +506,7 @@ MAINOBJ := pc.obj config.obj misc.obj random.obj timer.obj io.obj \
mem.obj rom.obj rom_load.obj device.obj nvr.obj \
$(VNCOBJ) $(RDPOBJ)
UIOBJ += ui_main.obj ui_new_floppy.obj ui_stbar.obj ui_vidapi.obj
UIOBJ += ui_main.obj ui_new_image.obj ui_stbar.obj ui_vidapi.obj
SYSOBJ := dma.obj nmi.obj pic.obj pit.obj ppi.obj pci.obj mca.obj \
mcr.obj memregs.obj nvr_at.obj nvr_ps2.obj

View File

@@ -8,7 +8,7 @@
*
* Rendering module for Microsoft DirectDraw 9.
*
* Version: @(#)win_ddraw.cpp 1.0.9 2018/05/09
* Version: @(#)win_ddraw.cpp 1.0.10 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -215,7 +215,6 @@ static void
SavePNG(const wchar_t *fn, HBITMAP hBitmap)
{
WCHAR temp[512];
BITMAPFILEHEADER bmpFileHeader;
BITMAPINFO bmpInfo;
HDC hdc;
LPVOID pBuf = NULL;
@@ -381,6 +380,7 @@ SaveBMP(const wchar_t *fn, HBITMAP hBitmap)
GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS);
if ((fp = _wfopen(fn, L"wb")) == NULL) {
pclog("[SaveBMP] File %ls could not be opened for writing!\n", fn);
_swprintf(temp, get_string(IDS_2088), fn);
ui_msgbox(MBX_ERROR, temp);
break;

View File

@@ -6,9 +6,9 @@
*
* This file is part of the VARCem Project.
*
* Implementation of the New Floppy Image dialog.
* Implementation of the New Floppy/ZIP Image dialog.
*
* Version: @(#)win_new_floppy.c 1.0.15 2018/05/11
* Version: @(#)win_new_image.c 1.0.16 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -52,7 +52,7 @@
static wchar_t fd_file_name[512];
static int is_zip;
static int fdd_id, sb_part;
static int drive_id, sb_part;
static int file_type = 0; /* 0 = IMG, 1 = Japanese FDI, 2 = 86F */
@@ -82,7 +82,7 @@ dlg_init(HWND hdlg)
h = GetDlgItem(hdlg, IDC_COMBO_DISK_SIZE);
if (is_zip) {
zip_types = zip_drives[fdd_id].is_250 ? 2 : 1;
zip_types = zip_drives[drive_id].is_250 ? 2 : 1;
for (i = 0; i < zip_types; i++)
SendMessage(h, CB_ADDSTRING, 0,
(LPARAM)get_string(IDS_5900 + i));
@@ -162,13 +162,13 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
if (is_zip)
ret = zip_create_image(fd_file_name, disk_size, file_type);
else
ret = floppy_create_image(fd_file_name, disk_size, 0, file_type);
ret = floppy_create_image(fd_file_name, disk_size, file_type);
}
if (ret) {
if (is_zip)
ui_sb_mount_zip(fdd_id, sb_part, 0, fd_file_name);
ui_sb_mount_zip(drive_id, sb_part, 0, fd_file_name);
else
ui_sb_mount_floppy(fdd_id, sb_part, 0, fd_file_name);
ui_sb_mount_floppy(drive_id, sb_part, 0, fd_file_name);
} else {
msg_box(hdlg, MBX_ERROR, (wchar_t *)IDS_4108);
plat_pause(0);
@@ -201,14 +201,17 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
f = _wfopen(temp_path, L"rb");
if (f != NULL) {
fclose(f);
if (msg_box(hdlg, MBX_QUESTION, (wchar_t *)IDS_4111) != 0) /* yes */
if (msg_box(hdlg, MBX_QUESTION, (wchar_t *)IDS_4111) != 0) /* yes */ {
pclog("SELECT: != 0 (NO)\n");
return FALSE;
}
}
pclog("SELECT: YES\n");
SendMessage(h, WM_SETTEXT, 0, (LPARAM)temp_path);
memset(fd_file_name, 0x00, sizeof(fd_file_name));
wcscpy(fd_file_name, temp_path);
h = GetDlgItem(hdlg, IDC_COMBO_DISK_SIZE);
if (!is_zip || zip_drives[fdd_id].is_250)
if (!is_zip || zip_drives[drive_id].is_250)
EnableWindow(h, TRUE);
wcs_len = wcslen(temp_path);
ext_offs = wcs_len - 4;
@@ -244,6 +247,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
}
h = GetDlgItem(hdlg, IDOK);
EnableWindow(h, TRUE);
break;
return TRUE;
} else
return FALSE;
@@ -259,11 +263,11 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
void
dlg_new_floppy(int idm, int tag)
dlg_new_image(int drive, int part, int zip)
{
is_zip = !!(idm & 0x80);
fdd_id = idm & 0x7f;
sb_part = tag;
is_zip = zip;
drive_id = drive;
sb_part = part;
DialogBox(hInstance, (LPCTSTR)DLG_NEW_FLOPPY, hwndMain, dlg_proc);
}

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Settings dialog.
*
* Version: @(#)win_settings_sound.h 1.0.7 2018/05/02
* Version: @(#)win_settings_sound.h 1.0.8 2018/05/13
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -42,8 +42,12 @@
* *
************************************************************************/
static int sound_to_list[20], list_to_sound[20];
static int midi_to_list[20], list_to_midi[20];
#define NUM_SOUND 32
#define NUM_MIDI 16
static int sound_to_list[NUM_SOUND], list_to_sound[NUM_SOUND];
static int midi_to_list[NUM_MIDI], list_to_midi[NUM_MIDI];
static int
@@ -97,6 +101,7 @@ sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_INITDIALOG:
pclog("SND: temp_sound = %d\n", temp_sound_card);
h = GetDlgItem(hdlg, IDC_COMBO_SOUND);
c = d = 0;
while (1) {
@@ -113,6 +118,7 @@ sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
list_to_sound[d] = c;
d++;
pclog("SND: list[%d] = %d (%s)\n", d, c, stransi);
}
}
@@ -239,6 +245,7 @@ sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SAVESETTINGS:
h = GetDlgItem(hdlg, IDC_COMBO_SOUND);
temp_sound_card = list_to_sound[SendMessage(h, CB_GETCURSEL, 0, 0)];
pclog("SND SAVE: temp_sound_card = %d (%d)\n", temp_sound_card, list_to_sound[SendMessage(h, CB_GETCURSEL, 0, 0)]);
h = GetDlgItem(hdlg, IDC_COMBO_MIDI);
temp_midi_device = list_to_midi[SendMessage(h, CB_GETCURSEL, 0, 0)];