Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - SPECTRUM ZX Port

Reply to topic
Author Message
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
SPECTRUM ZX Port
Post Posted: Fri Jul 22, 2022 12:25 pm
Question: how difficult is it to Port a Spectrum ZX game to the master system? Is it something easy or would you need to be a computer programmer to know how to do it?
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jul 2021
  • Posts: 24
Reply with quote
Post Posted: Fri Jul 22, 2022 12:54 pm
8BitBoy wrote
Question: how difficult is it to Port a Spectrum ZX game to the master system? Is it something easy or would you need to be a computer programmer to know how to do it?


You mean full ports that enhance the graphics, add native sprite support, etc., or straight conversions?

There exist MSX conversions of ZX Spectrum games, so I'm sure it's possible to convert them to Master System. I don't know how difficult this task would be, but it is possible.

I know that the way Spectrum handles lots of stuff is nothing like how the Master System does. While the MSX has TMS9918, which the Master System's graphics chip is based on and compatible with, the ZX Spectrum lacks any dedicated graphics chip.
I don't know much about how the conversions to MSX were made, but I believe those were made possible with the fact that both computers have somewhat similar graphic modes, although any enhancements to fully use the new hardware would still require lots of work.

So if you were to port ZXS games to SMS, some parts would require complete rewrite, for sure.
  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 593
  • Location: London, UK
Reply with quote
Post Posted: Fri Jul 22, 2022 12:58 pm
Lols, regardless of what you consider yourself now, I would say once you've ported a Spectrum game to Master System, you'd definitely be well within your rights to describe yourself as a "computer programmer"! :D
  View user's profile Send private message Visit poster's website
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
Post Posted: Fri Jul 22, 2022 1:11 pm
Thanks guys appreciate that. I bought a Spectrum ZX homebrew called alien girl last year and absolutely love it but every time I play I have to boot up my Spektrum. I just wonder if it might run better on the master system it would certainly be much easier to play for me with my mega SG.

Alien Girl you can Google I think. I don't think I can post pictures here. Will try anyway.

  View user's profile Send private message Visit poster's website
  • Joined: 09 Jul 2021
  • Posts: 24
Reply with quote
Post Posted: Fri Jul 22, 2022 5:24 pm
8BitBoy wrote
Thanks guys appreciate that. I bought a Spectrum ZX homebrew called alien girl last year and absolutely love it but every time I play I have to boot up my Spektrum. I just wonder if it might run better on the master system it would certainly be much easier to play for me with my mega SG.

Alien Girl you can Google I think. I don't think I can post pictures here. Will try anyway.


I never had the luxury of owning a ZX Spectrum. (or any other 8-bit computer) The only mention of it I ever stumbled upon outside of the internet was when one of my teachers at school told me he had one and wrote his own game for it, and he had to work with a black & white screen. Any online store listing I find costs two livers and a heart.

Also, the Master System collection I see in the background of that photo is very impressive.
  View user's profile Send private message
  • Joined: 17 Jan 2020
  • Posts: 118
  • Location: Brisbane, AU
Reply with quote
Post Posted: Sat Jul 23, 2022 12:15 am
"Speccy Ports" even in the 80's were known for their low quality. Companies would write games for the ZX spectrum and do a straight port to other systems using the same graphics. Since the ZX spectrum is fairly unique and low-spec in its graphics setup, invariably it would be lower quality that other games on the same system.

MSX was one system, but CPC was the other, where 256x192 games would be convert to run on it's 320x200 resolution screen, thus be considerably smaller. The CPC in particular required more data to write per pixel and had hardware scrolling. The ZX had less data per pixel, so manually scrolling a screen was possible at a reasonable pace, but manually scrolling just couldn't be done on the CPC fast enough (it had to write 16K per screen instead of the 6K of the ZX). The CPC had per pixel colour support, where the Spectrum had only per 8x8 pixel block colours, so the colour was also significantly poorer.

The MSX ports were often of low quality. The ZX spectrum has direct memory access to the RAM, and CPU is physically halted during VDU updates, so accessing the vdu ram was reasonably fast. The ZX had no concept of tiles; it was a bitmap display and pixels were written directly to the screen. If you want to update a single 8x8 pixel block, that whole block has to be written to. The SG/MSX has (what I’m calling) serial access to vdu with its required 28 (26?) t-states between writes. Software scrolling on the MSX was possible by moving all the tiles across by one. For the Speccy, this had to be done by writing the entire 6144 pixels of the display. Trying to update the bitmap display on the MSX/SG the same way a ported Speccy game does is going to be unacceptably slow. Even if it’s just updating sprites moving across the screen, this is going to slow the game down significantly, since writing even the data for a dozen tiles is slow.

California Games and Outrun are two poor MSX ports. Ironically, the MSX port of Outrun isn’t even a port of the released Speccy version.

The other challenge is the arrangement of the bitmap display is different. The Speccy goes across a single pixel row, then jumps down 8 pixels per row. The SG/MSX in a bitmap mode is still tiled in 8x8 tiles, going down 8, then across 8. Because of this, it’s going to need a fair bit of code to move from the ZX layout to the SG layout, assuming a straight bitmap pixel port.

It’s slightly easier if you have the original source code. Since the vdu routines can be abstracted away and new routines inserted per platform. Even if it’s an assembly layout, the data and display routines are known. This of course depends on the code quality, sometimes the vdu code and game logic are closely tied together.

If this is ported by doing rom hack, rom address will be a problem. The rom on the Speccy is from 6000h/8000h to FFFFh which doesn’t match the SMS/SG of 0000h to C000h, giving only a 24/16K overlap without realigning all the calls and jumps; which is very hard to do without the original source. This is going to leave you with only small games to port.

And of course 1bit sound, Though the ZX128 has an AY-3 chip, the ZX48K had bit sound. Again, possible on the MSX/SG but much lower quality.

When I port my own games, I actually simulate a tile based system for the ZX spectrum. I have a tile table in memory and update the tiles on screen only if they’ve changed. This keeps the updates reasonably fast and I can use the same code for games, since all my games are tile based (for the SG/SMS). The API is identical, and I just compile in the new library (mostly). It also means I can have tilesets appropriate for the system I’m porting to.

TLDR; it’s possible, but it’s going to run slow, look monochrome, and take a lot of custom code to update the graphics output.

ZX Spectrum screen layout:

zxvdulayout.gif (49.67 KB)
zxvdulayout.gif

  View user's profile Send private message Visit poster's website
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
Post Posted: Sat Jul 23, 2022 6:55 am
Thanks for the reply Novelty, and thanks for the comment on my collection too. It's been a labour of love!!

NoveltyMan wrote
8BitBoy wrote
Thanks guys appreciate that. I bought a Spectrum ZX homebrew called alien girl last year and absolutely love it but every time I play I have to boot up my Spektrum. I just wonder if it might run better on the master system it would certainly be much easier to play for me with my mega SG.

Alien Girl you can Google I think. I don't think I can post pictures here. Will try anyway.


I never had the luxury of owning a ZX Spectrum. (or any other 8-bit computer) The only mention of it I ever stumbled upon outside of the internet was when one of my teachers at school told me he had one and wrote his own game for it, and he had to work with a black & white screen. Any online store listing I find costs two livers and a heart.

Also, the Master System collection I see in the background of that photo is very impressive.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Aug 2019
  • Posts: 258
  • Location: Lancashire UK
Reply with quote
Post Posted: Sat Jul 23, 2022 6:56 am
Thank you under4mhz. Really appreciate the details reply. Whilst much of these is over my head I grasp the limitations. Thank you. It's a shame as I would love to see more games ported over from other consoles.

PS: I love the work you are doing at the moment. Please keep it up.



under4mhz wrote
"Speccy Ports" even in the 80's were known for their low quality. Companies would write games for the ZX spectrum and do a straight port to other systems using the same graphics. Since the ZX spectrum is fairly unique and low-spec in its graphics setup, invariably it would be lower quality that other games on the same system.

MSX was one system, but CPC was the other, where 256x192 games would be convert to run on it's 320x200 resolution screen, thus be considerably smaller. The CPC in particular required more data to write per pixel and had hardware scrolling. The ZX had less data per pixel, so manually scrolling a screen was possible at a reasonable pace, but manually scrolling just couldn't be done on the CPC fast enough (it had to write 16K per screen instead of the 6K of the ZX). The CPC had per pixel colour support, where the Spectrum had only per 8x8 pixel block colours, so the colour was also significantly poorer.

The MSX ports were often of low quality. The ZX spectrum has direct memory access to the RAM, and CPU is physically halted during VDU updates, so accessing the vdu ram was reasonably fast. The ZX had no concept of tiles; it was a bitmap display and pixels were written directly to the screen. If you want to update a single 8x8 pixel block, that whole block has to be written to. The SG/MSX has (what I’m calling) serial access to vdu with its required 28 (26?) t-states between writes. Software scrolling on the MSX was possible by moving all the tiles across by one. For the Speccy, this had to be done by writing the entire 6144 pixels of the display. Trying to update the bitmap display on the MSX/SG the same way a ported Speccy game does is going to be unacceptably slow. Even if it’s just updating sprites moving across the screen, this is going to slow the game down significantly, since writing even the data for a dozen tiles is slow.

California Games and Outrun are two poor MSX ports. Ironically, the MSX port of Outrun isn’t even a port of the released Speccy version.

The other challenge is the arrangement of the bitmap display is different. The Speccy goes across a single pixel row, then jumps down 8 pixels per row. The SG/MSX in a bitmap mode is still tiled in 8x8 tiles, going down 8, then across 8. Because of this, it’s going to need a fair bit of code to move from the ZX layout to the SG layout, assuming a straight bitmap pixel port.

It’s slightly easier if you have the original source code. Since the vdu routines can be abstracted away and new routines inserted per platform. Even if it’s an assembly layout, the data and display routines are known. This of course depends on the code quality, sometimes the vdu code and game logic are closely tied together.

If this is ported by doing rom hack, rom address will be a problem. The rom on the Speccy is from 6000h/8000h to FFFFh which doesn’t match the SMS/SG of 0000h to C000h, giving only a 24/16K overlap without realigning all the calls and jumps; which is very hard to do without the original source. This is going to leave you with only small games to port.

And of course 1bit sound, Though the ZX128 has an AY-3 chip, the ZX48K had bit sound. Again, possible on the MSX/SG but much lower quality.

When I port my own games, I actually simulate a tile based system for the ZX spectrum. I have a tile table in memory and update the tiles on screen only if they’ve changed. This keeps the updates reasonably fast and I can use the same code for games, since all my games are tile based (for the SG/SMS). The API is identical, and I just compile in the new library (mostly). It also means I can have tilesets appropriate for the system I’m porting to.

TLDR; it’s possible, but it’s going to run slow, look monochrome, and take a lot of custom code to update the graphics output.

ZX Spectrum screen layout:
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!