Page 8 of 12

Re: MAME Emulation

Posted: Thu Oct 31, 2019 8:55 pm
by robcfg
Here's MAME vdk loading code:

Code: Select all

bool vdk_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
{
	uint8_t header[0x100];
	io_generic_read(io, header, 0, 0x100);

	int header_size = header[3] * 0x100 + header[2];
	int track_count = header[8];
	int head_count = header[9];

	int file_offset = header_size;

	for (int track = 0; track < track_count; track++)
	{
		for (int head = 0; head < head_count ; head++)
		{
			desc_pc_sector sectors[SECTOR_COUNT];
			uint8_t sector_data[SECTOR_COUNT * SECTOR_SIZE];
			int sector_offset = 0;

			for (int i = 0; i < SECTOR_COUNT; i++)
			{
				sectors[i].track = track;
				sectors[i].head = head;
				sectors[i].sector = FIRST_SECTOR_ID + i;
				sectors[i].actual_size = SECTOR_SIZE;
				sectors[i].size = SECTOR_SIZE >> 8;
				sectors[i].deleted = false;
				sectors[i].bad_crc = false;
				sectors[i].data = &sector_data[sector_offset];

				io_generic_read(io, sectors[i].data, file_offset, SECTOR_SIZE);

				sector_offset += SECTOR_SIZE;
				file_offset += SECTOR_SIZE;
			}

			build_wd_track_mfm(track, head, image, 100000, SECTOR_COUNT, sectors, 22, 32, 24);
		}
	}

	return true;
}
At first glance, the loading code looks correct...

Re: MAME Emulation

Posted: Sat Nov 02, 2019 2:01 am
by bluearcus
Yeah, that does look pretty much OK, perhaps it's not directly related to a doublesided format as I'd assumed, Something must be amiss though to explain the Xroar vs Mame discrepancy in behaviour.

Re: MAME Emulation

Posted: Thu Nov 14, 2019 1:20 pm
by pser1
Hello,
I would like to debug a program that uses a lot of 6309 opcodes.
If I start with -debug, I can load the program after F5 but in the moment I press EXEC to start the program I always get this answer
?6 ERROR

Of course I have not done anything to tell MAME that the program is intended for a 6309 CPU
How should I proceed in order to be able to debug it?
Thanks in advance
pere

Re: MAME Emulation

Posted: Thu Nov 14, 2019 1:34 pm
by robcfg
Are you choosing a regular Dragon driver or one fitted with a 6309 processor?

Re: MAME Emulation

Posted: Thu Nov 14, 2019 2:51 pm
by pser1
Hello Robert,
I am using the one I have been using for the std Dragon, so I have to asume it uses a 6809
Is there a different version that accepts a 6309 CPU?
I would appreciate if you could upload it here to test it!
thanks a lot
pere

Re: MAME Emulation

Posted: Thu Nov 14, 2019 2:56 pm
by pser1
How do you tell MAME that it should accept the 6309 opcodes?
Inside the dragon64.zip there are only three ROMs, two for Basic and one for DOS
But I see no place to state the fact that you would code for the 6309 CPU

cheers
pere

Re: MAME Emulation

Posted: Thu Nov 14, 2019 5:56 pm
by robcfg
I don’t remember the name right now, but instead of dragon64 you have to start the equivalent machine that has the 6309.

There’s the dragon64 driver, which uses the 6809, and there should be a machine named dragon64_6309 or similar, which is the one you need to use.

Mame does not allow processor configuration per driver, you need a different driver instead.

I’ll take a look later today and come back to you.

Re: MAME Emulation

Posted: Thu Nov 14, 2019 6:52 pm
by pser1
thanks, Robert
I will have a look later too
cheers
pere

Re: MAME Emulation

Posted: Thu Nov 14, 2019 7:01 pm
by robcfg
Found it!

Use dragon64h instead of dragon64 as driver.

As in "mame64.exe dragon64h -window - debug"

Re: MAME Emulation

Posted: Thu Nov 14, 2019 7:32 pm
by pser1
issuing this command from the command line, it opens the machine window and the debug one
but immediately closes both windows and returns to the system
Probably the file dragon64h or its definition *doesn't* exist in my computer
Could you, please, upload that file here and tell me where should I put it (foldername)?
thanks a lot
pere

Ps. I am using MAME 215