Previous 15994 Revisions Next

r10888 Monday 21st March, 2011 at 11:18:52 UTC by Robbbert
[PCM] Added devices and info.
[src/mess/drivers]pcm.c

src/mess/drivers/pcm.c
r10887r10888
22
33        PC/M by Miodrag Milanovic
44
5        http://www.li-pro.net/pcm.phtml  (in German)
6
57        12/05/2009 Preliminary driver.
68
79        14/02/2011 Added keyboard (from terminal).
810
9        Commands haven't been checked out yet, but an
10        example is the following sequence: (press return at end of each line)
11        Commands:
12        1 select memory bank 1
13        2 select memory bank 2
14        B
15        C start cp/m from the inbuilt CCP
16        D Debugger
17        Fx Format disk A or B
18        G  Jump to address
19        I List files on tape
20        L filename.typ  Load file from tape
21        R read from disk
22        S filename aaaa / bbbb save a file to tape
23        V verify
24        W write to disk
25        X
26        Z set tape baud (1200, 2400, 3600 (default), 4800)
27   filename   start running this .COM file
1128
29        Therefore if you enter random input, it will lock up while trying to
30        load up a file of that name. Filenames on disk and tape are of the
31        standard 8.3 format. Wildcards (* ?) are permitted.
32
33        Here is an example of starting the debugger, executing a command in
34        it, then exiting back to the monitor.
35
1236        D
1337        U
1438        E
r10887r10888
1741#define ADDRESS_MAP_MODERN
1842
1943#include "emu.h"
44#include "machine/z80ctc.h"
45#include "machine/z80pio.h"
46#include "machine/z80sio.h"
2047#include "cpu/z80/z80.h"
48#include "cpu/z80/z80daisy.h"
49#include "imagedev/cassette.h"
50#include "sound/speaker.h"
51#include "sound/wave.h"
2152#include "machine/terminal.h"
2253
2354
r10887r10888
5081   return ret;
5182}
5283
84/* PIO connections as far as i could decipher
5385
86PortA is input and connects to the keyboard
87PortB is mostly output and connects to a series of LEDs,
88      but also carries the cassette control & data lines.
89
90A0-A6 ascii codes from the keyboard
91A7 strobe, high while a key is pressed
92B0 power indicator LED
93B1 Run/Stop LED
94B2 Sound on/off LED
95B3 n/c
96B4 High=Save, Low=Load LED
97B5 Motor On LED
98B6 Save data
99B7 Load data
100There is also a HALT LED, connected directly to the processor.
101*/
102
54103static ADDRESS_MAP_START(pcm_mem, ADDRESS_SPACE_PROGRAM, 8, pcm_state)
55104   ADDRESS_MAP_UNMAP_HIGH
56105   AM_RANGE( 0x0000, 0x1fff ) AM_ROM  // ROM
r10887r10888
62111   ADDRESS_MAP_UNMAP_HIGH
63112   ADDRESS_MAP_GLOBAL_MASK(0xff)
64113   AM_RANGE(0x84, 0x84) AM_READ(pcm_84_r)
114   //AM_RANGE(0x80, 0x83) // system CTC
115   //AM_RANGE(0x84, 0x87) // system PIO (data-a, data-b, ctrl-a, ctrl-b)
116   //AM_RANGE(0x88, 0x8B) // SIO (same order as above)
117   //AM_RANGE(0x8C, 0x8F) // User CTC
118   //AM_RANGE(0x90, 0x93) // user PIO (same order as above)
119   //AM_RANGE(0x94, 0x97) // bank select
120   //AM_RANGE(0x98, 0x9B) // NMI generator
121   //AM_RANGE(0x9C, 0x9F) // io ports available to the user
122   // disk controller?
65123ADDRESS_MAP_END
66124
67125/* Input ports */
r10887r10888
114172   return 0;
115173}
116174
175
176// someone please check this
177static const z80_daisy_config pcm_daisy_chain[] =
178{
179   { "z80ctc_s" },      /* System ctc */
180   { "z80pio_s" },      /* System pio */
181   { "z80sio" },      /* sio */
182   { "z80pio_u" },      /* User pio */
183   { "z80ctc_u" },      /* User ctc */
184   { NULL }
185};
186
187static Z80CTC_INTERFACE( ctc_u_intf )
188{
189   0,            /* timer disablers */
190   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
191   DEVCB_NULL,         /* ZC/TO0 callback */
192   DEVCB_NULL,         /* ZC/TO1 callback */
193   DEVCB_NULL         /* ZC/TO2 callback */
194};
195
196static Z80CTC_INTERFACE( ctc_s_intf )
197{
198   0,            /* timer disablers */
199   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
200   DEVCB_NULL,         /* ZC/TO0 callback - SIO channel A clock */
201   DEVCB_NULL,         /* ZC/TO1 callback - SIO channel B clock */
202   DEVCB_NULL         /* ZC/TO2 callback - speaker */
203};
204
205static Z80PIO_INTERFACE( pio_u_intf )
206{
207   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
208   DEVCB_NULL,         /* read port A */
209   DEVCB_NULL,         /* write port A */
210   DEVCB_NULL,         /* portA ready active callback */
211   DEVCB_NULL,         /* read port B */
212   DEVCB_NULL,         /* write port B */
213   DEVCB_NULL         /* portB ready active callback */
214};
215
216static Z80PIO_INTERFACE( pio_s_intf )
217{
218   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
219   DEVCB_NULL,         /* read port A */
220   DEVCB_NULL,         /* write port A */
221   DEVCB_NULL,         /* portA ready active callback */
222   DEVCB_NULL,         /* read port B */
223   DEVCB_NULL,         /* write port B */
224   DEVCB_NULL         /* portB ready active callback */
225};
226
227static const z80sio_interface sio_intf =
228{
229   0, //DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
230   0,         /* DTR changed handler */
231   0,         /* RTS changed handler */
232   0,         /* BREAK changed handler */
233   0,         /* transmit handler - which channel is this for? */
234   0         /* receive handler - which channel is this for? */
235};
236
237
238
117239/* F4 Character Displayer */
118240static const gfx_layout pcm_charlayout =
119241{
r10887r10888
137259   MCFG_CPU_ADD("maincpu",Z80, XTAL_10MHz /4)
138260   MCFG_CPU_PROGRAM_MAP(pcm_mem)
139261   MCFG_CPU_IO_MAP(pcm_io)
262   MCFG_CPU_CONFIG(pcm_daisy_chain)
140263
141264   MCFG_MACHINE_RESET(pcm)
142265
r10887r10888
148271   MCFG_SCREEN_SIZE(64*8, 32*8)
149272   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
150273   MCFG_SCREEN_UPDATE(pcm)
151
152274   MCFG_GFXDECODE(pcm)
153275   MCFG_PALETTE_LENGTH(2)
154276   MCFG_PALETTE_INIT(black_and_white)
155277
156278   MCFG_VIDEO_START(pcm)
157279
280   /* Sound */
281   MCFG_SPEAKER_STANDARD_MONO("mono")
282   MCFG_SOUND_WAVE_ADD("wave", "cassette")
283   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
284   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
285   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
286
287   /* Devices */
158288   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, pcm_terminal_intf)
289   MCFG_CASSETTE_ADD( "cassette", default_cassette_config )
290   MCFG_Z80PIO_ADD( "z80pio_u", XTAL_10MHz /4, pio_u_intf )
291   MCFG_Z80PIO_ADD( "z80pio_s", XTAL_10MHz /4, pio_s_intf )
292   MCFG_Z80SIO_ADD( "z80sio", 4800, sio_intf ) // clocks come from the system ctc
293   MCFG_Z80CTC_ADD( "z80ctc_u", 1379310.344828, ctc_u_intf ) // numbers need to be corrected
294   MCFG_Z80CTC_ADD( "z80ctc_s", 1379310.344828, ctc_s_intf ) // numbers need to be corrected
159295MACHINE_CONFIG_END
160296
161297/* ROM definition */
r10887r10888
176312   ROMX_LOAD( "bios_v330.d15", 0x0800, 0x0800, CRC(4f8d5b40) SHA1(440b0be4cf45a5d450f9eb7684ceb809450585dc), ROM_BIOS(3))
177313   ROMX_LOAD( "bios_v330.d16", 0x1000, 0x0800, CRC(93fd0d91) SHA1(c8f1bbb63eca3c93560622581ecbb588716aeb91), ROM_BIOS(3))
178314   ROMX_LOAD( "bios_v330.d17", 0x1800, 0x0800, CRC(d8c7ce33) SHA1(9030d9a73ef1c12a31ac2cb9a593fb2a5097f24d), ROM_BIOS(3))
315
179316   ROM_REGION(0x0800, "chargen",0)
180317   ROM_LOAD( "charrom.d113", 0x0000, 0x0800, CRC(5684b3c3) SHA1(418054aa70a0fd120611e32059eb2051d3b82b5a))
181   ROM_REGION(0x0800, "k7659",0)
318
319   ROM_REGION(0x0800, "k7659",0) // keyboard encoder
182320   ROM_LOAD ("k7659n.d8", 0x0000, 0x0800, CRC(7454bf0a) SHA1(b97e7df93778fa371b96b6f4fb1a5b1c8b89d7ba) )
183321ROM_END
184322

Previous 15994 Revisions Next


© 1998-2018 The MESS Team