From 9627a7cdfcf47a162d9913683ef0a40599aa93f0 Mon Sep 17 00:00:00 2001 From: Cyneprepou4uk Date: Mon, 14 Feb 2022 21:38:37 +0300 Subject: [PATCH] Update asm.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit получение инфы о том, куда будет переход после RTS и RTI --- src/asm.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/asm.cpp b/src/asm.cpp index 525f0cb0..757d6e59 100644 --- a/src/asm.cpp +++ b/src/asm.cpp @@ -714,7 +714,17 @@ char *bzk_Disassemble(int addr, uint8 *opcode) { tmp = GetMem(tmp) | GetMem(tmp + 1) << 8; sprintf(str, "%u|%u", bzk_GetNesFileAddress(tmp), bzk_getBank(tmp)); break; - + + //return from subroutine + case 0x60: //RTS + tmp = GetMem(((X.S) + 1)|0x0100) + (GetMem(((X.S) + 2)|0x0100) << 8) + 0x01 + sprintf(str, "%u|%u", bzk_GetNesFileAddress(tmp), bzk_getBank(tmp)); + + //return from interrupt + case 0x40: //RTI + tmp = GetMem(((X.S) + 2)|0x0100) + (GetMem(((X.S) + 3)|0x0100) << 8) + sprintf(str, "%u|%u", bzk_GetNesFileAddress(tmp), bzk_getBank(tmp)); + //for all other other opcodes, which are immediate and 1-byte instructions default: strcpy(str, "?|?");