You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm playing with the idea of stopping the execution of a game (and going to the debugger) when a certain condition is met, directly inside the logic of dos.cpp, but I think I'm doing something wrong here. (note: I cannot directly use breakpoints because I don't know the address to watch)
My usecase is simple: at some point, my game opens a file handle, and I want to identify the exact segment/offset/opcode when that happens. To do this, I've modified DOS_21Handler in dos.cpp, and in the switch case for instruction 0x3d (open file), I've added if (name1 == "MYFILENAME") { DEBUG_Enable_Handler(true); }
expecting that this would force the game to pause and give focus to the debugger. It actually does break correctly! On paper, the logic inside DEBUG_Enable_Handler should retrieve the current values for all registers, as well as the address for the next instruction. But somehow, the found segment and offset are completely wrong, the debugger points to invalid memory.
Any pointers to what I could be doing wrong would be greatly appreciated!
Thanks in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I'm playing with the idea of stopping the execution of a game (and going to the debugger) when a certain condition is met, directly inside the logic of dos.cpp, but I think I'm doing something wrong here. (note: I cannot directly use breakpoints because I don't know the address to watch)
My usecase is simple: at some point, my game opens a file handle, and I want to identify the exact segment/offset/opcode when that happens. To do this, I've modified DOS_21Handler in dos.cpp, and in the switch case for instruction 0x3d (open file), I've added
if (name1 == "MYFILENAME") { DEBUG_Enable_Handler(true); }
expecting that this would force the game to pause and give focus to the debugger. It actually does break correctly! On paper, the logic inside DEBUG_Enable_Handler should retrieve the current values for all registers, as well as the address for the next instruction. But somehow, the found segment and offset are completely wrong, the debugger points to invalid memory.
Any pointers to what I could be doing wrong would be greatly appreciated!
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions