void raise_interrupt(IRQ_TYPE irq_raised) { // The specific IRQ must be enabled in IE, master IRQ enable must be on, // and it must be on in the flags. io_registers[REG_IF] |= irq_raised; if((io_registers[REG_IME] & 0x01) && (io_registers[REG_IE] & io_registers[REG_IF]) && ((reg[REG_CPSR] & 0x80) == 0)) { bios_read_protect = 0xe55ec002; // Interrupt handler in BIOS reg_mode[MODE_IRQ][6] = reg[REG_PC] + 4; spsr[MODE_IRQ] = reg[REG_CPSR]; reg[REG_CPSR] = 0xD2; reg[REG_PC] = 0x00000018; bios_region_read_allow(); set_cpu_mode(MODE_IRQ); reg[CPU_HALT_STATE] = CPU_ACTIVE; reg[CHANGED_PC_STATUS] = 1; } }
static void do_init_stuff( char **cmdline ) /*****************************************/ { char *env; if( !MsgInit() ) exit(1); add_constant( "WASM=" BANSTR( _BANVER ), true ); ForceInclude = AsmStrDup( getenv( "FORCE" ) ); do_envvar_cmdline( "WASM" ); parse_cmdline( cmdline ); set_build_target(); set_cpu_mode(); set_fpu_mode(); get_os_include(); env = getenv( "INCLUDE" ); if( env != NULL ) AddItemToIncludePath( env, NULL ); PrintBanner(); open_files(); PushLineQueue(); }