******************************************************************************* * ReadySystem.S Written by Readysoft. * Copyright 1992,1993,1994 RS. All rights reserved. 1993.08.23.-1994.05.18. * v20.36. ******************************************************************************* ******************************************************************************* * Includes ******************************************************************************* ;------------------------------------------------------------------------------ ; Device Sources ;------------------------------------------------------------------------------ INCDIR 'Work:System/Source/' INCLUDE 'custom.device.S' v1.0 INCLUDE 'cia.device.S' v1.24 INCLUDE 'interrupt.device.S' v1.2 INCLUDE 'memory.device.S' v1.6 INCLUDE 'copper.device.S' v1.24 INCLUDE 'keyboard.device.S' v1.24 INCLUDE 'gameport.device.S' v1.24 INCLUDE 'trackdisk.device.S' v2.0 ;------------------------------------------------------------------------------ ; Library Sources ;------------------------------------------------------------------------------ INCLUDE 'exec.library.S' v1.0 INCLUDE 'intuition.library.S' v2.0 INCLUDE 'font.library.S' v2.4 INCLUDE 'sprite.library.S' v2.0 INCLUDE 'sound.library.S' v1.2 INCLUDE 'dos.library.S' v1.0 ******************************************************************************* * Macros ******************************************************************************* ;------------------------------------------------------------------------------ ; CALL Macro ;------------------------------------------------------------------------------ CALL MACRO move.l a6,-(a7) move.l \1,a6 device | library jsr \2(a6) offset move.l (a7)+,a6 ENDM ******************************************************************************* * Constant Definitions ******************************************************************************* ;------------------------------------------------------------------------------ ; System Area ;------------------------------------------------------------------------------ SYSTEM EQU $c02000 LOADADDR EQU $80000 ;------------------------------------------------------------------------------ ; Memory Areas ;------------------------------------------------------------------------------ CHIPLOW EQU $0 CHIPHIGH EQU $80000 FASTLOW EQU $c00000 FASTHIGH EQU $c80000 ******************************************************************************* * Code ******************************************************************************* ORG SYSTEM LOAD LOADADDR ******************************************************************************* * StartUp ******************************************************************************* sys.StartUp move.l a0,sys.va.UserPrg move.l a1,sys.va.ErrorPrg lea sys.SUStack(pc),a7 use StartUp Stack lea cus_BASE,a6 move.w #$7fff,cus_INTENA(a6) move.w #$7fff,cus_DMACON(a6) bsr sys.ProcTest processor test move.w d0,sys.da.ProcType btst #0,d0 68010 ? beq.s .68000 btst #1,d0 68020 ? beq.s .68010 .68020 lea $0,a0 init 68020 registers DC.W $4e7b,$8801 movec a0,VBR moveq #0,d0 DC.W $4e7b,$0002 movec d0,CACR moveq #0,d0 DC.W $4e7b,$0802 movec d0,CAAR lea sys.UStack(pc),a0 DC.W $4e7b,$8800 movec a0,USP lea sys.IStack(pc),a0 DC.W $4e7b,$8804 movec a0,ISP lea sys.MStack(pc),a0 DC.W $4e7b,$8803 movec a0,MSP bra .InitLibs .68010 lea $0,a0 init 68010 registers DC.W $4e7b,$8801 movec a0,VBR lea sys.MStack(pc),a7 lea sys.UStack(pc),a0 move.l a0,USP bra .InitLibs .68000 lea sys.MStack(pc),a7 init 68000 registers lea sys.UStack(pc),a0 move.l a0,USP .InitLibs bsr cus.Init custom.device bsr cia.Init cia.device bsr int.Init interrupt.device bsr mem.Init memory.device bsr cop.Init copper.device bsr kbd.Init keyboard.device bsr gam.Init gameport.device bsr trd.Init trackdisk.device bsr exe.Init exec.library bsr inl.Init intuition.library bsr fnt.Init font.library bsr spr.Init sprite.library bsr snd.Init sound.library bsr dos.Init dos.library move.w #$e03c,cus_INTENA(a6) move.w #$87f0,cus_DMACON(a6) move.l sys.va.UserPrg,a0 jmp (a0) ;------------------------------------------------------------------------------ ; ProcTest NoOp --> ProcType(d0) ;------------------------------------------------------------------------------ sys.ProcTest movem.l d1/a0-a3,-(a7) move.l $10,a0 Illegal move.l $2c,a2 Not Implemented $fxxx lea .Exit(pc),a1 move.l a1,$10 move.l a1,$2c move.l a7,a1 moveq #0,d0 moveq #0,d1 DC.W $4e7b,$1801 movec d1,VBR bset #0,d0 68010 OK moveq #1,d1 DC.W $4e7b,$1002 movec d1,CACR bset #1,d0 68020 OK DC.W $f201,$b000 co-processor ? tst.l d1 bne.s .Exit bset #4,d0 .Exit move.l a1,a7 move.l a0,$10 move.l a2,$2c movem.l (a7)+,d1/a0-a3 rts ;------------------------------------------------------------------------------ ; FatalError ErrorCode(d0) ;------------------------------------------------------------------------------ sys.FatalError move.l sys.va.ErrorPrg,a0 jmp (a0) ******************************************************************************* * Devices ******************************************************************************* CUS.DEV custom.device CIA.DEV cia.device INT.DEV interrupt.device MEM.DEV memory.device COP.DEV copper.device KBD.DEV keyboard.device GAM.DEV gameport.device TRD.DEV trackdisk.device ******************************************************************************* * Libraries ******************************************************************************* EXE.LIB exec.library INL.LIB intuition.library FNT.LIB font.library SPR.LIB sprite.library SND.LIB sound.library DOS.LIB dos.library ******************************************************************************* * Varibles ******************************************************************************* sys.va.UserPrg DC.L 0 sys.va.ErrorPrg DC.L 0 ******************************************************************************* * SystemData ******************************************************************************* SystemData sys.da.ProcType DC.W 0 sys.da.VBR DC.L sys.Vectors sys.da.MSP DC.L sys.MStack sys.da.ISP DC.L sys.IStack sys.da.USP DC.L sys.UStack ******************************************************************************* * Data Area ******************************************************************************* sys.Vectors BLK.B 1024,0 BLK.B 1024,0 sys.SUStack BLK.B 1024,0 StartUp Stack sys.IStack BLK.B 1024,0 InterruptStack sys.MStack BLK.B 1024,0 Master Stack sys.UStack BLK.B 2,0 UserStack SYSTOP S EQU LOADADDR E EQU LOADADDR+SYSTOP-SYSTEM