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 - Z80 Game Ideas Challenge

Reply to topic
Author Message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Z80 Game Ideas Challenge
Post Posted: Fri Mar 27, 2020 11:34 pm
Last edited by Stokes on Sat Mar 28, 2020 1:41 pm; edited 2 times in total
Welcome. This is a Z80 game idea challenge for all Z80 coders. The systems include:
Sega SG-1000 / SG-1000 II / SC-3000 / SF-7000 / Othello Multivision FG-1000 / FG-2000 / Mark III / Master System / Game Gear
Microsoft - Ascii MSX / MSX2
Coleco ColecoVision
Also, any conversion like MSX2SMS, SG-1000 to MSX, SG-1000 to ColecoVision, ColecoVision to MSX, ColecoVision to SG-1000 or SMS, etc. Happy coding!
  View user's profile Send private message
  • Joined: 22 Sep 2019
  • Posts: 83
Reply with quote
Post Posted: Sat Mar 28, 2020 12:08 pm
Stokes wrote
I am pleased to ask if one of you users will port it.

I'll do it, lemme just fire up my secret Scratch-Z80 compiler and

Sike. If you want your game on the SG-1000, why not learn some Z80 assembly and port it yourself? You'll probably find that you'll need to make significant changes to your game to get it on the SMS.
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Mar 28, 2020 1:35 pm
Wafer wrote
Stokes wrote
I am pleased to ask if one of you users will port it.

I'll do it, lemme just fire up my secret Scratch-Z80 compiler and

Sike. If you want your game on the SG-1000, why not learn some Z80 assembly and port it yourself? You'll probably find that you'll need to make significant changes to your game to get it on the SMS.


O_o

Well, since this is my first year to be on here while I've done some MSX2SMS ports, I will try for all.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 573
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sat Mar 28, 2020 2:08 pm
If you want to start from something close to Scratch, you could try Blockly-Z80:

http://www.haroldo-ok.com/blockly-z80/blockly-z80/demos/commands/index.html

Please, do keep in mind that the tool is extremely unfinished, and the Z80 code it generates is correct, but far from optimal.

Also, for didactical purposes, you might also want to try the 8bitworkshop IDE:

https://8bitworkshop.com/v3.5.0/?platform=sms-sms-libcv&file=climber.c

It is pretty easy to use, but you will need to know either assembly or C.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Mar 28, 2020 4:04 pm
haroldoop wrote
If you want to start from something close to Scratch, you could try Blockly-Z80:

http://www.haroldo-ok.com/blockly-z80/blockly-z80/demos/commands/index.html

Please, do keep in mind that the tool is extremely unfinished, and the Z80 code it generates is correct, but far from optimal.

Also, for didactical purposes, you might also want to try the 8bitworkshop IDE:

https://8bitworkshop.com/v3.5.0/?platform=sms-sms-libcv&file=climber.c

It is pretty easy to use, but you will need to know either assembly or C.


Wow! Thank you very much for this. I will try to create my Scratch game with these assemblers. :-)
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Mar 28, 2020 4:14 pm
https://scratch.mit.edu/projects/379884159/
Just reposted the instructions.
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Tue Mar 31, 2020 3:38 am
I just decided to put my conversion of Q-Bert's Qubes for the SG-1000 on here.
Q-Bert's Qubes.zip (16.46 KB)

  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Fri Apr 03, 2020 8:59 pm
I am trying to create a GEM emulator (Game Boy Emulator for MSXturboR created by The New Image) for the Master System. I'm using both the Game Boy and Game Boy Color BIOS as a test. One of you guys might say it's not possible to put Game Boy on Master System. The SMS just uses the regular Zilog Z80, but the Game Boy has the same, or not if it just uses the "GBZ80," but it also uses the Intel 8080.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 573
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Fri Apr 03, 2020 11:00 pm
Stokes wrote
I am trying to create a GEM emulator (Game Boy Emulator for MSXturboR created by The New Image) for the Master System. I'm using both the Game Boy and Game Boy Color BIOS as a test. One of you guys might say it's not possible to put Game Boy on Master System. The SMS just uses the regular Zilog Z80, but the Game Boy has the same, or not if it just uses the "GBZ80," but it also uses the Intel 8080.


That's definitely possible, though it will be incredibly slow. Also, you will need to provide extra RAM, since both GB and SMS have 8KB of RAM, meaning there wouldn't be nothing left for the emulator itself.

A bigger obstacle would be the graphics part: the gameboy supports tile flipping for sprites, the SMS doesn't. This means that you would probably need to rewrite the sprites on the fly in order to simulate flipping. Even harder would be to simulate the window layer; there is nothing similar to it on the SMS. An alternative would be to use one of the legacy SG-1000 bitmap modes and draw everything from scratch, the same way it would be done on a PC; of course, this would probably be even slower.

So, basically, you can definitely write a GB emulator for SMS, but it will have very poor performance. Still good for the hack value, though.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Apr 04, 2020 3:18 am
Last edited by Stokes on Sat Apr 04, 2020 3:29 am; edited 1 time in total
haroldoop wrote
Stokes wrote
I am trying to create a GEM emulator (Game Boy Emulator for MSXturboR created by The New Image) for the Master System. I'm using both the Game Boy and Game Boy Color BIOS as a test. One of you guys might say it's not possible to put Game Boy on Master System. The SMS just uses the regular Zilog Z80, but the Game Boy has the same, or not if it just uses the "GBZ80," but it also uses the Intel 8080.


That's definitely possible, though it will be incredibly slow. Also, you will need to provide extra RAM, since both GB and SMS have 8KB of RAM, meaning there wouldn't be nothing left for the emulator itself.

A bigger obstacle would be the graphics part: the gameboy supports tile flipping for sprites, the SMS doesn't. This means that you would probably need to rewrite the sprites on the fly in order to simulate flipping. Even harder would be to simulate the window layer; there is nothing similar to it on the SMS. An alternative would be to use one of the legacy SG-1000 bitmap modes and draw everything from scratch, the same way it would be done on a PC; of course, this would probably be even slower.

So, basically, you can definitely write a GB emulator for SMS, but it will have very poor performance. Still good for the hack value, though.


Okay, that's good to hear, I would also put it on Game Gear, but is there any way to put the BIOS inside an emulating part or change it in the start of the file? I'm trying to change the hexadecimals and coding of the BIOS at the start, including the Game Boy Color, although the GBC might have more colors that Master System like Game Gear.
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Taylor Stokes' MSX2SMS Ports
Post Posted: Sat Apr 04, 2020 3:27 am
The screen also might be like this too.
Tetris on MSX.png (93.06 KB)
Tetris on MSX.png

  View user's profile Send private message
  • Joined: 22 Sep 2019
  • Posts: 83
Reply with quote
Post Posted: Sat Apr 04, 2020 9:11 am
Stokes wrote
I'm trying to change the hexadecimals and coding of the BIOS at the start, including the Game Boy Color, although the GBC might have more colors that Master System like Game Gear.

Did you take my advice and learn any Z80 assembly? Because if you haven't, you will really need to do that. Hex editing will not cut it here.

Also, I don't believe the source is available for GEM, in which case you'd need to disassemble it yourself.

I wonder whether you might be trying to run before you can walk here, to be honest.
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 229
Reply with quote
Post Posted: Sat Apr 04, 2020 10:59 am
For whatever it's worth, there seems to be a large fraction of Game Boy games that never use the window layer at all, so you still might be able to get to "interesting" results using SMS or Game Gear the usual way. Also EverDrives have cartridge RAM support you may be able to abuse to overcome memory limitations, though it still might not fit when the game itself also used Game Boy cartridge memory. Game Boy Color has a higher speed clock available for the CPU, but some games didn't use it, typically because they also ran in the older models. If you're doing more "targeted conversion" than "pure emulation" you might also be able to port over Super Game Boy borders and colorization, those improve the appearance of many titles on a color screen. Also at least a few games targeting both Game Boy and Game Gear were built from a shared codebase Back In the Day, so there might be something to learn by analyzing them (I don't know )
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Apr 04, 2020 12:05 pm
Wafer wrote
Stokes wrote
I'm trying to change the hexadecimals and coding of the BIOS at the start, including the Game Boy Color, although the GBC might have more colors that Master System like Game Gear.

Did you take my advice and learn any Z80 assembly? Because if you haven't, you will really need to do that. Hex editing will not cut it here.

Also, I don't believe the source is available for GEM, in which case you'd need to disassemble it yourself.

I wonder whether you might be trying to run before you can walk here, to be honest.


Y'know, I'm trying to learn it in C, but still taking advice.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 573
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sat Apr 04, 2020 1:34 pm
Stokes wrote
Wafer wrote
Stokes wrote
I'm trying to change the hexadecimals and coding of the BIOS at the start, including the Game Boy Color, although the GBC might have more colors that Master System like Game Gear.

Did you take my advice and learn any Z80 assembly? Because if you haven't, you will really need to do that. Hex editing will not cut it here.

Also, I don't believe the source is available for GEM, in which case you'd need to disassemble it yourself.

I wonder whether you might be trying to run before you can walk here, to be honest.


Y'know, I'm trying to learn it in C, but still taking advice.


Well, if you're trying to program a GB emulator for SMS, don't care about the speed (since it won't run at full speed, even with ASM) and are trying to learn C, one option would be to port the C source of a existing GB emulator to SMS.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Sep 2019
  • Posts: 83
Reply with quote
Post Posted: Sat Apr 04, 2020 1:41 pm
Stokes wrote
Y'know, I'm trying to learn it in C, but still taking advice.

C is a good start, but the source for GEM isn't available (I just downloaded the archive to check), so you'd need to disassemble the binary and then work with the disassembly. Knowledge of C wouldn't help you there. Also, it might be considered poor form to disassemble something that actually got a release in the last decade.

Edit 2: In fact, GEM is written in assembly to begin with, per their website, so C is really a non-starter for the purposes of porting it.

Edit: If you're not interested in learning assembly, but you do want to try to port a Game Boy emulator, haroldoop's suggestion is probably the way to go. Just be aware that you'll probably find the performance is even worse than it might've been with an assembly-based port of GEM. Not only do you have the C overhead to worry about, but GEM had the advantage that it's written to take advantage of the similarities between the host and target CPUs, and a more generalized emulator won't have that.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 573
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sat Apr 04, 2020 5:12 pm
On the other hand, if you want to be adventurous, you could try to implement a static translator, which would pick the GB-Z80 assembly code and translate it to plain Z80 code equivalents; most of the code that's not related to audio and video acess could be translated to good-performing Z80 equivalents, though you would need to perform some memory relocations here and there.

The graphics, on the other hand, would fall into exactly the same issues you would have with an emulator.

Still, overall, the solution would be much faster than a pure emulator; on the other hand, a pure emulator would be far easier to code.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Oct 2008
  • Posts: 354
Reply with quote
Post Posted: Sun Apr 05, 2020 3:54 am
bsittler wrote
For whatever it's worth, there seems to be a large fraction of Game Boy games that never use the window layer at all, so you still might be able to get to "interesting" results using SMS or Game Gear the usual way. Also EverDrives have cartridge RAM support you may be able to abuse to overcome memory limitations, though it still might not fit when the game itself also used Game Boy cartridge memory. Game Boy Color has a higher speed clock available for the CPU, but some games didn't use it, typically because they also ran in the older models. If you're doing more "targeted conversion" than "pure emulation" you might also be able to port over Super Game Boy borders and colorization, those improve the appearance of many titles on a color screen. Also at least a few games targeting both Game Boy and Game Gear were built from a shared codebase Back In the Day, so there might be something to learn by analyzing them (I don't know )


The GB CPU is known as "GBZ80" because it is modified with some custom instructions added and some instructions' opcodes were moved (making them still effectively different from a stock Z80).

Also, I'm fairly certain GBC uses a 15-bit palette (the same as SNES, which is what the SGB borders are infact, they are SNES graphics), even if it doesn't look like it since many games used only bright colors to compensate for the low-visibility LCD.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 573
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sun Apr 05, 2020 10:30 am
KingMike wrote
The GB CPU is known as "GBZ80" because it is modified with some custom instructions added and some instructions' opcodes were moved (making them still effectively different from a stock Z80).


For the record, these are the GB-only opcodes:


 Opcode  GMB
 ---------------------------------------
 08      LD   (nn),SP
 10      STOP
 22      LDI  (HL),A
 2A      LDI  A,(HL)
 32      LDD  (HL),A
 3A      LDD  A,(HL)
 D9      RETI  ; Same functionality, but a different opcode
 E0      LD   (FF00+n),A
 E2      LD   (FF00+C),A
 E8      ADD  SP,dd
 EA      LD   (nn),A
 F0      LD   A,(FF00+n)
 F2      LD   A,(FF00+C)
 F8      LD   HL,SP+dd
 FA      LD   A,(nn)
 CB3X    SWAP r/(HL)


These opcodes would have to be either emulated, or translated.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Tue Apr 14, 2020 6:27 pm
haroldoop wrote
KingMike wrote
The GB CPU is known as "GBZ80" because it is modified with some custom instructions added and some instructions' opcodes were moved (making them still effectively different from a stock Z80).


For the record, these are the GB-only opcodes:


 Opcode  GMB
 ---------------------------------------
 08      LD   (nn),SP
 10      STOP
 22      LDI  (HL),A
 2A      LDI  A,(HL)
 32      LDD  (HL),A
 3A      LDD  A,(HL)
 D9      RETI  ; Same functionality, but a different opcode
 E0      LD   (FF00+n),A
 E2      LD   (FF00+C),A
 E8      ADD  SP,dd
 EA      LD   (nn),A
 F0      LD   A,(FF00+n)
 F2      LD   A,(FF00+C)
 F8      LD   HL,SP+dd
 FA      LD   A,(nn)
 CB3X    SWAP r/(HL)


These opcodes would have to be either emulated, or translated.


Nobody has responded to the conversation. Is this supposed to be the BIOS of the original Game Boy?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2769
Reply with quote
Post Posted: Tue Apr 14, 2020 6:37 pm
no, this is not BIOS. These are the CPU instructions specific of the Game Boy CPU. These aren't present on a 'regular' Z80
  View user's profile Send private message Visit poster's website
  • Joined: 22 Sep 2019
  • Posts: 83
Reply with quote
Post Posted: Tue Apr 14, 2020 7:14 pm
Stokes wrote
Nobody has responded to the conversation.


If by "conversation" you mean this:
Stokes wrote
I'm trying to change the hexadecimals and coding of the BIOS at the start, including the Game Boy Color, although the GBC might have more colors that Master System like Game Gear.


You do realize that it's going to take more than just a BIOS to get, really, ANY Game Boy game to work, right? I know you've been doing a lot of converting MSX ROMs, but with respect to that, emulating a Game Boy is LEAGUES above what you've done so far.

If your question is "How can I paste a GB BIOS onto the start of a GB ROM and have it run on an SMS?" the answer is: you can't.
  View user's profile Send private message
lester64652373
  • Guest
Reply with quote
I have 20 great iseas BUT
Post Posted: Sun May 03, 2020 6:14 pm
I do not have enough source examples.

I can get around in Z80 Assembly but I am not proficient at it.

I was working on a side scrolling game for the SG1000 and Colecovision but it just doesn't work.

I set up the 8x8 tiles and everything but my pointers and math are all off.

Does anyone have a decent scroll routine in written source code that they want to share.

My premise is my player is in the middle of the screen and the screen scrolls in all 4 directions.

If I get to the end of the screen it wraps around to the other side.

Anyone can do pacman and tetris, I want to do something new.

Please, please, please anyone that can help.
 
  • Joined: 22 Sep 2019
  • Posts: 83
Reply with quote
Post Posted: Sun May 03, 2020 6:54 pm
lester64652373 wrote
Does anyone have a decent scroll routine in written source code that they want to share.


Having played the Wonder Boy SG-1000 port, I doubt that any scrolling routine could be considered decent for the 9918. Check out this bit on Sega Retro about the challenges involved in software scrolling and how other games dealt with it.

That said, since you know that your layout is wrapping round to the other side of the screen, it rather sounds as though you need to add a layer of extrapolation, so that you can stream your layout to the screen.

Whilst I realize you want to do something "new", perhaps you should start with something less challenging so that you can get a feel for the hardware.
  View user's profile Send private message
lester64652373
  • Guest
Reply with quote
Post Posted: Mon May 04, 2020 2:06 am
Whilst I realize you want to do something "new", perhaps you should start with something less challenging so that you can get a feel for the hardware.[/quote]

Well, I have already invested 4 months into the game it's just I can't figure out the scrolling part so I will take anything I can get.

Way back when I learned basic using old computer magazines on my Coleco ADAM but now that I am working at Assembly language level source code is harder to come by in order to learn.

Lot's of TRS80...Very little SG1000
 
  • Joined: 22 Apr 2018
  • Posts: 229
Reply with quote
Post Posted: Mon May 04, 2020 3:01 am
Are you looking for truly pixel-perfect omnidirectional scrolling, or would a "close approximation" be sufficient? If the latter, you might check out Namcot's Bosconian conversion for the MSX 1. The hardware is very similar to SG-1000, and an unofficial Korean release got it running on the SMS too as part of a multicart.

Also, it's not as readable as assembly language, but disassembling existing MSX, SG-1000, and SMS games has proven very instructive. Some emulators have built-in tools that help with this, but in the worst case a hex editor and a Z80 machine code cheat sheet are still enough to start putting together a disassembly you can use
  View user's profile Send private message
lester64652373
  • Guest
Reply with quote
Post Posted: Mon May 04, 2020 9:05 pm
[quote="bsittler"]Are you looking for truly pixel-perfect omnidirectional scrolling, or would a "close approximation" be sufficient? If the latter, you might check out Namcot's Bosconian conversion for the MSX 1. The hardware is very similar to SG-1000, and an unofficial Korean release got it running on the SMS too as part of a multicart.

For now just to get the math and things working I have no problem just moving tiles to the next column or row next to it.
Later I can try and refine as best as possible or even try some type of double buffering.

I have seen way too many games on the SG1000 and Colecovision to know that such things are possible.
I mean Zaxxon itself, though choppy, is proof positive that almost anything can be done.
 
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Mon Jun 15, 2020 11:05 pm
[quote="lester64652373"]
bsittler wrote
Are you looking for truly pixel-perfect omnidirectional scrolling, or would a "close approximation" be sufficient? If the latter, you might check out Namcot's Bosconian conversion for the MSX 1. The hardware is very similar to SG-1000, and an unofficial Korean release got it running on the SMS too as part of a multicart.

For now just to get the math and things working I have no problem just moving tiles to the next column or row next to it.
Later I can try and refine as best as possible or even try some type of double buffering.

I have seen way too many games on the SG1000 and Colecovision to know that such things are possible.
I mean Zaxxon itself, though choppy, is proof positive that almost anything can be done.


It's been a while for this forum post, but why not try this demo from Daniel Bienvenu that I converted for the SG-1000. It's a ColecoVision demo, but I hope this helps, I also wish that I could convert this into source code.
Scroll Demo by Daniel Bienvenu.zip (6.7 KB)
Press start to begin. Use up for slow speed, down for fast speed.

  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Tue Jun 16, 2020 1:58 am
bsittler wrote
Are you looking for truly pixel-perfect omnidirectional scrolling, or would a "close approximation" be sufficient? If the latter, you might check out Namcot's Bosconian conversion for the MSX 1. The hardware is very similar to SG-1000, and an unofficial Korean release got it running on the SMS too as part of a multicart.

Also, it's not as readable as assembly language, but disassembling existing MSX, SG-1000, and SMS games has proven very instructive. Some emulators have built-in tools that help with this, but in the worst case a hex editor and a Z80 machine code cheat sheet are still enough to start putting together a disassembly you can use


By the way, there was a Korean release of Bosconian for the Samsung Gam*Boy?
Wait a minute, you're talking about the 128 Total collection? Is there any ROM dump for that? Thanks in advance.
  View user's profile Send private message
  • Joined: 17 Feb 2020
  • Posts: 216
  • Location: United States
Reply with quote
Post Posted: Sat Oct 17, 2020 2:49 am
Wafer wrote
Stokes wrote
I am pleased to ask if one of you users will port it.

I'll do it, lemme just fire up my secret Scratch-Z80 compiler and

Sike. If you want your game on the SG-1000, why not learn some Z80 assembly and port it yourself? You'll probably find that you'll need to make significant changes to your game to get it on the SMS.

Also Wafer, you have luck ahead of you because I'm doing assembly now. I am trying to see if I can get any TI calculator or any Z80 system on MSX.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!