Previous 15994 Revisions Next

r9754 Thursday 9th December, 2010 at 12:07:11 UTC by Barry Rodewald
[PCW8xxx,9256] Preliminary printer emulation.
[src/mess]mess.mak
[src/mess/drivers]pcw.c
[src/mess/includes]pcw.h
[src/mess/layout]pcw.lay*
[src/mess/video]pcw.c

src/mess/video/pcw.c
r9753r9754
2121
2222VIDEO_START( pcw )
2323{
24   pcw_state *state = machine->driver_data<pcw_state>();
25   rectangle rect;
26   rect.min_x = rect.min_y = 0;
27   rect.max_x = PCW_PRINTER_WIDTH - 1;
28   rect.max_y = PCW_PRINTER_HEIGHT - 1;
29
30   state->prn_output = auto_bitmap_alloc(machine,PCW_PRINTER_WIDTH,PCW_PRINTER_HEIGHT,BITMAP_FORMAT_INDEXED16);
31   bitmap_fill(state->prn_output,&rect,1);
2432}
2533
2634/* two colours */
r9753r9754
5664   unsigned char *roller_ram_ptr;
5765   int pen0,pen1;
5866
59   pen0 = 0;
60   pen1 = 1;
61
62   /* invert? */
63   if (state->vdu_video_control_register & (1<<7))
67   if(screen == screen->machine->device("screen"))
6468   {
65      /* yes */
66      pen1^=1;
67      pen0^=1;
68   }
69      pen0 = 0;
70      pen1 = 1;
6971
70   /* video enable? */
71   if ((state->vdu_video_control_register & (1<<6))!=0)
72   {
73      rectangle rect;
72      /* invert? */
73       if (state->vdu_video_control_register & (1<<7))
74       {
75           /* yes */
76           pen1^=1;
77           pen0^=1;
78       }
7479
75      /* render top border */
76      rect.min_x = 0;
77      rect.min_y = 0;
78      rect.max_x = PCW_SCREEN_WIDTH;
79      rect.max_y = PCW_BORDER_HEIGHT;
80      bitmap_fill(bitmap, &rect, pen0);
80       /* video enable? */
81      if ((state->vdu_video_control_register & (1<<6))!=0)
82      {
83         rectangle rect;
8184
82      /* render bottom border */
83      rect.min_x = 0;
84      rect.min_y = PCW_BORDER_HEIGHT + PCW_DISPLAY_HEIGHT;
85      rect.max_x = PCW_SCREEN_WIDTH;
86      rect.max_y = rect.min_y + PCW_BORDER_HEIGHT;
87      bitmap_fill(bitmap, &rect, pen0);
85         /* render top border */
86         rect.min_x = 0;
87         rect.min_y = 0;
88         rect.max_x = PCW_SCREEN_WIDTH;
89         rect.max_y = PCW_BORDER_HEIGHT;
90         bitmap_fill(bitmap, &rect, pen0);
8891
89      /* yes */
92         /* render bottom border */
93         rect.min_x = 0;
94         rect.min_y = PCW_BORDER_HEIGHT + PCW_DISPLAY_HEIGHT;
95         rect.max_x = PCW_SCREEN_WIDTH;
96         rect.max_y = rect.min_y + PCW_BORDER_HEIGHT;
97         bitmap_fill(bitmap, &rect, pen0);
9098
91      /* offset to start in table */
92      roller_ram_offs = (state->roller_ram_offset<<1);
99         /* offset to start in table */
100         roller_ram_offs = (state->roller_ram_offset<<1);
93101
94      for (y=0; y<256; y++)
95      {
96         int by;
97         unsigned short line_data;
98         unsigned char *line_ptr;
102         for (y=0; y<256; y++)
103         {
104            int by;
105            unsigned short line_data;
106            unsigned char *line_ptr;
99107
100         x = PCW_BORDER_WIDTH;
108            x = PCW_BORDER_WIDTH;
101109
102         roller_ram_ptr = messram_get_ptr(screen->machine->device("messram")) + state->roller_ram_addr + roller_ram_offs;
110            roller_ram_ptr = messram_get_ptr(screen->machine->device("messram")) + state->roller_ram_addr + roller_ram_offs;
103111
104         /* get line address */
105         /* b16-14 control which bank the line is to be found in, b13-3 the address in the bank (in 16-byte units), and b2-0 the offset. Thus a roller RAM address bbbxxxxxxxxxxxyyy indicates bank bbb, address 00xxxxxxxxxxx0yyy. */
106         line_data = ((unsigned char *)roller_ram_ptr)[0] | (((unsigned char *)roller_ram_ptr)[1]<<8);
112            /* get line address */
113            /* b16-14 control which bank the line is to be found in, b13-3 the address in the bank (in 16-byte units), and b2-0 the offset. Thus a roller RAM address bbbxxxxxxxxxxxyyy indicates bank bbb, address 00xxxxxxxxxxx0yyy. */
114            line_data = ((unsigned char *)roller_ram_ptr)[0] | (((unsigned char *)roller_ram_ptr)[1]<<8);
107115
108         /* calculate address of pixel data */
109         line_ptr = messram_get_ptr(screen->machine->device("messram")) + ((line_data & 0x0e000)<<1) + ((line_data & 0x01ff8)<<1) + (line_data & 0x07);
116            /* calculate address of pixel data */
117            line_ptr = messram_get_ptr(screen->machine->device("messram")) + ((line_data & 0x0e000)<<1) + ((line_data & 0x01ff8)<<1) + (line_data & 0x07);
110118
111         for (by=0; by<90; by++)
112         {
113            unsigned char byte;
119            for (by=0; by<90; by++)
120            {
121               unsigned char byte;
114122
115            byte = line_ptr[0];
123               byte = line_ptr[0];
116124
117            for (b=0; b<8; b++)
118            {
119               if (byte & 0x080)
125               for (b=0; b<8; b++)
120126               {
121                  pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen1);
127                  if (byte & 0x080)
128                  {
129                     pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen1);
130                  }
131                  else
132                  {
133                     pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen0);
134
135                  }
136                  byte = byte<<1;
122137               }
123               else
124               {
125                  pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen0);
126138
127               }
128               byte = byte<<1;
139               x = x + 8;
140
141
142               line_ptr = line_ptr+8;
129143            }
130144
131            x = x + 8;
145            /* update offset, wrap within 512 byte range */
146            roller_ram_offs+=2;
147            roller_ram_offs&=511;
132148
133
134            line_ptr = line_ptr+8;
135149         }
136150
137         /* update offset, wrap within 512 byte range */
138         roller_ram_offs+=2;
139         roller_ram_offs&=511;
151         /* render border */
152         /* 8 pixels either side of display */
153         for (y=0; y<256; y++)
154         {
155            pcw_plot_pixel(bitmap, 0, y+PCW_BORDER_HEIGHT, pen0);
156            pcw_plot_pixel(bitmap, 1, y+PCW_BORDER_HEIGHT, pen0);
157            pcw_plot_pixel(bitmap, 2, y+PCW_BORDER_HEIGHT, pen0);
158            pcw_plot_pixel(bitmap, 3, y+PCW_BORDER_HEIGHT, pen0);
159            pcw_plot_pixel(bitmap, 4, y+PCW_BORDER_HEIGHT, pen0);
160            pcw_plot_pixel(bitmap, 5, y+PCW_BORDER_HEIGHT, pen0);
161            pcw_plot_pixel(bitmap, 6, y+PCW_BORDER_HEIGHT, pen0);
162            pcw_plot_pixel(bitmap, 7, y+PCW_BORDER_HEIGHT, pen0);
140163
164            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+0, y+PCW_BORDER_HEIGHT, pen0);
165            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+1, y+PCW_BORDER_HEIGHT, pen0);
166            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+2, y+PCW_BORDER_HEIGHT, pen0);
167            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+3, y+PCW_BORDER_HEIGHT, pen0);
168            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+4, y+PCW_BORDER_HEIGHT, pen0);
169            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+5, y+PCW_BORDER_HEIGHT, pen0);
170            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+6, y+PCW_BORDER_HEIGHT, pen0);
171            pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+7, y+PCW_BORDER_HEIGHT, pen0);
172         }
141173      }
142
143      /* render border */
144      /* 8 pixels either side of display */
145      for (y=0; y<256; y++)
174      else
146175      {
147         pcw_plot_pixel(bitmap, 0, y+PCW_BORDER_HEIGHT, pen0);
148         pcw_plot_pixel(bitmap, 1, y+PCW_BORDER_HEIGHT, pen0);
149         pcw_plot_pixel(bitmap, 2, y+PCW_BORDER_HEIGHT, pen0);
150         pcw_plot_pixel(bitmap, 3, y+PCW_BORDER_HEIGHT, pen0);
151         pcw_plot_pixel(bitmap, 4, y+PCW_BORDER_HEIGHT, pen0);
152         pcw_plot_pixel(bitmap, 5, y+PCW_BORDER_HEIGHT, pen0);
153         pcw_plot_pixel(bitmap, 6, y+PCW_BORDER_HEIGHT, pen0);
154         pcw_plot_pixel(bitmap, 7, y+PCW_BORDER_HEIGHT, pen0);
176         /* not video - render whole lot in pen 0 */
177         rectangle rect;
155178
156         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+0, y+PCW_BORDER_HEIGHT, pen0);
157         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+1, y+PCW_BORDER_HEIGHT, pen0);
158         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+2, y+PCW_BORDER_HEIGHT, pen0);
159         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+3, y+PCW_BORDER_HEIGHT, pen0);
160         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+4, y+PCW_BORDER_HEIGHT, pen0);
161         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+5, y+PCW_BORDER_HEIGHT, pen0);
162         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+6, y+PCW_BORDER_HEIGHT, pen0);
163         pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+7, y+PCW_BORDER_HEIGHT, pen0);
179         /* render top border */
180         rect.min_x = 0;
181         rect.min_y = 0;
182         rect.max_x = PCW_SCREEN_WIDTH;
183         rect.max_y = PCW_SCREEN_HEIGHT;
184
185         bitmap_fill(bitmap, &rect, pen0);
164186      }
165187   }
166188   else
167189   {
168      /* not video - render whole lot in pen 0 */
190      // printer output
169191      rectangle rect;
170
171      /* render top border */
172      rect.min_x = 0;
173      rect.min_y = 0;
174      rect.max_x = PCW_SCREEN_WIDTH;
175      rect.max_y = PCW_SCREEN_HEIGHT;
176
177      bitmap_fill(bitmap, &rect, pen0);
192      INT32 feed;
193      rect.min_x = rect.min_y = 0;
194      rect.max_x = PCW_PRINTER_WIDTH - 1;
195      rect.max_y = PCW_PRINTER_HEIGHT - 1;
196      feed = -(state->paper_feed / 2);
197      copyscrollbitmap(bitmap,state->prn_output,0,NULL,1,&feed,&rect);
198      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-1,state->printer_headpos) = 0;
199      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-2,state->printer_headpos) = 0;
200      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-3,state->printer_headpos) = 0;
201      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-1,state->printer_headpos-1) = 0;
202      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-2,state->printer_headpos-1) = 0;
203      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-1,state->printer_headpos+1) = 0;
204      *BITMAP_ADDR16(bitmap,PCW_PRINTER_HEIGHT-2,state->printer_headpos+1) = 0;
178205   }
179206   return 0;
180207}
src/mess/includes/pcw.h
r9753r9754
1616
1717#define PCW_SCREEN_WIDTH   (PCW_DISPLAY_WIDTH + (PCW_BORDER_WIDTH<<1))
1818#define PCW_SCREEN_HEIGHT   (PCW_DISPLAY_HEIGHT  + (PCW_BORDER_HEIGHT<<1))
19#define PCW_PRINTER_WIDTH   (40*16)
20#define PCW_PRINTER_HEIGHT   (20*16)
1921
2022
2123class pcw_state : public driver_device
r9753r9754
3537   UINT8 printer_command;
3638   UINT8 printer_data;
3739   UINT8 printer_status;
38   UINT8 printer_headpos;
40   INT16 printer_headpos;
3941   UINT16 kb_scan_row;
4042   UINT8 mcu_keyboard_data[16];
4143   UINT8 mcu_transmit_reset_seq;
r9753r9754
4648   unsigned int roller_ram_addr;
4749   unsigned short roller_ram_offset;
4850   unsigned char vdu_video_control_register;
51   UINT8 printer_serial;  // value if shift/store data pin
52   UINT8 printer_shift;  // state of shift register
53   UINT8 printer_shift_output;  // output presented to the paper feed motor and print head motor
54   UINT8 head_motor_state;
55   UINT8 linefeed_motor_state;
56   UINT16 printer_pins;
57   UINT8 printer_p2;  // MCU port P2 state
58   UINT8 paper_feed;  // amount of paper fed through printer, by n/360 inches.  One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu)
59   bitmap_t* prn_output;
4960};
5061
5162
src/mess/layout/pcw.lay
r0r9754
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <view name="Monitor only">
4      <screen index="0">
5         <bounds left="0" top="0" right="4" bottom="3" />
6      </screen>
7   </view>
8
9   <view name="Printer only">
10      <screen index="1">
11         <bounds left="0" top="0" right="1" bottom="1" />
12      </screen>
13   </view>
14
15   <view name="Both Monitor and Printer">
16      <screen index="0">
17         <bounds left="0" top="20" right="40" bottom="50" />
18      </screen>
19      <screen index="1">
20         <bounds left="10" top="0" right="30" bottom="20" />
21      </screen>
22   </view>
23</mamelayout>
src/mess/mess.mak
r9753r9754
18421842$(MESS_DRIVERS)/ng_aes.o:   $(MESS_LAYOUT)/neogeo.lh
18431843$(MESS_DRIVERS)/poly880.o:   $(MESS_LAYOUT)/poly880.lh
18441844$(MESS_VIDEO)/pc8401a.o:   $(MESS_LAYOUT)/pc8500.lh
1845$(MESS_DRIVERS)/pcw.o:      $(MESS_LAYOUT)/pcw.lh
18451846$(MESS_DRIVERS)/pro80.o:   $(MESS_LAYOUT)/pro80.lh
18461847$(MESS_DRIVERS)/px4.o:      $(MESS_LAYOUT)/px4.lh
18471848$(MESS_DRIVERS)/px8.o:      $(MESS_LAYOUT)/px8.lh
src/mess/drivers/pcw.c
r9753r9754
105105#include "sound/beep.h"
106106#include "devices/messram.h"
107107
108#include "pcw.lh"
109
108110#define VERBOSE 1
109111#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
110112
113static const UINT8 half_step_table[4] = { 0x01, 0x02, 0x04, 0x08 };
114static const UINT8 full_step_table[4] = { 0x03, 0x06, 0x0c, 0x09 };
115
111116static WRITE_LINE_DEVICE_HANDLER( pcw_fdc_interrupt );
112117
113// pointer to pcw ram
114// flag to indicate if boot-program is enabled/disabled
115// code for CPU int type generated when FDC int is triggered
116
117
118
119
120
121
122118static void pcw_update_interrupt_counter(pcw_state *state)
123119{
124120   /* never increments past 15! */
r9753r9754
669665}
670666
671667/* TODO: Implement the printer for PCW8256, PCW8512,PCW9256*/
668static void pcw_printer_fire_pins(running_machine* machine, UINT16 pins)
669{
670   pcw_state *state = machine->driver_data<pcw_state>();
671   int x,line;
672   INT32 feed = (state->paper_feed / 2);
673
674   for(x=feed+PCW_PRINTER_HEIGHT-16;x<feed+PCW_PRINTER_HEIGHT-7;x++)
675   {
676      line = x % PCW_PRINTER_HEIGHT;
677      if((pins & 0x01) == 0)
678         *BITMAP_ADDR16(state->prn_output,line,state->printer_headpos) = (UINT16)(pins & 0x01);
679      pins >>= 1;
680   }
681//   if(state->printer_headpos < PCW_PRINTER_WIDTH)
682//      state->printer_headpos++;
683}
684
672685static WRITE8_HANDLER(pcw_printer_data_w)
673686{
674687   pcw_state *state = space->machine->driver_data<pcw_state>();
r9753r9754
712725}
713726
714727/* MCU handlers */
728/* I/O ports: (likely to be completely wrong...)
729 * (write)
730 * all are active low
731 * P1: pins 0-7
732 * P2 bit 0: pin 8
733 * P2 bit 1: serial shift/store clock
734 * P2 bit 2: serial shift store data
735 * P2 bit 3: serial shift/store strobe
736 * P2 bit 4: print head motor
737 * P2 bit 5: paper feed motor
738 * P2 bit 6: fire pins
739 * (read)
740 * P2 bit 7: bail bar status (0 if out)
741 * T0: Paper sensor (?)
742 * T1: Print head location (1 if not at left margin)
743 */
715744static READ8_HANDLER(mcu_printer_p1_r)
716745{
746   pcw_state *state = space->machine->driver_data<pcw_state>();
717747//   logerror("PRN: MCU reading data from P1\n");
718   return 0x00;
748   return state->printer_pins & 0x00ff;
719749}
720750
721751static WRITE8_HANDLER(mcu_printer_p1_w)
722752{
723   logerror("PRN: MCU writing %02x to P1\n",data);
753   pcw_state *state = space->machine->driver_data<pcw_state>();
754   state->printer_pins = (state->printer_pins & 0x0100) | data;
755   //popmessage("PRN: Print head position = %i",state->printer_headpos);
756   logerror("PRN: MCU writing %02x to P1 [%03x]\n",data,state->printer_pins);
724757}
725758
726759static READ8_HANDLER(mcu_printer_p2_r)
727760{
728761   UINT8 ret = 0x00;
762   pcw_state *state = space->machine->driver_data<pcw_state>();
729763//   logerror("PRN: MCU reading data from P2\n");
730   ret |= 0x80;
764   ret |= 0x80;  // make sure bail bar is in
765   ret |= (state->printer_p2 & 0x70);
766   ret |= (state->printer_pins & 0x100) ? 0x01 : 0x00;  // ninth pin
767   ret |= 0x0e;
731768   return ret;
732769}
733770
734771static WRITE8_HANDLER(mcu_printer_p2_w)
735772{
736773   pcw_state *state = space->machine->driver_data<pcw_state>();
737//   logerror("PRN: MCU writing %02x to P2\n",data);
738   if((data & 0x20) == 0)
739      state->printer_headpos = 1;  // move head
740   if((data & 0x10) == 0)
741      state->printer_headpos = 0;
774   static UINT8 prev;
775
776   //logerror("PRN: MCU writing %02x to P2\n",data);
777   state->printer_p2 = data & 0x70;
778
779   if((data & 0x40) == 0 && (prev & 0x40) != 0)
780      pcw_printer_fire_pins(space->machine,state->printer_pins);
781
782   // handle shift/store
783   state->printer_serial = data & 0x04;  // data
784   if((data & 0x02) != 0)  // clock
785   {
786      state->printer_shift <<= 1;
787      if(state->printer_serial == 0)
788         state->printer_shift &= ~0x01;
789      else
790         state->printer_shift |= 0x01;
791   }
792   if((data & 0x08) != 0)  // strobe
793   {
794      state->printer_shift_output = state->printer_shift;
795      if((state->printer_p2 & 0x10) == 0)  // print head motor active
796      {
797         UINT8 stepper_state = (state->printer_shift_output >> 4) & 0x0f;
798         if(stepper_state == full_step_table[(state->head_motor_state + 1) & 0x03])
799         {
800            state->printer_headpos += 2;
801            state->head_motor_state++;
802         }
803         if(stepper_state == half_step_table[(state->head_motor_state + 1) & 0x03])
804         {
805            state->printer_headpos += 1;
806            state->head_motor_state++;
807         }
808         if(stepper_state == full_step_table[(state->head_motor_state - 1) & 0x03])
809         {
810            state->printer_headpos -= 2;
811            state->head_motor_state--;
812         }
813         if(stepper_state == half_step_table[(state->head_motor_state - 1) & 0x03])
814         {
815            state->printer_headpos -= 1;
816            state->head_motor_state--;
817         }
818         if(state->printer_headpos < 0)
819            state->printer_headpos = 0;
820         if(state->printer_headpos > PCW_PRINTER_WIDTH)
821            state->printer_headpos = PCW_PRINTER_WIDTH;
822         state->head_motor_state &= 0x03;
823      }
824      if((state->printer_p2 & 0x20) == 0)  // line feed motor active
825      {
826         UINT8 stepper_state = state->printer_shift_output & 0x0f;
827         if(stepper_state == full_step_table[(state->linefeed_motor_state + 1) & 0x03])
828         {
829            state->paper_feed++;
830            state->linefeed_motor_state++;
831         }
832         if(stepper_state == half_step_table[(state->linefeed_motor_state + 1) & 0x03])
833         {
834            state->paper_feed++;
835            state->linefeed_motor_state++;
836         }
837         state->linefeed_motor_state &= 0x03;
838      }
839   }
840   if(data & 0x01)
841      state->printer_pins |= 0x0100;
842   else
843      state->printer_pins &= ~0x0100;
844   prev = data;
845   //popmessage("PRN: P2 bits %s %s %s\nSerial: %02x\nHeadpos: %i",data & 0x40 ? " " : "6",data & 0x20 ? " " : "5",data & 0x10 ? " " : "4",state->printer_shift_output,state->printer_headpos);
742846}
743847
744// Paper sensor?
848// Paper sensor
745849static READ8_HANDLER(mcu_printer_t1_r)
746850{
747851   return 1;
748852}
749853
750// Print head location? (0 if at left margin, otherwise 1)
854// Print head location (0 if at left margin, otherwise 1)
751855static READ8_HANDLER(mcu_printer_t0_r)
752856{
753857   pcw_state *state = space->machine->driver_data<pcw_state>();
754   return state->printer_headpos;
858
859   if(state->printer_headpos == 0)
860      return 0;
861   else
862      return 1;
755863}
756864
757865/*
r9753r9754
9671075   state->printer_command = 0xff;
9681076   state->printer_data = 0x00;
9691077   state->printer_headpos = 0x00; // bring printer head to left margin
1078   state->printer_shift = 0;
1079   state->printer_shift_output = 0;
9701080}
9711081
9721082static DRIVER_INIT(pcw)
r9753r9754
11961306/* PCW8256, PCW8512, PCW9256 */
11971307static MACHINE_CONFIG_START( pcw, pcw_state )
11981308   /* basic machine hardware */
1199   MDRV_CPU_ADD("maincpu", Z80, 4000000)       /* clock supplied to chip, but in reality it is 3.4 MHz */
1309   MDRV_CPU_ADD("maincpu", Z80, 3400000)       /* clock supplied to chip, but in reality it is 3.4 MHz */
12001310   MDRV_CPU_PROGRAM_MAP(pcw_map)
12011311   MDRV_CPU_IO_MAP(pcw_io)
1202   MDRV_QUANTUM_TIME(HZ(50))
1312//   MDRV_QUANTUM_TIME(HZ(50))
1313   MDRV_QUANTUM_PERFECT_CPU("maincpu")
12031314
12041315   MDRV_CPU_ADD("printer_mcu", I8041, 11000000)  // 11MHz
12051316   MDRV_CPU_IO_MAP(pcw_printer_io)
1317   MDRV_QUANTUM_PERFECT_CPU("printer_mcu")
12061318
12071319   MDRV_CPU_ADD("keyboard_mcu", I8048, 5000000) // 5MHz
12081320   MDRV_CPU_IO_MAP(pcw_keyboard_io)
1321   MDRV_QUANTUM_PERFECT_CPU("keyboard_mcu")
12091322
12101323   MDRV_MACHINE_START(pcw)
12111324   MDRV_MACHINE_RESET(pcw)
r9753r9754
12371350   MDRV_RAM_DEFAULT_SIZE("256K")
12381351MACHINE_CONFIG_END
12391352
1240static MACHINE_CONFIG_DERIVED( pcw_512, pcw )
1353static MACHINE_CONFIG_DERIVED( pcw8256, pcw )
1354   MDRV_SCREEN_ADD("printer",RASTER)
1355   MDRV_SCREEN_REFRESH_RATE(50)
1356   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1357   MDRV_SCREEN_SIZE( PCW_PRINTER_WIDTH, PCW_PRINTER_HEIGHT )
1358   MDRV_SCREEN_VISIBLE_AREA(0, PCW_PRINTER_WIDTH-1, 0, PCW_PRINTER_HEIGHT-1)
12411359
1360   MDRV_DEFAULT_LAYOUT( layout_pcw )
1361MACHINE_CONFIG_END
1362
1363static MACHINE_CONFIG_DERIVED( pcw8512, pcw )
1364   MDRV_SCREEN_ADD("printer",RASTER)
1365   MDRV_SCREEN_REFRESH_RATE(50)
1366   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1367   MDRV_SCREEN_SIZE( PCW_PRINTER_WIDTH, PCW_PRINTER_HEIGHT )
1368   MDRV_SCREEN_VISIBLE_AREA(0, PCW_PRINTER_WIDTH-1, 0, PCW_PRINTER_HEIGHT-1)
1369
1370   MDRV_DEFAULT_LAYOUT( layout_pcw )
1371
12421372   /* internal ram */
12431373   MDRV_RAM_MODIFY("messram")
12441374   MDRV_RAM_DEFAULT_SIZE("512K")
r9753r9754
12641394ROM_START(pcw8256)
12651395   ROM_REGION(0x10000,"maincpu",0)
12661396   ROM_FILL(0x0000,0x10000,0x00)                                 \
1267   ROM_REGION(0x400,"printer_mcu",0)  // i8041
1397   ROM_REGION(0x400,"printer_mcu",0)  // i8041 9-pin dot-matrix
12681398   ROM_LOAD("40026.ic701", 0, 0x400, CRC(ee8890ae) SHA1(91679cc5e07464ac55ef9a10f7095b2438223332))
12691399   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
12701400   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
r9753r9754
12731403ROM_START(pcw8512)
12741404   ROM_REGION(0x10000,"maincpu",0)
12751405   ROM_FILL(0x0000,0x10000,0x00)                                 \
1276   ROM_REGION(0x400,"printer_mcu",0)  // i8041
1406   ROM_REGION(0x400,"printer_mcu",0)  // i8041 9-pin dot-matrix
12771407   ROM_LOAD("40026.ic701", 0, 0x400, CRC(ee8890ae) SHA1(91679cc5e07464ac55ef9a10f7095b2438223332))
12781408   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
12791409   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
r9753r9754
12821412ROM_START(pcw9256)
12831413   ROM_REGION(0x10000,"maincpu",0)
12841414   ROM_FILL(0x0000,0x10000,0x00)                                 \
1285   ROM_REGION(0x2000,"printer_mcu",0) // i8041
1286   ROM_LOAD("40103.ic109", 0, 0x2000, CRC(a64d450a) SHA1(ebbf0ef19d39912c1c127c748514dd299915f88b))
1415   ROM_REGION(0x2000,"printer_mcu",0) // i8041 9-pin dot-matrix (does this model have different MCU code?)
1416   ROM_LOAD("40026.ic701", 0, 0x400, CRC(ee8890ae) SHA1(91679cc5e07464ac55ef9a10f7095b2438223332))
12871417   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
12881418   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
12891419ROM_END
r9753r9754
12911421ROM_START(pcw9512)
12921422   ROM_REGION(0x10000,"maincpu",0)
12931423   ROM_FILL(0x0000,0x10000,0x00)                                 \
1294   ROM_REGION(0x2000,"printer_mcu",0) // i8041
1424   ROM_REGION(0x2000,"printer_mcu",0) // i8041 daisywheel
12951425   ROM_LOAD("40103.ic109", 0, 0x2000, CRC(a64d450a) SHA1(ebbf0ef19d39912c1c127c748514dd299915f88b))
12961426   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
12971427   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
r9753r9754
13001430ROM_START(pcw10)
13011431   ROM_REGION(0x10000,"maincpu",0)
13021432   ROM_FILL(0x0000,0x10000,0x00)                                 \
1303   ROM_REGION(0x2000,"printer_mcu",0) // i8041
1433   ROM_REGION(0x2000,"printer_mcu",0) // i8041 daisywheel
13041434   ROM_LOAD("40103.ic109", 0, 0x2000, CRC(a64d450a) SHA1(ebbf0ef19d39912c1c127c748514dd299915f88b))
13051435   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
13061436   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
r9753r9754
13101440/* these are all variants on the pcw design */
13111441/* major difference is memory configuration and drive type */
13121442/*     YEAR NAME        PARENT  COMPAT  MACHINE   INPUT INIT    COMPANY        FULLNAME */
1313COMP( 1985, pcw8256,   0,      0,      pcw,     pcw,   pcw,   "Amstrad plc", "PCW8256",      GAME_NOT_WORKING)
1314COMP( 1985, pcw8512,   pcw8256,   0,      pcw_512,  pcw,   pcw,   "Amstrad plc", "PCW8512",      GAME_NOT_WORKING)
1315COMP( 1987, pcw9256,   pcw8256,   0,      pcw,     pcw,   pcw,      "Amstrad plc", "PCW9256",      GAME_NOT_WORKING)
1443COMP( 1985, pcw8256,   0,      0,      pcw8256,  pcw,   pcw,   "Amstrad plc", "PCW8256",      GAME_NOT_WORKING)
1444COMP( 1985, pcw8512,   pcw8256,   0,      pcw8512,  pcw,   pcw,   "Amstrad plc", "PCW8512",      GAME_NOT_WORKING)
1445COMP( 1987, pcw9256,   pcw8256,   0,      pcw8256,  pcw,   pcw,      "Amstrad plc", "PCW9256",      GAME_NOT_WORKING)
13161446COMP( 1987, pcw9512,   pcw8256,   0,      pcw9512,  pcw,   pcw,      "Amstrad plc", "PCW9512 (+)",   GAME_NOT_WORKING)
13171447COMP( 1993, pcw10,      pcw8256,   0,      pcw9512,  pcw,   pcw,      "Amstrad plc", "PCW10",         GAME_NOT_WORKING)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team