spjewkes / jrnz

A work-in-progress ZX Spectrum emulator
MIT License
1 stars 0 forks source link

Program is hanging when PC hits 0xffff with memory zero'ed to NOPs #26

Closed spjewkes closed 5 years ago

spjewkes commented 5 years ago

This is reproduced by running with the '--debug' option only. It will run through memory to 0xfffe and then stop.

I vaguely remember when I did the initial work on this I put something in to stop the code running wild but I my memory is a little sketchy on this now. I've not spotted anything obvious and I'm worried that this may be a nastier issue to do with the way we're handling memory (i.e. we're relying on 16-bit types to wrap for us when access the memory array).

spjewkes commented 5 years ago

Issue was to do with the bus class's dump_mem_at() function. It was trying to access the memory out of bounds. Fixed by using a 16-bit address that will wrap when dumping.