Page 1 of 5

mahlemiut WIP

Posted: Mon Jul 28, 2003 12:45 am
by mahlemiut
If Haze and R. Belmont can do this... :)

Thought I would look at the Sega Megatech driver seeing as Haze is on vacation, and I thought it would be a good learning experience to look at its BIOS (and the Z80 is the CPU I know fairly well).

Anyway, here's the current status of the driver. http://mahlemiut.marpirc.net/megatechupdate5.zip

And some pics too :)
ImageImage
ImageImage

RE

Posted: Mon Jul 28, 2003 1:03 am
by QRS
You are the man Barry!

Posted: Mon Jul 28, 2003 7:15 am
by Luja
Wowwww!!!! Sonic and Golden Axe.... Great, great, great

Regards

Posted: Mon Jul 28, 2003 7:42 am
by DRN
Excellent work Barry!! :D

Posted: Mon Jul 28, 2003 6:51 pm
by kfx
Nice work :D

Posted: Tue Jul 29, 2003 8:52 am
by mahlemiut
http://mahlemiut.marpirc.net/megatechupdate6.zip

Disabled the reading on the Genesis ports when a certain bit port is set low. Not sure of the correctness, as it is activated when the BIOS goes into test mode. But maybe that's normal. I don't really know for sure.

Also, changed the DIP switch defaults to 1 coin/1 credit for slots 1, 3, and 4, and 1 coin/2 credits for slot 2, at 3 minutes per credit.

Posted: Thu Jul 31, 2003 8:10 am
by mahlemiut
http://mahlemiut.marpirc.net/megatechupdate7.zip

The Genesis input ports are now mapped to the BIOS inputs, so now there is no more doubling up of controls.

Posted: Thu Aug 14, 2003 4:15 pm
by mahlemiut
Image

Well, it's a start. Still a long, long way to go on this one.

Posted: Thu Aug 14, 2003 9:19 pm
by mfm005
very good :)

Posted: Tue Aug 19, 2003 5:49 am
by mahlemiut
ImageImage

Now I guess I should get all input ports working - just the coin, start, service and test inputs found so far.

Posted: Thu Aug 21, 2003 11:46 pm
by mahlemiut
Image Image

Posted: Fri Aug 22, 2003 7:07 pm
by QRS
Ahh some neat progress here Barry! Now hurry up so I can play Sonic in fullscreen soon j/k :)

Posted: Fri Aug 22, 2003 10:36 pm
by Haze
nice work again barry, check your pm

Posted: Sun Aug 24, 2003 3:44 am
by mahlemiut
Image

All ROM tests pass now.
IC-2 = BIOS ROM
Slot 1 Main = Genesis 68k code
SUB = Game information ROM.

Now I need to figure out IC-28 and IC-29 are.

And maybe no one will mind if I post this.... :)

Image

Posted: Mon Aug 25, 2003 2:51 pm
by Kale
Bug fix for MT: Golden Axe 2 :)

Code: Select all

In genesis_io_r add these two lines at 1217 & 1239:
				if(iport1 & 0x10 || iport2 & 0x20)
					return_value+=1;
full code:
 READ16_HANDLER ( genesis_io_r )
{
	/* 8-bit only, data is mirrored in both halves */

	UINT8 return_value = 0;

	switch (offset)
	{
		case 0:
		/* Charles MacDonald ( http://cgfm2.emuviews.com/ )
		    D7 : Console is 1= Export (USA, Europe, etc.) 0= Domestic (Japan)
		    D6 : Video type is 1= PAL, 0= NTSC
		    D5 : Sega CD unit is 1= not present, 0= connected.
		    D4 : Unused (always returns zero)
		    D3 : Bit 3 of version number
		    D2 : Bit 2 of version number
		    D1 : Bit 1 of version number
		    D0 : Bit 0 of version number
		*/
			return_value = 0x80; /* ? megatech is usa? */
			break;

		case 1: /* port A data (joypad 1) */

			if (genesis_io_ram[offset] & 0x40)
			{
				int iport = readinputport(9);
				return_value = iport & 0x3f;
			}
			else
			{
				int iport1 = readinputport(12);
				int iport2 = readinputport(7) >> 1;
				return_value = (iport1 & 0x10) + (iport2 & 0x20);
				if(iport1 & 0x10 || iport2 & 0x20)
					return_value+=1;
			}

			return_value = (genesis_io_ram[offset] & 0x80) | return_value;
			logerror ("reading joypad 1 , type %02x %02x\n",genesis_io_ram[offset] & 0x80, return_value &0x7f);
			if(bios_ctrl_inputs & 0x04) return_value = 0xff;
			break;

		case 2: /* port B data (joypad 1) */

			if (genesis_io_ram[offset] & 0x40)
			{
				int iport1 = (readinputport(9) & 0xc0) >> 6;
				int iport2 = (readinputport(8) & 0x0f) << 2;
				return_value = (iport1 + iport2) & 0x3f;
			}
			else
			{
				int iport1 = readinputport(12) << 2;
				int iport2 = readinputport(7) >> 2;
				return_value = (iport1 & 0x10) + (iport2 & 0x20);
				if(iport1 & 0x10 || iport2 & 0x20)
					return_value+=1;
			}
			return_value = (genesis_io_ram[offset] & 0x80) | return_value;
			logerror ("reading joypad 2 , type %02x %02x\n",genesis_io_ram[offset] & 0x80, return_value &0x7f);
			if(bios_ctrl_inputs & 0x04) return_value = 0xff;
			break;

		default:
			return_value = 0xe0;

	}
	return return_value | return_value << 8;



}
This will fix the Golden Axe 2 start recognition bug.This is a guess,but I believe that bit is used for "joypad recognition",because without it the xP Play msg doesn't appear in the Main menu screen...
This will fix *at least* Gain Ground as well if a MegaTech version exists at all(I remember it can recognize "joypad recognition"),but I'm unsure if it breaks something at all(Needs through testing).