mac native demoscenes

Discussion in 'Mac Programming' started by Muncher, Nov 28, 2007.

  1. macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #1
    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:
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    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?
     
  3. thread starter macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #3
    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.
     

    Attached Files:

    • 64k.zip
      File size:
      10.6 KB
      Views:
      95
  4. macrumors 68020

    Joined:
    Dec 9, 2004
    #4
    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
     
  5. arn
    macrumors god

    arn

    Staff Member

    Joined:
    Apr 9, 2001
    #5
    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
     
  6. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #6
    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
     
  7. thread starter macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #7
    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.
     

    Attached Files:

  8. macrumors 68020

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

    --Eric
     
  9. macrumors regular

    Joined:
    Jul 16, 2007
  10. macrumors 603

    whooleytoo

    Joined:
    Aug 2, 2002
    Location:
    Cork, Ireland.
    #10
    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.
     
  11. macrumors regular

    Joined:
    Aug 30, 2007
    Location:
    Somewhere between here and there...
    #11
    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
     
  12. Macc, Jan 11, 2014
    Last edited: Jan 12, 2014

    macrumors newbie

    Joined:
    Jun 11, 2009
    #12
    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.
     
  13. Madd the Sane, Jan 12, 2014
    Last edited: Jan 14, 2014

    macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #13
    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.
     
  14. macrumors newbie

    Joined:
    Jun 11, 2009
    #14
    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.
     
  15. macrumors 68020

    barkmonster

    Joined:
    Dec 3, 2001
    Location:
    Lancashire
    #15
    Quit unexpectedly. I'm on Snow Leopard 10.6.8
     
  16. macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #16
    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?
     
  17. macrumors 603

    Joined:
    Aug 9, 2009
    #17
    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
     
  18. Macc, Jan 14, 2014
    Last edited: Jan 14, 2014

    macrumors newbie

    Joined:
    Jun 11, 2009
    #18
  19. macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #19
    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.
     
  20. macrumors 603

    Joined:
    Aug 9, 2009
    #20
    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.
     
  21. macrumors 6502a

    Joined:
    Jun 17, 2003
    #21
    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.
     
  22. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #22
  23. macrumors newbie

    Joined:
    Jun 11, 2009
    #23
    robvas: nice article, i love this type of optimization!
     
  24. macrumors newbie

    Joined:
    Jun 11, 2009
    #24
    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...
     
  25. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #25
    Hey that's pretty cool :)
     

Share This Page