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

trs/mc10.cpp: add minimum rom size and block size for cartridge rom, clean global namespace #12088

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

Conversation

Mokona
Copy link
Contributor

@Mokona Mokona commented Mar 2, 2024

Resolving the comments on #12080

  • Clean some mentioned code aspects
  • Specify the ROM minimum size and block size
  • Sort includes
  • Clean the global namespace
  • Add license lines

Report the comments on other previously written MC10 cart devices.

Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

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

This complicates the interface unnecessarily.

Comment on lines +111 to +122
else if (len < m_cart->min_rom_length())
{
return std::make_pair(
image_error::INVALIDLENGTH,
util::string_format("Unsupported cartridge size (must be at least %u bytes)", m_cart->min_rom_length()));
}
else if (len % m_cart->block_rom_length() != 0)
{
return std::make_pair(
image_error::INVALIDLENGTH,
util::string_format("Unsupported cartridge size (must be a multiple of %u bytes)", m_cart->block_rom_length()));
}
Copy link
Member

Choose a reason for hiding this comment

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

Adding the minimum length and granularity to the interface over-complicates things when they can be checked in load() if necessary anyway. The only reason the maximum length is checked here is to guard against attempting to read an excessively large file as loose software.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

Comment on lines +366 to 367
DEFINE_DEVICE_TYPE_PRIVATE(MC10_PAK_MCX128, device_mc10cart_interface, mc10_pak_mcx128_device, "mc10_mcx128", "Darren Atkinson's MCX-128 cartridge")
DEFINE_DEVICE_TYPE_PRIVATE(ALICE_PAK_MCX128, device_mc10cart_interface, alice_pak_mcx128_device, "alice_mcx128", "Darren Atkinson's MCX-128 cartridge (Alice ROM)")
Copy link
Member

Choose a reason for hiding this comment

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

Do these actually need to be different device types at all? Would making the ROMs BIOS options not be adequate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not the author of that part, I only applied to it the comment you made on private device and namespace to the neighbour file. But anyway, as I started to change it, I can push the change further.

If I understand the suggestion, it would be to have only one device type for mcx128, but add a configuration option on it to select between both ROMs described at the beginning of the file?

Copy link
Member

Choose a reason for hiding this comment

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

If you look at a card like this: https://github.com/mamedev/mame/blob/master/src/devices/bus/a2bus/grappler.cpp

Note that the Grappler+ has options for the 3.0 and 3.2 ROM revisions. You select them like -sl1 grapplus,bios=v30 or -sl1 grapplus,bios=v32.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I finally had time to look at this. I see a difference between the grappler and the mc10 situation. From what I understand, for grappler, both ROMs are valid for the card. So this is presented as an option, with a default value.

For the MCX128 device, you must use the ROM depending on the ROM installed for the particular flavour of the computer. Both computers are (almost) the same, but they have different system ROMs. And this, if you run the MC-10, you must use the ROM for MC-10 in the MCX128 device. And the same for Alice, with its own ROM.

So that's why the author originally made two devices I guess. Changing the ROM for the device does not represent a valid configuration.

Is there a way to have the "default ROM" depending on the emulated computer?

@galibert
Copy link
Member

galibert commented May 17, 2024 via email

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.

None yet

3 participants