mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Take a dropped payload, and stop drowning the console
Double-clicking the emulator printed a usage line to a console nobody sees and exited. It now opens a window that accepts a dropped .bin, with O for the system file dialog - GetOpenFileName on Windows, zenity or kdialog on Linux, since there is no such thing there without dragging in a toolkit. The window draws a dashed frame and an upload glyph from rectangles and one filled triangle; no text, because a font would have to be vendored for a screen that lives a few seconds and the instruction is on the title bar already. It is created and destroyed before the emulator's own display comes up, so it cannot interfere with the framebuffer window. A headless or toolkit-less machine falls back to the old usage message, and dragging a payload onto the executable still skips all of it - that arrives as argv[1]. Dropping a payload was then unusably slow, and the reason had nothing to do with the picker. A full hwtest sweep printed 52,452 lines, of which about 51,900 were per-register-access traces: 29,673 [gpio], 16,707 [mmio], 5,430 [sdmmc]. Redirected to a file that is merely wasteful, which is why it went unnoticed - every scripted run here redirects. On a Windows console it is not: each line goes through conhost one write at a time. Those traces now need --trace or RCM_EMU_TRACE=1, which drops default output to 578 lines - the payload's own UART plus the handful of [emu], [display], [pcie] and [audio] lines worth seeing. The flag brings all 48,354 back when a register-level question needs answering. Also adds RCM_EMU_PICK, which runs the picker's window lifecycle and returns a path as if it had been dropped, so that path can be tested by a script instead of only by a human dragging a file.
This commit is contained in:
1 parent
390d64abe6
commit
a71ccdf682
9 files changed
+288
-37
No files matched your search
+2
-1
@@ -1,4 +1,5 @@
|
||||
#include "i2c3.h"
|
||||
#include "trace.h"
|
||||
#include "../emu_state.h"
|
||||
#include "memory_map.h"
|
||||
|
||||
@@ -289,7 +290,7 @@ void execute(EmuState *state, uint32_t expected_rx_size) {
|
||||
break;
|
||||
}
|
||||
|
||||
printf("[i2c3] EXEC slave=0x%02X dir=%c cmd=0x%02X tx=%zuB rx=%zuB stack=%zu\n",
|
||||
TRACE("[i2c3] EXEC slave=0x%02X dir=%c cmd=0x%02X tx=%zuB rx=%zuB stack=%zu\n",
|
||||
slave_addr, dir_read ? 'R' : 'W', cmd, tx_buf.size(), rx_buf.size(),
|
||||
ev_stack.size());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user