-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Feature/151 machine code monitor #358
base: master
Are you sure you want to change the base?
Draft: Feature/151 machine code monitor #358
Conversation
… files: home/F2 (start of file) and end/F8 (end of file)
Looks quite good. I was able to build the U64 target. As soon as I have set up my U64 again (still in a box from a Commodore party), I will test it out. I can see you are on the right track also with separating the editor by type. Have you been able to figure out what happens with files larger than 26K? |
Thanks Gideon! Please also have a look at the other PR I raised which, unlike the one here, is ready to be merged as it had a much smaller focus, namely to introduce a hex viewer for files rather than the C64's RAM. The issue I had on that other PR with not being able to open files larger than 26KiB is already resolved. It was probably due to memory exhaustion caused by duplicating the required buffer space. The new approach simply uses the single source of truth buffer into which the file is read, then on the fly creates its hex representation as the hex viewer traverses the buffer. Thus, only a small additional buffer for the current view window is needed. I also did some low level byte to hex conversion (rather than relying on I am facing a few issues with this PR here and I described them in the PR overview at the bottom. Maybe you have an idea how to resolve them. Many thanks! |
A full machine code monitor like the one in VICE would be great to have. |
Would quite like this feature actually, missed a monitor sorely on developing my own recent project targettiing the U64. So ended up by debugging using full memory dumps (and doing PC based comparisons and analysis using a PC based hex editor) A VICE like monitor via the Ultimate UI would be awesome. |
Not to mention, supporting the C128's MMU from an app running on the UII+(L) is probably not possible, because the MMU is invisible for DMA.. So such a monitor would be of limited use for the C128... but for a C64 with UII+ it would still be quite usefull. The biggest challenge I see is supporting changing the contents of $01, as it is also hidden from DMA, tho I think this is far less of a limitation for the c64. |
This is work in progress and not yet ready to be merged. This PR was raised to simplify discussion and tracking of outstanding work. It relies on changes introduced in #357 and assumes that PR has been merged.
Changes
Ultimate 64
DEVELOPER
feature flagTODO
Extend monitor (Shortcuts are inspired by the machine code monitors in Action Replay MK6 and Final Cartridge III):
F
): Opens popup that expects a string of syntaxAAAA,DD
.M
).@
): Opens popup that expects a string of syntaxAAAA
. View then refreshes with this address being shown in the first line.D
): Switches to assembly view which shows one 6510 instruction per line. Syntax:<Address> ' ' <Byte(s)> [' ' <Instruction>]
. Switch back to hex view withH
. Relative branches show the absolute target address, see address $E009 in the following example for a C64 with a first revision Kernal:D
: To ensure consistency with the file hex view, the first address shown in the assembly view is always a multiple of 8 bytes, e.g.0xE000
in the example above. However, depending on where exactly the CPU starts decoding instructions, this may not allow us to find a valid opcode. In order to cater for this, repeatedly pressingA
shifts the disassembly start address by 0 through 2 bytes relative to the first address shown in the editor's view. In the previous example, this would mean we try to disassemble from address0xE000
, then0xE001
, then0xE002
, before we revert toE000
.*
(since popular monitors already use "I" to mean "Inspect"). Disabled when first entering the monitor view.Open Questions
U64Machine :: get_all_memory
which is only implemented for U64.