static int feature_interrupts = 0;
static int feature_instruction_size = 0;
static int fpu_min_exponent, fpu_max_exponent;
-static int rnd_seed;
+static int max_file_size;
+static int rnd_seed, rnd_seed_prev;
static TCHAR *feature_instruction_size_text = NULL;
static uae_u32 feature_addressing_modes[2];
static int feature_gzip = 0;
#define MAX_REGDATAS 32
static int regdatacnt;
static struct regdata regdatas[MAX_REGDATAS];
+static uae_u32 ignore_register_mask;
#define HIGH_MEMORY_START (addressing_mask == 0xffffffff ? 0xffff8000 : 0x00ff8000)
static int generate_address_mode;
static int test_memory_access_mask;
static uae_u32 opcode_memory_address;
+static uaecptr branch_target;
+static uaecptr branch_target_pc;
static uae_u8 imm8_cnt;
static uae_u16 imm16_cnt;
return;
if (feature_interrupts >= 2 && addr == IPL_TRIGGER_ADDR) {
add_memory_cycles(1);
+#if IPL_TRIGGER_ADDR_SIZE == 1
interrupt_cycle_cnt = INTERRUPT_CYCLES;
+#endif
return;
}
check_bus_error(addr, 1, regs.s ? 5 : 1);
{
if (!testing_active && is_nowrite_address(addr, 1))
return;
+ if (feature_interrupts >= 2 && addr == IPL_TRIGGER_ADDR) {
+ add_memory_cycles(1);
+#if IPL_TRIGGER_ADDR_SIZE == 2
+ interrupt_cycle_cnt = INTERRUPT_CYCLES;
+#endif
+ return;
+ }
check_bus_error(addr, 1, regs.s ? 5 : 1);
if (addr & 1) {
put_byte_test(addr + 0, v >> 8);
return 0;
}
-void ipl_fetch(void)
+// ipl check was early enough, interrupt possible after current instruction
+void ipl_fetch_now(void)
{
- if (regs.ipl_pin) {
+ if (regs.ipl[0] != regs.ipl_pin) {
regs.ipl[0] = regs.ipl_pin;
+ regs.ipl[1] = 0;
+ }
+}
+// ipl check was too late, interrupt possible after following instruction
+void ipl_fetch_next(void)
+{
+ if (regs.ipl[1] != regs.ipl_pin) {
+ regs.ipl[1] = regs.ipl_pin;
}
}
uae_s32 regd = regs.regs[reg];
if ((dp & 0x800) == 0)
regd = (uae_s32)(uae_s16)regd;
- return base + (uae_s8)dp + regd;
+ return base + (uae_s32)((uae_s8)(dp)) + regd;
}
static void activate_trace(void)
MakeFromSR_x(0);
}
+void REGPARAM2 MakeFromSR_STOP(void)
+{
+ MakeFromSR_x(-1);
+}
+
void REGPARAM2 MakeFromSR_intmask(uae_u16 oldsr, uae_u16 newsr)
{
}
{
}
+void checkint(void)
+{
+}
+
void cpu_halt(int halt)
{
cpu_halted = halt;
return 0;
}
-static uae_u32 xorshiftstate;
+static uae_u32 xorshiftstate, xorshiftstate_prev;
static uae_u32 xorshift32(void)
{
uae_u32 x = xorshiftstate;
return xorshiftstate;
}
-static int rand16_cnt;
+static int rand16_cnt, rand16_cnt_prev;
static uae_u16 rand16(void)
{
int cnt = rand16_cnt & 15;
v |= 1;
return v;
}
-static int rand32_cnt;
+static int rand32_cnt, rand32_cnt_prev;
static uae_u32 rand32(void)
{
int cnt = rand32_cnt & 31;
// first 3 values: positive
// next 4 values: negative
// last: zero
-static int rand8_cnt;
+static int rand8_cnt, rand8_cnt_prev;
static uae_u8 rand8(void)
{
int cnt = rand8_cnt & 7;
return false;
if (feature_loop_mode_register == reg)
return false;
+ if ((1 << reg) & ignore_register_mask)
+ return false;
// don't unnecessarily modify static forced register
for (int i = 0; i < regdatacnt; i++) {
static void compressfiles(const TCHAR *dir)
{
- for (int i = 1; i < filecount; i++) {
+ for (int i = 0; i < filecount; i++) {
TCHAR path[1000];
_stprintf(path, _T("%s/%04d.dat"), dir, i);
compressfile(path, 1);
}
}
+static void mergefiles(const TCHAR *dir)
+{
+ int tsize = 0;
+ FILE *of = NULL;
+ int oi = -1;
+ unsigned char zero[4] = { 0, 0, 0, 0 };
+ unsigned char head[4] = { 0xff, 0xff, 0xff, 0xff };
+ TCHAR opath[1000];
+ for (int i = 0; i < filecount; i++) {
+ TCHAR path[1000];
+ _stprintf(path, _T("%s/%04d.dat"), dir, i);
+ if (feature_gzip & 1) {
+ if (_tcschr(path, '.')) {
+ path[_tcslen(path) - 1] = 'z';
+ } else {
+ _tcscat(path, _T(".gz"));
+ }
+ }
+ FILE *f = _tfopen(path, _T("rb"));
+ fseek(f, 0, SEEK_END);
+ int size = ftell(f);
+ fseek(f, 0, SEEK_SET);
+ if (tsize > 0 && max_file_size > 0 && tsize + size >= max_file_size * 1024) {
+ fwrite(head, 1, 4, of);
+ fwrite(zero, 1, 4, of);
+ fclose(of);
+ of = NULL;
+ tsize = 0;
+ }
+ uae_u8 *mem = (uae_u8 *)malloc(size);
+ fread(mem, 1, size, f);
+ fclose(f);
+ if (!of) {
+ oi++;
+ _stprintf(opath, _T("%s/%04d.dat"), dir, oi);
+ if (feature_gzip & 1) {
+ if (_tcschr(opath, '.')) {
+ opath[_tcslen(opath) - 1] = 'z';
+ } else {
+ _tcscat(opath, _T(".gz"));
+ }
+ }
+ of = _tfopen(opath, _T("wb"));
+ if (!of) {
+ wprintf(_T("Couldn't open '%s'\n"), opath);
+ abort();
+ }
+ }
+ if (oi != i) {
+ _tunlink(path);
+ }
+ unsigned char b;
+ fwrite(head, 1, 4, of);
+ b = size >> 24;
+ fwrite(&b, 1, 1, of);
+ b = size >> 16;
+ fwrite(&b, 1, 1, of);
+ b = size >> 8;
+ fwrite(&b, 1, 1, of);
+ b = size >> 0;
+ fwrite(&b, 1, 1, of);
+ fwrite(mem, 1, size, of);
+ tsize += size;
+ free(mem);
+ }
+ if (of) {
+ fwrite(zero, 1, 4, of);
+ fclose(of);
+ }
+}
+
static void save_memory(const TCHAR *path, const TCHAR *name, uae_u8 *p, int size)
{
TCHAR fname[1000];
} else {
break;
}
+ } else if (((1 << reg) & ignore_register_mask)) {
+ return -1;
} else {
break;
}
if (currprefs.cpu_model >= 68020)
v &= ~0x100;
ereg = v >> 12;
- if (loopmodelimit && (ereg == 0 || ereg == 8 + 3 || ereg == 8 + 7 || ereg == feature_loop_mode_register)) {
+ if (loopmodelimit && (ereg == 0 || ereg == 8 + 3 || ereg == 8 + 7 || ((1 << ereg) & ignore_register_mask))) {
continue;
}
break;
break;
}
int ereg = v >> 12;
- if (loopmodelimit && (ereg == 0 || ereg == 8 + 3 || ereg == 8 + 7 || ereg == feature_loop_mode_register)) {
+ if (loopmodelimit && (ereg == 0 || ereg == 8 + 3 || ereg == 8 + 7)) {
+ return -1;
+ }
+ if ((1 << ereg) & ignore_register_mask) {
return -1;
}
*regused = ereg;
static int get_ipl(void)
{
- if (cpu_cycles + 4 > regs.ipl_time) {
- return regs.ipl[0];
- }
- return regs.ipl[1];
+ return regs.ipl[0];
}
static void execute_ins(uaecptr endpc, uaecptr targetpc, struct instr *dp, bool fpumode)
regs.loop_mode = 0;
regs.ipl_pin = 0;
regs.ipl[0] = regs.ipl[1] = 0;
- regs.ipl_time = 0;
interrupt_level = 0;
interrupt_cycle_cnt = 0;
test_exception_orig = 0;
break;
}
+ if (test_exception) {
+ break;
+ }
+
if (get_ipl() > regs.intmask) {
Exception(24 + get_ipl());
break;
}
+ regs.ipl[0] = regs.ipl[1];
+ regs.ipl[1] = 0;
if ((regs.pc == endpc || regs.pc == targetpc) && !cpu_stopped && feature_interrupts < 2) {
// Trace is only added as an exception if there was no other exceptions
if (test_exception >= 24 && test_exception <= 24 + 8) {
if (test_exception_addr != opcode_memory_address &&
test_exception_addr != opcode_memory_address - 2 &&
- test_exception_addr != test_instruction_end_pc)
- {
+ test_exception_addr != test_instruction_end_pc &&
+ test_exception_addr != branch_target) {
test_exception = -1;
}
}
registers[8 + 3] = test_memory_start; // A3 = start of test memory
}
+ ignore_register_mask = 0;
+ if (feature_loop_mode_register >= 0) {
+ ignore_register_mask |= 1 << feature_loop_mode_register;
+ }
+ if (feature_interrupts >= 2) {
+ // D0 and D7 is modified by delay code
+ ignore_register_mask |= 1 << 0;
+ ignore_register_mask |= 1 << 7;
+ }
+
registers[8 + 6] = opcode_memory_start - 0x100;
registers[15] = user_stack_memory_use;
uae_u32 target_ea_bak[3], target_address_bak, target_opcode_address_bak;
+ rnd_seed_prev = rnd_seed;
+ rand8_cnt_prev = rand8_cnt;
+ rand16_cnt_prev = rand16_cnt_prev;
+ rand32_cnt_prev = rand32_cnt_prev;
+ xorshiftstate_prev = xorshiftstate;
+
for (;;) {
int got_something = 0;
+ if (feature_interrupts >= 2) {
+ rnd_seed = rnd_seed;
+ rand8_cnt = rand8_cnt;
+ rand16_cnt = rand16_cnt_prev;
+ rand32_cnt = rand32_cnt_prev;
+ xorshiftstate = xorshiftstate_prev;
+ }
+
target_ea_bak[0] = target_ea[0];
target_ea_bak[1] = target_ea[1];
target_ea_bak[2] = target_ea[2];
// move ccr,d7
put_word_test(pc + 0, 0x42c7); // 4 cycles
}
+ pc += 2;
+#if IPL_TRIGGER_ADDR_SIZE == 1
+ // move.b #x,xxx.L (4 * 4 + 4)
+ put_long_test(pc, (0x13fc << 16) | IPL_TRIGGER_DATA);
+#else
+ // move.w #x,xxx.L (4 * 4 + 4)
+ put_long_test(pc, (0x33fc << 16) | IPL_TRIGGER_DATA);
+#endif
+ pc += 4;
+ put_long_test(pc, IPL_TRIGGER_ADDR);
+ pc += 4;
// moveq #x,d0 (4 cycles)
- put_word_test(pc + 2, 0x7000 | interrupt_delay_cnt);
- // move.b d0,0xdc0000 (RTCW) (8 + 4 + 4)
- put_word_test(pc + 4, 0x13c0);
- put_long_test(pc + 6, IPL_TRIGGER_ADDR);
+ int shift = interrupt_delay_cnt;
+ int ashift;
+ if (shift > 63) {
+ shift -= 63;
+ ashift = 63;
+ } else {
+ ashift = 0;
+ }
+ if (shift > 63 || ashift > 63) {
+ wprintf(_T("IPL delay count too large!\n"));
+ abort();
+ }
+
+ put_word_test(pc, 0x7000 | (ashift & 63));
+ pc += 2;
// ror.l d0,d0 (4 + 4 + d0 * 2 cycles)
- put_word_test(pc + 10, 0xe0b8);
+ put_word_test(pc, 0xe0b8);
+ pc += 2;
+ // moveq #x,d0 (4 cycles)
+ put_word_test(pc, 0x7000 | (shift & 63));
+ pc += 2;
+ // ror.l d0,d0 (4 + 4 + d0 * 2 cycles)
+ put_word_test(pc, 0xe0b8);
+ pc += 2;
// restore CCR
// move d7,ccr
- put_word_test(pc + 12, 0x44c7); // 12 cycles
- put_word_test(pc + 14, NOP_OPCODE); // 4 cycles
- pc += 16;
+ put_word_test(pc, 0x44c7); // 12 cycles
+ pc += 2;
+ put_word_test(pc, NOP_OPCODE); // 4 cycles
+ pc += 2;
+ put_word_test(pc, NOP_OPCODE); // 4 cycles
+ pc += 2;
if (feature_interrupts >= 3) {
// or #$8000,sr
put_long_test(pc, 0x007c8000);
pc += handle_specials_misc(opc, pc, dp, &isconstant_src);
if (fpumode) {
- // append fnop so that we detect pending FPU exceptions immediately
+ // append FNOP so that we detect pending FPU exceptions immediately
put_long_test(pc, 0xf2800000);
pc += 4;
}
uaecptr nextpc;
srcaddr = 0xffffffff;
dstaddr = 0xffffffff;
+
+ if (opc == 0x4efb && get_word_debug(opcode_memory_address + 2) == 0x06d4)
+ printf("");
+
uae_u32 dflags = m68k_disasm_2(out, sizeof(out) / sizeof(TCHAR), opcode_memory_address, NULL, 0, &nextpc, 1, &srcaddr, &dstaddr, 0xffffffff, 0);
if (verbose) {
my_trim(out);
}
}
}
+
+
+ if (srcaddr == 0x006b022e)
+ printf("");
// disassembler may set this
out_of_test_space = false;
}
#endif
- uaecptr branch_target = 0xffffffff;
- uaecptr branch_target_pc = 0xffffffff;
+ branch_target = 0xffffffff;
+ branch_target_pc = 0xffffffff;
int bc = isbranchinst(dp);
if (bc) {
if (bc < 0) {
if (regs.sr & 0x2000)
prev_s_cnt++;
- if (subtest_count == 19)
+ if (subtest_count == 77171)
printf("");
// execute test instruction(s)
}
if (safe_memory_mode) {
skipped = 1;
- }
+ }
}
// skip exceptions if loop mode and not CC instruction
}
}
if (cpu_lvl <= 1 && (last_cpu_cycles != cpu_cycles || first_cycles)) {
- dst = store_reg(dst, CT_CYCLES, last_cpu_cycles, cpu_cycles, first_cycles ? 0 : -1);
+ dst = store_reg(dst, CT_CYCLES, last_cpu_cycles, cpu_cycles, first_cycles ? sz_word : -1);
last_cpu_cycles = cpu_cycles;
first_cycles = 0;
}
if (lookup->mnemo == i_ILLG || fpuopcode == FPUOPP_ILLEGAL)
break;
- bool nextround = false;
+ int nextround = 0;
if (target_address != 0xffffffff) {
target_ea_src_cnt++;
if (target_ea_src_cnt >= target_ea_src_max) {
target_ea_src_cnt = 0;
if (target_ea_src_max > 0)
- nextround = true;
+ nextround = 1;
}
target_ea_dst_cnt++;
if (target_ea_dst_cnt >= target_ea_dst_max) {
target_ea_dst_cnt = 0;
if (target_ea_dst_max > 0)
- nextround = true;
+ nextround = 1;
}
target_ea[0] = 0xffffffff;
target_ea[1] = 0xffffffff;
}
generate_target_registers(target_address, cur_regs.regs);
} else {
- nextround = true;
+ nextround = 1;
}
// interrupt delay test
if (feature_interrupts >= 2) {
interrupt_delay_cnt++;
- if (interrupt_delay_cnt >= MAX_INTERRUPT_DELAY) {
+ if (interrupt_delay_cnt > 2 * 63) {
break;
} else {
- nextround = true;
+ nextround = -1;
rounds = 1;
quick = 0;
}
}
if (target_opcode_address != 0xffffffff || target_usp_address != 0xffffffff) {
- nextround = false;
+ nextround = 0;
target_ea_opcode_cnt++;
if (target_ea_opcode_cnt >= target_ea_opcode_max) {
target_ea_opcode_cnt = 0;
if (target_ea_opcode_max > 0)
- nextround = true;
+ nextround = 1;
} else {
quick = 0;
}
}
}
- cur_regs.regs[0] &= 0xffff;
- cur_regs.regs[8] &= 0xffff;
- cur_regs.regs[8 + 6]--;
- cur_regs.regs[15] -= 2;
+ if (nextround >= 0) {
+ cur_regs.regs[0] &= 0xffff;
+ cur_regs.regs[8] &= 0xffff;
+ cur_regs.regs[8 + 6]--;
+ cur_regs.regs[15] -= 2;
+ rnd_seed_prev = rnd_seed;
+ rand8_cnt_prev = rand8_cnt;
+ rand16_cnt_prev = rand16_cnt;
+ rand32_cnt_prev = rand32_cnt;
+ xorshiftstate_prev = xorshiftstate;
+ }
}
markfile(dir);
compressfiles(dir);
+ mergefiles(dir);
+
wprintf(_T("- %d tests\n"), subtest_count);
}
feature_test_rounds_opcode = 0;
ini_getvalx(ini, sections, _T("min_opcode_test_rounds"), &feature_test_rounds_opcode);
+ max_file_size = 200;
+ ini_getvalx(ini, sections, _T("max_file_size"), &max_file_size);
+
ini_getstringx(ini, sections, _T("feature_instruction_size"), &feature_instruction_size_text);
for (int i = 0; i < _tcslen(feature_instruction_size_text); i++) {
TCHAR c = _totupper(feature_instruction_size_text[i]);
static uae_u32 stackaddr_ptr;
static uae_u8 *opcode_memory_end;
+#define MAX_IPL_PC_VALUES 4
+static uae_u32 ipl_pc[MAX_IPL_PC_VALUES];
+static int ipl_pc_cnt[MAX_IPL_PC_VALUES];
+
static char opcode[32], group[32], cpustr[10];
#ifndef M68K
return getchar();
}
-static uae_u8 *load_file(const char *path, const char *file, uae_u8 *p, int *sizep, int exiterror, int candirect)
+static int load_file_offset(FILE *f, int *foffsetp)
+{
+ int size = -1;
+ unsigned char buf[4] = { 0 };
+ fseek(f, *foffsetp, SEEK_SET);
+ fread(buf, 1, sizeof(buf), f);
+ if (buf[0] == 0xff && buf[1] == 0xff && buf[2] == 0xff && buf[3] == 0xff) {
+ fread(buf, 1, sizeof(buf), f);
+ size = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0);
+ if (size == 0) {
+ *foffsetp = -1;
+ return 0;
+ }
+ *foffsetp = *foffsetp + size + 8;
+ return size;
+ }
+ *foffsetp = -1;
+ return -1;
+}
+
+static uae_u8 *load_file(const char *path, const char *file, uae_u8 *p, int *sizep, int *foffsetp, int exiterror, int candirect)
{
char fname[256];
uae_u8 *unpack = NULL;
int unpackoffset = 0;
int size = 0;
+ int foffset = foffsetp ? *foffsetp : 0;
- strcpy(fname, path);
- strcat(fname, file);
- if (strchr(file, '.')) {
- fname[strlen(fname) - 1] = 'z';
+ if (path) {
+ strcpy(fname, path);
+ strcat(fname, file);
+ if (strchr(file, '.')) {
+ fname[strlen(fname) - 1] = 'z';
+ } else {
+ strcat(fname, ".gz");
+ }
} else {
- strcat(fname, ".gz");
+ strcpy(fname, file);
}
FILE *f = fopen(fname, "rb");
if (f) {
- fseek(f, 0, SEEK_END);
- int gsize = ftell(f);
- fseek(f, 0, SEEK_SET);
+ int gsize;
+ if (foffsetp) {
+ gsize = load_file_offset(f, foffsetp);
+ if (gsize == 0) {
+ return NULL;
+ }
+ if (gsize > 0) {
+ *sizep = gsize;
+ }
+ }
+ if (*sizep <= 0) {
+ fseek(f, 0, SEEK_END);
+ gsize = ftell(f);
+ fseek(f, 0, SEEK_SET);
+ }
+
uae_u8 *gzbuf = NULL;
if (prealloc) {
if (!prealloc_gzip) {
}
}
if (!unpack) {
- sprintf(fname, "%s%s", path, file);
+ if (path) {
+ sprintf(fname, "%s%s", path, file);
+ } else {
+ strcpy(fname, file);
+ }
f = fopen(fname, "rb");
if (!f) {
if (exiterror) {
}
return NULL;
}
+ if (foffsetp) {
+ size = load_file_offset(f, foffsetp);
+ if (size == 0) {
+ return NULL;
+ }
+ if (size > 0) {
+ *sizep = size;
+ }
+ }
size = *sizep;
- if (size < 0) {
+ if (size <= 0) {
fseek(f, 0, SEEK_END);
size = ftell(f);
fseek(f, 0, SEEK_SET);
static void set_interrupt(void)
{
- if (interrupt_count < 15) {
- volatile uae_u16 *intena = (uae_u16 *)0xdff09a;
- volatile uae_u16 *intreq = (uae_u16 *)0xdff09c;
- uae_u16 mask = 1 << interrupt_count;
- test_intena = mask | 0x8000 | 0x4000;
- test_intreq = mask | 0x8000;
- *intena = test_intena;
- *intreq = test_intreq;
+ if (interrupttest == 1) {
+ if (interrupt_count < 15) {
+ volatile uae_u16 *intena = (uae_u16*)0xdff09a;
+ volatile uae_u16 *intreq = (uae_u16*)0xdff09c;
+ uae_u16 mask = 1 << interrupt_count;
+ test_intena = mask | 0x8000 | 0x4000;
+ test_intreq = mask | 0x8000;
+ *intena = test_intena;
+ *intreq = test_intreq;
+ }
+ }
+ if (interrupttest == 2) {
+ volatile uae_u16 *intena = (uae_u16*)0xdff09a;
+ volatile uae_u16 *intreq = (uae_u16*)0xdff09c;
+ volatile uae_u16 *serper = (uae_u16*)0xdff032;
+ *serper = IPL_TRIGGER_SERPER;
+ *intena = 0x8000 | 0x4000 | IPL_TRIGGER_INTMASK;
+ *intreq = IPL_TRIGGER_INTMASK;
}
}
static void clear_interrupt(void)
{
- volatile uae_u16 *intena = (uae_u16 *)0xdff09a;
- volatile uae_u16 *intreq = (uae_u16 *)0xdff09c;
+ volatile uae_u16 *intena = (uae_u16*)0xdff09a;
+ volatile uae_u16 *intreq = (uae_u16*)0xdff09c;
*intena = 0x7fff;
*intreq = 0x7fff;
}
outbp += strlen(outbp);
sprintf(outbp, "S=%d", supercnt);
outbp += strlen(outbp);
- for (int i = 0; i < 128; i++) {
+ for (short i = 0; i < 128; i++) {
if (exceptioncount[0][i] || exceptioncount[1][i] || exceptioncount[2][i]) {
if (i == 2 || i == 3) {
sprintf(outbp, " E%02d=%d/%d/%d", i, exceptioncount[0][i], exceptioncount[1][i], exceptioncount[2][i]);
}
strcat(outbp, "\n");
outbp += strlen(outbp);
+ if (interrupttest == 2) {
+ for (short i = 0; i < MAX_IPL_PC_VALUES; i++) {
+ if (ipl_pc[i]) {
+ sprintf(outbp, "%08x:%d ", ipl_pc[i], ipl_pc_cnt[i]);
+ outbp += strlen(outbp);
+ }
+ }
+ strcat(outbp, "\n");
+ outbp += strlen(outbp);
+ }
if (fpu_approxcnt) {
sprintf(outbp, "FPU approximate matches: %d\n", fpu_approxcnt);
}
#ifdef AMIGA
- if (interrupttest == 1) {
+ if (interrupttest) {
set_interrupt();
}
#endif
+
if (cpu_lvl == 1) {
execute_test010(&test_regs);
} else if (cpu_lvl >= 2) {
p = validate_test(p, ignore_errors, ignore_sr, &cur_regs, &test_regs, &last_regs, opcodeendsizeextra);
+ if (interrupttest == 2) {
+ short found = 0;
+ for (short i = 0; i < MAX_IPL_PC_VALUES; i++) {
+ if (ipl_pc[i] == test_regs.pc) {
+ ipl_pc_cnt[i]++;
+ found = 1;
+
+ }
+ }
+ if (!found) {
+ for (short i = 0; i < MAX_IPL_PC_VALUES; i++) {
+ if (ipl_pc[i] == 0) {
+ ipl_pc[i] = test_regs.pc;
+ ipl_pc_cnt[i] = 1;
+ break;
+ }
+ }
+ }
+ }
+
testcnt++;
if (super)
supercnt++;
uae_u8 data[4] = { 0 };
uae_u32 v;
char tfname[256];
- int filecnt = 1;
+ int filecnt = 0;
uae_u32 starttimeid;
int lvl;
sprintf(tfname, "%s/0000.dat", opcode);
size = -1;
- uae_u8 *headerfile = load_file(path, tfname, NULL, &size, 1, 1);
+ int foffset = 0;
+ uae_u8 *headerfile = load_file(path, tfname, NULL, &size, &foffset, 1, 1);
if (!headerfile) {
+ printf("Data file failed to open\n");
exit(0);
}
int headoffset = 0;
}
size = test_memory_size;
- load_file(path, "tmem.dat", test_memory, &size, 1, 0);
+ load_file(path, "tmem.dat", test_memory, &size, NULL, 1, 0);
if (size != test_memory_size) {
printf("tmem.dat size mismatch\n");
exit(0);
}
}
+ int otestcnt = -1;
+ printf("offset = %d\n", foffset);
for (;;) {
- printf("%s (%s). %u...\n", tfname, group, testcnt);
+ if (otestcnt != testcnt) {
+ printf("%s (%s). %u...\n", tfname, group, testcnt);
+ otestcnt = testcnt;
+ }
sprintf(tfname, "%s/%04d.dat", opcode, filecnt);
- test_data_size = -1;
- test_data = load_file(path, tfname, test_data_prealloc, &test_data_size, 0, 1);
+ test_data_size = 0;
+ test_data = load_file(path, tfname, test_data_prealloc, &test_data_size, &foffset, 0, 1);
+
+ printf("%p %d\n", test_data, foffset);
+
if (!test_data) {
+ if (foffset < 0) {
+ filecnt++;
+ foffset = 0;
+ continue;
+ }
if (askifmissing) {
printf("Couldn't open '%s%s'. Type new path and press enter.\n", path, tfname);
path[0] = 0;
break;
}
- filecnt++;
+ if (foffset <= 0) {
+ filecnt++;
+ }
}
if (errorcnt == 0) {
}
low_memory_size = -1;
- low_memory_temp = load_file(path, "lmem.dat", NULL, &low_memory_size, 0, 1);
+ low_memory_temp = load_file(path, "lmem.dat", NULL, &low_memory_size, NULL, 0, 1);
high_memory_size = -1;
- high_memory_temp = load_file(path, "hmem.dat", NULL, &high_memory_size, 0, 1);
+ high_memory_temp = load_file(path, "hmem.dat", NULL, &high_memory_size, NULL, 0, 1);
#ifndef M68K
low_memory = calloc(1, 32768);