Closed xlar54 closed 6 years ago
uhm.. seems to work fine in my implementation, it might have something to do with memory banking?
I have just tested setting the value to 0xff within the Memory class constructor, peek() reads the right value and poke seems to overwrite it just fine
ok cool, thank you. Ill see what Im doing wrong. Appreciate the double check!
no problem :), see if you can add some debug code around Memory::read_byte and Memory::write_byte, maybe memory banking is screwing things up.. IIRC even in the actual C64 you could effectively write values to the underlying RAM but reading would yield the ROM values due to the memory banking config.
I figured it out, thanks! I was patching ROM inside a call to your setup_memory_banks() function. Works fine for ROM, but I added a RAM patch in there also, and due to the banking, you were 100% right. I extracted a patch_ram() function and it works perfectly. Thanks again. (In my case, I have an ML monitor that I want available to me while Im working on the OS, and so patching RAM is needed).
great!, I remember I went across similar issues when I first wrote the memory banking support that's why it sounded familiar :)
Hey Mario,
One question I have for you - dont know if its my implementation or if you can replicate it in your code. If I patch RAM such as:
memram[0xc000] = 0xff;
It will place that value just fine. But if I try to POKE a new value into that memory location, it treats it like a ROM and wont overwrite those values. Seems to happen anywhere I set RAM.
Could you try this and see if you get the same problem?