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 - [Coding competition 2018] Gemitas by Cyttorak

Reply to topic

Rate this entry!

1 (Poor) 0% 0%
2 0% 0%
3 0% 0%
4 11% 11%
5 0% 0%
6 11% 11%
7 38% 38%
8 38% 38%
9 (Excellent) 0% 0%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14682
  • Location: London
Reply with quote
[Coding competition 2018] Gemitas by Cyttorak
Post Posted: Tue Mar 27, 2018 11:08 am
Quote
Gemitas is a Columns' clone for the Sega Master System featuring bigger graphics for the gem blocks and an endless game mode


http://www.smspower.org/Homebrew/Gemitas-SMS

  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 863
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Tue Mar 27, 2018 10:46 pm
Nice overhaul of a timeless classic.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 539
  • Location: Málaga, Spain
Reply with quote
Post Posted: Wed Mar 28, 2018 1:03 pm
Hi!

It feels polished, with nice effects and the music is good, suited to the theme.

The screen layout could let you to make a 2p Mode, which would make the Game feel completed and profesional as It seems better than the original.
  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 844
Reply with quote
Post Posted: Wed Mar 28, 2018 3:59 pm
Very nice version. Great visuals and very playable.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 19
Reply with quote
Post Posted: Wed Mar 28, 2018 7:55 pm
Thanks for the comments guys, I really appreciate them!

About 2P mode, it is of course possible, but currently I think the calculations to detect what gems should be destroyed and such it's too heavy. I think it even hangs the music a few ms. In 2P mode using the algorithm I use I think it would be more noticeable, so I would need to rework it so it is spread in several frames or something like that. Perhaps I would do for 2019 competition ;-)
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 539
  • Location: Málaga, Spain
Reply with quote
Post Posted: Wed Mar 28, 2018 8:56 pm
I spawn the music and sound playing in a line interruption, which in práctice is like some Sort of multithreading. In fact the loading of everything between scenes is heavy but the music does not stop. The interrupt seems to keep Safe the registers and everything.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 19
Reply with quote
Post Posted: Wed Mar 28, 2018 10:47 pm
With spawn you mean update it? I call it before vblank, both music and sfx updating.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 863
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Wed Mar 28, 2018 11:07 pm
Cyttorak wrote
With spawn you mean update it? I call it before vblank, both music and sfx updating.


You could use SMS_setLineInterruptHandler() + SMS_setLineCounter() to set up a function to be automatically called every frame (or every n lines, depending on how often you want it do be called); as long as the interrupts are enabled, whatever is currently being executed is temporarily interrupted in order to allow executing the handler. That way, you can ensure the music will be updated every frame, regardless of what is happening in the main program.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 539
  • Location: Málaga, Spain
Reply with quote
Yeah!
Post Posted: Thu Mar 29, 2018 10:03 am
Let's see...taken from galactic revenge. It is not that simple, but i have extracted the important part:



void changeBank(unsigned char b)
{
   if(b!=lastbank)
   {
      SMS_mapROMBank(b);
      lastbank=b;
   }
}

void InterruptHandler(void)
{
   unsigned char oldbank=lastbank;
   
   // Update music
   if(musicbank)
   {
      changeBank(musicbank);
      PSGFrame();
   }

   // Update sounds
   if(PSGSFXGetStatus())
   {
      changeBank(soundbank);
      PSGSFXFrame();
   }

   SMS_mapROMBank(oldbank);
}

void InitConsole()
{
   // La consola
   SMS_init();
   
   // Advanced frameskipping
   SMS_setLineInterruptHandler(&InterruptHandler);
   SMS_setLineCounter (180);
   SMS_enableLineInterrupt();
       
        ......
}

void PlayMusic(const unsigned char *music,unsigned char mbank,unsigned char looped)
{
   // Save banks
   musicbank=mbank;

   // Init Music
   changeBank(musicbank);
   
   // Loop???
   if(looped==1)
      PSGPlay (music);
   else
      PSGPlayNoRepeat(music);
}

void PlaySound(char *sound,unsigned char sbank, unsigned char channel)
{
   if(!PSGSFXGetStatus())
   {
      // Save banks
      soundbank=sbank;
   
      // Play the sound
      changeBank(sbank);
      PSGSFXPlay (sound,channel);
   }
}

  View user's profile Send private message
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Thu Mar 29, 2018 1:54 pm
I agree - nice overhaul of this classic game! Maybe I'm getting a little too old, but it feels very nice to be able to actually clearly see the bigger and brighter gems - compared to when I usually play Columns :) The music is a good fit, even though it drives me crazy after some time - but that is how it is supposed to be! I too experienced some music lagging, but not a big deal. Great work!
  View user's profile Send private message Visit poster's website
  • Joined: 12 Oct 2015
  • Posts: 183
  • Location: Ireland
Reply with quote
Great stuff
Post Posted: Fri Mar 30, 2018 2:34 pm
This is awesome Cyttorak especially if this is a first competition entry?? Great box art by the way! I really like the fact that you could potentially score about 1,000,000,000 points and there could be about 1,000,000,000 levels :) Great stuff
  View user's profile Send private message Visit poster's website
Revo
  • Guest
Reply with quote
Post Posted: Fri Mar 30, 2018 2:46 pm
What? We have to wait one year for a 2 players mode? That's way too long! The music is perfect and I really like the font and the big sprites.
 
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Apr 04, 2018 9:32 am
Nice work!
I feel the blocks are a little too slow falling at start, but that's probably because I'm quite used to those kind of games.
Also, I noticed the nice old fox trick of scrolling the screen 32 pixels down so that you could reuse the (unused) upper part of the PNT for 8 additional tiles contiguous to the previous ones :)
Please, do make a 2-players version!
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2009
  • Posts: 280
Reply with quote
Post Posted: Wed Apr 04, 2018 11:26 am
hang-on wrote
The music is a good fit, even though it drives me crazy after some time - but that is how it is supposed to be!


Thanks, i guess?
Which of the two level songs did drive you crazy? or crazier?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 19
Reply with quote
Post Posted: Wed Apr 04, 2018 11:57 am
Thanks guys for your positive feedback and the example code about how to make music not to hang!! I am really glad you like that little game :-)

I will try to do a 2P version as soon as possible but before it I have to finish other projects (no SMS related btw).

Regarding some questions and comments:

- Yeah, game has a 32 bit counter for the score and another 32 bit one for the loops. So you can get 4 billion points 4 billion times, that's why in the cover art says "longer than your lifetime"

- Big gems were the starting point of the game. I don't like how they look in Columns for SMS, they are too small.

- About the scrolling trick: I didn't know it was a trick, I just mounted the screen and bmp2tile created the asset in a way I had to scroll 32 pixels the vertical scroll in order to see it correctly in 256x224. What is the advantage of this trick? More tiles for the background?

- Music in line interrupt code: I will try it as soon as possible, but what surprises me is how banks are changed without problem. I mean, I remember sverx told me that it was instantaneous, but I didn't suspect it could be done without so small impact on performance. There is no bank change in game play time in Gemitas because I thought it will not be possible to use them in that liberal way.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Apr 04, 2018 12:08 pm
Cyttorak wrote
- About the scrolling trick: I didn't know it was a trick, I just mounted the screen and bmp2tile created the asset in a way I had to scroll 32 pixels the vertical scroll in order to see it correctly in 256x224. What is the advantage of this trick? More tiles for the background?


Oh - wow! (I'm slapping my own face here!) - I didn't realize you were using one of the 'extra height' screen modes! Sure you had to scroll, as in that mode the PNT starts at 0x3700 instead of 0x3800.
Unfortunately that mode is available only on second revision Master Systems (the so called SMS II) - devkitSMS/SMSlib doesn't even support those modes properly. Having tested it on my SMS II simply I didn't realize that, but fellow forum users with an 'original' Master System won't be able to see the game correctly (though I'm curious to know what they'll see instead!)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 19
Reply with quote
Post Posted: Wed Apr 04, 2018 12:28 pm
I am thinking that Columns for SMS used 256x192 resolution instead of 256x224 for this very same reason, to be compatible with Master System I, and due to that they had to use 8x8 gems so it could display the 6x13 gem board as the original game.
  View user's profile Send private message
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Wed Apr 04, 2018 2:54 pm
sverx wrote
Cyttorak wrote
- About the scrolling trick: I didn't know it was a trick, I just mounted the screen and bmp2tile created the asset in a way I had to scroll 32 pixels the vertical scroll in order to see it correctly in 256x224. What is the advantage of this trick? More tiles for the background?


Oh - wow! (I'm slapping my own face here!) - I didn't realize you were using one of the 'extra height' screen modes! Sure you had to scroll, as in that mode the PNT starts at 0x3700 instead of 0x3800.
Unfortunately that mode is available only on second revision Master Systems (the so called SMS II) - devkitSMS/SMSlib doesn't even support those modes properly. Having tested it on my SMS II simply I didn't realize that, but fellow forum users with an 'original' Master System won't be able to see the game correctly (though I'm curious to know what they'll see instead!)


BTW, the other day I tested the game in a SMS I from 1988...and it worked flawlessly.....

Can we asume that VDP II are already present in 1988 machines?
  View user's profile Send private message
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Thu Apr 05, 2018 8:53 pm
tibone wrote
hang-on wrote
The music is a good fit, even though it drives me crazy after some time - but that is how it is supposed to be!


Thanks, i guess?
Which of the two level songs did drive you crazy? or crazier?


Ha ha, I truly meant it as a compliment. It is really a very fitting, Columns-like tune (talking about the first level song here - and also the title screen tune). The real Columns track drives me nuts (too) - perfectly supporting my impression of Columns as a game that paradoxically is meditative and stressful at the same time. I think your music work on Gemitas hits that feeling very spot on. Play Columns (or Gemitas) for a little while, and then you have the music sticking to your brain for the rest of the day.... or even your life :)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Apr 06, 2018 8:50 am
I tested it again, since I realized you are using the extra-high mode. Then I saw that -on my setup- the last line of tiles at the bottom of the screen is completely invisible, but that appears only when I play at 60Hz ('NTSC mode'). In your game anyway there's nothing important there, as there's nothing important in the leftmost column FWIW, and thus no problem.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 19
Reply with quote
Post Posted: Fri Apr 06, 2018 9:00 am
So using 256x224 actually is only something like 248x216 visible in NTSC?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Apr 06, 2018 9:20 am
The problem is the so called 'safe area' - on a CRT what's too close to the borders might disappear.
From what I've read in those last years, it's pretty common on SMS-CRTs setups that the leftmost column isn't displayed / isn't displayed completely (on my setup in fact I can't see the leftmost 7 pixels, but I can see the 8th!)
As for the height, I have not much information. It might be a problem affecting my setup only (I'm using a *modded* PAL SMS II fitted with a 50/60 Hz switch, and a Samsung CRT accepting both 50/60Hz image, both with PAL and NTSC colors subcarriers - it's one of the latest CRTs manufactured, in an era when LCDs were quite common already and CRTs starting to be phased out - I bought that in 2003...)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Apr 06, 2018 1:58 pm
Last edited by sverx on Mon Apr 09, 2018 7:48 am; edited 1 time in total
kusfo wrote
BTW, the other day I tested the game in a SMS I from 1988...and it worked flawlessly.....
Can we asume that VDP II are already present in 1988 machines?


Please test the attached ROM - and let us know.

(attachment removed, program wasn't working correctly...)
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Fri Apr 06, 2018 3:31 pm
You just reinvented the wheel. :P

http://www.smspower.org/forums/15440-LamboByGenesisProjectNewSMSDemo#86558

sverx wrote
kusfo wrote
BTW, the other day I tested the game in a SMS I from 1988...and it worked flawlessly.....
Can we asume that VDP II are already present in 1988 machines?


Please test the attached ROM - and let us know.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Apr 06, 2018 3:55 pm
Calindro wrote
You just reinvented the wheel. :P


Oh - LOL! - What are you testing there to see which VDP rev. is?
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Sat Apr 07, 2018 9:06 pm
Btw, I've get different results!

Sverx tool is saying the VDP is an original revision VDP, but Calindro's says it's a rev.2!!!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Apr 09, 2018 7:48 am
my tool is broken. I should have tested it before releasing it...
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Mon Apr 09, 2018 7:55 am
In any case, this master system has hang-on on bios, and it's serial is 49G90483, model number 3005-06-B, it's that one known to have the rev2 of the VDP?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3756
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Apr 09, 2018 12:07 pm
I doubt we have such a detailed data :|
If you happen to open up your Master System, you can try reading what's written on the chip.

edit: this should work
VDPid.zip (4.1 KB)
VDPid - identify SMS VDP - source included (fixed)

  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2014
  • Posts: 331
Reply with quote
Post Posted: Wed Apr 11, 2018 4:43 am
Feels very close to the MD version. Nice and polished.

Game gets so hard by level 7, then again i was never particularly good at columns :D Good stuff!
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!