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 2016] Schlange CV by PkK

Reply to topic

Rate this entry!

1 (Poor) 6% 6%
2 0% 0%
3 12% 12%
4 25% 25%
5 31% 31%
6 18% 18%
7 6% 6%
8 0% 0%
9 (Excellent) 0% 0%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 11822
  • Location: London
Reply with quote
[Coding competition 2016] Schlange CV by PkK
Post Posted: Wed Mar 23, 2016 12:02 am
Last edited by Maxim on Thu Apr 28, 2016 7:41 am; edited 1 time in total
http://www.smspower.org/Homebrew/SchlangeCV-SMS



PkK wrote
This is a port of the popular game Schlange/snake/nibbles It is based on
a port I originally wrote for the ColecoVision, but there are
substantial differences, in particular in the graphics and the AI.

It should work on SG-1000, SC-3000, Mark III and Master
System, but so far has only been tested in the emulator Meka, not yet on
real hardware.

There is code in the game to automatically detect the system it is
running on. On the Mark III and Master System the full graphics are
used, while the SG-1000 and SC-3000 have simplified graphics.
Unfortunately I don't know of any emulator that emulates the hardware
features for the autodetection correctly, and don't have SG-1000 or
SC-3000 hardware myself. However, to allow all users to see the
differences between the SG-1000 / SC-3000 and the mark III / Master
System version, one can switch between them by pressing the fire button
in the configuration screen.

I consider this version a demo version, since it does not yet have all
the levels I want to put into this game, and only two of the four snakes
are fully working.

Gameplay:

Use the controller to steer your snake around the screen, while avoiding
collision with the walls, another snake or yourself.
A snake dies when it runs into a wall or a snake. The game is over when
no snakes remain.

A level is won when a snake reaches the winning length. The snake that
wins the most levels will win the game once all levels are won.

A snake increases in length when a bonus is eaten. Bonuses will appear
randomly throughout the game, including a special, clock-shaped bonus,
which halts all other snakes for a short period of time.

When a new level starts all snakes are reborn at initial length.

Configuration screen:

Use the joystick to navigate in the configuration menu and change
configuration settings.

Each snake can be controlled using either ColecoVision controller
(select ``Human 0" or ``Human 1") or the AI. There are two different AIs
available. ``AI S" is a simple and fast AI. The other AI's skill depends
on the number shown. Higher numbers indicate higher skill. Setting the
number to high values will slow the game down.

Snake speed can be configured using the ``Moves / 10 sec" option.
"Winning length" is the length a snake has to reach to win the level.
The ``Moves / Bonus" option adjusts the frequency of bonuses appearing.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 347
Reply with quote
Post Posted: Mon Mar 28, 2016 4:46 pm
The game is fun, but it has serious graphic glitches when playing on real hardware. The playing area is mostly okay, but the score board is a mess. Are you writing to the VDP while the screen is updated?
  View user's profile Send private message
  • Joined: 07 Aug 2007
  • Posts: 187
  • Location: Yach, Germany
Reply with quote
Post Posted: Mon Mar 28, 2016 10:44 pm
Kagesan wrote
Are you writing to the VDP while the screen is updated?


Yes, but it should only happen at a rate of at most one byte per 8.4 µs, which should be OK (and definitely is OK for the TMS9918).

Philipp
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 1908
Reply with quote
Post Posted: Tue Mar 29, 2016 9:18 am
It's surely the (very common) type of VRAM corruption due to not having enough clock cycles between two writes when in active phase. Check your code, you should have at least 26 clock cycles between each writes to be 100% sure to write everything correctly.
Also, make sure no interrupt can happen between the two writes to the VDP address registers. These are really the only two things to ensure to avoid problems :)
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 347
Reply with quote
Post Posted: Tue Mar 29, 2016 4:11 pm
Try running it in Emulicious with VDP constraints switched on. That gives an accurate impression of how it looks on the real hardware.
  View user's profile Send private message
  • Joined: 12 Oct 2015
  • Posts: 42
  • Location: Ireland
Reply with quote
Post Posted: Wed Mar 30, 2016 7:22 pm
Kagesan wrote
Try running it in Emulicious with VDP constraints switched on. That gives an accurate impression of how it looks on the real hardware.


Actually just to add to the thread - I tried to play this using Fusion and seems to have some graphics issues even on the emulator esp. during game play...
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 187
  • Location: Yach, Germany
Reply with quote
Post Posted: Thu Apr 14, 2016 10:08 pm
Finally, I found some time to track the graphics issues down.
The key was that there were no glitches in the intro, only in the menu and the game, i.e. the parts where text is displayed.

Since I considered the text stuff less important speed-wise, the graphics memory access routines for that were written in C, not asm. Turned out SDCC optimized the code so much that it became fast enough to violate the timing contraints

Now I can fix it - for this and the other two games.

Philipp
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 1908
Reply with quote
Post Posted: Fri Apr 15, 2016 8:03 am
PkK wrote
Now I can fix it - for this and the other two games.


Please do that, and let us know when it's done, I'll happily test these again on my SMS II :)
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 187
  • Location: Yach, Germany
Reply with quote
Post Posted: Fri Apr 15, 2016 8:10 am
sverx wrote
PkK wrote
Now I can fix it - for this and the other two games.


Please do that, and let us know when it's done, I'll happily test these again on my SMS II :)


Fixed it last night, sent the updated .rom for this and Cye to competition@smspower.org; I guess it will appear here sometime today, after someone goes through that mailbox.

Philipp
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 7688
  • Location: Paris, France
Reply with quote
Post Posted: Fri Apr 15, 2016 10:29 am
Please post updates to the forum or directly on the homebrew page if possible, and not to the e-mail address (we rarely check it).
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 187
  • Location: Yach, Germany
Reply with quote
Post Posted: Fri Apr 15, 2016 5:45 pm
OK, here's the update.

Philipp
SCV.demo.sms.gz (19 KB)
Updated version with VDP timing issues fixed

  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!