www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/03/08:21:38

From: steve@
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro and SB05_DJ2 problem
Date: 3 Mar 1997 11:57:10 GMT
Organization: IBM Austin
Lines: 108
Message-ID: <5feeam$1u2a@ausnews.austin.ibm.com>
References: <3319eaa3 DOT 7656395 AT ursa DOT smsu DOT edu>
Reply-To: steve_chew AT uk DOT ibm DOT com
NNTP-Posting-Host: steve.csnsg.uk.ibm.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In <3319eaa3 DOT 7656395 AT ursa DOT smsu DOT edu>, aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) writes:


Until MOD playing is added to Allegro, I am also using SB05 and Allegro together.
I have not experienced any problems - one thing to try; call sb_install_driver
before allegro_init to eliminate any potential timing problems (as suggested
by the SB docs).
Worth a try...



ing the Sound Blaster Library by Joel H. Hunter, and have run into a
>problem when using Allegro's graphics functions with it.  The MOD player built
>into the Sound Blaster Library stops at random places within the MOD or starts
>playing an extremely mangled version of the actual music.  It appears to be
>caused by something Allegro does, since it works fine if I remove all the
>Allegro calls.  I am using DJGPP 2.01, Allegro 2.2  and version 0.5 of the Sound
>Blaster Library.  If anyone has experienced this problem, please let me know. 
>Here is my offending code from a file called "credits.cc":
>
>#include <conio.h>
>#include <allegro.h>
>#include <credits.h>
>#include <data1.h>
>#include <dialogue.h>
>#include <main.h>
>#include <sb_lib.h>
>#include "keyb.h"
>
>#define NUM_CREDITS             4
>
>void RollTheCredits(void)
>  {
>  DATAFILE                    * GrabberFile;
>  BITMAP                      * Bitmaps[NUM_CREDITS];
>  BITMAP                      * WorkScreen;
>  int                           Coords[][2] = { {0,500},
>                                                {0,700},
>                                                {0,900},
>                                                {0,1100},
>                                              };
>  int                           NumVerticalPixels;
>  int                           Count;
>  int                           ScreenWidth = 640;
>  int                           ScreenHeight = 480;
>  sb_mod_file                 * Music;
>
>  allegro_init();
>  if ( (GrabberFile = load_datafile("data1.dat")) == NULL)
>    ExitWithError("Can't load credits data file");
>  Bitmaps[0] = (BITMAP *)GrabberFile[TITLE].dat;
>  Bitmaps[1] = (BITMAP *)GrabberFile[COPYRIGHT].dat;
>  Bitmaps[2] = (BITMAP *)GrabberFile[DESIGNER].dat,
>  Bitmaps[3] = (BITMAP *)GrabberFile[ALLEGRO_CREDIT].dat;
>  WorkScreen = create_bitmap(640,480);
>  set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
>  set_pallete((RGB *)GrabberFile[CREDITS_COLORS].dat);
>
>  if (sb_install_driver(8000) !=   SB_SUCCESS)
>    ExitWithError("Can't install MOD player");
>  if ( (Music = sb_load_mod_file("alienrad.mod")) == NULL)
>    ExitWithError("Can't load MOD file");
>  for (Count = 0;Count < NUM_CREDITS;Count++)
>    Coords[Count][0] = (ScreenWidth - (*Bitmaps[Count]).w) / 2;
>  sb_mod_play(Music);
>
>  while (1)
>    {
>    if (!sb_mod_active)
>      {
>      sb_uninstall_driver();
>      unload_datafile(GrabberFile);
>      destroy_bitmap(WorkScreen);
>      allegro_exit();
>      return;
>      }
>    NumVerticalPixels = 0;
>    while (Coords[NUM_CREDITS - 1][1] > -300)
>      {
>      clear(WorkScreen);
>      for (Count = 0;Count < NUM_CREDITS;Count++)
>        {
>
>blit(Bitmaps[Count],WorkScreen,0,0,Coords[Count][0],Coords[Count][1],(*Bitmaps[Count]).w,(*Bitmaps[Count]).h);
>        Coords[Count][1] -= 2;
>        }
>      NumVerticalPixels += 2;
>      blit(WorkScreen,screen,0,0,0,0,ScreenWidth,ScreenHeight);
>      if (kbhit() != 0)
>        {
>        if (getch() == ESCAPE)
>          {
>          sb_uninstall_driver();
>          unload_datafile(GrabberFile);
>          destroy_bitmap(WorkScreen);
>          allegro_exit();
>          return;
>          }
>        }
>      }
>    for (Count = 0;Count < NUM_CREDITS;Count++)
>      Coords[Count][1] += NumVerticalPixels;
>    }
>  }
>
>
>

- Raw text -


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