voxel: merging changing from trunk

This commit is contained in:
punkrockguy318 2014-02-12 14:56:34 +00:00
parent 86d663102e
commit d0a7716ba4
42 changed files with 11281 additions and 11229 deletions

View File

@ -17,43 +17,45 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* 7-in-1 Darkwing Duck, Snake, MagicBlock (PCB marked as "12 in 1")
* 7-in-1 Darkwing Duck, Snake, MagicBlock (PCB marked as "12 in 1")
* 12-in-1 1991 New Star Co. Ltd.
*
*/
#include "mapinc.h"
static uint8 reg[4];
static uint8 prgchr[2], ctrl;
static SFORMAT StateRegs[] =
{
{ reg, 4, "REGS" },
{ prgchr, 2, "REGS" },
{ &ctrl, 1, "CTRL" },
{ 0 }
};
static void Sync(void) {
uint8 bank = (reg[3] & 3) << 3;
setchr4(0x0000, (reg[1] >> 3) | (bank << 2));
setchr4(0x1000, (reg[2] >> 3) | (bank << 2));
if (reg[3] & 8) {
setprg32(0x8000, ((reg[2] & 7) >> 1) | bank);
uint8 bank = (ctrl & 3) << 3;
setchr4(0x0000, (prgchr[0] >> 3) | (bank << 2));
setchr4(0x1000, (prgchr[1] >> 3) | (bank << 2));
if (ctrl & 8) {
setprg16(0x8000, bank | (prgchr[0] & 6) | 0); // actually, both 0 and 1 registers used, but they will switch each PA12 transition
setprg16(0xc000, bank | (prgchr[0] & 6) | 1); // if bits are different for both registers, so they must be programmed strongly the same!
} else {
setprg16(0x8000, (reg[1] & 7) | bank);
setprg16(0xc000, 7 | bank);
setprg16(0x8000, bank | (prgchr[0] & 7));
setprg16(0xc000, bank | 7 );
}
setmirror(((reg[3] & 4) >> 2) ^ 1);
setmirror(((ctrl & 4) >> 2) ^ 1);
}
static DECLFW(BMC12IN1Write) {
switch (A) {
case 0xafff: reg[0] = V; break;
case 0xbfff: reg[1] = V; break;
case 0xdfff: reg[2] = V; break;
case 0xefff: reg[3] = V; break;
switch (A & 0xE000) {
case 0xA000: prgchr[0] = V; Sync(); break;
case 0xC000: prgchr[1] = V; Sync(); break;
case 0xE000: ctrl = V & 0x0F; Sync(); break;
}
Sync();
}
static void BMC12IN1Power(void) {
reg[0] = reg[1] = reg[2] = reg[3] = 0;
prgchr[0] = prgchr[1] = ctrl = 0;
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, BMC12IN1Write);
@ -68,3 +70,4 @@ void BMC12IN1_Init(CartInfo *info) {
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

View File

@ -39,7 +39,7 @@ static void Sync(void) {
} else
setprg32(0x8000, prg >> 1);
setchr8(chr);
setmirror(mirr);
setmirror(mirr ^ 1);
}
static DECLFW(M225Write) {

View File

@ -201,6 +201,20 @@ void CPROM_Init(CartInfo *info) {
Latch_Init(info, CPROMSync, 0, 0x8000, 0xFFFF, 0, 0);
}
//------------------ Map 29 --------------------------- //Used by Glider, http://www.retrousb.com/product_info.php?cPath=30&products_id=58
static void M29Sync() {
setprg16(0x8000, (latche & 0x1C) >> 2);
setprg16(0xc000, ~0);
setchr8r(0, latche & 3);
setprg8r(0x10, 0x6000, 0);
}
void Mapper29_Init(CartInfo *info) {
Latch_Init(info, M29Sync, 0, 0x8000, 0xFFFF, 1, 0);
}
//------------------ Map 38 ---------------------------
static void M38Sync(void) {

View File

@ -14,7 +14,7 @@
#include <cstdlib>
#include <cstring>
unsigned int debuggerPageSize = 14;
int vblankScanLines = 0; //Used to calculate scanlines 240-261 (vblank)
int vblankPixel = 0; //Used to calculate the pixels in vblank
@ -232,7 +232,7 @@ int getBank(int offs)
if (GameInfo && GameInfo->type==GIT_NSF)
return addr != -1 ? addr / 0x1000 : -1;
return addr != -1 ? addr / 0x4000 : -1;
return addr != -1 ? addr / (1<<debuggerPageSize) : -1; //formerly, dividing by 0x4000
}
int GetNesFileAddress(int A){

View File

@ -25,6 +25,9 @@ void FCEU_printf(char *format, ...);
#define FCEUI_printf FCEU_printf
//Video interface
// FIXME: these functions are declared in windows video driver header, but not in linux video driver header;
// eventually both platform video drivers should be brought to same set of functions and single shared header,
// which then can be included where access to video driver functions is needed instead of driver.h
void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b);
void FCEUD_GetPalette(uint8 i,uint8 *r, uint8 *g, uint8 *b);
@ -259,6 +262,9 @@ void FCEUI_SetEmulationPaused(int val);
void FCEUI_ToggleEmulationPause();
//indicates whether input aids should be drawn (such as crosshairs, etc; usually in fullscreen mode)
// FIXME: this function is already declared in both platform video driver headers;
// eventually both platform video drivers should be brought to same set of functions and single shared header,
// which then can be included where access to video driver functions is needed instead of driver.h
bool FCEUD_ShouldDrawInputAids();
///called when the emulator closes a game

View File

@ -0,0 +1 @@
/res.aps

View File

@ -4,8 +4,8 @@
#include "common.h"
#include "fceu.h"
#include "drivers/win/video.h"
extern PALETTEENTRY *color_palette;
//extern WAVEFORMATEX wf;
//extern int soundo;
@ -292,6 +292,7 @@ static void do_video_conversion(const unsigned char* buffer)
// memset(avi_file->convert_buffer, 0, VIDEO_WIDTH*(avi_file->end_scanline-avi_file->start_scanline)*3);
buffer += avi_file->start_scanline * VIDEO_WIDTH;
PALETTEENTRY* color_palette = GetPalette();
for(int y=avi_file->start_scanline; y<avi_file->end_scanline; ++y)
{

View File

@ -414,6 +414,11 @@ void SaveStrippedROM(int invert)
if(!GetSaveFileName(&ofn))return;
fp = fopen(sromfilename,"wb");
if(!fp)
{
FCEUD_PrintError("Error opening target stripped rom file!");
return;
}
if(GameInfo->type==GIT_NSF)
{

View File

@ -185,8 +185,8 @@ static CFGSTRUCT fceuconfig[] =
NAC("palyo",pal_emulation),
NAC("genie",genie),
NAC("fs",fullscreen),
NAC("vgamode",vmod),
NAC("fs",_FIXME_getFullscreenVar()),
NAC("vgamode",_FIXME_getVModeIdxVar()),
NAC("sound",soundo),
NAC("sicon",status_icon),
@ -206,8 +206,8 @@ static CFGSTRUCT fceuconfig[] =
NACS("odavi",directory_names[12]),
NACS("odbase",directory_names[13]),
AC(winspecial),
AC(NTSCwinspecial),
NAC("winspecial", _FIXME_getFilterModeWindowedIdxVar()),
NAC("NTSCwinspecial", _FIXME_getFilterOptionVar()),
AC(winsizemulx),
AC(winsizemuly),
AC(tvAspectX),
@ -231,23 +231,23 @@ static CFGSTRUCT fceuconfig[] =
NACA("InputType",InputType),
NAC("vmcx",vmodes[0].x),
NAC("vmcy",vmodes[0].y),
NAC("vmcb",vmodes[0].bpp),
NAC("vmcf",vmodes[0].flags),
NAC("vmcxs",vmodes[0].xscale),
NAC("vmcys",vmodes[0].yscale),
NAC("vmspecial",vmodes[0].special),
NAC("vmcx",_FIXME_getCustomVideoModeVar().width),
NAC("vmcy",_FIXME_getCustomVideoModeVar().height),
NAC("vmcb",_FIXME_getCustomVideoModeVar().bpp),
NAC("vmcf",_FIXME_getCustomVideoModeVar().flags),
NAC("vmcxs",_FIXME_getCustomVideoModeVar().xscale),
NAC("vmcys",_FIXME_getCustomVideoModeVar().yscale),
NAC("vmspecial",_FIXME_getCustomVideoModeVar().filter),
NAC("srendline",srendlinen),
NAC("erendline",erendlinen),
NAC("srendlinep",srendlinep),
NAC("erendlinep",erendlinep),
AC(directDrawModeWindowed),
AC(directDrawModeFullscreen),
AC(winsync),
NAC("988fssync",fssync),
NAC("directDrawModeWindowed", _FIXME_getDDrawModeWindowedVar()),
NAC("directDrawModeFullscreen", _FIXME_getDDrawModeFullscreenVar()),
NAC("winsync", _FIXME_getWindowedSyncModeIdxVar()),
NAC("988fssync",_FIXME_getFullscreenSyncModeIdxVar()),
AC(ismaximized),
AC(maxconbskip),
@ -279,7 +279,10 @@ static CFGSTRUCT fceuconfig[] =
AC(debuggerSaveLoadDEBFiles),
AC(debuggerDisplayROMoffsets),
AC(debuggerFontSize),
AC(hexeditorFontSize),
AC(debuggerPageSize),
AC(hexeditorFontWidth),
AC(hexeditorFontHeight),
ACS(hexeditorFontName),
AC(fullSaveStateLoads),
AC(frameSkipAmt),
AC(fps_scale_frameadvance),

View File

@ -1,3 +1,7 @@
// FIXME for Windows, make use of Config class the way linux version does
// old config registers variables by placing their addresses into static array, which makes
// many modules expose their internal vars and pollute globals; there is also no way to know when a
// setting was changed by it, which spawns auxillary functions intended to push new values through
void SaveConfig(const char *filename);
void LoadConfig(const char *filename);

View File

@ -41,12 +41,10 @@
#include "debuggersp.h"
extern Name* lastBankNames;
extern Name* loadedBankNames;
extern Name* pageNames[32];
extern Name* ramBankNames;
extern bool ramBankNamesLoaded;
extern int lastBank;
extern int loadedBank;
extern int pageNumbersLoaded[32];
extern int myNumWPs;
// ################################## End of SP CODE ###########################
@ -525,8 +523,9 @@ void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr)
if (symbDebugEnabled)
{
replaceNames(ramBankNames, a, &disassembly_operands[i]);
replaceNames(loadedBankNames, a, &disassembly_operands[i]);
replaceNames(lastBankNames, a, &disassembly_operands[i]);
for(int p=0;p<ARRAY_SIZE(pageNames);p++)
if(pageNames[p] != NULL)
replaceNames(pageNames[p], a, &disassembly_operands[i]);
}
// special case: an RTS opcode
@ -2152,7 +2151,8 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
case IDC_DEBUGGER_RELOAD_SYMS:
{
ramBankNamesLoaded = false;
lastBank = loadedBank = -1;
for(int i=0;i<ARRAYSIZE(pageNumbersLoaded);i++)
pageNumbersLoaded[i] = -1;
loadNameFiles();
UpdateDebugger(false);
break;
@ -2307,7 +2307,9 @@ void DoDebug(uint8 halt)
//-----------------------------------------
DebugSystem* debugSystem;
unsigned int debuggerFontSize = 15;
unsigned int hexeditorFontSize = 15;
unsigned int hexeditorFontHeight = 15;
unsigned int hexeditorFontWidth = 7;
char* hexeditorFontName = 0;
DebugSystem::DebugSystem()
{
@ -2322,12 +2324,20 @@ void DebugSystem::init()
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Courier New"); /*font name*/
hHexeditorFont = CreateFont(hexeditorFontSize, hexeditorFontSize / 2, /*Height,Width*/
//if the user provided his own courier font, use that
extern std::string BaseDirectory;
std::string courefon_path = BaseDirectory + "\\coure.fon";
AddFontResourceEx(courefon_path.c_str(), FR_PRIVATE, NULL);
char* hexfn = hexeditorFontName;
if(!hexfn) hexfn = "Courier";
hHexeditorFont = CreateFont(hexeditorFontHeight, hexeditorFontWidth, /*Height,Width*/
0,0, /*escapement,orientation*/
FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Courier"); /*font name*/
hexfn); /*font name*/
HDC hdc = GetDC(GetDesktopWindow());
HGDIOBJ old = SelectObject(hdc,hFixedFont);

View File

@ -22,8 +22,11 @@ extern bool debuggerAutoload;
extern bool debuggerSaveLoadDEBFiles;
extern bool debuggerDisplayROMoffsets;
extern unsigned int debuggerPageSize;
extern unsigned int debuggerFontSize;
extern unsigned int hexeditorFontSize;
extern unsigned int hexeditorFontWidth;
extern unsigned int hexeditorFontHeight;
extern char* hexeditorFontName;
void CenterWindow(HWND hwndDlg);
void DoPatcher(int address,HWND hParent);

View File

@ -32,12 +32,25 @@
int GetNesFileAddress(int A);
Name* lastBankNames = 0;
Name* loadedBankNames = 0;
inline int RomPageIndexForAddress(int addr) { return (addr-0x8000)>>(debuggerPageSize); }
//old
//Name* lastBankNames = 0;
//Name* loadedBankNames = 0;
//new
Name* pageNames[32] = {0}; //the maximum number of pages we could have is 32, based on 1KB debuggerPageSize
//old
//int lastBank = -1;
//int loadedBank = -1;
//new
int pageNumbersLoaded[32]; //TODO - need to initialize these to -1 somehow
Name* ramBankNames = 0;
bool ramBankNamesLoaded = false;
int lastBank = -1;
int loadedBank = -1;
extern char LoadedRomFName[2048];
char NLfilename[2048];
bool symbDebugEnabled = true;
@ -547,29 +560,24 @@ char* generateNLFilenameForAddress(uint16 address)
}
Name* getNamesPointerForAddress(uint16 address)
{
// this function is called very often (when using "Symbolic trace"), so this is sorted by frequency
if (address >= 0xC000)
if(address >= 0x8000)
{
return lastBankNames;
} else if (address >= 0x8000)
{
return loadedBankNames;
} else
return pageNames[RomPageIndexForAddress(address)];
}
else
{
return ramBankNames;
}
}
void setNamesPointerForAddress(uint16 address, Name* newNode)
{
if (address < 0x8000)
if (address >= 0x8000)
{
pageNames[RomPageIndexForAddress(address)] = newNode;
}
else
{
ramBankNames = newNode;
} else if (address < 0xC000)
{
loadedBankNames = newNode;
} else
{
lastBankNames = newNode;
}
}
@ -592,44 +600,32 @@ void loadNameFiles()
ramBankNames = parseNameFile(generateNLFilenameForAddress(0x0000));
}
// Find out which bank is loaded at 0xC000
cb = getBank(0xC000);
if (cb == -1) // No bank was loaded at that offset
int nPages = 1<<(15-debuggerPageSize);
for(int i=0;i<nPages;i++)
{
free(lastBankNames);
lastBankNames = 0;
} else if (cb != lastBank)
{
// If the bank changed since loading the NL files the last time it's necessary
// to load the address descriptions of the new bank.
lastBank = cb;
int pageIndexAddress = 0x8000 + (1<<debuggerPageSize)*i;
if (lastBankNames)
freeList(lastBankNames);
// Find out which bank is loaded at the page index
cb = getBank(pageIndexAddress);
if (cb == -1) // No bank was loaded at that offset
{
free(pageNames[i]);
pageNames[i] = 0;
}
else if (cb != pageNumbersLoaded[i])
{
// If the bank changed since loading the NL files the last time it's necessary
// to load the address descriptions of the new bank.
pageNumbersLoaded[i] = cb;
// Load new address definitions
lastBankNames = parseNameFile(generateNLFilenameForAddress(0xC000));
}
if (pageNames[i])
freeList(pageNames[i]);
// Find out which bank is loaded at 0x8000
cb = getBank(0x8000);
if (cb == -1) // No bank is loaded at that offset
{
free(loadedBankNames);
loadedBankNames = 0;
} else if (cb != loadedBank)
{
// If the bank changed since loading the NL files the last time it's necessary
// to load the address descriptions of the new bank.
loadedBank = cb;
if (loadedBankNames)
freeList(loadedBankNames);
// Load new address definitions
loadedBankNames = parseNameFile(generateNLFilenameForAddress(0x8000));
}
// Load new address definitions
pageNames[i] = parseNameFile(generateNLFilenameForAddress(pageIndexAddress));
}
} //loop across pages
}
// bookmarks

View File

@ -1,22 +1,22 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
// For commctrl.h below
#define _WIN32_IE 0x0550
@ -28,6 +28,7 @@
#include <windows.h>
#include <commctrl.h>
#include "video.h"
#include "input.h"
#include "keyboard.h"
#include "joystick.h"
@ -42,9 +43,8 @@ LPDIRECTINPUT7 lpDI=0;
void InitInputPorts(bool fourscore);
int tempwinsync = 0; //Temp variable used by turbo to turn of sync settings
VSYNCMODE tempwinsync = SYNCMODE_NONE; //Temp variable used by turbo to turn of sync settings
int tempsoundquality = 0; //Temp variable used by turbo to turn of sound quality settings
extern int winsync;
extern int soundquality;
extern bool replaceP2StartWithMicrophone;
//UsrInputType[] is user-specified. InputType[] is current
@ -376,7 +376,7 @@ static uint32 UpdatePPadData(int w)
static uint8 fkbkeys[0x48];
static uint8 suborkbkeys[0x60];
static uint8 suborkbkeys[0x65];
void KeyboardUpdateState(void); //mbg merge 7/17/06 yech had to add this
@ -421,6 +421,7 @@ void FCEUD_UpdateInput()
if(cidisabled)
UpdateFKB();
break;
case SIFC_PEC586KB:
case SIFC_SUBORKB:
if(cidisabled)
UpdateSuborKB();
@ -510,6 +511,7 @@ void InitInputPorts(bool fourscore)
case SIFC_FKB:
InputDPtr=fkbkeys;
break;
case SIFC_PEC586KB:
case SIFC_SUBORKB:
InputDPtr=suborkbkeys;
break;
@ -554,7 +556,7 @@ ButtConfig fkbmap[0x48]=
MK(BL_CURSORUP),MK(BL_CURSORLEFT),MK(BL_CURSORRIGHT),MK(BL_CURSORDOWN)
};
ButtConfig suborkbmap[0x60]=
ButtConfig suborkbmap[0x65]=
{
MC(0x01),MC(0x3b),MC(0x3c),MC(0x3d),MC(0x3e),MC(0x3f),MC(0x40),MC(0x41),MC(0x42),MC(0x43),
MC(0x44),MC(0x57),MC(0x58),MC(0x45),MC(0x29),MC(0x02),MC(0x03),MC(0x04),MC(0x05),MC(0x06),
@ -565,7 +567,8 @@ ButtConfig suborkbmap[0x60]=
MC(0x21),MC(0x22),MC(0x23),MC(0x24),MC(0x25),MC(0x26),MC(0x27),MC(0x28),MC(0x4b),MC(0x4c),
MC(0x4d),MC(0x2a),MC(0x2c),MC(0x2d),MC(0x2e),MC(0x2f),MC(0x30),MC(0x31),MC(0x32),MC(0x33),
MC(0x34),MC(0x35),MC(0x2b),MC(0xc8),MC(0x4f),MC(0x50),MC(0x51),MC(0x1d),MC(0x38),MC(0x39),
MC(0xcb),MC(0xd0),MC(0xcd),MC(0x52),MC(0x53)
MC(0xcb),MC(0xd0),MC(0xcd),MC(0x52),MC(0x53),MC(0x00),MC(0x00),MC(0x00),MC(0x00),MC(0x00),
MC(0x00),
};
@ -573,7 +576,7 @@ static void UpdateFKB(void)
{
int x;
for(x=0;x<0x48;x++)
for(x=0;x<sizeof(fkbkeys);x++)
{
fkbkeys[x]=0;
@ -586,7 +589,7 @@ static void UpdateSuborKB(void)
{
int x;
for(x=0;x<0x60;x++)
for(x=0;x<sizeof(suborkbkeys);x++)
{
suborkbkeys[x]=0;
@ -718,9 +721,9 @@ void InitInputStuff(void)
for(y=0; y<12; y++)
JoyClearBC(&powerpadsc[x][y]);
for(x=0; x<0x48; x++)
for(x=0; x<sizeof(fkbkeys); x++)
JoyClearBC(&fkbmap[x]);
for(x=0; x<0x60; x++)
for(x=0; x<sizeof(suborkbkeys); x++)
JoyClearBC(&suborkbmap[x]);
for(x=0; x<6; x++)
@ -1062,7 +1065,7 @@ const unsigned int NUMBER_OF_NES_DEVICES = SI_COUNT + 1;
const static unsigned int NUMBER_OF_FAMICOM_DEVICES = SIFC_COUNT + 1;
//these are unfortunate lists. they match the ESI and ESIFC enums
static const int configurable_nes[NUMBER_OF_NES_DEVICES]= { 0, 1, 0, 1, 1, 0 };
static const int configurable_fam[NUMBER_OF_FAMICOM_DEVICES]= { 0,0,0,0, 1,1,0,1, 1,1,1,0, 0,0 };
static const int configurable_fam[NUMBER_OF_FAMICOM_DEVICES]= { 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0 };
const unsigned int FAMICOM_POSITION = 2;
static void UpdateComboPad(HWND hwndDlg, WORD id)
@ -1336,10 +1339,11 @@ BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
DoTBConfig(hwndDlg, text, "POWERPADDIALOG", FTrainerButtons, 12);
break;
case SIFC_FKB:
DoTBConfig(hwndDlg, text, "FKBDIALOG", fkbmap, 0x48);
DoTBConfig(hwndDlg, text, "FKBDIALOG", fkbmap, sizeof(fkbkeys));
break;
case SIFC_PEC586KB:
case SIFC_SUBORKB:
DoTBConfig(hwndDlg, text, "SUBORKBDIALOG", suborkbmap, 0x60);
DoTBConfig(hwndDlg, text, "SUBORKBDIALOG", suborkbmap, sizeof(suborkbkeys));
break;
case SIFC_MAHJONG:
DoTBConfig(hwndDlg, text, "MAHJONGDIALOG", MahjongButtons, 21);
@ -1571,8 +1575,8 @@ int FCEUD_TestCommandState(int c)
void FCEUD_TurboOn (void)
{
tempwinsync = winsync; //Store winsync setting
winsync = 0; //turn off winsync for turbo (so that turbo can function even with VBlank sync methods
tempwinsync = GetWindowedSyncModeIdx(); //Store wndSyncMode setting
SetWindowedSyncModeIdx(SYNCMODE_NONE); //turn off wndSyncMode for turbo (so that turbo can function even with VBlank sync methods
tempsoundquality = soundquality; //Store sound quality settings
FCEUI_SetSoundQuality(0); //Turn sound quality to low
turbo = true;
@ -1580,7 +1584,7 @@ void FCEUD_TurboOn (void)
}
void FCEUD_TurboOff (void)
{
winsync = tempwinsync; //Restore winsync setting
SetWindowedSyncModeIdx(tempwinsync); //Restore wndSyncMode setting
soundquality = tempsoundquality; //Restore sound quality settings
FCEUI_SetSoundQuality(soundquality);
turbo = false;
@ -1589,15 +1593,15 @@ void FCEUD_TurboOff (void)
void FCEUD_TurboToggle(void)
{
if (turbo) {
winsync = tempwinsync; //If turbo was on, restore winsync
SetWindowedSyncModeIdx(tempwinsync); //If turbo was on, restore wndSyncMode
soundquality = tempsoundquality; //and restore sound quality setting
FCEUI_SetSoundQuality(soundquality);
}
else
{
tempwinsync = winsync; //Store video sync settings
tempwinsync = GetWindowedSyncModeIdx(); //Store video sync settings
tempsoundquality = soundquality; //Store sound quality settings
winsync = 0; //If turbo was off, turn off winsync (so that turbo can function even with VBlank sync methods
SetWindowedSyncModeIdx(SYNCMODE_NONE); //If turbo was off, turn off wndSyncMode (so that turbo can function even with VBlank sync methods
FCEUI_SetSoundQuality(0); //Set sound quality to low
}

View File

@ -19,7 +19,7 @@ int InitDInput(void);
void CreateInputStuff(void);
void InitInputStuff(void);
void DestroyInput(void);
void InputScreenChanged(int fs);
void InputScreenChanged(int fs); // FIXME defined nowhere used nowhere
void SetAutoFireDesynch(int DesynchOn);
int GetAutoFireDesynch();
uint32 GetGamepadPressedImmediate();

View File

@ -43,6 +43,7 @@
#include "../../movie.h"
#include "../../fceulua.h"
#include "window.h"
#include "archive.h"
#include "input.h"
#include "netplay.h"
@ -109,7 +110,6 @@ extern bool taseditorEnableAcceleratorKeys;
// External functions
extern std::string cfgFile; //Contains the filename of the config file used.
extern bool turbo; //Is game in turbo mode?
void ResetVideo(void);
void ShowCursorAbs(int w);
void HideFWindow(int h);
void FixWXY(int pref, bool shift_held);
@ -167,15 +167,12 @@ int ffbskip = 32; //Blit skips per blit when FF-ing
HINSTANCE fceu_hInstance;
HACCEL fceu_hAccel;
HRESULT ddrval;
static char TempArray[2048];
static int exiting = 0;
static volatile int moocow = 0;
int windowedfailed = 0;
int fullscreen = 0; //Windows files only, variable that keeps track of fullscreen status
static volatile int _userpause = 0; //mbg merge 7/18/06 changed tasbuild was using this only in a couple of places
@ -390,12 +387,12 @@ void FCEUD_PrintError(const char *errormsg)
{
AddLogText(errormsg, 1);
if (fullscreen && (eoptions & EO_HIDEMOUSE))
if (GetIsFullscreen() && (eoptions & EO_HIDEMOUSE))
ShowCursorAbs(1);
MessageBox(0, errormsg, FCEU_NAME" Error", MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
if (fullscreen && (eoptions & EO_HIDEMOUSE))
if (GetIsFullscreen() && (eoptions & EO_HIDEMOUSE))
ShowCursorAbs(0);
}
@ -491,7 +488,7 @@ int DriverInitialize()
if(soundo)
soundo = InitSound();
SetVideoMode(fullscreen);
InitVideoDriver();
InitInputStuff(); /* Initialize DInput interfaces. */
return 1;
@ -506,7 +503,7 @@ static void DriverKill(void)
DestroyInput();
ResetVideo();
ShutdownVideoDriver();
if(soundo)
{
@ -649,7 +646,6 @@ int main(int argc,char *argv[])
{
FCEUI_SetGameGenie(genie!=0);
fullscreen = !!fullscreen;
soundo = !!soundo;
frame_display = !!frame_display;
allowUDLR = !!allowUDLR;
@ -687,7 +683,7 @@ int main(int argc,char *argv[])
if(!t)
{
fullscreen=0;
SetIsFullscreen(false);
}
CreateMainWindow();
@ -919,8 +915,10 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count)
}
//blit the framebuffer
if(XBuf)
if(XBuf) {
xbsave = XBuf;
FCEUD_BlitScreen(XBuf);
}
//update debugging displays
_updateWindow();

View File

@ -34,7 +34,6 @@ extern int maxconbskip;
extern int ffbskip;
extern void LoadNewGamey(HWND hParent, const char *initialdir);
extern void CloseGame();
extern int fullscreen; //Windows files only, keeps track of fullscreen status
// Flag that indicates whether Game Genie is enabled or not.
extern int genie;
@ -55,8 +54,6 @@ extern int AFon;
extern int AFoff;
extern int AutoFireOffset;
extern int vmod;
extern char* directory_names[14];
char *GetRomName(); //Checks if rom is loaded, if so, outputs the Rom name with no directory path or file extension
@ -123,13 +120,13 @@ extern int soundo;
extern int eoptions;
extern int soundoptions;
extern uint8 *xbsave;
extern HRESULT ddrval;
extern int windowedfailed;
extern uint32 goptions;
void DoFCEUExit();
void ShowAboutBox();
int BlockingCheck();
void UpdateRendBounds(void);
void DoPriority();
void RemoveDirs();
void CreateDirs();

View File

@ -12,7 +12,7 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Íåéòðàëüíûé resources
// Neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
@ -950,6 +950,117 @@ BEGIN
LTEXT "",ID_SOUND_QUALITYNOTIFY,170,133,144,8
END
SUBORKBDIALOG DIALOGEX 13, 72, 478, 171
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Subor Keyboard Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Close",1,405,151,56,14
LTEXT "Remember to push the ""Scroll Lock"" key during emulation to enable Keyboard input.",-1,18,6,370,12
GROUPBOX "",-1,9,22,461,123,WS_GROUP
PUSHBUTTON "Esc",300,20,36,16,12
PUSHBUTTON "F1",301,58,37,16,12
PUSHBUTTON "F2",302,78,37,16,12
PUSHBUTTON "F3",303,98,37,16,12
PUSHBUTTON "F4",304,118,37,16,12
PUSHBUTTON "F5",305,143,37,16,12
PUSHBUTTON "F6",306,163,37,16,12
PUSHBUTTON "F7",307,183,37,16,12
PUSHBUTTON "F8",308,203,37,16,12
PUSHBUTTON "F9",309,229,37,16,12
PUSHBUTTON "F10",310,249,37,16,12
PUSHBUTTON "F11",311,268,37,16,12
PUSHBUTTON "F12",312,288,37,16,12
PUSHBUTTON "Pause",313,318,36,16,12
PUSHBUTTON "`",314,20,60,16,12
PUSHBUTTON "1",315,39,60,16,12
PUSHBUTTON "2",316,58,60,16,12
PUSHBUTTON "3",317,77,60,16,12
PUSHBUTTON "4",318,96,60,16,12
PUSHBUTTON "5",319,115,60,16,12
PUSHBUTTON "6",320,134,60,16,12
PUSHBUTTON "7",321,153,60,16,12
PUSHBUTTON "8",322,172,60,16,12
PUSHBUTTON "9",323,191,60,16,12
PUSHBUTTON "0",324,210,60,16,12
PUSHBUTTON "-",325,229,60,16,12
PUSHBUTTON "=",326,248,60,16,12
PUSHBUTTON "BS",327,286,60,16,12
PUSHBUTTON "Ins",328,318,59,16,12
PUSHBUTTON "Home",329,337,59,16,12
PUSHBUTTON "NL",330,385,59,16,12
PUSHBUTTON "/",331,405,59,16,12
PUSHBUTTON "*",332,425,59,16,12
PUSHBUTTON "-",333,444,59,16,12
PUSHBUTTON "PUp",334,357,59,16,12
PUSHBUTTON "TAB",335,20,76,24,12
PUSHBUTTON "Q",336,47,76,16,12
PUSHBUTTON "W",337,66,76,16,12
PUSHBUTTON "E",338,85,76,16,12
PUSHBUTTON "R",339,104,76,16,12
PUSHBUTTON "T",340,123,76,16,12
PUSHBUTTON "Y",341,142,76,16,12
PUSHBUTTON "U",342,161,76,16,12
PUSHBUTTON "I",343,180,76,16,12
PUSHBUTTON "O",344,199,76,16,12
PUSHBUTTON "P",345,218,76,16,12
PUSHBUTTON "[",346,237,76,16,12
PUSHBUTTON "]",347,256,76,16,12
PUSHBUTTON "Enter",348,274,76,28,29
PUSHBUTTON "Del",349,318,75,16,12
PUSHBUTTON "End",350,338,75,16,12
PUSHBUTTON "PDn",351,357,75,16,12
PUSHBUTTON "7",352,385,75,16,12
PUSHBUTTON "8",353,405,75,16,12
PUSHBUTTON "9",354,425,75,16,12
PUSHBUTTON "+",355,444,75,16,28
PUSHBUTTON "CL",356,20,92,27,12
PUSHBUTTON "A",357,52,92,16,12
PUSHBUTTON "S",358,71,92,16,12
PUSHBUTTON "D",359,90,92,16,12
PUSHBUTTON "F",360,109,92,16,12
PUSHBUTTON "G",361,128,92,16,12
PUSHBUTTON "H",362,147,92,16,12
PUSHBUTTON "J",363,166,92,16,12
PUSHBUTTON "K",364,185,92,16,12
PUSHBUTTON "L",365,204,92,16,12
PUSHBUTTON ";",366,223,92,16,12
PUSHBUTTON "'",367,242,92,16,12
PUSHBUTTON "4",368,385,91,16,12
PUSHBUTTON "5",369,405,91,16,12
PUSHBUTTON "6",370,425,91,16,12
PUSHBUTTON "SHIFT",371,20,108,37,12
PUSHBUTTON "Z",372,62,108,16,12
PUSHBUTTON "X",373,81,108,16,12
PUSHBUTTON "C",374,100,108,16,12
PUSHBUTTON "V",375,119,108,16,12
PUSHBUTTON "B",376,138,108,16,12
PUSHBUTTON "N",377,157,108,16,12
PUSHBUTTON "M",378,176,108,16,12
PUSHBUTTON ",",379,195,108,16,12
PUSHBUTTON ".",380,214,108,16,12
PUSHBUTTON "/",381,233,108,16,12
PUSHBUTTON "\\",382,267,60,16,12
PUSHBUTTON "Up",383,337,108,16,12
PUSHBUTTON "1",384,385,107,16,12
PUSHBUTTON "2",385,405,107,16,12
PUSHBUTTON "3",386,425,107,16,12
PUSHBUTTON "CTRL",387,20,123,28,12
PUSHBUTTON "ALT",388,66,123,27,12
PUSHBUTTON "SPACE",389,96,123,130,12
PUSHBUTTON "Left",390,318,123,16,12
PUSHBUTTON "Dn",391,337,123,16,12
PUSHBUTTON "Right",392,357,123,16,12
PUSHBUTTON "0",393,386,123,35,12
PUSHBUTTON ".",394,425,123,16,12
PUSHBUTTON "SHIFT",395,254,108,48,12
PUSHBUTTON "ALT",396,229,123,29,12
PUSHBUTTON "CTRL",397,274,123,28,12
PUSHBUTTON "Break",398,337,36,16,12
PUSHBUTTON "Reset",399,357,36,16,12
PUSHBUTTON "Enter",400,444,107,16,28
END
TIMINGCONFIG DIALOGEX 23, 157, 203, 60
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Timing Configuration"
@ -1986,6 +2097,10 @@ BEGIN
BOTTOMMARGIN, 274
END
"SUBORKBDIALOG", DIALOG
BEGIN
END
"TIMINGCONFIG", DIALOG
BEGIN
LEFTMARGIN, 10
@ -2152,12 +2267,12 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
#endif // Íåéòðàëüíûé resources
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Ðóññêèé (Ðîññèÿ) resources
// Russian (Russia) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
@ -2232,12 +2347,12 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
#endif // Ðóññêèé (Ðîññèÿ) resources
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Àíãëèéñêèé (ÑØÀ) resources
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@ -2471,7 +2586,7 @@ IDB_BITMAP_SELECTED17 BITMAP "res\\te_17_selected.bmp"
IDB_BITMAP_SELECTED18 BITMAP "res\\te_18_selected.bmp"
IDB_BITMAP_SELECTED19 BITMAP "res\\te_19_selected.bmp"
IDB_BRANCH_SPRITESHEET BITMAP "res\\branch_spritesheet.bmp"
#endif // Àíãëèéñêèé (ÑØÀ) resources
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -22,6 +22,7 @@ Main - Main gate between emulator and Taseditor
#include "main.h" // for GetRomName
#include "taseditor.h"
#include "window.h"
#include "video.h"
#include "../../input.h"
#include "../keyboard.h"
#include "../joystick.h"
@ -56,7 +57,6 @@ extern int joysticksPerFrame[INPUT_TYPES_TOTAL];
extern bool turbo;
extern int pal_emulation;
extern int newppu;
extern void PushCurrentVideoSettings();
extern void RefreshThrottleFPS();
extern bool LoadFM2(MovieData& movieData, EMUFILE* fp, int size, bool stopAfterHeader);
// temporarily saved FCEUX config
@ -883,7 +883,6 @@ void applyMovieInputConfig()
pal_emulation = currMovieData.palFlag;
FCEUI_SetVidSystem(pal_emulation);
RefreshThrottleFPS();
PushCurrentVideoSettings();
// update PPU type
newppu = currMovieData.PPUflag;
SetMainWindowText();

View File

@ -19,6 +19,8 @@ Popup display - Manager of popup windows
#include "taseditor_project.h"
#include "zlib.h"
#include "drivers/win/video.h"
extern TASEDITOR_CONFIG taseditorConfig;
extern TASEDITOR_WINDOW taseditorWindow;
extern BOOKMARKS bookmarks;
@ -91,7 +93,7 @@ void POPUP_DISPLAY::init()
{
free();
// fill scr_bmp palette with current palette colors
extern PALETTEENTRY *color_palette;
PALETTEENTRY* color_palette = GetPalette();
for (int i = 0; i < 256; ++i)
{
screenshotBmi->bmiColors[i].rgbRed = color_palette[i].peRed;

View File

@ -46,7 +46,6 @@
char *textToTrans; // buffer to hold the text that needs translating
char *transText; //holds the translated text
extern void FCEUD_BlitScreen(uint8 *XBuf); //needed for pause, not sure where this is defined...
//adelikat merge 7/1/08 - had to add these extern variables
//------------------------------
extern uint8 PALRAM[0x20];

View File

@ -48,8 +48,8 @@ using namespace std;
#include "debuggersp.h"
extern Name* lastBankNames;
extern Name* loadedBankNames;
extern Name* pageNames[32];
extern int pageNumbersLoaded[32];
extern Name* ramBankNames;
// ################################## End of SP CODE ###########################
@ -840,8 +840,8 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
}
replaceNames(ramBankNames, a, &tempAddressesLog);
replaceNames(loadedBankNames, a, &tempAddressesLog);
replaceNames(lastBankNames, a, &tempAddressesLog);
for(int i=0;i<ARRAY_SIZE(pageNames);i++)
replaceNames(pageNames[i], a, &tempAddressesLog);
}
strncpy(str_disassembly, a, LOG_DISASSEMBLY_MAX_LEN);
str_disassembly[LOG_DISASSEMBLY_MAX_LEN - 1] = 0;

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +1,96 @@
#ifndef WIN_VIDEO_H
#define WIN_VIDEO_H
#include "common.h"
#include <Windows.h>
#include "types.h"
// I like hacks.
#define uint8 __UNO492032
#include <winsock.h>
#include "ddraw.h"
#undef LPCWAVEFORMATEX
#include "dsound.h"
#include "dinput.h"
#include <commctrl.h>
#include <shlobj.h> // For directories configuration dialog.
#undef uint8
#include "main.h"
#include "window.h"
enum DIRECTDRAW_MODES
typedef enum
{
DIRECTDRAW_MODE_SOFTWARE,
DIRECTDRAW_MODE_SURFACE_IN_RAM,
DIRECTDRAW_MODE_FULL,
DIRECTDRAW_MODE_SOFTWARE = 0, // all features are emulated in software
DIRECTDRAW_MODE_SURFACE_IN_RAM, // place offscreen surface in RAM rather than in VRAM; may or may not use hardware acceleration
DIRECTDRAW_MODE_FULL, // use available hardware features, emulate the rest
// ...
DIRECTDRAW_MODES_TOTAL
};
} DIRECTDRAW_MODE;
#define VF_DDSTRETCHED 1
#define VIDEOMODEFLAG_DXBLT 1
#define VIDEOMODEFLAG_STRFS 2
#define VEF_LOSTSURFACE 1
#define VEF____INTERNAL 2
#define VMDF_DXBLT 1
#define VMDF_STRFS 2
typedef enum
{
FILTER_NONE = 0,
FILTER_HQ2X,
FILTER_SCALE2X,
FILTER_NTSC2X,
FILTER_HQ3X,
FILTER_SCALE3X
} VFILTER;
typedef struct {
int x;
int y;
int width;
int height;
int bpp;
int flags;
int xscale;
int yscale;
RECT srect;
RECT drect;
int special;
} vmdef;
RECT srcRect;
RECT dstRect;
VFILTER filter;
} VideoMode;
// left, top, right, bottom
extern vmdef vmodes[11];
extern int winspecial;
extern int NTSCwinspecial;
typedef enum {
SYNCMODE_NONE = 0,
SYNCMODE_WAIT,
SYNCMODE_LAZYWAIT,
SYNCMODE_DOUBLEBUF
} VSYNCMODE;
extern int directDrawModeWindowed;
extern int directDrawModeFullscreen;
void InitVideoDriver(void);
void ShutdownVideoDriver();
extern int fssync;
extern int winsync;
// Recalculate blit rectangle within window of given size
void OnWindowSizeChange(int width, int height);
void SetFSVideoMode();
void FCEUD_BlitScreen(uint8 *XBuf);
void ConfigVideo();
void recalculateBestFitRect(int width, int height);
int SetVideoMode(int fs);
// Get current blit rectangle
RECT GetActiveRect(void);
// Get driver palette
PALETTEENTRY* GetPalette(void);
// Returns true when in fullscreen mode, false when in windowed
bool GetIsFullscreen(void);
// Set fullscreen mode flag
// FCEUD_VideoChanged() must be called in order to make value take effect
void SetIsFullscreen(bool f);
VSYNCMODE GetWindowedSyncModeIdx(void);
void SetWindowedSyncModeIdx(VSYNCMODE idx);
// Bring up the Video configuration dialog
void ShowConfigVideoDialog();
// (Re)apply render lines and sprite limitation to FCE
void DoVideoConfigFix();
// Implements FCEUD requirements
bool FCEUD_ShouldDrawInputAids(void);
void FCEUD_BlitScreen(uint8 *XBuf);
void ResetVideo();
void SetFSVideoMode();
void PushCurrentVideoSettings();
void ResetCustomMode();
void FCEUD_VideoChanged(void); // this one should be declared here
void FCEUD_SetPalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b);
void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsigned char *b);
// see win/config.h
bool& _FIXME_getFullscreenVar(void);
int& _FIXME_getVModeIdxVar(void);
VSYNCMODE& _FIXME_getFullscreenSyncModeIdxVar(void);
VSYNCMODE& _FIXME_getWindowedSyncModeIdxVar(void);
VFILTER& _FIXME_getFilterModeWindowedIdxVar(void);
int& _FIXME_getFilterOptionVar(void);
DIRECTDRAW_MODE& _FIXME_getDDrawModeWindowedVar(void);
DIRECTDRAW_MODE& _FIXME_getDDrawModeFullscreenVar(void);
VideoMode& _FIXME_getCustomVideoModeVar(void);
#endif

View File

@ -83,8 +83,6 @@ extern PLAYBACK playback;
#include "Win32InputBox.h"
extern int32 fps_scale_unpaused;
//extern void ToggleFullscreen();
using namespace std;
//----Context Menu - Some dynamically added menu items
@ -995,7 +993,7 @@ void HideFWindow(int h)
//Toggles the display status of the main menu.
void ToggleHideMenu(void)
{
if(!fullscreen && !nofocus && (GameInfo || tog))
if(!GetIsFullscreen() && !nofocus && (GameInfo || tog))
{
tog ^= 1;
HideMenu(tog);
@ -1034,7 +1032,7 @@ bool ALoad(const char *nameo, char* innerFilename, bool silent)
UpdateCheckedMenuItems();
PushCurrentVideoSettings();
FCEUD_VideoChanged();
std::string recentFileName = nameo;
if(GameInfo->archiveFilename && GameInfo->archiveCount>1)
@ -1053,7 +1051,10 @@ bool ALoad(const char *nameo, char* innerFilename, bool silent)
if(eoptions & EO_FSAFTERLOAD)
{
SetFSVideoMode();
changerecursive=1;
SetIsFullscreen(true);
FCEUD_VideoChanged();
changerecursive=0;
}
@ -1119,7 +1120,7 @@ void LoadNewGamey(HWND hParent, const char *initialdir)
void GetMouseData(uint32 (&md)[3])
{
extern RECT bestfitRect;
RECT bestfitRect = GetActiveRect();
double screen_width = VNSWID;
double screen_height = FSettings.TotalScanlines();
@ -1271,8 +1272,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
if (fullscreenByDoubleclick)
{
extern void ToggleFullscreen();
ToggleFullscreen();
changerecursive=1;
SetIsFullscreen(!GetIsFullscreen());
FCEUD_VideoChanged();
changerecursive=0;
return 0;
} else
{
@ -1379,7 +1382,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco;
case WM_SIZE:
if (!fullscreen && !changerecursive && !windowedfailed)
if (!GetIsFullscreen() && !changerecursive && !windowedfailed)
{
switch(wParam)
{
@ -1439,7 +1442,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
//break;
goto proco;
case WM_DISPLAYCHANGE:
if(!fullscreen && !changerecursive)
if(!GetIsFullscreen() && !changerecursive)
vchanged=1;
goto proco;
case WM_DROPFILES:
@ -1970,7 +1973,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
FCEUI_SetVidSystem(pal_emulation);
RefreshThrottleFPS();
UpdateCheckedMenuItems();
PushCurrentVideoSettings();
FCEUD_VideoChanged();
break;
case MENU_DIRECTORIES:
ConfigDirectories();
@ -1994,7 +1997,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
ConfigTiming();
break;
case MENU_VIDEO:
ConfigVideo();
ShowConfigVideoDialog();
break;
case MENU_HOTKEYS:
MapInput();
@ -2290,16 +2293,16 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
if(wParam==SC_KEYMENU)
{
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB)) && cidisabled)
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB) || (InputType[2]==SIFC_PEC586KB)) && cidisabled)
break;
if(lParam == VK_RETURN || fullscreen || tog) break;
if(lParam == VK_RETURN || GetIsFullscreen() || tog) break;
}
goto proco;
case WM_SYSKEYDOWN:
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB)) && cidisabled)
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB) || (InputType[2]==SIFC_PEC586KB)) && cidisabled)
break; // Hopefully this won't break DInput...
if(fullscreen || tog)
if(GetIsFullscreen() || tog)
{
if(wParam==VK_MENU)
break;
@ -2328,26 +2331,16 @@ adelikat: Outsourced this to a remappable hotkey
if(GameInfo)
{
//Only disable command keys if a game is loaded(and the other conditions are right, of course).
if(InputType[2]==SIFC_FKB)
if((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB) || (InputType[2]==SIFC_PEC586KB))
{
if(wParam==VK_SCROLL)
{
cidisabled^=1;
FCEUI_DispMessage("Family Keyboard %sabled.",0,cidisabled?"en":"dis");
FCEUI_DispMessage("%s Keyboard %sabled.",0,InputType[2]==SIFC_FKB?"Family":(InputType[2]==SIFC_SUBORKB?"Subor":"PEC586"),cidisabled?"en":"dis");
}
if(cidisabled)
break; // Hopefully this won't break DInput...
}
if(InputType[2]==SIFC_SUBORKB)
{
if(wParam==VK_SCROLL)
{
cidisabled^=1;
FCEUI_DispMessage("Subor Keyboard %sabled.",0,cidisabled?"en":"dis");
}
if(cidisabled)
break;
}
}
goto proco;
@ -2472,9 +2465,10 @@ void FixWXY(int pref, bool shift_held)
void UpdateFCEUWindow(void)
{
if(vchanged && !fullscreen && !changerecursive && !nofocus)
if(vchanged && !GetIsFullscreen() && !changerecursive && !nofocus)
{
SetVideoMode(0);
SetIsFullscreen(false);
FCEUD_VideoChanged();
vchanged = 0;
}
@ -2615,11 +2609,13 @@ void SetMainWindowStuff()
ShowWindow(hAppWnd, SW_SHOWNORMAL);
}
if (eoptions & EO_BESTFIT && !windowedfailed)
// removed check for EO_BESTFIT flag
// OnWindowSizeChange() now is a general purpose window resize handler on video driver side
if (!windowedfailed)
{
RECT client_recr;
GetClientRect(hAppWnd, &client_recr);
recalculateBestFitRect(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
OnWindowSizeChange(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
}
}
@ -2987,6 +2983,10 @@ void UpdateMenuHotkeys()
ChangeMenuItemText(MENU_CDLOGGER, combined);
}
bool GetIsFullscreenOnDoubleclick() {
return fullscreenByDoubleclick;
}
//This function is for the context menu item Save Movie As...
//It gets a filename from the user then calls CreateMovie()
void SaveMovieAs()

View File

@ -40,6 +40,10 @@ void GetMouseData(uint32 (&md)[3]);
//void ChangeMenuItemText(int menuitem, string text);
void UpdateMenuHotkeys();
// Returns true if fullscreen via double click is enabled
// TODO: replace fullscreenByDoubleclick references with a call to this
bool GetIsFullscreenOnDoubleclick(void);
template<int BUFSIZE>
inline std::string GetDlgItemText(HWND hDlg, int nIDDlgItem) {
char buf[BUFSIZE];

View File

@ -69,14 +69,15 @@ enum ESIFC
SIFC_4PLAYER = 3,
SIFC_FKB = 4,
SIFC_SUBORKB = 5,
SIFC_HYPERSHOT = 6,
SIFC_MAHJONG = 7,
SIFC_QUIZKING = 8,
SIFC_FTRAINERA = 9,
SIFC_FTRAINERB = 10,
SIFC_OEKAKIDS = 11,
SIFC_BWORLD = 12,
SIFC_TOPRIDER = 13,
SIFC_PEC586KB = 6,
SIFC_HYPERSHOT = 7,
SIFC_MAHJONG = 8,
SIFC_QUIZKING = 9,
SIFC_FTRAINERA = 10,
SIFC_FTRAINERB = 11,
SIFC_OEKAKIDS = 12,
SIFC_BWORLD = 13,
SIFC_TOPRIDER = 14,
SIFC_COUNT = SIFC_TOPRIDER
};
@ -92,6 +93,7 @@ inline const char* ESIFC_Name(ESIFC esifc)
"4-Player Adapter",
"Family Keyboard",
"Subor Keyboard",
"PEC586 Keyboard",
"HyperShot Pads",
"Mahjong",
"Quiz King Buzzers",

View File

@ -473,7 +473,7 @@ static BMAPPINGLocal bmap[] = {
{"Konami VRC6 Rev. B", 26, Mapper26_Init},
{"CC-21 MI HUN CHE", 27, UNLCC21_Init}, // Former dupe for VRC2/VRC4 mapper, redefined with crc to mihunche boards
{"", 28, Mapper28_Init},
// {"", 29, Mapper29_Init},
{"", 29, Mapper29_Init},
// {"", 30, Mapper30_Init},
// {"", 31, Mapper31_Init},
{"IREM G-101", 32, Mapper32_Init},
@ -972,6 +972,7 @@ static int iNES_Init(int num) {
switch (num) { // FIXME, mapper or game data base with the board parameters and ROM/RAM sizes
case 13: CHRRAMSize = 16 * 1024; break;
case 6:
case 29:
case 96: CHRRAMSize = 32 * 1024; break;
case 176: CHRRAMSize = 128 * 1024; break;
default: CHRRAMSize = 8 * 1024; break;

View File

@ -108,6 +108,7 @@ void Mapper24_Init(CartInfo *);
void Mapper25_Init(CartInfo *);
void Mapper26_Init(CartInfo *);
void Mapper28_Init(CartInfo *);
void Mapper29_Init(CartInfo *);
void Mapper32_Init(CartInfo *);
void Mapper33_Init(CartInfo *);
void Mapper34_Init(CartInfo *);

View File

@ -38,6 +38,7 @@
#ifdef WIN32
#include "drivers/win/main.h"
#include "drivers/win/video.h"
#include "drivers/win/memwatch.h"
#include "drivers/win/cheat.h"
#include "drivers/win/debugger.h"
@ -67,6 +68,7 @@ extern INPUTCFC *FCEU_InitArkanoidFC(void);
extern INPUTCFC *FCEU_InitSpaceShadow(void);
extern INPUTCFC *FCEU_InitFKB(void);
extern INPUTCFC *FCEU_InitSuborKB(void);
extern INPUTCFC *FCEU_InitPEC586KB(void);
extern INPUTCFC *FCEU_InitHS(void);
extern INPUTCFC *FCEU_InitMahjong(void);
extern INPUTCFC *FCEU_InitQuizKing(void);
@ -431,6 +433,9 @@ static void SetInputStuffFC()
case SIFC_SUBORKB:
portFC.driver=FCEU_InitSuborKB();
break;
case SIFC_PEC586KB:
portFC.driver=FCEU_InitPEC586KB();
break;
case SIFC_HYPERSHOT:
portFC.driver=FCEU_InitHS();
break;
@ -1175,15 +1180,13 @@ static void FCEUI_DoExit(void)
void ToggleFullscreen()
{
#ifdef WIN32
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
extern void UpdateCheckedMenuItems();
UpdateCheckedMenuItems();
changerecursive=1;
int oldmode = fullscreen;
if(!SetVideoMode(oldmode ^ 1))
SetVideoMode(oldmode);
changerecursive=1;
SetIsFullscreen(!GetIsFullscreen());
FCEUD_VideoChanged();
changerecursive=0;
#endif
}

View File

@ -21,82 +21,69 @@
#include <string.h>
#include "share.h"
#include "fkb.h"
#define AK2(x,y) ( (FKB_##x) | (FKB_##y <<8) )
#define AK(x) FKB_##x
#define AK(x) FKB_ ## x
static uint8 bufit[0x49];
static uint8 ksmode;
static uint8 ksindex;
static uint16 matrix[9][2][4]=
static uint16 matrix[9][2][4] =
{
{{AK(F8),AK(RETURN),AK(BRACKETLEFT),AK(BRACKETRIGHT)},
{AK(KANA),AK(RIGHTSHIFT),AK(BACKSLASH),AK(STOP)}},
{{AK(F7),AK(AT),AK(COLON),AK(SEMICOLON)},
{AK(UNDERSCORE),AK(SLASH),AK(MINUS),AK(CARET)}},
{{AK(F6),AK(O),AK(L),AK(K)},
{AK(PERIOD),AK(COMMA),AK(P),AK(0)}},
{{AK(F5),AK(I),AK(U),AK(J)},
{AK(M),AK(N),AK(9),AK(8)}},
{{AK(F4),AK(Y),AK(G),AK(H)},
{AK(B),AK(V),AK(7),AK(6)}},
{{AK(F3),AK(T),AK(R),AK(D)},
{AK(F),AK(C),AK(5),AK(4)}},
{{AK(F2),AK(W),AK(S),AK(A)},
{AK(X),AK(Z),AK(E),AK(3)}},
{{AK(F1),AK(ESCAPE),AK(Q),AK(CONTROL)},
{AK(LEFTSHIFT),AK(GRAPH),AK(1),AK(2)}},
{{AK(CLEAR),AK(UP),AK(RIGHT),AK(LEFT)},
{AK(DOWN),AK(SPACE),AK(DELETE),AK(INSERT)}},
{ { AK(F8), AK(RETURN), AK(BRACKETLEFT), AK(BRACKETRIGHT) },
{ AK(KANA), AK(RIGHTSHIFT), AK(BACKSLASH), AK(STOP) } },
{ { AK(F7), AK(AT), AK(COLON), AK(SEMICOLON) },
{ AK(UNDERSCORE), AK(SLASH), AK(MINUS), AK(CARET) } },
{ { AK(F6), AK(O), AK(L), AK(K) },
{ AK(PERIOD), AK(COMMA), AK(P), AK(0) } },
{ { AK(F5), AK(I), AK(U), AK(J) },
{ AK(M), AK(N), AK(9), AK(8) } },
{ { AK(F4), AK(Y), AK(G), AK(H) },
{ AK(B), AK(V), AK(7), AK(6) } },
{ { AK(F3), AK(T), AK(R), AK(D) },
{ AK(F), AK(C), AK(5), AK(4) } },
{ { AK(F2), AK(W), AK(S), AK(A) },
{ AK(X), AK(Z), AK(E), AK(3) } },
{ { AK(F1), AK(ESCAPE), AK(Q), AK(CONTROL) },
{ AK(LEFTSHIFT), AK(GRAPH), AK(1), AK(2) } },
{ { AK(CLEAR), AK(UP), AK(RIGHT), AK(LEFT) },
{ AK(DOWN), AK(SPACE), AK(DELETE), AK(INSERT) } },
};
static void FKB_Write(uint8 v)
{
v>>=1;
if(v&2)
{
if((ksmode&1) && !(v&1))
ksindex=(ksindex+1)%9;
}
ksmode=v;
static void FKB_Write(uint8 v) {
v >>= 1;
if (v & 2) {
if ((ksmode & 1) && !(v & 1))
ksindex = (ksindex + 1) % 9;
}
ksmode = v;
}
static uint8 FKB_Read(int w, uint8 ret)
{
//printf("$%04x, %d, %d\n",w+0x4016,ksindex,ksmode&1);
if(w)
{
int x;
static uint8 FKB_Read(int w, uint8 ret) {
if (w) {
int x;
ret&=~0x1E;
for(x=0;x<4;x++)
if(bufit[ matrix[ksindex][ksmode&1][x]&0xFF ] || bufit[ matrix[ksindex][ksmode&1][x]>>8])
{
ret|=1<<(x+1);
}
ret^=0x1E;
}
return(ret);
ret &= ~0x1E;
for (x = 0; x < 4; x++)
if (bufit[ matrix[ksindex][ksmode & 1][x] & 0xFF ] || bufit[ matrix[ksindex][ksmode & 1][x] >> 8])
ret |= 1 << (x + 1);
ret ^= 0x1E;
}
return(ret);
}
static void FKB_Strobe(void)
{
ksmode=0;
ksindex=0;
//printf("strobe\n");
static void FKB_Strobe(void) {
ksmode = 0;
ksindex = 0;
}
static void FKB_Update(void *data, int arg)
{
memcpy(bufit+1,data,0x48);
static void FKB_Update(void *data, int arg) {
memcpy(bufit + 1, data, sizeof(bufit) - 1);
}
static INPUTCFC FKB={FKB_Read,FKB_Write,FKB_Strobe,FKB_Update,0,0};
static INPUTCFC FKB = { FKB_Read, FKB_Write, FKB_Strobe, FKB_Update, 0, 0 };
INPUTCFC *FCEU_InitFKB(void)
{
memset(bufit,0,sizeof(bufit));
ksmode=ksindex=0;
return(&FKB);
INPUTCFC *FCEU_InitFKB(void) {
memset(bufit, 0, sizeof(bufit));
ksmode = ksindex = 0;
return(&FKB);
}

View File

@ -1,72 +1,72 @@
#define FKB_F1 0x01
#define FKB_F2 0x02
#define FKB_F3 0x03
#define FKB_F4 0x04
#define FKB_F5 0x05
#define FKB_F6 0x06
#define FKB_F7 0x07
#define FKB_F8 0x08
#define FKB_1 0x09
#define FKB_2 0x0A
#define FKB_3 0x0B
#define FKB_4 0x0C
#define FKB_5 0x0D
#define FKB_6 0x0E
#define FKB_7 0x0F
#define FKB_8 0x10
#define FKB_9 0x11
#define FKB_0 0x12
#define FKB_MINUS 0x13
#define FKB_CARET 0x14
#define FKB_BACKSLASH 0x15
#define FKB_STOP 0x16
#define FKB_ESCAPE 0x17
#define FKB_Q 0x18
#define FKB_W 0x19
#define FKB_E 0x1A
#define FKB_R 0x1B
#define FKB_T 0x1C
#define FKB_Y 0x1D
#define FKB_U 0x1E
#define FKB_I 0x1F
#define FKB_O 0x20
#define FKB_P 0x21
#define FKB_AT 0x22
#define FKB_BRACKETLEFT 0x23
#define FKB_RETURN 0x24
#define FKB_CONTROL 0x25
#define FKB_A 0x26
#define FKB_S 0x27
#define FKB_D 0x28
#define FKB_F 0x29
#define FKB_G 0x2A
#define FKB_H 0x2B
#define FKB_J 0x2C
#define FKB_K 0x2D
#define FKB_L 0x2E
#define FKB_SEMICOLON 0x2F
#define FKB_COLON 0x30
#define FKB_BRACKETRIGHT 0x31
#define FKB_KANA 0x32
#define FKB_LEFTSHIFT 0x33
#define FKB_Z 0x34
#define FKB_X 0x35
#define FKB_C 0x36
#define FKB_V 0x37
#define FKB_B 0x38
#define FKB_N 0x39
#define FKB_M 0x3A
#define FKB_COMMA 0x3B
#define FKB_PERIOD 0x3C
#define FKB_SLASH 0x3D
#define FKB_UNDERSCORE 0x3E
#define FKB_RIGHTSHIFT 0x3F
#define FKB_GRAPH 0x40
#define FKB_SPACE 0x41
#define FKB_CLEAR 0x42
#define FKB_INSERT 0x43
#define FKB_DELETE 0x44
#define FKB_UP 0x45
#define FKB_LEFT 0x46
#define FKB_RIGHT 0x47
#define FKB_DOWN 0x48
#define FKB_F1 0x01
#define FKB_F2 0x02
#define FKB_F3 0x03
#define FKB_F4 0x04
#define FKB_F5 0x05
#define FKB_F6 0x06
#define FKB_F7 0x07
#define FKB_F8 0x08
#define FKB_1 0x09
#define FKB_2 0x0A
#define FKB_3 0x0B
#define FKB_4 0x0C
#define FKB_5 0x0D
#define FKB_6 0x0E
#define FKB_7 0x0F
#define FKB_8 0x10
#define FKB_9 0x11
#define FKB_0 0x12
#define FKB_MINUS 0x13
#define FKB_CARET 0x14
#define FKB_BACKSLASH 0x15
#define FKB_STOP 0x16
#define FKB_ESCAPE 0x17
#define FKB_Q 0x18
#define FKB_W 0x19
#define FKB_E 0x1A
#define FKB_R 0x1B
#define FKB_T 0x1C
#define FKB_Y 0x1D
#define FKB_U 0x1E
#define FKB_I 0x1F
#define FKB_O 0x20
#define FKB_P 0x21
#define FKB_AT 0x22
#define FKB_BRACKETLEFT 0x23
#define FKB_RETURN 0x24
#define FKB_CONTROL 0x25
#define FKB_A 0x26
#define FKB_S 0x27
#define FKB_D 0x28
#define FKB_F 0x29
#define FKB_G 0x2A
#define FKB_H 0x2B
#define FKB_J 0x2C
#define FKB_K 0x2D
#define FKB_L 0x2E
#define FKB_SEMICOLON 0x2F
#define FKB_COLON 0x30
#define FKB_BRACKETRIGHT 0x31
#define FKB_KANA 0x32
#define FKB_LEFTSHIFT 0x33
#define FKB_Z 0x34
#define FKB_X 0x35
#define FKB_C 0x36
#define FKB_V 0x37
#define FKB_B 0x38
#define FKB_N 0x39
#define FKB_M 0x3A
#define FKB_COMMA 0x3B
#define FKB_PERIOD 0x3C
#define FKB_SLASH 0x3D
#define FKB_UNDERSCORE 0x3E
#define FKB_RIGHTSHIFT 0x3F
#define FKB_GRAPH 0x40
#define FKB_SPACE 0x41
#define FKB_CLEAR 0x42
#define FKB_INSERT 0x43
#define FKB_DELETE 0x44
#define FKB_UP 0x45
#define FKB_LEFT 0x46
#define FKB_RIGHT 0x47
#define FKB_DOWN 0x48

View File

@ -0,0 +1,96 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "share.h"
#include "suborkb.h"
#define AK(x) FKB_ ## x
static uint8 bufit[0x66];
static uint8 kspos, kstrobe;
static uint8 ksindex;
//TODO: check all keys, some of the are wrong
static uint16 matrix[13][8] =
{
{ AK(ESCAPE),AK(SPACE),AK(LMENU),AK(LCONTROL),AK(LSHIFT),AK(GRAVE),AK(TAB),AK(CAPITAL) },
{ AK(F6),AK(F7),AK(F5),AK(F4),AK(F8),AK(F2),AK(F1),AK(F3) },
{ AK(EQUALS), AK(NUMPAD0),AK(PERIOD),AK(A),AK(RETURN),AK(1),AK(Q),AK(Z) },
{ 0, AK(NUMPAD3),AK(NUMPAD6),AK(S),AK(NUMPAD9),AK(2),AK(W),AK(X) },
{ AK(SLASH), AK(NUMPAD2),AK(NUMPAD5),AK(D),AK(NUMPAD8),AK(3),AK(E),AK(C) },
{ AK(BREAK), AK(NUMPAD1),AK(NUMPAD4),AK(F),AK(NUMPAD7),AK(4),AK(R),AK(V) },
{ AK(BACK),AK(BACKSLASH),AK(GRETURN),AK(G),AK(RBRACKET),AK(5),AK(T),AK(B) },
{ AK(9),AK(PERIOD),AK(L),AK(K),AK(O),AK(8),AK(I),AK(COMMA) },
{ AK(0),AK(SLASH),AK(SEMICOLON),AK(J),AK(P),AK(7),AK(U),AK(M) },
{ AK(MINUS),AK(MINUS),AK(APOSTROPHE),AK(H),AK(LBRACKET),AK(6),AK(Y),AK(N) },
{ AK(F11),AK(F12),AK(F10),0,AK(MINUS),AK(F9),0,0 },
{ AK(UP),AK(RIGHT),AK(DOWN),AK(DIVIDE),AK(LEFT),AK(MULTIPLY),AK(SUBTRACT),AK(ADD) },
{ AK(INSERT),AK(NUMPAD1),AK(HOME),AK(PRIOR),AK(DELETE),AK(END),AK(NEXT),AK(NUMLOCK) },
};
static void PEC586KB_Write(uint8 v) {
if (!(kstrobe & 2) && (v & 2)) {
kspos = 0;
}
if ((kstrobe & 1) && !(v & 1)) {
ksindex = 0;
}
if ((kstrobe & 4) && !(v & 4)) {
kspos++;
kspos %= 13;
}
kstrobe = v;
}
static uint8 PEC586KB_Read(int w, uint8 ret) {
#ifdef FCEUDEF_DEBUGGER
if (!fceuindbg) {
#endif
if (w) {
ret &= ~2;
if(bufit[matrix[kspos][7-ksindex]])
ret |= 2;
ksindex++;
ksindex&=7;
}
#ifdef FCEUDEF_DEBUGGER
}
#endif
return(ret);
}
static void PEC586KB_Strobe(void) {
// kstrobe = 0;
// ksindex = 0;
}
static void PEC586KB_Update(void *data, int arg) {
memcpy(bufit + 1, data, sizeof(bufit) - 1);
}
static INPUTCFC PEC586KB = { PEC586KB_Read, PEC586KB_Write, PEC586KB_Strobe, PEC586KB_Update, 0, 0 };
INPUTCFC *FCEU_InitPEC586KB(void) {
memset(bufit, 0, sizeof(bufit));
kspos = ksindex = kstrobe = 0;
return(&PEC586KB);
}

View File

@ -1,94 +1,84 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "share.h"
#include "suborkb.h"
#define AK2(x,y) ( (FKB_##x) | (FKB_##y <<8) )
#define AK(x) FKB_##x
#define AK(x) FKB_ ## x
static uint8 bufit[0x61];
static uint8 bufit[0x66];
static uint8 ksmode;
static uint8 ksindex;
static uint16 matrix[13][2][4]=
static uint16 matrix[13][2][4] =
{
{{AK(4),AK(G),AK(F),AK(C)},
{AK(F2),AK(E),AK(5),AK(V)}},
{{AK(2),AK(D),AK(S),AK(END)},
{AK(F1),AK(W),AK(3),AK(X)}},
{{AK(INSERT),AK(BACK),AK(NEXT),AK(RIGHT)},
{AK(F8),AK(PRIOR),AK(DELETE),AK(HOME)}},
{{AK(9),AK(I),AK(L),AK(COMMA)},
{AK(F5),AK(O),AK(0),AK(PERIOD)}},
{{AK(RBRACKET),AK(RETURN),AK(UP),AK(LEFT)},
{AK(F7),AK(LBRACKET),AK(BACKSLASH),AK(DOWN)}},
{{AK(Q),AK(CAPITAL),AK(Z),AK(TAB)},
{AK(ESCAPE),AK(A),AK(1),AK(LCONTROL)}},
{{AK(7),AK(Y),AK(K),AK(M)},
{AK(F4),AK(U),AK(8),AK(J)}},
{{AK(MINUS),AK(SEMICOLON),AK(APOSTROPHE),AK(SLASH)},
{AK(F6),AK(P),AK(EQUALS),AK(LSHIFT)}},
{{AK(T),AK(H),AK(N),AK(SPACE)},
{AK(F3),AK(R),AK(6),AK(B)}},
{{0,0,0,0},
{0,0,0,0}},
{{AK(LMENU),AK(NUMPAD4),AK(NUMPAD7),AK(F11)},
{AK(F12),AK(NUMPAD1),AK(NUMPAD2),AK(NUMPAD8)}},
{{AK(SUBTRACT),AK(ADD),AK(MULTIPLY),AK(NUMPAD9)},
{AK(F10),AK(NUMPAD5),AK(DIVIDE),AK(NUMLOCK)}},
{{AK(GRAVE),AK(NUMPAD6),AK(PAUSE),AK(SPACE)},
{AK(F9),AK(NUMPAD3),AK(DECIMAL),AK(NUMPAD0)}},
{ { AK(4), AK(G), AK(F), AK(C) }, { AK(F2), AK(E), AK(5), AK(V) } },
{ { AK(2), AK(D), AK(S), AK(END) }, { AK(F1), AK(W), AK(3), AK(X) } },
{ { AK(INSERT), AK(BACK), AK(NEXT), AK(RIGHT) }, { AK(F8), AK(PRIOR), AK(DELETE), AK(HOME) } },
{ { AK(9), AK(I), AK(L), AK(COMMA) }, { AK(F5), AK(O), AK(0), AK(PERIOD) } },
{ { AK(RBRACKET), AK(RETURN), AK(UP), AK(LEFT) }, { AK(F7), AK(LBRACKET), AK(BACKSLASH), AK(DOWN) } },
{ { AK(Q), AK(CAPITAL), AK(Z), AK(TAB) }, { AK(ESCAPE), AK(A), AK(1), AK(LCONTROL) } },
{ { AK(7), AK(Y), AK(K), AK(M) }, { AK(F4), AK(U), AK(8), AK(J) } },
{ { AK(MINUS), AK(SEMICOLON), AK(APOSTROPHE), AK(SLASH) }, { AK(F6), AK(P), AK(EQUALS), AK(LSHIFT) } },
{ { AK(T), AK(H), AK(N), AK(SPACE) }, { AK(F3), AK(R), AK(6), AK(B) } },
{ { AK(NUMPAD6), AK(GRETURN), AK(NUMPAD4), AK(NUMPAD8) }, { AK(NUMPAD2), 0, 0, 0 } }, // baibaidino actually uses diferent layot
{ { AK(LMENU), AK(NUMPAD4), AK(NUMPAD7), AK(F11) }, { AK(F12), AK(NUMPAD1), AK(NUMPAD2), AK(NUMPAD8) } },
{ { AK(SUBTRACT), AK(ADD), AK(MULTIPLY), AK(NUMPAD9) }, { AK(F10), AK(NUMPAD5), AK(DIVIDE), AK(NUMLOCK) } },
{ { AK(GRAVE), AK(NUMPAD6), AK(PAUSE), AK(SPACE) }, { AK(F9), AK(NUMPAD3), AK(DECIMAL), AK(NUMPAD0) } },
};
static void SuborKB_Write(uint8 v)
{
v>>=1;
if(v&2)
{
if((ksmode&1) && !(v&1))
ksindex=(ksindex+1)%13;
}
ksmode=v;
static void SuborKB_Write(uint8 v) {
v >>= 1;
if (v & 2) {
if ((ksmode & 1) && !(v & 1))
ksindex = (ksindex + 1) % 13;
}
ksmode = v;
}
static uint8 SuborKB_Read(int w, uint8 ret)
{
if(w)
{
int x;
static uint8 SuborKB_Read(int w, uint8 ret) {
if (w) {
int x;
ret&=~0x1E;
// if(ksindex==9)
// {
// if(ksmode&1)
// ret|=2;
// }
// else
// {
for(x=0;x<4;x++)
if(bufit[matrix[ksindex][ksmode&1][x]&0xFF]||bufit[matrix[ksindex][ksmode&1][x]>>8])
ret|=1<<(x+1);
// }
ret^=0x1E;
}
return(ret);
ret &= ~0x1E;
for (x = 0; x < 4; x++)
if (bufit[matrix[ksindex][ksmode & 1][x]])
ret |= 1 << (x + 1);
ret ^= 0x1E;
}
return(ret);
}
static void SuborKB_Strobe(void)
{
ksmode=0;
ksindex=0;
static void SuborKB_Strobe(void) {
ksmode = 0;
ksindex = 0;
}
static void SuborKB_Update(void *data, int arg)
{
memcpy(bufit+1,data,0x60);
static void SuborKB_Update(void *data, int arg) {
memcpy(bufit + 1, data, sizeof(bufit) - 1);
}
static INPUTCFC SuborKB={SuborKB_Read,SuborKB_Write,SuborKB_Strobe,SuborKB_Update,0,0};
static INPUTCFC SuborKB = { SuborKB_Read, SuborKB_Write, SuborKB_Strobe, SuborKB_Update, 0, 0 };
INPUTCFC *FCEU_InitSuborKB(void)
{
memset(bufit,0,sizeof(bufit));
ksmode=ksindex=0;
return(&SuborKB);
INPUTCFC *FCEU_InitSuborKB(void) {
memset(bufit, 0, sizeof(bufit));
ksmode = ksindex = 0;
return(&SuborKB);
}

View File

@ -1,96 +1,102 @@
#define FKB_ESCAPE 0x01
#define FKB_F1 0x02
#define FKB_F2 0x03
#define FKB_F3 0x04
#define FKB_F4 0x05
#define FKB_F5 0x06
#define FKB_F6 0x07
#define FKB_F7 0x08
#define FKB_F8 0x09
#define FKB_F9 0x0A
#define FKB_F10 0x0B
#define FKB_F11 0x0C
#define FKB_F12 0x0D
#define FKB_PAUSE 0x0E
#define FKB_GRAVE 0x0F
#define FKB_1 0x10
#define FKB_2 0x11
#define FKB_3 0x12
#define FKB_4 0x13
#define FKB_5 0x14
#define FKB_6 0x15
#define FKB_7 0x16
#define FKB_8 0x17
#define FKB_9 0x18
#define FKB_0 0x19
#define FKB_MINUS 0x1A
#define FKB_EQUALS 0x1B
#define FKB_BACK 0x1C
#define FKB_INSERT 0x1D
#define FKB_HOME 0x1E
#define FKB_PRIOR 0x1F
#define FKB_NUMLOCK 0x20
#define FKB_DIVIDE 0x21
#define FKB_MULTIPLY 0x22
#define FKB_SUBTRACT 0x23
#define FKB_TAB 0x24
#define FKB_Q 0x25
#define FKB_W 0x26
#define FKB_E 0x27
#define FKB_R 0x28
#define FKB_T 0x29
#define FKB_Y 0x2A
#define FKB_U 0x2B
#define FKB_I 0x2C
#define FKB_O 0x2D
#define FKB_P 0x2E
#define FKB_LBRACKET 0x2F
#define FKB_RBRACKET 0x30
#define FKB_RETURN 0x31
#define FKB_DELETE 0x32
#define FKB_END 0x33
#define FKB_NEXT 0x34
#define FKB_NUMPAD7 0x35
#define FKB_NUMPAD8 0x36
#define FKB_NUMPAD9 0x37
#define FKB_ADD 0x38
#define FKB_CAPITAL 0x39
#define FKB_A 0x3A
#define FKB_S 0x3B
#define FKB_D 0x3C
#define FKB_F 0x3D
#define FKB_G 0x3E
#define FKB_H 0x3F
#define FKB_J 0x40
#define FKB_K 0x41
#define FKB_L 0x42
#define FKB_SEMICOLON 0x43
#define FKB_APOSTROPHE 0x44
#define FKB_NUMPAD4 0x45
#define FKB_NUMPAD5 0x46
#define FKB_NUMPAD6 0x47
#define FKB_LSHIFT 0x48
#define FKB_Z 0x49
#define FKB_X 0x4A
#define FKB_C 0x4B
#define FKB_V 0x4C
#define FKB_B 0x4D
#define FKB_N 0x4E
#define FKB_M 0x4F
#define FKB_COMMA 0x50
#define FKB_PERIOD 0x51
#define FKB_SLASH 0x52
#define FKB_BACKSLASH 0x53
#define FKB_UP 0x54
#define FKB_NUMPAD1 0x55
#define FKB_NUMPAD2 0x56
#define FKB_NUMPAD3 0x57
#define FKB_LCONTROL 0x58
#define FKB_LMENU 0x59
#define FKB_SPACE 0x5A
#define FKB_LEFT 0x5B
#define FKB_DOWN 0x5C
#define FKB_RIGHT 0x5D
#define FKB_NUMPAD0 0x5E
#define FKB_DECIMAL 0x5F
#define FKB_ESCAPE 0x01
#define FKB_F1 0x02
#define FKB_F2 0x03
#define FKB_F3 0x04
#define FKB_F4 0x05
#define FKB_F5 0x06
#define FKB_F6 0x07
#define FKB_F7 0x08
#define FKB_F8 0x09
#define FKB_F9 0x0A
#define FKB_F10 0x0B
#define FKB_F11 0x0C
#define FKB_F12 0x0D
#define FKB_PAUSE 0x0E
#define FKB_GRAVE 0x0F
#define FKB_1 0x10
#define FKB_2 0x11
#define FKB_3 0x12
#define FKB_4 0x13
#define FKB_5 0x14
#define FKB_6 0x15
#define FKB_7 0x16
#define FKB_8 0x17
#define FKB_9 0x18
#define FKB_0 0x19
#define FKB_MINUS 0x1A
#define FKB_EQUALS 0x1B
#define FKB_BACK 0x1C
#define FKB_INSERT 0x1D
#define FKB_HOME 0x1E
#define FKB_PRIOR 0x1F
#define FKB_NUMLOCK 0x20
#define FKB_DIVIDE 0x21
#define FKB_MULTIPLY 0x22
#define FKB_SUBTRACT 0x23
#define FKB_TAB 0x24
#define FKB_Q 0x25
#define FKB_W 0x26
#define FKB_E 0x27
#define FKB_R 0x28
#define FKB_T 0x29
#define FKB_Y 0x2A
#define FKB_U 0x2B
#define FKB_I 0x2C
#define FKB_O 0x2D
#define FKB_P 0x2E
#define FKB_LBRACKET 0x2F
#define FKB_RBRACKET 0x30
#define FKB_RETURN 0x31
#define FKB_DELETE 0x32
#define FKB_END 0x33
#define FKB_NEXT 0x34
#define FKB_NUMPAD7 0x35
#define FKB_NUMPAD8 0x36
#define FKB_NUMPAD9 0x37
#define FKB_ADD 0x38
#define FKB_CAPITAL 0x39
#define FKB_A 0x3A
#define FKB_S 0x3B
#define FKB_D 0x3C
#define FKB_F 0x3D
#define FKB_G 0x3E
#define FKB_H 0x3F
#define FKB_J 0x40
#define FKB_K 0x41
#define FKB_L 0x42
#define FKB_SEMICOLON 0x43
#define FKB_APOSTROPHE 0x44
#define FKB_NUMPAD4 0x45
#define FKB_NUMPAD5 0x46
#define FKB_NUMPAD6 0x47
#define FKB_LSHIFT 0x48
#define FKB_Z 0x49
#define FKB_X 0x4A
#define FKB_C 0x4B
#define FKB_V 0x4C
#define FKB_B 0x4D
#define FKB_N 0x4E
#define FKB_M 0x4F
#define FKB_COMMA 0x50
#define FKB_PERIOD 0x51
#define FKB_SLASH 0x52
#define FKB_BACKSLASH 0x53
#define FKB_UP 0x54
#define FKB_NUMPAD1 0x55
#define FKB_NUMPAD2 0x56
#define FKB_NUMPAD3 0x57
#define FKB_LCONTROL 0x58
#define FKB_LMENU 0x59
#define FKB_SPACE 0x5A
#define FKB_LEFT 0x5B
#define FKB_DOWN 0x5C
#define FKB_RIGHT 0x5D
#define FKB_NUMPAD0 0x5E
#define FKB_DECIMAL 0x5F
#define FKB_RSHIFT 0x60
#define FKB_RMENU 0x61
#define FKB_RCONTROL 0x62
#define FKB_BREAK 0x63
#define FKB_RESET 0x64
#define FKB_GRETURN 0x65

View File

@ -47,6 +47,7 @@
#include "drivers/win/main.h"
#include "drivers/win/ram_search.h"
#include "drivers/win/ramwatch.h"
#include "drivers/win/video.h"
#endif
#include <string>
@ -243,7 +244,11 @@ static bool ReadStateChunk(EMUFILE* is, SFORMAT *sf, int size)
static int read_sfcpuc=0, read_snd=0;
#ifndef WIN32
// included corresponding header on Windows, no longer needed
// TODO do the same for SDL and remove declaration completely
void FCEUD_BlitScreen(uint8 *XBuf); //mbg merge 7/17/06 YUCKY had to add
#endif
void UpdateFCEUWindow(void); //mbg merge 7/17/06 YUCKY had to add
static bool ReadStateChunks(EMUFILE* is, int32 totalsize)
{

View File

@ -390,6 +390,7 @@ static BMAPPING bmap[] = {
{ "NovelDiamond9999999in1", Novel_Init, 0 },
{ "OneBus", UNLOneBus_Init, 0 },
{ "PEC-586", UNLPEC586Init, 0 },
{ "RET-CUFROM", Mapper29_Init, BMCFLAG_32KCHRR },
{ "RROM", NROM_Init, 0 },
{ "RROM-128", NROM_Init, 0 },
{ "SA-002", TCU02_Init, 0 },

View File

@ -0,0 +1,10 @@
#ifndef BITFLAGS_H
#define BITFLAGS_H
// Flag test / set / clear macros for convenience and clarity
#define FL_TEST(var, mask) (var & mask)
#define FL_SET(var, mask) (var |= mask)
#define FL_CLEAR(var, mask) (var &= ~mask)
#define FL_FROMBOOL(var, mask, b) (var = (b)? var|mask:var&(~mask))
#endif // BITFLAGS_H

View File

@ -596,6 +596,7 @@
<ClCompile Include="..\src\input\mahjong.cpp" />
<ClCompile Include="..\src\input\mouse.cpp" />
<ClCompile Include="..\src\input\oekakids.cpp" />
<ClCompile Include="..\src\input\pec586kb.cpp" />
<ClCompile Include="..\src\input\powerpad.cpp" />
<ClCompile Include="..\src\input\quiz.cpp" />
<ClCompile Include="..\src\input\shadow.cpp" />
@ -963,6 +964,7 @@
<ClInclude Include="..\src\ines-correct.h" />
<ClInclude Include="..\src\ines.h" />
<ClInclude Include="..\src\input.h" />
<ClInclude Include="..\src\input\fkb.h" />
<ClInclude Include="..\src\input\share.h" />
<ClInclude Include="..\src\input\suborkb.h" />
<ClInclude Include="..\src\movie.h" />

View File

@ -958,6 +958,9 @@
<ClCompile Include="..\src\boards\mihunche.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\input\pec586kb.cpp">
<Filter>input</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\drivers\common\args.h">
@ -1464,6 +1467,9 @@
<ClInclude Include="..\src\utils\ioapi.h">
<Filter>utils</Filter>
</ClInclude>
<ClInclude Include="..\src\input\fkb.h">
<Filter>input</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\src\drivers\win\res.rc">

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff