News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Any interest in a CPC reverse engineering tool?

Started by crabfists, 20:38, 24 March 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

crabfists

I uploaded a new build of CPC Analyser. 

New features:

  • CPC 6128 support
  • Lua scripting support - for custom viewers.

Fixes:
  • Improved snapshot compatibility

Lots of other improvements...

Unfortunately, I have temporarily removed external ROM support due to complications with getting 6128 support working.

Get it from here.
https://colourclash.co.uk/cpc-analyser/

andycadley

So I finally got around to sitting down and trying this out. Seems like a pretty powerful tool, if I could figure out how to operate it.

First issue was it really doesn't seem to like high DPI displays (the text was absolutely tiny). I've fiddled with the compatibility settings to try and tweak it to at least be readable, although that's possibly what's then caused other issues.

I can't quite figure out how the graphics viewer is rendering the image when in "bitmap" mode (or what the other modes mean!). If I move the graphics view on by a single byte, for example, it doesn't seem to be doing what I'd expect - that is rendering byte directly in the selected Mode, based on the width of columns selected. And there are a few oddities like displaying some numbers in decimal even though hex mode is selected, but nothing insurmountable.

Is there a good tutorial on how to use it? Or some kind of user guide? I saw a YouTube video but it's a bit tricky to follow along with that when really I'm looking for specifics on individual bits of the tool.

Overall though, it definitely looks powerful and I'd rather use it than write my own bespoke thing. The ability to add custom viewers, in particular, seems like it could be very useful if I could figure it all out.

crabfists

Thanks for the honest feedback. :)

Quote from: andycadley on 17:33, 16 May 24First issue was it really doesn't seem to like high DPI displays (the text was absolutely tiny). I've fiddled with the compatibility settings to try and tweak it to at least be readable, although that's possibly what's then caused other issues.
To use a bigger font, you can put a ttf font in the Fonts directory and specify it in the GlobalConfig.json file. See this note in the Wiki:

https://github.com/TheGoodDoktor/8BitAnalysers/wiki/Configuring#high-resolution-displays

I can recommend the cousine regular font from here https://fonts.google.com/specimen/Cousine. It could be worth bundling it in the download package.

Quote from: andycadley on 17:33, 16 May 24I can't quite figure out how the graphics viewer is rendering the image when in "bitmap" mode (or what the other modes mean!). If I move the graphics view on by a single byte, for example, it doesn't seem to be doing what I'd expect - that is rendering byte directly in the selected Mode, based on the width of columns selected.
It took me a while to get my head around how it worked at first. The thing to bear in mind is, it draws in vertical strips/columns. The width of the strips come from the XSize value. I know you're not keen on YT videos but this video shows how to find graphics using the Graphics view. It might be the same one you already watched though.

.

As for the modes, I would stick to the Bitmap mode. The other modes were added for the Spectrum version and I'm not sure they make sense for the CPC version.

Quote from: andycadley on 17:33, 16 May 24And there are a few oddities like displaying some numbers in decimal even though hex mode is selected, but nothing insurmountable.
Could you give details on where this happens please?

Quote from: andycadley on 17:33, 16 May 24Is there a good tutorial on how to use it? Or some kind of user guide?
Not really. Only the Youtube videos made by me and https://www.youtube.com/@TheDoktor123. Some work has been started on the Wiki but it's got a long way to go.

If you want to ask any other questions feel free to send me a DM or to come and ask questions on the Discord.

andycadley

Quote from: crabfists on 21:49, 16 May 24Thanks for the honest feedback. :)

Quote from: andycadley on 17:33, 16 May 24First issue was it really doesn't seem to like high DPI displays (the text was absolutely tiny). I've fiddled with the compatibility settings to try and tweak it to at least be readable, although that's possibly what's then caused other issues.
To use a bigger font, you can put a ttf font in the Fonts directory and specify it in the GlobalConfig.json file. See this note in the Wiki:

https://github.com/TheGoodDoktor/8BitAnalysers/wiki/Configuring#high-resolution-displays

I can recommend the cousine regular font from here https://fonts.google.com/specimen/Cousine. It could be worth bundling it in the download package.

Thanks for that, I've tried it and it fixes the font problem at least (well it fixes it if I only use my laptop screen, I'm expecting it won't be much fun when I have it plugged into my external monitor as they have very different DPI settings). It doesn't really fix the layout problems though, every starts off all squished into a small window and, even maximised, controls have a habit of being hidden at the end of big scrollable regions. So using the graphics viewer part, for example, I have to set the mode at the top of the panel, scroll it enough to see the X/Y size settings, change them then scroll back up to see the memory I'm examining, then scroll back down to tweak it....

Quote from: crabfists on 21:49, 16 May 24
Quote from: andycadley on 17:33, 16 May 24I can't quite figure out how the graphics viewer is rendering the image when in "bitmap" mode (or what the other modes mean!). If I move the graphics view on by a single byte, for example, it doesn't seem to be doing what I'd expect - that is rendering byte directly in the selected Mode, based on the width of columns selected.
It took me a while to get my head around how it worked at first. The thing to bear in mind is, it draws in vertical strips/columns. The width of the strips come from the XSize value. I know you're not keen on YT videos but this video shows how to find graphics using the Graphics view. It might be the same one you already watched though.

Yeah, that's how I expected it to work. And for Mode 1 that's exactly what it seems to be doing (I could easily pick out the graphics in a Manic Miner snapshot). I'm not sure it's working properly for Mode 0 though. Incrementing the memory address by 1 isn't doing what I'd expect it to be doing in that case. And weirdly the view of the memory in the "Code Analysis" bit doesn't match up at all in Mode 0, so it's probably a bit buggy.

Quote from: crabfists on 21:49, 16 May 24
Quote from: andycadley on 17:33, 16 May 24And there are a few oddities like displaying some numbers in decimal even though hex mode is selected, but nothing insurmountable.
Could you give details on where this happens please?

Most notably, the text that appears in the scrollbar thing next to the graphics viewer (see attached screenshot)

The offset in the hover-over for the graphics view seems to be decimal as well (I can't entirely decide whether it's preferable in that case or whether hex would be better just for consistency).

Quote from: crabfists on 21:49, 16 May 24If you want to ask any other questions feel free to send me a DM or to come and ask questions on the Discord.

Cool. Will quite possibly do that after playing around a bit more.

andycadley

FWIW, having fiddled around enough to get it building in Visual Studio, I think it (and some other) problems stem from the code sometimes treating Xsize and Ysize as if measured in bits and sometimes as if measured in pixels. Probably a bit of a relic of its Spectrum legacy (where the two things are the same).

Changing the CPC specific bits in DrawPhysicalMemoryAsGraphicsColumn to both use memAddr += 2 fixes the viewer, but still leaves other bugs in Mode 0. I suspect it should always just treat them as bits (and thus be memAddr++ as it is for the C64 and Speccy formats). That seems to fix weird issues I was seeing with the hover over address not being right, but doesn't fix how the data looks in the Code Analysis window (which is definitely assuming the values are pixels).

Powered by SMFPacks Menu Editor Mod