
                                        startup.s            Page 1       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


    1                                   ;; ROM Dump
    2                                   ;; This code is really, really dumb, since it expects to run
    3                                   ;; from the skunkboard startup. It won't even init hardware
    4                                   ;; or set up the OPL, since that's all technically done.
    5                                   ;; All it's going to do is use the utilities to dump
    6                                   ;; memory from $800000-$802000. 
    7                                   
    8                                   	.include "jaguar.inc"
    1                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2                                   ;
    3                                   ;       JAGUAR.INC  Hardware Equates for JAGUAR System
    4                                   ;
    5                                   ;       COPYRIGHT 1992-1994 Atari Computer Corporation
    6                                   ;       UNAUTHORIZED REPRODUCTION, ADAPTATION, DISTRIBUTION,
    7                                   ;       PERFORMANCE OR DISPLAY OF THIS COMPUTER PROGRAM OR
    8                                   ;       THE ASSOCIATED AUDIOVISUAL WORK IS STRICTLY PROHIBITED.
    9                                   ;       ALL RIGHTS RESERVED.
   10                                   ;
   11                                   ;      Last Modified: 9/19/94 - SDS
   12                                   ;
   13                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   14                                   
   15                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   16                                   ;      GENERIC DEFINES
   17                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   18                                   
   19           =00000000               DRAM            EQU     $000000 ; First system RAM location
   20           =00004000               USERRAM         EQU     $004000 ; Beginning of non-reserved RAM
   21           =00200000               ENDRAM          EQU     $200000 ; End of DRAM
   22           =001FFFFC               INITSTACK       EQU     ENDRAM-4        ; Good place to initialize stack
   23                                   
   24                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   25                                   ;      CPU REGISTERS
   26                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   27                                   
   28           =00000100               LEVEL0          EQU     $100            ; 68000 Level 0 Autovector Interrupt
   29           =00000100               USER0           EQU     $100            ; Pseudonym for LEVEL0
   30                                   
   31                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   32                                   ; Masks for INT1 CPU Interrupt Control Register
   33                                   
   34           =00000001               C_VIDENA        EQU     $0001           ; Enable Video time-base interrupts
   35           =00000002               C_GPUENA        EQU     $0002           ; Enable GPU register-write interrupt
   36           =00000004               C_OPENA         EQU     $0004           ; Enable OP stop-object interrupt
   37           =00000008               C_PITENA        EQU     $0008           ; Enable PIT interrupt
   38           =00000010               C_JERENA        EQU     $0010           ; Enable Jerry interrupt
   39                                   
   40           =00000100               C_VIDCLR        EQU     $0100           ; Clear pending video interrupts
   41           =00000200               C_GPUCLR        EQU     $0200           ; Clear pending GPU interrupts
   42           =00000400               C_OPCLR         EQU     $0400           ; Clear pending OP interrupts
   43           =00000800               C_PITCLR        EQU     $0800           ; Clear pending PIT interrupts
   44           =00001000               C_JERCLR        EQU     $1000           ; Clear pending Jerry interrupts
   45                                   
   46                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   47                                   ;       JAGUAR REGISTERS
   48                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


                                        jaguar.inc           Page 2       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


   49                                   
   50           =00F00000               BASE            EQU     $F00000 ; TOM Internal Register Base
   51                                   
   52                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   53                                   ;       TOM REGISTERS
   54                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   55                                   
   56           =00F00004               HC              EQU     BASE + 4        ; Horizontal Count
   57           =00F00006               VC              EQU     BASE + 6        ; Vertical Count
   58           =00F00008               LPH             EQU     BASE + 8        ; Horizontal Lightpen
   59           =00F0000A               LPV             EQU     BASE + $0A      ; Vertical Lightpen
   60           =00F00010               OB0             EQU     BASE + $10      ; Current Object Phrase
   61           =00F00012               OB1             EQU     BASE + $12
   62           =00F00014               OB2             EQU     BASE + $14
   63           =00F00016               OB3             EQU     BASE + $16
   64           =00F00020               OLP             EQU     BASE + $20      ; Object List Pointer
   65           =00F00026               OBF             EQU     BASE + $26      ; Object Processor Flag
   66           =00F00028               VMODE           EQU     BASE + $28      ; Video Mode
   67           =00F0002A               BORD1           EQU     BASE + $2A      ; Border Color (Red & Green)
   68           =00F0002C               BORD2           EQU     BASE + $2C      ; Border Color (Blue)
   69           =00F00038               HDB1            EQU     BASE + $38      ; Horizontal Display Begin One
   70           =00F0003A               HDB2            EQU     BASE + $3A      ; Horizontal Display Begin Two
   71           =00F0003C               HDE             EQU     BASE + $3C      ; Horizontal Display End
   72           =00F00044               VS              EQU     BASE + $44      ; Vertical Sync
   73           =00F00046               VDB             EQU     BASE + $46      ; Vertical Display Begin
   74           =00F00048               VDE             EQU     BASE + $48      ; Vertical Display End
   75           =00F0004E               VI              EQU     BASE + $4E      ; Vertical Interrupt
   76           =00F00050               PIT0            EQU     BASE + $50      ; Programmable Interrupt Timer (Lo)
   77           =00F00052               PIT1            EQU     BASE + $52      ; Programmable Interrupt Timer (Hi)
   78           =00F00058               BG              EQU     BASE + $58      ; Background Color
   79                                   
   80           =00F000E0               INT1            EQU     BASE + $E0      ; CPU Interrupt Control Register
   81           =00F000E2               INT2            EQU     BASE + $E2      ; CPU Interrupt Resume Register
   82                                   
   83           =00F00400               CLUT            EQU     BASE + $400     ; Color Lookup Table
   84                                   
   85           =00F00800               LBUFA           EQU     BASE + $800     ; Line Buffer A
   86           =00F01000               LBUFB           EQU     BASE + $1000    ; Line Buffer B
   87           =00F01800               LBUFC           EQU     BASE + $1800    ; Line Buffer Current
   88                                   
   89                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   90                                   ;      OBJECT PROCESSOR EQUATES
   91                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   92                                   
   93           =00000000               BITOBJ          EQU     0
   94           =00000001               SCBITOBJ        EQU     1
   95           =00000002               GPUOBJ          EQU     2
   96           =00000003               BRANCHOBJ       EQU     3
   97           =00000004               STOPOBJ         EQU     4
   98                                   
   99           =00002000               O_REFLECT       EQU     $00002000       ; OR with top LONG of BITMAP object
  100           =00004000               O_RMW           EQU     $00004000
  101           =00008000               O_TRANS         EQU     $00008000
  102           =00010000               O_RELEASE       EQU     $00010000
  103                                   
  104           =00000000               O_DEPTH1        EQU     (0<<12) ; DEPTH Field for BITMAP objects


                                        jaguar.inc           Page 3       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  105           =00001000               O_DEPTH2        EQU     (1<<12)
  106           =00002000               O_DEPTH4        EQU     (2<<12)
  107           =00003000               O_DEPTH8        EQU     (3<<12)
  108           =00004000               O_DEPTH16       EQU     (4<<12)
  109           =00005000               O_DEPTH32       EQU     (5<<12)
  110                                   
  111           =00008000               O_NOGAP         EQU     (1<<15) ; Phrase GAP between image phrases
  112           =00010000               O_1GAP          EQU     (2<<15)
  113           =00018000               O_2GAP          EQU     (3<<15)
  114           =00020000               O_3GAP          EQU     (4<<15)
  115           =00028000               O_4GAP          EQU     (5<<15)
  116           =00030000               O_5GAP          EQU     (6<<15)
  117           =00038000               O_6GAP          EQU     (7<<15)
  118                                   
  119           =00000000               O_BREQ          EQU     (0<<14) ; CC field of BRANCH objects
  120           =00004000               O_BRGT          EQU     (1<<14)
  121           =00008000               O_BRLT          EQU     (2<<14)
  122           =0000C000               O_BROP          EQU     (3<<14)
  123           =00010000               O_BRHALF        EQU     (4<<14)
  124                                   
  125           =00000008               O_STOPINTS      EQU     $00000008       ; Enable Interrupts in STOP object
  126                                   
  127                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  128                                   ;      VIDEO INITIALIZATION CONSTANTS
  129                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130                                   
  131           =00000581               NTSC_WIDTH      EQU     1409            ; Width of screen in pixel clocks
  132           =00000337               NTSC_HMID       EQU     823             ; Middle of screen in pixel clocks
  133           =000000F1               NTSC_HEIGHT     EQU     241             ; Height of screen in scanlines
  134           =0000010A               NTSC_VMID       EQU     266             ; Middle of screen in halflines
  135                                   
  136           =00000565               PAL_WIDTH       EQU     1381            ; Same as above for PAL...
  137           =0000034B               PAL_HMID        EQU     843
  138           =0000011F               PAL_HEIGHT      EQU     287
  139           =00000142               PAL_VMID        EQU     322
  140                                   
  141                                   ;;; The following mask will extract the PAL/NTSC flag bit from the
  142                                   ;;; CONFIG register. NTSC = Bit Set, PAL = Bit Clear
  143                                   
  144           =00000010               VIDTYPE         EQU     $10
  145                                   
  146                                   ;;; The following are Video Mode register flags
  147                                   
  148           =00000001               VIDEN           EQU     $0001           ; Enable video-time base generator
  149                                   
  150           =00000000               CRY16           EQU     $0000           ; Enable 16-bit CRY mode
  151           =00000002               RGB24           EQU     $0002           ; Enable 24-bit RGB mode
  152           =00000004               DIRECT16        EQU     $0004           ; Enable 16-bit DIRECT mode
  153           =00000006               RGB16           EQU     $0006           ; Enable 16-bit RGB mode
  154                                   
  155           =00000008               GENLOCK         EQU     $0008           ; Not Supported in Jaguar Console
  156           =00000010               INCEN           EQU     $0010           ; Enable encrustation
  157           =00000020               BINC            EQU     $0020           ; Select local border color
  158           =00000040               CSYNC           EQU     $0040           ; Enable composite sync
  159           =00000080               BGEN            EQU     $0080           ; Clear line buffer to BG
  160           =00000100               VARMOD          EQU     $0100           ; Enable variable-color resolution mode


                                        jaguar.inc           Page 4       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  161                                   
  162           =00000000               PWIDTH1         EQU     $0000           ; Select pixels 1 clock wide
  163           =00000200               PWIDTH2         EQU     $0200           ; Select pixels 2 clocks wide
  164           =00000400               PWIDTH3         EQU     $0400           ; Select pixels 3 clocks wide
  165           =00000600               PWIDTH4         EQU     $0600           ; Select pixels 4 clocks wide
  166           =00000800               PWIDTH5         EQU     $0800           ; Select pixels 5 clocks wide
  167           =00000A00               PWIDTH6         EQU     $0A00           ; Select pixels 6 clocks wide
  168           =00000C00               PWIDTH7         EQU     $0C00           ; Select pixels 7 clocks wide
  169           =00000E00               PWIDTH8         EQU     $0E00           ; Select pixels 8 clocks wide
  170                                   
  171                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  172                                   ;       GPU REGISTERS
  173                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  174                                   
  175           =00F02100               G_FLAGS         EQU     BASE + $2100    ; GPU Flags
  176           =00F02104               G_MTXC          EQU     BASE + $2104    ; GPU Matrix Control
  177           =00F02108               G_MTXA          EQU     BASE + $2108    ; GPU Matrix Address
  178           =00F0210C               G_END           EQU     BASE + $210C    ; GPU Data Organization
  179           =00F02110               G_PC            EQU     BASE + $2110    ; GPU Program Counter
  180           =00F02114               G_CTRL          EQU     BASE + $2114    ; GPU Operation Control/Status
  181           =00F02118               G_HIDATA        EQU     BASE + $2118    ; GPU Bus Interface high data
  182           =00F0211C               G_REMAIN        EQU     BASE + $211C    ; GPU Division Remainder
  183           =00F0211C               G_DIVCTRL       EQU     BASE + $211C    ; GPU Divider control
  184           =00F03000               G_RAM           EQU     BASE + $3000    ; GPU Internal RAM
  185           =00F04000               G_ENDRAM        EQU     G_RAM +(4*1024) ; 4K bytes
  186                                   
  187                                   ;;;
  188                                   ;;; GPU Flags Register Equates
  189                                   ;;;
  190                                   
  191           =00000010               G_CPUENA        EQU     $00000010       ; CPU Interrupt enable bits
  192           =00000020               G_DSPENA        EQU     $00000020       ; DSP Interrupt enable bits
  193           =00000040               G_PITENA        EQU     $00000040       ; PIT Interrupt enable bits
  194           =00000080               G_OPENA         EQU     $00000080       ; Object Processor Interrupt enable bits
  195           =00000100               G_BLITENA       EQU     $00000100       ; Blitter Interrupt enable bits
  196           =00000200               G_CPUCLR        EQU     $00000200       ; CPU Interrupt clear bits
  197           =00000400               G_DSPCLR        EQU     $00000400       ; DSP Interrupt clear bits
  198           =00000800               G_PITCLR        EQU     $00000800       ; PIT Interrupt clear bits
  199           =00001000               G_OPCLR         EQU     $00001000       ; Object Processor Interrupt clear bits
  200           =00002000               G_BLITCLR       EQU     $00002000       ; Blitter Interrupt clear bits
  201                                   
  202                                   ;;;
  203                                   ;;; GPU Control/Status Register
  204                                   ;;;
  205                                   
  206           =00000001               GPUGO           EQU     $00000001       ; Start and Stop the GPU
  207           =00000004               GPUINT0         EQU     $00000004       ; generate a GPU type 0 interrupt
  208                                   
  209           =00000040               G_CPULAT        EQU     $00000040       ; Interrupt Latches
  210           =00000080               G_DSPLAT        EQU     $00000080
  211           =00000100               G_PITLAT        EQU     $00000100
  212           =00000200               G_OPLAT         EQU     $00000200
  213           =00000400               G_BLITLAT       EQU     $00000400
  214                                   
  215                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  216                                   ;       BLITTER REGISTERS


                                        jaguar.inc           Page 5       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  217                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  218                                   
  219           =00F02200               A1_BASE         EQU     BASE + $2200    ; A1 Base Address
  220           =00F02204               A1_FLAGS        EQU     BASE + $2204    ; A1 Control Flags
  221           =00F02208               A1_CLIP         EQU     BASE + $2208    ; A1 Clipping Size
  222           =00F0220C               A1_PIXEL        EQU     BASE + $220C    ; A1 Pixel Pointer
  223           =00F02210               A1_STEP         EQU     BASE + $2210    ; A1 Step (Integer Part)
  224           =00F02214               A1_FSTEP        EQU     BASE + $2214    ; A1 Step (Fractional Part)
  225           =00F02218               A1_FPIXEL       EQU     BASE + $2218    ; A1 Pixel Pointer (Fractional)
  226           =00F0221C               A1_INC          EQU     BASE + $221C    ; A1 Increment (Integer Part)
  227           =00F02220               A1_FINC         EQU     BASE + $2220    ; A1 Increment (Fractional Part)
  228           =00F02224               A2_BASE         EQU     BASE + $2224    ; A2 Base Address
  229           =00F02228               A2_FLAGS        EQU     BASE + $2228    ; A2 Control Flags
  230           =00F0222C               A2_MASK         EQU     BASE + $222C    ; A2 Address Mask
  231           =00F02230               A2_PIXEL        EQU     BASE + $2230    ; A2 PIXEL
  232           =00F02234               A2_STEP         EQU     BASE + $2234    ; A2 Step (Integer)
  233                                   
  234           =00F02238               B_CMD           EQU     BASE + $2238    ; Command
  235           =00F0223C               B_COUNT         EQU     BASE + $223C    ; Counters
  236           =00F02240               B_SRCD          EQU     BASE + $2240    ; Source Data
  237           =00F02248               B_DSTD          EQU     BASE + $2248    ; Destination Data
  238           =00F02250               B_DSTZ          EQU     BASE + $2250    ; Destination Z
  239           =00F02258               B_SRCZ1         EQU     BASE + $2258    ; Source Z (Integer)
  240           =00F02260               B_SRCZ2         EQU     BASE + $2260    ; Source Z (Fractional)
  241           =00F02268               B_PATD          EQU     BASE + $2268    ; Pattern Data
  242           =00F02270               B_IINC          EQU     BASE + $2270    ; Intensity Increment
  243           =00F02274               B_ZINC          EQU     BASE + $2274    ; Z Increment
  244           =00F02278               B_STOP          EQU     BASE + $2278    ; Collision stop control
  245                                   
  246           =00F0227C               B_I3            EQU     BASE + $227C    ; Blitter Intensity 3
  247           =00F02280               B_I2            EQU     BASE + $2280    ; Blitter Intensity 2
  248           =00F02284               B_I1            EQU     BASE + $2284    ; Blitter Intensity 1
  249           =00F02288               B_I0            EQU     BASE + $2288    ; Blitter Intensity 0
  250                                   
  251           =00F0228C               B_Z3            EQU     BASE + $228C    ; Blitter Z 3
  252           =00F02290               B_Z2            EQU     BASE + $2290    ; Blitter Z 2
  253           =00F02294               B_Z1            EQU     BASE + $2294    ; Blitter Z 1
  254           =00F02298               B_Z0            EQU     BASE + $2298    ; Blitter Z 0
  255                                   
  256                                   ;;;
  257                                   ;;; BLITTER Command Register equates
  258                                   ;;;
  259                                   
  260           =00000001               SRCEN           EQU     $00000001       ; d00:     source data read (inner loop)
  261           =00000002               SRCENZ          EQU     $00000002       ; d01:     source Z read (inner loop)
  262           =00000004               SRCENX          EQU     $00000004       ; d02:     source data read (realign)
  263           =00000008               DSTEN           EQU     $00000008       ; d03:     dest data read (inner loop)
  264           =00000010               DSTENZ          EQU     $00000010       ; d04:     dest Z read (inner loop)
  265           =00000020               DSTWRZ          EQU     $00000020       ; d05:     dest Z write (inner loop)
  266           =00000040               CLIP_A1         EQU     $00000040       ; d06:     A1 clipping enable
  267           =00000100               UPDA1F          EQU     $00000100       ; d08:     A1 update step fraction
  268           =00000200               UPDA1           EQU     $00000200       ; d09:     A1 update step
  269           =00000400               UPDA2           EQU     $00000400       ; d10:     A2 update step
  270           =00000800               DSTA2           EQU     $00000800       ; d11:     reverse usage of A1 and A2
  271           =00001000               GOURD           EQU     $00001000       ; d12:     enable Gouraud shading
  272           =00002000               ZBUFF           EQU     $00002000       ; d13:     polygon Z data updates


                                        jaguar.inc           Page 6       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  273           =00004000               TOPBEN          EQU     $00004000       ; d14:     intensity carry into byte
  274           =00008000               TOPNEN          EQU     $00008000       ; d15:     intensity carry into nibble
  275           =00010000               PATDSEL         EQU     $00010000       ; d16:     Select pattern data
  276           =00020000               ADDDSEL         EQU     $00020000       ; d17:     diagnostic
  277                                                                           ; d18-d20: Z comparator inhibit
  278           =00040000               ZMODELT         EQU     $00040000       ;            source < destination
  279           =00080000               ZMODEEQ         EQU     $00080000       ;            source = destination
  280           =00100000               ZMODEGT         EQU     $00100000       ;            source > destination
  281                                                                           ; d21-d24: Logic function control
  282           =00200000               LFU_NAN         EQU     $00200000       ;            !source & !destination
  283           =00400000               LFU_NA          EQU     $00400000       ;            !source &  destination
  284           =00800000               LFU_AN          EQU     $00800000       ;             source & !destination
  285           =01000000               LFU_A           EQU     $01000000       ;             source &  destination
  286                                   
  287           =02000000               CMPDST          EQU     $02000000       ; d25:     pixel compare pattern & dest
  288           =04000000               BCOMPEN         EQU     $04000000       ; d26:     bit compare write inhibit
  289           =08000000               DCOMPEN         EQU     $08000000       ; d27:     data compare write inhibit
  290           =10000000               BKGWREN         EQU     $10000000       ; d28:     data write back
  291           =20000000               BUSHI           EQU     $20000000       ; d29      blitter priority
  292           =40000000               SRCSHADE        EQU     $40000000       ; d30:     shade src data w/IINC value
  293                                   
  294                                   ;;;
  295                                   ;;; The following are ALL 16 possible logical operations of the LFUs
  296                                   ;;;
  297                                   
  298           =00000000               LFU_ZERO        EQU     $00000000       ; All Zeros
  299           =00200000               LFU_NSAND       EQU     $00200000       ; NOT Source AND NOT Destination
  300           =00400000               LFU_NSAD        EQU     $00400000       ; NOT Source AND Destination
  301           =00600000               LFU_NOTS        EQU     $00600000       ; NOT Source
  302           =00800000               LFU_SAND        EQU     $00800000       ; Source AND NOT Destination
  303           =00A00000               LFU_NOTD        EQU     $00A00000       ; NOT Destination
  304           =00C00000               LFU_N_SXORD     EQU     $00C00000       ; NOT (Source XOR Destination)
  305           =00E00000               LFU_NSORND      EQU     $00E00000       ; NOT Source OR NOT Destination
  306           =01000000               LFU_SAD         EQU     $01000000       ; Source AND Destination
  307           =01200000               LFU_SXORD       EQU     $01200000       ; Source XOR Destination
  308           =01400000               LFU_D           EQU     $01400000       ; Destination
  309           =01600000               LFU_NSORD       EQU     $01600000       ; NOT Source OR Destination
  310           =01800000               LFU_S           EQU     $01800000       ; Source
  311           =01A00000               LFU_SORND       EQU     $01A00000       ; Source OR NOT Destination
  312           =01C00000               LFU_SORD        EQU     $01C00000       ; Source OR Destination
  313           =01E00000               LFU_ONE         EQU     $01E00000       ; All Ones
  314                                   
  315                                   ; These are some common combinations with less boolean names
  316                                   
  317           =01800000               LFU_REPLACE     EQU     $01800000       ; Source REPLACEs destination
  318           =01200000               LFU_XOR         EQU     $01200000       ; Source XOR with destination
  319           =00000000               LFU_CLEAR       EQU     $00000000       ; CLEAR destination
  320                                   
  321                                   ;;;
  322                                   ;;; BLITTER Flags (A1 or A2) register equates
  323                                   ;;;
  324                                   
  325                                   ; Pitch d00-d01:
  326                                   ;       distance between pixel phrases
  327           =00000000               PITCH1          EQU     $00000000       ; 0 phrase gap
  328           =00000001               PITCH2          EQU     $00000001       ; 1 phrase gap


                                        jaguar.inc           Page 7       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  329           =00000002               PITCH4          EQU     $00000002       ; 3 phrase gap
  330           =00000003               PITCH3          EQU     $00000003       ; 2 phrase gap
  331                                   
  332                                   ; Pixel d03-d05
  333                                   ;       bit depth (2^n)
  334           =00000000               PIXEL1          EQU     $00000000       ; n = 0
  335           =00000008               PIXEL2          EQU     $00000008       ; n = 1
  336           =00000010               PIXEL4          EQU     $00000010       ; n = 2
  337           =00000018               PIXEL8          EQU     $00000018       ; n = 3
  338           =00000020               PIXEL16         EQU     $00000020       ; n = 4
  339           =00000028               PIXEL32         EQU     $00000028       ; n = 5
  340                                   
  341                                   ; Z offset d06-d08
  342                                   ;       offset from phrase of pixel data from its corresponding
  343                                   ;       Z data phrases
  344           =00000000               ZOFFS0          EQU     $00000000       ; offset = 0    UNUSED
  345           =00000040               ZOFFS1          EQU     $00000040       ; offset = 1
  346           =00000080               ZOFFS2          EQU     $00000080       ; offset = 2
  347           =000000C0               ZOFFS3          EQU     $000000C0       ; offset = 3
  348           =00000100               ZOFFS4          EQU     $00000100       ; offset = 4
  349           =00000140               ZOFFS5          EQU     $00000140       ; offset = 5
  350           =00000180               ZOFFS6          EQU     $00000180       ; offset = 6
  351           =000001C0               ZOFFS7          EQU     $000001C0       ; offset = 7    UNUSED
  352                                   
  353                                   ; Width d09-d14
  354                                   ;       width used for address generation
  355                                   ;       This is a 6-bit floating point value in pixels
  356                                   ;       4-bit unsigned exponent
  357                                   ;       2-bit mantissa with implied 3rd bit of 1
  358           =00000800               WID2            EQU     $00000800       ; 1.00 X 2^1  ( 4<<9)
  359           =00001000               WID4            EQU     $00001000       ; 1.00 X 2^2  ( 8<<9)
  360           =00001400               WID6            EQU     $00001400       ; 1.10 X 2^2  (10<<9)
  361           =00001800               WID8            EQU     $00001800       ; 1.00 x 2^3  (12<<9)
  362           =00001A00               WID10           EQU     $00001A00       ; 1.01 X 2^3  (13<<9)
  363           =00001C00               WID12           EQU     $00001C00       ; 1.10 X 2^3  (14<<9)
  364           =00001E00               WID14           EQU     $00001E00       ; 1.11 X 2^3  (15<<9)
  365           =00002000               WID16           EQU     $00002000       ; 1.00 X 2^4  (16<<9)
  366           =00002200               WID20           EQU     $00002200       ; 1.01 X 2^4  (17<<9)
  367           =00002400               WID24           EQU     $00002400       ; 1.10 X 2^4  (18<<9)
  368           =00002600               WID28           EQU     $00002600       ; 1.11 X 2^4  (19<<9)
  369           =00002800               WID32           EQU     $00002800       ; 1.00 X 2^5  (20<<9)
  370           =00002A00               WID40           EQU     $00002A00       ; 1.01 X 2^5  (21<<9)
  371           =00002C00               WID48           EQU     $00002C00       ; 1.10 X 2^5  (22<<9)
  372           =00002E00               WID56           EQU     $00002E00       ; 1.11 X 2^5  (23<<9)
  373           =00003000               WID64           EQU     $00003000       ; 1.00 X 2^6  (24<<9)
  374           =00003200               WID80           EQU     $00003200       ; 1.01 X 2^6  (25<<9)
  375           =00003400               WID96           EQU     $00003400       ; 1.10 X 2^6  (26<<9)
  376           =00003600               WID112          EQU     $00003600       ; 1.11 X 2^6  (27<<9)
  377           =00003800               WID128          EQU     $00003800       ; 1.00 X 2^7  (28<<9)
  378           =00003A00               WID160          EQU     $00003A00       ; 1.01 X 2^7  (29<<9)
  379           =00003C00               WID192          EQU     $00003C00       ; 1.10 X 2^7  (30<<9)
  380           =00003E00               WID224          EQU     $00003E00       ; 1.11 X 2^7  (31<<9)
  381           =00004000               WID256          EQU     $00004000       ; 1.00 X 2^8  (32<<9)
  382           =00004200               WID320          EQU     $00004200       ; 1.01 X 2^8  (33<<9)
  383           =00004400               WID384          EQU     $00004400       ; 1.10 X 2^8  (34<<9)
  384           =00004600               WID448          EQU     $00004600       ; 1.11 X 2^8  (35<<9)


                                        jaguar.inc           Page 8       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  385           =00004800               WID512          EQU     $00004800       ; 1.00 X 2^9  (36<<9)
  386           =00004A00               WID640          EQU     $00004A00       ; 1.01 X 2^9  (37<<9)
  387           =00004C00               WID768          EQU     $00004C00       ; 1.10 X 2^9  (38<<9)
  388           =00004E00               WID896          EQU     $00004E00       ; 1.11 X 2^9  (39<<9)
  389           =00005000               WID1024         EQU     $00005000       ; 1.00 X 2^10 (40<<9)
  390           =00005200               WID1280         EQU     $00005200       ; 1.01 X 2^10 (41<<9)
  391           =00005400               WID1536         EQU     $00005400       ; 1.10 X 2^10 (42<<9)
  392           =00005600               WID1792         EQU     $00005600       ; 1.11 X 2^10 (43<<9)
  393           =00005800               WID2048         EQU     $00005800       ; 1.00 X 2^11 (44<<9)
  394           =00005A00               WID2560         EQU     $00005A00       ; 1.01 X 2^11 (45<<9)
  395           =00005C00               WID3072         EQU     $00005C00       ; 1.10 X 2^11 (46<<9)
  396           =00005E00               WID3584         EQU     $00005E00       ; 1.11 X 2^11 (47<<9)
  397                                   
  398                                   ; X add control d16-d17
  399                                   ;       controls the update of the X pointer on each pass
  400                                   ;       round the inner loop
  401           =00000000               XADDPHR         EQU     $00000000       ; 00 - add phrase width and truncate
  402           =00010000               XADDPIX         EQU     $00010000       ; 01 - add pixel size (add 1)
  403           =00020000               XADD0           EQU     $00020000       ; 10 - add zero
  404           =00030000               XADDINC         EQU     $00030000       ; 11 - add the increment
  405                                   
  406                                   ; Y add control d18
  407                                   ;       controls the update of the Y pointer within the inner loop.
  408                                   ;       it is overridden by the X add control if they are in add increment
  409           =00000000               YADD0           EQU     $00000000       ; 00 - add zero
  410           =00040000               YADD1           EQU     $00040000       ; 01 - add 1
  411                                   
  412                                   ; X sign d19
  413                                   ;       add or subtract pixel size if X add control = 01 (XADDPIX)
  414           =00000000               XSIGNADD        EQU     $00000000       ; 0 - add pixel size
  415           =00080000               XSIGNSUB        EQU     $00080000       ; 1 - subtract pixel size
  416                                   
  417                                   ; Y sign d20
  418                                   ;       add or subtract pixel size if Y add control = 01 (YADD1)
  419           =00000000               YSIGNADD        EQU     $00000000       ; 0 - add 1
  420           =00100000               YSIGNSUB        EQU     $00100000       ; 1 - sub 1
  421                                   
  422                                   
  423                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  424                                   ;       JERRY REGISTERS
  425                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  426                                   
  427           =00F10000               JPIT1           EQU     BASE + $10000   ; Timer 1 Pre-Scaler
  428           =00F10002               JPIT2           EQU     BASE + $10002   ; Timer 1 Divider
  429           =00F10004               JPIT3           EQU     BASE + $10004   ; Timer 2 Pre-Scaler
  430           =00F10006               JPIT4           EQU     BASE + $10006   ; Timer 2 Divider
  431                                   
  432           =00F10020               J_INT          EQU     BASE + $10020   ; Jerry Interrupt control (to TOM)
  433                                   
  434           =00F14000               JOYSTICK       EQU     BASE + $14000   ; Joystick register and mute
  435           =00F14002               JOYBUTS         EQU     BASE + $14002   ; Joystick register
  436           =00F14002               CONFIG          EQU     BASE + $14002   ; Also has NTSC/PAL
  437                                   
  438           =00F1A118               MOD_MASK        EQU     BASE + $1A118   ; Mask for ADDQ(SUBQ)MOD
  439                                   
  440           =00F1A140               DAC1			EQU		BASE + $1A140	; Left DAC


                                        jaguar.inc           Page 9       0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  441           =00F1A144               DAC2			EQU		BASE + $1A144	; Right DAC
  442                                   
  443           =00F1A150               SCLK            EQU     BASE + $1A150   ; SSI Clock Frequency
  444           =00F1A154               SMODE           EQU     BASE + $1A154   ; SSI Control
  445                                   
  446           =00F1A148               L_I2S           EQU     BASE + $1A148   ; I2S Serial Interface
  447           =00F1A14C               R_I2S           EQU     BASE + $1A14C   ; I2S Serial Interface
  448                                   
  449                                   ; These are equivalents used in the manual
  450           =00F1A150               SSTAT			EQU		BASE + $1A150	; Serial status word
  451           =00F1A148               LTXD			EQU		BASE + $1A148
  452           =00F1A148               LRXD			EQU		BASE + $1A148
  453           =00F1A14C               RTXD			EQU		BASE + $1A14C
  454           =00F1A14C               RRXD			EQU		BASE + $1A14C
  455                                   
  456                                   ; ASYNC/ComLynx
  457                                   
  458           =00F10034               ASICLK			EQU		BASE + $10034	; Async clock
  459           =00F10032               ASICTRL			EQU		BASE + $10032	; Async control (WO)
  460           =00F10032               ASISTAT			EQU		BASE + $10032	; Async status (RO)
  461           =00F10030               ASIDATA			EQU		BASE + $10030	; Async data (RW)
  462                                   
  463           =0000000D               U_SERIN			EQU		13
  464                                   
  465           =00000040               U_MCLRERR		EQU		$0040
  466           =00000020               U_MRINTEN		EQU		$0020
  467           =00000001               U_MODD			EQU		$0001
  468                                   
  469                                   ;;;
  470                                   ;;; Jerry Interrupt Control Flags
  471                                   ;;;
  472                                   
  473           =00000001               J_EXTENA        EQU     $0001           ; Enable external interrupts
  474           =00000002               J_DSPENA        EQU     $0002           ; Enable DSP interrupts
  475           =00000004               J_TIM1ENA       EQU     $0004           ; Enable Timer 1 interrupts
  476           =00000008               J_TIM2ENA       EQU     $0008           ; Enable Timer 2 interrupts
  477           =00000010               J_ASYNENA       EQU     $0010           ; Enable Asyncronous Serial interrupts
  478           =00000020               J_SYNENA        EQU     $0020           ; Enable Syncronous Serial interrupts
  479                                   
  480           =00000100               J_EXTCLR        EQU     $0100           ; Clear pending external interrupts
  481           =00000200               J_DSPCLR        EQU     $0200           ; Clear pending DSP interrupts
  482           =00000400               J_TIM1CLR       EQU     $0400           ; Clear pending Timer 1 interrupts
  483           =00000800               J_TIM2CLR       EQU     $0800           ; Clear pending Timer 2 interrupts
  484           =00001000               J_ASYNCLR       EQU     $1000           ; Clear pending Asynch. Serial interrupts
  485           =00002000               J_SYNCLR        EQU     $2000           ; Clear pending Synch. Serial interrupts
  486                                   
  487                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  488                                   ;     JERRY Joystick Equates
  489                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  490                                   
  491                                   ; Bits when LONGword is formatted as below (from JOYTEST\JT_LOOP.S).
  492                                   ;
  493                                   ; Format: xxApxxBx RLDU147* xxCxxxox 2580369#
  494                                   
  495           =00000014               JOY_UP          EQU     20              ;joypad
  496           =00000015               JOY_DOWN        EQU     21


                                        jaguar.inc           Page 10      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  497           =00000016               JOY_LEFT        EQU     22
  498           =00000017               JOY_RIGHT       EQU     23
  499                                   
  500           =0000001D               FIRE_A          EQU     29              ;fire buttons
  501           =00000019               FIRE_B          EQU     25
  502           =0000000D               FIRE_C          EQU     13
  503           =00000009               OPTION          EQU     9
  504           =0000001C               PAUSE           EQU     28
  505                                   
  506           =00000010               KEY_STAR        EQU     16              ;keypad
  507           =00000011               KEY_7           EQU     17
  508           =00000012               KEY_4           EQU     18
  509           =00000013               KEY_1           EQU     19
  510                                   
  511           =00000004               KEY_0           EQU     4
  512           =00000005               KEY_8           EQU     5
  513           =00000006               KEY_5           EQU     6
  514           =00000007               KEY_2           EQU     7
  515                                   
  516           =00000000               KEY_HASH        EQU     0
  517           =00000001               KEY_9           EQU     1
  518           =00000002               KEY_6           EQU     2
  519           =00000003               KEY_3           EQU     3
  520                                   
  521           =00F00000               ANY_JOY         EQU     $00F00000       ; AND joyedge with this...
  522                                                                           ; joypad was pressed if result is not 0
  523           =32002200               ANY_FIRE        EQU     $32002200       ; AND joyedge with this...
  524                                                                           ; A,B C, Option or Pause was pressed
  525                                                                           ; if result is not 0
  526           =000F00FF               ANY_KEY         EQU     $000F00FF       ; AND joyedge with this... 123456789*0#
  527                                                                           ; was pressed if result is not 0
  528                                   
  529                                   ;;;
  530                                   ;;;     ROM Tables built into Jerry - 128 samples each
  531                                   ;;;     16 bit samples sign extended to 32
  532                                   ;;;
  533                                   
  534           =00F1D000               ROM_TABLE       EQU     BASE + $1D000   ; Base of tables
  535                                   
  536           =00F1D000               ROM_TRI         EQU     BASE + $1D000   ; A triangle wave
  537           =00F1D200               ROM_SINE        EQU     BASE + $1D200   ; Full amplitude SINE
  538           =00F1D400               ROM_AMSINE      EQU     BASE + $1D400   ; Linear (?) ramp SINE
  539           =00F1D600               ROM_12W         EQU     BASE + $1D600   ; SINE(X)+SINE(2*X) : (was ROM_SINE12W)
  540           =00F1D800               ROM_CHIRP16     EQU     BASE + $1D800   ; SHORT SWEEP
  541           =00F1DA00               ROM_NTRI        EQU     BASE + $1DA00   ; Triangle w/NOISE
  542           =00F1DC00               ROM_DELTA       EQU     BASE + $1DC00   ; Positive spike
  543           =00F1DE00               ROM_NOISE       EQU     BASE + $1DE00   ; Guess
  544                                   
  545                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  546                                   ;       JERRY Registers (DSP)
  547                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  548                                   
  549           =00F1A100               D_FLAGS         EQU     BASE + $1A100   ; DSP Flags
  550           =00F1A104               D_MTXC          EQU     BASE + $1A104   ; DSP Matrix Control
  551           =00F1A108               D_MTXA          EQU     BASE + $1A108   ; DSP Matrix Address
  552           =00F1A10C               D_END           EQU     BASE + $1A10C   ; DSP Data Organization


                                        jaguar.inc           Page 11      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  553           =00F1A110               D_PC            EQU     BASE + $1A110   ; DSP Program Counter
  554           =00F1A114               D_CTRL          EQU     BASE + $1A114   ; DSP Operation Control/Status
  555           =00F1A118               D_MOD          EQU     BASE + $1A118   ; DSP Modulo Instruction Mask
  556           =00F1A11C               D_REMAIN        EQU     BASE + $1A11C   ; DSP Division Remainder
  557           =00F1A11C               D_DIVCTRL       EQU     BASE + $1A11C   ; DSP Divider control
  558           =00F1A120               D_MACHI        EQU     BASE + $1A120   ; DSP Hi byte of MAC operations
  559           =00F1B000               D_RAM           EQU     BASE + $1B000   ; DSP Internal RAM
  560           =00F1D000               D_ENDRAM        EQU     D_RAM +(8*1024) ; 8K bytes
  561                                   
  562                                   ;;;
  563                                   ;;; JERRY Flag Register Equates
  564                                   ;;;
  565                                   
  566           =00000010               D_CPUENA        EQU     $00000010       ; CPU Interrupt Enable Bit
  567           =00000020               D_I2SENA        EQU     $00000020       ; I2S Interrupt Enable Bit
  568           =00000040               D_TIM1ENA       EQU     $00000040       ; Timer 1 Interrupt Enable Bit
  569           =00000080               D_TIM2ENA       EQU     $00000080       ; Timer 2 Interrupt Enable Bit
  570           =00000100               D_EXT0ENA       EQU     $00000100       ; External Interrupt 0 Enable Bit
  571           =00010000               D_EXT1ENA       EQU     $00010000       ; External Interrupt 1 Enable Bit
  572                                   
  573           =00000200               D_CPUCLR        EQU     $00000200       ; CPU Interrupt Clear Bit
  574           =00000400               D_I2SCLR        EQU     $00000400       ; I2S Interrupt Clear Bit
  575           =00000800               D_TIM1CLR       EQU     $00000800       ; Timer 1 Interrupt Clear Bit
  576           =00001000               D_TIM2CLR       EQU     $00001000       ; Timer 2 Interrupt Clear Bit
  577           =00002000               D_EXT0CLR       EQU     $00002000       ; External Interrupt 0 Clear Bit
  578           =00020000               D_EXT1CLR       EQU     $00020000       ; External Interrupt 1 Clear Bit
  579                                   
  580                                   ;;;
  581                                   ;;; JERRY Control/Status Register
  582                                   ;;;
  583                                   
  584           =00000001               DSPGO           EQU     $00000001       ; Start DSP
  585           =00000004               DSPINT0         EQU     $00000004       ; Generate a DSP Interrupt 0
  586                                   
  587           =00000040               D_CPULAT        EQU     $00000040       ; Interrupt Latches
  588           =00000080               D_I2SLAT        EQU     $00000080
  589           =00000100               D_TIM1LAT       EQU     $00000100
  590           =00000200               D_TIM2LAT       EQU     $00000200
  591           =00000400               D_EXT1LAT       EQU     $00000400
  592           =00010000               D_EXT2LAT       EQU     $00010000
  593                                   
  594                                   ;;;
  595                                   ;;; JERRY Modulo Instruction Masks
  596                                   ;;;
  597                                   
  598           =FFFFFFFE               MODMASK2        EQU     $FFFFFFFE       ; 2 byte circular buffer
  599           =FFFFFFFC               MODMASK4        EQU     $FFFFFFFC       ; 4 byte circular buffer
  600           =FFFFFFF8               MODMASK8        EQU     $FFFFFFF8       ; 8 byte circular buffer
  601           =FFFFFFF0               MODMASK16       EQU     $FFFFFFF0       ; 16 byte circular buffer
  602           =FFFFFFE0               MODMASK32       EQU     $FFFFFFE0       ; 32 byte circular buffer
  603           =FFFFFFC0               MODMASK64       EQU     $FFFFFFC0       ; 64 byte circular buffer
  604           =FFFFFF80               MODMASK128      EQU     $FFFFFF80       ; 128 byte circular buffer
  605           =FFFFFF00               MODMASK256      EQU     $FFFFFF00       ; 256 byte circular buffer
  606           =FFFFFE00               MODMASK512      EQU     $FFFFFE00       ; 512 byte circular buffer
  607           =FFFFFC00               MODMASK1K       EQU     $FFFFFC00       ; 1k circular buffer
  608           =FFFFF800               MODMASK2K       EQU     $FFFFF800       ; 2k circular buffer


                                        jaguar.inc           Page 12      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  609           =FFFFF000               MODMASK4K       EQU     $FFFFF000       ; 4k circular buffer
  610           =FFFFE000               MODMASK8K       EQU     $FFFFE000       ; 8k circular buffer
  611           =FFFFC000               MODMASK16K      EQU     $FFFFC000       ; 16k circular buffer
  612           =FFFF8000               MODMASK32K      EQU     $FFFF8000       ; 32k circular buffer
  613           =FFFF0000               MODMASK64K      EQU     $FFFF0000       ; 64k circular buffer
  614           =FFFE0000               MODMASK128K     EQU     $FFFE0000       ; 128k circular buffer
  615           =FFFC0000               MODMASK256K     EQU     $FFFC0000       ; 256k circular buffer
  616           =FFF80000               MODMASK512K     EQU     $FFF80000       ; 512k circular buffer
  617           =FFF00000               MODMASK1M       EQU     $FFF00000       ; 1M circular buffer
  618                                   
  619                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  620                                   ;;; SHARED Equates for TOM (GPU) and JERRY (DSP)
  621                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  622                                   
  623                                   ;;;
  624                                   ;;; Control/Status Registers
  625                                   ;;;
  626                                   
  627           =00000001               RISCGO          EQU     $00000001       ; Start GPU or DSP
  628           =00000002               CPUINT          EQU     $00000002       ; Allow the GPU/DSP to interrupt CPU
  629           =00000004               FORCEINT0       EQU     $00000004       ; Cause an INT 0 on GPU or DSP
  630           =00000008               SINGLE_STEP     EQU     $00000008       ; Enter SINGLE_STEP mode
  631           =00000010               SINGLE_GO       EQU     $00000010       ; Execute one instruction
  632                                   
  633           =00004000               REGPAGE         EQU     $00004000       ; Register Bank Select
  634           =00008000               DMAEN           EQU     $00008000       ; Enable DMA LOAD and STORE
  635                                   
  636                                   ;;;
  637                                   ;;; Flags Register
  638                                   ;;;
  639                                   
  640           =00000001               ZERO_FLAG       EQU     $00000001       ; ALU Zero Flag
  641           =00000002               CARRY_FLAG      EQU     $00000002       ; ALU Carry Flag
  642           =00000004               NEGA_FLAG       EQU     $00000004       ; ALU Negative Flag
  643                                   
  644           =00000008               IMASK           EQU     $00000008       ; Interrupt Service Mask
  645                                   
  646                                   ;;;
  647                                   ;;; Matrix Control Register
  648                                   ;;;
  649                                   
  650           =00000003               MATRIX3         EQU     $00000003       ; use for 3x1 Matrix
  651           =00000004               MATRIX4         EQU     $00000004       ; etc...
  652           =00000005               MATRIX5         EQU     $00000005
  653           =00000006               MATRIX6         EQU     $00000006
  654           =00000007               MATRIX7         EQU     $00000007
  655           =00000008               MATRIX8         EQU     $00000008
  656           =00000009               MATRIX9         EQU     $00000009
  657           =0000000A               MATRIX10        EQU     $0000000A
  658           =0000000B               MATRIX11        EQU     $0000000B
  659           =0000000C               MATRIX12        EQU     $0000000C
  660           =0000000D               MATRIX13        EQU     $0000000D
  661           =0000000E               MATRIX14        EQU     $0000000E
  662           =0000000F               MATRIX15        EQU     $0000000F
  663                                   
  664           =00000000               MATROW          EQU     $00000000       ; Access Matrix by Row


                                        jaguar.inc           Page 13      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  665           =00000010               MATCOL          EQU     $00000010       ; Access Matrix by Column
  666                                   
  667                                   ;;;
  668                                   ;;; Data Organisation Register
  669                                   ;;;
  670                                   
  671           =00010001               BIG_IO          EQU     $00010001       ; Use 32-bit registers as big-endian
  672           =00020002               BIG_PIX         EQU     $00020002       ; Pixel organisation is big-endian
  673           =00040004               BIG_INST        EQU     $00040004       ; Word program fetches are big-endian
  674                                   
  675                                   ;;;
  676                                   ;;; Divide Unit Control
  677                                   ;;;
  678                                   
  679           =00000001               DIV_OFFSET      EQU     $00000001       ; Divide 16.16 values if set
  680                                   
  681                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  682                                   ;;; The following EQU's will be removed from JAGUAR.INC in the next release
  683                                   ;;; or two. For the most part, they are being removed because they are only
  684                                   ;;; useful in Jaguar programming methods we do not recommend.
  685                                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  686                                   
  687           =00000001               COMPAT          EQU     1
  688                                   
  689                                                   IF      COMPAT
  690                                   ;;;
  691                                   ;;; These registers should never be messed with so these EQUs will
  692                                   ;;; be purged in the next revision of JAGUAR.INC. Please don't use them.
  693                                   ;;;
  694                                   
  695           =00F00000               MEMCON1         EQU     BASE + 0        ; Memory Configuration Register One
  696           =00F00002               MEMCON2         EQU     BASE + 2        ; Memory Configuration Register Two
  697           =00F00020               OLPLO           EQU     BASE + $20
  698           =00F00022               OLPHI           EQU     BASE + $22
  699           =00F00024               ODP             EQU     BASE + $24      ; Object Data Pointer
  700           =00F0002E               HP              EQU     BASE + $2e      ; Horizontal Period
  701           =00F00030               HBB             EQU     BASE + $30      ; Horizontal Blanking Begin
  702           =00F00032               HBE             EQU     BASE + $32      ; Horizontal Blanking End
  703           =00F00034               HS              EQU     BASE + $34      ; Horizontal Sync
  704           =00F00036               HVS             EQU     BASE + $36      ; Horizontal Vertical Sync
  705           =00F0003E               VP              EQU     BASE + $3e      ; Vertical Period
  706           =00F00040               VBB             EQU     BASE + $40      ; Vertical Blanking Begin
  707           =00F00042               VBE             EQU     BASE + $42      ; Vertical Blanking End
  708           =00F0004A               VEB             EQU     BASE + $4a      ; Vertical EQUalization Begin
  709           =00F0004C               VEE             EQU     BASE + $4c      ; Vertical EQUalization End
  710           =00F00054               HEQ             EQU     BASE + $54      ; Horizontal EQUalization End
  711           =00F00056               TEST1           EQU     BASE + $56      ; Undocumented Register - DO NOT USE
  712                                   
  713                                   ;;; These don't exist on the Jaguar Console so they are going away.
  714                                   ;R_DAC           EQU     BASE + $1A148   ; These are not connected in Jaguar
  715                                   ;L_DAC           EQU     BASE + $1A14C   ; so DO NOT USE!!!
  716                                   
  717                                                   ENDIF
  718                                   
  719                                   ;;;;;;;;;
  720                                   ;; EOF ;;


                                        startup.s            Page 14      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


  721                                   ;;;;;;;;;
    9                                   
   10                                   	.extern skunkRESET
   11                                   	.extern skunkNOP
   12                                   	.extern skunkCONSOLEWRITE
   13                                   	.extern skunkCONSOLECLOSE
   14                                   	.extern skunkCONSOLEREAD
   15                                   	.extern skunkFILEOPEN
   16                                   	.extern skunkFILEWRITE
   17                                   	.extern skunkFILEREAD
   18                                   	.extern skunkFILECLOSE
   19                                   	
   20           =00008FC0               col	.equ $8FC0
   21                                   
   22                                   ; start here 
   23  00000000  33FC8FC000F00058       	move.w	#col,BG
   24  00000008  2C3C000001C0           	move.l	#$01c0,	d6			; color index used during erase
   25                                   
   26                                   	; set bank 2
   27                                   ;	move.w	#$4BA1, $c00000		; now from bank 1
   28                                   	
   29  0000000E  4EB9xxxxxxxx           	jsr	skunkRESET
   30  00000014  207C00000000           	move.l	#filename,a0
   31  0000001A  7000                   	moveq	#0,d0
   32  0000001C  4EB900000000           	jsr skunkFILEOPEN
   33                                   
   34                                   ;	move.l	#$800000,a1
   35                                   ;	move.l	#3,d1		; write 4, 2048 byte blocks for 8K
   36                                   
   37  00000022  227C00020000           	move.l #$20000,a1	; dump RAM
   38  00000028  223C000001FF           	move.l  #511,d1		; 1MB
   39                                   
   40                                   .wrlp:
   41  0000002E  33C600F00058           	move.w	d6, BG
   42  00000034  3C3900F00006           	move.w	VC,d6
   43  0000003A  EF46                   	asl.w	#7,d6
   44  0000003C  004600C0               	ori.w	#$c0,d6
   45                                   	
   46                                   	; copy from ROM to RAM - can't properly access ROM (cart or bios) while HPI is in write mode
   47  00000040  203C000001FF           	move.l	#511,d0		; 2048 bytes / 4 (dwords) - 1 (dbra)
   48  00000046  207C00000000           	move.l	#rombuf,a0
   49                                   
   50                                   	; clear back to normal
   51  0000004C  33FC8FC000F00058       	move.w	#col,BG
   52                                   .cplp:
   53  00000054  20D9                   	move.l	(a1)+,(a0)+
   54  00000056  51C8FFFC               	dbra	d0,.cplp
   55                                   	
   56                                   	; set again (skunkFILEWRITE sets it back)
   57  0000005A  33C600F00058           	move.w	d6,BG
   58                                   	
   59                                   	; dump RAM buffer to PC
   60  00000060  207C00000000           	move.l	#rombuf,a0
   61  00000066  203C00000800           	move.l	#2048,d0
   62  0000006C  61000000               	bsr	skunkFILEWRITE
   63                                   	


                                        startup.s            Page 15      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)


   64                                   	; loop till done
   65  00000070  51C9FFBC               	dbra d1,.wrlp
   66                                   	
   67                                   	; copy complete, close the file 
   68  00000074  61000000               	bsr skunkFILECLOSE
   69                                   	
   70                                   	; now close the console, which will exit JCP and make us reset
   71  00000078  61000000               	bsr skunkCONSOLECLOSE
   72                                   	
   73                                   	; flag done onscreen
   74  0000007C  33FC000000F00058       	move.w	#$0000,BG
   75                                   forevr:
   76  00000084  4E71                   	nop
   77  00000086  4EF900000084           	jmp forevr	
   78                                   
   79                                   	.long
   80                                   filename:
   81  0000008C  62696F732E62696E00     	.dc.b	'bios.bin',0
   82                                   
   83                                   	
   84  00000095                         	.bss
   85                                   	.long
   86  00000000 =00001000               rombuf:	.ds.b	4096
   87                                   	
   88                                   	.end


                                                             Page 16      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)
Symbol Table

             .cplp 00000054  t             B_ZINC 00F02274  a           D_REMAIN 00F1A11C  a               INT1 00F000E0  a 
             .wrlp 0000002E  t         CARRY_FLAG 00000002  a          D_TIM1CLR 00000800  a               INT2 00F000E2  a 
           A1_BASE 00F02200  a            CLIP_A1 00000040  a          D_TIM1ENA 00000040  a            JOYBUTS 00F14002  a 
           A1_CLIP 00F02208  a               CLUT 00F00400  a          D_TIM1LAT 00000100  a           JOYSTICK 00F14000  a 
           A1_FINC 00F02220  a             CMPDST 02000000  a          D_TIM2CLR 00001000  a           JOY_DOWN 00000015  a 
          A1_FLAGS 00F02204  a             COMPAT 00000001  a          D_TIM2ENA 00000080  a           JOY_LEFT 00000016  a 
         A1_FPIXEL 00F02218  a             CONFIG 00F14002  a          D_TIM2LAT 00000200  a          JOY_RIGHT 00000017  a 
          A1_FSTEP 00F02214  a             CPUINT 00000002  a             ENDRAM 00200000  a             JOY_UP 00000014  a 
            A1_INC 00F0221C  a              CRY16 00000000  a             FIRE_A 0000001D  a              JPIT1 00F10000  a 
          A1_PIXEL 00F0220C  a              CSYNC 00000040  a             FIRE_B 00000019  a              JPIT2 00F10002  a 
           A1_STEP 00F02210  a           C_GPUCLR 00000200  a             FIRE_C 0000000D  a              JPIT3 00F10004  a 
           A2_BASE 00F02224  a           C_GPUENA 00000002  a          FORCEINT0 00000004  a              JPIT4 00F10006  a 
          A2_FLAGS 00F02228  a           C_JERCLR 00001000  a            GENLOCK 00000008  a          J_ASYNCLR 00001000  a 
           A2_MASK 00F0222C  a           C_JERENA 00000010  a              GOURD 00001000  a          J_ASYNENA 00000010  a 
          A2_PIXEL 00F02230  a            C_OPCLR 00000400  a              GPUGO 00000001  a           J_DSPCLR 00000200  a 
           A2_STEP 00F02234  a            C_OPENA 00000004  a            GPUINT0 00000004  a           J_DSPENA 00000002  a 
           ADDDSEL 00020000  a           C_PITCLR 00000800  a             GPUOBJ 00000002  a           J_EXTCLR 00000100  a 
          ANY_FIRE 32002200  a           C_PITENA 00000008  a          G_BLITCLR 00002000  a           J_EXTENA 00000001  a 
           ANY_JOY 00F00000  a           C_VIDCLR 00000100  a          G_BLITENA 00000100  a              J_INT 00F10020  a 
           ANY_KEY 000F00FF  a           C_VIDENA 00000001  a          G_BLITLAT 00000400  a           J_SYNCLR 00002000  a 
            ASICLK 00F10034  a               DAC1 00F1A140  a           G_CPUCLR 00000200  a           J_SYNENA 00000020  a 
           ASICTRL 00F10032  a               DAC2 00F1A144  a           G_CPUENA 00000010  a          J_TIM1CLR 00000400  a 
           ASIDATA 00F10030  a            DCOMPEN 08000000  a           G_CPULAT 00000040  a          J_TIM1ENA 00000004  a 
           ASISTAT 00F10032  a           DIRECT16 00000004  a             G_CTRL 00F02114  a          J_TIM2CLR 00000800  a 
              BASE 00F00000  a         DIV_OFFSET 00000001  a          G_DIVCTRL 00F0211C  a          J_TIM2ENA 00000008  a 
           BCOMPEN 04000000  a              DMAEN 00008000  a           G_DSPCLR 00000400  a              KEY_0 00000004  a 
                BG 00F00058  a               DRAM 00000000  a           G_DSPENA 00000020  a              KEY_1 00000013  a 
              BGEN 00000080  a              DSPGO 00000001  a           G_DSPLAT 00000080  a              KEY_2 00000007  a 
          BIG_INST 00040004  a            DSPINT0 00000004  a              G_END 00F0210C  a              KEY_3 00000003  a 
            BIG_IO 00010001  a              DSTA2 00000800  a           G_ENDRAM 00F04000  a              KEY_4 00000012  a 
           BIG_PIX 00020002  a              DSTEN 00000008  a            G_FLAGS 00F02100  a              KEY_5 00000006  a 
              BINC 00000020  a             DSTENZ 00000010  a           G_HIDATA 00F02118  a              KEY_6 00000002  a 
            BITOBJ 00000000  a             DSTWRZ 00000020  a             G_MTXA 00F02108  a              KEY_7 00000011  a 
           BKGWREN 10000000  a           D_CPUCLR 00000200  a             G_MTXC 00F02104  a              KEY_8 00000005  a 
             BORD1 00F0002A  a           D_CPUENA 00000010  a            G_OPCLR 00001000  a              KEY_9 00000001  a 
             BORD2 00F0002C  a           D_CPULAT 00000040  a            G_OPENA 00000080  a           KEY_HASH 00000000  a 
         BRANCHOBJ 00000003  a             D_CTRL 00F1A114  a            G_OPLAT 00000200  a           KEY_STAR 00000010  a 
             BUSHI 20000000  a          D_DIVCTRL 00F1A11C  a               G_PC 00F02110  a              LBUFA 00F00800  a 
             B_CMD 00F02238  a              D_END 00F1A10C  a           G_PITCLR 00000800  a              LBUFB 00F01000  a 
           B_COUNT 00F0223C  a           D_ENDRAM 00F1D000  a           G_PITENA 00000040  a              LBUFC 00F01800  a 
            B_DSTD 00F02248  a          D_EXT0CLR 00002000  a           G_PITLAT 00000100  a             LEVEL0 00000100  a 
            B_DSTZ 00F02250  a          D_EXT0ENA 00000100  a              G_RAM 00F03000  a              LFU_A 01000000  a 
              B_I0 00F02288  a          D_EXT1CLR 00020000  a           G_REMAIN 00F0211C  a             LFU_AN 00800000  a 
              B_I1 00F02284  a          D_EXT1ENA 00010000  a                HBB 00F00030  a          LFU_CLEAR 00000000  a 
              B_I2 00F02280  a          D_EXT1LAT 00000400  a                HBE 00F00032  a              LFU_D 01400000  a 
              B_I3 00F0227C  a          D_EXT2LAT 00010000  a                 HC 00F00004  a             LFU_NA 00400000  a 
            B_IINC 00F02270  a            D_FLAGS 00F1A100  a               HDB1 00F00038  a            LFU_NAN 00200000  a 
            B_PATD 00F02268  a           D_I2SCLR 00000400  a               HDB2 00F0003A  a           LFU_NOTD 00A00000  a 
            B_SRCD 00F02240  a           D_I2SENA 00000020  a                HDE 00F0003C  a           LFU_NOTS 00600000  a 
           B_SRCZ1 00F02258  a           D_I2SLAT 00000080  a                HEQ 00F00054  a           LFU_NSAD 00400000  a 
           B_SRCZ2 00F02260  a            D_MACHI 00F1A120  a                 HP 00F0002E  a          LFU_NSAND 00200000  a 
            B_STOP 00F02278  a              D_MOD 00F1A118  a                 HS 00F00034  a          LFU_NSORD 01600000  a 
              B_Z0 00F02298  a             D_MTXA 00F1A108  a                HVS 00F00036  a         LFU_NSORND 00E00000  a 
              B_Z1 00F02294  a             D_MTXC 00F1A104  a              IMASK 00000008  a        LFU_N_SXORD 00C00000  a 
              B_Z2 00F02290  a               D_PC 00F1A110  a              INCEN 00000010  a            LFU_ONE 01E00000  a 
              B_Z3 00F0228C  a              D_RAM 00F1B000  a          INITSTACK 001FFFFC  a        LFU_REPLACE 01800000  a 


                                                             Page 17      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)
Symbol Table

             LFU_S 01800000  a                OB0 00F00010  a            PWIDTH6 00000A00  a              WID10 00001A00  a 
           LFU_SAD 01000000  a                OB1 00F00012  a            PWIDTH7 00000C00  a            WID1024 00005000  a 
          LFU_SAND 00800000  a                OB2 00F00014  a            PWIDTH8 00000E00  a             WID112 00003600  a 
          LFU_SORD 01C00000  a                OB3 00F00016  a            REGPAGE 00004000  a              WID12 00001C00  a 
         LFU_SORND 01A00000  a                OBF 00F00026  a              RGB16 00000006  a             WID128 00003800  a 
         LFU_SXORD 01200000  a                ODP 00F00024  a              RGB24 00000002  a            WID1280 00005200  a 
           LFU_XOR 01200000  a                OLP 00F00020  a             RISCGO 00000001  a              WID14 00001E00  a 
          LFU_ZERO 00000000  a              OLPHI 00F00022  a            ROM_12W 00F1D600  a            WID1536 00005400  a 
               LPH 00F00008  a              OLPLO 00F00020  a         ROM_AMSINE 00F1D400  a              WID16 00002000  a 
               LPV 00F0000A  a             OPTION 00000009  a        ROM_CHIRP16 00F1D800  a             WID160 00003A00  a 
              LRXD 00F1A148  a             O_1GAP 00010000  a          ROM_DELTA 00F1DC00  a            WID1792 00005600  a 
              LTXD 00F1A148  a             O_2GAP 00018000  a          ROM_NOISE 00F1DE00  a             WID192 00003C00  a 
             L_I2S 00F1A148  a             O_3GAP 00020000  a           ROM_NTRI 00F1DA00  a               WID2 00000800  a 
            MATCOL 00000010  a             O_4GAP 00028000  a           ROM_SINE 00F1D200  a              WID20 00002200  a 
          MATRIX10 0000000A  a             O_5GAP 00030000  a          ROM_TABLE 00F1D000  a            WID2048 00005800  a 
          MATRIX11 0000000B  a             O_6GAP 00038000  a            ROM_TRI 00F1D000  a             WID224 00003E00  a 
          MATRIX12 0000000C  a             O_BREQ 00000000  a               RRXD 00F1A14C  a              WID24 00002400  a 
          MATRIX13 0000000D  a             O_BRGT 00004000  a               RTXD 00F1A14C  a             WID256 00004000  a 
          MATRIX14 0000000E  a           O_BRHALF 00010000  a              R_I2S 00F1A14C  a            WID2560 00005A00  a 
          MATRIX15 0000000F  a             O_BRLT 00008000  a           SCBITOBJ 00000001  a              WID28 00002600  a 
           MATRIX3 00000003  a             O_BROP 0000C000  a               SCLK 00F1A150  a            WID3072 00005C00  a 
           MATRIX4 00000004  a           O_DEPTH1 00000000  a          SINGLE_GO 00000010  a              WID32 00002800  a 
           MATRIX5 00000005  a          O_DEPTH16 00004000  a        SINGLE_STEP 00000008  a             WID320 00004200  a 
           MATRIX6 00000006  a           O_DEPTH2 00001000  a              SMODE 00F1A154  a            WID3584 00005E00  a 
           MATRIX7 00000007  a          O_DEPTH32 00005000  a              SRCEN 00000001  a             WID384 00004400  a 
           MATRIX8 00000008  a           O_DEPTH4 00002000  a             SRCENX 00000004  a               WID4 00001000  a 
           MATRIX9 00000009  a           O_DEPTH8 00003000  a             SRCENZ 00000002  a              WID40 00002A00  a 
            MATROW 00000000  a            O_NOGAP 00008000  a           SRCSHADE 40000000  a             WID448 00004600  a 
           MEMCON1 00F00000  a          O_REFLECT 00002000  a              SSTAT 00F1A150  a              WID48 00002C00  a 
           MEMCON2 00F00002  a          O_RELEASE 00010000  a            STOPOBJ 00000004  a             WID512 00004800  a 
        MODMASK128 FFFFFF80  a              O_RMW 00004000  a              TEST1 00F00056  a              WID56 00002E00  a 
       MODMASK128K FFFE0000  a         O_STOPINTS 00000008  a             TOPBEN 00004000  a               WID6 00001400  a 
         MODMASK16 FFFFFFF0  a            O_TRANS 00008000  a             TOPNEN 00008000  a              WID64 00003000  a 
        MODMASK16K FFFFC000  a         PAL_HEIGHT 0000011F  a              UPDA1 00000200  a             WID640 00004A00  a 
         MODMASK1K FFFFFC00  a           PAL_HMID 0000034B  a             UPDA1F 00000100  a             WID768 00004C00  a 
         MODMASK1M FFF00000  a           PAL_VMID 00000142  a              UPDA2 00000400  a               WID8 00001800  a 
          MODMASK2 FFFFFFFE  a          PAL_WIDTH 00000565  a              USER0 00000100  a              WID80 00003200  a 
        MODMASK256 FFFFFF00  a            PATDSEL 00010000  a            USERRAM 00004000  a             WID896 00004E00  a 
       MODMASK256K FFFC0000  a              PAUSE 0000001C  a          U_MCLRERR 00000040  a              WID96 00003400  a 
         MODMASK2K FFFFF800  a               PIT0 00F00050  a             U_MODD 00000001  a              XADD0 00020000  a 
         MODMASK32 FFFFFFE0  a               PIT1 00F00052  a          U_MRINTEN 00000020  a            XADDINC 00030000  a 
        MODMASK32K FFFF8000  a             PITCH1 00000000  a            U_SERIN 0000000D  a            XADDPHR 00000000  a 
          MODMASK4 FFFFFFFC  a             PITCH2 00000001  a             VARMOD 00000100  a            XADDPIX 00010000  a 
         MODMASK4K FFFFF000  a             PITCH3 00000003  a                VBB 00F00040  a           XSIGNADD 00000000  a 
        MODMASK512 FFFFFE00  a             PITCH4 00000002  a                VBE 00F00042  a           XSIGNSUB 00080000  a 
       MODMASK512K FFF80000  a             PIXEL1 00000000  a                 VC 00F00006  a              YADD0 00000000  a 
         MODMASK64 FFFFFFC0  a            PIXEL16 00000020  a                VDB 00F00046  a              YADD1 00040000  a 
        MODMASK64K FFFF0000  a             PIXEL2 00000008  a                VDE 00F00048  a           YSIGNADD 00000000  a 
          MODMASK8 FFFFFFF8  a            PIXEL32 00000028  a                VEB 00F0004A  a           YSIGNSUB 00100000  a 
         MODMASK8K FFFFE000  a             PIXEL4 00000010  a                VEE 00F0004C  a              ZBUFF 00002000  a 
          MOD_MASK 00F1A118  a             PIXEL8 00000018  a                 VI 00F0004E  a          ZERO_FLAG 00000001  a 
         NEGA_FLAG 00000004  a            PWIDTH1 00000000  a              VIDEN 00000001  a            ZMODEEQ 00080000  a 
       NTSC_HEIGHT 000000F1  a            PWIDTH2 00000200  a            VIDTYPE 00000010  a            ZMODEGT 00100000  a 
         NTSC_HMID 00000337  a            PWIDTH3 00000400  a              VMODE 00F00028  a            ZMODELT 00040000  a 
         NTSC_VMID 0000010A  a            PWIDTH4 00000600  a                 VP 00F0003E  a             ZOFFS0 00000000  a 
        NTSC_WIDTH 00000581  a            PWIDTH5 00000800  a                 VS 00F00044  a             ZOFFS1 00000040  a 


                                                             Page 18      0:53:46 am 12-May-2009     Madmac 3.03  (MSDOS)
Symbol Table

            ZOFFS2 00000080  a 
            ZOFFS3 000000C0  a 
            ZOFFS4 00000100  a 
            ZOFFS5 00000140  a 
            ZOFFS6 00000180  a 
            ZOFFS7 000001C0  a 
               col 00008FC0  a 
          filename 0000008C  t 
            forevr 00000084  t 
            rombuf 00000000  b 
  skunkCONSOLECLOSE external  ax
  skunkCONSOLEREAD external  ax
  skunkCONSOLEWRITE external  ax
    skunkFILECLOSE external  ax
     skunkFILEOPEN external  ax
     skunkFILEREAD external  ax
    skunkFILEWRITE external  ax
          skunkNOP external  ax
        skunkRESET external  ax

