ZX->MSX ports

By PingPong

Prophet (2916)

PingPong's picture

23-09-2017, 19:05

Often ZX speccy games were ported to MSX without any improvements.
The different display management often results in poor gfx performances on msx where the display cannot be managed as a bitmap mode due to more slow VRAM access.
However there are some notable exceptions where the FPS are not so bad.
In speccy due to memory mapped vram sw developers can do anything of strange to get more speed in gfx routines.
On msx this is not so easy.

working in the bitmap way on msx means that we have almost twice the vram to manage:
the color informations have a greater resoulution and require 6kb instead of 1kb to be updated.
But on monochrome games the amount of vram to manage is the same, the difference is the layout.

The question is:
Anyone know if ZX->MSX1 ports were coded by
1) leaving unchanged the zx gfx routines then bit blitting the RAM->VRAM taking in account different vram layout
or
2) if those routines were modified to work more efficiently with the different VRAM layout?

Anyone can point me to examples of (1) or (2)?

Yhx

Login or register to post comments

By hit9918

Prophet (2668)

hit9918's picture

23-09-2017, 20:52

OUTI + ADD HL,DE converts the layout on the fly, vram speed would have needed two NOP anyways.
the ADD moves HL to the next line of a linear RAM layout

By PingPong

Prophet (2916)

PingPong's picture

23-09-2017, 21:48

So you are telling that they work in z80 RAM then they do a massive kind of LDIRVRM ?
Are there exceptions of this approach like an optimized VRAM operation instead of a massive write all?
Or a sw sprite msx-oriented gfx routines?

By sd_snatcher

Prophet (2573)

sd_snatcher's picture

23-09-2017, 22:50

Since the ZX-Zpectrum VRAM layout is a mess (no, it's not linear either), and there's a performance penalty to access it (not to mention the snow effect), a lot of its games draw all the graphics in normal RAM, then only transfer the contents to the VRAM after everything is completed.

When ported to the MSX, they changed the VRAM transfer routine to another one that does that via the MSX I/O ports.

By sd_snatcher

Prophet (2573)

sd_snatcher's picture

23-09-2017, 23:21

hit9918 wrote:

OUTI + ADD HL,DE converts the layout on the fly, vram speed would have needed two NOP anyways.
the ADD moves HL to the next line of a linear RAM layout

It's usually done like more or less like this:

	ld	d,HIGH SRCBUF
	ld	l,LOW SRCBUF
	ld	a,HIGH BLKSIZE
loop1:
	ld	b,LOW BLKSIZE
loop2:
	ld	h,d
 REPT	7
	ld	e,(hl)
	out	(c),e
	inc	h
 ENDR
	ld	e,(hl)
	out	(c),e
	inc	l
	djnz	loop
	dec	a
	jp	nz,loop1

There's a good explanation about the ZX-Spectrum VRAM layout in this article.

By PingPong

Prophet (2916)

PingPong's picture

24-09-2017, 11:42

Umh, quite inefficient. Even maintaining the RAM-> VRAM buffer arrangement the ram layout should match the vram layout and gfx routines (sw sprites, scrolling) should be changed to work with msx layout.
then a single LDIRVRM could fill the VRAM from RAM without animation flickering ...

Anyone know of a ZX game that followed this approach?

By hit9918

Prophet (2668)

hit9918's picture

24-09-2017, 15:13

6k can be copied with 3.5mhz 16 cycles LDI LDI in 35 fps. sounds nice.
but a second copy makes it 18 fps, not 25 fps.

does ZX goblins really go 25 fps.
the goblins hills are like 18 of 24 chars high.
18 fps * 24/18 = 24 fps. yeah, so so, the phantom. but this never does 25 fps including sprites.

or does the game have a 128k version (maybe the ZX 128k can do doublebuffering the video and direct rendering. ZX 48k has fixed vram, no doublebuffering.)
and the MSX port is the 48k version

where is the secret of the ZX phantom

By hit9918

Prophet (2668)

hit9918's picture

24-09-2017, 16:15

Is the secret of ZX scroll the mpeg motion compensation smoothing movements? Big smile

look at that
https://www.youtube.com/watch?v=T2V5_4PXeZk&t=3m0s

first it looks like the ZX has 25 fps
and then at 3:00 the ball shootings wobble at lower fps

another one, beret
https://www.youtube.com/watch?v=wBYP8DizMMI&t=0m30s
same symptoms, scroll looks smoother than the sprites

By PingPong

Prophet (2916)

PingPong's picture

24-09-2017, 16:49

My curiosity is if there is some games that did rewrite the gfx routines only to go better on msx.
i suspect one point of start is to check zx ports where for example, they used some hw sprites. this is a hint for me of ' something done to improve the speed of gfx' . I think it's more easy to find here a decent scroll routine instead of games that have on main menu two options:
'1- Teclado'
'2- Kempston Interface' ;-)

By hit9918

Prophet (2668)

hit9918's picture

24-09-2017, 18:16

I cant remember anything but goblins.

take for example beamrider. the MSX version is top.
it looks like it is not bitmap style rendering but usage of chars duplication
in theory it could have started as ZX game and then modded
but it is no scroll game

My MSX profile