Previous 15994 Revisions Next

r14569 Wednesday 22nd February, 2012 at 07:40:18 UTC by Olivier Galibert
fprintf(stderr) -> logerror (nw)
[src/mess/drivers]next.c
[src/mess/machine]n82077aa.c ncr5390.c nextmo.c

src/mess/machine/ncr5390.c
r14568r14569
521521
522522READ8_MEMBER(ncr5390_device::tcount_lo_r)
523523{
524   fprintf(stderr, "%s: tcount_lo_r %02x (%08x)\n", tag(), tcount & 0xff, cpu_get_pc(&space.device()));
524   logerror("%s: tcount_lo_r %02x (%08x)\n", tag(), tcount & 0xff, cpu_get_pc(&space.device()));
525525   return tcount;
526526}
527527
r14568r14569
529529{
530530   tcount = (tcount & 0xff00) | data;
531531   status &= ~S_TC0;
532   fprintf(stderr, "%s: tcount_lo_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
532   logerror("%s: tcount_lo_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
533533}
534534
535535READ8_MEMBER(ncr5390_device::tcount_hi_r)
536536{
537   fprintf(stderr, "%s: tcount_hi_r %02x (%08x)\n", tag(), tcount >> 8, cpu_get_pc(&space.device()));
537   logerror("%s: tcount_hi_r %02x (%08x)\n", tag(), tcount >> 8, cpu_get_pc(&space.device()));
538538   return tcount >> 8;
539539}
540540
r14568r14569
542542{
543543   tcount = (tcount & 0x00ff) | (data << 8);
544544   status &= ~S_TC0;
545   fprintf(stderr, "%s: tcount_hi_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
545   logerror("%s: tcount_hi_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
546546}
547547
548548UINT8 ncr5390_device::fifo_pop()
r14568r14569
580580
581581READ8_MEMBER(ncr5390_device::command_r)
582582{
583   fprintf(stderr, "%s: command_r (%08x)\n", tag(), cpu_get_pc(&space.device()));
583   logerror("%s: command_r (%08x)\n", tag(), cpu_get_pc(&space.device()));
584584   return command[0];
585585}
586586
587587WRITE8_MEMBER(ncr5390_device::command_w)
588588{
589   //  fprintf(stderr, "%s: command_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
589   //   logerror("%s: command_w %02x (%08x)\n", tag(), data, cpu_get_pc(&space.device()));
590590   if(command_pos == 2) {
591591      status |= S_GROSS_ERROR;
592592      check_irq();
r14568r14569
771771{
772772   UINT32 ctrl = scsi_bus->ctrl_r();
773773   UINT8 res = status | (ctrl & S_MSG ? 4 : 0) | (ctrl & S_CTL ? 2 : 0) | (ctrl & S_INP ? 1 : 0);
774   fprintf(stderr, "%s: status_r %02x (%08x)\n", tag(), res, cpu_get_pc(&space.device()));
774   logerror("%s: status_r %02x (%08x)\n", tag(), res, cpu_get_pc(&space.device()));
775775   if(irq)
776776      status &= ~(S_GROSS_ERROR|S_PARITY|S_TCC);
777777   return res;
r14568r14569
792792   if(res)
793793      command_pop_and_chain();
794794
795   fprintf(stderr, "%s: istatus_r %02x (%08x)\n", tag(), res, cpu_get_pc(&space.device()));
795   logerror("%s: istatus_r %02x (%08x)\n", tag(), res, cpu_get_pc(&space.device()));
796796   return res;
797797}
798798
r14568r14569
803803
804804READ8_MEMBER(ncr5390_device::seq_step_r)
805805{
806   fprintf(stderr, "%s: seq_step_r %d (%08x)\n", tag(), seq, cpu_get_pc(&space.device()));
806   logerror("%s: seq_step_r %d (%08x)\n", tag(), seq, cpu_get_pc(&space.device()));
807807   return seq;
808808}
809809
src/mess/machine/n82077aa.c
r14568r14569
231231void n82077aa_device::fifo_push(UINT8 data)
232232{
233233   if(fifo_pos == 16) {
234      fprintf(stderr, "Overflow\n");
234      logerror("%s: Overflow\n", tag());
235235      return;
236236   }
237237   fifo[fifo_pos++] = data;
src/mess/machine/nextmo.c
r14568r14569
3838
3939READ8_MEMBER(nextmo_device::r4_r)
4040{
41   fprintf(stderr, "nextmo: r4_r %02x (%08x)\n", r4, cpu_get_pc(&space.device()));
41   logerror("nextmo: r4_r %02x (%08x)\n", r4, cpu_get_pc(&space.device()));
4242   return r4;
4343}
4444
r14568r14569
4747   if(r4 & 1)
4848      device_reset();
4949   r4 = (r4 & (~data & 0xfc)) | (data & 3);
50   fprintf(stderr, "nextmo: r4_w %02x (%08x)\n", r4, cpu_get_pc(&space.device()));
50   logerror("nextmo: r4_w %02x (%08x)\n", r4, cpu_get_pc(&space.device()));
5151}
5252
5353READ8_MEMBER(nextmo_device::r5_r)
5454{
55   fprintf(stderr, "nextmo: r5_r %02x (%08x)\n", r5, cpu_get_pc(&space.device()));
55   logerror("nextmo: r5_r %02x (%08x)\n", r5, cpu_get_pc(&space.device()));
5656   return r5;
5757}
5858
5959WRITE8_MEMBER(nextmo_device::r5_w)
6060{
6161   r5 = data;
62   fprintf(stderr, "nextmo: r5_w %02x (%08x)\n", r5, cpu_get_pc(&space.device()));
62   logerror("nextmo: r5_w %02x (%08x)\n", r5, cpu_get_pc(&space.device()));
6363}
6464
6565READ8_MEMBER(nextmo_device::r6_r)
6666{
67   fprintf(stderr, "nextmo: r6_r %02x (%08x)\n", r6, cpu_get_pc(&space.device()));
67   logerror("nextmo: r6_r %02x (%08x)\n", r6, cpu_get_pc(&space.device()));
6868   return r6;
6969}
7070
7171WRITE8_MEMBER(nextmo_device::r6_w)
7272{
7373   r6 = data;
74   fprintf(stderr, "nextmo: r6_w %02x (%08x)\n", r6, cpu_get_pc(&space.device()));
74   logerror("nextmo: r6_w %02x (%08x)\n", r6, cpu_get_pc(&space.device()));
7575}
7676
7777READ8_MEMBER(nextmo_device::r7_r)
7878{
79   fprintf(stderr, "nextmo: r7_r %02x (%08x)\n", r7, cpu_get_pc(&space.device()));
79   logerror("nextmo: r7_r %02x (%08x)\n", r7, cpu_get_pc(&space.device()));
8080   return r7;
8181}
8282
8383WRITE8_MEMBER(nextmo_device::r7_w)
8484{
8585   r7 = data;
86   fprintf(stderr, "nextmo: r7_w %02x (%08x)\n", r7, cpu_get_pc(&space.device()));
86   logerror("nextmo: r7_w %02x (%08x)\n", r7, cpu_get_pc(&space.device()));
8787   if(r7 & 0xc0) {
88      fprintf(stderr, "nextmo: start dma %02x %02x\n", r6, r7);
88      logerror("nextmo: start dma %02x %02x\n", r6, r7);
8989      sector_pos = 0;
9090      if(!drq_cb.isnull())
9191         drq_cb(true);
r14568r14569
131131
132132READ8_MEMBER(nextmo_device::r8_r)
133133{
134   fprintf(stderr, "nextmo: r8_r (%08x)\n", cpu_get_pc(&space.device()));
134   logerror("nextmo: r8_r (%08x)\n", cpu_get_pc(&space.device()));
135135   return 0x00;
136136}
137137
138138WRITE8_MEMBER(nextmo_device::r8_w)
139139{
140   fprintf(stderr, "nextmo: r8_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
140   logerror("nextmo: r8_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
141141}
142142
143143READ8_MEMBER(nextmo_device::r9_r)
144144{
145   fprintf(stderr, "nextmo: r9_r (%08x)\n", cpu_get_pc(&space.device()));
145   logerror("nextmo: r9_r (%08x)\n", cpu_get_pc(&space.device()));
146146   return 0x00;
147147}
148148
149149WRITE8_MEMBER(nextmo_device::r9_w)
150150{
151   fprintf(stderr, "nextmo: r9_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
151   logerror("nextmo: r9_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
152152}
153153
154154READ8_MEMBER(nextmo_device::ra_r)
155155{
156   fprintf(stderr, "nextmo: ra_r (%08x)\n", cpu_get_pc(&space.device()));
156   logerror("nextmo: ra_r (%08x)\n", cpu_get_pc(&space.device()));
157157   return 0x00;
158158}
159159
160160WRITE8_MEMBER(nextmo_device::ra_w)
161161{
162   fprintf(stderr, "nextmo: ra_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
162   logerror("nextmo: ra_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
163163}
164164
165165READ8_MEMBER(nextmo_device::rb_r)
166166{
167   fprintf(stderr, "nextmo: rb_r (%08x)\n", cpu_get_pc(&space.device()));
167   logerror("nextmo: rb_r (%08x)\n", cpu_get_pc(&space.device()));
168168   return 0x24;
169169}
170170
171171WRITE8_MEMBER(nextmo_device::rb_w)
172172{
173   fprintf(stderr, "nextmo: rb_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
173   logerror("nextmo: rb_w %02x (%08x)\n", data, cpu_get_pc(&space.device()));
174174}
175175
176176READ8_MEMBER(nextmo_device::r10_r)
177177{
178   fprintf(stderr, "nextmo: r10_r %d (%08x)\n", offset, cpu_get_pc(&space.device()));
178   logerror("nextmo: r10_r %d (%08x)\n", offset, cpu_get_pc(&space.device()));
179179   return 0x00;
180180}
181181
182182WRITE8_MEMBER(nextmo_device::r10_w)
183183{
184   fprintf(stderr, "nextmo: r10_w %d, %02x (%08x)\n", offset, data, cpu_get_pc(&space.device()));
184   logerror("nextmo: r10_w %d, %02x (%08x)\n", offset, data, cpu_get_pc(&space.device()));
185185}
186186
187187void nextmo_device::check_ecc()
188188{
189   fprintf(stderr, "nextmo: check_ecc\n");
189   logerror("nextmo: check_ecc\n");
190190   for(int i=0; i<0x400; i++)
191191      sector[i] = i;
192192}
193193
194194void nextmo_device::compute_ecc()
195195{
196   fprintf(stderr, "nextmo: compute_ecc\n");
196   logerror("nextmo: compute_ecc\n");
197197   memset(sector+0x400, 0, 0x110);
198198}
src/mess/drivers/next.c
r14568r14569
261261   else if(bit < 30) level = 6;
262262   else              level = 7;
263263
264   fprintf(stderr, "IRQ info %08x/%08x - %d\n", irq_status, irq_mask, level);
264   logerror("IRQ info %08x/%08x - %d\n", irq_status, irq_mask, level);
265265
266266   if(level != irq_level) {
267267      maincpu->set_input_line(irq_level, CLEAR_LINE);
r14568r14569
314314            dma_read(slot, val, eof, err);
315315            if(err) {
316316               ds.state = (ds.state & ~DMA_ENABLE) | DMA_BUSEXC;
317               fprintf(stderr, "DMA: bus error on read slot %d\n", slot);
317               logerror("DMA: bus error on read slot %d\n", slot);
318318               return;
319319            }
320            if(0)
321               fprintf(stderr, "DMA [%08x] = %02x\n", ds.current, val);
322320            space->write_byte(ds.current++, val);
323321            dma_check_end(slot, eof);
324322            if(!(ds.state & DMA_ENABLE))
r14568r14569
333331            dma_write(slot, val, eof, err);
334332            if(err) {
335333               ds.state = (ds.state & ~DMA_ENABLE) | DMA_BUSEXC;
336               fprintf(stderr, "DMA: bus error on write slot %d\n", slot);
334               logerror("DMA: bus error on write slot %d\n", slot);
337335               return;
338336            }
339337            dma_check_end(slot, false);
r14568r14569
457455   }
458456
459457   const char *name = dma_name(slot);
460   fprintf(stderr, "dma_regs_r %s:%d %08x (%08x)\n", name, reg, res, cpu_get_pc(&space.device()));
458   logerror("dma_regs_r %s:%d %08x (%08x)\n", name, reg, res, cpu_get_pc(&space.device()));
461459
462460   return res;
463461}
r14568r14569
469467
470468   const char *name = dma_name(slot);
471469
472   fprintf(stderr, "dma_regs_w %s:%d %08x (%08x)\n", name, reg, data, cpu_get_pc(&space.device()));
470   logerror("dma_regs_w %s:%d %08x (%08x)\n", name, reg, data, cpu_get_pc(&space.device()));
473471   switch(reg) {
474472   case 0:
475473      dma_slots[slot].start = data;
r14568r14569
495493   const char *name = dma_name(slot);
496494
497495   if(cpu_get_pc(&space.device()) != 0x409bb4e)
498      fprintf(stderr, "dma_ctrl_r %s:%d %02x (%08x)\n", name, reg, dma_slots[slot].state, cpu_get_pc(&space.device()));
496      logerror("dma_ctrl_r %s:%d %02x (%08x)\n", name, reg, dma_slots[slot].state, cpu_get_pc(&space.device()));
499497
500498   return reg ? 0 : dma_slots[slot].state << 24;
501499}
r14568r14569
505503   int slot = offset >> 2;
506504   int reg = offset & 3;
507505   const char *name = dma_name(slot);
508   fprintf(stderr, "dma_ctrl_w %s:%d %08x @ %08x (%08x)\n", name, reg, data, mem_mask, cpu_get_pc(&space.device()));
506   logerror("dma_ctrl_w %s:%d %08x @ %08x (%08x)\n", name, reg, data, mem_mask, cpu_get_pc(&space.device()));
509507   if(!reg) {
510508      if(ACCESSING_BITS_16_23)
511509         dma_do_ctrl_w(slot, data >> 16);
r14568r14569
530528         data & DMA_INITBUFTURBO ? " initbufturbo" : "");
531529#endif
532530   if(data & DMA_SETENABLE)
533      fprintf(stderr, "dma enable %s %s %08x (%08x)\n", name, data & DMA_SETREAD ? "read" : "write", (dma_slots[slot].limit-dma_slots[slot].start) & 0x7fffffff, cpu_get_pc(maincpu));
531      logerror("dma enable %s %s %08x (%08x)\n", name, data & DMA_SETREAD ? "read" : "write", (dma_slots[slot].limit-dma_slots[slot].start) & 0x7fffffff, cpu_get_pc(maincpu));
534532
535533   dma_slot &ds = dma_slots[slot];
536534   if(data & (DMA_RESET|DMA_INITBUF|DMA_INITBUFTURBO)) {
r14568r14569
562560READ32_MEMBER( next_state::scsictrl_r )
563561{
564562   UINT32 res = (scsictrl << 24) | (scsistat << 16);
565   fprintf(stderr, "scsictrl_read %08x @ %08x (%08x)\n", res, mem_mask, cpu_get_pc(&space.device()));
563   logerror("scsictrl_read %08x @ %08x (%08x)\n", res, mem_mask, cpu_get_pc(&space.device()));
566564   return res;
567565}
568566
r14568r14569
574572         scsi->reset();
575573      device_t::static_set_clock(*scsi, scsi_clocks[scsictrl >> 6]);
576574
577      fprintf(stderr, "SCSIctrl %dMHz int=%s dma=%s dmadir=%s%s%s dest=%s (%08x)\n",
575      logerror("SCSIctrl %dMHz int=%s dma=%s dmadir=%s%s%s dest=%s (%08x)\n",
578576            scsi_clocks[scsictrl >> 6]/1000000,
579577            scsictrl & 0x20 ? "on" : "off",
580578            scsictrl & 0x10 ? "on" : "off",
r14568r14569
586584   }
587585   if(ACCESSING_BITS_16_23) {
588586      scsistat = data >> 16;
589      fprintf(stderr, "SCSIstat %02x (%08x)\n", data, cpu_get_pc(&space.device()));
587      logerror("SCSIstat %02x (%08x)\n", data, cpu_get_pc(&space.device()));
590588   }
591589}
592590
r14568r14569
595593   // Event counters, around that time, are usually fixed-frequency counters.
596594   // This one being 1MHz seems to make sense
597595
598   // The nexttrb rom seems pretty convinced that it's 20 bits only.
596   // The v74 rom seems pretty convinced that it's 20 bits only.
599597
600598   if(ACCESSING_BITS_24_31)
601599      eventc_latch = machine().time().as_ticks(1000000) & 0xfffff;
r14568r14569
609607
610608WRITE32_MEMBER( next_state::fdc_control_w )
611609{
612   fprintf(stderr, "FDC write %02x (%08x)\n", data >> 24, cpu_get_pc(&space.device()));
610   logerror("FDC write %02x (%08x)\n", data >> 24, cpu_get_pc(&space.device()));
613611}
614612
615613READ32_MEMBER( next_state::fdc_control_r )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team