; $Id: hardware.i,v 1.5 1994/02/09 02:04:35 limes Exp $
;  *************************************************************************
;  
;  Opera Hardware Definitions Include File
;  
;  Copyright (C) 1992, New Technologies Group, Inc.
;  Confidential and Proprietary  -  All Rights Reserved
;  
;  This file works with any tab space from 1 to 8.
;  
;  HISTORY
;  Date   Author           Description
;  ------ ---------------- -------------------------------------------------
;  921204 -RJ Mical        Burst this file out of sherrie.h
;  
;  **********************************************************************   

	IF :LNOT::DEF:	|__HARDWARE_I|
	GBLL	|__HARDWARE_I|


;  === VDL DMA control ===   
;  Bit fields 0xF8000000 are reserved   
VDL_640SC         EQU &04000000
VDL_DISPMOD_MASK  EQU &03800000
VDL_SLIPEN        EQU &00400000
VDL_ENVIDDMA      EQU &00200000
VDL_SLIPCOMMSEL   EQU &00100000
VDL_480RES        EQU &00080000
VDL_RELSEL        EQU &00040000
VDL_PREVSEL       EQU &00020000
VDL_LDCUR         EQU &00010000
VDL_LDPREV        EQU &00008000
VDL_LEN_MASK      EQU &00007E00
VDL_LINE_MASK     EQU &000001FF

VDL_LINE_SHIFT     EQU 0
VDL_LEN_SHIFT      EQU 9

VDL_LEN_PREFETCH   EQU 4


;  VDL_DISPMOD_MASK definitions   
VDL_DISPMOD_320   EQU &00000000
VDL_DISPMOD_384   EQU &00800000
VDL_DISPMOD_512   EQU &01000000
VDL_DISPMOD_640   EQU &01800000
VDL_DISPMOD_1024  EQU &02000000
VDL_DISPMOD_res5  EQU &02800000
VDL_DISPMOD_res6  EQU &03000000
VDL_DISPMOD_res7  EQU &03800000


;  === VDL Palette data ===   
VDL_CONTROL     EQU &80000000
VDL_RGBCTL_MASK EQU &60000000
VDL_PEN_MASK    EQU &1F000000
VDL_R_MASK      EQU &00FF0000
VDL_G_MASK      EQU &0000FF00
VDL_B_MASK      EQU &000000FF

VDL_B_SHIFT       EQU 0
VDL_G_SHIFT       EQU 8
VDL_R_SHIFT       EQU 16
VDL_PEN_SHIFT     EQU 24
VDL_RGBSEL_SHIFT  EQU 29

;  VDL_RGBCTL_MASK definitions   
VDL_FULLRGB     EQU &00000000
VDL_REDONLY     EQU &60000000
VDL_GREENONLY   EQU &40000000
VDL_BLUEONLY    EQU &20000000


;  === VDL display control word ===   
VDL_DISPCTRL      EQU &C0000000
VDL_BACKGROUND    EQU &20000000
VDL_NULLAMY       EQU &10000000
VDL_PALSEL        EQU &08000000
VDL_S640SEL       EQU &04000000
VDL_CLUTBYPASSEN  EQU &02000000
VDL_SLPDCEL       EQU &01000000
VDL_FORCETRANS    EQU &00800000
VDL_BACKTRANS     EQU &00400000
VDL_WINSWAPHV     EQU &00200000
VDL_WINVSUB_MASK  EQU &00180000  ; See definitions below   
VDL_WINHSUB_MASK  EQU &00060000  ; See definitions below   
VDL_WINBLSB_MASK  EQU &00018000  ; See definitions below   
VDL_WINVINTEN     EQU &00004000
VDL_WINHINTEN     EQU &00002000
VDL_RANDOMEN      EQU &00001000
VDL_WINREPEN      EQU &00000800
VDL_SWAPHV        EQU &00000400
VDL_VSUB_MASK     EQU &00000300  ; See definitions below   
VDL_HSUB_MASK     EQU &000000C0  ; See definitions below   
VDL_BLSB_MASK     EQU &00000030  ; See definitions below   
VDL_VINTEN        EQU &00000008
VDL_HINTEN        EQU &00000004
VDL_COLORSONLY    EQU &00000002
VDL_ONEVINTDIS    EQU &00000001

;  VDL_BLSB_MASK definitions   
VDL_BLSB_NOP    EQU &00000030
VDL_BLSB_BLUE   EQU &00000020  ; Normal   
VDL_BLSB_GREEN  EQU &00000010
VDL_BLSB_ZERO   EQU &00000000

;  VDL_HSUB_MASK definitions   
VDL_HSUB_NOP    EQU &000000C0
VDL_HSUB_FRAME  EQU &00000080  ; Normal   
VDL_HSUB_ONE    EQU &00000040
VDL_HSUB_ZERO   EQU &00000000

;  VDL_VSUB_MASK definitions   
VDL_VSUB_NOP    EQU &00000300
VDL_VSUB_FRAME  EQU &00000200  ; Normal   
VDL_VSUB_ONE    EQU &00000100
VDL_VSUB_ZERO   EQU &00000000

;  VDL_WBLSB_MASK definitions   
VDL_WINBLSB_NOP    EQU &00018000
VDL_WINBLSB_BLUE   EQU &00010000  ; Normal   
VDL_WINBLSB_GREEN  EQU &00008000
VDL_WINBLSB_ZERO   EQU &00000000

;  VDL_HSUB_MASK definitions   
VDL_WINHSUB_NOP    EQU &00060000
VDL_WINHSUB_FRAME  EQU &00040000  ; Normal   
VDL_WINHSUB_ONE    EQU &00020000
VDL_WINHSUB_ZERO   EQU &00000000

;  VDL_VSUB_MASK definitions   
VDL_WINVSUB_NOP    EQU &00180000
VDL_WINVSUB_FRAME  EQU &00100000  ; Normal   
VDL_WINVSUB_ONE    EQU &00080000
VDL_WINVSUB_ZERO   EQU &00000000


;  === AMY control word ===   
VDL_AMYCTRL  EQU &80000000


;  === Special VDL 'NOP' ===   
VDL_NOP      EQU &E1000000
VDL_NULLVDL  EQU VDL_NOP
VDL_AMY_NOP  EQU VDL_AMYCTRL+0
VDL_AMYNULL  EQU VDL_AMY_NOP


;  === CCB control word flags ===   
CCB_SKIP        EQU &80000000
CCB_LAST        EQU &40000000
CCB_NPABS       EQU &20000000
CCB_SPABS       EQU &10000000
CCB_PPABS       EQU &08000000
CCB_LDSIZE      EQU &04000000
CCB_LDPRS       EQU &02000000
CCB_LDPPMP      EQU &01000000
CCB_LDPLUT      EQU &00800000
CCB_CCBPRE      EQU &00400000
CCB_YOXY        EQU &00200000
CCB_ACSC        EQU &00100000
CCB_ALSC        EQU &00080000
CCB_ACW         EQU &00040000
CCB_ACCW        EQU &00020000
CCB_TWD         EQU &00010000
CCB_LCE         EQU &00008000
CCB_ACE         EQU &00004000
CCB_reserved13  EQU &00002000
CCB_MARIA       EQU &00001000
CCB_PXOR        EQU &00000800
CCB_USEAV       EQU &00000400
CCB_PACKED      EQU &00000200
CCB_POVER_MASK  EQU &00000180
CCB_PLUTPOS     EQU &00000040
CCB_BGND        EQU &00000020
CCB_NOBLK       EQU &00000010
CCB_PLUTA_MASK  EQU &0000000F

CCB_POVER_SHIFT  EQU 7
CCB_PLUTA_SHIFT  EQU 0

PMODE_PDC   EQU ((&00000000):SHL:CCB_POVER_SHIFT) ; Normal
PMODE_ZERO  EQU ((&00000002):SHL:CCB_POVER_SHIFT)
PMODE_ONE   EQU ((&00000003):SHL:CCB_POVER_SHIFT)


;  === Cel first preamble word flags ===   
PRE0_LITERAL  EQU &80000000
PRE0_BGND     EQU &40000000

PRE0_VCNT_MASK  EQU &0000FFC0
PRE0_LINEAR     EQU &00000010
PRE0_REP8       EQU &00000008
PRE0_BPP_MASK   EQU &00000007

PRE0_VCNT_SHIFT  EQU 6
PRE0_BPP_SHIFT   EQU 0

;  PRE0_BPP_MASK definitions   
PRE0_BPP_1   EQU &00000001
PRE0_BPP_2   EQU &00000002
PRE0_BPP_4   EQU &00000003
PRE0_BPP_6   EQU &00000004
PRE0_BPP_8   EQU &00000005
PRE0_BPP_16  EQU &00000006


PRE0_VCNT_PREFETCH    EQU 1


;  === Cel second preamble word flags ===   
PRE1_WOFFSET8_MASK   EQU &FF000000
PRE1_WOFFSET10_MASK  EQU &03FF0000
PRE1_NOSWAP          EQU &00004000
PRE1_TLLSB_MASK      EQU &00003000
PRE1_LRFORM          EQU &00000800
PRE1_TLHPCNT_MASK    EQU &000007FF

PRE1_WOFFSET8_SHIFT   EQU 24
PRE1_WOFFSET10_SHIFT  EQU 16
PRE1_TLLSB_SHIFT      EQU 12
PRE1_TLHPCNT_SHIFT    EQU 0

PRE1_TLLSB_0     EQU &00000000
PRE1_TLLSB_PDC0  EQU &00001000 ; Normal
PRE1_TLLSB_PDC4  EQU &00002000
PRE1_TLLSB_PDC5  EQU &00003000

PRE1_WOFFSET_PREFETCH EQU 2
PRE1_TLHPCNT_PREFETCH EQU 1


;  === CCBCTL0 flags ===   
B15POS_MASK   EQU &C0000000
B0POS_MASK    EQU &30000000
SWAPHV        EQU &08000000
ASCALL        EQU &04000000
CCBCTL0_u25   EQU &02000000
CFBDSUB       EQU &01000000
CFBDLSB_MASK  EQU &00C00000
PDCLSB_MASK   EQU &00300000

B15POS_SHIFT EQU 30
B0POS_SHIFT  EQU 28
CFBD_SHIFT   EQU 22
PDCLSB_SHIFT EQU 20

;  B15POS_MASK definitions   
B15POS_0    EQU &00000000
B15POS_1    EQU &40000000
B15POS_PDC  EQU &C0000000

;  B0POS_MASK definitions   
B0POS_0     EQU &00000000
B0POS_1     EQU &10000000
B0POS_PPMP  EQU &20000000
B0POS_PDC   EQU &30000000

;  CFBDLSB_MASK definitions   
CFBDLSB_0      EQU &00000000
CFBDLSB_CFBD0  EQU &00400000
CFBDLSB_CFBD4  EQU &00800000
CFBDLSB_CFBD5  EQU &00C00000

;  PDCLSB_MASK definitions   
PDCLSB_0     EQU &00000000
PDCLSB_PDC0  EQU &00100000
PDCLSB_PDC4  EQU &00200000
PDCLSB_PDC5  EQU &00300000


;  === Packed cel data control tokens ===   
PACK_EOL          EQU &00000000
PACK_LITERAL      EQU &00000001
PACK_TRANSPARENT  EQU &00000002
PACK_PACKED       EQU &00000003


;  === PPMPC control word flags ===   
;  You compose a PPMP value by building up PPMPC definitions and then 
;  using the PPMP_0_SHIFT or PPMP_1_SHIFT values to build up the 
;  value to be used for the CCB's PPMP
; 

;  These define the shifts required to get your PPMPC value into either 
;  the 0 half or the 1 half of the PPMP
; 
PPMP_0_SHIFT EQU 0
PPMP_1_SHIFT EQU 16

PPMPC_1S_MASK  EQU &00008000
PPMPC_MS_MASK  EQU &00006000
PPMPC_MF_MASK  EQU &00001C00
PPMPC_SF_MASK  EQU &00000300
PPMPC_2S_MASK  EQU &000000C0
PPMPC_AV_MASK  EQU &0000003E
PPMPC_2D_MASK  EQU &00000001

PPMPC_MS_SHIFT  EQU 13
PPMPC_MF_SHIFT  EQU 10
PPMPC_SF_SHIFT  EQU 8
PPMPC_2S_SHIFT  EQU 6
PPMPC_AV_SHIFT  EQU 1

;  PPMPC_1S_MASK definitions   
PPMPC_1S_PDC   EQU &00000000
PPMPC_1S_CFBD  EQU &00008000

;  PPMPC_MS_MASK definitions   
PPMPC_MS_CCB         EQU &00000000
PPMPC_MS_PIN         EQU &00002000
PPMPC_MS_PDC_MFONLY  EQU &00004000
PPMPC_MS_PDC         EQU &00004000

;  PPMPC_MF_MASK definitions   
PPMPC_MF_1  EQU &00000000
PPMPC_MF_2  EQU &00000400
PPMPC_MF_3  EQU &00000800
PPMPC_MF_4  EQU &00000C00
PPMPC_MF_5  EQU &00001000
PPMPC_MF_6  EQU &00001400
PPMPC_MF_7  EQU &00001800
PPMPC_MF_8  EQU &00001C00

;  PPMPC_SF_MASK definitions   
PPMPC_SF_2   EQU &00000100
PPMPC_SF_4   EQU &00000200
PPMPC_SF_8   EQU &00000300
PPMPC_SF_16  EQU &00000000

;  PPMPC_2S_MASK definitions   
PPMPC_2S_0     EQU &00000000
PPMPC_2S_CCB   EQU &00000040
PPMPC_2S_CFBD  EQU &00000080
PPMPC_2S_PDC   EQU &000000C0

;  PPMPC_2D_MASK definitions   
PPMPC_2D_1  EQU &00000000
PPMPC_2D_2  EQU &00000001


;  === JOYSTICK/JOYSTICK1 flags ===   
JOYSTART  EQU &00000080
JOYFIREC  EQU &00000040
JOYFIREA  EQU &00000020
JOYFIREB  EQU &00000010
JOYDOWN   EQU &00000008
JOYUP     EQU &00000004
JOYRIGHT  EQU &00000002
JOYLEFT   EQU &00000001

JOYSELECT EQU JOYFIREC

JOYMOVE     EQU (JOYLEFT+JOYRIGHT+JOYUP+JOYDOWN)
JOYBUTTONS  EQU (JOYFIREA+JOYFIREB+JOYFIREC+JOYSTART)



	ENDIF	  ; of #ifdef __HARDWARE_I   


	END

