Genesis / Megadrive core ported to MiST

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

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

Post Reply
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

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: 1343
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

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
Atari Super Hero
Atari Super Hero
Posts: 874
Joined: Tue Feb 21, 2017 7:02 am

Re: Genesis / Megadrive core ported to MiST

Post by DanyPPC »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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 God
Atari God
Posts: 1016
Joined: Fri Apr 24, 2015 12:10 pm

Re: Genesis / Megadrive core ported to MiST

Post by vebxenon »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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: 311
Joined: Sun May 15, 2016 3:44 pm

Re: Genesis / Megadrive core ported to MiST

Post by seastalker »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

i've implemented TAS bug in the new release - Gargoyles work.
Also Lotus Turbo Challenge is fixed.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

It seems TAS bug affects Jim Power in opposite way - now this game looks like with old CPU - full of cherry stripes.
slingshot
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Genesis / Megadrive core ported to MiST

Post by Sorgelig »

ok. Re-checked it - both works.
slingshot
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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: 1343
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

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
Atari Super Hero
Atari Super Hero
Posts: 874
Joined: Tue Feb 21, 2017 7:02 am

Re: Genesis / Megadrive core ported to MiST

Post by DanyPPC »

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
Atari God
Atari God
Posts: 1809
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

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.
Post Reply

Return to “MiST”