mirror of
https://github.com/TASVideos/desmume
synced 2024-07-01 07:14:37 +00:00
Compare commits
6 Commits
0f6f54b151
...
592175f618
Author | SHA1 | Date | |
---|---|---|---|
|
592175f618 | ||
|
6309a9c6a7 | ||
|
779606ec2f | ||
|
ffb8666a8f | ||
|
ff6c33a8d6 | ||
|
be53737eba |
|
@ -20,9 +20,15 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "../slot2.h"
|
||||
#include "../emufile.h"
|
||||
|
||||
u8 hcv1000_cnt;
|
||||
char hcv1000_data[16];
|
||||
static u8 hcv1000_cnt;
|
||||
static u8 hcv1000_data[16] =
|
||||
{ 0x5F, 0x5F, 0x5F, 0x5F,
|
||||
0x5F, 0x5F, 0x5F, 0x5F,
|
||||
0x5F, 0x5F, 0x5F, 0x5F,
|
||||
0x5F, 0x5F, 0x5F, 0x5F
|
||||
};
|
||||
|
||||
class Slot2_HCV1000 : public ISlot2Interface
|
||||
{
|
||||
|
@ -34,17 +40,15 @@ public:
|
|||
return &info;
|
||||
}
|
||||
|
||||
virtual bool init()
|
||||
virtual void connect()
|
||||
{
|
||||
hcv1000_cnt = 0;
|
||||
memset(hcv1000_data, 0x5F, 16);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
|
||||
{
|
||||
if (addr == 0xA000000) { hcv1000_cnt = (val & 0x83); }
|
||||
if (addr == 0xA000000)
|
||||
hcv1000_cnt = (val & 0x83);
|
||||
}
|
||||
|
||||
virtual u8 readByte(u8 PROCNUM, u32 addr)
|
||||
|
@ -58,12 +62,15 @@ public:
|
|||
}
|
||||
|
||||
//HCV_CNT
|
||||
else if (addr == 0xA000000) { slot_byte = hcv1000_cnt; }
|
||||
else if (addr == 0xA000000)
|
||||
{
|
||||
slot_byte = hcv1000_cnt;
|
||||
}
|
||||
|
||||
//HCV_DATA
|
||||
else if ((addr >= 0xA000010) && (addr <= 0xA00001F))
|
||||
{
|
||||
slot_byte = (u8)hcv1000_data[addr & 0xF];
|
||||
slot_byte = hcv1000_data[addr & 0xF];
|
||||
}
|
||||
|
||||
return slot_byte;
|
||||
|
@ -71,6 +78,24 @@ public:
|
|||
|
||||
virtual u16 readWord(u8 PROCNUM, u32 addr) { return 0xFDFD; };
|
||||
virtual u32 readLong(u8 PROCNUM, u32 addr) { return 0xFDFDFDFD; };
|
||||
|
||||
virtual void savestate(EMUFILE &os)
|
||||
{
|
||||
s32 version = 0;
|
||||
os.write_32LE(version);
|
||||
|
||||
os.write_u8(hcv1000_cnt);
|
||||
}
|
||||
|
||||
virtual void loadstate(EMUFILE &is)
|
||||
{
|
||||
s32 version = is.read_s32LE();
|
||||
|
||||
if (version >= 0)
|
||||
{
|
||||
is.read_u8(hcv1000_cnt);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ISlot2Interface* construct_Slot2_HCV1000() { return new Slot2_HCV1000(); }
|
||||
|
|
|
@ -51,6 +51,13 @@
|
|||
#include "main.h"
|
||||
#include "winutil.h"
|
||||
|
||||
//60 is a poor choice for a threshold; the theoretical maximum you can get even at an exact 45 degree angle is 70
|
||||
//Sloshy sticks or slightly-off angles make it impossible to reach 60, as it's far too close to 70.
|
||||
//Too-small values feel bad, too
|
||||
//50 is a more normal choice
|
||||
//#define S9X_JOY_NEUTRAL 60
|
||||
int S9X_JOY_NEUTRAL = 50;
|
||||
|
||||
// Gamepad Dialog Strings
|
||||
// Support Unicode display
|
||||
//#define INPUTCONFIG_TITLE "Input Configuration"
|
||||
|
@ -520,6 +527,9 @@ BOOL di_init()
|
|||
{
|
||||
HWND hParentWnd = MainWindow->getHWnd();
|
||||
|
||||
S9X_JOY_NEUTRAL = GetPrivateProfileInt("Controls", "DigitalizationThreshold", S9X_JOY_NEUTRAL, IniName);
|
||||
|
||||
|
||||
pDI = NULL;
|
||||
memset(cDIBuf, 0, sizeof(cDIBuf));
|
||||
|
||||
|
@ -669,10 +679,6 @@ int FunkyNormalize(int cur, int min, int max)
|
|||
return Result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define S9X_JOY_NEUTRAL 60
|
||||
|
||||
void CheckAxis (short joy, short control, int val,
|
||||
int min, int max,
|
||||
bool &first, bool &second)
|
||||
|
|
|
@ -20,7 +20,11 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef __MACH__
|
||||
#define _DARWIN_C_SOURCE /* As below, plus strl* functions */
|
||||
#else
|
||||
#define _XOPEN_SOURCE 500 /* For strdup, realpath */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
|
|
Loading…
Reference in New Issue
Block a user