Rickster2527 / genplus-gx

Automatically exported from code.google.com/p/genplus-gx
Other
0 stars 0 forks source link

Mega-CD support #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be cool to have mega CD suppot to play game like Dune, Road
Avenger... Maybe look at the code used by Notaz for his emulator Picodrive

http://notaz.gp2x.de/

Thanks for your hard work on this emulator ;)  

Original issue reported on code.google.com by Yod4zM...@gmail.com on 29 May 2009 at 7:10

GoogleCodeExporter commented 9 years ago
Your progress as always is amazing Eke, great work!  Can't wait to see a 
release  for this :) 

Original comment by chicor...@gmail.com on 14 Jun 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Thanks for support.

@100: I would have no time doing and maintaining a proper windows port, though 
i always thought the Wii interface could easily be ported back (using mouse 
instead of wiimote) and this would be much nicer than those uniformized windows 
gui that all emulators seem to be using...

As for cheats, i don't think any cheat device existed for mega cd and i don't 
know any patch code either: the reason is probably that code can be executed 
from a lot of various places when mega cd is used and that memory is always 
switching from one side to another, depends on current memory mode or can only 
be accessed through banking . All in one, it makes very difficult for a 
cartridge to intercept all memory access and patch them properly, also the 
sub-cpu bus is only internal so not  "spyable", which leaves out the 
possibility of patching code on that side and kinda limits utility of such 
device.

Original comment by ekeeke31@gmail.com on 15 Jun 2012 at 6:46

GoogleCodeExporter commented 9 years ago
I finally fixed the last remaining issues with AH3 Thunderstrike / Thunderhawk:

- map was fixed by increasing the granularity of graphics operation processing: 
instead of processing all lines at once when the operation is started 
(inaccurate but more optimized), I now update the rendering on each CPU 
executed line, in regard to "real" timings (though exact timings are unknown 
for now). This was required as this game will start a graphics operation then 
write to Word-RAM and update the data needed by the graphic chip while it is 
rendering.

- corrupted "riverside" graphics  were solved by fixing a stupid bug with how 
stamp flipping was emulated: stamps (16x16 or 32x32 pixel patterns) can be 
flipped  horizontally (mirrored) and/or at 90, 180, 270° by setting a few bits 
in the corresponding stamp table entry and I was simply not handling these bits 
correctly.

I also took some time to add support for Mode 1: in this mode, the main CPU 
boots from an inserted cartridge instead of booting from the CD as it usually 
does. There is actually two kind of Mode 1: 

1) in the first one, the main CPU still boots from the CD unit internal Boot 
ROM (what people like to call "BIOS") but the BIOS (maybe not all versions ?) 
can detect a bootable cartridge is inserted and jump to it instead of trying to 
boot a CD.

2) in the second one, the cartridge outputs a signal to the console so that the 
main CPU will directly boot from that cartridge (it's actually like what all 
Genesis games are doing). In this mode, the internal Boot ROM and the normally 
accessible RAM is still accessible (from $400000-$7FFFFF instead of 
$000000-$3FFFFF as usual), so cartridge can access CD hardware.

The latter is actually required by a few Genesis programs to work, namely Flux 
and Wonder Library. These were actually some of the few remaining known ROM 
dumps that were not compatible with Genesis Plus GX because of lack of Sega CD 
support, so they are now supported by the emulator, even if there isn't much to 
do with them without proper CD images.

Original comment by ekeeke31@gmail.com on 16 Jun 2012 at 2:04

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ekeeke31@gmail.com on 16 Jun 2012 at 2:56

Attachments:

GoogleCodeExporter commented 9 years ago
I quickly added save-state support for CD games. I'm not sure what was so 
difficult that PC emulators did not supported save-state until very recently 
(actually I think only Kega has 100% working save-state support so far), so 
maybe I'm missing something, I don't know. State size is actually quite big 
with CD hardware state incorporated (almost 1MB) but it works perfectly fine 
with the few games I tested.

So, since I'm pretty much satisfied with the current state of my core now, I 
guess a release should not be too long, only need to incorporate it in the Wii 
port and add the necessary GUI adjustments for Mega CD specific stuff.

Original comment by ekeeke31@gmail.com on 17 Jun 2012 at 7:14

GoogleCodeExporter commented 9 years ago
Thank you :) save games = cheats :) if it is posible do not compress the 
savegame files. With an hex editor + time you can cheat mega cd games changing 
the values on save file.

Original comment by ferran...@hotmail.com on 18 Jun 2012 at 1:29

GoogleCodeExporter commented 9 years ago
As always your work are impressive, i waiting wii build and many thanks for 
your efforts

Kudos

Original comment by mrdeathj...@gmail.com on 18 Jun 2012 at 9:15

GoogleCodeExporter commented 9 years ago
Thank you Sooo much. It's nice to know a Wii build is on the cards soon. :)

Original comment by ploggy16...@gmail.com on 19 Jun 2012 at 7:40

GoogleCodeExporter commented 9 years ago
RAM cheats (PAR) are possible with games like Sonic CD that use Genesis RAM. 
Would be quite happy to see PAR cheats enabled for Sonic CD with a warning 
saying no guarantees that it'll work. Do a search for Sonic CD PAR cheats by 
King Of Chaos, they work fine using ArtMoney with Kega for example.

Original comment by cluster.phucking on 28 Jun 2012 at 9:45

GoogleCodeExporter commented 9 years ago
PAR cheats are still enabled when Mega CD is emulated so you can still apply 
patches to the main RAM.

In regard to what I said above about DMA operation not incrementing source 
address register values, it appeared I was wrong as it broke a few other CD 
games and that it was just a bug with the way I was handling the source address 
increment along the emulated Word-RAM DMA delay. 

Good news is that I finished back-porting my implementation to the Wii/Gamecube 
port, chased down a few design bugs which I would not have noticed with the 
basic windows port (especially with the ability to load successive games or 
changing various emulator options during gameplay). Tested only on Wii so far 
(could not find my SD Gekko anywhere.. damn) and with ISO or BIN loaded from 
SDCARD: runs fullspeed as expected but audio tracks are still not supported, 
which I suspect is going to be a major performance hit when implemented 
(planned for later releases).

Original comment by ekeeke31@gmail.com on 28 Jun 2012 at 11:31

GoogleCodeExporter commented 9 years ago
Incredible work, 100% compatibility! I doubt I'm going to  be able to play 
anything MCD wise due to the limited space on my SD card and my HDD is 
partitioned in WBFS format only. :-(

I read through your progress here and it's fascinating, but I don't understand 
the technical stuff, it sounds...complex. The Wii homebrew scene is so lucky to 
have someone like yourself who is not only incredibly talented but also cares 
about true emulation. I have to say GenPlus GX is the best MD emulator I've 
used.

Original comment by tmo...@gmail.com on 1 Jul 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Thanks for the kind word. 
100% compatibility should be taken with grain of salt though since I could not 
test all games from start to end obviously, just made sure all booted fine and 
played without graphical glitches or errors.

Anyway, version 1.7.0 is up to download. I hope to add audio track support soon 
so this can be more enjoyable in some way.

Original comment by ekeeke31@gmail.com on 1 Jul 2012 at 6:38

GoogleCodeExporter commented 9 years ago
Thank You Eke Eke, I'm going to have a lot of fun with this. Just played a bit 
of Sonic CD and while music doesn't play at start, it kicks in when I go to the 
Future. I know music isn't supported in this new build, it's just a nice 
surprise :)

Thanks again Eke Eke. You Da Man.

Original comment by ploggy16...@gmail.com on 2 Jul 2012 at 2:33

GoogleCodeExporter commented 9 years ago
I just tried out the latest update and consider myself awestruck! 
Honestly I'm very impressed with how well you where able to make Sega CD 
emulation run on the Wii(GC)in such a short period of time!

Sega CD running on 240p component video with no dieing disk drives and internal 
battery is just awesome! 

I salute you ekeeke! 

Original comment by TheRealB...@gmail.com on 2 Jul 2012 at 5:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have been waiting and hoping patiently that Sega/Mega CD support would come 
to the Wii at some point and here it finally is.  This was an important console 
to me back in the day and was the only system that I felt was truly missing 
from the Wii homebrew scene.  

I have tested a handful of games already (some of which use the scaling 
capabilities of the system: 'Batman Returns') and the performance has been 
absolutely superb.  Well done Eke Eke on an absolutely superb performance 
emulation of the console, I am very impressed and very grateful.  It was 
strange playing 'Batman Returns' without the amazing soundtrack so great to see 
you will implement the support for all this at a later date.

Thank you very much again for your amazing work!

Original comment by barksta...@gmail.com on 2 Jul 2012 at 8:51

GoogleCodeExporter commented 9 years ago
AMAZING

Original comment by cheatfreak47 on 2 Jul 2012 at 9:07

GoogleCodeExporter commented 9 years ago
I have a quick question. I noticed that the option in the menu settings to 
change the background to Genesis Plus GX is now missing. Is there a reason for 
why this option was removed?

Original comment by TheRealB...@gmail.com on 2 Jul 2012 at 5:04

GoogleCodeExporter commented 9 years ago
Well, there were not much sense in keeping the old background picture since 
it's a multi system emulator now, and that picture was actually taking 
significant memory space that would be more useful for real emulation features. 
For the same reason i did not added pictures of other emulated systems.

Original comment by ekeeke31@gmail.com on 2 Jul 2012 at 7:42

GoogleCodeExporter commented 9 years ago
Ah, that makes sense. I will live with the checkered background.

Also another thing, don't know if this should have its own issue section but 
I've noticed that when playing from USB games tend to have more audio glitching 
in cut scenes and are over all less compatible then SD. This was the case with 
Lunar II, which had more glichly audio in the Opening cut scene then with SD 
and I tried Keio Flying Squadron on USB and the game wouldn't even start after 
watching the game’s opening cut scene (however I haven't tried running the 
game from SD yet).  

Don't know if this will be of any help since I haven't really tested that many 
games, but I thought I should just put it out there to make it relevant. 

Original comment by TheRealB...@gmail.com on 3 Jul 2012 at 3:53

GoogleCodeExporter commented 9 years ago
I cannot comment much about USB speed as i could not test it for the release 
(and does not really usb drives anyway) but since CD games are pretty much 
accessing data from the image file on the disc directly (they are obviously too 
big to fit in RAM like normal ROM files), access speed of the device you use to 
store these files will have some impact on emulation speed. This is especially 
true for FMV games or intros which are reading data continuously (you can tell 
thos through the dvd dtive blu led, which kinda mimic mega cd red led). 
I don't think there is much i can do to improve this, afaik libfat already does 
caching and buffering so it's probably as fast as it can be. I will accept any 
insight or advice from anyone that has more experience than me on that subject 
though. Maybe also the issue is that your drive is not accessed at USB2 speed, 
in which case you should make sure HBC is using IOS58 when it loads the 
emulator. USB1 speed is definitively too slow compared to SD speed. I wonder if 
someone tried to load isos from DVD...

Device used should not have any effect on game compatibility though, unless the 
file is corrupted on that particular device, since the only thing that matter 
is the sector data returned. I tested this game and it should work fine, not 
sure about the intro since i usually skip them. Anyway, if you have an issue 
with a specific game, it's better to create its own issue report as it's easier 
for me to follow it.

Original comment by ekeeke31@gmail.com on 3 Jul 2012 at 8:19

GoogleCodeExporter commented 9 years ago
Sega CD emulation is looking nice so far. For the next release, could you do 
some more work on the system separation? Specific folders for each system and a 
file filter would be nice. Right now it seems like the emulator tries to load 
whatever you throw at it no matter what system you chose to emulate in the 
menu. Especially with Sega CD, something could be done to reduce duplicate 
entries (Since Sega CD images usually consist of at least 2 files), like only 
showing cue/toc files and not iso/bin, for example. If you add support for 
iso+mp3, I think mp3 files should also be hidden in the menu.

You also mentioned loading isos from DVD. I know the Wii can't read CD's, but 
would it be possible to add support for burned Sega CD games on DVD? Like they 
are burned just like a CD backup, but on DVD instead. If the Wii drive is fast 
enough, it would free a lot of space on the SD cards/USB drives, and it would 
give quite an authentic feel to it.

Finally, will there be a specific recommended format for Sega CD images once CD 
tracks are added, or will most common formats be supported?

Original comment by swsparkl...@gmail.com on 3 Jul 2012 at 11:25

GoogleCodeExporter commented 9 years ago
There are already different ROM, cheats, screenshot & saves paths  for the 
different systems you select in the Load Menu. The last accessed ROM path is 
automatically saved separately for each system (cd, md, ms, gg, sg) and each 
device (sd, usb, dvd). As for being able to load any file type from a specific 
system browser, i don't see where is the problem, it's actually a feature and 
it's up to you to store each ROM files properly. 

Regarding Mega CD, i am indeed planning to filter audio files when they will be 
supported, but there was no need to filter anything until they are. Audio files 
supported type will most likely be .ogg and .wav, as well as bin+cue support 
(audio format is similar to wav but inside the bin file). Mp3 will not be 
supported for licensing reasons (i think all open-source mp3 decoding library 
are GPL which is not compati

And no, you can't just "burn a sega cd disc into a dvd", those are totally 
different and incompatible support formats. The only thing the wii could read 
from a dvd is binary data in a fesystem, so the only you can do is copying Sega 
CD image files on a DVD, just you woild do on SD or USB.

Original comment by ekeeke31@gmail.com on 3 Jul 2012 at 2:26

GoogleCodeExporter commented 9 years ago
Aw, no mp3? :/ looks like im gonna need a decent audio converter, cuz most of 
the Iso's ive found are .iso or .bin packaged with mp3

Original comment by cheatfreak47 on 3 Jul 2012 at 4:41

GoogleCodeExporter commented 9 years ago
I took a look at it again and the last accessed ROM path is indeed saved 
automatically for each system. Could we have an option to set the paths 
permanently though, so that they won't accidentally change? Regarding the 
feature of being able to load any file type, I just thought that it was kind of 
strange to separate the systems at all when you can just for example open Mega 
Drive games through the Game Gear option and vice versa, but if they're all 
organized in separate folders already it doesn't matter too much.

Could anything other than audio files be hidden as well? Even with the audio 
files hidden, there are usually at least two entries left per image, since a 
Sega CD image will usually come with at least the bin+cue or iso+cue 
combinations. Only having one entry per image would be even more convenient, 
especially if you have quite a number of games to choose from.

I see. Then I guess the drive wouldn't be able to read things like audio 
tracks, too bad.

Original comment by swsparkl...@gmail.com on 3 Jul 2012 at 4:50

GoogleCodeExporter commented 9 years ago
1) .bin should not be coming with .mp3  since they already have audio track 
data inside them

2) .cue files will obviously be masked as well, don't  worry

3)  paths are already permanent, they are saved in the configuration file and 
restored on each start. If you mean having a default base directory that is 
always accessed each time you open a browser and do not get updated when 
browsing, i'm not going to do it, it's a design choice and i like the way it 
is.  

Original comment by ekeeke31@gmail.com on 3 Jul 2012 at 5:08

GoogleCodeExporter commented 9 years ago
On the USB thing. It looks as though this isn't an issue exclusive to USB. I 
just tried playing Lunar II on the SD card again its audio glitched up in all 
the same spots as USB. Which is odd since I could of sworn that it didn't have 
that issue when I first tested it on the SD card. 

On a side note my external HDD is running on USB2.0 and my HBC is set to use 
ios58. 

Original comment by TheRealB...@gmail.com on 3 Jul 2012 at 6:05

GoogleCodeExporter commented 9 years ago
Hmm, I've tried Panic! and the sound  stutters a lot, and it hanged at one 
point. I'm using a BIN+CUE image, does this happen to everybody?

Original comment by superballena on 3 Jul 2012 at 7:45

GoogleCodeExporter commented 9 years ago
You really need to be very precise and exactly describe the spots you are 
having problem if you want me to reproduce issues or do something to fix them, 
it's gonna be unmanageable otherwise. 

It seems I reproduced a problem with PCM sound that starts to go wrong after 
some time or under some unknown conditions, seems to be fixed by returning to 
the menu then back to the game (anyone confirming this ?)so it might be some 
bug with how it is buffered or handled at the end of each frame as I didn't 
spend much time on this after I got it working I admit and have run most games 
without sound.

BIOS model might also have some impact, please try with different ones to see 
if it makes any differences and indicate which one was running when reporting 
an issue.

Original comment by ekeeke31@gmail.com on 3 Jul 2012 at 8:04

GoogleCodeExporter commented 9 years ago
Sonic CD keeps freezing while trying to load levels. im playing it from my USB 
2.0 device.

Original comment by cheatfreak47 on 3 Jul 2012 at 10:42

GoogleCodeExporter commented 9 years ago
specifically after i played it a while.

Original comment by cheatfreak47 on 3 Jul 2012 at 10:48

GoogleCodeExporter commented 9 years ago
Sonic CD - playing from SDHC card and it freezes trying to load the next level

Original comment by brymas...@gmail.com on 4 Jul 2012 at 1:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
woohoo. we have it confirmed. glad it isnt my USB device.

Original comment by cheatfreak47 on 4 Jul 2012 at 4:02

GoogleCodeExporter commented 9 years ago
You mean the first act loads fine but the second dosen't ? Or the level after 
the first boss ? I did not tested so far actually. Again, please make a 
separate issue for game specific bug and again, please indicate what bios it 
was running (pal, us, jp ? model 1 or 2 ? revision ?) and try with different 
bios.

Issue with stuttering sound in CD games should have their own issue too: a good 
way to know if it is indeed a problem with PCM chip emulation is to set FM 
volume to 0 in audio settings and verify you can still here the music. Also try 
if this got fixed with VSYNC disabled  to see if it's due to emulation speed 
dropping.

Original comment by ekeeke31@gmail.com on 4 Jul 2012 at 6:15