Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Muncher

macrumors 65816
Original poster
Apr 19, 2007
1,465
0
California
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

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
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

macrumors 65816
Original poster
Apr 19, 2007
1,465
0
California
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. Also this one.

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, 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.
 

Attachments

  • 64k.zip
    10.6 KB · Views: 527

Eric5h5

macrumors 68020
Dec 9, 2004
2,489
590
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

macrumors god
Staff member
Apr 9, 2001
16,363
5,795
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
Extension

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

Chrystar
Flag Day
Chaos Mint

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

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
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.
View attachment Particle Burst Test r01.qtz.zip
 

Muncher

macrumors 65816
Original poster
Apr 19, 2007
1,465
0
California
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.
View attachment 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.
 

Attachments

  • SDLMain.m.zip
    3.8 KB · Views: 420

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
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.
 

Macc

macrumors newbie
Jun 11, 2009
12
0
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.
 
Last edited:

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
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.
 
Last edited:

Macc

macrumors newbie
Jun 11, 2009
12
0
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

macrumors 68020
Dec 3, 2001
2,134
15
Lancashire
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. Also this one.

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, 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

macrumors 6502a
Nov 8, 2010
534
73
Utah
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

Moderator
Staff member
Aug 9, 2009
10,739
8,415
A sea of green
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
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
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

Moderator
Staff member
Aug 9, 2009
10,739
8,415
A sea of green
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

macrumors 6502a
Jun 17, 2003
873
3
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:
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.
 

Macc

macrumors newbie
Jun 11, 2009
12
0
Hi again,

After a while, i'm back again, now i'm finally got assembled a little intro, and just wanted to share with you. It's my first attempt to do anything in my old Mac's - using C and a little assembly. It runs on my Mac LC III and Classic II.

Here is a short video:
http://youtu.be/THLHg4X96Ok

Thanks for watching...
 

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
Hi again,

After a while, i'm back again, now i'm finally got assembled a little intro, and just wanted to share with you. It's my first attempt to do anything in my old Mac's - using C and a little assembly. It runs on my Mac LC III and Classic II.

Here is a short video:
http://youtu.be/THLHg4X96Ok

Thanks for watching...
Hey that's pretty cool :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.