What sort of patching system patching system do you want? (sorry if you mentioned already. I forget things). I think you want something that can inject code in the ROM for things like trainers and/or making hacks to get some unlicensed games work.TascoDLX wrote:I don't care about PAR codes. I think you shouldn't support them at all. However, I would like to see a decent patching system, something far better than what Fusion has. The current cheat system in Regen doesn't appeal to me at all.
When I very first implemented the PAR I refreshed the RAM every scanline but I still remeber it didn't work for Sonic 2 chaos emerald cheats until I intercepted the reads and returned the patched data. I think that Fusion runs 68k opcode-by-opcode (cycle-by-cycle would be incorrect to say) and updates PAR codes after some cycles (half scanline?). But thats just what I think, only Steve knows.TascoDLX wrote:That being said, I've done some more tests. It seems when a PAR code (affecting RAM) is enabled in Fusion, the value is written to RAM and is rewritten (or refreshed) in a somewhat frequent manner.
For instance, in Power Rangers, I set 16 codes (byte-sized) [or 8 codes (word-sized)] to write 5A to FFD080 thru FFD08F, then a save state reveals this:
Code:
FFD080 : 0000 5A5A 0000 5A5A 5A57 58DA 5A5A 5A5A
All bytes are being set but the data has changed as a few loops have elapsed since the last refresh (roughly three loops here, but usually less it seems). I don't know when or how often the refresh occurs, only Steve would for sure.
Maybe. But AFAIK, Game Genie codes are used (or it was designed) to patch ROM. Although a RAM address can be converted to Game Genie code but I remember reading somewhere that it was not always possible and didn't worked either in emus or in real thing. In Regen, currently, if the patch address is in ROM it is patched once only and no need to refresh it, of course until you turn of the cheat whereby the previous value is written. No Game Genie problems have been reported thus far.TascoDLX wrote:However, I do believe the cheat method of intercepting RAM reads is the method employed by the Game Genie and I would say is the more favorable method.
Well now is good time to clear some things up and since now PAR is working correctly, I can say it with more confidence . Also note that I am assuming that PAR intercepted reads and didn't write and this is the way it is done in Regen. I have told this many times but many people have failed to clearly understand this point. Well here we go then:TascoDLX wrote:The code FFD081:0060 (not a useful code, mind you) is doing FFD080 = 0060. This should be FFD081 = 60.
1) Sik said that AAAAAA:00DD is byte write only. I have already said that Regen doesn't do any writes, so what I thought he meant was that it is only intercepted for byte reads. Maybe I thinked wrong but this is wrong.
2) As for your above example, you wrote a byte (FFD081 = 60) but when you read a word from there its byte-swapped. Although FFD080:5880 case is not correct indeed. It needs to return 8058. I'll fix it.
stay safe,
AamirM