static DEVICE_RESET( ti99_pcoden ) { logerror("ti99_pcode: reset\n"); ti99_pcoden_state *pcode = get_safe_token(device); /* If the card is selected in the menu, register the card */ if (input_port_read(device->machine(), "EXTCARD") & EXT_PCODE) { device_t *peb = device->owner(); int success = mount_card(peb, device, &pcode_ncard, get_pebcard_config(device)->slot); if (!success) return; astring *region = new astring(); astring_assemble_3(region, device->tag(), ":", pcode_region); pcode->rom0 = device->machine().region(astring_c(region))->base(); pcode->rom1 = pcode->rom0 + 0x1000; pcode->rom2 = pcode->rom0 + 0x2000; pcode->grom = pcode->rom0 + 0x3000; pcode->bank_select = 0; pcode->selected = 0; astring *gromname = new astring(); for (int i=0; i < 8; i++) { astring_printf(gromname, "grom_%d", i); pcode->gromdev[i] = device->subdevice(astring_c(gromname)); } } }
/* * Application entry point. */ int main(void) { #if 0 static const evhandler_t evhndl[] = { InsertHandler, RemoveHandler }; #endif /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); crypto_init(); buttons_init(); chHeapInit(fast_heap, FAST_HEAP_ADDR, FAST_HEAP_SIZE); sdStart(&SD2, NULL); palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7)); palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7)); lcd_init(); setvbuf(stdin, NULL, _IONBF, 0); mmcObjectInit(&MMCD1); mmcStart(&MMCD1, &mmccfg); mount_card(); pwmStart(&PWMD1, &lcd_pwmcfg); palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(1)); // XXX moveme palSetPadMode(GPIOB, 6, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOC, 10, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOC, 11, PAL_MODE_INPUT_PULLUP); fiprintf(lcd_stdout, "HIHI"); while (TRUE) { console_cmd_loop(); //chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS)); } return 0; }
int fs_drv_init(const char* args,int argc) { slow_card = 0; gBootCic = 6102; gCpldVers = neo_get_cpld(); // get Myth CPLD ID gCardID = neo_id_card(); // check for Neo Flash card neo_select_menu(); // enable menu flash in cart space gCardType = *(volatile unsigned int *)(0xB01FFFF0) >> 16; switch(gCardType & 0x00FF) { case 0: gCardTypeCmd = 0x00DAAE44; // set iosr = enable game flash for newest cards gPsramCmd = 0x00DAAF44; // set iosr for Neo2-SD psram break; case 1: gCardTypeCmd = 0x00DA8E44; // set iosr = enable game flash for new cards gPsramCmd = 0x00DA674E; // set iosr for Neo2-Pro psram break; case 2: gCardTypeCmd = 0x00DA0E44; // set iosr = enable game flash for old cards gPsramCmd = 0x00DA0F44; // set iosr for psram break; default: gCardTypeCmd = 0x00DAAE44; // set iosr = enable game flash for newest cards gPsramCmd = 0x00DAAF44; // set iosr for psram break; } disk_io_set_mode(0,0); neo2_enable_sd(); return mount_card(); }