Previous 15994 Revisions Next

r15805 Wednesday 8th August, 2012 at 11:28:05 UTC by Robbbert
BASIC52 / BASIC31 : These work now, apart from cpu-related issues. [Robbbert]
[src/mess/drivers]basic52.c

src/mess/drivers/basic52.c
r15804r15805
44
55        03/12/2009 Skeleton driver.
66
7        2012-08-08 Made to work [Robbbert]
8
79BASIC-52 is an official Intel release.
810
911BASIC-31 (and variants) as found on the below url, are homebrews.
1012
1113http://dsaprojects.110mb.com/electronics/8031-ah/8031-bas.html
1214
15
16The driver is working, however there are issues with the cpu serial code.
17When started, you are supposed to press Space and the system works out
18the baud rate and boots up.
19
20However, the way the cpu is written, it actually passes bytes around, so
21the auto-speed detection doesn't work as intended.
22
23So, as it stands, start the driver, then press d and g in turn until
24something starts happening. Basic-52 usually starts at a very slow rate,
25about 1 character per second, while Basic-31 is much faster.
26
27Once the system starts, all input must be in uppercase. Read the manual
28to discover the special features of this Basic.
29
1330****************************************************************************/
1431
1532#include "emu.h"
r15804r15805
2239{
2340public:
2441   basic52_state(const machine_config &mconfig, device_type type, const char *tag)
25      : driver_device(mconfig, type, tag) { }
42      : driver_device(mconfig, type, tag),
43   m_maincpu(*this, "maincpu"),
44   m_terminal(*this, TERMINAL_TAG) { }
2645
2746   DECLARE_WRITE8_MEMBER(kbd_put);
47   DECLARE_READ8_MEMBER(unk_r);
2848   UINT8 m_term_data;
49   required_device<cpu_device> m_maincpu;
50   required_device<generic_terminal_device> m_terminal;
2951};
3052
31// may need AS_DATA as well..
3253
33// according to my reading of the mcs51 cpu source, AS_PROGRAM is for
34// external RAM, AS_DATA for internal RAM, and AS_IO for the IO ports
35
3654static ADDRESS_MAP_START(basic52_mem, AS_PROGRAM, 8, basic52_state)
3755   ADDRESS_MAP_UNMAP_HIGH
3856   AM_RANGE(0x0000, 0x1fff) AM_ROM
3957   AM_RANGE(0x2000, 0x7fff) AM_RAM
40   AM_RANGE(0x8000, 0x9fff) AM_ROM // EPROM
58   //AM_RANGE(0x8000, 0x9fff) AM_ROM // EPROM
4159   //AM_RANGE(0xc000, 0xdfff) // Expansion block
4260   //AM_RANGE(0xe000, 0xffff) // Expansion block
4361ADDRESS_MAP_END
r15804r15805
4967   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)  // PPI-8255
5068   //AM_RANGE(0xc000, 0xdfff) // Expansion block
5169   //AM_RANGE(0xe000, 0xffff) // Expansion block
70   AM_RANGE(0x20003, 0x20003) AM_READ(unk_r);
5271ADDRESS_MAP_END
5372
5473/* Input ports */
5574static INPUT_PORTS_START( basic52 )
5675INPUT_PORTS_END
5776
77// won't compile unless these are static
78static void to_term(device_t *device, int data )
79{
80   basic52_state *state = device->machine().driver_data<basic52_state>();
81   address_space *space = device->memory().space(AS_PROGRAM);
82   state->m_terminal->write(*space, 0, data);
83}
5884
85static int from_term(device_t *device)
86{
87   basic52_state *state = device->machine().driver_data<basic52_state>();
88   return state->m_term_data;
89}
90
91READ8_MEMBER( basic52_state::unk_r)
92{
93   return m_term_data; // won't boot without this
94}
95
5996static MACHINE_RESET( basic52 )
6097{
98   basic52_state *state = machine.driver_data<basic52_state>();
99   i8051_set_serial_tx_callback(state->m_maincpu, to_term);
100   i8051_set_serial_rx_callback(state->m_maincpu, from_term);
61101}
62102
63103WRITE8_MEMBER( basic52_state::kbd_put )
64104{
105   cputag_set_input_line(machine(), "maincpu", MCS51_RX_LINE, ASSERT_LINE);
106   cputag_set_input_line(machine(), "maincpu", MCS51_RX_LINE, CLEAR_LINE);
65107   m_term_data = data;
66108}
67109
r15804r15805
128170ROM_END
129171
130172/* Driver */
131/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
132COMP( 1985, basic52,  0,       0,    basic52,   basic52, basic52_state,  0,    "Intel", "MCS BASIC 52", GAME_NOT_WORKING | GAME_NO_SOUND)
133COMP( 1985, basic31,  basic52, 0,    basic31,   basic52, basic52_state,  0,    "Intel", "MCS BASIC 31", GAME_NOT_WORKING | GAME_NO_SOUND)
134
173/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    CLASS          INIT    COMPANY   FULLNAME       FLAGS */
174COMP( 1985, basic52,  0,       0,    basic52,   basic52, basic52_state,  0,    "Intel", "MCS BASIC 52", GAME_NO_SOUND_HW)
175COMP( 1985, basic31,  basic52, 0,    basic31,   basic52, basic52_state,  0,    "Intel", "MCS BASIC 31", GAME_NO_SOUND_HW)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team