-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Handle tray eject/load via smc #1564
base: master
Are you sure you want to change the base?
Conversation
Is this different from `-dvd_path ""`?
…On Tue, Nov 28, 2023, 18:21 BiatuAutMiahn ***@***.***> wrote:
As per #1563 <#1563>, allow
user to specify -no-dvd to clear the dvd_path on startup.
------------------------------
You can view, comment on, or merge this pull request online at:
#1564
Commit Summary
- 21eab43
<21eab43>
Add -no_dvd parameter
File Changes
(1 file <https://github.com/xemu-project/xemu/pull/1564/files>)
- *M* softmmu/vl.c
<https://github.com/xemu-project/xemu/pull/1564/files#diff-b6cd26cc031333f54cf7765de0d501e6fbc28c9177201c22730e56a6f75884c4>
(12)
Patch Links:
- https://github.com/xemu-project/xemu/pull/1564.patch
- https://github.com/xemu-project/xemu/pull/1564.diff
—
Reply to this email directly, view it on GitHub
<#1564>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJYNE2YQ355PJ26IUKVLNDYGYMSTAVCNFSM6AAAAAA76DTPYSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTIOJTGM2TGNI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
|
It's only clearing the path. Maybe I should implement if (strlen(dvd_path) > 0) {
// Allow clearing the dvd path on boot.
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-no_dvd") == 0) {
argv[i] = NULL;
dvd_path = "";
xemu_settings_set_string(&g_config.sys.files.dvd_path, "");
break;
}
}
} |
How's this? bool no_dvd_drive = false;
bool no_dvd = false;
// debug only.
#ifdef DEBUG_XEMU_C
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-no_dvd_drive") == 0) {
argv[i] = NULL;
no_dvd_drive = true;
break;
}
}
#endif
const char *dvd_path = g_config.sys.files.dvd_path;
if (!no_dvd_drive) {
// Allow clearing the dvd path on boot.
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-no_dvd") == 0) {
argv[i] = NULL;
no_dvd = true;
dvd_path = "";
xemu_settings_set_string(&g_config.sys.files.dvd_path, "");
break;
}
}
if (!no_dvd) {
// Allow overriding the dvd path from command line
for (int i = 1; i < argc; i++) {
if (argv[i] && strcmp(argv[i], "-dvd_path") == 0) {
argv[i] = NULL;
if (i < argc - 1 && argv[i+1]) {
dvd_path = argv[i+1];
argv[i+1] = NULL;
}
break;
}
}
if (strlen(dvd_path) > 0) {
if (xemu_check_file(dvd_path) || strcmp(dvd_path, hdd_path) == 0) {
char *msg = g_strdup_printf("Failed to open DVD image file '%s'. Please check machine settings.", dvd_path);
xemu_queue_error_message(msg);
g_free(msg);
dvd_path = "";
}
}
}
// Always populate DVD drive. If disc path is the empty string, drive is
// connected but no media present.
fake_argv[fake_argc++] = strdup("-drive");
char *escaped_dvd_path = strdup_double_commas(dvd_path);
fake_argv[fake_argc++] = g_strdup_printf("index=1,media=cdrom,file=%s",
escaped_dvd_path);
free(escaped_dvd_path);
} |
I thought an eject boot option was going to be added. This is different than starting with no dvd in the tray. |
-Reverts -no_dvd arg -Adds eject/load tray handling to xbox smc. -Adds -eject_after_boot arg -Adds smc handling of eject_after_handling
I think this is what you had in mind Edit: |
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.
Please run clang-format on the code as per https://xemu.app/docs/dev/#contributing
As per #1563, allow user to specify
-no_dvd
to clear the dvd_path on startup.