Previous 15994 Revisions Next

r6309 Thursday 5th November, 2009 at 14:10:01 UTC by Curt Coder
[PC8001] Populated memory maps.
[src/mess/drivers]pc8001.c
[src/mess/includes]pc8001.h

src/mess/includes/pc8001.h
r6308r6309
22#define __PC8001__
33 
44#define Z80_TAG         "z80"
5#define I8251_TAG      "i8251"
56#define I8255A_TAG      "i8255"
67#define I8257_TAG      "i8257"
78#define UPD1990A_TAG   "upd1990a"
r6308r6309
910#define CASSETTE_TAG   "cassette"
1011#define CENTRONICS_TAG   "centronics"
1112#define SCREEN_TAG      "screen"
13#define SPEAKER_TAG      "speaker"
1214 
1315typedef struct _pc8001_state pc8001_state;
1416struct _pc8001_state
r6308r6309
2527   const device_config *upd3301;
2628   const device_config *cassette;
2729   const device_config *centronics;
30   const device_config *speaker;
2831};
2932 
3033#endif
src/mess/drivers/pc8001.c
r6308r6309
55#include "devices/messram.h"
66#include "machine/8257dma.h"
77#include "machine/ctronics.h"
8#include "machine/i8214.h"
89#include "machine/i8255a.h"
10#include "machine/msm8251.h"
911#include "machine/upd1990a.h"
1012#include "video/upd3301.h"
1113#include "sound/speaker.h"
1214 
1315/* Read/Write Handlers */
1416 
15WRITE8_HANDLER( port10_w )
17static WRITE8_HANDLER( port10_w )
1618{
19   /*
20 
21      bit      description
22 
23      0      RTC C0
24      1      RTC C1
25      2      RTC C2
26      3      RTC DATA IN
27      4      unused
28      5      unused
29      6      unused
30      7      unused
31 
32   */
33 
1734   pc8001_state *state = space->machine->driver_data;
1835 
1936   /* real time clock */
r6308r6309
2643   centronics_data_w(state->centronics, 0, data);
2744}
2845 
46static WRITE8_HANDLER( port30_w )
47{
48   /*
49 
50      bit      description
51 
52      0      characters per line (0=40, 1=80)
53      1      color mode (0=color, 1=B&W)
54      2      CMT CHIN
55      3      CMT MOTOR (1=on)
56      4      CMT BS1
57      5      CMT BS2
58      6      unused
59      7      unused
60 
61   */
62}
63 
64static WRITE8_HANDLER( pc8001mk2_port31_w )
65{
66   /*
67 
68      bit      description
69 
70      0      expansion ROM (0=expansion, 1=N80)
71      1      memory mode (0=ROM, 1=RAM)
72      2      color mode (0=attribute, 1=B&W)
73      3      graphics enable
74      4      resolution (0=640x200, 1=320x200)
75      5      background color
76      6      background color
77      7      background color
78 
79   */
80}
81 
2982static WRITE8_HANDLER( port40_w )
3083{
84   /*
85 
86      bit      description
87 
88      0      PRT /STROBE
89      1      RTC STB
90      2      RTC CLK
91      3      CRT /CLDS CLK
92      4      unused
93      5      BEEP
94      6      unused
95      7      unused
96 
97   */
98 
3199   pc8001_state *state = space->machine->driver_data;
32100 
33101   /* printer */
r6308r6309
36104   /* real time clock */
37105   upd1990a_stb_w(state->upd1990a, BIT(data, 1));
38106   upd1990a_clk_w(state->upd1990a, BIT(data, 2));
107 
108   /* beep */
109   speaker_level_w(state->speaker, BIT(data, 5));
39110}
40111 
41112static READ8_HANDLER( port40_r )
42113{
114   /*
115 
116      bit      description
117 
118      0      PRT /READY
119      1      PRT /ACK
120      2      CMT CDIN
121      3      EXP /EXTON
122      4      RTC DATA OUT
123      5      CRT VRTC
124      6      unused
125      7      unused
126 
127   */
128 
43129   pc8001_state *state = space->machine->driver_data;
44130   UINT8 data = 0xc0;
45131 
r6308r6309
71157   AM_RANGE(0x07, 0x07) AM_READ_PORT("KEY7")
72158   AM_RANGE(0x08, 0x08) AM_READ_PORT("KEY8")
73159   AM_RANGE(0x09, 0x09) AM_READ_PORT("KEY9")
74   AM_RANGE(0x10, 0x10) AM_WRITE(port10_w)
75//   AM_RANGE(0x30, 0x30) AM_WRITE(port30_w)
76   AM_RANGE(0x40, 0x40) AM_READWRITE(port40_r, port40_w)
160   AM_RANGE(0x10, 0x10) AM_MIRROR(0x0f) AM_WRITE(port10_w)
161   AM_RANGE(0x20, 0x20) AM_MIRROR(0x0e) AM_DEVREADWRITE(I8251_TAG, msm8251_data_r, msm8251_data_w)
162   AM_RANGE(0x21, 0x21) AM_MIRROR(0x0e) AM_DEVREADWRITE(I8251_TAG, msm8251_status_r, msm8251_control_w)
163   AM_RANGE(0x30, 0x30) AM_MIRROR(0x0f) AM_WRITE(port30_w)
164   AM_RANGE(0x40, 0x40) AM_MIRROR(0x0f) AM_READWRITE(port40_r, port40_w)
77165   AM_RANGE(0x50, 0x51) AM_DEVREADWRITE(UPD3301_TAG, upd3301_r, upd3301_w)
78166   AM_RANGE(0x60, 0x68) AM_DEVREADWRITE(I8257_TAG, dma8257_r, dma8257_w)
79//   AM_RANGE(0xe4, 0xe4) AM_WRITE(irq_level_w)
167//   AM_RANGE(0x70, 0x7f) unused
168//   AM_RANGE(0x80, 0x80) AM_MIRROR(0x0f) AM_WRITE(pc8011_ext0_w)
169//   AM_RANGE(0x90, 0x90) AM_MIRROR(0x0f) AM_WRITE(pc8011_ext1_w)
170//   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_WRITE(pc8011_ext2_w)
171//   AM_RANGE(0xb0, 0xb0) AM_READ(pc8011_gpio8_r)
172//   AM_RANGE(0xb1, 0xb1) AM_WRITE(pc8011_gpio8_w)
173//   AM_RANGE(0xb2, 0xb2) AM_READ(pc8011_gpio4_r)
174//   AM_RANGE(0xb3, 0xb3) AM_WRITE(pc8011_gpio4_w)
175//   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE(PC8011_CH1_I8251_TAG, msm8251_data_r, msm8251_data_w)
176//   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE(PC8011_CH1_I8251_TAG, msm8251_status_r, msm8251_control_w)
177//   AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE(PC8011_CH2_I8251_TAG, msm8251_data_r, msm8251_data_w)
178//   AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE(PC8011_CH2_I8251_TAG, msm8251_status_r, msm8251_control_w)
179//   AM_RANGE(0xc8, 0xc8) RS-232 output enable?
180//   AM_RANGE(0xca, 0xca) RS-232 output disable?
181//   AM_RANGE(0xd0, 0xd3) AM_DEVREADWRITE(PC8011_IEEE488_I8255A_TAG, i8255a_r, i8255a_w)
182//   AM_RANGE(0xd8, 0xd8) AM_READ(pc8011_ieee488_control_signal_input_r)
183//   AM_RANGE(0xda, 0xda) AM_READ(pc8011_ieee488_bus_address_mode_r)
184//   AM_RANGE(0xdc, 0xdc) AM_WRITE(pc8011_ieee488_nrfd_w)
185//   AM_RANGE(0xde, 0xde) AM_WRITE(pc8011_ieee488_bus_mode_control_w)
186//   AM_RANGE(0xe0, 0xe3) AM_WRITE(expansion_storage_mode_w)
187//   AM_RANGE(0xe4, 0xe4) AM_MIRROR(0x01) AM_WRITE(irq_level_w)
80188//   AM_RANGE(0xe6, 0xe6) AM_WRITE(irq_mask_w)
189//   AM_RANGE(0xe7, 0xe7) AM_WRITE(pc8012_memory_mode_w)
190//   AM_RANGE(0xe8, 0xfb) unused
81191   AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE(I8255A_TAG, i8255a_r, i8255a_w)
82192ADDRESS_MAP_END
83193 
194static ADDRESS_MAP_START( pc8001mk2_mem, ADDRESS_SPACE_PROGRAM, 8 )
195   AM_RANGE(0x0000, 0x5fff) AM_RAMBANK(1)
196   AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(2)
197   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(3)
198   AM_RANGE(0xc000, 0xffff) AM_RAMBANK(4)
199ADDRESS_MAP_END
200 
201static ADDRESS_MAP_START( pc8001mk2_io, ADDRESS_SPACE_IO, 8 )
202   AM_IMPORT_FROM(pc8001_io)
203   AM_RANGE(0x30, 0x30) AM_WRITE(port30_w)
204   AM_RANGE(0x31, 0x31) AM_WRITE(pc8001mk2_port31_w)
205//   AM_RANGE(0x5c, 0x5c) AM_WRITE(pc8001mk2_gram_on_w)
206//   AM_RANGE(0x5f, 0x5f) AM_WRITE(pc8001mk2_gram_off_w)
207//   AM_RANGE(0xe8, 0xe8) kanji_address_lo_w, kanji_data_lo_r
208//   AM_RANGE(0xe9, 0xe9) kanji_address_hi_w, kanji_data_hi_r
209//   AM_RANGE(0xea, 0xea) kanji_readout_start_w
210//   AM_RANGE(0xeb, 0xeb) kanji_readout_end_w
211//   AM_RANGE(0xf3, 0xf3) DMA type disk unit interface selection port 
212//   AM_RANGE(0xf4, 0xf4) DMA type 8 inch control
213//   AM_RANGE(0xf5, 0xf5) DMA type 8 inch margin control
214//   AM_RANGE(0xf6, 0xf6) DMA type 8 inch FDC status
215//   AM_RANGE(0xf7, 0xf7) DMA type 8 inch FDC data register
216//   AM_RANGE(0xf8, 0xf8) DMA type 5 inch control
217//   AM_RANGE(0xf9, 0xf9) DMA type 5 inch margin control
218//   AM_RANGE(0xfa, 0xfa) DMA type 5 inch FDC status
219//   AM_RANGE(0xfb, 0xfb) DMA type 5 inch FDC data register
220ADDRESS_MAP_END
221 
84222/* Input Ports */
85223 
86224static INPUT_PORTS_START( pc8001 )
r6308r6309
198336   PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Roll Up") PORT_CODE(KEYCODE_F8)         PORT_CHAR(UCHAR_MAMEKEY(PGUP))
199337   PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Roll Down") PORT_CODE(KEYCODE_F9)      PORT_CHAR(UCHAR_MAMEKEY(PGDN))
200338   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
339 
340   PORT_START("DSW1")
201341INPUT_PORTS_END
202342 
203343/* Video */
r6308r6309
225365{
226366}
227367 
368static WRITE_LINE_DEVICE_HANDLER( pc8001_upd3301_drq_w )
369{
370   pc8001_state *driver_state = device->machine->driver_data;
371 
372   dma8257_drq_w(driver_state->i8257, 2, state);
373}
374 
228375static UPD3301_INTERFACE( pc8001_upd3301_intf )
229376{
230377   SCREEN_TAG,
231378   pc8001_display_pixels,
232379   DEVCB_NULL,
380   DEVCB_LINE(pc8001_upd3301_drq_w),
233381   DEVCB_NULL,
234   DEVCB_NULL,
235382   DEVCB_NULL
236383};
237384 
385/* 8251 Interface */
386 
387static msm8251_interface pc8001_8251_intf = 
388{
389   NULL,
390   NULL,
391   NULL
392};
393 
238394/* 8255 Interface */
239395 
240396I8255A_INTERFACE( pc8001_8255_intf )
r6308r6309
286442   state->i8257 = devtag_get_device(machine, I8257_TAG);
287443   state->upd1990a = devtag_get_device(machine, UPD1990A_TAG);
288444   state->upd3301 = devtag_get_device(machine, UPD3301_TAG);
289   //state->speaker = devtag_get_device(machine, SPEAKER_TAG);
445   state->speaker = devtag_get_device(machine, SPEAKER_TAG);
290446   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
291447 
292448   /* find memory regions */
r6308r6309
368524   MDRV_VIDEO_UPDATE(pc8001)
369525 
370526   /* sound hardware */
527   MDRV_SPEAKER_STANDARD_MONO("mono")
528   MDRV_SOUND_ADD(SPEAKER_TAG, SPEAKER, 0)
529   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
371530 
372531   /* devices */
532   MDRV_MSM8251_ADD(I8251_TAG, pc8001_8251_intf)
373533   MDRV_I8255A_ADD(I8255A_TAG, pc8001_8255_intf)
374534   MDRV_DMA8257_ADD(I8257_TAG, 4000000, pc8001_8257_intf)
375535   MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, pc8001_upd1990a_intf)
r6308r6309
386546static MACHINE_DRIVER_START( pc8001mk2 )
387547   MDRV_IMPORT_FROM(pc8001)
388548 
549   MDRV_CPU_MODIFY(Z80_TAG)
550   MDRV_CPU_PROGRAM_MAP(pc8001mk2_mem)
551   MDRV_CPU_IO_MAP(pc8001mk2_io)
552 
389553   MDRV_RAM_MODIFY("messram")
390554   MDRV_RAM_DEFAULT_SIZE("64K")
391555MACHINE_DRIVER_END
r6308r6309
406570ROM_END
407571 
408572ROM_START( pc8001mk2 )
409   ROM_REGION( 0x10000, "maincpu", 0 )
573   ROM_REGION( 0x8000, "n80", 0 )
410574   ROM_LOAD( "n80_2.rom", 0x00000, 0x8000, CRC(03cce7b6) SHA1(c12d34e42021110930fed45a8af98db52136f1fb) )
411575 
412   ROM_REGION( 0x40000, "gfx1", 0)
576   ROM_REGION( 0x800, "chargen", 0)
413577   ROM_LOAD( "font.rom", 0x0000, 0x0800, CRC(56653188) SHA1(84b90f69671d4b72e8f219e1fe7cd667e976cf7f) )
578 
579   ROM_REGION( 0x20000, "kanji", 0)
414580ROM_END
415581 
416582/* System Drivers */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team