	.nlist
  .ifndef __ppi_equ__
__ppi_equ__	equ	1

;----------------------------------------------------------------
;
;	8255 PPI
;
;----------------------------------------------------------------

;愙懕恾
;	                              8255
;	    劕劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劖
;	    劔A7  A5  A3  A1      B7  B5  B3  B1  C7  C5  C3  C1  劔
;	    劔劆A6劆A4劆A2劆A0    劆B6劆B4劆B2劆B0劆C6劆C4劆C2劆C0劔
;	    劘劰劰劰劰劰劰劰劰劒劒劰劰劰劰劰劰劰劰劰劰劰劰劰劰劰劰劗
;	      + B A + R L D U     + B A + R L D U 劆劆劆劆劆劆劆劋R
;	        劆劆  劆劆劆劆  劇劅劑劊  劆劆劆劆劆劆劆劆劆劆劋劅L
;	        仜劑劅劑劑劑劑劅劑劅劑劅劅劑劑劑劑劊劆劆劆劆劆劕劒劖
;	    劇劅劑仜劅劑劑劑劑劅劑劅劑劅劅劑劑劑劑劅劊劆劆劆劋劸S1劔
;	  劇劑劅劑劅劅劑劑劑劊劇劑劅劑劅劅劑劑劑劊    劆劆劋劅劸S2劔
;	  劆劆劇劑劅劅劑劑劊  劆劆劇劑劅劅劑劑劊      劆劆    劘劒劗
;	  劆劆劆劆劇劅劑劊    劆劆劆劆劇劅劑劊        劆劆   MSM6258
;	  劆劆劆劆劆劇劑劅劅劅劑劑劑劑劑劅劑劅劅劅劅劅劑劊
;	  劆劆劆劆劆劆劆      劆劆劆劆劆劇劑劅劅劅劅劅劊
;	  U A D B L 劆R G +   U A D B L 劆R G +
;	劕劰劰劰劰劰劰劰劰劰劚劰劰劰劰劰劰劰劰劰劖
;	劔仜劆仜劆仜劆仜劆仜劔仜劆仜劆仜劆仜劆仜劔
;	劔1 仜2 仜3 仜4 仜5 劔1 仜2 仜3 仜4 仜5 劔
;	劘劖6   7   8   9 劕劤劖6   7   8   9 劕劗
;	  劘劒劒劒劒劒劒劒劗  劘劒劒劒劒劒劒劒劗
;	   JOY STICK 1(JS)     JOY STICK 2(JT)

;PPI億乕僩A
;	-|JS7|JS6|-|JS4|JS3|JS2|JS1
PPI_PORT_A		equ	$00E9A001	;僕儑僀僗僥傿僢僋1
PPI_A_JS7_BIT		equ	  6
PPI_A_JS7_MASK		equ	%01000000	;PA6 JS7擖椡丅0=B偑墴偝傟偰偄傞
PPI_A_JS6_BIT		equ	   5
PPI_A_JS6_MASK		equ	%00100000	;PA5 JS6擖椡丅0=A偑墴偝傟偰偄傞
PPI_A_JS4_BIT		equ	     3
PPI_A_JS4_MASK		equ	%00001000	;PA3 JS4擖椡丅0=仺偑墴偝傟偰偄傞
PPI_A_JS3_BIT		equ	      2
PPI_A_JS3_MASK		equ	%00000100	;PA2 JS3擖椡丅0=仼偑墴偝傟偰偄傞
PPI_A_JS2_BIT		equ	       1
PPI_A_JS2_MASK		equ	%00000010	;PA1 JS2擖椡丅0=伀偑墴偝傟偰偄傞
PPI_A_JS1_BIT		equ	        0
PPI_A_JS1_MASK		equ	%00000001	;PA0 JS1擖椡丅0=仾偑墴偝傟偰偄傞

;PPI億乕僩B
;	-|JT7|JT6|-|JT4|JT3|JT2|JT1
PPI_PORT_B		equ	$00E9A003	;僕儑僀僗僥傿僢僋2
PPI_B_JT7_BIT		equ	  6
PPI_B_JT7_MASK		equ	%01000000	;PB6 JT7擖椡丅0=B偑墴偝傟偰偄傞
PPI_B_JT6_BIT		equ	   5
PPI_B_JT6_MASK		equ	%00100000	;PB5 JT6擖椡丅0=A偑墴偝傟偰偄傞
PPI_B_JT4_BIT		equ	     3
PPI_B_JT4_MASK		equ	%00001000	;PB3 JT4擖椡丅0=仺偑墴偝傟偰偄傞
PPI_B_JT3_BIT		equ	      2
PPI_B_JT3_MASK		equ	%00000100	;PB2 JT3擖椡丅0=仼偑墴偝傟偰偄傞
PPI_B_JT2_BIT		equ	       1
PPI_B_JT2_MASK		equ	%00000010	;PB1 JT2擖椡丅0=伀偑墴偝傟偰偄傞
PPI_B_JT1_BIT		equ	        0
PPI_B_JT1_MASK		equ	%00000001	;PB0 JT1擖椡丅0=仾偑墴偝傟偰偄傞

;PPI億乕僩C
;	JS7|JS6|JT8|JS8|RATIO##|LEFT|RIGHT
PPI_PORT_C		equ	$00E9A005	;僕儑僀僗僥傿僢僋丄ADPCM僐儞僩儘乕儖
PPI_C_JS7_BIT		equ	 7
PPI_C_JS7_MASK		equ	%10000000	;PC7 JS7弌椡(晧榑棟)
PPI_C_JS6_BIT		equ	  6
PPI_C_JS6_MASK		equ	%01000000	;PC6 JS6弌椡(晧榑棟)
PPI_C_JT8_BIT		equ	   5
PPI_C_JT8_MASK		equ	%00100000	;PC5 JT8弌椡
PPI_C_JS8_BIT		equ	    4
PPI_C_JS8_MASK		equ	%00010000	;PC4 JS8弌椡
PPI_C_RATIO_BIT		equ	      2
PPI_C_RATIO_MASK	equ	%00001100	;PC3-PC2 ADPCM暘廃斾丅00=1/1024,01=1/768,10=1/512,11=inhibited
PPI_C_RATIO_1024	equ	%00000000	;00=1/1024
PPI_C_RATIO_768		equ	%00000100	;01=1/768
PPI_C_RATIO_512		equ	%00001000	;10=1/512
PPI_C_LEFT_BIT		equ	       1
PPI_C_LEFT_MASK		equ	%00000010	;PC1 ADPCM弌椡LEFT丅0=弌椡偡傞,1=弌椡偟側偄
PPI_C_RIGHT_BIT		equ	        0
PPI_C_RIGHT_MASK	equ	%00000001	;PC0 ADPCM弌椡RIGHT丅0=弌椡偡傞,1=弌椡偟側偄

;PPI僐儞僩儘乕儖
;	0|---|BIT###|VALUE
;	1|A_MODE##|A_DIR|C_UPPER_DIR|B_MODE|B_DIR|C_LOWER_DIR
PPI_CONTROL		equ	$00E9A007	;僐儞僩儘乕儖
PPI_CONTROL_PORT	equ	%00000000	;0=億乕僩C偱弌椡偵愝掕偝傟偰偄傞價僢僩偺憖嶌
PPI_CONTROL_MODE	equ	%10000000	;1=儌乕僪偺愝掕
;億乕僩C偱弌椡偵愝掕偝傟偰偄傞價僢僩偺憖嶌
PPI_SELECT_BIT		equ	       1
PPI_SELECT_MASK		equ	%00001110	;價僢僩慖戰
PPI_SET_RESET_BIT	equ	        0
PPI_SET_RESET_MASK	equ	%00000001	;0=儕僙僢僩,1=僙僢僩
;儌乕僪偺愝掕
;	儌乕僪0(Basic Input/Output)
;	儌乕僪1(Strobed Input/Output)
;	儌乕僪2(Strobed Bi-Directional Bus I/O)
PPI_A_MODE_BIT		equ	   5
PPI_A_MODE_MASK		equ	%01100000	;僌儖乕僾A(億乕僩A偲億乕僩C偺忋埵)偺儌乕僪
PPI_A_DIR_BIT		equ	    4
PPI_A_DIR_MASK		equ	%00010000	;億乕僩A偺曽岦丅0=弌椡,1=擖椡
PPI_C_UPPER_DIR_BIT	equ	     3
PPI_C_UPPER_DIR_MASK	equ	%00001000	;億乕僩C偺忋埵偺曽岦丅0=弌椡,1=擖椡
PPI_B_MODE_BIT		equ	      2
PPI_B_MODE_MASK		equ	%00000100	;僌儖乕僾B(億乕僩B偲億乕僩C偺壓埵)偺儌乕僪
PPI_B_DIR_BIT		equ	       1
PPI_B_DIR_MASK		equ	%00000010	;億乕僩B偺曽岦丅0=弌椡,1=擖椡
PPI_C_LOWER_DIR_BIT	equ	        0
PPI_C_LOWER_DIR_MASK	equ	%00000001	;億乕僩C偺壓埵偺曽岦丅0=弌椡,1=擖椡

  .endif  ;__ppi_equ__
	.list
