static int notify(processor_t::idp_notify msgid, ...) { // Various messages: va_list va; va_start(va, msgid); // A well behaving processor module should call invoke_callbacks() // in his notify() function. If this function returns 0, then // the processor module should process the notification itself // Otherwise the code should be returned to the caller: int code = invoke_callbacks(HT_IDP, msgid, va); if ( code ) return code; switch ( msgid ) { case processor_t::init: helper.create("$ z80"); break; case processor_t::newprc: { int np = va_arg(va, int); pflag = features[np]; ph.assemblers = i8085asms; if ( isZ80() ) ph.assemblers = Z80asms; if ( is64180() ) ph.assemblers = HD64180asms; if ( isGB() ) ph.assemblers = GBasms; { char buf[MAXSTR]; if ( helper.supval(-1, buf, sizeof(buf)) > 0 ) set_device_name(buf, IORESP_NONE); } } break; case processor_t::newfile: if ( strcmp(inf.procName, "z180") == 0 ) { char cfgfile[QMAXFILE]; get_cfg_filename(cfgfile, sizeof(cfgfile)); if ( choose_ioport_device(cfgfile, device, sizeof(device), parse_area_line0) ) set_device_name(device, IORESP_AREA); } break; default: break; } va_end(va); return(1); }
//---------------------------------------------------------------------- int i5_emu(void) { uint32 Feature = cmd.get_canon_feature(); flow = ((Feature & CF_STOP) == 0); if ( (Feature & CF_USE1) ) LoadArg(cmd.Op1); if ( (Feature & CF_USE2) ) LoadArg(cmd.Op2); if ( Feature & CF_JUMP ) QueueMark(Q_jumps,cmd.ea); switch ( cmd.itype ) { case I5_mov: case I5_mvi: case Z80_ld: // if ( ! fail ) R1.doInt( R2.value() ); // else R1.undef(); break; case Z80_jp: case Z80_jr: // Z80 case Z80_ret: // Z80 if ( cmd.Op1.Cond != oc_not ) break; case I5_jmp: if ( cmd.Op2.type == o_phrase ) QueueMark(Q_jumps,cmd.ea); case I5_ret: flow = 0; break; case I5_rstv: ua_add_cref(0,toEA(codeSeg(0x40,0),0x40),fl_CN); break; case I5_rst: { int mul = (isZ80() ? 1 : 8); ushort offset = ushort(cmd.Op1.value * mul); ua_add_cref(0,toEA(codeSeg(offset,0),offset),fl_CN); } case I5_call: case I5_cc: case I5_cnc: case I5_cz: case I5_cnz: case I5_cpe: case I5_cpo: case I5_cp: case I5_cm: case Z80_exx: // Z80 // i5_CPUregs.bc.undef(); // i5_CPUregs.de.undef(); // i5_CPUregs.hl.undef(); // i5_CPUregs.af.undef(); // i5_CPUregs.ix.undef(); // i5_CPUregs.iy.undef(); break; default: // R1.undef(); // R2.undef(); break; } if ( Feature & CF_CHG1 ) SaveArg(cmd.Op1); if ( Feature & CF_CHG2 ) SaveArg(cmd.Op2); if ( flow ) ua_add_cref(0,cmd.ea+cmd.size,fl_F); return 1; }
inline bool is8085(void) { return !isZ80(); }