From 146e2cdad6c2bcc49cbd7738652e62e9375244d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Izaguirre?= Date: Tue, 17 Aug 2021 12:50:04 +0200 Subject: [PATCH] trace Acorn ROM entrypoints --- traceApplecorn.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/traceApplecorn.go b/traceApplecorn.go index 51ebae4..5fdf4b8 100644 --- a/traceApplecorn.go +++ b/traceApplecorn.go @@ -29,7 +29,7 @@ type mosCallData struct { } const ( - applecornKernelStart uint16 = 0xc000 // Code above this is out of BBC territory + applecornKernelStart uint16 = 0xd000 // Code above this is out of BBC territory applecornNoCaller uint16 = 0xffff ) @@ -62,8 +62,19 @@ func (t *traceApplecorn) inspect() { } pc, sp := t.a.cpu.GetPCAndSP() - inKernel := pc >= applecornKernelStart + if pc == 0x8000 { + regA, _, _, _ := t.a.cpu.GetAXYP() + fmt.Printf("BBC MOS call to $%04x LANGUAGE(%02x)\n", pc, regA) + } else if pc == 0x8003 { + regA, _, regY, _ := t.a.cpu.GetAXYP() + address := t.a.mmu.peekWord(0xf2 + uint16(regY)) + command := t.getTerminatedString(address, 0x0d) + fmt.Printf("BBC MOS call to $%04x SERVICE(A=%v, \"%s\")\n", pc, regA, command) + + } + + inKernel := pc >= applecornKernelStart if !t.wasInKernel && inKernel { regA, regX, regY, _ := t.a.cpu.GetAXYP()