-
Notifications
You must be signed in to change notification settings - Fork 2k
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 "Multiport" cartridge and RAM expansion for the Matra & Hachette Alice #12080
Conversation
@Mokona the new files are missing license header, see other source files to see what I mean. |
@@ -38,6 +42,7 @@ | |||
#include "mcx128.h" | |||
#include "pak.h" | |||
#include "ram.h" | |||
#include "multiports_ext.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be kept sorted.
void mc10_multiports_ext_device::device_post_load() | ||
{ | ||
update_bank(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary – bank objects automatically save and restore state.
void mc10_multiports_ext_device::update_bank() | ||
{ | ||
m_bank.target()->set_entry(rom_bank_index); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The object finders implement operator->
so you can use natural syntax as though they were pointers. Adding .target()
is ugly.
memory_region *const romregion(memregion("^rom")); | ||
if (!romregion) | ||
{ | ||
return std::make_pair(image_error::BADSOFTWARE, "Software item lacks 'rom' data area"); | ||
} | ||
|
||
m_bank.target()->configure_entries(0, 8, romregion->base(), 0x2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s no check that the ROM is large enough here – you aren’t catering for ROMs with less than 64KiB, so you need to add a check to ensure the ROM is big enough, or you’ll end up reading off the end of the memory region.
Also, the check that the rom
region exists is redundant, because you won’t get here if it isn’t since it’s already checked by the slot device.
|
||
DEFINE_DEVICE_TYPE_PRIVATE(ALICE_MULTIPORTS_EXT, device_mc10cart_interface, mc10_multiports_ext_device, "mc10_multiports_ext", "Fred_72 and 6502man's Multiports Extension") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of this is to put the content of the file in an anonymous namespace to minimise global symbols.
Thanks for the review. As this was already merged, I will provide another PR soon. |
…ra & Hachette Alice (mamedev#12080)
This addition to the Alice line (4k, 32 and 90) adds RAM and Cartridge support in a different way as the already supported Darren Atkinson's MCX-128 cartridge.