📄 iop.inc
字号:
;;IOP clock = 81 Mhz
.ifnz SYSTEM_81_MHZ
IOP_CLOCK equ 81000000
.endif
.ifnz SYSTEM_67_MHZ
IOP_CLOCK equ 67500000
.endif
.ifnz SYSTEM_54_MHZ
IOP_CLOCK equ 54000000
.endif
IR_SCAN_TIME equ (IOP_CLOCK*100/1000000)
;;**************************************************************************;;
;; 64 port r/w address port I/O define (read/write) ;;
;; 0 = low / 1 = high ;;
;;**************************************************************************;;
GPIO_PORT0 equ $00
GPIO_PORT1 equ $01
GPIO_PORT2 equ $02
GPIO_PORT3 equ $03
GPIO_PORT4 equ $04
GPIO_PORT5 equ $05
GPIO_PORT6 equ $06
GPIO_PORT7 equ $07
;;**************************************************************************;;
;; 64 bit for each port I/O define (write only) ;;
;; 0 = input / 1 = output (read will destore setting!!) ;;
;;**************************************************************************;;
GPIO_IO0_CFG equ $08
GPIO_IO1_CFG equ $09
GPIO_IO2_CFG equ $0A
GPIO_IO3_CFG equ $0B
GPIO_IO4_CFG equ $0C
GPIO_IO5_CFG equ $0D
GPIO_IO6_CFG equ $0E
GPIO_IO7_CFG equ $0F
;;**************************************************************************;;
;; RISC exchange data area ;;
;;**************************************************************************;;
IOP_DATA0_L equ $10
IOP_DATA0_H equ $11
IOP_DATA1_L equ $12
IOP_DATA1_H equ $13
IOP_DATA2_L equ $14
IOP_DATA2_H equ $15
IOP_DATA3_L equ $16
IOP_DATA3_H equ $17
IOP_DATA4_L equ $18
IOP_DATA4_H equ $19
IOP_DATA5_L equ $1A
IOP_DATA5_H equ $1B
IOP_DATA6_L equ $1C
IOP_DATA6_H equ $1D
IOP_DATA7_L equ $1E
IOP_DATA7_H equ $1F
;;**************************************************************************;;
;; Timer and interrupt ;;
;;**************************************************************************;;
IntMask equ $20
IntFlag equ $21
TimerA_Lo equ $22
TimerA_Hi equ $23
TimerB_Lo equ $24
TimerB_Hi equ $25
INT_TIMER_B equ %00000001
INT_TIMER_A equ %00000010
;;**************************************************************************;;
;;IR port define ;;
;;**************************************************************************;;
IR_PORT equ GPIO_PORT3
IR_PORT_CFG equ GPIO_IO3_CFG
IR_IN equ %00000010 ;;gpio 25
IR_READY equ %10000000
IR_REPEAT equ %01000000
IR_RD equ 7
IR_RP equ 6
;;**************************************************************************;;
;;VFD , game port define ;;
;;**************************************************************************;;
VFD_PORT equ GPIO_PORT2
VFD_PORT_CFG equ GPIO_IO2_CFG
VFD_PORT1 equ GPIO_PORT3
VFD_PORT_CFG1 equ GPIO_IO3_CFG
VFD_READY equ %10000000
VFD_REPEAT equ %01000000
.ifnz SUPPORT_DEMO
.ifnz SUPPORT_GUANGLING
VFD_CLK equ %01000000 ;;gpio 22
VFD_STB equ %00100000 ;;gpio 21
VFD_DATA equ %10000000 ;;gpio 23
VFDB_CLK equ 6
VFDB_DAT equ 7
VFDB_STB equ 5
.else
VFD_DATA equ %01000000 ;;gpio 22
VFD_STB equ %00100000 ;;gpio 21
VFD_CLK equ %10000000 ;;gpio 23
VFDB_DAT equ 6
VFDB_CLK equ 7
VFDB_STB equ 5
.endif
.else
VFD_DATA equ %01000000 ;;gpio 22
VFD_STB equ %00000001 ;;gpio 24
VFD_CLK equ %10000000 ;;gpio 23
VFDB_DAT equ 6
VFDB_CLK equ 7
VFDB_STB equ 0
.endif
TEST_PORT equ GPIO_PORT5 ;;gpio 7
TEST_PORT_CFG equ GPIO_IO5_CFG
TEST_P4 equ %00000010
TEST_P5 equ %00000001
GAME_PORT equ GPIO_PORT0 ;;gpio 0,2
GAME_PORT_CFG equ GPIO_IO0_CFG
GAME_D1 equ %00000100 ;;gpio 2
GAME_D2 equ %00000001 ;;gpio 0
GAMEP_D1 equ 2
GAMEP_D2 equ 0
;;**************************************************************************;;
;;DSA port define ;;
;;**************************************************************************;;
.ifnz SUPPORT_DISCMAN
DSA_PORT equ GPIO_PORT2 ;;gpio 21,22,23
DSA_PORT_CFG equ GPIO_IO2_CFG
DSA_ACK equ %01000000 ;;gpio 22
DSA_DAT equ %10000000 ;;gpio 23
DSA_STB equ %00100000 ;;gpio 21
DSAB_ACK equ 6
DSAB_DAT equ 7
DSAB_STB equ 5
.else
DSA_PORT equ GPIO_PORT1 ;;gpio 8,9,10
DSA_PORT_CFG equ GPIO_IO1_CFG
DSA_ACK equ %00000001 ;;gpio 8
DSA_DAT equ %00000010 ;;gpio 9
DSA_STB equ %00000100 ;;gpio 10
DSAB_ACK equ 0
DSAB_DAT equ 1
DSAB_STB equ 2
.endif
;;**************************************************************************;;
;;Qcdoe port define ;;
;;**************************************************************************;;
.ifnz SUPPORT_DEMO
QCODE_TEST equ %10000000 ;;gpio 7
.ifnz SUPPORT_GUANGLING
QCODE_SQDT equ %00000010 ;;gpio 41
.else
QCODE_SQDT equ %01000000 ;;gpio 6
.endif
QCODE_SCOR equ %00100000 ;;gpio 13
QCODE_SQCK equ %00000001 ;;gpio 24
.ifnz SUPPORT_GUANGLING
QCODE_SHOCK equ %11111100
.else
QCODE_SHOCK equ %11111110
.endif
QCODE_PORT equ GPIO_PORT1
QCODE_PORT_CFG equ GPIO_IO1_CFG
.ifnz SUPPORT_GUANGLING
QCODE_SQDT_PORT equ GPIO_PORT5
.else
QCODE_SQDT_PORT equ GPIO_PORT0
.endif
QCODE_SCOR_PORT equ GPIO_PORT1
QCODE_SQCK_PORT equ GPIO_PORT3
QCODE_SHOCK_CFG equ GPIO_IO5_CFG
QCODE_SHOCK_PORT equ GPIO_PORT5
.ifnz SUPPORT_GUANGLING
Q_SQDT equ 1 ;;gpio 41
.else
Q_SQDT equ 6 ;;gpio 6
.endif
Q_SCOR equ 5 ;;gpio 13
Q_SQCK equ 0 ;;gpio 24
Q_SHOCK equ 0 ;;gpio 40
.else
QCODE_TEST equ %10000000 ;;gpio 7
QCODE_SQDT equ %00001000 ;;gpio 11
QCODE_SCOR equ %00000100 ;;gpio 10
QCODE_SQCK equ %00010000 ;;gpio 12
QCODE_SHOCK equ %11111110
QCODE_PORT equ GPIO_PORT1
QCODE_PORT_CFG equ GPIO_IO1_CFG
.ifnz SUPPORT_GUANGLING
QCODE_SQDT_PORT equ GPIO_PORT5
.else
QCODE_SQDT_PORT equ GPIO_PORT1
.endif
QCODE_SCOR_PORT equ GPIO_PORT1
QCODE_SQCK_PORT equ GPIO_PORT1
QCODE_SHOCK_CFG equ GPIO_IO5_CFG
QCODE_SHOCK_PORT equ GPIO_PORT5
Q_SQDT equ 3 ;;gpio 11
Q_SCOR equ 2 ;;gpio 10
Q_SQCK equ 4 ;;gpio 12
Q_SHOCK equ 0 ;;gpio 40
.endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -