News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Which Megadrive Emulator Should I Put My Effort Into?  (Read 4578 times)

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Which Megadrive Emulator Should I Put My Effort Into?
« on: February 09, 2015, 08:29:10 am »
Hey folks,

Been a while, many happy returns, wb and all that.

So after a while doing other things I'm getting back into the old rom hacking game and after dusting off my old emulators and refreshing myself on the docs I got thinking that maybe there have been some interesting developments in the several years since I last picked anything up.

I'm really only interested in the Megadrive and am at the point where my main interest is in the game's assembly (I'm happy reading it in traces and doing basic updates to the code in the ROM files). The method I tend to use is the way well described in Tony Hedstrom's document How to Make Genesis Game Genie Codes With Gens Tracer in which he uses Gens Hacking Version and Gens Tracer to find the routines of interest. I see however in a topic at gamehacking.org a user called Pugsy recommends a different method using HazeMD.

Now I like Gens and am keen to keep using it however I'll probably experiment with others beforehand. However I was thinking it would be very handy if Gens Hacking and Gens Tracer were merged into one. Since I have the source to Gens Tracer I thought about doing so but, not wanting to re-invent the wheel, I searched out to see if anyone had already done so and also wanted to check if my source was the latest.

This led to this list here segaretro emu list which shows there are now 7 versions of Gens on the go, the most recent one being Gens/GS II.

I don't want to complete work on an emulator only to find there is another "bigger and better" one already out there that renders my efforts meaningless or has me implementing functionality readily available else where. I'm also not looking to get into a emulator war where I implement some functionality in Emu X only for the owner of Emu Y to go and add it in, I'd rather be involved in something already well established.*

Can anyone provide any guidance on which Megadrive emulator they think I should see about working on / learning about?


(*Please don't think I'm being big-headed and thinking I can just swan into a project and start making changes, I'm not! I'm looking for guidance on the right path to start the journey.)

FAST6191

  • Hero Member
  • *****
  • Posts: 2810
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #1 on: February 09, 2015, 09:11:48 am »
"Please don't think I'm being big-headed and thinking I can just swan into a project and start making changes"
If you can code and understand the concepts behind debugging then chances are you probably can do that for megadrive/genesis debuggers, you would have a far harder time doing it on the NES, SNES, GBA or possibly DS but debugging has not moved with the times in megadrive emulation world and is crying out for something good (I have had to tell so many people around here that cut their teeth in NES/SNES/GBA/DS debugging that megadrive/genesis is doable but nowhere near as nice to work in).
If you wanted something a bit less code heavy then some worked examples of control remapping, cheat injection, hooking and graphics/font handling specifically for the megadrive/genesis could work. If you know the sound system then a modern approach to megadrive/genesis sound hacking would be something worth reading/being able to link up -- if you saw the 5000 texture replacements version of translation hacking on the N64 and found it sat a bit odd with you then I advise you not to go reading up on the "modern" approaches to megadrive audio ripping.

The GBA saw a project to unite (ish) all the various forks of the VBA emulator into one mega emulator, said project being called VBA-m. There is scope for that here as well, however you might do just as well to look at the feature list of fceux and remake it for the megadrive, possibly with any additions you can think up (the z80-68K interactions being something possibly worth looking at). I did make a thread/discussion to see what the features people want out of a hacking emulator once http://www.romhacking.net/forum/index.php?topic=17234 , however "like FCEUX but for another console" was the broad summary of that and similar discussions.


RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #2 on: February 09, 2015, 03:41:56 pm »
Yeah, no problems with concept of debugging. I'm a programmer by trade and have always saw computing simply in terms of loops and ifs, regardless of language, with a little bit extra for the subtle nuances of the language. Doesn't matter if it is Visual Basic for Applications or 68K, it's all comes down to the same thing.

See, I'm thinking I'd have more to give in terms of 'code heavy' work. I know some things I'd like emulators to do to help me discover more about certain roms and I think I could implement some of them even though my understanding of higher level concepts like font and sound handling are minimal / non-existent.

"...look at the feature list of fceux and remake it for the megadrive..." - But using which emulator as a base? I'm not looking to start from the ground up and don't have the time to commit to do so. Besides, so much more can be achieved if people all contribute to the same project rather than splinter of and work on their own. (Seriously, at least 7 versions of Gens? WTF!?)

That's a hell of a shopping list on your link! For me, for the Megadrive, I'd be looking to combine the features from Gens Hacking and Tracer (so hooks, trace logs and code searching) followed by step through debugging, then either reverse step through / step back or function highlighting.

But what emulator do I try and implement this in!?
« Last Edit: February 09, 2015, 03:49:26 pm by RyanfaeScotland »

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #3 on: February 09, 2015, 04:12:36 pm »
My favourite MD emulators for hacking are Regen and Exodus. But they both are closed source.

To my knowledge, the best open source emulator is precisely Gens, but I must admit I don't know this one very well.

I tried one of its version, and found it much more uncomfortable than Regen. If you could implement most Regen features (especially a convenient GUI for breakpoints, watchpoints, logs, etc.) it'd be awesome.

But I'm sorry not to be able to tell you which Gens version you should use. Maybe you should ask your question on Sega-16 or gendev.spritesmind.net

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #4 on: February 09, 2015, 05:10:40 pm »
Having just read through each of the entry pages for the emulators on the sonicretro list I posted I think I'd be inclined to agree tryphon.

Kega is listed as aiming for "...an extremely high importance on accuracy as opposed to speed or other features..." so I am reluctant to work on a project where the key aims seem pretty far from my own.

HazeMD is now part of Mame/Mess project and again, I think they have objects too far flung from Megadrive debugging to be a viable option.

I read on about Regen but nothing jumped out at me: 68000 debugger, 68000 overclocking and Many other features were all that caught me eye (further inspection about the chip emulation is interesting but on an unrelated note). Is the debugger worth checking out?

Exodus has a good looking screenshot, I like the window with all the registers showing especially if it updates in real time (actually only if it does!) and 'All M68000 opcodes' is interesting as a feature. Does this just mean it can process them all or is there more to it?

Anything about them in particular you think really sell them?

Yea, I'll probably go to a more specialised forum once I have a better idea of where to go (which I think I'm starting to form to be honest). I like RHDN as more of a general, wide spread resource where lots of people with a wide variety of experiences gather so it is good to get some general input on before heading somewhere for something more specific (or maybe that is just my skewed version of the place, I really don't hangout as often as I should).

GensKMod is the one by Kaneda, the owner of the site you linked to, and I remember using it a while back and it being very good, lots of useful displays at the very least. I'll be looking to replicate / harness some of that for sure.

EDIT - A look through the topics there shows Kaneda put his source for KMod up on Github just last year. Makes me think it is going to be the place to start from. :) http://gendev.spritesmind.net/forum/viewtopic.php?t=1551 Exciting times.
« Last Edit: February 09, 2015, 05:50:20 pm by RyanfaeScotland »

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #5 on: February 09, 2015, 06:13:04 pm »
Quote
Exodus has a good looking screenshot, I like the window with all the registers showing especially if it updates in real time (actually only if it does!) and 'All M68000 opcodes' is interesting as a feature. Does this just mean it can process them all or is there more to it?

The debugger of Exodus is likely the best among MD emulators. Yes, you can see registers, RAM, VRAM changing on the fly, you can trace VDP calls. Its active disassembly disassemble the game while you play it, thus discriminating perfectly code and data (normally, you can recompile the game after that).

It's almost perfect. It has 2 severe flaws though :

* its interface is heavy : you have to open many windows to make it usable (and AFAIK you're forced to navigate between menus to do that) and you end up with many windows overlapping each other, especially if you have a small screen (I work on a 12" netbook).

* it's SLOW !!! I can run it at 3 - 4 fps with the debugger !

I read on about Regen but nothing jumped out at me: 68000 debugger, 68000 overclocking and Many other features were all that caught me eye (further inspection about the chip emulation is interesting but on an unrelated note). Is the debugger worth checking out?

It's debugger is a little less powerful than Exodus', but all comes in one window, and the emulator itself is much faster (up to 100 fps with my weak PC).

Its main default is that there are some bugs, in emulation (program crashes from time to time) and in debugger (a watchpoint often breaks after the instruction that caused it, sometimes it corrupts RAM, watchpoints on RAM can't discriminate between reads and writes).

Quote
Anything about them in particular you think really sell them?

Both are said to be among the 3 most accurate (the 3rd is Gens).

To be honest, there are lots of features I'd have liked to see implemented in them, but since they are closed source, it's a little delicate to bother their respective authors (have they been open-source, I'd have tried to do them by myself before contacting authors). It seems that Regen's author is unreachable also.

That's just i didn't find anything really awesome for the MD (as I said, I had a bad experience with Gens, but I'm sure it's woth another try) for hacking.

If you could implement a basic but comfortable (this quality is often overlooked) debugger such as the one of Regen for Gens, I think it'd be a really strong base upon which you could develop interesting features (I have a personal list, but FCEUX or the NO$... emulators are full of ideas).

I have a similar project than yours (but not immediately : I'm very reluctant when it comes to code GUIs :) ) and be glad to see your work going

Good luck with your project !

Pennywise

  • Hero Member
  • *****
  • Posts: 2310
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #6 on: February 09, 2015, 06:54:42 pm »
Exodus is intended to be open source sometime in the future, but the scope of the project and the lack of free time on the developer's part is the biggest obstacle for the emulator to really flourish. Given time I think it will end up being one of the best if not the best Megadrive emulator there is.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #7 on: February 10, 2015, 03:40:42 am »
The lack of free time is the main reason why personal project are given up, sometimes even before becoming open source.

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #8 on: February 11, 2015, 09:07:55 am »
I'll make a point of using both Regen and Exodus for a few edits and see how I get on. In the meantime I'm going to contact Kaneda / the KGens crew and see about getting a bit more info from them. Thanks for all the input tryphon.

Exodus is intended to be open source sometime in the future, but the scope of the project and the lack of free time on the developer's part is the biggest obstacle for the emulator to really flourish. Given time I think it will end up being one of the best if not the best Megadrive emulator there is.

The lack of free time is the main reason why personal project are given up, sometimes even before becoming open source.

I can totally understand this. Everyone wants their project to be a certain standard before releasing it into the wild. Hopefully he'll get it to that standard and out there soon, in the meantime if I manage something found to be useful in Gens I'd have no problem it being replicated anywhere people find it useful*.


*T&Cs apply ;)

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6958
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #9 on: February 13, 2015, 09:24:28 am »
I think Regen causes games to break on alignment errors? (I remember Kega appearing to silently do that and I was wondering why my hack wasn't working the first time I did that).

But on something else, I hit another error that I'm surprised didn't have visible symptoms for QUITE a long time: not initialing the Dx counter register for dbra with a word (I'm tempted to use a byte for small values), since it quits when the register underflows to FFFF.
Although that probably isn't something that can be caught during emulation. Not sure if it's what I'm working on (can't say what, I don't think) or if it's common, but it does clr.l Dx: move.b Dx,... (even when using immediate values)
"My watch says 30 chickens" Google, 2018

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #10 on: January 04, 2016, 08:24:46 am »
So I gave Exodus a try but it was crashing each time I tried the debug feature, investigated it myself and reported it but didn't go any further with it.

Instead I went through my tool chain and found that I was using an outdated version of Gens KMod which had quite a few features missing. Now that I've updated that I'm able to view RAM on the fly, can use the tracing from Gens Tracing as an interactive disassembler and with Gens Hacking I can poke RAM values so I think I've got a pretty good thing going, just a pain it is across 3 emulators.

Still tempted to go try Mame as a result but will need to find a day I have a couple of hours free.
« Last Edit: January 04, 2016, 08:52:35 am by RyanfaeScotland »

tvtoon

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
Re: Which Megadrive Emulator Should I Put My Effort Into?
« Reply #11 on: January 04, 2016, 04:21:45 pm »
There is also mednafen, that uses the GenPlus source. You can log stuff with it, but the debugging features are a mess (small font on big screen, not for every platform)...