Previous 15994 Revisions Next

r10104 Wednesday 19th January, 2011 at 11:39:29 UTC by Robbbert
[SOL20] Modernised. Added devices.
[src/mess/drivers]ptcsol.c

src/mess/drivers/ptcsol.c
r10103r10104
2323        SOL-20 board only
2424
2525****************************************************************************/
26#define ADDRESS_MAP_MODERN
2627
2728#include "emu.h"
2829#include "cpu/i8085/i8085.h"
2930#include "machine/terminal.h"
30#include "machine/ram.h"
31#include "sound/wave.h"
32#include "imagedev/cassette.h"
33#include "machine/ay31015.h"
3134
3235
33class ptcsol_state : public driver_device
36class sol20_state : public driver_device
3437{
3538public:
36   ptcsol_state(running_machine &machine, const driver_device_config_base &config)
37      : driver_device(machine, config) { }
39   sol20_state(running_machine &machine, const driver_device_config_base &config)
40      : driver_device(machine, config),
41   m_maincpu(*this, "maincpu"),
42   m_cass_1(*this, "cassette1"),
43   m_cass_2(*this, "cassette2"),
44   m_uart_c(*this, "uart_c"),
45   m_uart_s(*this, "uart_s"),
46   m_terminal(*this, TERMINAL_TAG)
47   { }
3848
39   UINT8 sol20_fa;
40   UINT8 sol20_fc;
41   UINT8 sol20_fe;
49   required_device<cpu_device> m_maincpu;
50   required_device<device_t> m_cass_1;
51   required_device<device_t> m_cass_2;
52   required_device<device_t> m_uart_c;
53   required_device<device_t> m_uart_s;
54   required_device<device_t> m_terminal;
55   DECLARE_READ8_MEMBER( sol20_fa_r );
56   DECLARE_READ8_MEMBER( sol20_fc_r );
57   DECLARE_WRITE8_MEMBER( sol20_fe_w );
58   DECLARE_WRITE8_MEMBER( sol20_kbd_put );
59   UINT8 m_sol20_fa;
60   UINT8 m_sol20_fc;
61   UINT8 m_sol20_fe;
4262   const UINT8 *FNT;
43   const UINT8 *videoram;
44   UINT8 framecnt;
63   const UINT8 *m_videoram;
64   UINT8 m_framecnt;
4565};
4666
4767
4868
49static READ8_HANDLER( sol20_fa_r )
69READ8_MEMBER( sol20_state::sol20_fa_r )
5070{
51   ptcsol_state *state = space->machine->driver_data<ptcsol_state>();
52   return state->sol20_fa;
71   return m_sol20_fa;
5372}
5473
55static READ8_HANDLER( sol20_fc_r )
74READ8_MEMBER( sol20_state::sol20_fc_r )
5675{
57   ptcsol_state *state = space->machine->driver_data<ptcsol_state>();
58   state->sol20_fa = 0xff;
59   return state->sol20_fc;
76   m_sol20_fa = 0xff;
77   return m_sol20_fc;
6078}
6179
62static WRITE8_HANDLER( sol20_fe_w )
80WRITE8_MEMBER( sol20_state::sol20_fe_w )
6381{
64   ptcsol_state *state = space->machine->driver_data<ptcsol_state>();
65   state->sol20_fe = data;
82   m_sol20_fe = data;
6683}
6784
68static ADDRESS_MAP_START( sol20_mem, ADDRESS_SPACE_PROGRAM, 8)
69   AM_RANGE(0X0000, 0Xbfff) AM_RAM   // optional s100 ram
85static ADDRESS_MAP_START( sol20_mem, ADDRESS_SPACE_PROGRAM, 8, sol20_state)
86   AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot")
87   AM_RANGE(0X0800, 0Xbfff) AM_RAM   // optional s100 ram
7088   AM_RANGE(0xc000, 0xc7ff) AM_ROM
7189   AM_RANGE(0Xc800, 0Xcbff) AM_RAM   // system ram
72   AM_RANGE(0Xcc00, 0Xcfff) AM_RAM   AM_REGION("maincpu", 0xcc00)// video ram
90   AM_RANGE(0Xcc00, 0Xcfff) AM_RAM   AM_BASE(m_videoram)
7391   AM_RANGE(0Xd000, 0Xffff) AM_RAM   // optional s100 ram
7492ADDRESS_MAP_END
7593
76static ADDRESS_MAP_START( sol20_io , ADDRESS_SPACE_IO, 8)
94static ADDRESS_MAP_START( sol20_io , ADDRESS_SPACE_IO, 8, sol20_state)
7795   ADDRESS_MAP_UNMAP_HIGH
7896   ADDRESS_MAP_GLOBAL_MASK(0xff)
7997   AM_RANGE(0xfa, 0xfa) AM_READ(sol20_fa_r)
r10103r10104
94112   PORT_INCLUDE(generic_terminal)
95113INPUT_PORTS_END
96114
115static const ay31015_config sol20_ay31015_config =
116{
117   AY_3_1015,
118   4800.0,
119   4800.0,
120   NULL,
121   NULL,
122   NULL
123};
97124
125
126static const cassette_config sol20_cassette_config =
127{
128   cassette_default_formats,
129   NULL,
130   (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED),
131   NULL
132};
133
134/* after the first 4 bytes have been read from ROM, switch the ram back in */
135static TIMER_CALLBACK( sol20_boot )
136{
137   memory_set_bank(machine, "boot", 0);
138}
139
98140static MACHINE_RESET( sol20 )
99141{
100   ptcsol_state *state = machine->driver_data<ptcsol_state>();
101   state->sol20_fa=0xff;
102   state->sol20_fe=0;
142   sol20_state *state = machine->driver_data<sol20_state>();
143   state->m_sol20_fa=0xff;
144   state->m_sol20_fe=0;
145   memory_set_bank(machine, "boot", 1);
146   timer_set(machine, ATTOTIME_IN_USEC(10), NULL, 0, sol20_boot);
103147}
104148
149static DRIVER_INIT( sol20 )
150{
151   UINT8 *RAM = machine->region("maincpu")->base();
152   memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0xc000);
153}
154
105155static VIDEO_START( sol20 )
106156{
107   ptcsol_state *state = machine->driver_data<ptcsol_state>();
157   sol20_state *state = machine->driver_data<sol20_state>();
108158   state->FNT = machine->region("chargen")->base();
109   state->videoram = machine->region("maincpu")->base()+0xcc00;
110159}
111160
112161static VIDEO_UPDATE( sol20 )
113162{
114   ptcsol_state *state = screen->machine->driver_data<ptcsol_state>();
163   sol20_state *state = screen->machine->driver_data<sol20_state>();
115164/* visible screen is 64 x 16, with start position controlled by scroll register */
116165   UINT8 y,ra,chr,gfx;
117166   UINT16 sy=0,ma,x,inv;
118167
119   state->framecnt++;
168   state->m_framecnt++;
120169
121   ma = state->sol20_fe << 6; // scroll register
170   ma = state->m_sol20_fe << 6; // scroll register
122171
123172   for (y = 0; y < 16; y++)
124173   {
r10103r10104
128177
129178         for (x = ma; x < ma + 64; x++)
130179         {
131            chr = state->videoram[x & 0x3ff];
180            chr = state->m_videoram[x & 0x3ff];
132181            inv = 0;
133182
134183            /* Take care of flashing characters */
135            if ((chr & 0x80) && (state->framecnt & 0x08))
184            if ((chr & 0x80) && (state->m_framecnt & 0x08))
136185               inv ^= 0xff;
137186
138187            chr &= 0x7f;
r10103r10104
162211   return 0;
163212}
164213
165static WRITE8_DEVICE_HANDLER( sol20_kbd_put )
214WRITE8_MEMBER( sol20_state::sol20_kbd_put )
166215{
167   ptcsol_state *state = device->machine->driver_data<ptcsol_state>();
168   state->sol20_fa &= 0xfe;
169   state->sol20_fc = data;
216   m_sol20_fa &= 0xfe;
217   m_sol20_fc = data;
170218}
171219
172220static GENERIC_TERMINAL_INTERFACE( sol20_terminal_intf )
173221{
174   DEVCB_HANDLER(sol20_kbd_put)
222   DEVCB_DRIVER_MEMBER(sol20_state, sol20_kbd_put)
175223};
176224
177static MACHINE_CONFIG_START( sol20, ptcsol_state )
225static MACHINE_CONFIG_START( sol20, sol20_state )
178226   /* basic machine hardware */
179227   MCFG_CPU_ADD("maincpu",I8080, XTAL_14_31818MHz/7)
180228   MCFG_CPU_PROGRAM_MAP(sol20_mem)
r10103r10104
195243   MCFG_VIDEO_START(sol20)
196244   MCFG_VIDEO_UPDATE(sol20)
197245
198   /* internal ram */
199//  MCFG_RAM_ADD(RAM_TAG)
200//  MCFG_RAM_DEFAULT_SIZE("8K")
201//  MCFG_RAM_EXTRA_OPTIONS("16K,32K")
202   MCFG_GENERIC_TERMINAL_ADD("terminal", sol20_terminal_intf)
246   /* sound hardware */
247   MCFG_SPEAKER_STANDARD_MONO("mono")
248   MCFG_SOUND_WAVE_ADD("wave.1", "cassette1")
249   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)   // cass1 speaker
250   MCFG_SOUND_WAVE_ADD("wave.2", "cassette2")
251   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)   // cass2 speaker
252
253   // devices
254   MCFG_CASSETTE_ADD( "cassette1", sol20_cassette_config )
255   MCFG_CASSETTE_ADD( "cassette2", sol20_cassette_config )
256   MCFG_AY31015_ADD( "uart_c", sol20_ay31015_config )
257   MCFG_AY31015_ADD( "uart_s", sol20_ay31015_config )
258   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, sol20_terminal_intf)
203259MACHINE_CONFIG_END
204260
205261/* ROM definition */
r10103r10104
211267   /* character generator not dumped, using the one from 'c10' for now */
212268   ROM_REGION( 0x2000, "chargen", 0 )
213269   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
270   /* There are actually 2 character generators available - the 6574 and the 6575 */
214271ROM_END
215272
216273/* Driver */
217274/*    YEAR  NAME    PARENT  COMPAT  MACHINE  INPUT  INIT   COMPANY     FULLNAME   FLAGS */
218COMP( 1976, sol20,  0,      0,      sol20,   sol20, 0,     "Processor Technology Corporation",  "SOL-20", GAME_NOT_WORKING | GAME_NO_SOUND)
275COMP( 1976, sol20,  0,      0,      sol20,   sol20, sol20, "Processor Technology Corporation",  "SOL-20", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team