4 typedef int (handler_6502_t) (void);
15 static struct opcode_map *current_inst;
16 static int current_exec_index;
75 struct opcode_map opcode_list [255] = {
81 * awk '{print "int func_" $2 "(void) {\n\n}"}' < opcode-6502 | sort | uniq
311 * return execution cycle count
313 int decode6502(unsigned char inst, int *cycle_cnt, int *inst_len) {
315 struct opcode_map * omap = &opcode_list[inst];
316 if (omap->func == NULL) {
320 dprint("decode inst: %02x > %s, %d cycle, %d len\n",
321 inst, omap->mnemonic, omap->cycle, omap->inst_len);
322 *cycle_cnt = omap->cycle;
323 *inst_len = omap->inst_len;
326 current_exec_index = 0;
331 int execute6502(void) {
332 current_exec_index++;
333 return current_inst->func();
336 int init_6502core(void) {
338 current_exec_index = 0;