Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/hostevents_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ void EventManager::poll_events() {
bool g_realtime_status = toggle_g_realtime();
LOG_F(INFO, "g_realtime: %s", g_realtime_status ? "enabled" : "disabled");
}
return;
}

// Control-L: log toggle
Expand Down
3 changes: 2 additions & 1 deletion cpu/ppc/ppcemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,8 @@ extern int increment_icnt_factor();
extern int decrement_icnt_factor();
extern int get_icnt_factor();

/* toggle_g_realtime */
/* realtime clock control */
extern bool g_realtime;
extern bool toggle_g_realtime();

/* force_cycle_counter_reload */
Expand Down
8 changes: 8 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ int main(int argc, char** argv) {
->check(WorkingDirectory)->capture_default_str();
auto bootrom_opt = emu->add_option("-b,--bootrom", bootrom_path, "Specifies BootROM path")
->check(CLI::ExistingFile)->capture_default_str();
emu->add_flag("--realtime", g_realtime,
"Advance guest timers using the host clock");
auto deterministic_opt = emu->add_flag("--deterministic", is_deterministic,
"Use deterministic execution");
emu->add_option("--start-date", start_date,
Expand Down Expand Up @@ -234,6 +236,10 @@ int main(int argc, char** argv) {
CLI11_PARSE(app, argc, argv);

deterministic_interactive = deterministic_mode == "interactive";
if (g_realtime && is_deterministic && !deterministic_interactive) {
return app.exit(CLI::ValidationError("--realtime",
"Use --deterministic-mode=interactive with realtime timing"));
}

if (*list_cmd) {
if (sub_arg == "machines") {
Expand Down Expand Up @@ -327,6 +333,8 @@ int main(int argc, char** argv) {

cout << "BootROM path: " << bootrom_path << endl;
cout << "Execution mode: " << execution_mode << endl;
if (g_realtime)
cout << "Guest timers use the host clock." << endl;
if (is_deterministic) {
cout << "Using deterministic execution mode; disk, NVRAM, and PRAM changes will not be saved." << endl;
if (deterministic_interactive) {
Expand Down
13 changes: 10 additions & 3 deletions zdocs/users/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@ Specifies working directory, where `path` is a string for the directory the emul

Start the guest RTC on the given date, using the current local time of day. The clock continues ticking, including across midnight. This is useful for running software with an expiration date, such as `--start-date=1997-03-01` for BeOS DR 8.2. Without a date override or deterministic mode, the RTC follows the host clock.

```
--realtime
```

Advance the CPU timebase, decrementer, and device timers using elapsed host time, instead of instruction counts. This keeps double click delays, keyboard repeat, sleeps, and timeouts tied to wall time, improving usability of user interfaces. Control-Alt-R toggles this mode while running.

```
--deterministic
--deterministic-mode strict|interactive
```

Enables deterministic mode, where the emulator behaves the same way every run. Meant to be a development or debugging aid, to remove variability between runs. Disk, NVRAM, and PRAM changes are not saved. The default `strict` mode ignores mouse and keyboard input; `interactive` mode allows input for interactive debugging.
Enables deterministic mode, where the emulator behaves the same way every run. Meant to be a development or debugging aid, to remove variability between runs. Disk, NVRAM, and PRAM changes are not saved. Audio output is also disabled, since we cannot control when the host would try to access it. The default `strict` mode ignores mouse and keyboard input; `interactive` mode allows input for interactive debugging.

The RTC defaults to `--start-date=2001-03-24`, unless a date is explicitly supplied. It starts at noon and advances the RTC with emulated time. Restarting the emulated machine starts the deterministic RTC from that date and noon again.
The RTC defaults to `--start-date=2001-03-24`, unless a date is explicitly supplied. It starts at noon and advances the RTC with emulated time. Restarting the emulated machine starts the deterministic RTC from that date and noon again. With `--realtime`, it advances at wall-clock rate from that fixed date and noon.

```
--setenv args
Expand Down Expand Up @@ -209,7 +215,7 @@ The debugger is enabled here, due to the presence of `-d`. The CD ROM image will

## Keyboard Shortcuts

You can use these keyboard commands while the emulator is running in real-time mode:
You can use these keyboard commands while the emulator is running:

* Control-G: mouse grab
* Control-S: scale quality
Expand All @@ -219,6 +225,7 @@ You can use these keyboard commands while the emulator is running in real-time m
* Control--: smaller
* Control-L: log toggle
* Control-D: debugger
* Control-Alt-R: toggle realtime guest timing

## Accessing Open Firmware

Expand Down
Loading