Example #1
0
/**
 * Check Bios call and see if we need to re-direct to our own routines
 * Return TRUE if we've handled the exception, else return FALSE to let TOS attempt it
 */
bool Bios(void)
{
	Uint32 Params;
	Uint16 BiosCall;

	/* Get call */
	Params = Regs[REG_A7];
	BiosCall = STMemory_ReadWord(Params);

	/* Intercept? */
	switch(BiosCall)
	{
	 case 0x1:
		return Bios_Bconstat(Params);
	 case 0x2:
		return Bios_Bconin(Params);
	 case 0x3:
		return Bios_Bconout(Params);
	 case 0x4:
		return Bios_RWabs(Params);
	 case 0x8:
		return Bios_Bcostat(Params);
	 default:           /* Call as normal! */
		HATARI_TRACE ( HATARI_TRACE_OS_BIOS, "BIOS %d\n", BiosCall );
		return FALSE;
	}
}
Example #2
0
/**
 * Check Bios call and see if we need to re-direct to our own routines.
 * Return true if we've handled the exception, else return false to let
 * TOS attempt it
 */
bool Bios(void)
{
	Uint32 Params;
	Uint16 BiosCall;

	/* Get call */
	Params = Regs[REG_A7];
	BiosCall = STMemory_ReadWord(Params);
	Params += SIZE_WORD;

	/* Intercept? */
	switch(BiosCall)
	{
	case 0x0:
		LOG_TRACE(TRACE_OS_BIOS, "BIOS 0x00 Getmpb(0x%X)\n",
			  STMemory_ReadLong(Params));
		break;

	case 0x3:
		LOG_TRACE(TRACE_OS_BIOS, "BIOS 0x03 Bconout(%i, 0x%02hhX)\n",
			  STMemory_ReadWord(Params),
			  STMemory_ReadWord(Params)+SIZE_WORD);
		break;

	case 0x4:
		Bios_RWabs(Params);
		break;

	case 0x5:
		LOG_TRACE(TRACE_OS_BIOS, "BIOS 0x05 Setexc(0x%hX, 0x%X)\n",
			  STMemory_ReadWord(Params),
			  STMemory_ReadLong(Params)+SIZE_WORD);
		break;

	case 0x1:
	case 0x2:
	case 0x7:
	case 0x8:
	case 0x9:
	case 0xB:
		/* commands taking a single word */
		LOG_TRACE(TRACE_OS_BIOS, "BIOS 0x%02hX %s(0x%hX)\n",
			  BiosCall, Bios_Call2Name(BiosCall),
			  STMemory_ReadWord(Params));
		break;

	case 0x6:
	case 0xA:
		/* commands taking no args */
		LOG_TRACE(TRACE_OS_BIOS, "BIOS 0x%02hX %s()\n",
			  BiosCall, Bios_Call2Name(BiosCall));
		break;

	default:
		Log_Printf(LOG_WARN, "Unknown BIOS call 0x%x!\n", BiosCall);
		break;
	}
	return false;
}