Old Regen pages

AamirM's Regen forum

Moderator: AamirM

Locked
Eke
Very interested
Posts: 885
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Fri Apr 04, 2008 8:03 pm

AamirM wrote:Your emulator runs 68k cycle-by-cycle... right?

AamirM
yes, interrupts are handled on a cycle basis, latency is also "emulated" (there is a small delay between INT activation in VDP register and INT occurence)

8bitwizard
Very interested
Posts: 159
Joined: Sat Feb 24, 2007 11:35 pm
Location: San Antonio, TX

Post by 8bitwizard » Fri Apr 04, 2008 8:53 pm

HardWareMan wrote:A fully endorse. However, breakpoint for access at address will be more useful than breakpoint on PC. Very ask this.
For example, if breakpoint to access to memory $FF0001, a0=$FF0000, then the opcode move.l d1,$0001(a0) will breakpoint cause. Well, and so forth.
Actually both break on PC address and memory access are good, also break on memory read or memory write is useful too.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Post by King Of Chaos » Sat Apr 05, 2008 1:35 am

Since you guys would probably know this (since I'm curious) can any of you guys explain why some (just a few actually) Pro Action Replay codes created and working in Kega don't work in Regen without modification?

My questions are the following...

1) I've been told that odd numbered RAM addresses writes aren't supported, hence why you have to change it to a lower even numbered address. But Kega supports odd numbered RAM PAR addresses. Why and how?

2) The offsets seem to be a little off in Regen (or is it Kega?). Take the codes below for disabling water in levels. What's the first Kega version code doing that the 2nd Regen version code (that's a higher offset) isn't? Why doesn't Kega's offset for the same code work in Regen?

If you want an example, compare the following PAR codes for Sonic The Hedgehog. The first set works in Kega, the second works in Regen after modification. I'm interested in the technical inner workings of both, just in case. :)

Code: Select all

[0]
Name=MASTER CODE (MUST BE ENTERED)
0=Off
1=On,000338:6004

[1]
Name=Enable Stage Select
0=Off
1=Enable,FFFFE0:0001
2=Disable,FFFFE0:0000

[2]
Name=Enable Debug Mode
0=Off
1=Enable,FFFFFA:0001
2=Disable,FFFFFA:0000

[3]
Name=Chaos Emerald Modifier
0=Off
1=None,FFFE57:0000
2=One,FFFE57:0001
3=Two,FFFE57:0002
4=Three,FFFE57:0003
5=Four,FFFE57:0004
6=Five,FFFE57:0005
7=Six,FFFE57:0006

[4]
Name=Invincibility
0=Off
1=On,FFD031:0045

[5]
Name=Infinite Lives
0=Off
1=On,FFFE12:0009

[6]
Name=Rings Modifier
0=Off
1=1 Ring,FFFE21:0001
2=50 Rings,FFFE21:0032
3=100 Rings,FFFE21:0064
4=101 Rings,FFFE21:0065

[7]
Name=Never Drown Underwater
0=Off
1=On,FFFE14:FFFF

[8]
Name=Disable Water In All Levels
0=Off
1=On,FFF648:0009

Code: Select all

[0]
Name=MASTER CODE (MUST BE ENTERED)
0=Off
1=On,000338:6004

[1]
Name=Level Select
0=Off
1=Enable,FFFFE0:0001
2=Disable,FFFFE0:0000

[2]
Name=Debug Mode
0=Off
1=Enable,FFFFFA:0001
2=Disable,FFFFFA:0000

[3]
Name=Chaos Emerald Modifier
0=Off
1=None,FFFE57:0000
2=One,FFFE57:0001
3=Two,FFFE57:0002
4=Three,FFFE57:0003
5=Four,FFFE57:0004
6=Five,FFFE57:0005
7=Six,FFFE57:0006

[4]
Name=Invincibility
0=Off
1=On,FFD030:0045

[5]
Name=Infinite Lives
0=Off
1=On,FFFE12:0009

[6]
Name=Rings Modifier
0=Off
1=1 Ring,FFFE20:0001
2=50 Rings,FFFE20:0032
3=100 Rings,FFFE20:0064
4=101 Rings,FFFE20:0065

[7]
Name=Never Drown Underwater
0=Off
1=On,FFFE14:FFFF

[8]
Name=Disable Water In All Levels
0=Off
1=On,FFF648:0993
Thanks in advance guys. This sort of thing really interests me, and I've been wondering this for awhile now.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Sat Apr 05, 2008 6:10 am

For ROM addresses, the data is 16-bit. For RAM addresses, the data is 8-bit.

I believe you should have been told that odd ^ROM^ addresses aren't supported. That would make more sense.

For RAM addresses, only the lower byte should apply.

Regarding this code:

Code: Select all

FFFE14:FFFF
I would guess the upper FF has no effect.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Post by King Of Chaos » Sat Apr 05, 2008 3:05 pm

Thanks. I got another question, if you were going to do PAR correctly in an emulator, how would you do it (assuming you'd do it like Kega does)?

Captain Boomerang
Interested
Posts: 13
Joined: Sat Apr 05, 2008 9:35 pm
Location: Logan City, Queensland

Post by Captain Boomerang » Sat Apr 05, 2008 9:42 pm

Hi,

I'm the guy who fixed the typos in the readme file about a month ago. I like to make a suggestion to split the readme part of the file and the version history of the file into two different files since both together will make the readme file large. I've already done this for you and you can download the split files from the following link: http://rapidshare.com/files/105165294/R ... s.zip.html

A couple more things, I'd like to make a couple requests to enhance the system lockup emulation to silently lockup without the dialog box. I suggest something like "LockupDialog" to disable it on and off. The last request is cleaning up of the INI file to help make it easier to read and understand. Look at Kega Fusion's created INI file for a good idea how clean and arranged it can be. I've created an example for you, which can be downloaded from the following link: http://rapidshare.com/files/105167257/regen.ini.html

My last requests is for you to create font files using the font Kega uses. I'm sure Tiido knows what it is, since he appears to use it in his emulator detection program. I also request that you add a INI setting to flip around the message and FPS location. My next request is that you add to the messages for the loading and unloading of cheats and things like that. My last request is to make sure multiple messages can be on the screen at the same time like Kega does. I'm hoping these can be done, so I can use Regen as my main emulator from that point on.

Lastly, I was looking at the ZSNES forum topic earlier, and somebody reported having issues with Regen not opening the last location of the previously opened ROM, and that it would open to the cheats folder or something like that. The way to remedy this is to borrow the "LastGenesisROM" INI function from Kega Fusion's configuration. I'm sure there's a couple things from Kega's INI that you can borrow and use in Regen.

I'll try not to be a stranger or lurker so I can keep track of this wonderful emulator you've made Aamir. I will be following this closely and if I have anything else to contribute, I'll be sure to. Thanks for your time, patience, kindness and the development of this fantastic emulator!

-Adam

P.S. I wish to input my vote to have Ultimate Mortal Kombat Trilogy supported. You can probably do this with a switch in the INI settings just for that game.

P.P.S. You guys really should submit Regen to emulation news sites, so Aamir can get more exposure for this emulator.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Sun Apr 06, 2008 9:31 am

King Of Chaos wrote:Thanks. I got another question, if you were going to do PAR correctly in an emulator, how would you do it (assuming you'd do it like Kega does)?
So, you're assuming that Kega does it correctly then? :wink: OK, maybe it does.

I don't know about PAR specifically, but the general idea is this: allow all writes to RAM; if a read occurs from a patched address, replace it with the appropriate patch data.

You could patch the ROM by writing the patch data directly the ROM in memory, though you'd need to replace the original data when a code is disabled. However, RAM access needs to be intercepted, unless you simply rewrite the data at a constant rate (which may be less reliable).

If you want to support all cheat codes (PAR and GG), you'll have to differentiate between 8-bit and 16-bit RAM patch codes. If you care to be kind, you could give users the option to create 16-bit RAM patch codes in the easy-to-read PAR format.

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Sun Apr 06, 2008 10:01 am

Hi,
Captain Boomerang wrote:I'm the guy who fixed the typos in the readme file about a month ago. I like to make a suggestion to split the readme part of the file and the version history of the file into two different files since both together will make the readme file large. I've already done this for you and you can download the split files from the following link: http://rapidshare.com/files/105165294/R ... s.zip.html
Thanks and thanks. I'll do it.
Captain Boomerang wrote:A couple more things, I'd like to make a couple requests to enhance the system lockup emulation to silently lockup without the dialog box. I suggest something like "LockupDialog" to disable it on and off.
Already done. See the regen.ini file. There is also an option to disable lockups but if they are enabled then emulator will show a message instead of a dialog box.
Captain Boomerang wrote:My last requests is for you to create font files using the font Kega uses.
I'll be adding an option in the next version so you can select any Windows font you have and convert it into the font file that Regen can use.
Captain Boomerang wrote:My next request is that you add to the messages for the loading and unloading of cheats and things like that. My last request is to make sure multiple messages can be on the screen at the same time like Kega does.
You'll see that in the next version.
Captain Boomerang wrote:The way to remedy this is to borrow the "LastGenesisROM" INI function from Kega Fusion's configuration.
If you notice, there is no difference between the LastGenesisROM and FileHistory0 entry in Kega's config file. So in Regen I set the directory to there.
Captain Boomerang wrote:P.S. I wish to input my vote to have Ultimate Mortal Kombat Trilogy supported. You can probably do this with a switch in the INI settings just for that game.
Sorry, but this will not happen :(. This game is doing things that are not possible on a real genesis. Although the use of a switch in config file is a good idea but then I'll have to add many checks in the memory handlers which will slow down the emulator. Sorry again.

Thanks for all your suggestions and feedback.

stay safe,

AamirM

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Sun Apr 06, 2008 10:34 am

Hi,
TascoDLX wrote:I don't know about PAR specifically, but the general idea is this: allow all writes to RAM; if a read occurs from a patched address, replace it with the appropriate patch data.
This is exactly the way it is done in Regen right now.

Although I am not sure, but I think PAR was only for intercepting RAM reads.
TascoDLX wrote:However, RAM access needs to be intercepted, unless you simply rewrite the data at a constant rate (which may be less reliable).
I am 85% sure that RAM is intercepted instead of being written constantly. I tried writing to RAM constantly too, but that resulted in game generating address errors or illegal instruction errors. But that may also be because I am doing something wrong. I remember Sonic 1 displaying 'LINE 1111 EMULATOR $0000D2F6'. I'll try it again and post a screenshot if I get it again.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Post by King Of Chaos » Sun Apr 06, 2008 1:13 pm

I was told the difference between Kega and Regen's PAR abilities right now is that Regen is doing word writes all the time. If the value to write is smaller than 0x100, it is a byte write, if it's larger, it's a word write. That's why some of them don't work (and why some do). =P

What actually bugs me most in general is the fact there's no documentation on how either the Game Genie or AR/PAR/PAR2 works technically.

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Sun Apr 06, 2008 1:21 pm

King Of Chaos wrote:I was told the difference between Kega and Regen's PAR abilities right now is that Regen is doing word writes all the time. If the value to write is smaller than 0x100, it is a byte write, if it's larger, it's a word write. That's why some of them don't work (and why some do). =P

What actually bugs me most in general is the fact there's no documentation on how either the Game Genie or AR/PAR/PAR2 works technically.
Regen does not actually do any writes. It just detects a certain address and returns the data. And they are detected for both word and byte writes.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Post by King Of Chaos » Sun Apr 06, 2008 1:23 pm

AamirM wrote:
King Of Chaos wrote:I was told the difference between Kega and Regen's PAR abilities right now is that Regen is doing word writes all the time. If the value to write is smaller than 0x100, it is a byte write, if it's larger, it's a word write. That's why some of them don't work (and why some do). =P

What actually bugs me most in general is the fact there's no documentation on how either the Game Genie or AR/PAR/PAR2 works technically.
Regen does not actually do any writes. It just detects a certain address and returns the data. And they are detected for both word and byte writes.
Ah, there goes that idea then. =P A lot of great research from looking into these would actually make great documentation and tutorials on how they work.
P.S. I wish to input my vote to have Ultimate Mortal Kombat Trilogy supported. You can probably do this with a switch in the INI settings just for that game.
If that hack used bank switching, it'd work in Kega and probably Regen too.
My last requests is for you to create font files using the font Kega uses.
I'm actually curious on which font it does use, since it looks all hawt and stuff. =P

HardWareMan
Very interested
Posts: 746
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Sun Apr 06, 2008 3:20 pm

King Of Chaos wrote:
P.S. I wish to input my vote to have Ultimate Mortal Kombat Trilogy supported. You can probably do this with a switch in the INI settings just for that game.
If that hack used bank switching, it'd work in Kega and probably Regen too.
No, it does not. Just plain solid space from $000000 to $9FFFFF.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Sun Apr 06, 2008 6:16 pm

King Of Chaos wrote:What actually bugs me most in general is the fact there's no documentation on how either the Game Genie or AR/PAR/PAR2 works technically.
For Game Genie info, check out US Patent #5,112,051. It's may be a little slanted towards the NES but the general concept is broad enough.
AamirM wrote:Although I am not sure, but I think PAR was only for intercepting RAM reads.
I never got that impression (because of the format of the code). But it's not like I have first-hand experience with the PAR.
AamirM wrote:Regen does not actually do any writes. It just detects a certain address and returns the data. And they are detected for both word and byte writes.
Correct. There should be no writes, just intercepted reads.

Remember, if a word read occurs on RAM and a byte is patched there (check address & 0xFFFFFE), you must return half of the current word combined with the patched half. Make sure you patch the correct half.

The current state of PAR codes is a bit SNAFU, what with the Gens PAR bug/discrepancy. I'd prefer a system that allowed patching multiple bytes at any address. A PAR code like FFFFFA:0001 should look more like FFFFFA-01 to avoid confusion, and you could easily create a code like FF0000-53454741 without the tedium.

And perhaps if there was a system that allowed patching on the Sega CD, both MAIN and SUB side?

Feel free to steal any of these ideas. :wink:

TmEE co.(TM)
Very interested
Posts: 2443
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 06, 2008 6:33 pm

Real PAR can write to RAM... AFAIK. I made some PAR code's for Duke3D, which locations are in RAM and one friend of mine reported they work on real HW with real PAR.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Locked