mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Corrected some off by one errors in DM01 dot matrix emulation, while making it a bit more generic. Ultimately, it will plug into Scorpion 2 and 4 hardware. [James Wallace]
This commit is contained in:
parent
847cb7ba26
commit
fb3e6359e8
@ -2593,6 +2593,15 @@ WRITE8_MEMBER(bfm_sc2_state::sc3_expansion_w)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void bfmdm01_busy(running_machine &machine, int state)
|
||||
{
|
||||
Scorpion2_SetSwitchState(machine, 4,4, state?0:1);
|
||||
}
|
||||
|
||||
static const bfmdm01_interface dm01_interface =
|
||||
{
|
||||
bfmdm01_busy
|
||||
};
|
||||
|
||||
/* machine init (called only once) */
|
||||
static MACHINE_RESET( awp_init )
|
||||
@ -2606,7 +2615,6 @@ static MACHINE_RESET( awp_init )
|
||||
static MACHINE_RESET( dm01_init )
|
||||
{
|
||||
on_scorpion2_reset(machine);
|
||||
BFM_dm01_reset(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -3680,7 +3688,6 @@ static INPUT_PORTS_START( scorpion3 )
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
/* machine driver for scorpion2 board */
|
||||
|
||||
static MACHINE_CONFIG_START( scorpion2, bfm_sc2_state )
|
||||
@ -3755,6 +3762,24 @@ static void sc2awp_common_init(running_machine &machine,int reels, int decrypt)
|
||||
}
|
||||
}
|
||||
|
||||
static void sc2awpdmd_common_init(running_machine &machine,int reels, int decrypt)
|
||||
{
|
||||
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
|
||||
|
||||
int n;
|
||||
BFM_dm01_config(machine, &dm01_interface);
|
||||
sc2_common_init(machine, decrypt);
|
||||
/* setup n default 96 half step reels */
|
||||
|
||||
state->m_reels=reels;
|
||||
|
||||
for ( n = 0; n < reels; n++ )
|
||||
{
|
||||
stepper_config(machine, n, &starpoint_interface_48step);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT (bbrkfst)
|
||||
{
|
||||
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
|
||||
@ -3823,7 +3848,7 @@ static DRIVER_INIT (focus)
|
||||
static DRIVER_INIT (cpeno1)
|
||||
{
|
||||
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
|
||||
sc2awp_common_init(machine,6, 1);
|
||||
sc2awpdmd_common_init(machine,6, 1);
|
||||
|
||||
MechMtr_config(machine,5);
|
||||
|
||||
@ -3865,6 +3890,42 @@ static DRIVER_INIT (cpeno1)
|
||||
state->m_has_hopper = 0;
|
||||
}
|
||||
|
||||
static DRIVER_INIT (ofah)
|
||||
{
|
||||
sc2awpdmd_common_init(machine,4, 1);
|
||||
|
||||
Scorpion2_SetSwitchState(machine,4,0,1); /* pay tube low (1 pound front) */
|
||||
Scorpion2_SetSwitchState(machine,4,1,1); /* pay tube low (20p) */
|
||||
Scorpion2_SetSwitchState(machine,4,2,1); /* pay tube low (?1 right) */
|
||||
Scorpion2_SetSwitchState(machine,4,3,1); /* pay tube low (?1 left) */
|
||||
|
||||
Scorpion2_SetSwitchState(machine,6,0,0); /* ? percentage key */
|
||||
Scorpion2_SetSwitchState(machine,6,1,1);
|
||||
Scorpion2_SetSwitchState(machine,6,2,0);
|
||||
Scorpion2_SetSwitchState(machine,6,3,1);
|
||||
|
||||
MechMtr_config(machine,3);
|
||||
|
||||
}
|
||||
|
||||
static DRIVER_INIT (prom)
|
||||
{
|
||||
sc2awpdmd_common_init(machine,6, 1);
|
||||
|
||||
Scorpion2_SetSwitchState(machine,4,0,1); /* pay tube low (1 pound front) */
|
||||
Scorpion2_SetSwitchState(machine,4,1,1); /* pay tube low (20p) */
|
||||
Scorpion2_SetSwitchState(machine,4,2,1); /* pay tube low (?1 right) */
|
||||
Scorpion2_SetSwitchState(machine,4,3,1); /* pay tube low (?1 left) */
|
||||
|
||||
Scorpion2_SetSwitchState(machine,6,0,0); /* ? percentage key */
|
||||
Scorpion2_SetSwitchState(machine,6,1,1);
|
||||
Scorpion2_SetSwitchState(machine,6,2,0);
|
||||
Scorpion2_SetSwitchState(machine,6,3,1);
|
||||
|
||||
MechMtr_config(machine,3);
|
||||
|
||||
}
|
||||
|
||||
static DRIVER_INIT (bfmcgslm)
|
||||
{
|
||||
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
|
||||
@ -3877,7 +3938,8 @@ static DRIVER_INIT (bfmcgslm)
|
||||
static DRIVER_INIT (luvjub)
|
||||
{
|
||||
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
|
||||
sc2awp_common_init(machine,6, 1);
|
||||
sc2awpdmd_common_init(machine,6, 1);
|
||||
|
||||
MechMtr_config(machine,8);
|
||||
state->m_has_hopper = 0;
|
||||
|
||||
@ -7921,32 +7983,34 @@ GAME( 199?, sc2town3p , sc2town , scorpion2_dm01 , drwho , drwho , 0, "BFM"
|
||||
GAME( 199?, sc2town4 , sc2town , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Round The Town (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2town5 , sc2town , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Round The Town (Bellfruit) (set 6) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2ofool , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool1 , sc2ofool , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool2 , sc2ofool , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool3 , sc2ofool , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 4) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool4 , sc2ofool , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool , 0 , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool1 , sc2ofool , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool2 , sc2ofool , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool3 , sc2ofool , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 4) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ofool4 , sc2ofool , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Only Fools & Horses (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2ptytm , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Party Time (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ptytm1 , sc2ptytm , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Party Time (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ptytm1p , sc2ptytm , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Party Time (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ptytm , 0 , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Party Time (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ptytm1 , sc2ptytm , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Party Time (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2ptytm1p , sc2ptytm , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Party Time (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2cops , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsp , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops1 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops1p , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops2 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops3 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 4) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops3p , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 4, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops4 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops5 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 6) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copscp , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc1 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc1p , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc2 , sc2cops , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops , 0 , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsp , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops1 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops1p , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops2 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops3 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 4) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops3p , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 4, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops4 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2cops5 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers (Bellfruit) (set 6) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2copdc , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)", GAME_FLAGS)
|
||||
//Shows Nudge Now animation on bootup - using right ROMS?
|
||||
GAME( 199?, sc2copsc , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copscp , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc1 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc1p , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copsc2 , sc2cops , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Casino Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2copdc , 0 , scorpion2_dm01 , drwho , ofah , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copdcp , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copdc1 , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 2, UK, 250GBP Jackpot) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copdc1p , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 2, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
@ -7960,10 +8024,10 @@ GAME( 199?, sc2copdc5 , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM
|
||||
GAME( 199?, sc2copdc5p , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 6, UK, 200GBP Jackpot, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2copdc6 , sc2copdc , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 7, UK) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
GAME( 199?, sc2prom , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Along The Prom (Bellfruit) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem , 0 , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2premp , sc2prem , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem1 , sc2prem , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Premier Club Manager (Bellfruit) (set 2, UK) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem1p , sc2prem , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Premier Club Manager (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem2 , sc2prem , scorpion2_dm01 , drwho , drwho , 0, "BFM", "Premier Club Manager (Bellfruit) (set 3, UK) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prom , 0 , scorpion2_dm01 , drwho , prom , 0, "BFM", "Along The Prom (Bellfruit) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem , 0 , scorpion2_dm01 , drwho , prom , 0, "BFM", "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2premp , sc2prem , scorpion2_dm01 , drwho , prom , 0, "BFM", "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem1 , sc2prem , scorpion2_dm01 , drwho , prom , 0, "BFM", "Premier Club Manager (Bellfruit) (set 2, UK) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem1p , sc2prem , scorpion2_dm01 , drwho , prom , 0, "BFM", "Premier Club Manager (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)", GAME_FLAGS)
|
||||
GAME( 199?, sc2prem2 , sc2prem , scorpion2_dm01 , drwho , prom , 0, "BFM", "Premier Club Manager (Bellfruit) (set 3, UK) (Scorpion 2/3)", GAME_FLAGS)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,37 +29,23 @@ Standard dm01 memorymap
|
||||
4000-FFFF | W | D D D D D D D D | ROM (48k)
|
||||
-----------+---+-----------------+-----------------------------------------
|
||||
|
||||
NOTE: The board uses only one dot of its last set of eight in a row, as the
|
||||
rest are used for the row counter. Because of the way we do dots, we show
|
||||
the blank ones that are most likely hidden by bezels on the unit.
|
||||
TODO: - find out clockspeed of CPU
|
||||
- sometimes screen isn't cleared, is the a clear bit missing?
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "bfm_dm01.h"
|
||||
// local prototypes ///////////////////////////////////////////////////////
|
||||
|
||||
extern void Scorpion2_SetSwitchState(running_machine &machine, int strobe, int data, int state);
|
||||
extern int Scorpion2_GetSwitchState(running_machine &machine, int strobe, int data);
|
||||
|
||||
// local vars /////////////////////////////////////////////////////////////
|
||||
|
||||
#define DM_BYTESPERROW 9
|
||||
#define DM_MAXLINES 21
|
||||
|
||||
#define FEEDBACK_STROBE 4
|
||||
#define FEEDBACK_DATA 4
|
||||
|
||||
static int control;
|
||||
static int xcounter;
|
||||
static int busy;
|
||||
static int data_avail;
|
||||
|
||||
static UINT8 scanline[DM_BYTESPERROW];
|
||||
|
||||
static UINT8 comdata;
|
||||
|
||||
//static int read_index;
|
||||
//static int write_index;
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
#define VERBOSE 1
|
||||
@ -69,13 +55,38 @@ static UINT8 comdata;
|
||||
|
||||
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
|
||||
|
||||
typedef struct _dm01
|
||||
{
|
||||
const bfmdm01_interface *intf;
|
||||
int data_avail,
|
||||
control, /* motor phase */
|
||||
xcounter,
|
||||
busy;
|
||||
|
||||
UINT8 scanline[DM_BYTESPERROW],
|
||||
comdata;
|
||||
|
||||
} bfmdm01;
|
||||
|
||||
static bfmdm01 dm01;
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void BFM_dm01_config(running_machine &machine, const bfmdm01_interface *intf)
|
||||
{
|
||||
assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call BFM_dm01_config at init time!");
|
||||
assert_always(intf, "BFM_dm01_config called with an invalid interface!");
|
||||
dm01.intf = intf;
|
||||
BFM_dm01_reset(machine);
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int read_data(void)
|
||||
{
|
||||
int data = comdata;
|
||||
int data = dm01.comdata;
|
||||
|
||||
data_avail = 0;
|
||||
dm01.data_avail = 0;
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -91,9 +102,9 @@ static READ8_HANDLER( control_r )
|
||||
|
||||
static WRITE8_HANDLER( control_w )
|
||||
{
|
||||
int changed = control ^ data;
|
||||
int changed = dm01.control ^ data;
|
||||
|
||||
control = data;
|
||||
dm01.control = data;
|
||||
|
||||
if ( changed & 2 )
|
||||
{ // reset horizontal counter
|
||||
@ -101,16 +112,16 @@ static WRITE8_HANDLER( control_w )
|
||||
{
|
||||
//int offset = 0;
|
||||
|
||||
xcounter = 0;
|
||||
dm01.xcounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( changed & 8 )
|
||||
{ // bit 3 changed = BUSY line
|
||||
if ( data & 8 ) busy = 0;
|
||||
else busy = 1;
|
||||
if ( data & 8 ) dm01.busy = 0;
|
||||
else dm01.busy = 1;
|
||||
|
||||
Scorpion2_SetSwitchState(space->machine(), FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1);
|
||||
dm01.intf->busy_func(space->machine(),dm01.busy);
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,30 +136,27 @@ static READ8_HANDLER( mux_r )
|
||||
|
||||
static WRITE8_HANDLER( mux_w )
|
||||
{
|
||||
int x = xcounter;
|
||||
|
||||
if ( x < DM_BYTESPERROW )
|
||||
if ( dm01.xcounter < DM_BYTESPERROW )
|
||||
{
|
||||
scanline[xcounter++] = data;
|
||||
dm01.scanline[dm01.xcounter] = data;
|
||||
dm01.xcounter++;
|
||||
}
|
||||
|
||||
if ( x == 8 )
|
||||
if ( dm01.xcounter == 9 )
|
||||
{
|
||||
int row = ((0xFF^data) & 0x7C) >> 2; // 7C = 000001111100
|
||||
|
||||
scanline[x] &= 0x80;
|
||||
dm01.scanline[8] &= 0x80;//filter all other bits
|
||||
if ( (row >= 0) && (row < DM_MAXLINES) )
|
||||
{
|
||||
int p,dots;
|
||||
|
||||
x = 0;
|
||||
p = 0;
|
||||
dots = 0;
|
||||
|
||||
while ( p < (DM_BYTESPERROW) )
|
||||
{
|
||||
|
||||
UINT8 d = scanline[p];
|
||||
UINT8 d = dm01.scanline[p];
|
||||
if (d & 0x80) dots |= 0x01;
|
||||
else dots &=~0x01;
|
||||
if (d & 0x40) dots |= 0x02;
|
||||
@ -165,7 +173,7 @@ static WRITE8_HANDLER( mux_w )
|
||||
else dots &=~0x40;
|
||||
if (d & 0x01) dots |= 0x80;
|
||||
else dots &=~0x80;
|
||||
output_set_indexed_value("matrix", p +(8*row), dots);
|
||||
output_set_indexed_value("dotmatrix", p +(9*row), dots);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
@ -178,12 +186,12 @@ static READ8_HANDLER( comm_r )
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if ( data_avail )
|
||||
if ( dm01.data_avail )
|
||||
{
|
||||
result = read_data();
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
if ( data_avail() )
|
||||
if ( dm01.data_avail() )
|
||||
{
|
||||
cpu_set_irq_line(1, M6809_IRQ_LINE, ASSERT_LINE ); // trigger IRQ
|
||||
}
|
||||
@ -227,8 +235,8 @@ ADDRESS_MAP_END
|
||||
|
||||
void BFM_dm01_writedata(running_machine &machine, UINT8 data)
|
||||
{
|
||||
comdata = data;
|
||||
data_avail = 1;
|
||||
dm01.comdata = data;
|
||||
dm01.data_avail = 1;
|
||||
|
||||
//pulse IRQ line
|
||||
cputag_set_input_line(machine, "matrix", M6809_IRQ_LINE, HOLD_LINE ); // trigger IRQ
|
||||
@ -244,15 +252,15 @@ INTERRUPT_GEN( bfm_dm01_vbl )
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
int BFM_dm01_busy(void)
|
||||
{
|
||||
return data_avail;
|
||||
return dm01.data_avail;
|
||||
}
|
||||
|
||||
void BFM_dm01_reset(running_machine &machine)
|
||||
{
|
||||
busy = 0;
|
||||
control = 0;
|
||||
xcounter = 0;
|
||||
data_avail = 0;
|
||||
dm01.busy = 0;
|
||||
dm01.control = 0;
|
||||
dm01.xcounter = 0;
|
||||
dm01.data_avail = 0;
|
||||
|
||||
Scorpion2_SetSwitchState(machine, FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1);
|
||||
dm01.intf->busy_func(machine,dm01.busy);
|
||||
}
|
||||
|
@ -6,8 +6,15 @@
|
||||
#ifndef BFM_DM01
|
||||
#define BFM_DM01
|
||||
|
||||
typedef struct _bfmdm01_interface bfmdm01_interface;
|
||||
struct _bfmdm01_interface
|
||||
{
|
||||
void (*busy_func)(running_machine &machine, int state);
|
||||
};
|
||||
ADDRESS_MAP_EXTERN( bfm_dm01_memmap,8 );
|
||||
|
||||
void BFM_dm01_config(running_machine &machine, const bfmdm01_interface *intf);
|
||||
|
||||
INTERRUPT_GEN( bfm_dm01_vbl );
|
||||
|
||||
void BFM_dm01_reset(running_machine &machine);
|
||||
|
Loading…
Reference in New Issue
Block a user