Tuesday, January 8, 2013

So I was trying to run a test build of an older version of Rush Hour and decided it was time to use the debug facilities of MESS. So far, I've done all my TI work without using any debuggers and I thought it might be nice to cheat a little. Sadly, MESS is acting acting a bit weird.

I set some breakpoints at the start of the cartridge, and they didn't take. After fighting with that for a while, I tried running a simple test cart I was using earlier. That cart eventually hits a "jmp $" instruction and stops. I figured I could at least confirm that the cart is being loaded into the right location.

I think I found the problem. The debugger seems to be misinterpreting the instructions in the disassembly window. Maybe this is causing the breakpoints to be ignored since MESS thinks the address is in the middle of a multiword instruction. Below I've compared the same chunk of code as seen in the debugger window and the objdump disassembly.

From MESS (incorrect):
60C2: 10FF                     socb *r0, *r12+
60C4: 064A C68B           szc r6, @>8bc6(r8)
60C8: 06A0                     a r6, r0
60CA: 6768 C0C1 0702  s @>c1c0(r7), @>0207(r1)

From objdump (correct):
60c2: 10ff              jmp -2
60c4: 064a            dect r10
60c6: c68b            mov r11, *r10
60c8: 06a0 6768   bl @>6768
60cc: c0c1            mov r1, r3

So it looks like I should take a look at the MESS sources and see what's going on here. Most likely, there's something misconfigured somewhere.

2 comments:

  1. Unfortunately the debugger in MESS (at least for the 9900) is non-functional. IIRC, as it was explained to me, the debugger is pretty much hard coded for little-endian architectures, and consequently gets the instruction decoding hopelessly wrong. Michael Zapf (maintainer of the 99/4A emulation in MESS) can give you more information. He hangs out on the MESS/MAME developer forums.

    Cheers

    Willsy

    ReplyDelete
  2. Thanks, that's great to know. I was just assuming I did something dumb and everyone else was having a great time enjoying their debugged code.

    I'll have to poke around the MESS forums and see what I can find. If I do get debugger support working, I'll have to send them a patch.

    Thanks again.

    ReplyDelete