Previous 15994 Revisions Next

r12933 Sunday 25th September, 2011 at 11:15:50 UTC by Robbbert
POLY1 - added some devices and notes.
[src/mess/drivers]poly.c

src/mess/drivers/poly.c
r12932r12933
99    It uses a 6809 for all main functions. There is a Z80 for CP/M, but all
1010    of the roms are 6809 code.
1111
12    The keyboard controller is one of those custom XR devices.
13    Will use the terminal keyboard instead.
14
1215    ToDo:
13    - Everything!
16    - Almost Everything!
17    - Connect up the device ports & lines
18    - Find out about graphics mode and how it is selected
19    - There is a beeper or speaker connected to the 6840 - how?
20    - Fix Keyboard so that the Enter key tells BASIC to do something
21    - Fix If ^G is pressed, emulation freezes
22    - Find out how to make 2nd teletext screen to display
1423
1524****************************************************************************/
1625#define ADDRESS_MAP_MODERN
r12932r12933
1827#include "emu.h"
1928#include "cpu/m6809/m6809.h"
2029#include "cpu/z80/z80.h"
30#include "machine/6821pia.h"
31#include "machine/6840ptm.h"
2132#include "video/saa5050.h"
2233#include "machine/terminal.h"
2334
r12932r12933
2738public:
2839   poly_state(const machine_config &mconfig, device_type type, const char *tag)
2940      : driver_device(mconfig, type, tag),
30   m_maincpu(*this, "maincpu")
41   m_maincpu(*this, "maincpu"),
42   m_pia0(*this, "pia0"),
43   m_pia1(*this, "pia1")
3144   { }
3245
3346   required_device<cpu_device> m_maincpu;
47   required_device<pia6821_device> m_pia0;
48   required_device<pia6821_device> m_pia1;
3449   DECLARE_WRITE8_MEMBER(kbd_put);
50   DECLARE_READ8_MEMBER(pia1_b_in);
51   DECLARE_READ_LINE_MEMBER(pia1_cb1_in);
52   UINT8 m_term_data;
53   bool m_term_key;
3554};
3655
3756
r12932r12933
3958   ADDRESS_MAP_UNMAP_HIGH
4059   AM_RANGE(0x0000,0x9fff) AM_RAM
4160   AM_RANGE(0xa000,0xcfff) AM_ROM
42   AM_RANGE(0xd000,0xe7ff) AM_RAM
43   AM_RANGE(0xe800,0xebff) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
44   AM_RANGE(0xec00,0xefff) AM_RAM
61   AM_RANGE(0xd000,0xdfff) AM_RAM
62   AM_RANGE(0xe000,0xe003) AM_DEVREADWRITE("pia0", pia6821_device, read, write) //video control PIA 6821
63   // AM_RANGE(0xe004,0xe006) optional RS232C interface
64   AM_RANGE(0xe00c,0xe00f) AM_DEVREADWRITE("pia1", pia6821_device, read, write) //keyboard PIA 6821
65   AM_RANGE(0xe020,0xe027) AM_DEVREADWRITE("ptm", ptm6840_device, read, write) //timer 6840
66   // AM_RANGE(0xe030,0xe037) Data Link Controller 6854
67   AM_RANGE(0xe040,0xe040) AM_NOP //Set protect flip-flop after 1 E-cycle
68   AM_RANGE(0xe050,0xe05f) AM_RAM //Dynamic Address Translater (arranges memory banks)
69   // AM_RANGE(0xe060,0xe060) Select Map 1
70   // AM_RANGE(0xe070,0xe070) Select Map 2
71   AM_RANGE(0xe800,0xebbf) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
72   AM_RANGE(0xebc0,0xebff) AM_RAM
73   AM_RANGE(0xec00,0xefbf) AM_RAM // screen 2 AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
74   AM_RANGE(0xefc0,0xefff) AM_RAM
4575   AM_RANGE(0xf000,0xffff) AM_ROM
4676ADDRESS_MAP_END
4777
r12932r12933
5585{
5686}
5787
88static const pia6821_interface poly_pia0_intf=
89{
90   DEVCB_NULL,                  /* port A input */
91   DEVCB_NULL,   /* port B input */
92   DEVCB_NULL, /* CA1 input */
93   DEVCB_NULL, /* CB1 input */
94   DEVCB_NULL,                  /* CA2 input */
95   DEVCB_NULL,                  /* CB2 input */
96   DEVCB_NULL,   /* port A output */
97   DEVCB_NULL,   /* port B output */
98   DEVCB_NULL, /* CA2 output */
99   DEVCB_NULL, /* CB2 output */
100   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE),   /* IRQA output */
101   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)      /* IRQB output */
102};
103
104READ8_MEMBER( poly_state::pia1_b_in )
105{
106// return ascii key value, bit 7 is the strobe value
107   return m_term_data;
108}
109
110READ_LINE_MEMBER( poly_state::pia1_cb1_in )
111{
112// return kbd strobe value
113   return 0;
114}
115
116
117static const pia6821_interface poly_pia1_intf=
118{
119   DEVCB_NULL,      /* port A input */
120   DEVCB_DRIVER_MEMBER(poly_state, pia1_b_in),      /* port B input */
121   DEVCB_NULL,      /* CA1 input */
122   DEVCB_DRIVER_LINE_MEMBER(poly_state, pia1_cb1_in),      /* CB1 input */
123   DEVCB_NULL,      /* CA2 input */
124   DEVCB_NULL,      /* CB2 input */
125   DEVCB_NULL,      /* port A output */
126   DEVCB_NULL,      /* port B output */
127   DEVCB_NULL,      /* CA2 output */
128   DEVCB_NULL,      /* CB2 output */
129   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE),
130   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)
131};
132
133static const ptm6840_interface poly_ptm_intf =
134{
135   XTAL_10MHz/10, // not correct
136   { 0, 0, 0 },
137   { DEVCB_NULL,
138     DEVCB_NULL,
139     DEVCB_NULL },
140   DEVCB_NULL
141};
142
58143static SCREEN_UPDATE( poly )
59144{
60145   device_t *saa5050 = screen->machine().device("saa5050");
r12932r12933
68153{
69154   "screen",
70155   0,   /* starting gfxnum */
71   40, 25, 40,  /* x, y, size */
156   40, 24, 40,  /* x, y, size */
72157   0   /* rev y order */
73158};
74159
75160// temporary hack
76161WRITE8_MEMBER( poly_state::kbd_put )
77162{
163   m_term_data = data;
164   //m_term_key = 1;
78165   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
79166   mem->write_byte(0xebec, data);
80167   mem->write_byte(0xebd0, 1); // any non-zero here
r12932r12933
100187   MCFG_SCREEN_SIZE(40 * 12, 24 * 20)
101188   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
102189   MCFG_SCREEN_UPDATE(poly)
103
104190   MCFG_GFXDECODE(saa5050)
105191   MCFG_PALETTE_LENGTH(128)
106192   MCFG_PALETTE_INIT(saa5050)
107193
194   /* Devices */
108195   MCFG_SAA5050_ADD("saa5050", poly_saa5050_intf)
196   MCFG_PIA6821_ADD( "pia0", poly_pia0_intf )
197   MCFG_PIA6821_ADD( "pia1", poly_pia1_intf )
198   MCFG_PTM6840_ADD("ptm", poly_ptm_intf)
109199
110200   // temporary hack
111201   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team