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
hyperterminal
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Jul 09, 2017 1:43 pm

Re: Genesis / Megadrive core ported to MiST

Post by hyperterminal »

User avatar
DrOG
Atari Super Hero
Atari Super Hero
Posts: 738
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: Genesis / Megadrive core ported to MiST

Post by DrOG »

MasterOfGizmo wrote:Worms looks like the displayed area of memory is incorrect. There's something missing at the top and garbage at the bottom.
But can only find a pal version which doesn't run at all in the fpgagen. So I cannot test myself.
If you need, here's the .BIN attached, this works unmodified (download all files to the same folder, remove the .ZIP extensions, and double click on the .CRC file in Total Commander, or you may use HJ-Split as well: http://www.hjsplit.org/ )
Sorry to be so complicated, but otherwise the forum motor doesn't let me to upload this big file.
You do not have the required permissions to view the files attached to this post.
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

DrOG wrote: If you need, here's the .BIN attached, this works unmodified
Thanks a lot. And indeed doesn't look good ... I'll have a look
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:For a test i just disabled a feature called "v30 "in the core. At least in the Sonic intro this suppressed the additional lines at the screens bottom. Perhaps you'd like to check if this is also the case with the other games exhibiting this issue.
I've investigated this V30 mode a bit, it should have work only in PAL mode, the vertical counter in this case should have 312 steps/frame. But the current implementation only have a 262 step counter (and it's even not quite correct, that's why Double Dragon has a blank screen, it polls the VH counter, but I guess it never gets the expected value from it).
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

That bit seems to be always there. It just causes malfunction when being used on NTSC. But i don't think we need to care about that.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:That bit seems to be always there. It just causes malfunction when being used on NTSC. But i don't think we need to care about that.
Yes, but even with the V30 register set to 0, the counters are not correct. I will try to fix them.
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

slingshot wrote:Yes, but even with the V30 register set to 0, the counters are not correct. I will try to fix them.
The Worms issue seems to be something similar. Worms tries to change the displayed image at a certain scanline.

I've done some changes to the counter which i think should be correct. But they at least have no effect on worms:
https://github.com/harbaum/fpgagen/comm ... 0d445f1180

Maybe other games show some effect on this.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:
slingshot wrote:Yes, but even with the V30 register set to 0, the counters are not correct. I will try to fix them.
The Worms issue seems to be something similar. Worms tries to change the displayed image at a certain scanline.

I've done some changes to the counter which i think should be correct. But they at least have no effect on worms:
https://github.com/harbaum/fpgagen/comm ... 0d445f1180

Maybe other games show some effect on this.
Of course the interlaced mode change seems to be OK (but AFAIK interlaced mode doesn't work anyway), I think it's more complicated. The hcounter's reset point should differ between H32 and H40 modes, but probably nothing checks it (the check takes much more cycles than the counting frequency). However the vertical counter not only differs between V30 and non-V30 modes (less important now), but it reset to a different values after hsync ends.
I took the info from here:
http://md.squee.co/VDP#H.2FV_Counter

Just I cannot try it right now. The counter has a big duplicated code section, I want to eliminate it also.
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

slingshot wrote:but it reset to a different values after hsync ends.
I took the info from here:
http://md.squee.co/VDP#H.2FV_Counter
That's also the text i use. But i don't see anything about the vcnt reset value there. I think the "during vsync ..." also refers to the h counter,
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote: That's also the text i use. But i don't see anything about the vcnt reset value there. I think the "during vsync ..." also refers to the h counter,
During VBlank in 28 vertical cell mode the counter will continue to increment normally from 224 to 234. It will reset to 229, indicating the beam will re-start on the top of the display. It will then increment until active display.
During VBlank in 30 vertical cell mode the counter will continue to increment normally from 240 to 10. It will reset to 210, indicating the beam will re-start on the top of the display. It will then increment until active display.
I've added up the numbers, and in V30, it gave the number of lines of the PAL display, non-V30 -> NTSC.
non-V30 -> 235 + 27 = 262
V30 -> 266 + 46 = 312

So in non-V30, the number of counts is good now, but the sequence is not. Upd: I missed the different use of the HV reg in interlaced mode - and I found it correct before in your patch, so I must had a blackout :D
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

slingshot wrote: So in non-V30, the number of counts is good now, but the sequence is not.
Yes. It's probably easier to derive the hv counter values from the vcnt and hcnt counters instead of running seperate counters for the hv counter register.

Are there any genesis test cartridges?
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:
slingshot wrote: So in non-V30, the number of counts is good now, but the sequence is not.
Yes. It's probably easier to derive the hv counter values from the vcnt and hcnt counters instead of running seperate counters for the hv counter register.

Are there any genesis test cartridges?
And also there is the VCNT counter, which is incremented at the half of the line, just because of the integrated scandoubler (complicates things).
There's that VDP info cartridge on the WIKI page, the shadow/intensity tests don't look good.
And now I see the whole X_CNT and XH_CNT separation is _only_ because of the scandoubler. Ahh...
User avatar
krupkaj
Captain Atari
Captain Atari
Posts: 303
Joined: Wed Oct 22, 2003 11:00 pm
Location: Olomouc/Czech Republic
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by krupkaj »

MasterOfGizmo wrote:Yes. It's probably easier to derive the hv counter values from the vcnt and hcnt counters instead of running seperate counters for the hv counter register.

Are there any genesis test cartridges?
you can try this one: http://mode5.net/gendiag.html
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

slingshot wrote: And also there is the VCNT counter, which is incremented at the half of the line
Ah, indeed. So my patch makes things worse ...
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
Chris23235
Captain Atari
Captain Atari
Posts: 238
Joined: Thu Aug 07, 2014 6:52 pm

Re: Genesis / Megadrive core ported to MiST

Post by Chris23235 »

slingshot wrote: use the standard MiST OSD and ROM loader, but in a compatible way with the other boards)
Many thanks for your work. The standard MiST OSD and ROM loader are much better in my opinion. I wish the PC-Engine and the Atari 8 Bit core would use them as well.

I tried Gunstar Heroes and while the game was perfect most of the time, one time the screen shaking after an explosion didn't stop. I wasn't able to reproduce it.
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:
slingshot wrote: And also there is the VCNT counter, which is incremented at the half of the line
Ah, indeed. So my patch makes things worse ...
I'm progressing with my changes, Double Dragon starts already :)
But have to clean up, so many duplicated code and so on...
PS: your patch is still correct to format the register from the internal representation to the external. But as I see, interlace mode is not really done in any way.
Last edited by slingshot on Mon Sep 24, 2018 4:58 pm, edited 1 time in total.
hyperterminal
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Jul 09, 2017 1:43 pm

Re: Genesis / Megadrive core ported to MiST

Post by hyperterminal »

I recommend the 240p test suite for testing the VDP implementation: http://junkerhq.net/xrgb/index.php?titl ... test_suite
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

slingshot wrote: PS: your patch is still correct to format the register from the internal representation to the external.
My patch also makes the mirrored HV register appear four times instead of two. You might do this as well.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1345
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by MasterOfGizmo »

hyperterminal wrote:I recommend the 240p test suite for testing the VDP implementation: http://junkerhq.net/xrgb/index.php?titl ... test_suite
I am afraid that test actually tests only very few features off the VDP. We might need something to test e.g. the interrupts. I am not sure at all that e.g. the hsync interrupts work properly. They may cause things like the worms issue.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

MasterOfGizmo wrote:
My patch also makes the mirrored HV register appear four times instead of two. You might do this as well.
That one fixed Cannon Fodder!
Unfortunately Worms and Double Dragon II still has garbage at the bottom. Seems they have the same problem. But Double Dragon I is OK.
User avatar
Higgy
Captain Atari
Captain Atari
Posts: 207
Joined: Tue Jan 24, 2017 1:38 pm

Re: Genesis / Megadrive core ported to MiST

Post by Higgy »

This scene demo seems to use pretty much every trick in the book even undocumented transparency effects!

http://www.pouet.net/prod.php?which=69648

A difficult test for the Core! Plus the large cartridge size.
User avatar
jotego
Captain Atari
Captain Atari
Posts: 251
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: Genesis / Megadrive core ported to MiST

Post by jotego »

slingshot wrote:
jotego wrote: During the summer months I've been busy with travelling, reading and flamenco... so I didn't spend much time on this. Please use the MiSTer version for now as it is the most compatible one. The changes with JT12 v0.2 are minimum and for Megadrive work well.
Thanks for the answer! Strange the forum's message service didn't include the reply address.
I've already integrated the version you mentioned, and did some other rework on the core (e.g. use the standard MiST OSD and ROM loader, but in a compatible way with the other boards), the result is the FGPA's 27% is free now, so VDP development can continue, if someone is interested in it.
To free up as much as 27% of the FPGA is good news indeed. Place & routing becomes much easier for the tool when there is space room and timing constraints are met more easily. Thanks for that effort!
--
Source code of all my cores here.
My Patreon page here.
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 »

Higgy wrote:This scene demo seems to use pretty much every trick in the book even undocumented transparency effects!

http://www.pouet.net/prod.php?which=69648

A difficult test for the Core! Plus the large cartridge size.
The biggest problem with this game is PAL-only version.
User avatar
Higgy
Captain Atari
Captain Atari
Posts: 207
Joined: Tue Jan 24, 2017 1:38 pm

Re: Genesis / Megadrive core ported to MiST

Post by Higgy »

Is the problem that the NTSC/PAL implementation is not fully known on the Genesis/Megadrive?

I know the PCB's are the same with jumper switches defining if it is NTSC/PAL and for example on the NES it uses different chips and clock Crystal for NTSC or PAL.

I spotted a Youtuber 'Gamehut' he was a Megadrive programmer back in the day and seems to remember and have a lot of code still. Do you think it is worth asking him if he has information on what the Jumpers switch change to go from NTSC TO PAL? He implemented copy/play protection on 'Mickey Mania' and is fully aware of the Region jumpers on the PCB.
slingshot
Atari God
Atari God
Posts: 1983
Joined: Mon Aug 06, 2018 3:05 pm

Re: Genesis / Megadrive core ported to MiST

Post by slingshot »

Higgy wrote:Is the problem that the NTSC/PAL implementation is not fully known on the Genesis/Megadrive?

I know the PCB's are the same with jumper switches defining if it is NTSC/PAL and for example on the NES it uses different chips and clock Crystal for NTSC or PAL.

I spotted a Youtuber 'Gamehut' he was a Megadrive programmer back in the day and seems to remember and have a lot of code still. Do you think it is worth asking him if he has information on what the Jumpers switch change to go from NTSC TO PAL? He implemented copy/play protection on 'Mickey Mania' and is fully aware of the Region jumpers on the PCB.
The jumper is not the biggest problem :)
What it switches in the VDP is the one - different timings. It's not that hard, but there's still other work to do before looking into this. Of course if someone wants to work on it, the source is available.
Post Reply

Return to “MiST”