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

"R PC RESET" and "G" #450

Closed
TommyGH opened this Issue Jul 31, 2017 · 12 comments

Comments

Projects
None yet
4 participants
@TommyGH

TommyGH commented Jul 31, 2017

AppleWin1.26.1.1
Debugger2.9.0.1
Windows10.

I'm having a problem "resetting" the emulator and having it "restart". I'm not sure what I'm doing wrong.

  1. Start AppleWin in AppleII+ mode.
  2. Load a DOS disk into drive 1.
  3. to boot disk
    see AppleSoft prompt.
  4. to enter debugger
  5. R PC RESET
    to reset emulator to FA62.
  6. G
    to restart the AppleII+.

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?
Is it user error?

Please advise.

@sicklittlemonkey

This comment has been minimized.

Show comment
Hide comment
@sicklittlemonkey

sicklittlemonkey Jul 31, 2017

Contributor

$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 ...

Cheers,
Nick.

Contributor

sicklittlemonkey commented Jul 31, 2017

$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 ...

Cheers,
Nick.

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Jul 31, 2017

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:

  1. Start AppleWin and place DOS disk in Drive 1.
  2. enter debugger
  3. BPR PC=b747
  4. G
    The breakpoint hits.
  5. to restart

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
4.2) R PC RESET

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".

Tommy

TommyGH commented Jul 31, 2017

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:

  1. Start AppleWin and place DOS disk in Drive 1.
  2. enter debugger
  3. BPR PC=b747
  4. G
    The breakpoint hits.
  5. to restart

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
4.2) R PC RESET

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".

Tommy

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Jul 31, 2017

Grrrrr, I just realized in my posts to this issue that I should not use less than (<) or greater than (>) characters around my "F2" key designations in my descriptions.

TommyGH commented Jul 31, 2017

Grrrrr, I just realized in my posts to this issue that I should not use less than (<) or greater than (>) characters around my "F2" key designations in my descriptions.

@sicklittlemonkey

This comment has been minimized.

Show comment
Hide comment
@sicklittlemonkey

sicklittlemonkey Jul 31, 2017

Contributor

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:
C600G.

Cheers,
Nick.

Contributor

sicklittlemonkey commented Jul 31, 2017

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:
C600G.

Cheers,
Nick.

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Aug 1, 2017

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".

Tommy

TommyGH commented Aug 1, 2017

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".

Tommy

@sicklittlemonkey

This comment has been minimized.

Show comment
Hide comment
@sicklittlemonkey

sicklittlemonkey Aug 1, 2017

Contributor
Contributor

sicklittlemonkey commented Aug 1, 2017

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Aug 1, 2017

Contributor

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.

Yes, that's the intent.

This change was done at 124eca4, in at least experimental v1.26.2.3.
NB. The latest is experimental v1.26.2.4.
@TommyGH - try upgrading from 1.26.1.1 to this latest version.

Contributor

tomcw commented Aug 1, 2017

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.

Yes, that's the intent.

This change was done at 124eca4, in at least experimental v1.26.2.3.
NB. The latest is experimental v1.26.2.4.
@TommyGH - try upgrading from 1.26.1.1 to this latest version.

@sicklittlemonkey

This comment has been minimized.

Show comment
Hide comment
@sicklittlemonkey

sicklittlemonkey Aug 3, 2017

Contributor
Contributor

sicklittlemonkey commented Aug 3, 2017

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Aug 5, 2017

I've tested this with 1.26.3.0. 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.

Observation 1:

  1. Start AppleWin 1.26.3.0
  2. F7 to enter debugger
  3. BPR PC=0
  4. F7 to start booting
  5. Note title bar has "[Stepping]" as expected
  6. F6 for Full Screen Mode

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.

Observation 2:

  1. Start AppleWin 1.26.3.0.
  2. Boot a DOS disk.
  3. F7 to enter debugger.
  4. F2 to reset the emulator.
  5. G to start the emulation.

"[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.

Tommy

TommyGH commented Aug 5, 2017

I've tested this with 1.26.3.0. 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.

Observation 1:

  1. Start AppleWin 1.26.3.0
  2. F7 to enter debugger
  3. BPR PC=0
  4. F7 to start booting
  5. Note title bar has "[Stepping]" as expected
  6. F6 for Full Screen Mode

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.

Observation 2:

  1. Start AppleWin 1.26.3.0.
  2. Boot a DOS disk.
  3. F7 to enter debugger.
  4. F2 to reset the emulator.
  5. G to start the emulation.

"[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.

Tommy

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Aug 8, 2017

Contributor

Closing as questions about "Stepping" have been moved to #457.

Contributor

tomcw commented Aug 8, 2017

Closing as questions about "Stepping" have been moved to #457.

@tomcw tomcw closed this Aug 8, 2017

@tomcw tomcw added this to the 1.27 milestone Aug 10, 2017

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Aug 11, 2017

Emulator: 1.26.3.0
Debugger: 2.9.0.8

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
Place a bootable disk in drive 1.
F7
bpr pc=801
F7
breakpoint hits
drive 1 disk light is on
F2 to reset emulation
F5 to "swap" disks
See a dire warning message about not swapping disks while the drive is still spinning.

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.

TommyGH commented Aug 11, 2017

Emulator: 1.26.3.0
Debugger: 2.9.0.8

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
Place a bootable disk in drive 1.
F7
bpr pc=801
F7
breakpoint hits
drive 1 disk light is on
F2 to reset emulation
F5 to "swap" disks
See a dire warning message about not swapping disks while the drive is still spinning.

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.

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 28, 2017

Contributor

This is why the three key salute (Ctrl-OpenApple-Reset) was added in the //e.

Ha! Everything M$ copies Apple did it first ... color me not surprised.

Contributor

Michaelangel007 commented Aug 28, 2017

This is why the three key salute (Ctrl-OpenApple-Reset) was added in the //e.

Ha! Everything M$ copies Apple did it first ... color me not surprised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment