PDA

View Full Version : mac native demoscenes




Muncher
Nov 28, 2007, 08:08 PM
Just recently, I was surfing around online, and I came across the idea of a demoscene. The concept really struck a chord in me, especially the 64k/4k intros. I've seen a lot of genius coding, but that has got to be some of the best (the good ones at least :rolleyes:). Anyway, I looked around to see if there were any os x native intros. However, every single one I found was a port, except for frmactals. After fooling around a bit in xcode, I found what I think is the main reason why: Macs just aren't good at making small apps. Hello World was 12kb, and the simplest SDL app was 1.1MB, after being thinned down a bit. It seems that PPC apps are a lot smaller than Intel, cause I managed 508kb with that arcitecture.

Anyways, to my main question. :D How do I make a small intro on a mac without assembly? Seems impossible to me. Oh, well. I'm getting windows in a few days anyway. :rolleyes:



HiRez
Nov 28, 2007, 09:03 PM
Anyways, to my main question. :D How do I make a small intro on a mac without assembly? Seems impossible to me. Oh, well. I'm getting windows in a few days anyway. :rolleyes:Uh, can I ask why it's so important to have an application under 64K nowadays? Or is it just theoretical curiosity? Do you know how many 1 MB apps you can fit on a low-end 160 GB drive? Sorry, I know that's a snarky response...but really...why?

Muncher
Nov 28, 2007, 09:24 PM
From my (very limited) understanding, it's more of an art form than anything else. Just how much can you fit into 64k? Check this out (http://www.youtube.com/watch?v=scSsxrMVXh8). Also this one (http://www.youtube.com/watch?v=tlbeSuyFyLA).

Hee hee hee. I did it! I'm so proud! :D I removed the sdl executable (which, apparently, did nothing for me, except take up valuable space) from the app, and ran it through trimmit (http://lipidity.com/software/trimmit/), a wonderful little program which got me down to ~23k! I'll attach the app; it's nothing amazing, just a test to see what I could do.

Eric5h5
Nov 28, 2007, 09:55 PM
Sorry, I know that's a snarky response...but really...why?

If you have to ask why, you wouldn't understand the answer. ;)

As for code size, Macs aren't really much different from any other platform. It depends on what sort of stuff you're including. If anything, PPC apps tend to be slightly larger than x86 on average, probably due to x86 having variable length instructions. If you're doing a Universal build, then your code size doubles right away.

--Eric

arn
Nov 28, 2007, 10:10 PM
Just recently, I was surfing around online, and I came across the idea of a demoscene. The concept really struck a chord in me, especially the 64k/4k intros. I've seen a lot of genius coding, but that has got to be some of the best (the good ones at least :rolleyes:). Anyway, I looked around to see if there were any os x native intros. However, every single one I found was a port, except for frmactals. After fooling around a bit in xcode, I found what I think is the main reason why: Macs just aren't good at making small apps. Hello World was 12kb, and the simplest SDL app was 1.1MB, after being thinned down a bit. It seems that PPC apps are a lot smaller than Intel, cause I managed 508kb with that arcitecture.


I was a big fan of the demoscene, but the art of it is certainly lost in days of GPUs and 2GHz processors. Getting something impressive running on a 8MHz machine with hardware tricks and size contraints was certainly an art.

The Amiga had (imo) the best demos. In the days of Youtube, there are demos recorded. Here are a couple of my favorites from the Amiga:

State of the Art (http://www.youtube.com/watch?v=c5kuYfTCGLg)
Extension (http://www.youtube.com/watch?v=pQvO4Hc0qAI)

Again, ran on an 8MHz machine from 1986. I dabbled in some demo coding on the Mac in my college days (Mac IIsi):

Chrystar (http://www.pouet.net/prod.php?which=24593)
Flag Day (http://www.pouet.net/prod.php?which=24594)
Chaos Mint (http://www.pouet.net/prod.php?which=24595)

None work anymore on OS X. If anyone's got a 68k machine that can record video, I'd like to have a digital copy of 'em.

arn

HiRez
Nov 28, 2007, 10:32 PM
OK I get it, that's cool. You might try something with QuartzComposer, or embedding a QCView into a Cocoa app (although the latter will probably not be that small due to all the Cocoa and Quartz libraries needed -- I'd guess >100K minimum). You can do some very cool stuff in QuartzComposer in under 64K for the file, I'm just not sure how to display it with little overhead. I guess using some sort of pre-installed player (such as the screensaver infrastructure) would be considered cheating?

ps. Man I loved Chrystar and Flag Day on my original Mac 128K (although they might have been running on the Plus upgrade). Those were really impressive.
92695

Muncher
Nov 28, 2007, 11:14 PM
OK I get it, that's cool. You might try something with QuartzComposer, or embedding a QCView into a Cocoa app (although the latter will probably not be that small due to all the Cocoa and Quartz libraries needed -- I'd guess >100K minimum). You can do some very cool stuff in QuartzComposer in under 64K for the file, I'm just not sure how to display it with little overhead. I guess using some sort of pre-installed player (such as the screensaver infrastructure) would be considered cheating?

ps. Man I loved Chrystar and Flag Day on my original Mac 128K (although they might have been running on the Plus upgrade). Those were really impressive.
92695

I don't think using quartz composer would go over well. I think it has to be an executable. Now, if I can find some good compression code, I can expand it at runtime and fit twice as much in!

The thing about os x is that you can't just make a pure c sdl app. To make a .app file, you need to go through some obj-c "glue." That "glue" is 22k all on its own. The real source file was very small, maybe 1k. I wonder if I learned obj-c I could slim that down a bit. If you guys want to give it a try (I don't see why you would, but still... :D), I'll attach the file.

Eric5h5
Nov 29, 2007, 08:11 PM
Again, ran on an 8MHz machine from 1986.

[Nitpick mode=ON]7 Mhz, actually. :) I believe the Atari ST was 8 MHz. But yep, Amiga had the best demos.

--Eric

mongrol
Nov 29, 2007, 11:38 PM
ubernitpick
{
amigamhz = 7.14
}

whooleytoo
Nov 30, 2007, 10:28 AM
I think it's quite an interesting area. The nice thing about the Demoscene is it encourages procedural generation; which in turn is very useful for scalable graphics, I reckon.

Hence, if you were to code a game using entirely procedurally generated content, the quality/resolution could be scaled up/down easier for mobile to high-end gaming devices.

Padraic
Dec 2, 2007, 01:16 PM
I've been dabbling in the demoscene as well. No coding yet (no time ATM), just checking them out. Besides http://www.pouet.net I also found http://mac.scene.org... Both have some good mac demos.

Patrick

Macc
Jan 11, 2014, 08:03 PM
Hi, i,m also interested some way in the demoscene. About 20-24 years ago, i made many indros and demos on the c64, later i started 68k assembly on an Amiga600, then i even did some coding on GameBoy and GameBoy Advance. Some years ago i bought a Mac Classic II, it has system 7.1 installed, in good working condition. Then i didn't touched it until now. When i powered it up, it didn't worked anymore. I started digging the net, finally i cleaned, recapped the main board, and it now works again. Mainwhile i fell in love with the Classic OS, and the machine, and bought some another Macs too from the era: Mac LC, Mac LC III. All of them are now working with system 7.6.1, i got the dev tools installed too, i read thousands of pages of developer manuals... still missing some informations, but i hope i will have enough spare time to start coding for real.

Unfortunately, some links are dead now, this is the same for almost all mac demoscene links around provided by google, or forums. If anyone could share some demoscene links, or have some information about direct hardware programming, i would be really greatful...

arn: i only could download the Chaos mint, i will copy it to the real HW, and will try to record somehow.

Madd the Sane
Jan 12, 2014, 02:42 PM
Yes, unfortunately Apple did remove some of their older downloads, especially MPW. Although most of the Carbon headers still list when specific C APIs became available on Classic, but you will have to find out which version of, say, InterfaceLib is on 7.5.3.

Edit: also, that is the C interface, not the Pascal one. As my knowledge of Pascal is limited, I don't know how different the Mac APIs are, as far as names go.

Macc
Jan 14, 2014, 11:47 AM
Thanks for the tip. For now i'm searching for the inside macintosh volume IV/V/VI in printed format (as it isn't available as pdf), but unfortunately, Amazon who have them, doesn't ship to my country. Anyone have them for sale?

arn: i was able to run Chaos Mint on my Mac LC III, if you could provide me your other demo apps, i could make a camera recording of them.

Yesterday i got my Azetc Monster, i finished installing the system on it. That silence is amazing:) In addition, it is now really easy to transfer large files from OS X directly to the CF card, which is now in fact the HD one my vintage Mac.

barkmonster
Jan 14, 2014, 11:57 AM
From my (very limited) understanding, it's more of an art form than anything else. Just how much can you fit into 64k? Check this out (http://www.youtube.com/watch?v=scSsxrMVXh8). Also this one (http://www.youtube.com/watch?v=tlbeSuyFyLA).

Hee hee hee. I did it! I'm so proud! :D I removed the sdl executable (which, apparently, did nothing for me, except take up valuable space) from the app, and ran it through trimmit (http://lipidity.com/software/trimmit/), a wonderful little program which got me down to ~23k! I'll attach the app; it's nothing amazing, just a test to see what I could do.

Quit unexpectedly. I'm on Snow Leopard 10.6.8

Madd the Sane
Jan 14, 2014, 12:30 PM
Yesterday i got my Azetc Monster, i finished installing the system on it. That silence is amazing:) In addition, it is now really easy to transfer large files from OS X directly to the CF card, which is now in fact the HD one my vintage Mac.
Wait, there's an adapter that lets you use a CF card as a hard drive on older Macs? :O

Hmm, is there one that lets you use an SD card instead?

chown33
Jan 14, 2014, 01:32 PM
Wait, there's an adapter that lets you use a CF card as a hard drive on older Macs? :O

Hmm, is there one that lets you use an SD card instead?

There are microSD-to-CF adapters. I looked them up on Amazon last fall.

FWIW, a CF card's electrical interface is essentially an ATA/IDE drive. Obviously, the connectors are completely different, but an adapter is little more than a circuit board with suitable connectors and conductors, and little or no electronics.

I see several such products on Amazon, search terms:
IDE to compact flash adapter

http://en.wikipedia.org/wiki/CompactFlash#Technical_details

Macc
Jan 14, 2014, 01:46 PM
Wait, there's an adapter that lets you use a CF card as a hard drive on older Macs? :O

Here is mine: http://www.artmix.com/CF_AztecMonster.html

Madd the Sane
Jan 14, 2014, 01:56 PM
FWIW, a CF card's electrical interface is essentially an ATA/IDE drive.
I see several such products on Amazon, search terms:
IDE to compact flash adapter

One problem with that: The Mac that I have, a Power Mac 7200, has no IDE interface, and I have no plan on adding one. I would need something that would connect to the SCSI bus that is inside of it.

chown33
Jan 14, 2014, 02:11 PM
One problem with that: The Mac that I have, a Power Mac 7200, has no IDE interface, and I have no plan on adding one. I would need something that would connect to the SCSI bus that is inside of it.

I googled scsi to IDE adapter, which showed some promising results.

I also googled scsi compact flash adapter and found this on the first page of results:
http://www.atari-forum.com/viewtopic.php?f=27&t=22928

YMMV.

mrichmon
Jan 15, 2014, 02:17 AM
After fooling around a bit in xcode, I found what I think is the main reason why: Macs just aren't good at making small apps. Hello World was 12kb, and the simplest SDL app was 1.1MB,:

Well, with a SDL app you are pulling in a large library. But a Hello World can be implemented smaller than 12kB.

The following code:
main() {
printf("hello\n");
}

Compiles to a 8496 byte (~8.3kB) binary without playing with any gcc or link options to strip out unused parts. (On OS X 10.9.1 with Apple LLVM version 5.0 (clang-500.2.79).) By further hand coding this can probably be reduced down to maybe ~5kB since a main method with no body statements will compile to 4313B.

The original point of "demos" was to demonstrate programming proficiency by implementing something impressive in a small program. By their very nature this involves getting to know the compiler, linker, and binary layout very well to be able to manipulate the tools achieve the demo goal.

Starting to work in an IDE like XCode, or using large and complex libraries like SDL is in some ways going in the opposite direction of what a demo is trying to do. You could use XCode to write a demo, but if you are focused on binary code size you would probably find yourself fighting against XCode most of the time. It might be worth considering dropping down to using LLVM or gcc directly.

robvas
Jan 15, 2014, 10:21 AM
It's for Linux, but here's some good reading on making the tiniest executable possible

http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

Macc
Jan 20, 2014, 05:24 AM
robvas: nice article, i love this type of optimization!