Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"R PC RESET" and "G" #450
I'm having a problem "resetting" the emulator and having it "restart". I'm not sure what I'm doing wrong.
At this point I hear the Apple "BEEP!", but it has not rebooted the disk. I am at an AppleSoft prompt with the previous AppleII+ screen displayed. I was expecting the normal disk reboot and hello program to execute, etc.
Q: What is the proper way to "reset" or "restart" the emulator (without restarting AppleWin.exe)?
I'm usually in the debugger and at some point I get all messed up or don't hit a breakpoint when I think I should have. I therefore want to restart the emulation, hit my first breakpoints again and perhaps set other breakpoints. I'd like to do this without having to completely close the AppleWin program. The Help file mentions "R PC RESET" and I was hoping this would be the way to do it.
Is this a bug?
$FA62 is the reset routine. The soft reset vector ($3F2-4) is in a good state, so it doesn't reboot.
This is normal on any Apple II. To reboot a II or II+ you had to PR#6 or power cycle the machine. This is why the three key salute (Ctrl-OpenApple-Reset) was added in the //e.
But in AppleWin you can just click the Apple button or press F2. The Buttons on the right map to the function keys. F1 is help etc ...
Thanks for the response Nick.
After I posted this issue I realized the reset vector was likely part of my problem.
But just pressing F2 also does not give me what I want. For example:
The expectation is to hit the breakpoint at $B747 again since I'm "starting over".
It seems at step 4.1 I need to do the following:
4.1) 3F2: 0 0 0
and then either or G.
I was hoping there was a "push one button to reset everything" option, but apparently not.
Another thought is to add steps 4.1 and 4.2 to my "Debug.txt" script.
I suppose there might be other "gotchas" here too. For example, if I have the LANGUAGE CARD ram selected at the time that I want to "start over".
I suppose you could use scripting. I must admit I haven't explored it much.
Probably only one soft reset vector byte needs changing, e.g. 3f2:0.
And because you're only interested in the reboot, so you could omit the above simply do:
Changing only 3F2 to 0 will usually work, but won't work if the Soft Entry Vector (3F2) is the address which falls on an even page boundary (say $E000) and 3F3 and 3F4 are set up properly.
Once things start to get messed up with the emulation (because of fat fingers, or just dumbness on my part), and I want to "restart from scratch", I think it will almost always be better to force the emulation through the monitor "RESET" code at FA62 and not just start with C600G. For example, if I've already stepped through code that has altered 3F2 then just C600G won't get me back to the same state I was in before. In addition, I'm not sure what happens with C600G if the wrong RAM bank is selected.
Seems like scripting and the "X" in the upper right corner are the two easiest ways to "restart from scratch".
Heh, that'll teach me to reply on my way out before testing! Yes, 3F3 or 3F4 is what you need to change. In any case, after having a play I still think F2 does what you want - it actually resets the machine state including memory switches and contents, but leaves the debugger config like breakpoints etc intact. If you're in the debugger and hit F2 (Ctrl-F2 does only a reset, BTW) then the whole machine is reset and you're left in the debugger at FA62. You just need to hit F7 or G<Enter> and the reset continues then breaks at your breakpoint. Cheers, Nick.
Yes, that's the intent.
I've tested this with 184.108.40.206. My testing was not very intensive, but the issue is fixed.
After entering the debugger, I can now use F2 to get a "clean" restart of the emulation, which is different behavior from earlier AppleWin versions.
Since I'm here and this is related, I do have two more observations regarding use of F2. Not sure if they need to be separate issues.
I see the word "stepping" on the right hand side of the screen below the buttons and below the T/S disk designations. I've not seen that word over there before and was wondering if this is by design.
"[Stepping]" is in the titlebar. This was not expected. There are no breakpoints set. The emulator runs very slowly at this point. Booting "DOS3.3 (1980) Master Diskette" from Apple usually takes about 30 seconds to boot to the AppleSoft prompt, but in Stepping mode now (with no breakpoints set), it takes 90 seconds.
And if I continue from above and press F7 twice, then "[Stepping]" disappears from the title bar.
referenced this issue
Aug 8, 2017
Using F2 to "reset" the emulator does not reset the disk drives to inactive state.
If the intention for using F2 to "reset" the emulator is to make it more convenient than closing and restarting AppleWin, then what should happen with disk drives that are "spinning" when you press F2 while in the debugger?
Start AppleWin in AppleII+ mode
Note, I think I opened an issue a long time ago about the disk drive light being on when it sometimes should not be on. I'm not sure if that's a part of this problem or not.