spjewkes / jrnz

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

Make ROM read only #25

Open spjewkes opened 5 years ago

spjewkes commented 5 years ago

I hit an issue where something was rightly or wrongly changing the ROM. We need to make this area of memory unwritable. This isn't as easy as I'd have hoped as we're using the operator[] to access memory easily to handle some of the operands (my memory is hazy but I think we have pointers to areas we may want to write to).

One solution could be to maintain a separate array for the ROM which is returned for reading. Writing to where the ROM should be will go somewhere else and be unaccessible. My only slight worry is how this plays with StorageElements. It may be that I need to rethink how I'm doing this completely.