Genesis / Megadrive core ported to MiST

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

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

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby jotego » Thu Nov 15, 2018 2:27 pm

DanyPPC wrote:Super Street Fighter has not correct sound, tested with 0.51 and 0.52


Yes, I hear the PSG sound a bit too long. I wonder if that gets fixed with the same fix as Alien 3. I'll try it with the newest FPGAgen core.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Thu Nov 15, 2018 2:33 pm

jotego wrote:
slingshot wrote:Did you try it with "Fast VRAM speed?

I don't know what that is.

A new option in the OSD. If it is a bug, but don't seem to me. It can help on Sonic I and Clue so far. Hopefully, with the new CPU that option can be obsoleted.

slingshot wrote:Alien 3 already fixed in git, I think connecting the FM reset to the Z80 reset fixed it.

Which one is your GIT repository? I was pulling from harbaum's one and the bug is still there.


It was committed just 2 days ago.

Yes, I hear the PSG sound a bit too long. I wonder if that gets fixed with the same fix as Alien 3. I'll try it with the newest FPGAgen core.

The PSG wasn't changed. I'm not sure what reset signal should applied to it, since it's part of the VDP, and that cannot be seen in the schematics. But could be tried to change MRST_N to T80_RESET_N for the PSG to see if it helps, if it's really a reset problem, and not something other. The T80 usually not resetted mid-scene.

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

Re: Genesis / Megadrive core ported to MiST

Postby Sorgelig » Thu Nov 15, 2018 6:21 pm

PSG shares the same reset as the whole VDP.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sat Nov 17, 2018 3:50 pm

jotego wrote:
DanyPPC wrote:Super Street Fighter has not correct sound, tested with 0.51 and 0.52


Yes, I hear the PSG sound a bit too long. I wonder if that gets fixed with the same fix as Alien 3. I'll try it with the newest FPGAgen core.


Alien 3 problem is something with the Z80, if you keep resetting, once there will be sound. As I traced down, the Z80 "forgets" to send data to the FM, need some time to debug it.
The 68k stops the Z80 once in every frame, writes something to its memory, then the Z80 resumes, and if it picks the correct changes in RAM, then it starts to send data to FM. Probably this has some flaw in it.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Sat Nov 17, 2018 10:18 pm

I think I found the problem with Alien 3, I wonder how can it work on the hardware without freezing it.

New release uploaded!
- Has the new cycle-perfect FX68k CPU from ijor. Worth to watch the Titan demos again.
- Has jt12 0.52 for exciting music from jotego.
- Lot of small bug fixes, probably some new bugs.

Feel free to try it, and report any new and old issues.

https://github.com/mist-devel/mist-bina ... -fx68k.rbf

User avatar
fury23
Atari User
Atari User
Posts: 38
Joined: Sun Jan 10, 2016 2:08 pm

Re: Genesis / Megadrive core ported to MiST

Postby fury23 » Sun Nov 18, 2018 6:09 am

slingshot wrote:I think I found the problem with Alien 3, I wonder how can it work on the hardware without freezing it.

New release uploaded!
- Has the new cycle-perfect FX68k CPU from ijor. Worth to watch the Titan demos again.
- Has jt12 0.52 for exciting music from jotego.
- Lot of small bug fixes, probably some new bugs.

Feel free to try it, and report any new and old issues.

https://github.com/mist-devel/mist-bina ... -fx68k.rbf


Thank you so much :cheers:

User avatar
Xtro
Atari freak
Atari freak
Posts: 55
Joined: Fri Jan 09, 2015 11:47 am
Location: Spain

Re: Genesis / Megadrive core ported to MiST

Postby Xtro » Sun Nov 18, 2018 10:22 am

Been trying games that gave me problems, like Sonic 2 in interlaced mode and now they are perfect, seems to sound better too. This core seems very accurate and enjoyable :cheers:

User avatar
Xtro
Atari freak
Atari freak
Posts: 55
Joined: Fri Jan 09, 2015 11:47 am
Location: Spain

Re: Genesis / Megadrive core ported to MiST

Postby Xtro » Sun Nov 18, 2018 12:40 pm

Tried Titan 2 Demo and graphically it is perfect, but there is no music and loses sound very quickly.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Mon Nov 19, 2018 9:14 am

Xtro wrote:Tried Titan 2 Demo and graphically it is perfect, but there is no music and loses sound very quickly.


I've only have silence after the plasma scene, near end. Anybody else has full silence?

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

Re: Genesis / Megadrive core ported to MiST

Postby DanyPPC » Mon Nov 19, 2018 9:21 am

There are sound bugs with this new core in Super Skidmarks

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

Re: Genesis / Megadrive core ported to MiST

Postby DanyPPC » Mon Nov 19, 2018 9:24 am

slingshot wrote:
Xtro wrote:Tried Titan 2 Demo and graphically it is perfect, but there is no music and loses sound very quickly.


I've only have silence after the plasma scene, near end. Anybody else has full silence?


Confirm, no sound after this part.

desUBIKado
Atari maniac
Atari maniac
Posts: 79
Joined: Sat Jan 06, 2018 11:49 pm

Re: Genesis / Megadrive core ported to MiST

Postby desUBIKado » Mon Nov 19, 2018 5:56 pm

slingshot wrote:I think I found the problem with Alien 3, I wonder how can it work on the hardware without freezing it.

New release uploaded!
- Has the new cycle-perfect FX68k CPU from ijor. Worth to watch the Titan demos again.
- Has jt12 0.52 for exciting music from jotego.
- Lot of small bug fixes, probably some new bugs.

Feel free to try it, and report any new and old issues.

https://github.com/mist-devel/mist-bina ... -fx68k.rbf


I test a few of games and very well, but Micro Machines 2 music sounds horrible.

User avatar
Xtro
Atari freak
Atari freak
Posts: 55
Joined: Fri Jan 09, 2015 11:47 am
Location: Spain

Re: Genesis / Megadrive core ported to MiST

Postby Xtro » Mon Nov 19, 2018 10:08 pm

Tested again and I don't have music (FM Sound?) on Titan Overdrive 2 demo. Sound effect work (PSG Sound?) and very shortly no audio at all. I am running the core on 15khz if that matters.

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby jotego » Tue Nov 20, 2018 6:57 am

Xtro wrote:Tested again and I don't have music (FM Sound?) on Titan Overdrive 2 demo. Sound effect work (PSG Sound?) and very shortly no audio at all. I am running the core on 15khz if that matters.


I think I have explained it in other post. Titan Overdrive 2 Demo tries to push too much the maximum write speed to the FM chip and ignores the BUSY signal that the chip produces indicating that there should be no writes. It is true that sometimes you can ignore BUSY and still get a correct write. But it is a lottery. Writes are already as fast as can be in JT12: one M68k clock cycles for adress writes and 24 FM clock cycles for data writes. BUSY is held up for 32 FM clock cycles, like real hardware. If that demo doesn't work for those conditions, that's their software fault. I don't think it can work for a large collection of real hardware either as it is now.

So no fixing needed for Titan Overdrive 2 Demo from my point of view. It is just out of spec.

phoboz
Atariator
Atariator
Posts: 29
Joined: Sun Jan 15, 2017 10:52 pm

Re: Genesis / Megadrive core ported to MiST

Postby phoboz » Tue Nov 20, 2018 7:23 am

jotego wrote:I think I have explained it in other post. Titan Overdrive 2 Demo tries to push too much the maximum write speed


I don’t know it this is related to the problem above, but now when you have a cycle accurate CPU – shouldn’t the clock speed be reduced to 7.67 MHz instead of 54 MHz? Maybe that will slow down the Titan Overdrive 2 Demo enough?

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Tue Nov 20, 2018 10:14 am

phoboz wrote:
jotego wrote:I think I have explained it in other post. Titan Overdrive 2 Demo tries to push too much the maximum write speed


I don’t know it this is related to the problem above, but now when you have a cycle accurate CPU – shouldn’t the clock speed be reduced to 7.67 MHz instead of 54 MHz? Maybe that will slow down the Titan Overdrive 2 Demo enough?


The CPU (and FM) gets the correct 54/7 MHz enablers. Also various parts requires various clocks (enablers), like Z80 54/15. The recent problems shows memory access timing problems, unfortunately it is not easy to solve, because of the shared SDRAM for everything, but seems I could make at least not worse than before.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Tue Nov 20, 2018 10:16 am

jotego wrote:
So no fixing needed for Titan Overdrive 2 Demo from my point of view. It is just out of spec.


Yepp, Z80 must be slowed down with 68000 memory access wait states.

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby jotego » Tue Nov 20, 2018 11:03 am

slingshot wrote:
jotego wrote:
So no fixing needed for Titan Overdrive 2 Demo from my point of view. It is just out of spec.


Yepp, Z80 must be slowed down with 68000 memory access wait states.


If Z80 runs too fast, Titan Overdrive 2 will not work. That's definite.

Regular games work with a fast Z80 because they check the BUSY bit and get synchronized there. Or they just use a slow writing approach. But that demo tries to go at full speed to show maximum sample rate on the PCM channel so it is too dependent on bus/system/FM timing.

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Tue Nov 20, 2018 11:55 am

jotego wrote:
Regular games work with a fast Z80 because they check the BUSY bit and get synchronized there. Or they just use a slow writing approach. But that demo tries to go at full speed to show maximum sample rate on the PCM channel so it is too dependent on bus/system/FM timing.


I experienced another strange thing, if Titan 2 has no music, then I start a game, like Super Skidmarks or Sonic 3, then reload Titan 2, it'll have music. Maybe it's just a co-incidence, or the duration of the T80 reset is not consistent, and not resetting the FM correctly, I don't know.
How many cycles required for a correct FM reset? Maybe the reset control port write must have a wait state, too.

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby jotego » Tue Nov 20, 2018 12:30 pm

slingshot wrote:I experienced another strange thing, if Titan 2 has no music, then I start a game, like Super Skidmarks or Sonic 3, then reload Titan 2, it'll have music. Maybe it's just a co-incidence, or the duration of the T80 reset is not consistent, and not resetting the FM correctly, I don't know.
How many cycles required for a correct FM reset? Maybe the reset control port write must have a wait state, too.


You need at least 32 FM clock cycles (6*32 effective input clock cycles) to have a full reset of JT12. Maybe I should generate an internal reset signal to guarantee this...

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Tue Nov 20, 2018 1:51 pm

jotego wrote:You need at least 32 FM clock cycles (6*32 effective input clock cycles) to have a full reset of JT12. Maybe I should generate an internal reset signal to guarantee this...


Thanks, maybe I'll measure the reset length of Titan2 with SignalTap, that would give a clue what should be delayed more. And for the last resort, a reset signal can be generated for jt12, just it wouldn't be too authentic.
It's interesting that the problem is not something too slow, but too fast :)

Upd.: total silence seems to be an issue with the T80 when the bus request held in reset state, nothing to do with the FM chip.

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Postby ijor » Wed Nov 21, 2018 12:53 am

jotego wrote:I didn't know that document. Busy flag is not useless, it is actually very useful. The hardware works like this:

The different operator information for each channel keeps moving in a cyclic shift register. There is only one point where you can write. So when you have data to write, you have to wait until you see the operator you want passing through. That wait is 24 FM clock cycles in my (and some Yamaha) implementation(s). The busy bit is held for 32 FM clock cycles with a blind counter. It is blind because it will always count for 32 cycles even if not so many are needed. Busy bit does not gate writes. You can issue a new write while busy is high and it will get processed. But, a new write before the old one is done will delete the previous one and that data will get lost.

So without checking for the busy bit, you can still get things right as long as you wait for a good amount of time between writes and you're lucky.


jotego wrote:I think I have explained it in other post. Titan Overdrive 2 Demo tries to push too much the maximum write speed to the FM chip and ignores the BUSY signal that the chip produces indicating that there should be no writes. It is true that sometimes you can ignore BUSY and still get a correct write. But it is a lottery. Writes are already as fast as can be in JT12: one M68k clock cycles for adress writes and 24 FM clock cycles for data writes. BUSY is held up for 32 FM clock cycles, like real hardware. If that demo doesn't work for those conditions, that's their software fault. I don't think it can work for a large collection of real hardware either as it is now.

So no fixing needed for Titan Overdrive 2 Demo from my point of view. It is just out of spec.


I don't know much about the Genesis architecture, let alone about the FM chip. But from what you are saying, and from my own experience with similar behavior on other systems, I am guessing that there might be a problem of the alignment of the busy bit cycle.

I assume the demo does work on real hardware, doesn't it? That shouldn't be too difficult to verify. If so, then probably the demo somehow synchronize with the 5-bit (32 cycles) counter you mentioned above. I don't know if it really possible to sync with that counter or not. But if it does, then it is not a "lottery" anymore, it is just cycle exact.

You need at least 32 FM clock cycles (6*32 effective input clock cycles) to have a full reset of JT12. Maybe I should generate an internal reset signal to guarantee this...


May be hardware reset is processed wrong. Or may be you need to reset the counter to a specific value at reset that is not necessary zero.
Fx Cast: Atari St cycle accurate fpga core

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

Re: Genesis / Megadrive core ported to MiST

Postby slingshot » Wed Nov 21, 2018 7:46 pm

I could fix the T80, so reset now OK, Titan demos have music. Jotego updated jt12 to 0.61. I've adjusted the memory timing, and seems the sound of Micro Machine and Super Skidmarks is good now. New release uploaded:

https://github.com/mist-devel/mist-bina ... -fx68k.rbf

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

Re: Genesis / Megadrive core ported to MiST

Postby DanyPPC » Wed Nov 21, 2018 9:39 pm

Great ! Super Skidmarks sound now is ok. Titan 2 demo too.

User avatar
Higgy
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 111
Joined: Tue Jan 24, 2017 1:38 pm

Re: Genesis / Megadrive core ported to MiST

Postby Higgy » Wed Nov 21, 2018 10:10 pm

The collaborative work on this Core has been amazing. :cheers:

The reason I suggested the Titan 2 demo was because it seemed to use so much trickery I thought that if you guys got that running then everything else would work. Oh and the ROM size is so large you can't run it on most Genesis/ Megadrive SD Flash Carts, meaning most people had to watch it on YouTube and not CRT.


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 5 guests