Update to v094r01 release.

byuu says:

Changelog:
- port: various compilation fixes for OS X [kode54]
- nall: added programpath() function to return path to process binary
  [todo: need to have ethos use this function]
- ruby: XAudio2 will select default game sound device instead of first
  sound device
- ruby: DirectInput device IDs are no longer ambiguous when VID+PID are
  identical
- ruby: OpenGL won't try and terminate if it hasn't been initialized
- gb: D-pad up+down/left+right not masked in SGB mode
- sfc: rewrote ICD2 video rendering to output in real-time, work with
  cycle-based Game Boy renderer
- sfc: rewrote Bus::reduce(), reduces game loading time by about 500ms
- ethos: store save states in {game}/higan/* instead of {game}/bsnes/*
- loki: added target-loki/ (blank stub for now)
- Makefile: purge out/* on make clean
This commit is contained in:
Tim Allen
2014-01-28 21:04:58 +11:00
parent 10464b8c54
commit 04986d2bf7
32 changed files with 272 additions and 118 deletions

View File

@@ -35,18 +35,21 @@ struct pInputCarbon {
group.input[inputID].value = value;
}
void poll(vector<HID::Device*>& devices) {
vector<HID::Device*> poll() {
vector<HID::Device*> devices;
KeyMap keymap;
GetKeys(keymap);
uint8_t* buffer = (uint8_t*)keymap;
unsigned inputID = 0;
for(auto& key : keys) {
bool value = buffer[key.id >> 3] & (1 << (key.id & 7)));
bool value = buffer[key.id >> 3] & (1 << (key.id & 7));
assign(kb.hid, HID::Keyboard::GroupID::Button, inputID++, value);
}
devices.append(&kb.hid);
return devices;
}
bool rumble(uint64_t id, bool enable) {

View File

@@ -107,13 +107,9 @@ struct InputJoypadDirectInput {
Joypad jp;
jp.vendorID = instance->guidProduct.Data1 >> 0;
jp.productID = instance->guidProduct.Data1 >> 16;
jp.isXInputDevice = false;
if(auto device = rawinput.find(jp.vendorID, jp.productID)) {
jp.pathID = crc32_calculate((const uint8_t*)device().path.data(), device().path.size());
jp.hid.id = (uint64_t)jp.pathID << 32 | jp.vendorID << 16 | jp.productID << 0;
jp.isXInputDevice = device().isXInputDevice;
} else {
//this should never occur
return DIENUM_CONTINUE;
}
//Microsoft has intentionally imposed artificial restrictions on XInput devices when used with DirectInput
@@ -133,6 +129,17 @@ struct InputJoypadDirectInput {
device->EnumObjects(DirectInput_EnumJoypadEffectsCallback, (void*)this, DIDFT_FFACTUATOR);
jp.hid.rumble = effects > 0;
DIPROPGUIDANDPATH property;
memset(&property, 0, sizeof(DIPROPGUIDANDPATH));
property.diph.dwSize = sizeof(DIPROPGUIDANDPATH);
property.diph.dwHeaderSize = sizeof(DIPROPHEADER);
property.diph.dwObj = 0;
property.diph.dwHow = DIPH_DEVICE;
device->GetProperty(DIPROP_GUIDANDPATH, &property.diph);
string devicePath = (const char*)utf8_t(property.wszPath);
jp.pathID = crc32_calculate((const uint8_t*)devicePath.data(), devicePath.size());
jp.hid.id = (uint64_t)jp.pathID << 32 | jp.vendorID << 16 | jp.productID << 0;
if(jp.hid.rumble) {
//disable auto-centering spring for rumble support
DIPROPDWORD property;