Screen 4 VRAM Question

Страница 1/2
| 2

By CodeIndigo

Supporter (16)

Аватар пользователя CodeIndigo

07-02-2019, 19:59

I'm new to 8-bit programming, but I have a decent amount of experience with frameworks like XNA and Monogame. From what I understand of the VRAM mapping for Screen 4, there are four pages of memory. If I only use two of those pages as actually intended, is it feasible to use the rest to store additional patterns for use later?

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By MsxKun

Paragon (1112)

Аватар пользователя MsxKun

07-02-2019, 22:06

Hi

Screen 4 doesn't use pages as in bitmap modes do, it's pattern based.
You can set your pattern table more or less freely. Same for color table, name table, sprites... then the rest of the VRAM, you can store whatever you want. And yes, that includes additional patterns for use later. You can change the pattern adress table to the direction you have stored another set of patterns and then, change let's say on the fly.

Unless for pages you mean something else or I missed something. The VDP is quite flexible and can be tricked in some ways. Here at MRC there was a talk about using VDP commands (used to transfer VRAM data in bitmap modes) also in SC4. So maybe pages as in MSX-Basic Set Page can be used after all but I think it's simpler to think about SC4 like in SC2 and think in terms of pattern/name/sprite tables that, with more VRAM available, can be set in different tables, so in fact you have more than 1 table of whatever you want...

Dunno if I explained myself well Smile2

By DarkSchneider

Paladin (944)

Аватар пользователя DarkSchneider

14-02-2019, 10:02

On screen 4 what you have are 2 segments of 64KB. You can switch the active segment using the control registers, but I recommend you to use 64KB that is easier, and is not easy to fill it in SC4.

By zett

Hero (608)

Аватар пользователя zett

14-02-2019, 11:13

to see wat you can do with sc4, look at f1 spirit. sc4 is a tile mode screen with 3x tile sets. so you can emulate a bitmapmode

By Grauw

Ascended (10633)

Аватар пользователя Grauw

14-02-2019, 11:26

MsxKun wrote:

You can set your pattern table more or less freely. Same for color table, name table, sprites... then the rest of the VRAM, you can store whatever you want. And yes, that includes additional patterns for use later. You can change the pattern adress table to the direction you have stored another set of patterns and then, change let's say on the fly.

So to add to this, this means that you can basically use the entire 128K for name (256 bytes), pattern (2K) and colour tables (2K).

Since the screen is divided in either 3 (192 lines) or 4 (212 lines) parts with one name, pattern and colour table each, you need 12.75K (192 lines) or 17K (212 lines) per screen, you can fit 7-10 screens in memory. This is the normal mode.

However if you share one pattern and colour table for the entire screen you need 4.75K (192 lines) or 5K (212 lines) per screen, then you can fit 25-26 screens in memory.

And then additionally, if let’s say you have only one name table and just swap out the pattern and colour table, you could fit 31 pattern + colour tables in memory.

Note that there are some requirements regarding alignment of the tables, so in practice these numbers will turn out lower. However this should give you a general impression of how much will fit, and some trickery can be done on the table base addresses, or you could copy data around with the CPU if needed.

By Metalion

Paragon (1587)

Аватар пользователя Metalion

24-08-2022, 12:00

Grauw wrote:

Since the screen is divided in either 3 (192 lines) or 4 (212 lines) parts with one name, pattern and colour table each, you need 12.75K (192 lines) or 17K (212 lines) per screen, you can fit 7-10 screens in memory. This is the normal mode.

So in 212 lines mode, you do have a 4th table of patterns, and a 4th table of colors ?

By aoineko

Paladin (689)

Аватар пользователя aoineko

24-08-2022, 14:26

Wow... really? O_O

- admin: this comment was prolly a reaction on posted spam, which has been removed. no worries. nothing to see here, keep on walking.

By Metalion

Paragon (1587)

Аватар пользователя Metalion

24-08-2022, 15:36

Grauw wrote:

Since the screen is divided in either 3 (192 lines) or 4 (212 lines) parts with one name, pattern and colour table each, you need 12.75K (192 lines) or 17K (212 lines) per screen, you can fit 7-10 screens in memory. This is the normal mode.

So in 212 lines mode, you do have a 4th table of patterns, and a 4th table of colors ?

By Grauw

Ascended (10633)

Аватар пользователя Grauw

24-08-2022, 19:17

Pretty sure yes.

By aoineko

Paladin (689)

Аватар пользователя aoineko

24-08-2022, 19:47

aoineko wrote:

Wow... really? O_O

- admin: this comment was prolly a reaction on posted spam, which has been removed. no worries. nothing to see here, keep on walking.

Nop. That was just a very surprised reaction to Grauw information about the existence of a 4th tables in SC2/SC4 modes ! ^^

BTW, the V9938 doc (updated by MRC users) says about SC2/SC4:
"In 212 line mode (LN bit equal to 1) additional 20 scan lines are displayed as blank with border color, software has no way to display anything in that space."

Only SC0 is said to leak over the VRAM in 212 lines mode.

Who is right?

By Metalion

Paragon (1587)

Аватар пользователя Metalion

24-08-2022, 19:48

Grauw wrote:

Pretty sure yes.

OK, thanks.

Grauw wrote:

Note that there are some requirements regarding alignment of the tables, so in practice these numbers will turn out lower. However this should give you a general impression of how much will fit, and some trickery can be done on the table base addresses, or you could copy data around with the CPU if needed.

As everybody knows, in screen 2 there are restrictions on the value of register R#3 (color table address) and R#4 (pattern table address). R#3 can only be 7Fh or FFh (address 0000h or 2000h), R#4 can only be 03h or 07h (address 0000h or 2000h).

Are those restrictions still there for screen 4 ?

EDIT: I just saw the aoineko message, so it needs to be confirmed, I guess

Страница 1/2
| 2