X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Ffame%2Ffamec.c;h=8c71c0799eca80042181938e5264a54055116b65;hb=3aa1e148a28da9b4e10e824984f7b3a4908b1ace;hp=609b76fe029d50fe8b15b24378972960a286a57f;hpb=70357ce52578dee0dd3b3663902cf872c3d34258;p=picodrive.git diff --git a/cpu/fame/famec.c b/cpu/fame/famec.c index 609b76f..8c71c07 100644 --- a/cpu/fame/famec.c +++ b/cpu/fame/famec.c @@ -523,7 +523,7 @@ static u32 flag_I; #endif -static void init_jump_table(void); +static int init_jump_table(void); /* Custom function handler */ typedef void (*icust_handler_func)(u32 vector); @@ -626,35 +626,6 @@ static const s32 exception_cycle_table[256] = }; -/********************/ -/* helper functions */ -/********************/ - - -#if 0 -static void famec_SetFetch(u32 low_adr, u32 high_adr, u32 fetch_adr) -{ - u32 i, j; - - i = (low_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; - j = (high_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; - - while (i <= j) - g_m68kcontext->Fetch[i++] = fetch_adr; -} - -static void famec_SetBanks(void) -{ - u32 i=0; - while(m68kcontext.fetch[i].low_addr != (u32)-1) - { - famec_SetFetch(m68kcontext.fetch[i].low_addr,m68kcontext.fetch[i].high_addr,m68kcontext.fetch[i].offset); - i++; - } -} -#endif - - /***********************/ /* core main functions */ /***********************/ @@ -939,8 +910,12 @@ int m68k_emulate(s32 cycles) { if (!initialised) { +#ifdef FAMEC_NO_GOTOS init_jump_table(); return 0; +#else + goto init_jump_table; +#endif } /* Comprobar si la CPU esta detenida debido a un doble error de bus */ @@ -965,8 +940,8 @@ int m68k_emulate(s32 cycles) // Cache SR SET_SR(m68kcontext.sr) - // Cache PPL - flag_I = M68K_PPL; + // Cache PPL + flag_I = M68K_PPL; // Fijar PC SET_PC(m68kcontext.pc) @@ -1078,12 +1053,16 @@ famec_Exec: #endif return cycles - m68kcontext.io_cycle_counter; -} - +#ifdef FAMEC_NO_GOTOS +} -static void init_jump_table(void) +static int init_jump_table(void) +{{ +#else +init_jump_table: { +#endif u32 i, j; for(i = 0x0000; i <= 0xFFFF; i += 0x0001) @@ -5090,6 +5069,7 @@ static void init_jump_table(void) JumpTable[0xF000 + i] = CAST_OP(0xF000); initialised = 1; -} + return 0; +}}