Jump to content
  • 0
desertfish

how to reset the machine from software?

Question

I'm trying to reset the machine from software, by using JMP ($FFFC)     --  FFFC is the 65c02's software reset vector is it not? (The vector points to $DE86-  I've also tried a basic program with sys $de86 )

However, this is not really succesful.  Best result that I get is that the program simply returns to the basic ready prompt. Worst result is that the emulator crashes and dumps core.

Any insights on this?

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Are you making sure to set the ROM bank to 0 first? I took a look at what the RESET command does, and it pretty much just sets the ROM bank to 0 and jumps to ($FFFC), so I'm not sure why it wouldn't work for you.

Edited by Ender

Share this post


Link to post
Share on other sites
  • 0

Hijacking this thread. Is there a way for a reset that does preserve the BASIC memory? 

I try to reset the screen to defaults including CHARROM and Pallette and was not successful as of now (other than saving and copying the stuff)

Share this post


Link to post
Share on other sites
  • 0
29 minutes ago, SerErris said:

Hijacking this thread. Is there a way for a reset that does preserve the BASIC memory? 

I try to reset the screen to defaults including CHARROM and Pallette and was not successful as of now (other than saving and copying the stuff)

If you reset the video settings, then you just need to restore the ROM bank to 4 and then just RTS from the initial RUN/SYS call. Make sure you don't have anything left on the stack from your program! This should bring you right back to the READY prompt and your program should still be in memory and runnable from BASIC.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

edit ... fixed my inital problem - thanks for you response 🙂

Edited by SerErris

Share this post


Link to post
Share on other sites
  • 0
On 9/6/2020 at 11:18 PM, desertfish said:

I'm trying to reset the machine from software, by using JMP ($FFFC)     --  FFFC is the 65c02's software reset vector is it not? (The vector points to $DE86-  I've also tried a basic program with sys $de86 )

However, this is not really succesful.  Best result that I get is that the program simply returns to the basic ready prompt. Worst result is that the emulator crashes and dumps core.

Any insights on this?

Note that the Basic Ready prompt is what should happen after a system reset ... at least until the power up options from the RTC NVRAM become available ... but it seems that what is going on is that a hardware reset will also reset the Bank register directly, so the reset routine doesn't have to do that itself. So the reset routine expects to be executed with the banks (both RAM and ROM) in their own reset state.

Share this post


Link to post
Share on other sites
  • 0

Interesting, I wonder what the C64 did if you banked out the kernal rom and then caused a hardware reset.   I vaguely remember resetting the machine not always working (unless using something like the reset button on a final cartridge) so it could very well be that it didn't bank the roms in before calling the reset vector then.....

Anyway I'm using this now to software-reset the Cx16 and it works:  sei ; stz cx16.d1prb ;  jmp ($fffc)

Share this post


Link to post
Share on other sites
  • 0

A hardware reset (that is actually pulling the resetline up) will also reset the banking to default (like you power on). Reset not working was a software reset. And that might be the same issue. If you call the reset routine and you do not see the KERNAL rom, then you will be out of luck ... 

The procedure you created is the save method of calling a reset, yes. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use