/**********************************************************************/
/*                                                                    */
/*                 J. HIPPEL REPLAY ROUTINE FOR AZTEC-C               */
/*                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              */
/* Some infos about the replay-routine:                               */
/*   - This Routine uses a level-6 interrupt.                         */
/*   - Enter the Module lenght at the end of the Routine (at the      */
/*     marked position!)                                              */
/*                                                                    */
/* Here are the instructions for this Replay-Routine.                 */
/*                                                                    */
/* Compile this Programm with the following options:                  */
/*     CC +D +C hippelreplay.c                                        */
/*                                                                    */
/* And then link it with the following options:                       */
/*     LN +Cdb hippelreplay.o -lcl                                    */
/*                                                                    */
/* After linking the programm load the C-monitor and load the         */
/* executable programm to address $40000. Then load the Hippel-       */
/* module to address $400ca. Then you must save the programm to disk. */
/*                                                                    */
/* F.X. in the C-Monitor:                                             */
/*                                                                    */
/* .L hippelreplay 40000                                              */
/* Load $040000-$04d4dc                                               */
/* .L HIPPEL.snd 400ca                                                */
/* Load $0400ca-$04c9f8                                               */
/* .S hippelreplay 40000 4d4dc                                        */
/* Save $040000-$04d4dc                                               */
/*                                                                    */
/* After that you must use SCATom to change the hunks. All hunks must */
/* be loaded into CHIP-MEM, otherwise you hear only shit!             */
/*                                                                    */
/* I hope you undestand these instructiuons. If you use this replay-  */
/* Routine in your programms then put it at the top of your Source-   */
/* Code (After the include-files). Then you can load the SidmonV1.0   */
/* Module to the same address.                                        */
/* For more infos write to:                                           */
/*          REFLEX ­ PLK 370527 F ­ 4600 DORTMUND 1 ­ GERMANY         */
/*                                                                    */
/*                                                 BLADERUNNER/REFLEX */
/**********************************************************************/
#include "exec/memory.h"
#include "exec/exec.h"
#include "functions.h"

char *LeftMouse = (char *)0xbfe001;   /* CIA - Addresse fuer Mausabfrage */

#asm
; ==================================
; =    Little J.Hippel Replayer    =
; = Typed in by BLADERUNNER/REFLEX =
; ==================================

   public _start,_stop

_start:
   moveq #01,d0
   jsr sound

   move.l  #14500,d0

   move.b   #$0,$bfde00
   move.b   d0,$bfd400
   lsr.w   #8,d0
   move.b   d0,$bfd500
   move.b   #$81,$bfdd00
   move.b   #$11,$bfde00
   move.l   $78,lev6save
   move.l   #lev6interrupt,$78
   rts

_stop:
   moveq #00,d0
   jsr sound     
   move.b   #$1,$bfdd00      ;** restore timer & dma
   move.l   lev6save,$78
   move.w   #$0,$dff0a8
   move.w   #$0,$dff0b8
   move.w   #$0,$dff0c8
   move.w   #$0,$dff0d8
   move.w   #$f,$dff096
   rts

lev6interrupt:
   movem.l   d0/d1,-(sp)      ;** jump
   bsr  sound+$02             
   move.b   $bfdd00,d0
   move.w   #$2000,$dff09c
   movem.l   (sp)+,d0/d1
   rte

   dseg

lev6save:          dc.l   0

   cseg

sound:           ds.b   51502,0            ; Enter here the Module Lenght!

#endasm

extern start(),stop();




main()
{

  start();  /* Start the Sound! */

  while ((*LeftMouse & 0x40) == 0x40);    /* Main Loop */
  
  stop();  /* Stop the Sound! */
}
