1999-10-03 14:16:26 +00:00
|
|
|
/*
|
|
|
|
* main.h - General definitions
|
|
|
|
*
|
2002-01-15 14:58:43 +00:00
|
|
|
* Basilisk II (C) 1997-2002 Christian Bauer
|
1999-10-03 14:16:26 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
|
|
|
|
|
|
|
// CPU type (0 = 68000, 1 = 68010, 2 = 68020, 3 = 68030, 4 = 68040/060)
|
|
|
|
extern int CPUType;
|
|
|
|
extern bool CPUIs68060; // Flag to distinguish 68040 and 68060
|
|
|
|
|
|
|
|
// FPU type (0 = no FPU, 1 = 68881, 2 = 68882)
|
|
|
|
extern int FPUType;
|
|
|
|
|
|
|
|
// Flag: 24-bit-addressing?
|
|
|
|
extern bool TwentyFourBitAddressing;
|
|
|
|
|
|
|
|
// 68k register structure (for Execute68k())
|
|
|
|
struct M68kRegisters {
|
|
|
|
uint32 d[8];
|
|
|
|
uint32 a[8];
|
|
|
|
uint16 sr;
|
|
|
|
};
|
|
|
|
|
1999-10-19 17:41:44 +00:00
|
|
|
// General functions
|
|
|
|
extern bool InitAll(void);
|
|
|
|
extern void ExitAll(void);
|
|
|
|
|
|
|
|
// Platform-specific functions
|
1999-10-03 14:16:26 +00:00
|
|
|
extern void FlushCodeCache(void *start, uint32 size); // Code was patched, flush caches if neccessary
|
|
|
|
extern void QuitEmulator(void); // Quit emulator
|
|
|
|
extern void ErrorAlert(const char *text); // Display error alert
|
2001-06-30 17:21:56 +00:00
|
|
|
extern void ErrorAlert(int string_id);
|
1999-10-03 14:16:26 +00:00
|
|
|
extern void WarningAlert(const char *text); // Display warning alert
|
2001-06-30 17:21:56 +00:00
|
|
|
extern void WarningAlert(int string_id);
|
1999-10-03 14:16:26 +00:00
|
|
|
extern bool ChoiceAlert(const char *text, const char *pos, const char *neg); // Display choice alert
|
|
|
|
|
2001-07-03 15:59:49 +00:00
|
|
|
// Mutexes (non-recursive)
|
|
|
|
struct B2_mutex;
|
|
|
|
extern B2_mutex *B2_create_mutex(void);
|
|
|
|
extern void B2_lock_mutex(B2_mutex *mutex);
|
|
|
|
extern void B2_unlock_mutex(B2_mutex *mutex);
|
|
|
|
extern void B2_delete_mutex(B2_mutex *mutex);
|
|
|
|
|
1999-10-03 14:16:26 +00:00
|
|
|
// Interrupt flags
|
|
|
|
enum {
|
2000-07-14 21:29:16 +00:00
|
|
|
INTFLAG_60HZ = 1, // 60.15Hz VBL
|
|
|
|
INTFLAG_1HZ = 2, // ~1Hz interrupt
|
|
|
|
INTFLAG_SERIAL = 4, // Serial driver
|
|
|
|
INTFLAG_ETHER = 8, // Ethernet driver
|
|
|
|
INTFLAG_AUDIO = 16, // Audio block read
|
2000-08-20 14:08:44 +00:00
|
|
|
INTFLAG_TIMER = 32, // Time Manager
|
2001-07-09 11:22:01 +00:00
|
|
|
INTFLAG_ADB = 64, // ADB
|
|
|
|
INTFLAG_NMI = 128 // NMI
|
1999-10-03 14:16:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern uint32 InterruptFlags; // Currently pending interrupts
|
|
|
|
extern void SetInterruptFlag(uint32 flag); // Set/clear interrupt flags
|
|
|
|
extern void ClearInterruptFlag(uint32 flag);
|
|
|
|
|
|
|
|
#endif
|