Exemplo n.º 1
0
/*
 * This Funktion handles all startup code, needed for vectrex to work
 * correctly, recallibrating the beam and making sure that some sound
 * is played (if wanted).
 */
static inline void start_one_vectrex_round(void)
{
  set_dp_c8();                        /* vectrex internal... dp must point */
  recalculate_music(current_song);    /* to c800, could make a function which */
  wait_recal();                       /* sets this up allright... */
  do_sound();
}
Exemplo n.º 2
0
void mainloop(const bool &Exit)
{
   unsigned char skipped = 0;
   for (;!Exit;)
   {
      if (skipped < temp.frameskip)
      {
          skipped++;
          temp.vidblock = 1;
      }
      else
          skipped = temp.vidblock = 0;

      if (!temp.vidblock)
          flip();

      for (unsigned f = rsm.needframes[rsm.frame]; f; f--)
      {
         temp.sndblock = !conf.sound.enabled;
         temp.inputblock = temp.vidblock && conf.sound.enabled;
         spectrum_frame();
         VideoSaver();

         // message handling before flip (they paint to rbuf)
         if (!temp.inputblock)
         {
             dispatch(conf.atm.xt_kbd ? ac_main_xt : ac_main);
         }
         if (!temp.sndblock)
         {
             do_sound();
             Vs1001.Play();
         }
         if (rsm.mix_frames > 1)
         {
            memcpy(rbuf_s + rsm.rbuf_dst * rb2_offs, rbuf, temp.scx * temp.scy / 4);
            if (++rsm.rbuf_dst == rsm.mix_frames)
                rsm.rbuf_dst = 0;
         }
         if (!temp.sndblock)
         {
/*
             if(conf.sound.do_sound == do_sound_none)
                 do_idle();
*/
         }
      }

      if (++rsm.frame == rsm.period)
          rsm.frame = 0;

   }
   correct_exit();
}