OpenMSX debugger: We have high level block commands like "showmem"/"cpu regs". Do raw (not beautified) block commands exist ?

Page 4/4
1 | 2 | 3 |

By ricbit

Champion (436)

ricbit's picture

31-05-2019, 17:22

It took me a while to understand tcl, but everything clicked when I realized it's just lisp with weirder syntax. I've seen it described at "lisp and bash met in a bar and had a kid".

By friguron

Expert (82)

friguron's picture

26-06-2019, 02:03

Hi, I have run a long way with my Poc, specially after starting using openmsx .tcl scripts folder to get many ideas regarding asking for proper info in real time (via socket)...

But for the 2 pieces of info I want to retrieve right now, I'm somehow lost. I can't figure out how to get this info (even getting ideas from the scripts folder contents...)

I'd like to know (if possible), the selected pages for any mapped memory object alive inside an openmsx session. That is:
1.- Inserted megaroms (which of the NN pages is selected for each of the 8/16KB mapped areas). Example using invented .tcl: "debug [carta read current_mapped_page[0]] "
2.- mapped memory: For a mapped memory object, I'd like to get the currently selected 16 KB pages. Again, example using invented .tcl: "debug [memory read current_mapped_page[0]] "

Is it achievable via some debugger command? (couldn't find any, after some investigation)

Thanks in advance.

PS: Here you have some teaser of my Poc (which still I don't know if might somewhat get a "quality usable" status in the near future): https://vimeo.com/344213712 (password: openmskiss)

By wouter_

Champion (412)

wouter_'s picture

26-06-2019, 10:10

Yes this is possible. Reading the (shared) status of all memory mappers in the system can be done via the MapperIO debuggable. This debuggable contains 4 bytes, corresponding to the 4x 16kB mapper pages. It is both readable and writable.

MegaROMs don't share state, so there's a debuggable per megaROM. See below for how to obtain the name of these debuggables. MegaROMs differ in the size of the switchable pages (typically 8kB or 16kB) and in the range spanned by these pages (e.g. full range 0x0000-0xffff, or only middle 32kB 0x4000-0xbfff). To abstract these differences the debuggable is always 64kB in size. Each byte in the debuggable indicates the selected page for that specific address. Thus for example the debuggable for a KonamiSCC mapper will return 255 for 0x0000-0x3fff and 0xc000-0xffff (those regions are not switchable) and return the same value for all 0x2000 addresses in the 4 switchable regions. For now only reading from this debuggable is implemented in openMSX.

To construct the name of the MegaROM-debuggable in a specific MSX slot, you can use the command slotmap to get the exact device name and append " romblocks" to it. The slotmap command is meant for interactive use. For use in a script, the command "machine_info slot <ps> <ss> <page>" may be more convenient. To check whether the device in a specific slot is a ROM or memory mapper you can use the command "machine_info device <device name>". This returns a Tcl dictionary. Use the entry with key=type to classify the device. Depending on the device type there may be other useful entries in this dictionary, for example roms also have a mappertype entry.

BTW you can use the command "debug list" to get a list of all debuggables and "debug desc <debuggable>" to get a short description for that debuggable. You can use machine_info and openmsx_info to get a list of all machine-specific or general openMSX info-topics. And use "help machine_info <topic>" to get a short description for that topic.

By friguron

Expert (82)

friguron's picture

26-06-2019, 11:00

Fantastic info. This should keep me occupied for many days.

Thanks!

By Manuel

Ascended (15551)

Manuel's picture

26-06-2019, 11:08

The selected mapper segment is also shown in the openMSX debugger GUI, which uses the mechanism described above. You might find it useful to check its source code.

Page 4/4
1 | 2 | 3 |