Famicom Network System controller added

misc fixes to mappers
This commit is contained in:
g0me3 2020-01-04 13:16:54 +03:00
parent 0b4be4b639
commit 6abfe09caf
8 changed files with 66 additions and 33 deletions

View File

@ -237,13 +237,8 @@ void Mapper200_Init(CartInfo *info) {
//------------------ Map 201 ---------------------------
static void M201Sync(void) {
if (latche & 8) {
setprg32(0x8000, latche & 3);
setchr8(latche & 3);
} else {
setprg32(0x8000, 0);
setchr8(0);
}
setprg32(0x8000, latche & 3);
setchr8(latche & 3);
}
void Mapper201_Init(CartInfo *info) {

View File

@ -47,31 +47,31 @@ static uint8 flash_save=0, flash_state=0, flash_mode=0, flash_bank;
static void (*WLSync)(void);
static void (*WHSync)(void);
static INLINE void setfpageptr(int s, uint32 A, uint8 *p) {
uint32 AB = A >> 11;
int x;
if (p)
for (x = (s >> 1) - 1; x >= 0; x--) {
FlashPage[AB + x] = p - A;
}
else
for (x = (s >> 1) - 1; x >= 0; x--) {
FlashPage[AB + x] = 0;
}
static INLINE void setfpageptr(int s, uint32 A, uint8 *p) {
uint32 AB = A >> 11;
int x;
if (p)
for (x = (s >> 1) - 1; x >= 0; x--) {
FlashPage[AB + x] = p - A;
}
else
for (x = (s >> 1) - 1; x >= 0; x--) {
FlashPage[AB + x] = 0;
}
}
void setfprg16(uint32 A, uint32 V) {
if (PRGsize[0] >= 16384) {
V &= PRGmask16[0];
setfpageptr(16, A, flashdata ? (&flashdata[V << 14]) : 0);
} else {
uint32 VA = V << 3;
int x;
for (x = 0; x < 8; x++)
setfpageptr(2, A + (x << 11), flashdata ? (&flashdata[((VA + x) & PRGmask2[0]) << 11]) : 0);
}
void setfprg16(uint32 A, uint32 V) {
if (PRGsize[0] >= 16384) {
V &= PRGmask16[0];
setfpageptr(16, A, flashdata ? (&flashdata[V << 14]) : 0);
} else {
uint32 VA = V << 3;
int x;
for (x = 0; x < 8; x++)
setfpageptr(2, A + (x << 11), flashdata ? (&flashdata[((VA + x) & PRGmask2[0]) << 11]) : 0);
}
}
void inc_flash_write_count(uint8 bank, uint32 A)

View File

@ -93,6 +93,7 @@ static uint8 HyperShotData=0;
static uint32 MahjongData=0;
static uint32 FTrainerData=0;
static uint8 TopRiderData=0;
static uint32 FamiNetSysData = 0;
static uint8 BWorldData[1+13+1];
@ -104,6 +105,7 @@ static void UpdateHyperShot(void);
static void UpdateMahjong(void);
static void UpdateFTrainer(void);
static void UpdateTopRider(void);
static void UpdateFamiNetSys(void);
static uint32 snespad_return[4];
static uint32 JSreturn=0;
@ -463,6 +465,7 @@ void FCEUD_UpdateInput()
case SIFC_FTRAINERB:
case SIFC_FTRAINERA: UpdateFTrainer();break;
case SIFC_TOPRIDER: UpdateTopRider();break;
case SIFC_FAMINETSYS: UpdateFamiNetSys(); break;
case SIFC_OEKAKIDS: mouse=true; break;
}
@ -566,6 +569,9 @@ void InitInputPorts(bool fourscore)
case SIFC_TOPRIDER:
InputDPtr=&TopRiderData;
break;
case SIFC_FAMINETSYS:
InputDPtr = &FamiNetSysData;
break;
case SIFC_BWORLD:
InputDPtr=BWorldData;
break;
@ -718,6 +724,27 @@ static void UpdateTopRider(void)
TopRiderData|=1<<x;
}
ButtConfig FamiNetSysButtons[24] =
{
MK(V),MK(C),MK(X),MK(Z),MK(BL_CURSORUP),MK(BL_CURSORDOWN),MK(BL_CURSORLEFT),MK(BL_CURSORRIGHT),
MK(0),MK(1),MK(2),MK(3),MK(4),MK(5),MK(6),MK(7),
MK(8),MK(9),MK(ASTERISK),MK(KP_PLUS),MK(KP_DELETE),MK(KP_MINUS),MK(ESCAPE),MK(BACKSPACE)
};
// A B SEL ST * # . C x EndComm
// V C X Z * + DEL - x BS
static void UpdateFamiNetSys(void)
{
int x;
FamiNetSysData = 0;
for (x = 0; x<24; x++) {
if (DTestButton(&FamiNetSysButtons[x]))
FamiNetSysData |= 1 << x;
}
FamiNetSysData &= 0x00BFFFFF; // bit22 must be zero
}
ButtConfig FTrainerButtons[12]=
{
MK(O),MK(P),MK(BRACKET_LEFT),

View File

@ -82,8 +82,9 @@ enum ESIFC
SIFC_OEKAKIDS = 12,
SIFC_BWORLD = 13,
SIFC_TOPRIDER = 14,
SIFC_FAMINETSYS = 15,
SIFC_COUNT = SIFC_TOPRIDER
SIFC_COUNT = SIFC_FAMINETSYS
};
@ -105,7 +106,8 @@ inline const char* ESIFC_Name(ESIFC esifc)
"Family Trainer B",
"Oeka Kids Tablet",
"Barcode World",
"Top Rider"
"Top Rider",
"Famicom Network Controller"
};
if(esifc >= SIFC_NONE && esifc <= SIFC_COUNT)

View File

@ -211,6 +211,7 @@ static void SetInput(void) {
{0xb8b9aca3, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Wild Gunman
{0x5112dc21, SI_UNSET, SI_ZAPPER, SIFC_NONE }, // Wild Gunman
{0xaf4010ea, SI_GAMEPAD, SI_POWERPADB, SIFC_UNSET }, // World Class Track Meet
{0x67b126b9, SI_GAMEPAD, SI_GAMEPAD, SIFC_FAMINETSYS }, // Famicom Network System
{0x00000000, SI_UNSET, SI_UNSET, SIFC_UNSET }
};
int x = 0;
@ -724,7 +725,7 @@ BMAPPINGLocal bmap[] = {
{"F-15 MMC3 Based", 259, BMCF15_Init},
{"HP10xx/H20xx Boards", 260, BMCHPxx_Init},
{"810544-CA-1", 261, BMC810544CA1_Init},
{ "KONAMI QTAi Board", 547, QTAi_Init },
{"KONAMI QTAi Board", 547, QTAi_Init },
{"", 0, NULL}
};

View File

@ -77,6 +77,7 @@ extern INPUTCFC *FCEU_InitFamilyTrainerA(void);
extern INPUTCFC *FCEU_InitFamilyTrainerB(void);
extern INPUTCFC *FCEU_InitOekaKids(void);
extern INPUTCFC *FCEU_InitTopRider(void);
extern INPUTCFC *FCEU_InitFamiNetSys(void);
extern INPUTCFC *FCEU_InitBarcodeWorld(void);
//---------------
@ -534,6 +535,9 @@ static void SetInputStuffFC()
case SIFC_TOPRIDER:
portFC.driver=FCEU_InitTopRider();
break;
case SIFC_FAMINETSYS:
portFC.driver = FCEU_InitFamiNetSys();
break;
}
}

View File

@ -688,6 +688,7 @@
</ClCompile>
<ClCompile Include="..\src\input\cursor.cpp" />
<ClCompile Include="..\src\input\fkb.cpp" />
<ClCompile Include="..\src\input\fns.cpp" />
<ClCompile Include="..\src\input\ftrainer.cpp" />
<ClCompile Include="..\src\input\hypershot.cpp" />
<ClCompile Include="..\src\input\mahjong.cpp" />

View File

@ -1096,6 +1096,9 @@
<ClCompile Include="..\src\drivers\win\header_editor.cpp">
<Filter>drivers\win</Filter>
</ClCompile>
<ClCompile Include="..\src\input\fns.cpp">
<Filter>input</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\drivers\common\args.h">