Professional Web Applications Themes

Vectors, interrupts, traps, asynchronous calls and whatnot - Mac Programming

Alright. Now comes a part that I've always pushed back whenever I came close to it - I started to tackle it to understand the wacky raster techniques of old C64 programming a few years back. Now, on the mac, the word trap (which was new to me) comes up fairly often, and it seems the term is interchangeable with the default functions of the ROM - although the term 'trap' probably refers to the way they're dealt with at a low level. I'd really like some debunking and differentiation of these terms. Although I will state my main goal ...

  1. #1

    Default Vectors, interrupts, traps, asynchronous calls and whatnot

    Alright. Now comes a part that I've always pushed back whenever I came
    close to it - I started to tackle it to understand the wacky raster
    techniques of old C64 programming a few years back. Now, on the mac,
    the word trap (which was new to me) comes up fairly often, and it
    seems the term is interchangeable with the default functions of the
    ROM - although the term 'trap' probably refers to the way they're
    dealt with at a low level.

    I'd really like some debunking and differentiation of these terms.

    Although I will state my main goal in this - it is for game
    programming. I believe that to play a continuous melody in the
    background of a game, you simply cannot implement nusic and sound
    effects in a basic procedural way, on top of the control detection,
    AI, collision, graphics handling without being brilliantly organized -
    I realize I'm better off simply defining an interrupt to it. I'd like
    to know how it works. The only other time I encountered it was for a
    MS-DOS C game library called Allegro; much of the work was done for
    you, you didn't have to touch any assembler yourself.

    I also realize that for my target setting, complex music with fast,
    fluid animations are probably not possible on the Mac Plus/SE since
    the sound chip takes a lot of CPU power in the first place, but that's
    not what I was trying to get at. I'd be content for simple animations,
    really. I can simply think of many examples of games where it's
    implemented and slow (like some Sierra games: Gold Rush, King's Quest
    III, Manhunter, etc). Although Dark Castle proves that small sound
    effects and arcade-like controls are very possible.
    Mu0n Guest

  2. #2

    Default Re: Vectors, interrupts, traps, asynchronous calls and whatnot

    In article <google.com>,
    ca (Mu0n) wrote:
     

    The 68K had a 2-byte instruction that was a software interrupt, known
    as a "trap". Windows and Unix (OS X) programs call the operating system
    by loading libraries at run time, which means you have to have both
    the .h file and the stub library for every system call. If you look
    at a Mac header file like Quickdraw.h, you'll see that a system call
    like LineTo is defined as:

    void LineTo(short h, short v) ONEWORDINLINE(0xA891);

    The ONEWORDINLINE is a macro that expands, on a 68K generating C
    compiler to: just plunk 0xA891 into the compiler output. It is a
    68K instruction that the Mac OS will implement as the actual LineTo
    subroutine.


    Very handy, since you don't have to worry about proprietary object code
    formats for intermediate files, and there are no stub libraries to get
    out of sync with the header files and the O.S.
     

    The original Mac O.S. doesn't have a sound chip like the C64 did.
    Instead it has a 8-bit D to A converter chip. (A big improvement over
    the Apple ]['s 1-bit D to A) You just hand the O.S. a buffer of samples
    and it play it.

    The applicaiton "Studio Session" use to play 4-channel sound while doing
    substantial animation on those vintage machines. You can still download
    it and play with it for free at:
    <http://www.madcapps.com/bogas_productions.htm>
    David Guest

  3. #3

    Default Re: Vectors, interrupts, traps, asynchronous calls and whatnot

    David Phillip Oster <org> wrote in message news:<sf.sbcglobal.net>... 

    Yeah, I have the original Studio Session, and found out about that new
    version some months ago. I think it's great what they've done to it.
    The old version could play 6 instruments (by careful planning of their
    limited 4-channel sound?) while the new version goes up to 8.

    I just rechecked the website, and it doesn't seem like they provide
    any information on their music file format. I know that it could be
    possible to integrate them in a game, there is a b&w version of Tetris
    that *DID* use some - it even had to have some of the instrument
    files.
    Mu0n Guest

  4. #4

    Default Re: Vectors, interrupts, traps, asynchronous calls and whatnot

    In article <google.com>,
    ca (Mu0n) wrote:
     
    >
    > Yeah, I have the original Studio Session, and found out about that new
    > version some months ago. I think it's great what they've done to it.
    > The old version could play 6 instruments (by careful planning of their
    > limited 4-channel sound?) while the new version goes up to 8.
    >
    > I just rechecked the website, and it doesn't seem like they provide
    > any information on their music file format. I know that it could be
    > possible to integrate them in a game, there is a b&w version of Tetris
    > that *DID* use some - it even had to have some of the instrument
    > files.[/ref]

    Back in the day, the would give you specs on their file format (I've
    mislaid my copy.) As I remember, it was a similar idea to MOD files:
    references to sampled instrument files, and midi-like lists of notes for
    them to play.
    David Guest

Similar Threads

  1. Asynchronous calls from Java?
    By bobbrose in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: February 28th, 04:55 AM
  2. Asynchronous web service calls
    By Russell Mason in forum ASP.NET Web Services
    Replies: 3
    Last Post: August 5th, 03:09 PM
  3. Asynchronous web service calls, will you still have timeouts
    By Norton in forum ASP.NET Web Services
    Replies: 1
    Last Post: August 3rd, 06:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139