MD Mega Fighter (aka mmf)

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Post Reply
ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

MD Mega Fighter (aka mmf)

Post by ElBarto » Tue Nov 18, 2008 12:17 am

Hello all,

I've started a quite ambitious project, a fighting game.
I don't know if I'm gonna finish it one day but it's a pretty complete project to learn a lot of thing on the MD :)

You can download the demo here.

For now you can only move/jump and only with player1, the player2 is here just for fun.
There is a glitch while you jump forward or backward (only in fusion), I'm trying to find a solution to fix that ....
I've not tried on HW so if anybody can for me :)

The source will follow soon.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Nov 18, 2008 12:12 pm

Do you use DMA for the sprites ? I'm sure you do, and you are crossing a 128K boundary here (DMA updates only 16bits of the source address), so this glitch will happen on real HW aswell (not tried). Only Fusion does emulates this feature.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Tue Nov 18, 2008 12:24 pm

Hm, I get 404 Not Found.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Nov 18, 2008 5:36 pm

Gave a whirl on real HW and surprise surprise, it does not run. Luckily for you I had EXACT same problem in my game, and the problem is having DMA enabled and writing $00 to the last DMA reg !!! You either write $80 or don't set the DMA enable bit. This is the DMA bug I believe, one workaround is making Z80 run code that accesses ROM, this way you won't get crashes.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Tue Nov 18, 2008 10:24 pm

TmEE co.(TM) wrote:Gave a whirl on real HW and surprise surprise, it does not run. Luckily for you I had EXACT same problem in my game, and the problem is having DMA enabled and writing $00 to the last DMA reg !!! You either write $80 or don't set the DMA enable bit. This is the DMA bug I believe, one workaround is making Z80 run code that accesses ROM, this way you won't get crashes.
Can you give more info on this Z80 workaround you mentioned? Are you saying that simply reading ROM data from the Z80 will somehow prevent this lockup from occurring, or release the system from a locked state?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Nov 18, 2008 11:17 pm

When I had this issue in my game, I tried everything possible until I noticed I do an accidental DMA during reg initialization. The crash never happened when my sound engine played music with drums (aka heavy ROM access), Z80 initialized before VDP setup... when the DMA crash happens, the whole system seems stopped, though I'm not 100% sure as my engine may be waiting a command from 68K which is halted.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Wed Nov 19, 2008 6:46 am

I didn't really understand the dma bug ...

Here is what I do (in vblank):
- Enable DMA
- Setup DMA to copy tiles
- Disable DMA

Two times (each times for each player cause I didn't update the tile if the frame is the same).

I know I should wait for DMA BUSY = 0 to disable the dma, this may cause a bug ....

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Wed Nov 19, 2008 7:26 am

Somewhere I read that M68K halted while running DMA. Is it correct?
Anyway, I already used several DMA transfering in VBlank routine without checking DMA busy flag. All works fine.

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Wed Nov 19, 2008 8:02 am

Yeah I've read that too, I assume it's true.
So what is the need of a DMA BUSY flag if when you want to check this (68k code) it's will be always 0 cause the dma isn't "running" ?
Don't know if I'm clear enough.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Nov 19, 2008 8:59 am

You're having accidental DMA right in the reg initialization, when I run in on my MD2 I get a switch to 240 line res and a crash, with VRAM and palettes being in the undefined state (with TMSS enabled, I get the TMSS screen in 240line res)... that is, the code does not even reach the RAM clearing... I had same problem in my game, and cause was accidental DMA and a crash caused by it... 68K should be halted and nothing should happen, but it still crashes, and only DMA crashes are related to the DMA crashing bug mentioned in the manual. I've never ran into the bug as I've nearly always had Z80 doing something with the ROM... I'm quite sure that without any ROM access on Z80 side, I will probably start getting crashes in some situations unless I do the workaround Sega mentioned.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Wed Nov 19, 2008 9:45 am

Ok I get it, the DMA enable bit was setting at the vdp initialisation.
The rom should now run on HW (same url).
I really have to get my tototek flash work on FreeBSD, my only window pc is my laptop and I don't have a parallel port on it ....

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Nov 19, 2008 10:34 am

It still doesn't work... crash during reg init... don't load last VDP register, maybe it helps... I know all my ROMs work because of a bug in my code that left last VDP register to be untouched :P

BTW, 240 line res is 50Hz only, you get rolling screen in 60Hz.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Post Reply