Page 1 of 1

Snake in 260 bytes for MD

Posted: Sat Sep 12, 2009 6:00 am
by Sonic 65
Hi guys - like snkenjoi and andlabs before me, I'm also from Sonic Retro. =P

I read through snkenjoi's thread on the smallest useful MD ROM and also TascoDLX's Megadrive demo, both of which inspired me to see if I could make some sort of simple game within the 260-byte TMSS limit that still worked on all MD models (note: this is untested on real hardware, but it works on all emulators, even Fusion with the TMSS bios).

The game pretty much plays like a basic Snake clone (collect food to grow bigger, if you hit yourself or the edges of the stage you die). There is no sound in this demo (not enough space :(). It doesn't really look very pretty, but I guess that's to be expected.

ROM link.

Known issues are that when you get a food piece, a grey 8x8 tile appears in the top-left corner for a split second, and the controls aren't really as responsive as I'd have liked them to be. However, the game is still very playable.

I'll release the source after I comment it fully. If you're really impatient, you could try disassembling it or something. =P

If you seriously want a screenshot before downloading, behold:

Image

Posted: Sat Sep 12, 2009 6:13 am
by Shiru
This is good, though I think you could fit much more in 260 bytes.

The smallest possible Snake game was my obsession some time ago, I wanted to make it into 128 bytes or less. I've made 256 bytes version for ZX Spectrum with sound effects and restarting after game over (it was easily possible to make it smaller without sound, but it would be far from 128 bytes anyway), and few versions for 8086 PC without sound, but with restarting (it was 189 bytes or so). The most smallest Snake implementations I know is 144 bytes for 8086 PC and 121 byte for ZX Spectrum (written in FP calculator code).

Posted: Sat Sep 12, 2009 4:02 pm
by Christuserloeser
Hey, thanks a lot for sharing ! :D

Posted: Sat Sep 12, 2009 5:28 pm
by TmEE co.(TM)
Problem with 68K is that your typical opcode takes minimally 2 bytes, and lot of them take 4 or more bytes. Z80, 8080 and other 8bit CPUs have things in 1 or 2 bytes usually so you can have much more in same space.

Anyway, this is nice :D

Posted: Thu Sep 17, 2009 2:07 pm
by 8bitwizard
An even bigger problem is that the word "SEGA" has to be located at $0100. Thus, no TMSS-compatible ROM can be less than 260 bytes.

Beyond this, there is quite a bit of overhead just to get it to start up: 8 bytes for initial A7 and PC, 4 bytes for "SEGA", and 20 bytes for handling TMSS. But loading A0 saves 4 bytes later, so that's really 8 + 4 + 16 = 28 bytes, before you can do anything useful.

Then the VDP has to be set up, taking 12 more bytes just to set the registers, then you have to clear VRAM, then you have to set up the joypad (but I don't see it storing $40 to set up the control port).

So you can't directly compare the size of this against the size something where the hardware has already been initialized for you.

Posted: Wed Nov 04, 2009 11:26 am
by jeanetti
Where can i download a donkey kong country rom that doesn't lag? i want to download a donkey kong country rom (first one) to play with my super nintendo emulator but everytime i download one it lags...where can i download one that i can play at normal game speed and doesn't lag.
_____________________
market samurai ~ marketsamurai ~ marketsamurai.com

Posted: Wed Nov 04, 2009 11:34 am
by Flygon
Uh, jeanetti, you've both hit the completely wrong topic and forum to be asking that question.

I suggest asking that question somewhere else. :wink:

Posted: Wed Nov 04, 2009 3:47 pm
by LocalH
Back on topic...

For those of us unencumbered by TMSS, I wonder what the smallest possible version of this would be. I've got a TMSS-less Gen1 with my trusty SMD so I could test to make sure it works on real hardware. Based on 8bitwizard's post, I see a minimum of 24 bytes that can be discarded (since you don't have to handle TMSS) but I'm wondering if one could abuse the header area (since there are no restrictions on executing code between $0-$1FF AFAIK, even on TMSS MDs). I bet you could get a TMSS-less version of this comparable to other systems (I would guess 160-192 bytes given the differences in instruction set).

Posted: Tue Nov 17, 2009 2:00 pm
by Fred
bot wrote:lololololdonkey konglolololol
what