mon bank question

All aspects of programming on the Commander X16.
Post Reply
wizardmountain
Posts: 4
Joined: Tue May 02, 2023 2:03 pm

mon bank question

Post by wizardmountain »

Hey everyone. I am looking for some clarification on certain behaviours in 'mon' as it relates to bank switching.

When I load up mon (in the emulator) and ask for address $9F20, I am shown what I assume is random garbage.
I want to try setting the VERA address registers to 00000, so I type in 00, 00, 00 for $9F20 - $9F22 in mon.

As soon as I hit enter though, the values revert back to the "garbage" that was there before.

Shouldn't I be able to set those register values?

Second part to the question... the documentation for mon found https://github.com/commanderx16/x16-doc ... Monitor.md here, talks about switching banks with the O command. When I did a O V0 command, thinking I may need to switch to video ram, and retried my write at $9F20, the value seemed to stick.

Basically, I'm unclear why mon won't save my values to vera address registers, as well as, what the bank switching in mon is actually doing. I thought bank switching was for ram/rom banks located at $A000 -> $FFFF?

Any guidance would be appreciated!
User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Re: mon bank question

Post by StephenHorn »

Most likely, the mon is resetting the registers when it adds text to the screen, and is failing to backup/restore the values.
Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: mon bank question

Post by TomXP411 »

Every time you write to the screen, the values on VERA's address vectors change. Since the OS has to write to the screen, the values change. You press RETURN in the monitor... the values change.

The VERA address vector is extremely volatile; every single thing that writes data to the screen has to set the address, so you can't set it with the M command in the monitor and expect it to stay at that value after pressing the enter key.
wizardmountain
Posts: 4
Joined: Tue May 02, 2023 2:03 pm

Re: mon bank question

Post by wizardmountain »

As to why the values are changing, this now makes sense. I'm embarassed I didn't clue in to that.

I'm guessing when I use the 'O' command to change banks... v0 would be the first FFFF of the vera memory, and v1 would be the second bit?
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: mon bank question

Post by TomXP411 »

wizardmountain wrote: Wed May 10, 2023 7:41 pm As to why the values are changing, this now makes sense. I'm embarassed I didn't clue in to that.

I'm guessing when I use the 'O' command to change banks... v0 would be the first FFFF of the vera memory, and v1 would be the second bit?
I think so. I haven't actually played with the video tools in SuperMon, but that sounds right.
Post Reply