Post by warty on Nov 6, 2022 21:18:07 GMT
Hey Folks,
I'm working on a C-128/B-128/Foenix F256/Foenix A2560K game, a rogue-like. It started from a C-128 base, and I'm circling back now to finish that version up.
I'm tearing a bit of hair out (not much left!) trying to figure out what the VDC is doing with the various screens (of text and attributes) I store in it.
I define and pre-load 9 screens, each of which has chars and attributes:
- Splash
- Player's map
- help screen
- Inventory
- Tinker (like a trading store)
- Gameover - you lost
- Gameover - you won
- dungeon map 1
- dungeon map 2
I flip between those by changing the HI byte of the VDC address register (#12). I do some block copying between player's map and the 2 dungeon maps. All that works fine, except...
It acts like either some of the RAM is mirrored, OR there are limits on what you can put into register 12 that make it fail and fall back to a different address in a predictable way.
For example, if I say switch to 0x4000 (all these are VDC RAM space addresses), and load in some screen data, then flip display to 0x0000, it doesn't change.
Say I set display address to 0x0000, load data in 0x0000, I can see it right? Then I load load data into 0x1000, and switch to that address, now I see that data on the screen no problem. But if I load data into 0x4000, and switch to 0x0000, I see the data I loaded into 0x4000.
It seems to act like this:
0x0000 > mirrored at 0x4000
0x1000 > 0x5000
0x2000 > NOT mirrored at 0x6000. (I have char font definition at 0x2000, and another screen at 0x6000, and can show 0x6000 no problem.
0x3000 > mirrored at 0x7000.
similar patterns for the addresses above.
At the end of the day, I have a bit more space in extended memory, so I could stash some of the more static screens there (like Help), and push into VDC as needed, so there are ways to work around it. But I'd prefer to understand why it's doing what I observe (or just as likely: what I'm doing wrong and misinterpreting).
I tested on VICE and Z64K, and both acted the same. Haven't tested on my real 128D (at least not since 2020, and I don't remember stuff from back then).
I don't think it could really be mirroring, because people do graphics demos that would have noticed it before. So maybe a limitation of the addressing system for text mode? Anybody know offhand?
I'm working on a C-128/B-128/Foenix F256/Foenix A2560K game, a rogue-like. It started from a C-128 base, and I'm circling back now to finish that version up.
I'm tearing a bit of hair out (not much left!) trying to figure out what the VDC is doing with the various screens (of text and attributes) I store in it.
I define and pre-load 9 screens, each of which has chars and attributes:
- Splash
- Player's map
- help screen
- Inventory
- Tinker (like a trading store)
- Gameover - you lost
- Gameover - you won
- dungeon map 1
- dungeon map 2
I flip between those by changing the HI byte of the VDC address register (#12). I do some block copying between player's map and the 2 dungeon maps. All that works fine, except...
It acts like either some of the RAM is mirrored, OR there are limits on what you can put into register 12 that make it fail and fall back to a different address in a predictable way.
For example, if I say switch to 0x4000 (all these are VDC RAM space addresses), and load in some screen data, then flip display to 0x0000, it doesn't change.
Say I set display address to 0x0000, load data in 0x0000, I can see it right? Then I load load data into 0x1000, and switch to that address, now I see that data on the screen no problem. But if I load data into 0x4000, and switch to 0x0000, I see the data I loaded into 0x4000.
It seems to act like this:
0x0000 > mirrored at 0x4000
0x1000 > 0x5000
0x2000 > NOT mirrored at 0x6000. (I have char font definition at 0x2000, and another screen at 0x6000, and can show 0x6000 no problem.
0x3000 > mirrored at 0x7000.
similar patterns for the addresses above.
At the end of the day, I have a bit more space in extended memory, so I could stash some of the more static screens there (like Help), and push into VDC as needed, so there are ways to work around it. But I'd prefer to understand why it's doing what I observe (or just as likely: what I'm doing wrong and misinterpreting).
I tested on VICE and Z64K, and both acted the same. Haven't tested on my real 128D (at least not since 2020, and I don't remember stuff from back then).
I don't think it could really be mirroring, because people do graphics demos that would have noticed it before. So maybe a limitation of the addressing system for text mode? Anybody know offhand?