Appendix ( bootsector code to initialize hardware ) ; Multi Atari Boot code. ; If you have done an ST demo, use that boot to run it on these machines: ; ; ST, STe, Mega-ST,TT,Falcon,CT60 ; ; More info: ; http://leonard.oxg.free.fr/articles/multi_atari/multi_atari.html start sf $1fe.w move.l $5a0.w,d0 beq noCookie move.l d0,a0 .loop: move.l (a0)+,d0 beq noCookie cmp.l #'_MCH',d0 beq.s .find cmp.l #'CT60',d0 bne.s .skip ; CT60, switch off the cache pea (a0) lea bCT60(pc),a0 st (a0) clr.w -(a7) ; param = 0 ( switch off all caches ) move.w #5,-(a7) ; opcode move.w #160,-(a7) trap #14 addq.w #6,a7 move.l (a7)+,a0 .skip: addq.w #4,a0 bra.s .loop .find: move.w (a0)+,d7 beq noCookie ; STF move.b d7,$1fe.w cmpi.w #1,d7 bne.s .noSTE btst.b #4,1(a0) beq.s .noMegaSTE clr.b $ffff8e21.w ; 8Mhz MegaSTE .noMegaSTE: bra noCookie .noSTE: ; here TT or FALCON ; Always switch off the cache on these machines. move.b bCT60(pc),d0 bne.s .noMovec moveq #0,d0 dc.l $4e7b0002 ; movec d0,cacr ; switch off cache .noMovec: cmpi.w #3,d7 bne.s noCookie ; Here FALCON move.w #$59,-(a7) ;check monitortype (falcon) trap #14 addq.l #2,a7 lea rgb50(pc),a0 subq.w #1,d0 beq.s .setRegs subq.w #2,d0 beq.s .setRegs lea vga50(pc),a0 .setRegs: move.l (a0)+,$ffff8282.w move.l (a0)+,$ffff8286.w move.l (a0)+,$ffff828a.w move.l (a0)+,$ffff82a2.w move.l (a0)+,$ffff82a6.w move.l (a0)+,$ffff82aa.w move.w (a0)+,$ffff820a.w move.w (a0)+,$ffff82c0.w move.w (a0)+,$ffff8266.w clr.b $ffff8260.w move.w (a0)+,$ffff82c2.w move.w (a0)+,$ffff8210.w noCookie: ; Set res for all machines exept falcon or ct60 cmpi.b #3,$1fe.w beq letsGo clr.w -(a7) ;set stlow (st/tt) moveq #-1,d0 move.l d0,-(a7) move.l d0,-(a7) move.w #5,-(a7) trap #14 lea 12(a7),a7 cmpi.b #2,$1fe.w ; enough in case of TT beq.s letsGo move.w $468.w,d0 .vsync: cmp.w $468.w,d0 beq.s .vsync move.b #2,$ffff820a.w clr.b $ffff8260.w ;--------------------------------------------------------------------- letsGo: ; load your kernel, or whatever you want here ! ;--------------------------------------------------------------------- vga50: dc.l $170011 dc.l $2020E dc.l $D0012 dc.l $4EB04D1 dc.l $3F00F5 dc.l $41504E7 dc.w $0200 dc.w $186 dc.w $0 dc.w $5 dc.w $50 rgb50: dc.l $300027 dc.l $70229 dc.l $1e002a dc.l $2710265 dc.l $2f0081 dc.l $211026b dc.w $0200 dc.w $185 dc.w $0 dc.w $0 dc.w $50 bCT60: dc.b 0 even