Commit a3e36635 authored by mtufan's avatar mtufan

puae 2.3.2

parent 65adf22f
......@@ -21,6 +21,8 @@
#include "savestate.h"
#include "autoconf.h"
#define DUMPPACKET 0
int log_a2065 = 0;
static int log_transmit = 1;
static int log_receive = 1;
......@@ -133,7 +135,8 @@ void a2065_reset (void)
td = NULL;
}
static void dumppacket (TCHAR *n, uae_u8 *packet, int len)
#if DUMPPACKET
static void dumppacket (const TCHAR *n, uae_u8 *packet, int len)
{
int i;
TCHAR buf[10000];
......@@ -145,6 +148,7 @@ static void dumppacket (TCHAR *n, uae_u8 *packet, int len)
write_log (buf);
write_log ("\n\n");
}
#endif
#define MAX_PACKET_SIZE 4000
static uae_u8 transmitbuffer[MAX_PACKET_SIZE];
......@@ -173,9 +177,11 @@ static int mungepacket (uae_u8 *packet, int len)
uae_u16 type;
int ret = 0;
if (len < 60)
if (len < 20)
return 0;
//dumppacket ("pre:", packet, len);
#if DUMPPACKET
dumppacket ("pre:", packet, len);
#endif
data = packet + 14;
type = (packet[12] << 8) | packet[13];
// switch destination mac
......@@ -227,7 +233,9 @@ static int mungepacket (uae_u8 *packet, int len)
// this all just to translate single DHCP MAC..
}
}
//dumppacket ("post:", packet, len);
#if DUMPPACKET
dumppacket ("post:", packet, len);
#endif
return ret;
}
......@@ -260,7 +268,7 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len)
if (!(csr[0] & CSR0_RXON)) // receiver off?
return;
if (len < 60) { // too short
if (len < 20) { // too short
if (log_a2065)
write_log ("A2065: short frame, %d bytes\n", len);
return;
......
......@@ -68,6 +68,8 @@ typedef voidp unzFile;
#endif
#define ZIP_BZIP2 12
#define UNZ_OK (0)
#define UNZ_END_OF_LIST_OF_FILE (-100)
#define UNZ_ERRNO (Z_ERRNO)
......
......@@ -204,7 +204,7 @@ void audio_sampleripper (int mode)
while (rs) {
if (rs->changed) {
rs->changed = 0;
fetch_ripperpath (path, sizeof (path));
fetch_ripperpath (path, sizeof (path) / sizeof (TCHAR));
name[0] = 0;
if (currprefs.floppyslots[0].dfxtype >= 0)
_tcscpy (name, currprefs.floppyslots[0].df);
......
......@@ -540,7 +540,7 @@ static void *cdda_play_func (void *v)
cdu->cd_last_pos = cdda_pos;
bufon[bufnum] = 1;
cda->setvolume (currprefs.sound_volume, cdu->cdda_volume[0], cdu->cdda_volume[1]);
cda->setvolume (currprefs.sound_volume_cd >= 0 ? currprefs.sound_volume_cd : currprefs.sound_volume, cdu->cdda_volume[0], cdu->cdda_volume[1]);
if (!cda->play (bufnum)) {
setstate (cdu, AUDIO_STATUS_PLAY_ERROR);
goto end;
......
......@@ -1137,7 +1137,7 @@ void CDTV_hsync_handler (void)
}
static int subchannelcounter;
int cntmax = maxvpos * vblank_hz / 75 - 6;
int cntmax = (int)(maxvpos * vblank_hz / 75 - 6);
if (subchannelcounter > 0)
subchannelcounter--;
if (subchannelcounter <= 0) {
......
......@@ -250,6 +250,25 @@ TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *f
return my_strdup (file);
}
static TCHAR *cfgfile_subst_path_load (const TCHAR *path, struct multipath *mp, const TCHAR *file, bool dir)
{
unsigned int i;
for (i = 0; i < MAX_PATHS; i++) {
if (mp->path[i][0] && _tcscmp (mp->path[i], ".\\") != 0 && _tcscmp (mp->path[i], "./") != 0) {
TCHAR *s = cfgfile_subst_path (path, mp->path[i], file);
if (dir) {
if (my_existsdir (s))
return s;
} else {
if (zfile_exists (s))
return s;
}
xfree (s);
}
}
return cfgfile_subst_path (path, mp->path[0], file);
}
static int isdefault (const TCHAR *s)
{
TCHAR tmp[MAX_DPATH];
......@@ -513,6 +532,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
cfgfile_write (f, "config_version", "%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV);
cfgfile_write_str (f, "config_hardware_path", p->config_hardware_path);
cfgfile_write_str (f, "config_host_path", p->config_host_path);
cfgfile_write_str (f, "config_window_title", p->config_window_title);
for (sl = p->all_lines; sl; sl = sl->next) {
if (sl->unknown) {
......@@ -644,6 +664,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
cfgfile_write_bool (f, "serial_on_demand", p->serial_demand);
cfgfile_write_bool (f, "serial_hardware_ctsrts", p->serial_hwctsrts);
cfgfile_write_bool (f, "serial_direct", p->serial_direct);
cfgfile_dwrite (f, "serial_stopbits", "%d", p->serial_stopbits);
cfgfile_write_str (f, "scsi", scsimode[p->scsi]);
cfgfile_write_bool (f, "uaeserial", p->uaeserial);
cfgfile_write_bool (f, "sana2", p->sana2);
......@@ -826,6 +847,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
#endif
cfgfile_write_bool (f, "immediate_blits", p->immediate_blits);
cfgfile_write_bool (f, "waiting_blits", p->waiting_blits);
cfgfile_write_bool (f, "ntsc", p->ntscmode);
cfgfile_write_bool (f, "genlock", p->genlock);
cfgfile_dwrite_bool (f, "show_leds", !!(p->leds_on_screen & STATUSLINE_CHIPSET));
......@@ -1413,6 +1435,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
||
#endif
cfgfile_string (option, value, "gfx_display_name", p->gfx_display_name, sizeof p->gfx_display_name / sizeof (TCHAR))
|| cfgfile_string (option, value, "config_window_title", p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR))
|| cfgfile_string (option, value, "config_info", p->info, sizeof p->info / sizeof (TCHAR))
|| cfgfile_string (option, value, "config_description", p->description, sizeof p->description / sizeof (TCHAR)))
return 1;
......@@ -1593,7 +1616,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
tmpp = _tcschr (tmpp2, ',');
tmpp++;
wh[i].width = _tstol (tmpp);
while (*tmpp != ',' && *tmpp != 'x')
while (*tmpp != ',' && *tmpp != 'x' && *tmpp != '*')
tmpp++;
wh[i].height = _tstol (tmpp + 1);
tmpp2 = tmpp;
......@@ -1710,7 +1733,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
return 1;
}
if (cfgfile_string (option, value, "config_version", tmpbuf, sizeof (tmpbuf) / sizeof (char))) {
if (cfgfile_string (option, value, "config_version", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) {
TCHAR *tmpp2;
tmpp = _tcschr (value, '.');
if (tmpp) {
......@@ -1971,6 +1994,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
return 1;
if (cfgfile_yesno (option, value, "immediate_blits", &p->immediate_blits)
|| cfgfile_yesno (option, value, "waiting_blits", &p->waiting_blits)
|| cfgfile_yesno (option, value, "cd32cd", &p->cs_cd32cd)
|| cfgfile_yesno (option, value, "cd32c2p", &p->cs_cd32c2p)
|| cfgfile_yesno (option, value, "cd32nvram", &p->cs_cd32nvram)
......@@ -2020,7 +2044,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
|| cfgfile_yesno (option, value, "uaeserial", &p->uaeserial))
return 1;
if (cfgfile_intval (option, value, "cpu060_revision", &p->cpu060_revision, 1)
if (cfgfile_intval (option, value, "serial_stopbits", &p->serial_stopbits, 1)
|| cfgfile_intval (option, value, "cpu060_revision", &p->cpu060_revision, 1)
|| cfgfile_intval (option, value, "fpu_revision", &p->fpu_revision, 1)
|| cfgfile_intval (option, value, "cdtvramcard", &p->cs_cdtvcard, 1)
|| cfgfile_intval (option, value, "fatgary", &p->cs_fatgaryrev, 1)
......@@ -2079,13 +2104,16 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
|| cfgfile_strval (option, value, "parallel_matrix_emulation", &p->parallel_matrix_emulation, epsonprinter, 0))
return 1;
if (cfgfile_string (option, value, "kickstart_rom_file", p->romfile, sizeof p->romfile / sizeof (char))
|| cfgfile_string (option, value, "kickstart_ext_rom_file", p->romextfile, sizeof p->romextfile / sizeof (char))
|| cfgfile_string (option, value, "amax_rom_file", p->amaxromfile, sizeof p->amaxromfile / sizeof (char))
|| cfgfile_string (option, value, "flash_file", p->flashfile, sizeof p->flashfile / sizeof (char))
|| cfgfile_string (option, value, "cart_file", p->cartfile, sizeof p->cartfile / sizeof (char))
|| cfgfile_string (option, value, "pci_devices", p->pci_devices, sizeof p->pci_devices / sizeof (char))
|| cfgfile_string (option, value, "ghostscript_parameters", p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (char)))
if (cfgfile_string (option, value, "kickstart_rom_file", p->romfile, sizeof p->romfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "kickstart_ext_rom_file", p->romextfile, sizeof p->romextfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "kickstart_ext_rom_file2", p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR))
|| cfgfile_string (option, value, "kickstart_rom_file_id", p->romfile, sizeof p->romfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "kickstart_ext_rom_file_id", p->romextfile, sizeof p->romextfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "amax_rom_file", p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "flash_file", p->flashfile, sizeof p->flashfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "cart_file", p->cartfile, sizeof p->cartfile / sizeof (TCHAR))
|| cfgfile_string (option, value, "pci_devices", p->pci_devices, sizeof p->pci_devices / sizeof (TCHAR))
|| cfgfile_string (option, value, "ghostscript_parameters", p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (TCHAR)))
return 1;
if (cfgfile_strval (option, value, "cart_internal", &p->cart_internal, cartsmode, 0)) {
......@@ -2286,7 +2314,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
root = value;
aname = 0;
}
str = cfgfile_subst_path (UNEXPANDED, p->path_hardfile.path[0], root);
str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, true);
#ifdef FILESYS
add_filesys_config (p, -1, NULL, aname, str, ro, secs, heads, reserved, bs, 0, NULL, 0, 0);
#endif
......@@ -2381,7 +2409,7 @@ empty_fs:
root += 2;
*root = ':';
}
str = cfgfile_subst_path (UNEXPANDED, p->path_hardfile.path[0], root);
str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, false);
}
#ifdef FILESYS
add_filesys_config (p, -1, dname, aname, str, ro, secs, heads, reserved, bs, bp, fs, hdcv, 0);
......@@ -2668,6 +2696,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
cfgfile_string (line1b, line2b, "config_description", p->description, sizeof p->description / sizeof (TCHAR));
cfgfile_path (line1b, line2b, "config_hardware_path", p->config_hardware_path, sizeof p->config_hardware_path / sizeof (TCHAR));
cfgfile_path (line1b, line2b, "config_host_path", p->config_host_path, sizeof p->config_host_path / sizeof (TCHAR));
cfgfile_string (line1b, line2b, "config_window_title", p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR));
}
}
}
......@@ -3625,6 +3654,7 @@ void default_prefs (struct uae_prefs *p, int type)
p->use_serial = 0;
p->serial_demand = 0;
p->serial_hwctsrts = 1;
p->serial_stopbits = 0;
p->parallel_demand = 0;
p->parallel_matrix_emulation = 0;
p->parallel_postscript_emulation = 0;
......@@ -3731,6 +3761,7 @@ void default_prefs (struct uae_prefs *p, int type)
audio_default_options (p);
p->immediate_blits = 0;
p->waiting_blits = 0;
p->collision_level = 2;
p->leds_on_screen = 0;
p->keyboard_leds_in_use = 0;
......@@ -3925,6 +3956,7 @@ static void buildin_default_prefs (struct uae_prefs *p)
p->blitter_cycle_exact = 0;
p->chipset_mask = CSMASK_ECS_AGNUS;
p->immediate_blits = 0;
p->waiting_blits = 0;
p->collision_level = 2;
p->produce_sound = 3;
p->scsi = 0;
......
......@@ -73,11 +73,11 @@ static unsigned long memsizes[] = {
/* 21*/ 0xC0000000, //3GB
};
static int quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
static int quickstart_floppy = 1, quickstart_cd = 0, quickstart_ntsc = 0;
static int quickstart_cdtype = 0;
static char quickstart_cddrive[16];
static int quickstart_ok, quickstart_ok_floppy;
int quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
int quickstart_floppy = 1, quickstart_cd = 0, quickstart_ntsc = 0;
int quickstart_cdtype = 0;
char quickstart_cddrive[16];
int quickstart_ok, quickstart_ok_floppy;
//----------
......@@ -1360,11 +1360,12 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
{
unsigned int romcheck = 0;
quickstart_model = [((NSMenuItem*)sender) tag];
quickstart_conf = 0;
quickstart_compa = 0;
changed_prefs.nr_floppies = quickstart_floppy;
quickstart_ok = built_in_prefs (&changed_prefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck);
changed_prefs.ntscmode = quickstart_ntsc != 0;
//quickstart_cd = chnaged_prefs.floppyslots[1].dfxtype == DRV_NONE && (quickstart_model == 8 || quickstart_model == 9);
config_filename[0] = 0;
uae_reset(0);
}
......
......@@ -139,7 +139,6 @@ extern frame_time_t syncbase;
extern unsigned long frametime, timeframes;
extern int plffirstline, plflastline;
//plfstrt, plfstop, ;
extern uae_u16 htotal, vtotal, beamcon0;
/* 100 words give you 1600 horizontal pixels. Should be more than enough for
......
......@@ -30,7 +30,7 @@ struct hardfiledata {
TCHAR product_rev[4 + 1];
TCHAR device_name[256];
/* geometry from possible RDSK block */
unsigned int cylinders;
unsigned int cylinders;
unsigned int sectors;
unsigned int heads;
uae_u8 *virtual_rdb;
......@@ -59,11 +59,11 @@ struct hd_hardfiledata {
struct hardfiledata hfd;
int bootpri;
uae_u64 size;
unsigned int cyls;
unsigned int heads;
unsigned int secspertrack;
unsigned int cyls_def;
unsigned int secspertrack_def;
unsigned int cyls;
unsigned int heads;
unsigned int secspertrack;
unsigned int cyls_def;
unsigned int secspertrack_def;
unsigned int heads_def;
TCHAR *path;
int ansi_version;
......
......@@ -678,7 +678,7 @@ void uaenet_gotdata (struct s2devstruct *dev, const uae_u8 *d, int len)
if (!dev->online)
return;
/* drop if bogus size */
if (len < ETH_HEADER_SIZE || len >= dev->td->mtu + ETH_HEADER_SIZE + 2)
if (len < 20 || len >= dev->td->mtu + ETH_HEADER_SIZE + 2)
return;
/* drop if dst == broadcast and src == me */
if (isbroadcast (d) && !memcmp (d + 6, dev->td->mac, ADDR_SIZE))
......
......@@ -123,6 +123,9 @@ static uae_u32 emulib_ChangeLanguage (uae_u32 which)
case 7:
currprefs.keyboard_lang = KBD_LANG_TR;
break;
case 8:
currprefs.keyboard_lang = KBD_LANG_FI;
break;
default:
break;
}
......@@ -248,10 +251,8 @@ static uae_u32 emulib_GetUaeConfig (uaecptr place)
put_byte (place + 35, 1);
for (j = 0; j < 4; j++) {
// char *s = ua (currprefs.floppyslots[j].df);
for (i = 0; i < 256; i++)
put_byte (place + 36 + i + j * 256, currprefs.floppyslots[j].df[i]);
// xfree (s);
}
return 1;
}
......@@ -354,12 +355,10 @@ static int native_dos_op (uae_u32 mode, uae_u32 p1, uae_u32 p2, uae_u32 p3)
v = get_native_path (p1, tmp);
if (v)
return v;
//s = ua (tmp);
for (i = 0; i <= strlen (tmp) && i < p3 - 1; i++) {
put_byte (p2 + i, tmp[i]);
put_byte (p2 + i + 1, 0);
}
//xfree (s);
return 0;
}
#ifndef UAEGFX_INTERNAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment