-
September 9th, 2009, 04:47 PM
#1
Is this possible with C?
Ok a friend made a bet with me that I couldnt make a very basic pong replica in C that used less then 1 MB of HDD space and ran in less then 10MB of ram. CPU cycles isnt important in this case.
I know you can make pretty small and fast things in C but is this even possible?
-
September 9th, 2009, 04:50 PM
#2
Re: Is this possible with C?
It's probably possible. Really depends what you mean by "basic". If you're going to go with ASCII art I'd say definitely. Even some basic graphics packages should allow you to stay under those limits, so long as you make sure everything is linked statically.
-
September 9th, 2009, 05:02 PM
#3
Re: Is this possible with C?
Originally Posted by Lindley
It's probably possible. Really depends what you mean by "basic". If you're going to go with ASCII art I'd say definitely. Even some basic graphics packages should allow you to stay under those limits, so long as you make sure everything is linked statically.
basic meaning rectangles for the paddles, a circle for the ball and two lines for the top and bottom edges kind of basic. xD
-
September 9th, 2009, 06:11 PM
#4
Re: Is this possible with C?
Honestly it should be trivial to meet those requirements.
-
September 9th, 2009, 06:56 PM
#5
Re: Is this possible with C?
I'll bet you can do it in half that. Didn't the atari only have like 128K in those cartridges?
-
September 9th, 2009, 07:45 PM
#6
Re: Is this possible with C?
I don't think the question is whether or not it can be done---obviously it can---but whether it would be easy to do with modern graphics libraries. There *is* a tendency towards bloat in some of them.
-
September 9th, 2009, 08:30 PM
#7
Re: Is this possible with C?
Well, a basic program using the Allegro graphics library yields a ~600KB exe with Allegro and the CRT statically linked, and uses 3-4MB of RAM. That's with no attempts at size optimization whatsoever, and there's really no way you should use another 400KB of exe space or 5+MB of memory to implement pong.
-
September 10th, 2009, 10:57 AM
#8
Re: Is this possible with C?
Originally Posted by ninja9578
I'll bet you can do it in half that. Didn't the atari only have like 128K in those cartridges?
The Atari 2600 console system permitted an absolute maximum of 6KB in a ROM cartridge. Eventually that ceiling was broken to some degree by using bank switching in 4K blocks to swap in and out different 4KB blocks into the memory space.
Still later and more advanced cartridges contained code to swap banks in smaller increments, and even have some onboard RAM, but classic, 2600 Pong (and the 4 or 5 other games that came with) all fit into a singl 6K ROM.
Sure, the console itself had some additional features for display and sound interfacing, but the actual game code was tiny.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|