/*
* Support for a few cart mappers and some protection.
+ * (C) notaz, 2008,2009,2010
*
- * (c) Copyright 2008-2009, Grazvydas "notaz" Ignotas
- * Free for non-commercial use.
- *
+ * This work is licensed under the terms of MAME license.
+ * See COPYING file in the top-level directory.
*/
#include "../pico_int.h"
void carthw_realtec_startup(void)
{
- void *tmp;
int i;
elprintf(EL_STATUS, "Realtec mapper startup");
// allocate additional bank for boot code
// (we know those ROMs have aligned size)
- tmp = realloc(Pico.rom, Pico.romsize + M68K_BANK_SIZE);
- if (tmp == NULL)
- {
+ i = PicoCartResize(Pico.romsize + M68K_BANK_SIZE);
+ if (i != 0) {
elprintf(EL_STATUS, "OOM");
return;
}
- Pico.rom = tmp;
// create bank for boot code
for (i = 0; i < M68K_BANK_SIZE; i += 0x2000)
void carthw_prot_lk3_startup(void)
{
- void *tmp;
+ int ret;
elprintf(EL_STATUS, "lk3 prot emu startup");
// allocate space for bank0 backup
- tmp = realloc(Pico.rom, Pico.romsize + 0x8000);
- if (tmp == NULL)
- {
+ ret = PicoCartResize(Pico.romsize + 0x8000);
+ if (ret != 0) {
elprintf(EL_STATUS, "OOM");
return;
}
- Pico.rom = tmp;
memcpy(Pico.rom + Pico.romsize, Pico.rom, 0x8000);
PicoCartMemSetup = carthw_prot_lk3_mem_setup;