Previous 199869 Revisions Next

r26417 Monday 25th November, 2013 at 17:28:46 UTC by Osso
(MESS) Updated ht68k to use the n68681 device. Also added some infos from the manual. Currently the driver works if you have a system disk inserted at boot, but not without. See MT05148.(nw)
[src/mess/drivers]ht68k.c

trunk/src/mess/drivers/ht68k.c
r26416r26417
11/***************************************************************************
22
3        Hawthorne Technologies TinyGiant HT68k
3        Hawthorne Technology TinyGiant HT68k
44
55        29/11/2009 Skeleton driver.
66
7Monitor commands (most do unknown things) (must be in Uppercase)
8B boot
9C compare memory blocks
10D dump memory to screen
11E Edit memory (. to escape)
12F
13G
14K
15L
16M
17P
18R
19S
20T
21W
22X (. to escape)
7Monitor commands (from ht68k manual) (must be in Uppercase)
8B Load binary file from disk.
9C Compare memory.
10D Display memory in Hex and ASCII.
11E Examine and/or change memory (2 bytes). (. to escape)
12F Fill a block of memory with a value.
13G Go to an address and execute program.
14K Peek.
15L Load program from serial port.
16M Move memory.
17P Poke.
18R Read binary file from disk.
19S System boot.
20T Test printer.
21W Write binary file to disk.
22X Examine long and/or change memory (4 bytes). (. to escape)
2323
24
25Lot of infos available at: http://www.classiccmp.org/cini/ht68k.htm
26
2427****************************************************************************/
2528
2629#include "emu.h"
2730#include "cpu/m68000/m68000.h"
28#include "machine/68681.h"
31#include "machine/n68681.h"
2932#include "machine/wd_fdc.h"
30#include "machine/terminal.h"
33#include "machine/serial.h"
3134
3235
3336class ht68k_state : public driver_device
3437{
3538public:
3639   ht68k_state(const machine_config &mconfig, device_type type, const char *tag)
37      : driver_device(mconfig, type, tag),
40   : driver_device(mconfig, type, tag),
3841   m_maincpu(*this, "maincpu"),
39   m_terminal(*this, TERMINAL_TAG),
4042   m_duart(*this, "duart68681"),
41   m_fdc(*this, "wd1770")
42   ,
43      m_p_ram(*this, "p_ram"){ }
43   m_fdc(*this, "wd1770"),
44   m_floppy0(*this, "wd1770:0"),
45   m_floppy1(*this, "wd1770:1"),
46   m_floppy2(*this, "wd1770:2"),
47   m_floppy3(*this, "wd1770:3"),
48   m_floppy(NULL),
49   m_p_ram(*this, "p_ram"){ }
4450
4551
4652   required_device<cpu_device> m_maincpu;
47   required_device<generic_terminal_device> m_terminal;
48   required_device<duart68681_device> m_duart;
53   required_device<duartn68681_device> m_duart;
4954   required_device<wd1770_t> m_fdc;
50   DECLARE_WRITE8_MEMBER(kbd_put);
51   DECLARE_WRITE_LINE_MEMBER(ht68k_fdc_intrq_w);
55   required_device<floppy_connector> m_floppy0;
56   required_device<floppy_connector> m_floppy1;
57   required_device<floppy_connector> m_floppy2;
58   required_device<floppy_connector> m_floppy3;
59   floppy_image_device *m_floppy;
60   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
61   DECLARE_WRITE_LINE_MEMBER(duart_txb);
62   DECLARE_READ8_MEMBER(duart_input);
63   DECLARE_WRITE8_MEMBER(duart_output);
5264   required_shared_ptr<UINT16> m_p_ram;
5365   virtual void machine_reset();
5466};
r26416r26417
6072   //AM_RANGE(0x00080000, 0x000fffff) // Expansion
6173   //AM_RANGE(0x00d80000, 0x00d8ffff) // Printer
6274   AM_RANGE(0x00e00000, 0x00e00007) AM_MIRROR(0xfff8) AM_DEVREADWRITE8("wd1770", wd1770_t, read, write, 0x00ff) // FDC WD1770
63   AM_RANGE(0x00e80000, 0x00e800ff) AM_MIRROR(0xff00) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
75   AM_RANGE(0x00e80000, 0x00e800ff) AM_MIRROR(0xff00) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff )
6476   AM_RANGE(0x00f00000, 0x00f07fff) AM_ROM AM_MIRROR(0xf8000) AM_REGION("user1",0)
6577ADDRESS_MAP_END
6678
r26416r26417
6880static INPUT_PORTS_START( ht68k )
6981INPUT_PORTS_END
7082
71
7283void ht68k_state::machine_reset()
7384{
7485   UINT8* user1 = memregion("user1")->base();
r26416r26417
7687   memcpy((UINT8*)m_p_ram.target(),user1,0x8000);
7788
7889   m_maincpu->reset();
90   
91   m_fdc->reset();
92   m_fdc->set_floppy(NULL);
7993}
8094
81static void duart_irq_handler(device_t *device, int state, UINT8 vector)
95WRITE_LINE_MEMBER(ht68k_state::duart_irq_handler)
8296{
83   ht68k_state *drvstate = device->machine().driver_data<ht68k_state>();
84   drvstate->m_maincpu->set_input_line_and_vector(M68K_IRQ_3, state, M68K_INT_ACK_AUTOVECTOR);
97   m_maincpu->set_input_line_and_vector(M68K_IRQ_3, state, M68K_INT_ACK_AUTOVECTOR);
8598}
8699
87static void duart_tx(device_t *device, int channel, UINT8 data)
100WRITE_LINE_MEMBER(ht68k_state::duart_txb)
88101{
89   ht68k_state *state = device->machine().driver_data<ht68k_state>();
90   state->m_terminal->write(device->machine().driver_data()->generic_space(), 0, data);
102   //This is the second serial channel named AUX, for modem or other serial devices.
91103}
92104
93static UINT8 duart_input(device_t *device)
105READ8_MEMBER(ht68k_state::duart_input)
94106{
95107   return 0;
96108}
97109
98static void duart_output(device_t *device, UINT8 data)
110WRITE8_MEMBER(ht68k_state::duart_output)
99111{
100   ht68k_state *state = device->machine().driver_data<ht68k_state>();
112   m_floppy = NULL;
101113
102   static const char *names[] = { "wd1770:0", "wd1770:1", "wd1770:2", "wd1770:3" };
103   floppy_image_device *floppy = 0;
104   for(int i=0; i<4; i++) {
105      if(BIT(data, 7-i)==0) {
106         floppy_connector *con = device->machine().device<floppy_connector>(names[i]);
107         if(con)
108            floppy = con->get_device();
109         break;
110      }
111   }
112   if (floppy) floppy->ss_w(BIT(data,3) ? 0 : 1);
113   state->m_fdc->set_floppy(floppy);
114}
114   if ((BIT(data, 7)) == 0) { m_floppy = m_floppy0->get_device(); }
115   if ((BIT(data, 6)) == 0) { m_floppy = m_floppy1->get_device(); }
116   if ((BIT(data, 5)) == 0) { m_floppy = m_floppy2->get_device(); }
117   if ((BIT(data, 4)) == 0) { m_floppy = m_floppy3->get_device(); }
115118
116WRITE8_MEMBER( ht68k_state::kbd_put )
117{
118   duart68681_rx_data(m_duart, 0, data);
119   m_fdc->set_floppy(m_floppy);
120
121   if (m_floppy) {m_floppy->ss_w(BIT(data,3) ? 0 : 1);}
119122}
120123
121static GENERIC_TERMINAL_INTERFACE( terminal_intf )
124static const rs232_port_interface rs232_intf =
122125{
123   DEVCB_DRIVER_MEMBER(ht68k_state, kbd_put)
126   DEVCB_DEVICE_LINE_MEMBER("duart68681", duartn68681_device, rx_a_w),
127   DEVCB_NULL,
128   DEVCB_NULL,
129   DEVCB_NULL,
130   DEVCB_NULL
124131};
125132
126static const duart68681_config ht68k_duart68681_config =
133static const duartn68681_config ht68k_duart68681_config =
127134{
128   duart_irq_handler,
129   duart_tx,
130   duart_input,
131   duart_output
135   DEVCB_DRIVER_LINE_MEMBER(ht68k_state, duart_irq_handler),
136   DEVCB_DEVICE_LINE_MEMBER("rs232", serial_port_device, tx), //serial channel CON (console, for terminal, 9600 baud)
137   DEVCB_DRIVER_LINE_MEMBER(ht68k_state, duart_txb), // serial channel AUX (auxiliary, for modem or other serial device, 1200 baud)
138   DEVCB_DRIVER_MEMBER(ht68k_state, duart_input),
139   DEVCB_DRIVER_MEMBER(ht68k_state, duart_output)
132140};
133141
134142static SLOT_INTERFACE_START( ht68k_floppies )
r26416r26417
140148   /* basic machine hardware */
141149   MCFG_CPU_ADD("maincpu",M68000, XTAL_8MHz)
142150   MCFG_CPU_PROGRAM_MAP(ht68k_mem)
151   MCFG_RS232_PORT_ADD("rs232", rs232_intf, default_rs232_devices, "serial_terminal")
143152
144
145153   /* video hardware */
146   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
154   MCFG_DUARTN68681_ADD( "duart68681", XTAL_8MHz / 2, ht68k_duart68681_config )
147155
148   MCFG_DUART68681_ADD( "duart68681", XTAL_8MHz / 2, ht68k_duart68681_config )
149
150156   MCFG_WD1770x_ADD("wd1770", XTAL_8MHz )
151157
152158   MCFG_FLOPPY_DRIVE_ADD("wd1770:0", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats)
r26416r26417
165171/* Driver */
166172
167173/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY                     FULLNAME                    FLAGS */
168COMP( 1987, ht68k,  0,       0,      ht68k,     ht68k, driver_device,   0,   "Hawthorne Technologies", "TinyGiant HT68k", GAME_NO_SOUND)
174COMP( 1987, ht68k,  0,       0,      ht68k,     ht68k, driver_device,   0,   "Hawthorne Technology", "TinyGiant HT68k", GAME_NO_SOUND)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team