Previous 15994 Revisions Next

r9809 Wednesday 22nd December, 2010 at 03:00:22 UTC by Barry Rodewald
[PCW] Increased the length of time the timer IRQ is high, this should stop the printer MCU generating underflow errors.
[src/mess/drivers]pcw.c

src/mess/drivers/pcw.c
r9808r9809
177177
178178   state->timer_irq_flag = 1;
179179   pcw_update_irqs(machine);
180   timer_set(machine,ATTOTIME_IN_USEC(2),NULL,0,pcw_timer_pulse);
180   timer_set(machine,ATTOTIME_IN_USEC(100),NULL,0,pcw_timer_pulse);
181181}
182182
183183/* fdc interrupt callback. set/clear fdc int */
r9808r9809
383383   state->banks[offset] = data;
384384
385385   pcw_update_mem(space->machine, offset, data);
386   //popmessage("RAM Banks: %02x %02x %02x %02x",state->banks[0],state->banks[1],state->banks[2],state->banks[3]);
386//   popmessage("RAM Banks: %02x %02x %02x %02x",state->banks[0],state->banks[1],state->banks[2],state->banks[3]);
387387}
388388
389389static WRITE8_HANDLER(pcw_bank_force_selection_w)
r9808r9809
664664   }
665665}
666666
667/* TODO: Implement the printer for PCW8256, PCW8512,PCW9256*/
668667static void pcw_printer_fire_pins(running_machine* machine, UINT16 pins)
669668{
670669   pcw_state *state = machine->driver_data<pcw_state>();
r9808r9809
713712// printer status
714713// bit 7 - bail bar in
715714// bit 6 - not currently executing a command
716// bit 5 - always 0 for dot matrix printer (PCW8256/8512), 1 if a daisywheel printer(PCW9512)
715// bit 5 - printer RAM is full
717716// bit 4 - print head is not at left margin
718717// bit 3 - sheet feeder is present
719718// bit 2 - paper is present
r9808r9809
753752   pcw_state *state = space->machine->driver_data<pcw_state>();
754753   state->printer_pins = (state->printer_pins & 0x0100) | data;
755754   //popmessage("PRN: Print head position = %i",state->printer_headpos);
756   logerror("PRN: MCU writing %02x to P1 [%03x]\n",data,state->printer_pins);
755   logerror("PRN: MCU writing %02x to P1 [%03x/%03x]\n",data,state->printer_pins,~state->printer_pins & 0x1ff);
757756}
758757
759758static READ8_HANDLER(mcu_printer_p2_r)
r9808r9809
790789   }
791790   if((data & 0x08) != 0)  // strobe
792791   {
792      logerror("Strobe active [%02x]\n",state->printer_shift);
793793      state->printer_shift_output = state->printer_shift;
794794      if((state->printer_p2 & 0x10) == 0)  // print head motor active
795795      {
r9808r9809
798798         {
799799            state->printer_headpos += 2;
800800            state->head_motor_state++;
801            logerror("Printer head moved forward by 2 to %i\n",state->printer_headpos);
801802         }
802803         if(stepper_state == half_step_table[(state->head_motor_state + 1) & 0x03])
803804         {
804805            state->printer_headpos += 1;
805806            state->head_motor_state++;
807            logerror("Printer head moved forward by 1 to %i\n",state->printer_headpos);
806808         }
807809         if(stepper_state == full_step_table[(state->head_motor_state - 1) & 0x03])
808810         {
809811            state->printer_headpos -= 2;
810812            state->head_motor_state--;
813            logerror("Printer head moved back by 2 to %i\n",state->printer_headpos);
811814         }
812815         if(stepper_state == half_step_table[(state->head_motor_state - 1) & 0x03])
813816         {
814817            state->printer_headpos -= 1;
815818            state->head_motor_state--;
819            logerror("Printer head moved back by 1 to %i\n",state->printer_headpos);
816820         }
817821         if(state->printer_headpos < 0)
818822            state->printer_headpos = 0;
r9808r9809
826830         if(stepper_state == full_step_table[(state->linefeed_motor_state + 1) & 0x03])
827831         {
828832            state->paper_feed++;
833            if(state->paper_feed > PCW_PRINTER_HEIGHT*2)
834               state->paper_feed = 0;
829835            state->linefeed_motor_state++;
830836         }
831837         if(stepper_state == half_step_table[(state->linefeed_motor_state + 1) & 0x03])
832838         {
833839            state->paper_feed++;
840            if(state->paper_feed > PCW_PRINTER_HEIGHT*2)
841               state->paper_feed = 0;
834842            state->linefeed_motor_state++;
835843         }
836844         state->linefeed_motor_state &= 0x03;
r9808r9809
13051313/* PCW8256, PCW8512, PCW9256 */
13061314static MACHINE_CONFIG_START( pcw, pcw_state )
13071315   /* basic machine hardware */
1308   MDRV_CPU_ADD("maincpu", Z80, 3400000)       /* clock supplied to chip, but in reality it is 3.4 MHz */
1316   MDRV_CPU_ADD("maincpu", Z80, 4000000)       /* clock supplied to chip, but in reality it is 3.4 MHz */
13091317   MDRV_CPU_PROGRAM_MAP(pcw_map)
13101318   MDRV_CPU_IO_MAP(pcw_io)
1311//   MDRV_QUANTUM_TIME(HZ(50))
1312   MDRV_QUANTUM_PERFECT_CPU("maincpu")
13131319
13141320   MDRV_CPU_ADD("printer_mcu", I8041, 11000000)  // 11MHz
13151321   MDRV_CPU_IO_MAP(pcw_printer_io)
1316   MDRV_QUANTUM_PERFECT_CPU("printer_mcu")
13171322
13181323   MDRV_CPU_ADD("keyboard_mcu", I8048, 5000000) // 5MHz
13191324   MDRV_CPU_IO_MAP(pcw_keyboard_io)
1320   MDRV_QUANTUM_PERFECT_CPU("keyboard_mcu")
13211325
1326//   MDRV_QUANTUM_TIME(HZ(50))
1327   MDRV_QUANTUM_PERFECT_CPU("maincpu")
1328
13221329   MDRV_MACHINE_START(pcw)
13231330   MDRV_MACHINE_RESET(pcw)
13241331
r9808r9809
14111418ROM_START(pcw9256)
14121419   ROM_REGION(0x10000,"maincpu",0)
14131420   ROM_FILL(0x0000,0x10000,0x00)                                 \
1414   ROM_REGION(0x2000,"printer_mcu",0) // i8041 9-pin dot-matrix (does this model have different MCU code?)
1421   ROM_REGION(0x2000,"printer_mcu",0) // i8041 9-pin dot-matrix
14151422   ROM_LOAD("40026.ic701", 0, 0x400, CRC(ee8890ae) SHA1(91679cc5e07464ac55ef9a10f7095b2438223332))
14161423   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
14171424   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))
r9808r9809
14201427ROM_START(pcw9512)
14211428   ROM_REGION(0x10000,"maincpu",0)
14221429   ROM_FILL(0x0000,0x10000,0x00)                                 \
1423   ROM_REGION(0x2000,"printer_mcu",0) // i8041 daisywheel
1430   ROM_REGION(0x2000,"printer_mcu",0) // i8041 daisywheel (schematics say i8039?)
14241431   ROM_LOAD("40103.ic109", 0, 0x2000, CRC(a64d450a) SHA1(ebbf0ef19d39912c1c127c748514dd299915f88b))
14251432   ROM_REGION(0x400,"keyboard_mcu",0) // i8048
14261433   ROM_LOAD("40027.ic801", 0, 0x400, CRC(25260958) SHA1(210e7e25228c79d2920679f217d68e4f14055825))

Previous 15994 Revisions Next


© 1998-2018 The MESS Team