Genesis / Megadrive core ported to MiST

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Moderator Team

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 12:32 am

The article is a bit confusing as it first says DMA enable flag just mask CD5 write retaining it from previous write, but later says CD5 gets cleared at the end of DMA operation. If CD5 is cleared after DMA, then there is no point to talk it's retained if DMA enable flag isn't set.

Effectively CD5 won't set if DMA enable flag is not set and always cleared after DMA operation. CD5 cannot be re-used for next DMA operation (well, if article is correct).

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby MasterOfGizmo » Sun Oct 14, 2018 7:44 am

They also mention some tests. They may have test cartridges helping us to debug this stuff.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

DanyPPC
Captain Atari
Captain Atari
Posts: 447
Joined: Tue Feb 21, 2017 7:02 am

Re: Genesis / Megadrive core ported to MiST

Postby DanyPPC » Sun Oct 14, 2018 8:44 am

Great work and good effort on all games tested: Super Hang-On, OutRun, Top Gear II, Lotus II, Fire Shark, Twin Hawk, Sonic, Ghouls'n'Ghosts, Streets of Rage II and others work properly.

I hear no sound in Batman (one of the first cartridge released for this great console).

But now Thunder Force III, Gynoug, Wonderboy III have sound !!!

:cheers:
Last edited by DanyPPC on Sun Oct 14, 2018 11:45 am, edited 1 time in total.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 8:44 am

MasterOfGizmo wrote:They also mention some tests. They may have test cartridges helping us to debug this stuff.

http://nemesis.hacking-cult.org/MegaDri ... esting.zip

And it has source code, too.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 8:50 am

Sorgelig wrote:The article is a bit confusing as it first says DMA enable flag just mask CD5 write retaining it from previous write, but later says CD5 gets cleared at the end of DMA operation. If CD5 is cleared after DMA, then there is no point to talk it's retained if DMA enable flag isn't set.

Effectively CD5 won't set if DMA enable flag is not set and always cleared after DMA operation. CD5 cannot be re-used for next DMA operation (well, if article is correct).

The example is about the case when the DMA Fill is in pending state, then even if you disable DMA, rewrite CODE with CD5=0, the DMA fill will still start after the next write to the data port. But IMHO this can be because the pending fill state, not because CD5 is still set.
But somehow it is necessary to clear CD5, in Lotus, it tries to upload to CRAM with CD=23h, which means DMA still set. In Exodus, it is 13h, so it cleared CD5, and set CD4, but that is another flag. Unfortunately just implementing clearing CD5 after DMA end caused bugs in other games for me, too.
Last edited by slingshot on Sun Oct 14, 2018 8:57 am, edited 1 time in total.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 8:52 am

Another game with a CPU "bug", Gargoyles:
http://gendev.spritesmind.net/forum/vie ... les#p30130

Must break the TAS instruction, which is broken in the Mega Drive.

User avatar
vebxenon
Atari Super Hero
Atari Super Hero
Posts: 628
Joined: Fri Apr 24, 2015 12:10 pm

Re: Genesis / Megadrive core ported to MiST

Postby vebxenon » Sun Oct 14, 2018 10:04 am

Just a curiosity. Now Outrunners is playable again, it doesn't hang anymore, but title screen flashes a lot :shrug: .

Anyway, this core is getting better and better, and it sounds also very well! :cheers:

Thanks very much for your great work!

Regards,

Salva
Just a computer and videogame lover :)

- Atari Jr 2600 clone
- Atari 7800 Peritel
- Atari XEGS
- Atari Lynx II
- Atari Jaguar
- MiST Board

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 11:01 am

slingshot wrote:Another game with a CPU "bug", Gargoyles:
http://gendev.spritesmind.net/forum/vie ... les#p30130

Must break the TAS instruction, which is broken in the Mega Drive.

and how it affects this game?

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 12:25 pm

Sorgelig wrote:
slingshot wrote:Another game with a CPU "bug", Gargoyles:
http://gendev.spritesmind.net/forum/vie ... les#p30130

Must break the TAS instruction, which is broken in the Mega Drive.

and how it affects this game?


When I start the game, there's just a blank screen, with some grey sprite is flashing, then I die.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 12:26 pm

vebxenon wrote:Just a curiosity. Now Outrunners is playable again, it doesn't hang anymore, but title screen flashes a lot :shrug: .

Seems if you switch to PAL mode after it started, everything is normal. Maybe just a bug with one timing value in NTSC mode.

seastalker
Captain Atari
Captain Atari
Posts: 200
Joined: Sun May 15, 2016 3:44 pm

Re: Genesis / Megadrive core ported to MiST

Postby seastalker » Sun Oct 14, 2018 2:24 pm

What is the latest revision number - fpgagen-beta_20181013.rbf ? Is it in the community the current best be it beta or not? Sega systems are perhaps my most desired FPGA cores, and if any are near perfect, a single little tear of joy forms in my eye.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 3:12 pm

Does anyone know how Exodus identify SSF2 and enables the mapper? Or how to patch Titan Overdrive 2 to make it recognized in Exodus as SSF2 (and enable the mapper)?
I've studied Exodus sources but they are so much obfuscated - no any mention about mapper, SSF2 or Super Street Fighter 2 or anything sounding like this.
And more funny: exodus crash in Visual Studio 2017 when i try to run in debug mode and then load SSF2. It works with other ROMs under debugging but crash with SSF2...

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 5:26 pm

i've implemented TAS bug in the new release - Gargoyles work.
Also Lotus Turbo Challenge is fixed.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 5:56 pm

It seems TAS bug affects Jim Power in opposite way - now this game looks like with old CPU - full of cherry stripes.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 6:01 pm

Sorgelig wrote:i've implemented TAS bug in the new release - Gargoyles work.
Also Lotus Turbo Challenge is fixed.


Good :)
I wonder if this CPU bug can be triggered externally with TG68k, I bet SEGA didn't put broken CPUs in the Gensis, just there's a bug in some external part.
Meanwhile I fixed a ton of VDPFifoTest errors (mostly low-hanging fruits), but the most broken part seems to be DMA FILL. For example the fill value should go to FIFO, just don't understand how the DMA engine will know it.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 6:10 pm

seastalker wrote:What is the latest revision number - fpgagen-beta_20181013.rbf ? Is it in the community the current best be it beta or not? Sega systems are perhaps my most desired FPGA cores, and if any are near perfect, a single little tear of joy forms in my eye.

Sorry if it is not good enough. But trying harder :)

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 6:31 pm

Sorgelig wrote:It seems TAS bug affects Jim Power in opposite way - now this game looks like with old CPU - full of cherry stripes.

Just bug'gin write_back <= '1' seems to work for both games

Code: Select all

                           set_exec_tas <= '1';
                           IF TASbug = 0 THEN
                              write_back <= '1';
                              datatype <= "00";                           --Byte
                           END IF;
                           IF opcode(5 downto 4)="00" THEN
                              set_exec(Regwrena) <= '1';
                           END IF;

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 6:36 pm

slingshot wrote:Just bug'gin write_back <= '1' seems to work for both games

if i remember correct it produces the problem for both games for me :)

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 6:44 pm

Sorgelig wrote:
slingshot wrote:Just bug'gin write_back <= '1' seems to work for both games

if i remember correct it produces the problem for both games for me :)

It seems to be OK here, maybe try again :) But I don't know if it causes problems with a 3rd game...

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 6:44 pm

actually the re-bug is not entirely correct as it should prevent to write to memory, but if target is not memory, then it should write.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3107
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Sun Oct 14, 2018 6:52 pm

ok. Re-checked it - both works.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 6:54 pm

Sorgelig wrote:actually the re-bug is not entirely correct as it should prevent to write to memory, but if target is not memory, then it should write.

I don't know how to differentiate. So write_back is not just for memory? Maybe Till can make a better fix.

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby MasterOfGizmo » Sun Oct 14, 2018 6:58 pm

slingshot wrote:I wonder if this CPU bug can be triggered externally with TG68k, I bet SEGA didn't put broken CPUs in the Gensis, just there's a bug in some external part.


It's not a cup bug. The tas instruction forcefully does two uninterruptible subsequent bus cycles to make sure it's an atomic operation. Some versions of the vdp did not cope with that. E.g. the Amiga also didn't cope with it and you shouldn't use the tas instruction there.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

DanyPPC
Captain Atari
Captain Atari
Posts: 447
Joined: Tue Feb 21, 2017 7:02 am

Re: Genesis / Megadrive core ported to MiST

Postby DanyPPC » Sun Oct 14, 2018 6:59 pm

Tested a lot of games in alphabetical order, if it can help you, the following ones have graphic and sprites problems:

- Aladdin
- Blades of Vengeance
- Chaos Engine
- Cliffhanger
- Golden Axe II
- Hook
- Lotus Turbo Challenge
- Power Drive
- Rolling Thunder 2
- Shinobi III
- Story of Thor (doesn't work)

The following have audio problems:

- Batman
- Battle Squadron
- various...

Continue with test. But now most games work.

slingshot
Captain Atari
Captain Atari
Posts: 337
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sun Oct 14, 2018 7:37 pm

DanyPPC wrote:Tested a lot of games in alphabetical order, if it can help you, the following ones have graphic and sprites problems:

- Golden Axe II


Golden Axe II? I almost played to the end, didn't notice any problems.
Tried some others, too, and besides a window plane problem in Rolling Thunder II, I didn't see problems (Lemmings 2 still OK, so must be another bug). I couldn't find Chaos Engine ROM.
Last edited by slingshot on Sun Oct 14, 2018 8:25 pm, edited 1 time in total.


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 3 guests