\r
for (i = 0; i < CZ80_FETCH_BANK; i++)\r
{\r
- CPU->Fetch[i] = (FPTR)cz80_bad_address;\r
+ CPU->Fetch[i] = (FPTR)cz80_bad_address - (i << CZ80_FETCH_SFT);\r
#if CZ80_ENCRYPTED_ROM\r
CPU->OPFetch[i] = 0;\r
#endif\r
free(hash_tables[i]);
hash_tables[i] = NULL;
}
+
+ if (unresolved_links[i] != NULL) {
+ free(unresolved_links[i]);
+ unresolved_links[i] = NULL;
+ }
}
if (block_list_pool != NULL)
case 0x01: /* Current Track Relative Time (MM:SS:FF) */
{
int lba = cdd.lba - cdd.toc.tracks[cdd.index].start;
+ if (lba < 0) lba = 0;
set_reg16(0x38, (cdd.status << 8) | 0x01);
set_reg16(0x3a, lut_BCD_16[(lba/75)/60]);
set_reg16(0x3c, lut_BCD_16[(lba/75)%60]);
{
int len, pos = 0;
- len = strlen(fname);
- if (len >= 3)
- pos = len - 3;
+ len = strrchr(fname, '.') - fname;
+ if (len > 0)
+ pos = len;
- strcpy(ext, fname + pos);
+ strcpy(ext, fname + pos + 1);
if (base != NULL) {
if (pos + 1 < base_size)
// the basename of cuefile, no path
snprintf(cue_base, sizeof(cue_base), "%s", current_filep);
- p = cue_base + strlen(cue_base);
- if (p - 3 >= cue_base)
- p[-3] = 0;
+ p = strrchr(cue_base, '.');
+ if (p) p[1] = '\0';
data = calloc(1, sizeof(*data) + count_alloc * sizeof(cue_track));
if (data == NULL)
dest[0] = dest[1] = dest[2] = dest[3] =\r
dest[4] = dest[5] = dest[6] = dest[7] = c;\r
\r
- while (count--)\r
- *dest++ = c;\r
+ switch (count) {\r
+ case 7: *dest++ = c;\r
+ case 6: *dest++ = c;\r
+ case 5: *dest++ = c;\r
+ case 4: *dest++ = c;\r
+ case 3: *dest++ = c;\r
+ case 2: *dest++ = c;\r
+ case 1: *dest++ = c;\r
+ }\r
}\r
void memset32_uncached(int *dest, int c, int count) { memset32(dest, c, count); }\r
#endif\r
CH[c].SLOT[s].Incr = -1;\r
CH[c].SLOT[s].key = 0;\r
CH[c].SLOT[s].phase = 0;\r
+ CH[c].SLOT[s].ar = CH[c].SLOT[s].ksr = 0;\r
+ CH[c].SLOT[s].ar_ksr = 0;\r
CH[c].SLOT[s].ssg = CH[c].SLOT[s].ssgn = 0;\r
CH[c].SLOT[s].state= EG_OFF;\r
CH[c].SLOT[s].volume = MAX_ATT_INDEX;\r
Pico32x.dirty_pal = 1;\r
}\r
#endif\r
+ free(t);\r
}\r
\r
// vim:shiftwidth=2:ts=2:expandtab\r
strncpy(dst + prefix_len, p, dstlen - prefix_len - 1);\r
\r
dst[dstlen - 8] = 0;\r
- if (dst[strlen(dst) - 4] == '.')\r
- dst[strlen(dst) - 4] = 0;\r
+ if ((p = strrchr(dst, '.')) != NULL)\r
+ dst[p-dst] = 0;\r
if (ext)\r
strcat(dst, ext);\r
}\r