open       =  -30
close      =  -30  -6
read       =  -30  -12
openlib    =  -30  -378
output     =  -30  -30
write      =  -30  -18
execbase   =  4
DMACON     =  $dff096
Permit     = -30 -1081
forbid     = -30 -102
closelib   = -30 -384
start:
move.l execbase,a6
lea.l gfxname,a1
jsr openlib(a6)
move.l d0,gfxbase
move.l execbase,a6
lea.l dosname,a1
jsr openlib(a6)
move.l d0,a6
move.l #filename,d1
move.l #1005,d2
jsr open(a6)
beq prg_end
move.l d0,disk
weiter:
move.l #disk_buf,d2
move.l #8,d3
;
move.l disk,d1
jsr read(a6)
;
beq.l prg_end
jsr output(a6)
move.l d0,d1
move.l #disk_buf,d2
moveq #$08,d3
jsr write(a6)
bne.l weiter
move.l disk,d1
jsr close(a6)
prg_end:
;++++++++++++++++++++++++++
; setup the new copper list (will be performed in next VBlank)
;
   move.l ExecBase,a6
   jsr  Forbid(a6)   ; stop multitasking

   move.l GfxBase,a0
   add.l #$32,a0    ; point to LOFlist in GfxBase

   move.w #$0080,DMACON  ; stop Copper DMA
   move.l (a0),OldCopper  ; pointer to old copper list
   move.l #CopList,(a0)  ; my own Coppers..
   move.w #$8080,DMACON   
was_nun:

  andi.b #64,$bfe001
  beq raus
 jmp was_nun
;********************************
raus:
;
;  reset all resources used!
;
   move.l GfxBase,a0
   add.l #$32,a0    ; point to LOFlist in GfxBase

   move.w #$0080,DMACON  ; stop Copper and Sound
   move.l OldCopper,(a0)  ; restore pointer
   move.w #$8080,DMACON  ; start again ...

   move.l ExecBase,a6
   jsr  Permit(a6)   ; restart multitasking
;
;  Ready to give system back
;
   move.l GfxBase,a1
   jsr CloseLib(a6)
ende:
   move.l initialSP,sp
   clr.l d0     ; E.T. phone home!!
   ILLEGAL
;   rts
GfxName: DC.B 'graphics.library',0
   even
;  DISPLAY COPROCCESSOR INSTRUCTION LIST
;
Coplist:
 ; #RASTER FARBEN###
  DC.W $0180,$0000  ; Hgrund Farben
  DC.W $8501,$FFFE  
  DC.W $0180,$0111
  DC.W $8701,$FFFE
  DC.W $0180,$0222
  DC.W $8901,$FFFE
  DC.W $0180,$0333  ;Hgrund Farben
  DC.W $8B01,$FFFE
  DC.W $0180,$0444
  DC.W $8D01,$FFFE
  DC.W $0180,$0666
  DC.W $8F01,$FFFE
  DC.W $0180,$0777
  DC.W $9101,$FFFE
  DC.W $0180,$0888  ;Hgrund Farben
  DC.W $9301,$FFFE
  DC.W $0180,$0999
  DC.W $9501,$FFFE
  DC.W $0180,$0AAA
  DC.W $9701,$FFFE
  DC.W $0180,$0BBB
  DC.W $9901,$FFFE
  DC.W $0180,$0CCC
  DC.W $9B01,$FFFE
  DC.W $0180,$0DDD
  DC.W $9D01,$FFFE
  DC.W $0180,$0EEE
  DC.W $9f01,$FFFE    ;hgrund colors
  DC.W $0180,$0FFF
  DC.W $A001,$FFFE
  DC.W $0180,$0000 
;.................
  DC.W $A201,$FFFE   ;Font colours
  DC.W $0182,$0d00  ;red
  DC.W $A301,$FFFE
  DC.W $0182,$0f80  ;orange
  DC.W $A401,$FFFE
  DC.W $0182,$0fb0  ;gold o
  DC.W $A501,$FFFE
  DC.W $0182,$0ff0  ;yellow
  DC.W $A601,$FFFE
  DC.W $0182,$0bf0  ;green
  DC.W $A701,$FFFE
  DC.W $0182,$00f0  ;green...Font Colours
  DC.W $A801,$FFFE
  DC.W $0182,$02c0  ;dark green
  DC.W $A901,$FFFE
  DC.W $0182,$00bb  ; blue green
  DC.W $AA01,$FFFE
  DC.W $0182,$01fb  ;aqau
  DC.W $AB01,$FFFE
  DC.W $0182,$000f  ;blue
  DC.W $B001,$FFFE  ;Font Colours
;................  
  DC.W $0180,$0FFF  ;Hgrund Colours I
  DC.W $B201,$FFFE
  DC.W $0180,$0EEE
  DC.W $B401,$FFFE
  DC.W $0180,$0DDD
  DC.W $B601,$FFFE
  DC.W $0180,$0CCC
  DC.W $B801,$FFFE
  DC.W $0180,$0BBB
  DC.W $BA01,$FFFE
  DC.W $0180,$0999
  DC.W $BC01,$FFFE
  DC.W $0180,$0888
  DC.W $BE01,$FFFE
  DC.W $0180,$0777
  DC.W $C001,$FFFE
  DC.W $0180,$0666
  DC.W $C201,$FFFE
  DC.W $0180,$0555
  DC.W $C501,$FFFE
  DC.W $0180,$0444
  DC.W $C701,$FFFE
  DC.W $0180,$0333
  DC.W $C901,$FFFE
  DC.W $0180,$0222
  DC.W $CB01,$FFFE
  DC.W $0180,$0111
  DC.W $CD01,$FFFE
  DC.W $0180,$0000
  ;---------------HIER ENDE DER GRAU TOENE !!!

  DC.W $ffff,$fffe

GfxBase: blk.l 1,0
initialSP: blk.l 1,0
OldCopper: blk.l 1,0
;...........................
align 4
dosname: dc.b "dos.library",0
align 4
filename: dc.b "atom-text",0
align 4
disk: dc.l 0
disk_buf: blk.b 10,0

