Viewing banks with emu debugger / MON command

Get technical support from the community & developers with specific X16 programs if you can't find the solution elsewhere
(for general non-support related chat about programs please comment directly under the program in the software library)
Post Reply
ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

Viewing banks with emu debugger / MON command

Post by ZeroByte »


I've spent time needlessly banging my head against a wall here. I'm starting to learn to work with the banked RAM. So I wrote a routine to load stuff into hi memory, and then wanted to go into MON or the debugger just to see that this was successful. I read that MON uses Oxx to set the RAM bank, and the debugger uses B RAM xx to set the RAM bank. However, when doing either of these, I see the same seemingly random data over and over when I then do MA000 A0FF.

I'm guessing that I'm only ever seeing bank0 which the Kernal/BASIC use, and never the actual data.

Realizing that it must be user error, I decided to just bang out a quickie BASIC program to poke predictable values into the banks and then peek them back out again - this confirms that my banking is in fact working, but I still can't figure out what I'm doing wrong with my debug tools.

Q: In debugger, when I set, e.g.: B RAM 4 - does this cause the actual RAM bank to switch to 4 in the system? What about MON?

What commands should I use to just view the contents of the banks, but not actually meddle with the system state?

 

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Viewing banks with emu debugger / MON command

Post by JimmyDansbo »


In the debugger, you just do: DbankADDR so something like D4A000 will show code at address $A000 in bank 4. 

M4A000 would show the memory contents of $A000 in bank 4

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

Viewing banks with emu debugger / MON command

Post by ZeroByte »


I was just re-visiting the thread where you're discussing this topic but regarding the debug output when jumping into the kernal load API - this info wasn't explicit (or I missed it) but your screenshots gave me the clue I needed to get the debugger to show what I want. I just figured this syntax out and was about to come close my own thread lol.

But while we're at it, do you know the equivalent commands in the monitor (or do they not exist yet)?

Thanks for replying here!

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Viewing banks with emu debugger / MON command

Post by JimmyDansbo »



1 minute ago, ZeroByte said:




But while we're at it, do you know the equivalent commands in the monitor



I have no clue on how to use the monitor...

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
x16tial
Posts: 177
Joined: Sun Feb 07, 2021 8:23 pm

Viewing banks with emu debugger / MON command

Post by x16tial »


In the monitor use oxx, and make sure it 's not a Shift-O (like if you're in lower case mode), and make sure you use BOTH digits, so bank 0 would be 'o00', 255 would be 'off'  (use hex)

For inspecting vera memory use ov0 and ov1.  o by itself will reset back to main memory bank 0

to summarize for the monitor

banks: o00 to off   (switches both ram and rom banks)

vera: ov0 and ov1

o by itself: same as o00

(then use m to display whatever part of memory you're after)

pro tip: do a quick m 9f60, and the first two numbers will tell you what banks you're looking at (rom, ram)

(the rom bank is 0-7 and wraps around)

For the debugger:

the b command doesn't seem to work

but if you do m bbaaaa, it does, for example:

m 01a000

m 04c000

I haven't yet discovered how to display VERA memory in the debugger

derp, you guys already figured out the debugger above ?

 

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Viewing banks with emu debugger / MON command

Post by JimmyDansbo »



29 minutes ago, x16tial said:




I haven't yet discovered how to display VERA memory in the debugger



You just use V

v00000 = Address $0000 in bank 0

v10000 = Address $0000 in bank 1

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
x16tial
Posts: 177
Joined: Sun Feb 07, 2021 8:23 pm

Viewing banks with emu debugger / MON command

Post by x16tial »



Just now, JimmyDansbo said:




You just use V



v00000 = Address $0000 in bank 0



v10000 = Address $0000 in bank 1



Ah, very nice!

Post Reply