void UIDebugSH2::reserved3() { if (debugSH2) { bool ok; for(;;) { QString text = QInputDialog::getText(this, QtYabause::translate("Assembly code"), QtYabause::translate("Enter new assembly code") + ":", QLineEdit::Normal, QString(), &ok); if (ok && !text.isEmpty()) { char errorMsg[512]; int op = sh2iasm(text.toLatin1().data(), errorMsg); if (op != 0) { MappedMemoryWriteWord(debugSH2->regs.PC, op); break; } else QMessageBox::critical(QApplication::activeWindow(), QtYabause::translate("Error"), QString(errorMsg)); } else if (!ok) break; } } updateAll(); }
void CheatDoPatches(void) { int i; for (i = 0; ; i++) { switch (cheatlist[i].type) { case CHEATTYPE_NONE: return; case CHEATTYPE_ENABLE: if (cheatlist[i].enable == 0) continue; if (MappedMemoryReadWord(cheatlist[i].addr) != cheatlist[i].val) return; break; case CHEATTYPE_BYTEWRITE: if (cheatlist[i].enable == 0) continue; MappedMemoryWriteByte(cheatlist[i].addr, (u8)cheatlist[i].val); SH2WriteNotify(cheatlist[i].addr, 1); break; case CHEATTYPE_WORDWRITE: if (cheatlist[i].enable == 0) continue; MappedMemoryWriteWord(cheatlist[i].addr, (u16)cheatlist[i].val); SH2WriteNotify(cheatlist[i].addr, 2); break; case CHEATTYPE_LONGWRITE: if (cheatlist[i].enable == 0) continue; MappedMemoryWriteLong(cheatlist[i].addr, cheatlist[i].val); SH2WriteNotify(cheatlist[i].addr, 4); break; } } }