资源简介
FBAs游戏机模拟器源码,支持模拟大多数街机,更能支持联网对战!
代码片段和文件信息
#include “burnint.h“
#include “8255ppi.h“
#define MAX_PPIS 3
PPIPortRead PPI0PortReadA;
PPIPortRead PPI0PortReadB;
PPIPortRead PPI0PortReadC;
PPIPortWrite PPI0PortWriteA;
PPIPortWrite PPI0PortWriteB;
PPIPortWrite PPI0PortWriteC;
PPIPortRead PPI1PortReadA;
PPIPortRead PPI1PortReadB;
PPIPortRead PPI1PortReadC;
PPIPortWrite PPI1PortWriteA;
PPIPortWrite PPI1PortWriteB;
PPIPortWrite PPI1PortWriteC;
PPIPortRead PPI2PortReadA;
PPIPortRead PPI2PortReadB;
PPIPortRead PPI2PortReadC;
PPIPortWrite PPI2PortWriteA;
PPIPortWrite PPI2PortWriteB;
PPIPortWrite PPI2PortWriteC;
typedef struct
{
/* mode flags */
UINT8 groupA_mode;
UINT8 groupB_mode;
UINT8 portA_dir;
UINT8 portB_dir;
UINT8 portCH_dir;
UINT8 portCL_dir;
/* handshake signals (1=asserted; 0=non-asserted) */
UINT8 obf_a;
UINT8 obf_b;
UINT8 ibf_a;
UINT8 ibf_b;
UINT8 inte_a;
UINT8 inte_b;
UINT8 in_mask[3]; /* input mask */
UINT8 out_mask[3]; /* output mask */
UINT8 read[3]; /* data read from ports */
UINT8 latch[3]; /* data written to ports */
UINT8 output[3]; /* actual output data */
} ppi8255;
static ppi8255 chips[MAX_PPIS];
static void ppi8255_get_handshake_signals(ppi8255 *chip UINT8 *result)
{
UINT8 handshake = 0x00;
UINT8 mask = 0x00;
/* group A */
if (chip->groupA_mode == 1)
{
if (chip->portA_dir)
{
handshake |= chip->ibf_a ? 0x20 : 0x00;
handshake |= (chip->ibf_a && chip->inte_a) ? 0x08 : 0x00;
mask |= 0x28;
}
else
{
handshake |= chip->obf_a ? 0x00 : 0x80;
handshake |= (chip->obf_a && chip->inte_a) ? 0x08 : 0x00;
mask |= 0x88;
}
}
else if (chip->groupA_mode == 2)
{
handshake |= chip->inte_a ? 0x08 : 0x00;
handshake |= chip->obf_a ? 0x00 : 0x80;
handshake |= chip->ibf_a ? 0x20 : 0x00;
mask |= 0xA8;
}
/* group B */
if (chip->groupB_mode == 1)
{
if (chip->portA_dir)
{
handshake |= chip->ibf_b ? 0x02 : 0x00;
handshake |= (chip->ibf_b && chip->inte_b) ? 0x01 : 0x00;
mask |= 0x03;
}
else
{
handshake |= chip->obf_b ? 0x00 : 0x02;
handshake |= (chip->obf_b && chip->inte_b) ? 0x01 : 0x00;
mask |= 0x03;
}
}
*result &= ~mask;
*result |= handshake & mask;
}
static void ppi8255_write_port(ppi8255 *chip int port int chipnum)
{
UINT8 write_data;
write_data = chip->latch[port] & chip->out_mask[port];
write_data |= 0xFF & ~chip->out_mask[port];
/* write out special port 2 signals */
if (port == 2)
ppi8255_get_handshake_signals(chip &write_data);
chip->output[port] = write_data;
if (chipnum == 0 && port == 0) {
if (PPI0PortWriteA) PPI0PortWriteA(write_data);
}
if (chipnum == 0 && port == 1) {
if (PPI0PortWriteB) PPI0PortWriteB(write_data);
}
if (chipnum == 0 && port == 2) {
if (PPI0PortWriteC) PPI0PortWriteC(write_data);
}
if (chipnum == 1 && port == 0) {
if (PPI1PortWriteA) PPI1PortWriteA(write_data);
}
if (chipnum == 1 && port == 1) {
if (PPI1PortWriteB) PPI1PortWriteB(write_data);
}
if (chipnum == 1 && port == 2) {
if (PPI1PortWriteC) PPI1P
- 上一篇:人工神经网络原理及应用.pdf
- 下一篇:zeba
se用于zemax初始结构选择
相关资源
- 串口模拟器支持win10
- BOSON模拟器NetSim V5.31破解版附注册机
- WinCE_6.0_中文SDK(仿真器模拟器)
- AIX模拟器(PC)安装成功,不再需要找
- XBOX ONE 手柄模拟器
- 航海模拟器中DCPA TCPA的算法
- HART375手操器-模拟器.zip
- 真正能搜星的绿色中文版Wince5.0模拟器
- 魔兽335模拟器源代码
- 华为网管交换机模拟器
- Nokia SDK 开发模拟器
- 收藏奉献_DOS汉字系统21:国家统计局
- conquer征服服务器端+数据库2
- conquer征服服务器端+数据库1
- 凤凰模拟器破解包
- twrp的模拟器版本以及地址官方的.ra
- 北通360手柄模拟器完美版
- x360ce手柄模拟器
- modbus模拟器.rar
- S7工控模拟器.rar
- 思科模拟器配置实验
- 电力101/104规约模拟器
- 最好用的电子狗模拟器multkey Mk19.1.9
- libmp3lame.a(3.100)静态库for iOS支持真
- profibus多种主从站模拟器+profibus协议中
- dramsim2模拟器
-
DOS模拟器,内含EDIT、TASM、Tli
nk、 - Modbus测试工具和Modbus数据模拟器
- MIPSsimMIPS指令系统模拟器.zip
- cx-simulator1.5版PLC模拟器软件
评论
共有 条评论