int udpcrc = 0;
int sp = (data[0] << 8) | data[1];
int dp = (data[2] << 8) | data[3];
- int len = (data[4] << 8) | data[5];
+ int len2 = (data[4] << 8) | data[5];
if (sp == 67 || sp == 68 || dp == 67 || dp == 68)
udpcrc |= dofakemac (data + 36); // DHCP CHADDR
if (udpcrc && (data[6] || data[7])) {
int i;
uae_u32 sum;
data[6] = data[7] = 0;
- data[len] = 0;
+ data[len2] = 0;
sum = 0;
- for (i = 0; i < ((len + 1) & ~1); i += 2)
+ for (i = 0; i < ((len2 + 1) & ~1); i += 2)
sum += (data[i] << 8) | data[i + 1];
sum += (ipv4[12] << 8) | ipv4[13];
sum += (ipv4[14] << 8) | ipv4[15];
sum += (ipv4[16] << 8) | ipv4[17];
sum += (ipv4[18] << 8) | ipv4[19];
sum += 17;
- sum += len;
+ sum += len2;
while (sum >> 16)
sum = (sum & 0xFFFF) + (sum >> 16);
sum = ~sum;
static uae_u32 REGPARAM2 a2065_wget (uaecptr addr)
{
- uae_u16 v;
+ uae_u16 v = 0;
addr &= 65535;
switch (romtype) {
if (!status)
status = scsi_receive_data(scsi, &v2, true);
put_word((wd->cdmac.dmac_acr << 1) & 0xffffff, (v1 << 8) | v2);
- if (wd->wc.wd_dataoffset < sizeof wd->wc.wd_data) {
+ if (wd->wc.wd_dataoffset < sizeof wd->wc.wd_data - 1) {
wd->wc.wd_data[wd->wc.wd_dataoffset++] = v1;
wd->wc.wd_data[wd->wc.wd_dataoffset++] = v2;
}
for (;;) {
int status;
uae_u16 v = get_word((wd->cdmac.dmac_acr << 1) & 0xffffff);
- if (wd->wc.wd_dataoffset < sizeof wd->wc.wd_data) {
+ if (wd->wc.wd_dataoffset < sizeof wd->wc.wd_data - 1) {
wd->wc.wd_data[wd->wc.wd_dataoffset++] = v >> 8;
wd->wc.wd_data[wd->wc.wd_dataoffset++] = v;
}
if (series2) {
int total = 0;
int seekpos = 0;
- int size = zfile_size(z);
+ size = zfile_size(z);
if (size > 16384 + 4096) {
zfile_fread(wd->rom, 64, 1, z);
zfile_fseek(z, 16384, SEEK_SET);
/* DMA transfer one CD sector */
static void cdrom_run_read (void)
{
- int i, sector, inc;
+ int sector, inc;
int sec;
int seccnt;
buf[1] = 0;
buf[2] = 0;
buf[3] = cdrom_sector_counter & 31;
- for (i = 0; i < 2352; i++)
+ for (int i = 0; i < 2352; i++)
put_byte (cdrom_addressdata + seccnt * 4096 + i, buf[i]);
- for (i = 0; i < 73 * 2; i++)
+ for (int i = 0; i < 73 * 2; i++)
put_byte (cdrom_addressdata + seccnt * 4096 + 0xc00 + i, 0);
cdrom_pbx &= ~(1 << seccnt);
set_status (CDINTERRUPT_PBX);
/* cdrom data buffering thread */
static void *akiko_thread (void *null)
{
- int i;
+ int secnum;
uae_u8 *tmp1;
uae_u8 *tmp2;
int tmp3;
uae_sem_wait (&akiko_sem);
sector = cdrom_current_sector;
- for (i = 0; i < SECTOR_BUFFER_SIZE; i++) {
- if (sector_buffer_info_1[i] == 0xff)
+ for (secnum = 0; secnum < SECTOR_BUFFER_SIZE; secnum++) {
+ if (sector_buffer_info_1[secnum] == 0xff)
break;
}
if (sector >= 0 && is_valid_data_sector(sector) &&
- (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || i != SECTOR_BUFFER_SIZE)) {
+ (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || secnum != SECTOR_BUFFER_SIZE)) {
int blocks;
memset (sector_buffer_info_2, 0, SECTOR_BUFFER_SIZE);
#if AKIKO_DEBUG_IO_CMD
if (!ok) {
int offset = 0;
while (offset < SECTOR_BUFFER_SIZE) {
- int ok = 0;
+ int readok = 0;
if (is_valid_data_sector(sector))
- ok = sys_command_cd_rawread (unitnum, sector_buffer_2 + offset * 2352, sector, 1, 2352);
- sector_buffer_info_2[offset] = ok ? 3 : 0;
+ readok = sys_command_cd_rawread (unitnum, sector_buffer_2 + offset * 2352, sector, 1, 2352);
+ sector_buffer_info_2[offset] = readok ? 3 : 0;
offset++;
sector++;
}
cubo_pic_byte |= 1;
if ((cubo_pic_bit_cnt & 7) == 7) {
int offset = cubo_pic_bit_cnt / 8;
- if (offset <= sizeof(cubo_pic_key)) {
+ if (offset < sizeof(cubo_pic_key)) {
cubo_pic_key[offset] = cubo_pic_byte;
write_log(_T("Cubo PIC received %02x (%d/%d)\n"), cubo_pic_byte, offset, sizeof(cubo_pic_key));
}
static uae_u32 REGPARAM2 fmv_wget (uaecptr addr)
{
- uae_u32 v;
+ uae_u32 v = 0;
addr -= fmv_start & fmv_bank.mask;
addr &= fmv_bank.mask;
int mask = addr & BANK_MASK;
static uae_u32 REGPARAM2 fmv_bget (uaecptr addr)
{
- uae_u32 v;
+ uae_u32 v = 0;
addr -= fmv_start & fmv_bank.mask;
addr &= fmv_bank.mask;
int mask = addr & BANK_MASK;
prev = s;
j = 0;
outp[0] = 0;
+ tmp1[0] = 0;
while (cnt < max) {
TCHAR c = *s++;
if (!c)
if (index < 0)
zfile_fseek(configstore, 0, SEEK_SET);
+ tmp[0] = 0;
for (;;) {
uae_u8 b = 0;
TCHAR buffer[1000];
va_start (parms, format);
- _vsntprintf (buffer, sizeof (buffer) - 1, format, parms );
+ _vsntprintf (buffer, sizeof (buffer) / sizeof(TCHAR) - 1, format, parms );
va_end (parms);
if (nomore) {
write_log (_T("%s\n"), buffer);
last_custom_value1 = dat;
AUDxDAT (nr, dat, pt);
} else {
- uae_u16 dat;
+ uae_u16 dat = 0;
int w = v & 1;
uaecptr pt = disk_getpt ();
// disk_fifostatus() needed in >100% disk speed modes
v = custom_wget_1 (hpos, addr, 0, byte);
#ifdef ACTION_REPLAY
#ifdef ACTION_REPLAY_COMMON
- addr &= 0x1ff;
+ addr &= 0x1fe;
ar_custom[addr + 0] = (uae_u8)(v >> 8);
ar_custom[addr + 1] = (uae_u8)(v);
#endif
vertPoints *= (Real64)10/(Real64)cpi;
}
- if (!style & STYLE_PROP)
+ if (!(style & STYLE_PROP))
{
if (cpi == 10 && (style & STYLE_CONDENSED))
{
if (ok && (flags & ID_FLAG_SAVE_MASK_QUALIFIERS)) {
TCHAR *p2 = p + _tcslen (p);
*p2++ = '.';
- for (int i = 0; i < MAX_INPUT_QUALIFIERS * 2; i++) {
- if ((ID_FLAG_QUALIFIER1 << i) & flags) {
- if (i & 1)
- _stprintf (p2, _T("%c"), 'a' + i / 2);
+ for (int k = 0; k < MAX_INPUT_QUALIFIERS * 2; k++) {
+ if ((ID_FLAG_QUALIFIER1 << k) & flags) {
+ if (k & 1)
+ _stprintf (p2, _T("%c"), 'a' + k / 2);
else
- _stprintf (p2, _T("%c"), 'A' + i / 2);
+ _stprintf (p2, _T("%c"), 'A' + k / 2);
p2++;
}
}
if (flags & ID_FLAG_SAVE_MASK_QUALIFIERS) {
TCHAR *p2 = p + _tcslen(p);
*p2++ = '.';
- for (int i = 0; i < MAX_INPUT_QUALIFIERS * 2; i++) {
- if ((ID_FLAG_QUALIFIER1 << i) & flags) {
- if (i & 1)
- _stprintf(p2, _T("%c"), 'a' + i / 2);
+ for (int k = 0; k < MAX_INPUT_QUALIFIERS * 2; k++) {
+ if ((ID_FLAG_QUALIFIER1 << k) & flags) {
+ if (k & 1)
+ _stprintf(p2, _T("%c"), 'a' + k / 2);
else
- _stprintf(p2, _T("%c"), 'A' + i / 2);
+ _stprintf(p2, _T("%c"), 'A' + k / 2);
p2++;
}
}
if (bname[0] && !_tcscmp (bname2, bname))
matched = true;
}
- if (matched && fullmatch && _tcscmp(aname1, bname1) != 0)
+ if (matched && fullmatch && aname1 && bname1 && _tcscmp(aname1, bname1) != 0)
matched = false;
if (matched) {
if (match >= 0)
TCHAR tmp[10];
_stprintf(tmp, _T("custom%d"), jportscustom[i]);
found = inputdevice_joyport_config(prefs, tmp, NULL, i, jportsmode[i], 0, true) != 0;
- } else if (jports_name[i][0] || jports_configname[i][0]) {
+ } else if ((jports_name[i] && jports_name[i][0]) || (jports_configname[i] && jports_configname[i][0])) {
if (!inputdevice_joyport_config (prefs, jports_name[i], jports_configname[i], i, jportsmode[i], 1, true)) {
found = inputdevice_joyport_config (prefs, jports_name[i], NULL, i, jportsmode[i], 1, true) != 0;
}
if (!check2) {
uae_u32 w = get_word(pc);
// JSR xxxxxxxx or JSR (an)
- if (w == 0x4eb9 || w == 0x4eb9)
+ if (w == 0x4eb9 || (w & 0xfff8) == 0x4e90)
check2 = true;
}
if (check2) {
if (currprefs.cs_romisslow) {
for (i = (0xe00000 >> 16); i < (0xe80000 >> 16); i++)
ce_banktype[i] = CE_MEMBANK_CHIP16;
- for (i = (0xf80000 >> 16); i < (0x100000 >> 16); i++)
+ for (i = (0xf80000 >> 16); i < (0x1000000 >> 16); i++)
ce_banktype[i] = CE_MEMBANK_CHIP16;
}
if (ncr->rom && addr >= ncr->rom_start && addr < ncr->rom_end)
return read_rombyte (ncr, addr - ncr->rom_offset);
if (addr == A4091_DIP_OFFSET) {
- uae_u8 v = 0;
- v |= ncr->rc->device_id;
- v |= ncr->rc->device_settings << 3;
- v ^= 0xff & ~7;
- return v;
+ uae_u8 v2 = 0;
+ v2 |= ncr->rc->device_id;
+ v2 |= ncr->rc->device_settings << 3;
+ v2 ^= 0xff & ~7;
+ return v2;
}
if (ncr->io_end && (addr < ncr->io_start || addr >= ncr->io_end)) {
#if NCR_DEBUG > 1
uae_u16 r = imm >> 12;
TCHAR regs[16];
const TCHAR *cname = _T("?");
- int i;
- for (i = 0; m2cregs[i].regname; i++) {
- if (m2cregs[i].regno == creg)
+ int j;
+ for (j = 0; m2cregs[j].regname; j++) {
+ if (m2cregs[j].regno == creg)
break;
}
_stprintf (regs, _T("%c%d"), r >= 8 ? 'A' : 'D', r >= 8 ? r - 8 : r);
- if (m2cregs[i].regname)
- cname = m2cregs[i].regname;
+ if (m2cregs[j].regname)
+ cname = m2cregs[j].regname;
if (lookup->mnemo == i_MOVE2C) {
_tcscat (instrname, regs);
_tcscat (instrname, _T(","));
}
if (v & 8) {
// backwards compatibility
- uae_u32 v = restore_u32();
- cputrace.prefetch020[0] = v >> 16;
- cputrace.prefetch020[1] = (uae_u16)v;
- v = restore_u32();
- cputrace.prefetch020[2] = v >> 16;
- cputrace.prefetch020[3] = (uae_u16)v;
+ uae_u32 v2 = restore_u32();
+ cputrace.prefetch020[0] = v2 >> 16;
+ cputrace.prefetch020[1] = (uae_u16)v2;
+ v2 = restore_u32();
+ cputrace.prefetch020[2] = v2 >> 16;
+ cputrace.prefetch020[3] = (uae_u16)v2;
restore_u32();
restore_u32();
cputrace.prefetch020_valid[0] = true;
uae_u8 *save_cpu (int *len, uae_u8 *dstptr)
{
uae_u8 *dstbak, *dst;
- int model, i, khz;
+ int model, khz;
if (dstptr)
dstbak = dst = dstptr;
model = currprefs.cpu_model;
save_u32 (model); /* MODEL */
save_u32(0x80000000 | 0x40000000 | 0x20000000 | 0x10000000 | 0x8000000 | 0x4000000 | (currprefs.address_space_24 ? 1 : 0)); /* FLAGS */
- for (i = 0;i < 15; i++)
+ for (int i = 0;i < 15; i++)
save_u32 (regs.regs[i]); /* D0-D7 A0-A6 */
save_u32 (m68k_getpc ()); /* PC */
save_u16 (regs.irc); /* prefetch */
TCHAR es[1000];
if (err == MMSYSERR_NOERROR)
return MMSYSERR_NOERROR;
- if (mciGetErrorString (err, es, sizeof es))
+ if (mciGetErrorString (err, es, sizeof es / sizeof(TCHAR)))
write_log (_T("MCIErr: %s: %d = '%s'\n"), str, err, es);
return err;
}
as->sensedata[sactual] = swb.SenseBuf[sactual];
as->actual = 0; /* scsi_Actual */
} else {
- int i;
- for (i = 0; i < as->sense_len; i++)
+ for (int i = 0; i < as->sense_len; i++)
as->sensedata[i] = 0;
sactual = 0;
if (status == 0) {
BITMAP bmp;
int bmpw, w, h, bpp, iffbpp, tsize, size, x, y, i;
int iffsize, bodysize;
- uae_u32 colors[256];
+ uae_u32 colors[256] = { 0 };
int cnt;
uae_u8 *iff, *p;
uae_u8 iffilbm[] = {
CreationDisposition = OPEN_ALWAYS;
if (flags & O_WRONLY)
DesiredAccess = GENERIC_WRITE;
- if (flags & O_RDONLY) {
+ if (flags == O_RDONLY) {
DesiredAccess = GENERIC_READ;
CreationDisposition = OPEN_EXISTING;
}
if (v & FILE_ATTRIBUTE_READONLY)
ret |= MYVOLUMEINFO_READONLY;
*/
- if (GetVolumePathName (root, volume, sizeof (volume))) {
+ if (GetVolumePathName (root, volume, sizeof (volume) / sizeof(TCHAR))) {
TCHAR fsname[MAX_DPATH];
DWORD comlen;
DWORD flags;
Pen |= Pen << 16;
for (lines = 0; lines < Height; lines++, dst += bpr) {
uae_u32 *p = (uae_u32*)dst;
- for (cols = 0; cols < Width & ~15; cols += 16) {
+ for (cols = 0; cols < (Width & ~15); cols += 16) {
*p++ = Pen;
*p++ = Pen;
*p++ = Pen;
if (same) {
memset(p, Pen & 0xff, Width * 3);
} else {
- for (cols = 0; cols < Width & ~7; cols += 8) {
+ for (cols = 0; cols < (Width & ~7); cols += 8) {
*p++ = Pen1;
*p++ = Pen2;
*p++ = Pen3;
{
for (lines = 0; lines < Height; lines++, dst += bpr) {
uae_u32 *p = (uae_u32*)dst;
- for (cols = 0; cols < Width & ~7; cols += 8) {
+ for (cols = 0; cols < (Width & ~7); cols += 8) {
*p++ = Pen;
*p++ = Pen;
*p++ = Pen;
}
(*unkcnt)++;
write_log (_T("P96: Non-unique mode %dx%d"), w, h);
- if (256 - (*unkcnt) == mi[i - 1].id + 1) {
+ if (i > 0 && 256 - (*unkcnt) == mi[i - 1].id + 1) {
(*unkcnt) = 256 - 127;
write_log(_T(" (Skipped reserved)"));
} else if (256 - (*unkcnt) == 11) {
if (inimode) {
int ret = 0;
TCHAR *tmp = NULL;
- int size = sizeof tmp / sizeof(TCHAR);
if (ini_getstring(inidata, gs(root), name, &tmp)) {
*val = _tstol (tmp);
ret = 1;
if (inimode) {
int ret = 0;
TCHAR *tmp = NULL;
- int size = sizeof tmp / sizeof(TCHAR);
if (ini_getstring(inidata, gs(root), name, &tmp)) {
*val = _tstoi64 (tmp);
ret = 1;
if (isfullscreen () > 0)
guid = &fsdialogguid;
- hr = -1;
+ hr = E_FAIL;
ret = 0;
pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress (
GetModuleHandle (_T("shell32.dll")), "SHCreateItemFromParsingName");
if (((configstore[i]->Type == 0 || configstore[i]->Type == 3) && type == 0) || (configstore[i]->Type == type)) {
TCHAR path2[MAX_DPATH];
_tcscpy (path2, configstore[i]->Path);
- _tcsncat (path2, configstore[i]->Name, MAX_DPATH);
+ _tcsncat (path2, configstore[i]->Name, MAX_DPATH - _tcslen(path2));
if (!_tcscmp (path, path2)) {
_tcscpy (out, configstore[i]->Fullpath);
- _tcsncat (out, configstore[i]->Name, MAX_DPATH);
+ _tcsncat (out, configstore[i]->Name, MAX_DPATH - _tcslen(out));
return configstore[i];
}
}
}
if (parent) {
GetConfigPath (path, parent->Parent, noroot);
- _tcsncat (path, parent->Name, MAX_DPATH);
- _tcsncat (path, _T("\\"), MAX_DPATH);
+ _tcsncat (path, parent->Name, MAX_DPATH - _tcslen(path));
+ _tcsncat (path, _T("\\"), MAX_DPATH - _tcslen(path));
}
}
static void getconfigcache (TCHAR *dst, const TCHAR *path)
{
_tcscpy (dst, path);
- _tcsncat (dst, _T("configuration.cache"), MAX_DPATH);
+ _tcsncat (dst, _T("configuration.cache"), MAX_DPATH - _tcslen(dst));
}
static void deleteconfigcache(void)
GetConfigPath (path, configparent, FALSE);
GetConfigPath (shortpath, configparent, TRUE);
_tcscpy (path2, path);
- _tcsncat (path2, _T("*.*"), MAX_DPATH);
+ _tcsncat (path2, _T("*.*"), MAX_DPATH - _tcslen(path2));
if (*level == 0) {
if (flushcache) {
TCHAR path3[MAX_DPATH];
if (_tcslen (find_data.cFileName) > 4 && !strcasecmp (find_data.cFileName + _tcslen (find_data.cFileName) - 4, _T(".uae"))) {
_tcscpy (path3, path);
- _tcsncat (path3, find_data.cFileName, MAX_DPATH);
+ _tcsncat (path3, find_data.cFileName, MAX_DPATH - _tcslen(path3));
config->Artpath[0] = 0;
struct uae_prefs *p = cfgfile_open(path3, &config->Type);
if (p) {
} else {
fetch_configurationpath (path, sizeof (path) / sizeof (TCHAR));
}
- _tcsncat (path, name, MAX_DPATH);
+ _tcsncat (path, name, MAX_DPATH - _tcslen(path));
_tcscpy (full_path, path);
switch (flag)
{
if ((j == 0 && cs->Type == CONFIG_TYPE_HOST) || (j == 1 && cs->Type == CONFIG_TYPE_HARDWARE)) {
TCHAR tmp2[MAX_DPATH];
_tcscpy (tmp2, configstore[i]->Path);
- _tcsncat (tmp2, configstore[i]->Name, MAX_DPATH);
+ _tcsncat (tmp2, configstore[i]->Name, MAX_DPATH - _tcslen(tmp2));
SendDlgItemMessage (hDlg, IDC_CONFIGLINK, CB_ADDSTRING, 0, (LPARAM)tmp2);
if (config && (!_tcsicmp (tmp2, config->HardwareLink) || !_tcsicmp (tmp2, config->HostLink)))
idx2 = idx1;
if (config) {
TCHAR path[MAX_DPATH];
_tcscpy (path, config->Path);
- _tcsncat (path, config->Name, MAX_DPATH);
+ _tcsncat (path, config->Name, MAX_DPATH - _tcslen(path));
regsetstr (NULL, configreg[type], path);
}
}
for (i = 0; i < configstoresize; i++) {
if (configstore[i]->Type == CONFIG_TYPE_HOST) {
_tcscpy (tmp2, configstore[i]->Path);
- _tcsncat (tmp2, configstore[i]->Name, MAX_DPATH);
+ _tcsncat (tmp2, configstore[i]->Name, MAX_DPATH - _tcslen(tmp2));
if (!_tcscmp (tmp2, hostconf))
idx = j;
SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_ADDSTRING, 0, (LPARAM)tmp2);
workprefs.cpu_clock_multiplier = (1 << 8) << idx;
} else {
TCHAR txt[20];
+ txt[0] = 0;
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_GETTEXT, (WPARAM)sizeof (txt) / sizeof (TCHAR), (LPARAM)txt);
workprefs.cpu_clock_multiplier = 0;
workprefs.cpu_frequency = (int)(_tstof (txt) * 1000000.0);
if (idx >= 0) {
workprefs.sound_freq = soundfreqs[idx];
} else {
+ txt[0] = 0;
SendDlgItemMessage (hDlg, IDC_SOUNDFREQ, WM_GETTEXT, (WPARAM)sizeof (txt) / sizeof (TCHAR), (LPARAM)txt);
workprefs.sound_freq = _tstol (txt);
}
bsize = hfd.virtsize;
current_hfdlg.size = hfd.virtsize;
if (!memcmp (id, "RDSK", 4) || !memcmp (id, "CDSK", 4)) {
- int blocksize = (id[16] << 24) | (id[17] << 16) | (id[18] << 8) | (id[19] << 0);
+ blocksize = (id[16] << 24) | (id[17] << 16) | (id[18] << 8) | (id[19] << 0);
break;
}
}
for (int k = 0; axistable[k] >= 0; k += 3) {
if (evt == axistable[k] || evt == axistable[k + 1] || evt == axistable[k + 2]) {
for (int l = 0; inputlist[l] >= 0; l++) {
- if (inputlist[l] == axistable[k] || inputlist[l] == axistable[k + 1] || inputlist[l] == axistable[k + 1]) {
+ if (inputlist[l] == axistable[k] || inputlist[l] == axistable[k + 1] || inputlist[l] == axistable[k + 2]) {
ignore = true;
}
}
if (v != CB_ERR)
return filtermults[v];
+ tmp[0] = 0;
SendDlgItemMessage (hDlg, dlg, WM_GETTEXT, (WPARAM)sizeof tmp / sizeof (TCHAR), (LPARAM)tmp);
if (!_tcsicmp (tmp, _T("FS")))
return 0.0f;
AVIOutput_End ();
if(ischecked (hDlg, IDC_AVIOUTPUT_VIDEO)) {
avioutput_video = AVIOutput_ChooseVideoCodec (hDlg, tmp, sizeof tmp / sizeof (TCHAR));
- if (avioutput_audio = AVIAUDIO_WAV)
+ if (avioutput_audio == AVIAUDIO_WAV)
avioutput_audio = 0;
enable_for_avioutputdlg (hDlg);
} else {
*p++ = 0;
*p++ = 0;
if (p[0] == ' ')
- *p++;
+ *p++ = 0;
tmp[_tcslen (tmp) - 1] = 0;
SendMessage (hwnd, WM_SETTEXT, 0, (LPARAM)tmp);
ti.cbSize = sizeof (TOOLINFO);
} else {
rd = scan_arcadia_rom (file, 0);
if (rd) {
- if (rd->type == ROMTYPE_ARCADIABIOS || ROMTYPE_ALG)
+ if (rd->type == ROMTYPE_ARCADIABIOS || rd->type == ROMTYPE_ALG)
_tcscpy (prefs->romextfile, file);
else if (rd->type == ROMTYPE_ARCADIAGAME)
_tcscpy (prefs->cartfile, file);
*start = 0;
*end = 0;
for (int i = 0; i < 65536 + 1; i++) {
- addrbank *a = mem_banks[i];
+ addrbank *a = i < 65536 ? mem_banks[i] : NULL;
if (*start == 0 && a == bank)
*start = i << 16;
if (*start && a != bank) {
{
int i;
for (i = 0; roms[i].name; i++) {
- if (roms[i].group == 0 && (roms[i].type == ROMTYPE_ARCADIAGAME || roms[i].type == ROMTYPE_ARCADIAGAME)) {
+ if (roms[i].group == 0 && (roms[i].type == ROMTYPE_ARCADIABIOS || roms[i].type == ROMTYPE_ARCADIAGAME)) {
const TCHAR *p = roms[i].name;
p = p + _tcslen (p) + 1;
if (_tcslen (name) >= _tcslen (p) + 4) {
uae_u8 get_clock_msm(struct rtc_msm_data *data, int addr, struct tm *ct)
{
- uae_u8 v;
+ uae_u8 v = 0;
int year;
if (!ct) {
if ((data->fifo_half & STATUS_FIFO_PLAY) && (data->toccata_status & STATUS_PLAY_INTENA) && (data->toccata_status & STATUS_FIFO_PLAY)) {
data->toccata_irq |= STATUS_READ_PLAY_HALF;
}
- if ((data->fifo_half & STATUS_FIFO_RECORD) && (data->toccata_status & STATUS_FIFO_RECORD) && (data->toccata_status & STATUS_FIFO_RECORD)) {
+ if ((data->fifo_half & STATUS_FIFO_RECORD) && (data->toccata_status & STATUS_RECORD_INTENA) && (data->toccata_status & STATUS_FIFO_RECORD)) {
data->toccata_irq |= STATUS_READ_RECORD_HALF;
}
if (old != data->toccata_irq) {
for (;;) {
int ret;
tmpout[0] = 0;
- ret = cfgfile_modify (index, in, _tcslen (in), tmpout, sizeof (tmpout) * sizeof (TCHAR));
+ ret = cfgfile_modify (index, in, _tcslen (in), tmpout, sizeof (tmpout) / sizeof (TCHAR));
index++;
if (_tcslen (tmpout) > 0) {
if (_tcslen (out) == 0)
zs.next_out = z2->data;
zs.avail_out = size;
first = 1;
+ ret = Z_STREAM_ERROR;
do {
zs.next_in = buffer;
zs.avail_in = zfile_fread (buffer, 1, sizeof (buffer), z);
static struct zfile *archive_access_arcacc (struct znode *zn)
{
- struct zfile *zf;
+ struct zfile *zf = NULL;
struct zfile *z = zn->volume->archive;
int status, id_r, id_w;
aaHandle ah;