Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Freescale mcf5206e peripherals for Pluto 6 emulation #13261

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

NaokiS28
Copy link

Hi all,

I have been trying to emulate the Pluto 6 system from Heber and get it to a more useable state. My main intention was for homebrew projects but I also wanted to get Heber's demo programs to run.

A list of changes:

  • Update Pluto 6 Driver to support Heber's demo program (downloadable from their website)
  • Support all the I/O of the board with preliminary emulation of the FPGA, including the multiple address layout maps
  • Preliminary emulation of the Customer Security Device, otherwise known as the PIC18 security chip (also uploads the FPGA bitstream)
  • Update MCF5206E emulation to include support for the IO peripherals in the CPU package
  • Included two layout files for the Heber Development Board to roughly illustrate the board's functions, one for non-video designs and the other for single/dual video designs
  • Add separate device drivers for the following:
    -- ColdFire SIM Module - Preliminary but handles the timer IRQs
    -- ColdFire UART Modules - Based on the existing mc68681.cpp driver
    -- ColdFire Mbus Module - Preliminary, Motorola/Freescale/NXP's I2C driver
    -- Serial VFD - Better name/base device designation needed, essentially a serialised VFD 1x16 character display. Was used in a lot of fruit machines in the late 90s going on 2000s.

My intention is to at least get the demo program to load up and run in MAME, and currently only the SIM module needs updating to do this to correctly run the appropriate interrupt vector, followed by FPGA emulation for sound and UART support which is currently lacking. I've tried to follow best practices where possible but if there's anything I have missed or should be added, please let me know!

@NaokiS28
Copy link
Author

Just to make a note regarding the m68000 core changes, I only added these lines, but it seems running m68kmake.py and m68000gen.py rewrote the files and probably changed all the white spacing or something to cause those 12k changes.

//m68k_in.lst
4ac8 ffff halt        . .             c:0p
    m68ki_trace_t0();              /* auto-disable (see m68kcpu.h) */
    m_icount = 0;
    m_stopped = STOP_LEVEL_HALT;

//m68000.lst
4ac8 ffff halt    -     -

@mamehaze
Copy link
Contributor

a few basic things. Hashes should be in lowercase, not CAPS

also you've added a set of all NO_DUMP ROMs, we don't do that, this represents no data at all.

ROM_START( pl6_atw )
ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 )
ROM_LOAD16_BYTE( "27c801-5e1.u1", 0x000001, 0x100000, NO_DUMP )
ROM_LOAD16_BYTE( "27c801-5e2.u2", 0x000000, 0x100000, NO_DUMP )
ROM_LOAD16_BYTE( "27c801-snd1.u3", 0x100001, 0x100000, NO_DUMP )
ROM_LOAD16_BYTE( "27c801-snd2.u4", 0x100000, 0x100000, NO_DUMP )
ROM_END

@NaokiS28
Copy link
Author

a few basic things. Hashes should be in lowercase, not CAPS

also you've added a set of all NO_DUMP ROMs, we don't do that, this represents no data at all.

ROM_START( pl6_atw ) ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "27c801-5e1.u1", 0x000001, 0x100000, NO_DUMP ) ROM_LOAD16_BYTE( "27c801-5e2.u2", 0x000000, 0x100000, NO_DUMP ) ROM_LOAD16_BYTE( "27c801-snd1.u3", 0x100001, 0x100000, NO_DUMP ) ROM_LOAD16_BYTE( "27c801-snd2.u4", 0x100000, 0x100000, NO_DUMP ) ROM_END

Ah thank you for reminding me, will add the dump details now. I need to submit those, actually.

@mamehaze
Copy link
Contributor

the CAPS thing in general applies elsewhere too btw, you've got uppercase in many other places too, MAME tends to prefer lowercase

to pick a few random ones out

LOGVFD("vfd_text: %02x, %s, %d\n", (m_cmd & 0x3F), m_cmd, m_cursor);
	if(m_cmd != 0x2C && m_cmd != 0x2E){

m_vfd[m_cursor-1] = (m_buff[m_cursor-1] | vfd_charMap[m_cmd & 0x3F]);

(but there are many more)

@mamehaze
Copy link
Contributor

all in all I'm just happy somebody is giving these attention though, many of these fruit machine boards use very specific CPU variants where internal peripherals need doing. When everything was added it was added with the hope that they'd eventually be picked up and fleshed out, and sorted out properly.

U56: MC68682 DUART
B1: Varta NiCd 3v SRAM battery, which is likely leaking if not already replaced.
EXP 0+1: Fujitsu Cremson MB86290A/Expansion ports.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. I don't remember big differences between Cremson and Orchid really ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but I was getting errors about not having a screen attached despite not installing the device, so I commented it out for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs a configured screen_device and a ram_device as absolute bare minimum (needs the host for gathering data).

	MB86292(config, m_gpu, 0);
	m_gpu->set_screen(m_screen);
	m_gpu->set_vram(m_vram);
	// m_gpu->set_xint_cb().set(FUNC(alien_state::gpu_irq_w<0>));

Copy link
Member

@angelosa angelosa Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Or, in case of Pluto 5, SDRAM is on Calypso 16 card, I went the ram_device approach because this is a 200x card, and eventually it's gonna give back a penalty depending on what type is mounted.
PS: left is FPGA.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs a configured screen_device and a ram_device as absolute bare minimum (needs the host for gathering data).

	MB86292(config, m_gpu, 0);
	m_gpu->set_screen(m_screen);
	m_gpu->set_vram(m_vram);
	// m_gpu->set_xint_cb().set(FUNC(alien_state::gpu_irq_w<0>));

Yeah but I needed to think about it as the video device isn't always installed (actually quite a lot), so was going to only have those included when needed, not always in the class definition

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, because that is isolated from the rest of the system, needs a bus slot mechanism instead ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do that when I get chance.

@NaokiS28
Copy link
Author

Will sort that 'statement has no effect' error when I'm back and free

Comment on lines +120 to +127
* Game Notes *
pl6_cm: Hybrid Pluto 6 + PC setup. They are connected over RS232. Pluto 6 is probably handling IO and security here.
Uses a Intel Celeron (2.1Ghz) PC with a Protech PROX3770 motherboard. Game runs on Windows XP.
pl6_dev: Heber's official development kit for the Pluto 6. Only ships with a development BIOS and an SDK.
This "game" requires a bootable (FAT32 with Active partition) CHD, else it does nothing visually.
The CHD in this driver is an image of the CF card that was supplied by Heber in the SDK for demo purposes.
Security and FPGA encryption is disabled on this model.
Copy link
Member

@angelosa angelosa Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't find anything about the Protech PROX3770 beyond some bare listing. The earlier PROX3680 seems to be running on Intel chipset (ICH2 + Socket 370), still no BIOS tho as canon for industrial boards.
If pl6_demo (sic?) is supposed to be the x86 BIOS then it should go as a separate driver regardless because it's very out of scope to what's here (and, eventually, connect thru serial as two MAME instances).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pl6_demo is a demo program that uses a debug version of the bootloader to load the game program from a FAT32 partition on CF/IDE and then run on board.

The Protech PROX3770 was for pl6_cm, and yes I agree it should be a separate instance, will make a note.

@NaokiS28
Copy link
Author

Is someone else able to confirm if when doing a memdump that coldfire_mbus_device::mbdr_r is being unmapped somewhere? I cannot see why but memdump is listing 0xF00001F0-0xFFFFFFFF as being unmapped and I cannot tell why when the prior registers are loading

@NaokiS28
Copy link
Author

Is someone else able to confirm if when doing a memdump that coldfire_mbus_device::mbdr_r is being unmapped somewhere? I cannot see why but memdump is listing 0xF00001F0-0xFFFFFFFF as being unmapped and I cannot tell why when the prior registers are loading

Ignore this - was getting confused and not thinking

@NaokiS28
Copy link
Author

NaokiS28 commented Feb 1, 2025

I am at the point where the pluto 6 demo will now go into the demo screen to show the outputs. In theory the ColdFire UART should work enough that the serial menu would work, but further work on the FPGA HLE will be needed. The demo freezes when trying to send out other data on the other UARTs, but this will require more work to figure out which interrupts are needed.

macOS full build works on my side, Windows should too but my mingw setup isn't working right, so hopefully should be good

@angelosa
Copy link
Member

angelosa commented Feb 1, 2025

Any sign of life from the Fujitsu GPU?

@NaokiS28
Copy link
Author

NaokiS28 commented Feb 1, 2025

The video demo tries to initialise it but the emulation is skeleton and Im not the best person to implement it. There’s two demos from Heber that do make good use of the cremson and Ill try to link it up again when I know more about the implementation. It wasnt used that much in games but Heber did have a prototype dual video game. I know the owner and he said he had preserved the software from it, so Ill ask him if he would contribute when possible.

@NaokiS28 NaokiS28 marked this pull request as ready for review February 2, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants