GenDev SpritesMind Website SpritesMind.Net
Sega Megadrive/Genesis development
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Snake in 260 bytes for MD

 
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos
View previous topic :: View next topic  
Author Message
Sonic 65
Newbie


Joined: 08 Sep 2009
Posts: 1

PostPosted: Sat Sep 12, 2009 6:00 am    Post subject: Snake in 260 bytes for MD Reply with quote

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 Sad). 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:

Back to top
View user's profile Send private message
Shiru
Very interested


Joined: 07 Apr 2007
Posts: 786
Location: Russia, Moscow

PostPosted: Sat Sep 12, 2009 6:13 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Christuserloeser
Very interested


Joined: 28 Jan 2007
Posts: 124
Location: DCEvolution.net

PostPosted: Sat Sep 12, 2009 4:02 pm    Post subject: Reply with quote

Hey, thanks a lot for sharing ! Very Happy
_________________
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1953
Location: Estonia, Mahtra village

PostPosted: Sat Sep 12, 2009 5:28 pm    Post subject: Reply with quote

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 Very Happy
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
8bitwizard
Very interested


Joined: 24 Feb 2007
Posts: 155
Location: Austin, TX

PostPosted: Thu Sep 17, 2009 2:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
jeanetti
Newbie


Joined: 03 Nov 2009
Posts: 2

PostPosted: Wed Nov 04, 2009 11:26 am    Post subject: Reply with quote

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


Last edited by jeanetti on Sat Nov 07, 2009 9:46 am; edited 1 time in total
Back to top
View user's profile Send private message
Flygon
Interested


Joined: 28 Sep 2009
Posts: 43

PostPosted: Wed Nov 04, 2009 11:34 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
LocalH
Very interested


Joined: 19 Dec 2006
Posts: 132

PostPosted: Wed Nov 04, 2009 3:47 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Fred
Newbie


Joined: 20 Sep 2008
Posts: 5
Location: Sweden

PostPosted: Tue Nov 17, 2009 2:00 pm    Post subject: Reply with quote

bot wrote:
lololololdonkey konglolololol

what
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group