static int load_number(struct load_state *S) { int x; READ_VECTOR(S, &x, sizeof(ktap_number)); return x; }
uint g65816_device::g65816i_read_8_vector(uint address) { if (!READ_VECTOR.isnull()) return READ_VECTOR(*m_program, address, 0xff); else return g65816i_read_8_normal(address); }
static int load_int(struct load_state *S) { int x; READ_VECTOR(S, &x, sizeof(int)); return x; }
static int load_debuginfo(struct load_state *S, ktap_proto *f) { int i,n; f->source = READ_STRING(S); n = READ_INT(S); f->sizelineinfo = n; f->lineinfo = NEW_VECTOR(S, n * sizeof(int)); READ_VECTOR(S, f->lineinfo, n * sizeof(int)); n = READ_INT(S); f->locvars = NEW_VECTOR(S, n * sizeof(struct ktap_locvar)); f->sizelocvars = n; for (i = 0; i < n; i++) f->locvars[i].varname = NULL; for (i = 0; i < n; i++) { f->locvars[i].varname = READ_STRING(S); f->locvars[i].startpc = READ_INT(S); f->locvars[i].endpc = READ_INT(S); } n = READ_INT(S); for (i = 0; i < n; i++) f->upvalues[i].name = READ_STRING(S); return 0; }
static long load_number(struct load_state *S) { long x; READ_VECTOR(S, &x, sizeof(ktap_number)); return x; }
static int load_code(struct load_state *S, ktap_proto *f) { int n = READ_INT(S); f->sizecode = n; f->code = NEW_VECTOR(S, n * sizeof(ktap_instruction)); READ_VECTOR(S, f->code, n * sizeof(ktap_instruction)); return 0; }
static int load_header(struct load_state *S) { u8 h[KTAPC_HEADERSIZE]; u8 s[KTAPC_HEADERSIZE]; kp_header(h); READ_VECTOR(S, s, KTAPC_HEADERSIZE); if (memcmp(h, s, N0) == 0) return 0; if (memcmp(h, s, N1) != 0) error(S, "not a"); else if (memcmp(h, s, N2) != 0) error(S, "version mismatch in"); else if (memcmp(h, s, N3) != 0) error(S, "incompatible"); else error(S,"corrupted"); return -1; }