2013-11-06 06:11:27 +00:00
|
|
|
/*
|
|
|
|
* Apple // emulator for *nix
|
|
|
|
*
|
|
|
|
* This software package is subject to the GNU General Public License
|
|
|
|
* version 2 or later (your choice) as published by the Free Software
|
|
|
|
* Foundation.
|
|
|
|
*
|
|
|
|
* THERE ARE NO WARRANTIES WHATSOEVER.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MOCKINGBOARD_H__
|
|
|
|
#define _MOCKINGBOARD_H__
|
|
|
|
|
|
|
|
#ifdef APPLE2IX
|
2014-01-23 04:42:34 +00:00
|
|
|
#include "audio/peripherals.h"
|
2013-11-06 06:11:27 +00:00
|
|
|
|
|
|
|
extern bool g_bDisableDirectSoundMockingboard;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t l;
|
|
|
|
uint8_t h;
|
2013-11-06 06:11:27 +00:00
|
|
|
};
|
2015-06-07 18:35:45 +00:00
|
|
|
uint16_t w;
|
2013-11-06 06:11:27 +00:00
|
|
|
};
|
|
|
|
} IWORD;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t ORB; // $00 - Port B
|
|
|
|
uint8_t ORA; // $01 - Port A (with handshaking)
|
|
|
|
uint8_t DDRB; // $02 - Data Direction Register B
|
|
|
|
uint8_t DDRA; // $03 - Data Direction Register A
|
2013-11-06 06:11:27 +00:00
|
|
|
//
|
|
|
|
// $04 - Read counter (L) / Write latch (L)
|
|
|
|
// $05 - Read / Write & initiate count (H)
|
|
|
|
// $06 - Read / Write & latch (L)
|
|
|
|
// $07 - Read / Write & latch (H)
|
|
|
|
// $08 - Read counter (L) / Write latch (L)
|
|
|
|
// $09 - Read counter (H) / Write latch (H)
|
|
|
|
IWORD TIMER1_COUNTER;
|
|
|
|
IWORD TIMER1_LATCH;
|
|
|
|
IWORD TIMER2_COUNTER;
|
|
|
|
IWORD TIMER2_LATCH;
|
|
|
|
//
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t SERIAL_SHIFT; // $0A
|
|
|
|
uint8_t ACR; // $0B - Auxiliary Control Register
|
|
|
|
uint8_t PCR; // $0C - Peripheral Control Register
|
|
|
|
uint8_t IFR; // $0D - Interrupt Flag Register
|
|
|
|
uint8_t IER; // $0E - Interrupt Enable Register
|
|
|
|
uint8_t ORA_NO_HS; // $0F - Port A (without handshaking)
|
2013-11-06 06:11:27 +00:00
|
|
|
} SY6522;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t DurationPhonome;
|
|
|
|
uint8_t Inflection; // I10..I3
|
|
|
|
uint8_t RateInflection;
|
|
|
|
uint8_t CtrlArtAmp;
|
|
|
|
uint8_t FilterFreq;
|
2013-11-06 06:11:27 +00:00
|
|
|
//
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t CurrentMode; // b7:6=Mode; b0=D7 pin (for IRQ)
|
2013-11-06 06:11:27 +00:00
|
|
|
} SSI263A;
|
|
|
|
|
|
|
|
extern SS_CARDTYPE g_Slot4; // Mockingboard, Z80, Mouse in slot4
|
|
|
|
extern SS_CARDTYPE g_Slot5; // Mockingboard, Z80 in slot5
|
|
|
|
|
|
|
|
#define MB_UNITS_PER_CARD 2
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
SY6522 RegsSY6522;
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t RegsAY8910[16];
|
2013-11-06 06:11:27 +00:00
|
|
|
SSI263A RegsSSI263;
|
2015-06-07 18:39:01 +00:00
|
|
|
uint8_t nAYCurrentRegister;
|
2013-11-06 06:11:27 +00:00
|
|
|
bool bTimer1IrqPending;
|
|
|
|
bool bTimer2IrqPending;
|
|
|
|
bool bSpeechIrqPending;
|
|
|
|
} MB_Unit;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
SS_CARD_HDR Hdr;
|
|
|
|
MB_Unit Unit[MB_UNITS_PER_CARD];
|
|
|
|
} SS_CARD_MOCKINGBOARD;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern bool g_bMBTimerIrqActive;
|
|
|
|
#ifdef _DEBUG
|
2015-06-07 18:00:15 +00:00
|
|
|
extern uint32_t g_uTimer1IrqCount; // DEBUG
|
2013-11-06 06:11:27 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void MB_Initialize();
|
|
|
|
void MB_Reinitialize();
|
|
|
|
void MB_Destroy();
|
|
|
|
void MB_Reset();
|
2015-06-07 19:11:19 +00:00
|
|
|
void MB_InitializeIO(char *pCxRomPeripheral, unsigned int uSlot4, unsigned int uSlot5);
|
2013-11-06 06:11:27 +00:00
|
|
|
void MB_Mute();
|
|
|
|
void MB_Demute();
|
|
|
|
void MB_StartOfCpuExecute();
|
|
|
|
void MB_EndOfVideoFrame();
|
2015-01-31 21:57:10 +00:00
|
|
|
void MB_UpdateCycles(void);
|
2013-11-06 06:11:27 +00:00
|
|
|
SS_CARDTYPE MB_GetSoundcardType();
|
|
|
|
void MB_SetSoundcardType(SS_CARDTYPE NewSoundcardType);
|
|
|
|
double MB_GetFramePeriod();
|
|
|
|
bool MB_IsActive();
|
2015-06-07 18:47:57 +00:00
|
|
|
unsigned long MB_GetVolume();
|
2015-07-11 21:37:41 +00:00
|
|
|
void MB_SetVolumeZeroToTen(unsigned long goesToTen);
|
2015-06-07 18:47:57 +00:00
|
|
|
void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
|
|
|
|
unsigned long MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
|
|
|
|
unsigned long MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, unsigned long dwSlot);
|
2013-11-06 06:11:27 +00:00
|
|
|
#ifdef APPLE2IX
|
|
|
|
void mb_io_initialize(unsigned int slot4, unsigned int slot5);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // whole file
|