vc64web/virtualc64web

reset not working in some cases

Closed this issue · 5 comments

it happend when something did go completely wrong ... for example changing roms during gameplay or so ... but this is hard to reproduce.

now I have found a case which is reproducable:

  1. run square booze demo

grafik

  1. open virtual keyboard type run-stop + restore

  2. press reset button in the navbar

grafik

  1. now the emulator is completely frozen ...

sidenotes:

  • it happens with both types of roms e.g. original roms and open roms
  • pressing reset again changes nothing ... still hangs
  • it works in the 3.4 version

HAL said he knows we want to disconnect him 😬

BD0CD27B-D239-4B24-87B6-9C986DC6D85C

I did some more investigation ... for this I added this actionbutton
grafik

when pressing the 'c' key it shows us the cpu cycle count

findings...

after runstop-restore CPU count counts very slowly...

after reset it is resetted to zero ... good 🤓

after a couple of seconds I pressed 'c' and it shows this ...🤔

grafik

the count value increases but it should be much much much higher ...

it increases steadily but only by a small number

I have found another case in which the problem is reproducable ....

  1. load the aluminium hearts demo (preferrable via csdb browser)

https://dirkwhoffmann.github.io/virtualc64web/#http://csdb.dk/getinternalfile.php/198962/ald-aluminium.prg

  1. load and flash falcon_patrol2.prg via fileslot (via fileslot it does not make an automatic reset before flashing)

now we have the same situation ... reset is received by the core but not working ... cpu cycles increases very slowly ... it responds to pause and run but the screen output seems frozen ... when in run state it does something it eats the same amount of HOST-CPU power but advances the c64-CPU only at a very small step ..

BTW: is not more correct to always execute auto reset before we inserting a .prg or .crt via fileslot, like we do when we come from the scene browser module ? 🤔

I found the problem ... the variable runLoopCtrl in C64.cpp is 2 in both reproducable cases .... setting it to 0 directly after reset() fixes it ...

I think 2 means RL_CPU_JAMMED right?

Code fix is checked in (both dev and master branch)