delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/20/18:32:38

From: "M. Schulter" <mschulter AT value DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Assembly
Date: 20 Nov 1997 22:52:41 GMT
Organization: Value Net Internetwork Services Inc.
Lines: 19
Message-ID: <652evp$55d$3@vnetnews.value.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971117093817 DOT 2318C-100000 AT is>
NNTP-Posting-Host: value.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

: Seems like _puts would be a better choice.  `printf' pulls in a lot of
: support code from libc which aren't needed to print a fixed string.
: (`printf' can also get you in trouble if the string includes `%'
: characters.)

Hi, there.

As a newbie GAS programmer, I agree. Generally I use '_puts' for simple
text messages, saving '_printf' for things where I don't want a newline
after the string, or where I need formatted output (for example. to
display a numerical result).

Most appreciatively,

Margo Schulter
mschulter AT value DOT net

>

int main(void]
{
    MIDI *the_midi = load_midi("mission.mid");

    if (!the_midi)
    {
        printf("Midi file did not load. Check if it exists.\n");
        return 1;
    }
    allegro_init();
    install_sound(DIGI_NONE, MIDI_AUTODETECT, NULL);
    install_timer();
    install_keyboard(); // for the heck of it

    play_midi(the_midi, 1);
    read_key(); // pauses utill you hit a key
    stop_midi();
    destroy_midi(the_midi);
    allegro_exit();
    return 0;
}

Your program 1) loads the midi twice, once unncessairly, and


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019