From 433d69ebdc656e668bd755ab13dc66e8dc4fcd85 Mon Sep 17 00:00:00 2001 From: Andrea Ottaviani Date: Thu, 5 Sep 2024 22:10:17 +0200 Subject: [PATCH] Add files via upload fixed ram location for G-7000 compatibility, added exROM (game VP31 e VP40) support --- VSC-PicoPAC/picopac_cart.c | 71 +++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/VSC-PicoPAC/picopac_cart.c b/VSC-PicoPAC/picopac_cart.c index 27d4ef0..bf851b0 100644 --- a/VSC-PicoPAC/picopac_cart.c +++ b/VSC-PicoPAC/picopac_cart.c @@ -144,7 +144,8 @@ char extram[0xff]; //////////////////////////////////////////////////////////////////////////////////// void error(int numblink){ multicore_lockout_start_blocking(); - gpio_init(PICO_DEFAULT_LED_PIN); + sleep_ms(1000); + gpio_init(PICO_DEFAULT_LED_PIN); gpio_set_dir(PICO_DEFAULT_LED_PIN,GPIO_OUT); while(1){ @@ -180,29 +181,32 @@ void __not_in_flash_func(core1_main()) { //gpio_set_dir_in_masked(ALWAYS_IN_MASK); newgame=0; + gamechoosen=0; // Initial conditions - SET_DATA_MODE_IN; + //SET_DATA_MODE_IN; + while(newgame==0) { + //while(1) { pins=gpio_get_all(); addr = (pins & 0b0111111111111); - if((gpio_get(CS_PIN)==0) && (gpio_get(WR_PIN)==0)) { - extram[addr & 0xff]=((pins & DATA_PIN_MASK)>>D0_PIN); - if (extram[0x7e]==0x0a) { - gamechoosen=extram[0x7f]; - } - } else { bank=3-((gpio_get(P10_PIN)+(gpio_get(P11_PIN)*2))); - - if (gpio_get(PSEN_PIN)==0) { + if (gpio_get(PSEN_PIN)==0) { SET_DATA_MODE_OUT; gpio_put_masked(DATA_PIN_MASK,(rom_table[bank][addr])<>D0_PIN); + if (extram[0xff]==0xaa) { + gamechoosen=extram[0xfe]; + } + } + SET_DATA_MODE_IN; } + SET_DATA_MODE_IN; - + switch (new_bank_type) { case 0: // standard 2k / 4k while(1) { @@ -235,16 +239,18 @@ void __not_in_flash_func(core1_main()) { break; case 2: // XROM while(1) { - pins=gpio_get_all(); + pins=gpio_get_all(); addr = (pins & 0b0111111111111); // for all cart but xrom - if ((gpio_get(PSEN_PIN)==0 )) { - SET_DATA_MODE_OUT; - gpio_put_masked(DATA_PIN_MASK,(rom_table[0][addr])<