X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcarthw%2Fcarthw.c;h=e35ae75d4e1cdc1e7f1279aa1563d591a72b036e;hb=a736af3ecf708652f90e9cb05445d984960a0eec;hp=9d81f8e072b7d49c3a1e7a76357ff9317c905f75;hpb=1f1ff763e661bab664151c4821c65dad35777976;p=picodrive.git diff --git a/pico/carthw/carthw.c b/pico/carthw/carthw.c index 9d81f8e..e35ae75 100644 --- a/pico/carthw/carthw.c +++ b/pico/carthw/carthw.c @@ -203,20 +203,17 @@ static void carthw_realtec_reset(void) 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) @@ -487,18 +484,16 @@ static void carthw_prot_lk3_mem_setup(void) 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;