summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/thomson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/thomson.cpp')
-rw-r--r--src/mame/machine/thomson.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/src/mame/machine/thomson.cpp b/src/mame/machine/thomson.cpp
index 1dae4a1b972..95387a7668a 100644
--- a/src/mame/machine/thomson.cpp
+++ b/src/mame/machine/thomson.cpp
@@ -95,7 +95,7 @@ int thomson_state::to7_get_cassette()
/* demodulate wave signal on-the-fly */
/* we simply count sign changes... */
int k, chg;
- INT8 data[40];
+ int8_t data[40];
cassette_get_samples( cass, 0, pos, TO7_BIT_LENGTH * 15. / 14., 40, 1, data, 0 );
for ( k = 1, chg = 0; k < 40; k++ )
@@ -172,7 +172,7 @@ int thomson_state::mo5_get_cassette()
cassette_image* cass = m_cassette->get_image();
cassette_state state = m_cassette->get_state();
double pos = m_cassette->get_position();
- INT32 hbit;
+ int32_t hbit;
if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED )
return 1;
@@ -359,7 +359,7 @@ void thomson_state::thom_set_caps_led( int led )
DEVICE_IMAGE_LOAD_MEMBER( thomson_state, to7_cartridge )
{
int i,j;
- UINT8* pos = memregion("maincpu" )->base() + 0x10000;
+ uint8_t* pos = memregion("maincpu" )->base() + 0x10000;
offs_t size;
char name[129];
@@ -460,8 +460,8 @@ WRITE8_MEMBER( thomson_state::to7_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_MEMBER( thomson_state::to7_cartridge_r )
{
- UINT8* pos = memregion( "maincpu" )->base() + 0x10000;
- UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
+ uint8_t* pos = memregion( "maincpu" )->base() + 0x10000;
+ uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
if ( !space.debugger_access() )
{
m_thom_cart_bank = offset & 3;
@@ -559,7 +559,7 @@ READ8_MEMBER( thomson_state::to7_sys_porta_in )
{
/* keyboard */
int keyline = m_pia_sys->b_output();
- UINT8 val = 0xff;
+ uint8_t val = 0xff;
int i;
for ( i = 0; i < 8; i++ )
@@ -599,7 +599,7 @@ const device_type TO7_IO_LINE = &device_creator<to7_io_line_device>;
// to7_io_line_device - constructor
//-------------------------------------------------
-to7_io_line_device::to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+to7_io_line_device::to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TO7_IO_LINE, "T07 Serial source", tag, owner, clock, "to7_io_line", __FILE__),
m_pia_io(*this, THOM_PIA_IO),
m_rs232(*this, "rs232"),
@@ -833,11 +833,11 @@ WRITE8_MEMBER( thomson_state::to7_modem_mea8000_w )
This is similar Atari & Amiga mouses.
Returns: 0 0 0 0 0 0 YB XB YA XA
*/
-UINT8 thomson_state::to7_get_mouse_signal()
+uint8_t thomson_state::to7_get_mouse_signal()
{
- UINT8 xa, xb, ya, yb;
- UINT16 dx = m_io_mouse_x->read(); /* x axis */
- UINT16 dy = m_io_mouse_y->read(); /* y axis */
+ uint8_t xa, xb, ya, yb;
+ uint16_t dx = m_io_mouse_x->read(); /* x axis */
+ uint16_t dy = m_io_mouse_y->read(); /* y axis */
xa = ((dx + 1) & 3) <= 1;
xb = (dx & 3) <= 1;
ya = ((dy + 1) & 3) <= 1;
@@ -856,7 +856,7 @@ void thomson_state::to7_game_sound_update()
READ8_MEMBER( thomson_state::to7_game_porta_in )
{
- UINT8 data;
+ uint8_t data;
if ( m_io_config->read() & 1 )
{
/* mouse */
@@ -897,11 +897,11 @@ READ8_MEMBER( thomson_state::to7_game_porta_in )
READ8_MEMBER( thomson_state::to7_game_portb_in )
{
- UINT8 data;
+ uint8_t data;
if ( m_io_config->read() & 1 )
{
/* mouse */
- UINT8 mouse = to7_get_mouse_signal();
+ uint8_t mouse = to7_get_mouse_signal();
data = 0;
if ( mouse & 1 )
data |= 0x04; /* XA */
@@ -945,14 +945,14 @@ TIMER_CALLBACK_MEMBER(thomson_state::to7_game_update_cb)
if ( m_io_config->read() & 1 )
{
/* mouse */
- UINT8 mouse = to7_get_mouse_signal();
+ uint8_t mouse = to7_get_mouse_signal();
m_pia_game->ca1_w( (mouse & 1) ? 1 : 0 ); /* XA */
m_pia_game->ca2_w( (mouse & 2) ? 1 : 0 ); /* YA */
}
else
{
/* joystick */
- UINT8 in = m_io_game_port_buttons->read();
+ uint8_t in = m_io_game_port_buttons->read();
m_pia_game->cb2_w( (in & 0x80) ? 1 : 0 ); /* P2 action A */
m_pia_game->ca2_w( (in & 0x40) ? 1 : 0 ); /* P1 action A */
m_pia_game->cb1_w( (in & 0x08) ? 1 : 0 ); /* P2 action B */
@@ -1085,8 +1085,8 @@ MACHINE_RESET_MEMBER( thomson_state, to7 )
MACHINE_START_MEMBER( thomson_state, to7 )
{
address_space& space = m_maincpu->space(AS_PROGRAM);
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "to7: machine start called\n" ));
@@ -1163,7 +1163,7 @@ READ8_MEMBER( thomson_state::to770_sys_porta_in )
void thomson_state::to770_update_ram_bank()
{
address_space& space = m_maincpu->space(AS_PROGRAM);
- UINT8 portb = m_pia_sys->port_b_z_mask();
+ uint8_t portb = m_pia_sys->port_b_z_mask();
int bank;
switch (portb & 0xf8)
@@ -1309,8 +1309,8 @@ MACHINE_RESET_MEMBER( thomson_state, to770 )
MACHINE_START_MEMBER( thomson_state, to770 )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "to770: machine start called\n" ));
@@ -1414,7 +1414,7 @@ READ8_MEMBER( thomson_state::mo5_sys_porta_in )
READ8_MEMBER( thomson_state::mo5_sys_portb_in )
{
- UINT8 portb = m_pia_sys->b_output();
+ uint8_t portb = m_pia_sys->b_output();
int col = (portb >> 1) & 7; /* key column */
int lin = 7 - ((portb >> 4) & 7); /* key line */
@@ -1468,8 +1468,8 @@ WRITE8_MEMBER( thomson_state::mo5_gatearray_w )
DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
{
- UINT8* pos = memregion("maincpu")->base() + 0x10000;
- UINT64 size, i;
+ uint8_t* pos = memregion("maincpu")->base() + 0x10000;
+ uint64_t size, i;
int j;
char name[129];
@@ -1630,8 +1630,8 @@ WRITE8_MEMBER( thomson_state::mo5_cartridge_w )
/* read signal to bffc-bfff generates a bank switch */
READ8_MEMBER( thomson_state::mo5_cartridge_r )
{
- UINT8* pos = memregion( "maincpu" )->base() + 0x10000;
- UINT8 data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
+ uint8_t* pos = memregion( "maincpu" )->base() + 0x10000;
+ uint8_t data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
if ( !space.debugger_access() )
{
m_thom_cart_bank = offset & 3;
@@ -1690,8 +1690,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo5 )
MACHINE_START_MEMBER( thomson_state, mo5 )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "mo5: machine start called\n" ));
@@ -1799,7 +1799,7 @@ WRITE8_MEMBER( thomson_state::to9_gatearray_w )
/* style: 0 => TO9, 1 => TO8/TO9, 2 => MO6 */
-void thomson_state::to9_set_video_mode( UINT8 data, int style )
+void thomson_state::to9_set_video_mode( uint8_t data, int style )
{
switch ( data & 0x7f )
{
@@ -1855,7 +1855,7 @@ READ8_MEMBER( thomson_state::to9_vreg_r )
{
case 0: /* palette data */
{
- UINT8 c = m_to9_palette_data[ m_to9_palette_idx ];
+ uint8_t c = m_to9_palette_data[ m_to9_palette_idx ];
if ( !space.debugger_access() )
{
m_to9_palette_idx = ( m_to9_palette_idx + 1 ) & 31;
@@ -1886,7 +1886,7 @@ WRITE8_MEMBER( thomson_state::to9_vreg_w )
{
case 0: /* palette data */
{
- UINT16 color, idx;
+ uint16_t color, idx;
m_to9_palette_data[ m_to9_palette_idx ] = data;
idx = m_to9_palette_idx / 2;
color = m_to9_palette_data[ 2 * idx + 1 ];
@@ -2034,8 +2034,8 @@ WRITE8_MEMBER( thomson_state::to9_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_MEMBER( thomson_state::to9_cartridge_r )
{
- UINT8* pos = memregion( "maincpu" )->base() + 0x10000;
- UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
+ uint8_t* pos = memregion( "maincpu" )->base() + 0x10000;
+ uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
if ( !space.debugger_access() )
{
m_thom_cart_bank = offset & 3;
@@ -2049,9 +2049,9 @@ READ8_MEMBER( thomson_state::to9_cartridge_r )
void thomson_state::to9_update_ram_bank()
{
address_space& space = m_maincpu->space(AS_PROGRAM);
- UINT8 port = m_mc6846->get_output_port();
- UINT8 portb = m_pia_sys->port_b_z_mask();
- UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */
+ uint8_t port = m_mc6846->get_output_port();
+ uint8_t portb = m_pia_sys->port_b_z_mask();
+ uint8_t disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */
int bank;
switch ( portb & 0xf8 )
@@ -2128,7 +2128,7 @@ void thomson_state::to9_update_ram_bank_postload()
int thomson_state::to9_kbd_ktest()
{
int line, bit;
- UINT8 port;
+ uint8_t port;
for ( line = 0; line < 10; line++ )
{
@@ -2292,7 +2292,7 @@ WRITE8_MEMBER( thomson_state::to9_kbd_w )
note: parity is not used as a checksum but to actually transmit a 9-th bit
of information!
*/
-void thomson_state::to9_kbd_send( UINT8 data, int parity )
+void thomson_state::to9_kbd_send( uint8_t data, int parity )
{
if ( m_to9_kbd_status & ACIA_6850_RDRF )
{
@@ -2361,7 +2361,7 @@ int thomson_state::to9_kbd_get_key()
int control = ! (m_io_keyboard[7]->read() & 1);
int shift = ! (m_io_keyboard[9]->read() & 1);
int key = -1, line, bit;
- UINT8 port;
+ uint8_t port;
for ( line = 0; line < 10; line++ )
{
@@ -2457,7 +2457,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb)
case 1: /* x axis */
{
int newx = m_io_mouse_x->read();
- UINT8 data = ( (newx - m_to9_mouse_x) & 0xf ) - 8;
+ uint8_t data = ( (newx - m_to9_mouse_x) & 0xf ) - 8;
to9_kbd_send( data, 1 );
m_to9_mouse_x = newx;
break;
@@ -2466,7 +2466,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb)
case 2: /* y axis */
{
int newy = m_io_mouse_y->read();
- UINT8 data = ( (newy - m_to9_mouse_y) & 0xf ) - 8;
+ uint8_t data = ( (newy - m_to9_mouse_y) & 0xf ) - 8;
to9_kbd_send( data, 1 );
m_to9_mouse_y = newy;
break;
@@ -2475,7 +2475,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to9_kbd_timer_cb)
case 3: /* axis overflow & buttons */
{
int b = m_io_mouse_button->read();
- UINT8 data = 0;
+ uint8_t data = 0;
if ( b & 1 ) data |= 1;
if ( b & 2 ) data |= 4;
to9_kbd_send( data, 1 );
@@ -2545,7 +2545,7 @@ void thomson_state::to9_kbd_init()
READ8_MEMBER( thomson_state::to9_sys_porta_in )
{
- UINT8 ktest = to9_kbd_ktest();
+ uint8_t ktest = to9_kbd_ktest();
LOG_KBD(( "to9_sys_porta_in: ktest=%i\n", ktest ));
@@ -2633,8 +2633,8 @@ MACHINE_RESET_MEMBER( thomson_state, to9 )
MACHINE_START_MEMBER( thomson_state, to9 )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "to9: machine start called\n" ));
@@ -2712,7 +2712,7 @@ MACHINE_START_MEMBER( thomson_state, to9 )
int thomson_state::to8_kbd_ktest()
{
int line, bit;
- UINT8 port;
+ uint8_t port;
if ( m_io_config->read() & 2 )
return 0; /* disabled */
@@ -2742,7 +2742,7 @@ int thomson_state::to8_kbd_get_key()
int control = (m_io_keyboard[7]->read() & 1) ? 0 : 0x100;
int shift = (m_io_keyboard[9]->read() & 1) ? 0 : 0x080;
int key = -1, line, bit;
- UINT8 port;
+ uint8_t port;
if ( m_io_config->read() & 2 )
return -1; /* disabled */
@@ -3015,7 +3015,7 @@ void thomson_state::to8_update_floppy_bank_postload()
void thomson_state::to8_update_ram_bank()
{
address_space& space = m_maincpu->space(AS_PROGRAM);
- UINT8 bank = 0;
+ uint8_t bank = 0;
if ( m_to8_reg_sys1 & 0x10 )
{
@@ -3023,7 +3023,7 @@ void thomson_state::to8_update_ram_bank()
}
else
{
- UINT8 portb = m_pia_sys->port_b_z_mask();
+ uint8_t portb = m_pia_sys->port_b_z_mask();
switch ( portb & 0xf8 )
{
@@ -3239,8 +3239,8 @@ WRITE8_MEMBER( thomson_state::to8_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_MEMBER( thomson_state::to8_cartridge_r )
{
- UINT8* pos = memregion( "maincpu" )->base() + 0x10000;
- UINT8 data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
+ uint8_t* pos = memregion( "maincpu" )->base() + 0x10000;
+ uint8_t data = pos[offset + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
if ( !space.debugger_access() )
{
m_thom_cart_bank = offset & 3;
@@ -3256,7 +3256,7 @@ READ8_MEMBER( thomson_state::to8_cartridge_r )
void thomson_state::to8_floppy_init()
{
- UINT8* mem = memregion("maincpu")->base();
+ uint8_t* mem = memregion("maincpu")->base();
to7_floppy_init( mem + 0x34000 );
}
@@ -3264,7 +3264,7 @@ void thomson_state::to8_floppy_init()
void thomson_state::to8_floppy_reset()
{
- UINT8* mem = memregion("maincpu")->base();
+ uint8_t* mem = memregion("maincpu")->base();
to7_floppy_reset();
if ( THOM_FLOPPY_INT )
thmfc_floppy_reset();
@@ -3316,7 +3316,7 @@ READ8_MEMBER( thomson_state::to8_gatearray_r )
struct thom_vsignal v = thom_get_vsignal();
struct thom_vsignal l = thom_get_lightpen_vsignal( TO8_LIGHTPEN_DECAL, m_to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
- UINT8 res;
+ uint8_t res;
count = m_to7_lightpen ? l.count : v.count;
inil = m_to7_lightpen ? l.inil : v.inil;
init = m_to7_lightpen ? l.init : v.init;
@@ -3432,7 +3432,7 @@ READ8_MEMBER( thomson_state::to8_vreg_r )
{
case 0: /* palette data */
{
- UINT8 c = m_to9_palette_data[ m_to9_palette_idx ];
+ uint8_t c = m_to9_palette_data[ m_to9_palette_idx ];
if ( !space.debugger_access() )
{
m_to9_palette_idx = ( m_to9_palette_idx + 1 ) & 31;
@@ -3465,7 +3465,7 @@ WRITE8_MEMBER( thomson_state::to8_vreg_w )
{
case 0: /* palette data */
{
- UINT16 color, idx;
+ uint16_t color, idx;
m_to9_palette_data[ m_to9_palette_idx ] = data;
idx = m_to9_palette_idx / 2;
color = m_to9_palette_data[ 2 * idx + 1 ];
@@ -3644,8 +3644,8 @@ MACHINE_RESET_MEMBER( thomson_state, to8 )
MACHINE_START_MEMBER( thomson_state, to8 )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "to8: machine start called\n" ));
@@ -3795,8 +3795,8 @@ MACHINE_RESET_MEMBER( thomson_state, to9p )
MACHINE_START_MEMBER( thomson_state, to9p )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "to9p: machine start called\n" ));
@@ -3861,7 +3861,7 @@ MACHINE_START_MEMBER( thomson_state, to9p )
void thomson_state::mo6_update_ram_bank()
{
- UINT8 bank = 0;
+ uint8_t bank = 0;
if ( m_to8_reg_sys1 & 0x10 )
{
@@ -4113,8 +4113,8 @@ WRITE8_MEMBER( thomson_state::mo6_cartridge_w )
/* read signal generates a bank switch */
READ8_MEMBER( thomson_state::mo6_cartridge_r )
{
- UINT8* pos = memregion( "maincpu" )->base() + 0x10000;
- UINT8 data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
+ uint8_t* pos = memregion( "maincpu" )->base() + 0x10000;
+ uint8_t data = pos[offset + 0xbffc + (m_thom_cart_bank % m_thom_cart_nb_banks) * 0x4000];
if ( !space.debugger_access() )
{
m_thom_cart_bank = offset & 3;
@@ -4170,14 +4170,14 @@ TIMER_CALLBACK_MEMBER(thomson_state::mo6_game_update_cb)
/* unlike the TO8, CB1 & CB2 are not connected to buttons */
if ( m_io_config->read() & 1 )
{
- UINT8 mouse = to7_get_mouse_signal();
+ uint8_t mouse = to7_get_mouse_signal();
m_pia_game->ca1_w( BIT(mouse, 0) ); /* XA */
m_pia_game->ca2_w( BIT(mouse, 1) ); /* YA */
}
else
{
/* joystick */
- UINT8 in = m_io_game_port_buttons->read();
+ uint8_t in = m_io_game_port_buttons->read();
m_pia_game->ca1_w( BIT(in, 2) ); /* P1 action B */
m_pia_game->ca2_w( BIT(in, 6) ); /* P1 action A */
}
@@ -4225,8 +4225,8 @@ READ8_MEMBER( thomson_state::mo6_sys_porta_in )
READ8_MEMBER( thomson_state::mo6_sys_portb_in )
{
/* keyboard: 9 lines of 8 keys */
- UINT8 porta = m_pia_sys->a_output();
- UINT8 portb = m_pia_sys->b_output();
+ uint8_t porta = m_pia_sys->a_output();
+ uint8_t portb = m_pia_sys->b_output();
int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */
int lin = (portb >> 1) & 7; /* B bits 1-3: kbd line */
@@ -4271,7 +4271,7 @@ READ8_MEMBER( thomson_state::mo6_gatearray_r )
struct thom_vsignal v = thom_get_vsignal();
struct thom_vsignal l = thom_get_lightpen_vsignal( MO6_LIGHTPEN_DECAL, m_to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
- UINT8 res;
+ uint8_t res;
count = m_to7_lightpen ? l.count : v.count;
inil = m_to7_lightpen ? l.inil : v.inil;
init = m_to7_lightpen ? l.init : v.init;
@@ -4481,8 +4481,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo6 )
MACHINE_START_MEMBER( thomson_state, mo6 )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "mo6: machine start called\n" ));
@@ -4584,7 +4584,7 @@ WRITE8_MEMBER( thomson_state::mo5nr_net_w )
READ8_MEMBER( thomson_state::mo5nr_prn_r )
{
- UINT8 result = 0;
+ uint8_t result = 0;
result |= m_centronics_busy << 7;
@@ -4607,7 +4607,7 @@ WRITE8_MEMBER( thomson_state::mo5nr_prn_w )
READ8_MEMBER( thomson_state::mo5nr_sys_portb_in )
{
/* keyboard: only 8 lines of 8 keys (MO6 has 9 lines) */
- UINT8 portb = m_pia_sys->b_output();
+ uint8_t portb = m_pia_sys->b_output();
int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */
int lin = (portb >> 1) & 7; /* B bits 1-3: kbd line */
@@ -4705,8 +4705,8 @@ MACHINE_RESET_MEMBER( thomson_state, mo5nr )
MACHINE_START_MEMBER( thomson_state, mo5nr )
{
- UINT8* mem = memregion("maincpu")->base();
- UINT8* ram = m_ram->pointer();
+ uint8_t* mem = memregion("maincpu")->base();
+ uint8_t* ram = m_ram->pointer();
LOG (( "mo5nr: machine start called\n" ));