bug in openmsx in emulating the hybrid scr4?


Enlighted (6681)

imagem de ARTRAG

04-09-2006, 23:42

The undocumented hybrid scr4, the one corresponding to

defb 0x02 // Reg# 0 000000[M3][EV]
defb 0x62 // Reg# 1 [4/16k][BLANK][IE][M1][M2]0[SIZE][MAG]
defb 0x06 // Reg# 2 0000[NAME TABLE BASE ADDRESS] = 1800h
defb 0x9F // Reg# 3 [COLOR BASE ADDRESS] 2000h
defb 0x00 // Reg# 4 00000[PATTERN GENERATOR BASE ADDRESS] 0000h
defb 0x36 // Reg# 5 0[SPRITE ATTRIBUTE TABLE BASE ADDRESS] 1b00h
defb 0x07 // Reg# 6 00000[SPRITE PTRN GNRTR BASE ADDRESS] 3800h
defb 0x01 // Reg# 7 [TEXT COLOR 4bts][BACKDROP COLOR 4bts]

should have a 2K pattern generation table (valid in the 3 parts of teh screen) but
AFAIK shuld have a 6K color generation table (distinct for the 3 parts of teh screen) .

I see that open msx replicate the colors of the first 2K in the whole screen.

Se actually patterns and colors follows the same behaviour.
But the True VDP does not work like this...

This is important as the openmsx behaviour frees 2+2K of VRAM, but AFAIK,
those areas are non usable....

Does anyone heve a confirm of this "error" in the emulation of the VDP ?

Entrar ou registrar-se para comentar

Por mth

Champion (503)

imagem de mth

05-09-2006, 00:29

You call this hybrid scr4, so I assume it's some kind of combination of SCREEN4 and another mode. What is that other mode? And in what way do you expect it to act like SCREEN4 and in what way like the other mode?

You write 0x9F to reg 3, which means the table will start at 0x2000 indeed, but it also means A12 and A11 are forced to zero, so it will mirror 0x2000-0x27FF (an area of 2K). As far as I can see, openMSX is correct in doing that. If you don't want the mirroring effect, write 0xFF to reg 3.

Did you verify the behaviour on a real MSX?

Reg 0 should be set to 0x04 for SCREEN4, by the way, if set up like above you get SCREEN2.

If you would use your example code in SCREEN4, the sprite attribute table would be at 0x1A00 and the sprite colour table would be at 0x1800, so it would overlap with the name table.

This document describes VRAM addressing in detail. If you find any errors in it, please tell me.

Por BiFi

Enlighted (4348)

imagem de BiFi

05-09-2006, 07:28

for 3 different color tables you need to write 0xFF to R#3


Enlighted (6681)

imagem de ARTRAG

05-09-2006, 10:11

Great ! This means that 4K of VRAM can be freed for storing something else!

One more question, AFAI understand in this "mode" the Pattern Generator Table
and the Pattern Color Table are 2Kbyte each (instead of 6Kbyte).
Is it possible to move their starting address ?

Can I move the Pattern Generator Table and the Pattern Color Table to addresses
different from 0x0000 and 0x2000 ?

As there is free room, it could be useful to have multiple pattern sets in VRAM.

BTW I say hybrid scr4 (I should say scr2) because it is an hybrid scr2/scr1 mode.

Por mth

Champion (503)

imagem de mth

06-09-2006, 14:32

In the VDP internals, it's not actually a hybrid mode: it's SCREEN2 with mirroring applied to its tables. To the user, it feels similar to SCREEN1 though.

You cannot move the pattern generator table and colour table to addresses other than 0x0000 and 0x2000: because A12 and A11 are forced to zero, only A13 remains to specify the base address, if it's 0 the base is 0x0000 and if it's 1 the base is 0x2000. However, the name table is a lot smaller, so you can move it in smaller increments as well. You could implement double buffering of the name table using the VRAM freed by allocating only 2K for colours and patterns. Or use more sprites, maybe even a sprite split.


Enlighted (6681)

imagem de ARTRAG

06-09-2006, 15:24

Double buffering of the name table isn't very handy,
the time required to change the PNT is quite short,
so double buffer is almost unuseful.

If this room cannot be used for alternate character sets,
the sole possibility I see is to store more sprite definitions,
this could multiply by 5 the number of sprite patterns,
(from 64 to 320 !! for size 16x16 ) even if with some severe
limitation (all the sprites change their animation frame when
the SPT changes...)

Por Manuel

Ascended (18384)

imagem de Manuel

06-09-2006, 18:43

so um... no bug? Smile


Enlighted (6681)

imagem de ARTRAG

06-09-2006, 21:57

no bug, do not worry

Por Huey

Prophet (2681)

imagem de Huey

06-09-2006, 22:05

To bad Sad
The extra VRAM would have been very handy

Por Yukio

Paragon (1540)

imagem de Yukio

16-09-2006, 19:34

BTW I say hybrid scr4 (I should say scr2) because it is an hybrid scr2/scr1 mode.

The original MSX standard only has mode 0,1,2,3.
SCREEN IV is the generic name of a mixed mode.

The MSX2/MSX2+ Screen 4 mode use MSX1 tiles plus MSX2 Sprites and palette colors.

There is a mixed mode in MSX1 with screen 2 plus screen 1.
This is what you call "hybrid" Screen IV mode.