-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: Device emulation #1478
UI: Device emulation #1478
Conversation
hw: SBC uses a different endpoint address for output
…mu-project-master
…to device_emulation
…vice_emulation
…emoved the ability to mount XMUs to the Steel Battalion controller's internal hub as it no longer exists.
hw/xbox/xid-steel-battalion.c
Outdated
typedef struct XIDSteelBattalionOutputReport { | ||
uint8_t report_id; | ||
uint8_t length; | ||
uint8_t CockpitHatch_EmergencyEject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint8_t CockpitHatch_EmergencyEject; | |
uint8_t EmergencyEject : 4; | |
uint8_t CockpitHatch : 4; | |
uint8_t Ignition : 4; | |
uint8_t Start : 4; | |
.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen this syntax before, but it looks like it could be really useful. Thanks!
hw/xbox/xid-steel-battalion.c
Outdated
|
||
static void print_xid_steel_battalion_output_data(XIDSteelBattalionOutputReport *state) | ||
{ | ||
print_steel_battalion_leds("Cockpit Hatch", "Emergency Eject", state->CockpitHatch_EmergencyEject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print_steel_battalion_leds("Cockpit Hatch", "Emergency Eject", state->CockpitHatch_EmergencyEject); | |
fprintf(stderr, "%s: %d\n", "Emergency Eject", state->EmergencyEject); | |
fprintf(stderr, "%s: %d\n", "Cockpit Hatch", state->CockpitHatch); | |
fprintf(stderr, "%s: %d\n", "Ignition", state->Ignition); | |
fprintf(stderr, "%s: %d\n", "Start", state->Start); | |
.... |
…ld members. This makes accessing individual LED brightness values easier
The emulator could make it easier by having its own frontend, something close to PCSX2, so we can organize the games and put our own covers on them. Have you also thought about creating a compression format for the isos? Something like Dolphin did with RVZ, so that it is supported by Xemu (maybe a compression format called .xe ? Haha 😅) |
build: Update arm64 target, handle target/arch independent pkg names
I'm thinking I should maybe add light gun to this |
ui/xui/main-menu.cc
Outdated
DRIVER_LIGHT_GUN_DISPLAY_NAME | ||
}; | ||
bool is_selected = false; | ||
for (int i = 0; i < 5; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i = 0; i < 5; i++) { | |
for (int i = 0; i < ARRAY_SIZE(driver_display_names); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this suggestion, but implementing it as-is causes the build to fail because the ARRAY_SIZE macro uses the struct keyword after all is resolved.
I'm going to play around with this and see if I can come up with a good solution
… using viewport coordiantes for the mouse, which allows for accurate calculation of the X and Y inputs in the lightgun
This looks great! |
@@ -51,38 +53,61 @@ void InputManager::Update() | |||
|
|||
// Prevent controller events from going to the guest if they are being used | |||
// to navigate the HUD | |||
xemu_input_set_test_mode(controller_focus_capture); // FIXME: Rename 'test mode' | |||
xemu_input_set_test_mode( | |||
controller_focus_capture); // FIXME: Rename 'test mode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why adjust the spacing
|
||
// Combine all controller states to allow any controller to navigate | ||
m_buttons = 0; | ||
int16_t axis[CONTROLLER_AXIS__COUNT] = {0}; | ||
int16_t axis[CONTROLLER_AXIS__COUNT] = { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing
@@ -125,7 +228,8 @@ bool xemu_input_bind_xmu(int player_index, int peripheral_port_index, | |||
const char *filename, bool is_rebind); | |||
void xemu_input_rebind_xmu(int port); | |||
void xemu_input_unbind_xmu(int player_index, int peripheral_port_index); | |||
int xemu_input_get_controller_default_bind_port(ControllerState *state, int start); | |||
int xemu_input_get_controller_default_bind_port(ControllerState *state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing
// Input state | ||
uint16_t buttons; | ||
int16_t axis[CONTROLLER_AXIS__COUNT]; | ||
|
||
// Rendering state hacked on here for convenience but needs to be moved (FIXME) | ||
// Rendering state hacked on here for convenience but needs to be moved | ||
// (FIXME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Spacing
m_mouse_moved = true; | ||
m_last_mouse_pos = current_mouse_pos; | ||
m_navigating_with_controller = false; | ||
} | ||
|
||
// If mouse capturing is enabled (we are in a dialog), ensure the UI is alive | ||
// If mouse capturing is enabled (we are in a dialog), ensure the UI is | ||
// alive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Spacing
There are also some merge conflicts to be resolved however they don't seem super major, just a note, otherwise, great work! |
I'm closing this PR as it has been replaced by 4 smaller PRs that, when combined, accomplish the same thing |
Added functionality to emulate an Xbox Controller S or a Steel Battalion controller in addition to the existing emulated Xbox controller