                  >PART 'INIT'
* created 24.09.95
* (c) Bastian Schick
*
* setup OP,GPU,DSP,CPU to a defined state
* OP = STOP (at $0)
* DSP,GPU : big-endian,stopped,IRQs disabled
* dummy irq
* inits SP to $1000
* stops PIT and JPIT1 & 2
* 68k-SR set to $2000
* CPU-IRQs disabled
* blitter stoped
* CPU registers are cleared (for debug purposes)
;-----------------
;--    INIT     --
INIT:             move    #$2700,sr
                  lea     $00001000.w,sp
                  lea     $00F00000,a0
                  move.l  #$00070007,d0    ; big endian
                  move.l  d0,$210C(a0)
                  move.l  d0,$00F1A10C
                  moveq   #0,d0
                  move.l  d0,$2114(a0)     ; stop gpu
                  move.l  d0,$00F1A114     ; stop dsp
                  move.l  d0,$2100(a0)     ; disable GPU-IRQs
; disable DSP-IRQs
                  move.l  #%00000000000000010001111100000000,$00F1A100
                  move.l  #%0000000000111111<<8,$00F10020 ; clear and disable IRQs

                  move.l  d0,0.w
                  moveq   #4,d0
                  move.l  d0,4.w
                  moveq   #0,d0
                  move.l  d0,$0020(a0)     ; set OP to STOP-OBJECT
                  move.w  d0,$0026(a0)     ; clear OP-Flag
                  move.l  d0,$002A(a0)     ; border black
                  move.w  d0,$0056(a0)     ; set CRY mode to color/not BW
                  move.w  d0,$0058(a0)     ; background black
                  move.l  d0,$0050(a0)     ; stop PIT
                  move.l  d0,$00F10000     ; stop JPIT1
                  move.l  d0,$00F10004     ; stop JPIT2
                  move.l  d0,$2238(a0)     ; stop blitter
                  move.l  #$1F00<<16,$00E0(a0) ; clear pending irqs
                  lea     dummy_irq(pc),a0
                  move.l  a0,$00000100.w
                  bra.s   INIT1
dummy_irq:        clr.w   $00F000E2
                  rte
INIT1:            moveq   #0,d0
                  moveq   #0,d1
                  moveq   #0,d2
                  moveq   #0,d3
                  moveq   #0,d4
                  moveq   #0,d5
                  moveq   #0,d6
                  moveq   #0,d7
                  movea.l d0,a0
                  movea.l d0,a1
                  movea.l d0,a2
                  movea.l d0,a3
                  movea.l d0,a4
                  movea.l d0,a5
                  movea.l d0,a6
                  move    a0,usp
;-----------------
                  ENDPART
