Previous 15994 Revisions Next

r3157 Wednesday 3rd September, 2008 at 16:52:08 UTC by Fabio Priuli
Removing old log macro, allowing for removal of otherwise unused #includes of cbm.h.
[src/mess/audio]t6721.c ted7360.c vic6560.c
[src/mess/drivers]c128.c c16.c c64.c c65.c cbmb.c pet.c vc20.c
[src/mess/includes]cbm.h
[src/mess/machine]c128.c c16.c c64.c c65.c cbmb.c cbmdrive.c cbmieeeb.c cbmserb.c pet.c tpi6525.c vc1541.c vc20.c vc20tape.c
[src/mess/video]ted7360.c vic4567.c vic6560.c vic6567.c

src/mess/audio/vic6560.c
r3156r3157
1111#include "streams.h"
1212#include "deprecat.h"
1313
14#define VERBOSE_DBG 0
15#include "includes/cbm.h"
1614#include "video/vic6560.h"
1715
1816
r3156r3157
8482         if (tone1samples == 0)
8583            tone1samples = 1;
8684      }
87      DBG_LOG (1, "vic6560", ("tone1 %.2x %d\n", data, TONE1_FREQUENCY));
85      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560");
86      mame_printf_debug("tone1 %.2x %d\n", data, TONE1_FREQUENCY);
8887      break;
8988   case 0xb:
9089      vic6560[offset] = data;
r3156r3157
9594         if (tone2samples == 0)
9695            tone2samples = 1;
9796      }
98      DBG_LOG (1, "vic6560", ("tone2 %.2x %d\n", data, TONE2_FREQUENCY));
97      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560");
98      mame_printf_debug("tone2 %.2x %d\n", data, TONE2_FREQUENCY);
9999      break;
100100   case 0xc:
101101      vic6560[offset] = data;
r3156r3157
106106         if (tone2samples == 0)
107107            tone2samples = 1;
108108      }
109      DBG_LOG (1, "vic6560", ("tone3 %.2x %d\n", data, TONE3_FREQUENCY));
109      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560");
110      mame_printf_debug("tone3 %.2x %d\n", data, TONE3_FREQUENCY);
110111      break;
111112   case 0xd:
112113      vic6560[offset] = data;
r3156r3157
114115      {
115116         noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * machine->sample_rate
116117                          * NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
117         DBG_LOG (1, "vic6560", ("noise %.2x %d sample:%d\n",
118                           data, NOISE_FREQUENCY, noisesamples));
118
119         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560");
120         mame_printf_debug("noise %.2x %d sample:%d\n", data, NOISE_FREQUENCY, noisesamples);
121
119122         if ((double) noisepos / noisesamples >= 1.0)
120123         {
121124            noisepos = 0;
r3156r3157
128131      break;
129132   case 0xe:
130133      vic6560[offset] = (old & ~0xf) | (data & 0xf);
131      DBG_LOG (3, "vic6560", ("volume %d\n", data & 0xf));
134      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560");
135      mame_printf_debug("volume %d\n", data & 0xf);
132136      break;
133137   }
134138}
src/mess/audio/t6721.c
r3156r3157
1717#include "driver.h"
1818#include "cpu/m6502/m6502.h"
1919
20#define VERBOSE_DBG 1
21#include "includes/cbm.h"
2220#include "machine/tpi6525.h"
2321
2422#include "includes/c16.h"
r3156r3157
106104
107105WRITE8_HANDLER(c364_speech_w)
108106{
109   DBG_LOG (2, "364", ("port write %.2x %.2x\n", offset, data));
107   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "364");
108   mame_printf_debug("port write %.2x %.2x\n", offset, data);
109
110110   switch (offset) {
111111   case 0:
112112      if (data&0x80) {
r3156r3157
153153      break;
154154   case 2:
155155      speech.sample.data[speech.sample.index++]=data;
156      if (speech.sample.index==sizeof(speech.sample.data)) {
157         DBG_LOG(1,"t6721",("%.2x%.2x%.2x%.2x%.2x%.2x\n",
158                        speech.sample.data[0],
159                        speech.sample.data[1],
160                        speech.sample.data[2],
161                        speech.sample.data[3],
162                        speech.sample.data[4],
163                        speech.sample.data[5]));
156      if (speech.sample.index==sizeof(speech.sample.data))
157      {
158         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "t6721");
159         mame_printf_debug("%.2x%.2x%.2x%.2x%.2x%.2x\n", speech.sample.data[0], speech.sample.data[1],
160                  speech.sample.data[2], speech.sample.data[3], speech.sample.data[4], speech.sample.data[5]);
164161         speech.sample.index=0;
165162         /*speech.endOfSample=false; */
166163         speech.busy=TRUE;
r3156r3157
183180      }
184181      break;
185182   }
186   DBG_LOG (2, "364", ("port read %.2x %.2x\n", offset, data));
183   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "364");
184   mame_printf_debug("port read %.2x %.2x\n", offset, data);
187185   return data;
188186}
189187
src/mess/audio/ted7360.c
r3156r3157
1111#include "streams.h"
1212#include "deprecat.h"
1313
14#define VERBOSE_DBG 1
15#include "includes/cbm.h"
1614#include "includes/c16.h"
1715#include "video/ted7360.h"
1816
r3156r3157
5856      else
5957         ted7360[offset] = data;
6058      tone1samples = machine->sample_rate / TONE_FREQUENCY (TONE1_VALUE);
61      DBG_LOG (1, "ted7360", ("tone1 %d %d sample:%d\n",
62               TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), tone1samples));
59      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
60      mame_printf_debug("tone1 %d %d sample:%d\n", TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), tone1samples);
6361
6462      break;
6563   case 0xf:
6664   case 0x10:
6765      ted7360[offset] = data;
6866      tone2samples = machine->sample_rate / TONE_FREQUENCY (TONE2_VALUE);
69      DBG_LOG (1, "ted7360", ("tone2 %d %d sample:%d\n",
70               TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), tone2samples));
67      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
68      mame_printf_debug("tone2 %d %d sample:%d\n", TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), tone2samples);
7169
7270      noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * machine->sample_rate
7371                       * NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
74      DBG_LOG (1, "ted7360", ("noise %d sample:%d\n",
75               NOISE_FREQUENCY, noisesamples));
72      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
73      mame_printf_debug("noise %d sample:%d\n", NOISE_FREQUENCY, noisesamples);
7674      if (!NOISE_ON || ((double) noisepos / noisesamples >= 1.0))
7775      {
7876         noisepos = 0;
r3156r3157
8078      break;
8179   case 0x11:
8280      ted7360[offset] = data;
83      DBG_LOG(1, "ted7360", ("%s volume %d, %s %s %s\n",
84                   TONE_ON?"on":"off",
85                   VOLUME, TONE1_ON?"tone1":"", TONE2_ON?"tone2":"",
86                   NOISE_ON?"noise":""));
81
82      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
83      mame_printf_debug("%s volume %d, %s %s %s\n", TONE_ON?"on":"off", VOLUME,
84                     TONE1_ON?"tone1":"", TONE2_ON?"tone2":"", NOISE_ON?"noise":"");
85
8786      if (!TONE_ON||!TONE1_ON) tone1pos=0;
8887      if (!TONE_ON||!TONE2_ON) tone2pos=0;
8988      if (!TONE_ON||!NOISE_ON) noisepos=0;
src/mess/video/vic6560.c
r3156r3157
1111#include "utils.h"
1212#include "sound/custom.h"
1313
14#define VERBOSE_DBG 0
1514#include "vic6560.h"
1615
17#include "includes/cbm.h"
1816#include "includes/vc20.h"
1917#include "includes/cbmserb.h"
2018#include "includes/vc1541.h"
r3156r3157
187185
188186WRITE8_HANDLER ( vic6560_port_w )
189187{
190   DBG_LOG (1, "vic6560_port_w", ("%.4x:%.2x\n", offset, data));
188   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560_port_w");
189   mame_printf_debug("%.4x:%.2x\n", offset, data);
191190   switch (offset)
192191   {
193192   case 0xa:
r3156r3157
291290      val = vic6560[offset];
292291      break;
293292   }
294   DBG_LOG (3, "vic6560_port_r", ("%.4x:%.2x\n", offset, val));
293   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic6560_port_r");
294   mame_printf_debug("%.4x:%.2x\n", offset, val);
295295   return val;
296296}
297297
src/mess/video/vic4567.c
r3156r3157
5555
5656WRITE8_HANDLER ( vic3_port_w )
5757{
58   DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
58   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
59   mame_printf_debug("%.2x:%.2x\n", offset, data);
60
5961   offset &= 0x7f;
6062   switch (offset)
6163   {
r3156r3157
6870      vic2_port_w(machine, offset,data);
6971      break;
7072   case 0x2f:
71      DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
73      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
74      mame_printf_debug("%.2x:%.2x\n", offset, data);
7275      vic2.reg[offset] = data;
7376      break;
7477   case 0x30:
7578      vic2.reg[offset] = data;
76      if (vic2.port_changed!=NULL) {
77         DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
79      if (vic2.port_changed!=NULL)
80      {
81         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
82         mame_printf_debug("%.2x:%.2x\n", offset, data);
7883         vic2.reg[offset] = data;
7984         vic2.port_changed(data);
8085      }
r3156r3157
99104   case 0x3e:
100105   case 0x3f:
101106      vic2.reg[offset] = data;
102      DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
107      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
108      mame_printf_debug("%.2x:%.2x\n", offset, data);
103109      break;
104110   case 0x40:
105111   case 0x41:
r3156r3157
109115   case 0x45:
110116   case 0x46:
111117   case 0x47:
112      DBG_LOG (2, "vic plane write", ("%.2x:%.2x\n", offset, data));
118      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic plane write");
119      mame_printf_debug("%.2x:%.2x\n", offset, data);
113120      break;
114121   default:
115122      vic2.reg[offset] = data;
r3156r3157
133140   case 0x2f:
134141   case 0x30:
135142      val = vic2.reg[offset];
136      DBG_LOG (2, "vic read", ("%.2x:%.2x\n", offset, val));
143      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic read");
144      mame_printf_debug("%.2x:%.2x\n", offset, val);
137145      break;
138146   case 0x31:
139147   case 0x32:
r3156r3157
151159   case 0x3e:
152160   case 0x3f:                     /* not used */
153161      val = vic2.reg[offset];
154      DBG_LOG (2, "vic read", ("%.2x:%.2x\n", offset, val));
162      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic read");
163      mame_printf_debug("%.2x:%.2x\n", offset, val);
155164      break;
156165   case 0x40:
157166   case 0x41:
r3156r3157
161170   case 0x45:
162171   case 0x46:
163172   case 0x47:
164      DBG_LOG (2, "vic3 plane read", ("%.2x:%.2x\n", offset, val));
173      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic3 plane read");
174      mame_printf_debug("%.2x:%.2x\n", offset, val);
165175      break;
166176   default:
167177      val = vic2.reg[offset];
src/mess/video/vic6567.c
r3156r3157
6262#include "vic4567.h"
6363#include "utils.h"
6464
65#define VERBOSE_DBG 1
66#include "includes/cbm.h"
67
6865/* lightpen values */
6966#include "includes/c64.h"
7067
r3156r3157
292289   {
293290      if (!(vic2.reg[0x19] & 0x80))
294291      {
295         DBG_LOG (2, "vic2", ("irq start %.2x\n", mask));
292         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic2");
293         mame_printf_debug("irq start %.2x\n", mask);
296294         vic2.reg[0x19] |= 0x80;
297295         vic2.interrupt (1);
298296      }
r3156r3157
305303   vic2.reg[0x19] &= ~mask;
306304   if ((vic2.reg[0x19] & 0x80) && !(vic2.reg[0x19] & vic2.reg[0x1a] & 0xf))
307305   {
308      DBG_LOG (2, "vic2", ("irq end %.2x\n", mask));
306      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic2");
307      mame_printf_debug("irq end %.2x\n", mask);
309308      vic2.reg[0x19] &= ~0x80;
310309      vic2.interrupt (0);
311310   }
r3156r3157
319318static TIMER_CALLBACK(vic2_timer_timeout)
320319{
321320   int which = param;
322   DBG_LOG (3, "vic2 ", ("timer %d timeout\n", which));
321   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic2");
322   mame_printf_debug("timer %d timeout\n", which);
323323   switch (which)
324324   {
325325   case 1:                     /* light pen */
r3156r3157
340340
341341WRITE8_HANDLER ( vic2_port_w )
342342{
343   DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
343   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
344   mame_printf_debug("%.2x:%.2x\n", offset, data);
345
344346   offset &= 0x3f;
345347   switch (offset)
346348   {
r3156r3157
522524   case 0x2f:
523525      if (vic2.vic2e)
524526      {
525         DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
527         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
528         mame_printf_debug("%.2x:%.2x\n", offset, data);
526529         vic2.reg[offset] = data;
527530      }
528531      break;
r3156r3157
548551   case 0x3e:
549552   case 0x3f:
550553      vic2.reg[offset] = data;
551      DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data));
554      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic write");
555      mame_printf_debug("%.2x:%.2x\n", offset, data);
552556      break;
553557   default:
554558      vic2.reg[offset] = data;
r3156r3157
614618   case 0x30:
615619      if (vic2.vic2e) {
616620         val = vic2.reg[offset];
617         DBG_LOG (2, "vic read", ("%.2x:%.2x\n", offset, val));
621         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic read");
622         mame_printf_debug("%.2x:%.2x\n", offset, val);
618623      } else
619624         val = 0xff;
620625      break;
r3156r3157
634639   case 0x3e:
635640   case 0x3f:                     /* not used */
636641      val = vic2.reg[offset];
637      DBG_LOG (2, "vic read", ("%.2x:%.2x\n", offset, val));
642      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic read");
643      mame_printf_debug("%.2x:%.2x\n", offset, val);
638644      break;
639645   default:
640646      val = vic2.reg[offset];
641647   }
642648   if ((offset != 0x11) && (offset != 0x12))
643      DBG_LOG (2, "vic read", ("%.2x:%.2x\n", offset, val));
649      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vic read");
650      mame_printf_debug("%.2x:%.2x\n", offset, val);
644651   return val;
645652}
646653
src/mess/video/ted7360.c
r3156r3157
358358#include "utils.h"
359359#include "sound/custom.h"
360360
361#define VERBOSE_DBG 0
362#include "includes/cbm.h"
363361#include "includes/c16.h"
364362#include "includes/cbmserb.h"
365363#include "includes/vc1541.h"
r3156r3157
554552   {
555553      if (!(ted7360[9] & 0x80))
556554      {
557         DBG_LOG (1, "ted7360", ("irq start %.2x\n", mask));
555         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
556         mame_printf_debug("irq start %.2x\n", mask);
557
558558         ted7360[9] |= 0x80;
559559         c16_interrupt (machine, 1);
560560      }
r3156r3157
567567   ted7360[9] &= ~mask;
568568   if ((ted7360[9] & 0x80) && !(ted7360[9] & ted7360[0xa] & 0x5e))
569569   {
570      DBG_LOG (1, "ted7360", ("irq end %.2x\n", mask));
570      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
571      mame_printf_debug("irq end %.2x\n", mask);
572
571573      ted7360[9] &= ~0x80;
572574      c16_interrupt (machine, 0);
573575   }
r3156r3157
582584static TIMER_CALLBACK(ted7360_timer_timeout)
583585{
584586   int which = param;
585   DBG_LOG (3, "ted7360 ", ("timer %d timeout\n", which));
587
588   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
589   mame_printf_debug("timer %d timeout\n", which);
590
586591   switch (which)
587592   {
588593   case 1:
r3156r3157
625630
626631   if ((offset != 8) && ((offset < 0x15) || (offset > 0x19)))
627632   {
628      DBG_LOG (1, "ted7360_port_w", ("%.2x:%.2x\n", offset, data));
633      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
634      mame_printf_debug("%.2x:%.2x\n", offset, data);
629635   }
636
630637   switch (offset)
631638   {
632639   case 0xe:
r3156r3157
714721            x_begin = HORICONTALPOS;
715722            x_end = x_begin + 320;
716723         }
717         DBG_LOG (3, "ted7360_port_w", ("%s %s\n", data & 0x40 ? "ntsc" : "pal",
718                                 data & 0x20 ? "hori freeze" : ""));
724         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
725         mame_printf_debug("%s %s\n", data & 0x40 ? "ntsc" : "pal", data & 0x20 ? "hori freeze" : "");
726
719727         chargenaddr = CHARGENADDR;
720728      }
721729      break;
r3156r3157
742750#endif
743751      if ((data ^ old) & 1)
744752      {
745/*    DBG_LOG(1,"set rasterline hi",("soll:%d\n",RASTERLINE)); */
753//         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "set rasterline hi");
754//         mame_printf_debug("soll:%d\n",RASTERLINE);
746755      }
747756      break;
748757   case 0xb:
r3156r3157
750759      {
751760         ted7360_drawlines (machine, lastline, rasterline);
752761         ted7360[offset] = data;
753         /*  DBG_LOG(1,"set rasterline lo",("soll:%d\n",RASTERLINE)); */
762
763//         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "set rasterline lo");
764//         mame_printf_debug("soll:%d\n",RASTERLINE);
754765      }
755766      break;
756767   case 0xc:
r3156r3157
768779         ted7360[offset] = data;
769780         bitmapaddr = BITMAPADDR;
770781         chargenaddr = CHARGENADDR;
771         DBG_LOG (3, "ted7360_port_w", ("bitmap %.4x %s\n",
772                                 BITMAPADDR, INROM ? "rom" : "ram"));
782
783         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
784         mame_printf_debug("bitmap %.4x %s\n", BITMAPADDR, INROM ? "rom" : "ram");
773785      }
774786      break;
775787   case 0x13:
r3156r3157
778790         ted7360_drawlines (machine, lastline, rasterline);
779791         ted7360[offset] = data;
780792         chargenaddr = CHARGENADDR;
781         DBG_LOG (3, "ted7360_port_w", ("chargen %.4x %s %d\n",
782                                 CHARGENADDR, data & 2 ? "" : "doubleclock",
783                                 data & 1));
793
794         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
795         mame_printf_debug("chargen %.4x %s %d\n", CHARGENADDR, data & 2 ? "" : "doubleclock", data & 1);
784796      }
785797      break;
786798   case 0x14:
r3156r3157
789801         ted7360_drawlines (machine, lastline, rasterline);
790802         ted7360[offset] = data;
791803         videoaddr = VIDEOADDR;
792         DBG_LOG (3, "ted7360_port_w", ("videoram %.4x\n",
793                                 VIDEOADDR));
804
805         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
806         mame_printf_debug("videoram %.4x\n", VIDEOADDR);
794807      }
795808      break;
796809   case 0x15:                     /* backgroundcolor */
r3156r3157
836849      break;
837850   case 0x1c:
838851      ted7360[offset] = data;         /*? */
839      DBG_LOG (1, "ted7360_port_w", ("write to rasterline high %.2x\n",
840                              data));
852      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
853      mame_printf_debug("write to rasterline high %.2x\n", data);
841854      break;
842855   case 0x1f:
843856      ted7360[offset] = data;
844      DBG_LOG (1, "ted7360_port_w", ("write to cursorblink %.2x\n", data));
857      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
858      mame_printf_debug("write to cursorblink %.2x\n", data);
845859      break;
846860   default:
847861      ted7360[offset] = data;
r3156r3157
926940      break;
927941   case 0x1f:
928942      val = ((rasterline & 7) << 4) | (ted7360[offset] & 0x0f);
929      DBG_LOG (1, "ted7360_port_w", ("read from cursorblink %.2x\n", val));
943      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_w");
944      mame_printf_debug("read from cursorblink %.2x\n", val);
930945      break;
931946   default:
932947      val = ted7360[offset];
r3156r3157
935950   if ((offset != 8) && (offset >= 6) && (offset != 0x1c) && (offset != 0x1d) && (offset != 9)
936951      && ((offset < 0x15) || (offset > 0x19)))
937952   {
938      DBG_LOG (1, "ted7360_port_r", ("%.2x:%.2x\n", offset, val));
953      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360_port_r");
954      mame_printf_debug("%.2x:%.2x\n", offset, val);
939955   }
940956   return val;
941957}
src/mess/includes/cbm.h
r3156r3157
1414
1515/***********************************************
1616
17   CBM Debug Logging Macro
18
19***********************************************/
20
21/* call the XXX_LOG with XXX_LOG("info",("%fmt\n",args));         *
22 * where "info" can also be 0 to append .."%fmt",args to a line.   */
23
24#define LOG(LEVEL,N,M,A)  \
25        { \
26     if(LEVEL>=N) { \
27       if( M ) \
28              logerror("%11.6f: %-24s",attotime_to_double(timer_get_time()), (char*)M );\
29       logerror A; \
30     } \
31        }
32
33/* debugging level here for all on or off */
34#if 1
35# ifdef VERBOSE_DBG
36#  undef VERBOSE_DBG
37# endif
38# if 1
39#  define VERBOSE_DBG 0
40# else
41#  define VERBOSE_DBG 1
42# endif
43#endif
44
45#define DBG_LOG(n,m,a) LOG(VERBOSE_DBG,n,m,a)
46
47
48/***********************************************
49
5017   CBM Quickloads
5118
5219***********************************************/
src/mess/machine/c65.c
r3156r3157
1212#include "sound/sid6581.h"
1313#include "machine/6526cia.h"
1414
15#define VERBOSE_DBG 1
16#include "includes/cbm.h"
1715#include "includes/cbmserb.h"
1816#include "includes/vc1541.h"
1917#include "video/vic4567.h"
r3156r3157
118116      case 0:
119117         if (src.d==0x3ffff) dump=1;
120118         if (dump)
121            DBG_LOG(1,"dma copy job",
122                  ("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
119         {
120            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma copy job");
121            mame_printf_debug("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
123122                   len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d),
124                   c65_read_mem(machine, pair.d+1) ) );
123                   c65_read_mem(machine, pair.d+1));
124         }
125125         if ( (dma.version==1)
126126             &&( (src.d&0x400000)||(dst.d&0x400000)) ) {
127127            if ( !(src.d&0x400000) ) {
r3156r3157
144144         }
145145         break;
146146      case 3:
147         DBG_LOG(3,"dma fill job",
148               ("len:%.4x value:%.2x dst:%.6x sub:%.2x modrm:%.2x\n",
147         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma fill job");
148         mame_printf_debug("len:%.4x value:%.2x dst:%.6x sub:%.2x modrm:%.2x\n",
149149                len.w.l, fill, dst.d, c65_read_mem(machine, pair.d),
150                c65_read_mem(machine, pair.d+1)));
151            for (i=0; i<len.w.l; i++)
152               c65_write_mem(machine, dst.d++,fill);
153            break;
150                c65_read_mem(machine, pair.d+1));
151         for (i=0; i<len.w.l; i++)
152            c65_write_mem(machine, dst.d++,fill);
153         break;
154154      case 0x30:
155         DBG_LOG(1,"dma copy down",
156               ("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
155         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma copy down");
156         mame_printf_debug("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
157157                len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d),
158                c65_read_mem(machine, pair.d+1) ) );
158                c65_read_mem(machine, pair.d+1));
159159         for (i=0; i<len.w.l; i++)
160160            c65_write_mem(machine, dst.d--,c65_read_mem(machine, src.d--));
161161         break;
162162      default:
163         DBG_LOG(1,"dma job",
164               ("cmd:%.2x len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
163         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma job");
164         mame_printf_debug("cmd:%.2x len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
165165                cmd,len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d),
166                c65_read_mem(machine, pair.d+1)));
166                c65_read_mem(machine, pair.d+1));
167167      }
168168      break;
169169   default:
170      DBG_LOG (1, "dma chip write", ("%.3x %.2x\n", offset,value));
170      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma chip write");
171      mame_printf_debug("%.3x %.2x\n", offset,value);
171172      break;
172173   }
173174}
r3156r3157
175176static int c65_dma_port_r(running_machine *machine, int offset)
176177{
177178   /* offset 3 bit 7 in progress ? */
178   DBG_LOG (2, "dma chip read", ("%.3x\n", offset));
179   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma chip read");
180   mame_printf_debug("%.3x\n", offset);
179181    return 0x7f;
180182}
181183
r3156r3157
185187   {
186188      c65_6511_port=value;
187189   }
188   DBG_LOG (2, "r6511 write", ("%.2x %.2x\n", offset, value));
190   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "r6511 write");
191   mame_printf_debug("%.2x %.2x\n", offset, value);
189192}
190193
191194static int c65_6511_port_r(running_machine *machine, int offset)
r3156r3157
197200      if (input_port_read(machine, "SPECIAL") & 0x20)
198201         data &= ~1;
199202   }
200   DBG_LOG (2, "r6511 read", ("%.2x\n", offset));
203   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "r6511 read");
204   mame_printf_debug("%.2x\n", offset);
201205
202206   return data;
203207}
r3156r3157
328332
329333static void c65_fdc_w(running_machine *machine, int offset, int data)
330334{
331   DBG_LOG (1, "fdc write", ("%.5x %.2x %.2x\n", activecpu_get_pc(), offset, data));
335   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "fdc write");
336   mame_printf_debug("%.5x %.2x %.2x\n", activecpu_get_pc(), offset, data);
337
332338   switch (offset&0xf) {
333339   case 0:
334340      c65_fdc.reg[0]=data;
r3156r3157
409415      data=c65_fdc.reg[offset&0xf];
410416      break;
411417   }
412   DBG_LOG (1, "fdc read", ("%.5x %.2x %.2x\n", activecpu_get_pc(), offset, data));
418   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "fdc read");
419   mame_printf_debug("%.5x %.2x %.2x\n", activecpu_get_pc(), offset, data);
420
413421   return data;
414422}
415423
r3156r3157
484492      else if (offset<0x440)
485493         sid6581_1_port_w(machine, offset&0x3f, data);
486494      else
487         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
495         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
496         mame_printf_debug("%.3x %.2x\n", offset, data);
488497      break;
489498   case 0x500:
490      DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
499      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
500      mame_printf_debug("%.3x %.2x\n", offset, data);
491501      break;
492502   case 0x600:
493503      c65_6511_port_w(machine, offset&0xff,data);
r3156r3157
509519      break;
510520   case 0x200:
511521   case 0x300:
512      DBG_LOG (1, "io write", ("%.3x %.2x\n", offset+0xc00, data));
522      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
523      mame_printf_debug("%.3x %.2x\n", offset+0xc00, data);
513524      break;
514525   }
515526}
r3156r3157
529540      break;
530541   case 0x100:case 0x200: case 0x300:
531542   /* read only !? */
532      DBG_LOG (1, "io read", ("%.3x\n", offset));
543      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
544      mame_printf_debug("%.3x\n", offset);
533545      break;
534546   case 0x400:
535547      if (offset<0x420)
536548         return sid6581_0_port_r(machine, offset & 0x3f);
537549      if (offset<0x440)
538550         return sid6581_1_port_r(machine, offset&0x3f);
539      DBG_LOG (1, "io read", ("%.3x\n", offset));
551      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
552      mame_printf_debug("%.3x\n", offset);
540553      break;
541554   case 0x500:
542      DBG_LOG (1, "io read", ("%.3x\n", offset));
555      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
556      mame_printf_debug("%.3x\n", offset);
543557      break;
544558   case 0x600:
545559      return c65_6511_port_r(machine, offset&0xff);
r3156r3157
558572      return cia_1_r(machine, offset);
559573   case 0x200:
560574   case 0x300:
561      DBG_LOG (1, "io read", ("%.3x\n", offset+0xc00));
575      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
576      mame_printf_debug("%.3x\n", offset+0xc00);
562577      break;
563578   }
564579   return 0xff;
r3156r3157
581596   read8_machine_func rh;
582597   write8_machine_func wh;
583598
584   DBG_LOG (2, "c65 bankswitch", ("%.2x\n",value));
599   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c65 bankswitch");
600   mame_printf_debug("%.2x\n",value);
585601
586602   if (c65_io_on)
587603   {
r3156r3157
633649   if (data == old)
634650      return;
635651
636   DBG_LOG (1, "bankswitch", ("%d\n", data & 7));
637   loram = (data & 1) ? 1 : 0;
638   hiram = (data & 2) ? 1 : 0;
639   charen = (data & 4) ? 1 : 0;
652   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "bankswitch");
653   mame_printf_debug("%d\n", data & 0x07);
640654
655   loram  = (data & 0x01) ? 1 : 0;
656   hiram  = (data & 0x02) ? 1 : 0;
657   charen = (data & 0x04) ? 1 : 0;
658
641659   if ((!c64_game && c64_exrom)
642660      || (loram && hiram && !c64_exrom))
643661   {
src/mess/machine/cbmb.c
r3156r3157
1010#include "machine/6526cia.h"
1111#include "deprecat.h"
1212
13#define VERBOSE_DBG 1
1413#include "includes/cbm.h"
1514#include "machine/tpi6525.h"
1615#include "includes/cbmserb.h"
r3156r3157
208207
209208   if (level != old_level)
210209   {
211      DBG_LOG (3, "mos6509", ("irq %s\n", level ? "start" : "end"));
210      logerror("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "mos6509");
211      logerror("irq %s\n", level ? "start" : "end");
212212      cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, level);
213213      old_level = level;
214214   }
src/mess/machine/vc1541.c
r3156r3157
106106#include "cpu/m6502/m6502.h"
107107#include "machine/6522via.h"
108108
109#define VERBOSE_DBG 1
110#include "includes/cbm.h"
111109#include "includes/cbmdrive.h"
112110#include "machine/tpi6525.h"
113111
r3156r3157
402400static void vc1541_via0_irq (running_machine *machine, int level)
403401{
404402   vc1541->via0irq = level;
405   DBG_LOG(2, "vc1541 via0 irq",("level %d %d\n",vc1541->via0irq,vc1541->via1irq));
403   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 via0 irq");
404   mame_printf_debug("level %d %d\n",vc1541->via0irq,vc1541->via1irq);
405
406406   cpunum_set_input_line (machine, vc1541->cpunumber,
407407                 M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq);
408408}
r3156r3157
432432   case 11:
433433      break;
434434   }
435   if (value!=old) {
435   if (value!=old)
436   {
437      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 serial read");
438      mame_printf_debug("%s %s %s\n", serial.atn[0]?"ATN":"atn", serial.clock[0]?"CLOCK":"clock", serial.data[0]?"DATA":"data");
436439
437      DBG_LOG(2, "vc1541 serial read",("%s %s %s\n",
438                               serial.atn[0]?"ATN":"atn",
439                               serial.clock[0]?"CLOCK":"clock",
440                               serial.data[0]?"DATA":"data"));
440      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 serial read");
441      mame_printf_debug("%s %s %s\n", value&0x80?"ATN":"atn", value&4?"CLOCK":"clock", value&1?"DATA":"data");
441442
442      DBG_LOG(2, "vc1541 serial read",("%s %s %s\n",
443                               value&0x80?"ATN":"atn",
444                               value&4?"CLOCK":"clock",
445                               value&1?"DATA":"data"));
446443      old=value;
447444   }
448445
r3156r3157
451448
452449static WRITE8_HANDLER( vc1541_via0_write_portb )
453450{
454   DBG_LOG(2, "vc1541 serial write",("%s %s %s\n",
455                            data&0x10?"ATN":"atn",
456                            data&8?"CLOCK":"clock",
457                            data&2?"DATA":"data"));
451   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 serial write");
452   mame_printf_debug("%s %s %s\n", data&0x10?"ATN":"atn", data&8?"CLOCK":"clock", data&2?"DATA":"data");
458453
459454   vc1541->drive.serial.data=data&2?0:1;
460455   vc1541->drive.serial.acka=(data&0x10)?1:0;
r3156r3157
501496static void vc1541_via1_irq (running_machine *machine, int level)
502497{
503498   vc1541->via1irq = level;
504   DBG_LOG(2, "vc1541 via1 irq",("level %d %d\n",vc1541->via0irq,vc1541->via1irq));
499
500   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 via1 irq");
501   mame_printf_debug("level %d %d\n",vc1541->via0irq,vc1541->via1irq);
502
505503   cpunum_set_input_line (machine, vc1541->cpunumber,
506504                 M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq);
507505}
r3156r3157
509507static READ8_HANDLER( vc1541_via1_read_porta )
510508{
511509   int data=vc1541->head.data[vc1541->d64.pos];
512   DBG_LOG(2, "vc1541 drive",("port a read %.2x\n", data));
510   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 drive");
511   mame_printf_debug("port a read %.2x\n", data);
512
513513   return data;
514514}
515515
516516static WRITE8_HANDLER( vc1541_via1_write_porta )
517517{
518   DBG_LOG(1, "vc1541 drive",("port a write %.2x\n", data));
518   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 drive");
519   mame_printf_debug("port a write %.2x\n", data);
519520}
520521
521522static  READ8_HANDLER( vc1541_via1_read_portb )
r3156r3157
536537static WRITE8_HANDLER( vc1541_via1_write_portb )
537538{
538539   static int old=0;
539   if (data!=old) {
540      DBG_LOG(1, "vc1541 drive",("%.2x\n", data));
540   if (data!=old)
541   {
542      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 drive");
543      mame_printf_debug("%.2x\n", data);
544
541545      if ((old&3)!=(data&3)) {
542546         switch (old&3) {
543547         case 0:
r3156r3157
666670/* delivers status for displaying */
667671void vc1541_drive_status (char *text, int size)
668672{
669#if 1||VERBOSE_DBG
673#if 1
670674   if (vc1541->type==TypeVC1541) {
671675      snprintf (text, size, "%s %4.1f %s %.2x %s %s %s",
672676              vc1541->led ? "LED" : "led",
r3156r3157
717721         serial.atn[0] = serial.atn[1] && serial.atn[2];
718722         if (serial.atn[0] == level)
719723         {
720            DBG_LOG(1, "vc1541",("%d:%.4x atn %s\n",
721                            cpu_getactivecpu (),
722                            activecpu_get_pc(),
723                            serial.atn[0]?"ATN":"atn"));
724            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541");
725            mame_printf_debug("%d:%.4x atn %s\n", cpu_getactivecpu (), activecpu_get_pc(), serial.atn[0]?"ATN":"atn");
726
724727            via_set_input_ca1 (machine, 2, !level);
725728#if 0
726729            value=vc1541->drive.serial.data;
r3156r3157
758761         serial.data[0] = serial.data[1] && serial.data[2];
759762         if (serial.data[0] == level)
760763         {
761            DBG_LOG(1, "vc1541",("%d:%.4x data %s\n",
762                            cpu_getactivecpu (),
763                            activecpu_get_pc(),
764                            serial.data[0]?"DATA":"data"));
764            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541");
765            mame_printf_debug("%d:%.4x data %s\n", cpu_getactivecpu (), activecpu_get_pc(), serial.data[0]?"DATA":"data");
765766         }
766767      }
767768   }
r3156r3157
788789         serial.clock[0] = serial.clock[1] && serial.clock[2];
789790         if (serial.clock[0] == level)
790791         {
791            DBG_LOG(1, "vc1541",("%d:%.4x clock %s\n",
792                            cpu_getactivecpu (),
793                            activecpu_get_pc(),
794                            serial.clock[0]?"CLOCK":"clock"));
792            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541");
793            mame_printf_debug("%d:%.4x clock %s\n", cpu_getactivecpu (), activecpu_get_pc(), serial.clock[0]?"CLOCK":"clock");
795794         }
796795      }
797796   }
r3156r3157
827826static WRITE8_HANDLER ( c1551_port_w )
828827{
829828   static int old=0;
830   if (offset) {
831      DBG_LOG(1, "c1551 port",("write %.2x\n",data));
829   if (offset)
830   {
831      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 port");
832      mame_printf_debug("write %.2x\n",data);
833
832834      vc1541->drive.c1551.cpu_port=data;
833835
834      if (data!=old) {
835         DBG_LOG(1, "vc1541 drive",("%.2x\n", data));
836      if (data!=old)
837      {
838         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541 drive");
839         mame_printf_debug("%.2x\n", data);
836840         if ((old&3)!=(data&3)) {
837841            switch (old&3) {
838842            case 0:
r3156r3157
877881      vc1541->led = data & 8;
878882   } else {
879883      vc1541->drive.c1551.cpu_ddr=data;
880      DBG_LOG(1, "c1551 ddr",("write %.2x\n",data));
884
885      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 ddr");
886      mame_printf_debug("write %.2x\n",data);
881887   }
882888}
883889
r3156r3157
897903      }
898904      data&=~vc1541->drive.c1551.cpu_ddr;
899905      data|=vc1541->drive.c1551.cpu_ddr&vc1541->drive.c1551.cpu_port;
900      DBG_LOG(3, "c1551 port",("read %.2x\n", data));
906
907      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 port");
908      mame_printf_debug("read %.2x\n", data);
901909   } else {
902910      data=vc1541->drive.c1551.cpu_ddr;
903      DBG_LOG(3, "c1551 ddr",("read %.2x\n", data));
911
912   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 ddr");
913   mame_printf_debug("read %.2x\n", data);
904914   }
905915   return data;
906916}
r3156r3157
932942static int c1551_port_b_r (void)
933943{
934944   int data=vc1541->head.data[vc1541->d64.pos];
935   DBG_LOG(2, "c1551 drive",("port a read %.2x\n", data));
945   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 drive");
946   mame_printf_debug("port a read %.2x\n", data);
936947   return data;
937948}
938949
r3156r3157
961972
962973static void c1551x_write_data (running_machine *machine, TPI6525 *This, int data)
963974{
964   DBG_LOG(1, "c1551 cpu", ("%d write data %.2x\n",
965                   cpu_getactivecpu (), data));
975   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 cpu");
976   mame_printf_debug("%d write data %.2x\n", cpu_getactivecpu (), data);
966977#ifdef CPU_SYNC
967978   cpu_sync();
968979#endif
r3156r3157
976987   cpu_sync ();
977988#endif
978989   data=tpi6525_0_port_a_r(machine, 0);
979   DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n",
980                   cpu_getactivecpu (), data));
990
991   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 cpu");
992   mame_printf_debug("%d read data %.2x\n", cpu_getactivecpu (), data);
993
981994   return data;
982995}
983996
984997static void c1551x_write_handshake (running_machine *machine, TPI6525 *This, int data)
985998{
986   DBG_LOG(1, "c1551 cpu",("%d write handshake %.2x\n",
987                   cpu_getactivecpu (), data));
999   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 cpu");
1000   mame_printf_debug("%d write handshake %.2x\n", cpu_getactivecpu (), data);
9881001#ifdef CPU_SYNC
9891002   cpu_sync();
9901003#endif
r3156r3157
9981011   cpu_sync();
9991012#endif
10001013   data=tpi6525_0_port_c_r(machine, 0)&8?0x80:0;
1001   DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n",
1002                   cpu_getactivecpu (), data));
1014
1015   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 cpu");
1016   mame_printf_debug("%d read handshake %.2x\n", cpu_getactivecpu (), data);
1017
10031018   return data;
10041019}
10051020
r3156r3157
10101025   cpu_sync();
10111026#endif
10121027   data=tpi6525_0_port_c_r(machine, 0)&3;
1013   DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n",
1014                   cpu_getactivecpu (), data));
1028
1029   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551 cpu");
1030   mame_printf_debug("%d read status %.2x\n", cpu_getactivecpu (), data);
1031
10151032   return data;
10161033}
10171034
src/mess/machine/c128.c
r3156r3157
1616#include "machine/6526cia.h"
1717#include "deprecat.h"
1818
19#define VERBOSE_DBG 1
20#include "includes/cbm.h"
2119#include "includes/cbmserb.h"
2220#include "includes/vc1541.h"
2321#include "video/vic6567.h"
r3156r3157
7169
7270static WRITE8_HANDLER(c128_dma8726_port_w)
7371{
74   DBG_LOG(1,"dma write",("%.3x %.2x\n",offset,data));
72   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma write");
73   mame_printf_debug("%.3x %.2x\n",offset,data);
7574}
7675
7776static  READ8_HANDLER(c128_dma8726_port_r)
7877{
79   DBG_LOG(1,"dma read",("%.3x\n",offset));
78   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "dma read");
79   mame_printf_debug("%.3x\n",offset);
8080   return 0xff;
8181}
8282
r3156r3157
126126         c128_dma8726_port_w(machine, offset&0xff,data);
127127         break;
128128      case 0xe:
129         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
129         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
130         mame_printf_debug("%.3x %.2x\n", offset, data);
130131         break;
131132      }
132133   }
r3156r3157
162163      return cia_1_r(machine, offset);
163164   else if ((offset >= 0xf00) & (offset <= 0xfff))
164165      return c128_dma8726_port_r(machine, offset&0xff);
165   DBG_LOG (1, "io read", ("%.3x\n", offset));
166   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
167   mame_printf_debug("%.3x\n", offset);
166168   return 0xff;
167169}
168170
r3156r3157
175177   if (!c64mode)
176178      return;
177179
178   data = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT) & 7;
179   if ((data == old)&&(exrom==c64_exrom)&&(game==c64_game)&&!reset)
180   data = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT) & 0x07;
181   if ((data == old) && (exrom == c64_exrom) && (game == c64_game) && !reset)
180182      return;
181183
182   DBG_LOG (1, "bankswitch", ("%d\n", data & 7));
183   loram = (data & 1) ? 1 : 0;
184   hiram = (data & 2) ? 1 : 0;
185   charen = (data & 4) ? 1 : 0;
184   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "bankswitch");
185   mame_printf_debug("%d\n", data & 0x07);
186186
187   loram  = (data & 0x01) ? 1 : 0;
188   hiram  = (data & 0x02) ? 1 : 0;
189   charen = (data & 0x04) ? 1 : 0;
190
187191   if ((!c64_game && c64_exrom)
188192      || (loram && hiram && !c64_exrom))
189193   {
r3156r3157
542546   {
543547      if (!MMU_CPU8502)
544548      {
545         DBG_LOG (1, "switching to z80",
546                  ("active %d\n",cpu_getactivecpu()) );
549         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "switching to z80");
550         mame_printf_debug("active %d\n",cpu_getactivecpu());
551
547552         memory_set_context(0);
548553         c128_bankswitch_z80(machine);
549554         memory_set_context(1);
r3156r3157
552557      }
553558      else
554559      {
555         DBG_LOG (1, "switching to m6502",
556                  ("active %d\n",cpu_getactivecpu()) );
560         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "switching to m6502");
561         mame_printf_debug("active %d\n",cpu_getactivecpu());
562
557563         memory_set_context(1);
558564         c128_bankswitch_128(machine, reset);
559565         memory_set_context(0);
src/mess/machine/pet.c
r3156r3157
88#include "cpu/m6502/m6502.h"
99#include "cpu/m6809/m6809.h"
1010
11#define VERBOSE_DBG 1
1211#include "includes/cbm.h"
1312#include "machine/6821pia.h"
1413#include "machine/6522via.h"
r3156r3157
132131
133132   if (level != old_level)
134133   {
135      DBG_LOG (3, "mos6502", ("irq %s\n", level ? "start" : "end"));
134      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "mos6502");
135      mame_printf_debug("irq %s\n", level ? "start" : "end");
136
136137      if (superpet)
137138         cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, level);
138139      cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, level);
r3156r3157
226227
227228static WRITE8_HANDLER( pet_address_line_11 )
228229{
229   DBG_LOG (1, "address line", ("%d\n", data));
230   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "address line");
231   mame_printf_debug("%d\n", data);
232
230233   if (data) pet_font |= 1;
231234   else pet_font &= ~1;
232235}
src/mess/machine/c16.c
r3156r3157
1313#include "cpu/m6502/m6502.h"
1414#include "sound/sid6581.h"
1515
16#define VERBOSE_DBG 1
17#include "includes/cbm.h"
1816#include "includes/cbmserb.h"
1917#include "includes/vc1541.h"
2018#include "machine/tpi6525.h"
r3156r3157
361359WRITE8_HANDLER(c16_6551_port_w)
362360{
363361   offset &= 0x03;
364   DBG_LOG (3, "6551", ("port write %.2x %.2x\n", offset, data));
362   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "6551");
363   mame_printf_debug("port write %.2x %.2x\n", offset, data);
365364   port6529 = data;
366365}
367366
r3156r3157
370369   int data = 0x00;
371370
372371   offset &= 0x03;
373   DBG_LOG (3, "6551", ("port read %.2x %.2x\n", offset, data));
372   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "6551");
373   mame_printf_debug("port read %.2x %.2x\n", offset, data);
374374   return data;
375375}
376376
r3156r3157
423423
424424   if (level != old_level)
425425   {
426      DBG_LOG (3, "mos7501", ("irq %s\n", level ? "start" : "end"));
426      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "mos7501");
427      mame_printf_debug("irq %s\n", level ? "start" : "end");
427428      cpunum_set_input_line(machine, 0, M6510_IRQ_LINE, level);
428429      old_level = level;
429430   }
src/mess/machine/cbmdrive.c
r3156r3157
44#include <string.h>
55#include "driver.h"
66
7#define VERBOSE_DBG 1               /* general debug messages */
8#include "includes/cbm.h"
97#include "includes/cbmserb.h"
108#include "includes/cbmieeeb.h"
119
r3156r3157
139137   }
140138   c1551->size += c1551->image[i + 1];
141139
142   DBG_LOG (3, "d64 readprg", ("size %d\n", c1551->size));
140   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "d64 readprg");
141   mame_printf_debug("size %d\n", c1551->size);
143142
144143   c1551->buffer = (UINT8*)realloc (c1551->buffer, c1551->size);
145144   if (!c1551->buffer)
r3156r3157
147146
148147   c1551->size--;
149148
150   DBG_LOG (3, "d64 readprg", ("track: %d sector: %d\n",
151                        c1551->image[pos + 1],
152                        c1551->image[pos + 2]));
149   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "d64 readprg");
150   mame_printf_debug("track: %d sector: %d\n", c1551->image[pos + 1], c1551->image[pos + 2]);
153151
154152   for (i = 0; i < c1551->size; i += 254)
155153   {
r3156r3157
158156         memcpy (c1551->buffer + i, c1551->image + pos + 2, 254);
159157         pos = d64_tracksector2offset (c1551->image[pos + 0],
160158                             c1551->image[pos + 1]);
161         DBG_LOG (3, "d64 readprg", ("track: %d sector: %d\n",
162                              c1551->image[pos],
163                              c1551->image[pos + 1]));
159
160         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "d64 readprg");
161         mame_printf_debug("track: %d sector: %d\n", c1551->image[pos], c1551->image[pos + 1]);
164162      }
165163      else
166164      {
r3156r3157
432430         drive->state = OPEN;
433431         drive->pos = 0;
434432      }
435      DBG_LOG (1, "cbm_open", ("%s %s type:%c %c\n", name,
436                         rc ? "failed" : "success", type, mode ? mode : ' '));
433
434      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm_open");
435      mame_printf_debug("%s %s type:%c %c\n", name, rc ? "failed" : "success", type, mode ? mode : ' ');
437436   }
438437   else if ((drive->cmdpos == 1) && (drive->cmdbuffer[0] == 0x5f))
439438   {
r3156r3157
555554      if (!c1551->i.iec.handshakein)
556555      {
557556         c1551->i.iec.state++;
558         DBG_LOG(1,"c1551",("taken data %.2x\n",c1551->i.iec.datain));
557
558         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551");
559         mame_printf_debug("taken data %.2x\n", c1551->i.iec.datain);
560
559561         if (c1551->cmdpos < sizeof (c1551->cmdbuffer))
560562            c1551->cmdbuffer[c1551->cmdpos++] = c1551->i.iec.datain;
561563         if ((c1551->i.iec.datain == 0x3f) || (c1551->i.iec.datain == 0x5f))
r3156r3157
643645         c1551->i.iec.state++;
644646         if ((c1551->state == 0) || (c1551->state == OPEN))
645647         {
646            DBG_LOG (1, "c1551", ("taken data %.2x\n",
647                             c1551->i.iec.datain));
648            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551");
649            mame_printf_debug("taken data %.2x\n", c1551->i.iec.datain);
650
648651            if (c1551->cmdpos < sizeof (c1551->cmdbuffer))
649652               c1551->cmdbuffer[c1551->cmdpos++] = c1551->i.iec.datain;
650653         }
651654         else if (c1551->state == WRITING)
652655         {
653            DBG_LOG (1, "c1551", ("written data %.2x\n", c1551->i.iec.datain));
656            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "c1551");
657            mame_printf_debug("written data %.2x\n", c1551->i.iec.datain);
654658         }
655659         c1551->i.iec.handshakeout = 1;
656660      }
r3156r3157
670674   }
671675
672676   if (oldstate != c1551->i.iec.state)
673      if (VERBOSE_DBG >= 1) logerror("state %d->%d %d\n", oldstate, c1551->i.iec.state, c1551->state);
677      mame_printf_debug("state %d->%d %d\n", oldstate, c1551->i.iec.state, c1551->state);
674678}
675679
676680static int vc1541_time_greater(CBM_Drive * vc1541, attotime threshold)
r3156r3157
816820         {
817821            if (vc1541->cmdpos < sizeof (vc1541->cmdbuffer))
818822               vc1541->cmdbuffer[vc1541->cmdpos++] = vc1541->i.serial.value;
819            DBG_LOG (1, "serial read", ("%s %s %.2x\n",
820                     vc1541->i.serial.broadcast ? "broad" : "",
821                     vc1541->i.serial.last ? "last" : "",
822                                 vc1541->i.serial.value));
823
824            mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "serial read");
825            mame_printf_debug("%s %s %.2x\n", vc1541->i.serial.broadcast ? "broad" : "",
826                     vc1541->i.serial.last ? "last" : "", vc1541->i.serial.value);
823827         }
824828         vc1541->i.serial.state++;
825829      }
r3156r3157
11721176      }
11731177      if (vc1541_time_greater(vc1541, ATTOTIME_IN_USEC(20)))
11741178      {
1175         DBG_LOG (1, "vc1541", ("%.2x written\n", vc1541->i.serial.value));
1179         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "vc1541");
1180         mame_printf_debug("%.2x written\n", vc1541->i.serial.value);
1181
11761182         vc1541->i.serial.data = 1;
11771183         vc1541->i.serial.clock = 0;
11781184         vc1541->i.serial.state++;
r3156r3157
12831289   }
12841290
12851291   if (oldstate != vc1541->i.serial.state)
1286      if (VERBOSE_DBG >= 1) logerror("%d state %d->%d %d %s %s %s\n",
1287             vc1541->i.serial.device,
1288             oldstate,
1289             vc1541->i.serial.state, vc1541->state,
1290             cbm_serial.atn[0] ? "ATN" : "atn",
1291             cbm_serial.clock[0] ? "CLOCK" : "clock",
1292      mame_printf_debug("%d state %d->%d %d %s %s %s\n",
1293             vc1541->i.serial.device, oldstate, vc1541->i.serial.state, vc1541->state,
1294             cbm_serial.atn[0] ? "ATN" : "atn", cbm_serial.clock[0] ? "CLOCK" : "clock",
12921295             cbm_serial.data[0] ? "DATA" : "data");
12931296}
12941297
r3156r3157
14381441   }
14391442
14401443   if (oldstate != drive->i.ieee.state)
1441      if (VERBOSE_DBG >= 1) logerror("%d state %d->%d %d\n",
1442             drive->i.ieee.device,
1443             oldstate,
1444             drive->i.ieee.state, drive->state
1445             );
1444      mame_printf_debug("%d state %d->%d %d\n", drive->i.ieee.device, oldstate,
1445             drive->i.ieee.state, drive->state);
14461446}
src/mess/machine/vc20tape.c
r3156r3157
1212#include "image.h"
1313#include "sound/dac.h"
1414
15#define VERBOSE_DBG 0
16#include "includes/cbm.h"
1715#include "includes/vc20tape.h"
1816
1917#define TONE_ON_VALUE 0xff
src/mess/machine/cbmieeeb.c
r3156r3157
300300
301301#include "driver.h"
302302
303#define VERBOSE_DBG 1
304#include "includes/cbm.h"
305
306303#include "includes/cbmdrive.h"
307304#include "includes/cbmserb.h"
308305
r3156r3157
352349
353350void cbm_ieee_dav_w(int device, int data)
354351{
355   DBG_LOG(1,"cbm ieee dav",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
352   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee dav");
353   mame_printf_debug("%.4x dev:%d %d\n", activecpu_get_pc(), device, data);
354
356355   cbmieee.bus[device].dav=data;
357356   if (device==0) c2031_state(cbm_drive);
358357}
359358
360359void cbm_ieee_nrfd_w(int device, int data)
361360{
362   DBG_LOG(1,"cbm ieee nrfd",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
361   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee nrfd");
362   mame_printf_debug("%.4x dev:%d %d\n", activecpu_get_pc(), device, data);
363
363364   cbmieee.bus[device].nrfd=data;
364365   if (device==0) c2031_state(cbm_drive);
365366}
366367
367368void cbm_ieee_ndac_w(int device, int data)
368369{
369   DBG_LOG(1,"cbm ieee ndac",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
370   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee ndac");
371   mame_printf_debug("%.4x dev:%d %d\n", activecpu_get_pc(), device, data);
372
370373   cbmieee.bus[device].ndac=data;
371374   if (device==0) c2031_state(cbm_drive);
372375}
373376
374377void cbm_ieee_atn_w(int device, int data)
375378{
376   DBG_LOG(1,"cbm ieee atn",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
379   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee atn");
380   mame_printf_debug("%.4x dev:%d %d\n", activecpu_get_pc(), device, data);
381
377382   cbmieee.bus[device].atn=data;
378383   if (device==0) c2031_state(cbm_drive);
379384}
380385
381386void cbm_ieee_eoi_w(int device, int data)
382387{
383   DBG_LOG(1,"cbm ieee eoi",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
388   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee eoi");
389   mame_printf_debug("%.4x dev:%d %d\n", activecpu_get_pc(), device, data);
390
384391   cbmieee.bus[device].eoi=data;
385392   if (device==0) c2031_state(cbm_drive);
386393}
387394
388395void cbm_ieee_data_w(int device, int data)
389396{
390   DBG_LOG(1,"cbm ieee data",("%.4x dev:%d %.2x\n", activecpu_get_pc(), device, data));
397   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee data");
398   mame_printf_debug("%.4x dev:%d %.2x\n", activecpu_get_pc(), device, data);
399
391400   cbmieee.bus[device].data=data;
392401   if (device==0) c2031_state(cbm_drive);
393402}
r3156r3157
395404int cbm_ieee_srq_r(void)
396405{
397406   int data=cbmieee.bus[1].srq;
398   DBG_LOG(1,"cbm ieee srq",("read %d\n", data));
407
408   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee srq");
409   mame_printf_debug("read %d\n", data);
410
399411   return data;
400412}
401413
402414int cbm_ieee_dav_r(void)
403415{
404416   int data=cbmieee.bus[0].dav&&cbmieee.bus[1].dav;
405   DBG_LOG(1,"cbm ieee dav",("read %d\n", data));
417
418   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee dav");
419   mame_printf_debug("read %d\n", data);
420
406421   return data;
407422}
408423
409424int cbm_ieee_nrfd_r(void)
410425{
411426   int data=cbmieee.bus[0].nrfd && cbmieee.bus[1].nrfd;
412   DBG_LOG(1,"cbm ieee nrfd",("read %d\n", data));
427
428   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee nrfd");
429   mame_printf_debug("read %d\n", data);
430
413431   return data;
414432}
415433
416434int cbm_ieee_ndac_r(void)
417435{
418436   int data=cbmieee.bus[0].ndac&&cbmieee.bus[1].ndac;
419   DBG_LOG(1,"cbm ieee ndac",("read %d\n", data));
437
438   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee ndac");
439   mame_printf_debug("read %d\n", data);
440
420441   return data;
421442}
422443
423444int cbm_ieee_atn_r(void)
424445{
425446   int data=cbmieee.bus[0].atn&&cbmieee.bus[1].atn;
426   DBG_LOG(1,"cbm ieee atn",("read %d\n", data));
447
448   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee atn");
449   mame_printf_debug("read %d\n", data);
450
427451   return data;
428452}
429453
430454int cbm_ieee_eoi_r(void)
431455{
432456   int data=cbmieee.bus[0].eoi&&cbmieee.bus[1].eoi;
433/*   DBG_LOG(1,"cbm ieee eoi",("read %d\n", data)); */
457
458//   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee eoi");
459//   mame_printf_debug("read %d\n", data));
460
434461   return data;
435462}
436463
437464int cbm_ieee_data_r(void)
438465{
439466   int data=cbmieee.bus[0].data&cbmieee.bus[1].data;
440   DBG_LOG(1,"cbm ieee data",("read %.2x\n", data));
467
468   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "cbm ieee data");
469   mame_printf_debug("read %.2x\n", data);
470
441471   return data;
442472}
443473
src/mess/machine/cbmserb.c
r3156r3157
55#include "driver.h"
66#include "image.h"
77
8#define VERBOSE_DBG 0               /* general debug messages */
9//#include "includes/cbm.h"
108#include "includes/cbmdrive.h"
119
1210#include "includes/cbmserb.h"
r3156r3157
365363static void cbm_drive_status (CBM_Drive * c1551, char *text, int size)
366364{
367365   text[0] = 0;
368#if VERBOSE_DBG
366#if 0
369367   if ((c1551->interface == SERIAL) /*&&(c1551->i.serial.device==8) */ )
370368   {
371369      snprintf (text, size, "%d state:%d %d %d %s %s %s",
src/mess/machine/tpi6525.c
r3156r3157
7474#include <ctype.h>
7575#include "driver.h"
7676
77#define VERBOSE_DBG 1
78#include "includes/cbm.h"
79
8077#include "tpi6525.h"
8178
8279TPI6525 tpi6525[4]={
r3156r3157
116113{
117114   if (!This->interrupt.level && (This->air!=0)) {
118115      This->interrupt.level=1;
119      DBG_LOG (3, "tpi6525",("%d set interrupt\n",This->number));
116
117      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tpi6525");
118      mame_printf_debug("%d set interrupt\n",This->number);
119
120120      if (This->interrupt.output!=NULL)
121121         This->interrupt.output(machine, This->interrupt.level);
122122   }
r3156r3157
126126{
127127   if (This->interrupt.level && (This->air==0)) {
128128      This->interrupt.level=0;
129      DBG_LOG (3, "tpi6525",("%d clear interrupt\n",This->number));
129
130      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tpi6525");
131      mame_printf_debug("%d clear interrupt\n",This->number);
132
130133      if (This->interrupt.output!=NULL)
131134         This->interrupt.output(machine, This->interrupt.level);
132135   }
r3156r3157
266269         if (This->c.read) data&=This->c.read();
267270         data=(data&~This->c.ddr)|(This->c.ddr&This->c.port);
268271      }
269      DBG_LOG (2, "tpi6525",
270             ("%d read %.2x %.2x\n",This->number, offset,data));
272      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tpi6525");
273      mame_printf_debug("%d read %.2x %.2x\n",This->number, offset,data);
271274      break;
272275   case 3:
273276      data=This->a.ddr;
r3156r3157
306309      tpi6525_clear_interrupt(machine, This);
307310      break;
308311   }
309   DBG_LOG (3, "tpi6525",
310          ("%d read %.2x %.2x\n",This->number, offset,data));
312   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tpi6525");
313   mame_printf_debug("%d read %.2x %.2x\n",This->number, offset,data);
311314   return data;
312315}
313316
314317static void tpi6525_port_w(running_machine *machine, TPI6525 *This, int offset, int data)
315318{
316   DBG_LOG (2, "tpi6525",
317          ("%d write %.2x %.2x\n",This->number, offset,data));
319   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tpi6525");
320   mame_printf_debug("%d write %.2x %.2x\n",This->number, offset,data);
318321
319322   switch (offset&7) {
320323   case 0:
src/mess/machine/vc20.c
r3156r3157
1717#include "image.h"
1818#include "cpu/m6502/m6502.h"
1919
20#define VERBOSE_DBG 0
21#include "includes/cbm.h"
2220#include "machine/6522via.h"
2321#include "includes/vc1541.h"
2422#include "includes/cbmserb.h"
r3156r3157
7472
7573static READ8_HANDLER( vc20_via0_read_ca2 )
7674{
77   DBG_LOG (1, "tape", ("motor read %d\n", via0_ca2));
75   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "tape");
76   mame_printf_debug("motor read %d\n", via0_ca2);
77
7878   return via0_ca2;
7979}
8080
r3156r3157
120120static WRITE8_HANDLER( vc20_via0_write_porta )
121121{
122122   cbm_serial_atn_write (serial_atn = !(data & 0x80));
123   DBG_LOG (1, "serial out", ("atn %s\n", serial_atn ? "high" : "low"));
123
124   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "serial out");
125   mame_printf_debug("atn %s\n", serial_atn ? "high" : "low");
124126}
125127
126128/* via 1 addr 0x9120
r3156r3157
317319
318320static  READ8_HANDLER( vc20_via1_read_cb1 )
319321{
320   DBG_LOG (1, "serial in", ("request read\n"));
322   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "serial in");
323   mame_printf_debug("request read\n");
324
321325   return cbm_serial_request_read ();
322326}
323327
src/mess/machine/c64.c
r3156r3157
2929#include "machine/6526cia.h"
3030#include "deprecat.h"
3131
32#define VERBOSE_DBG 1
3332#include "includes/cbm.h"
3433#include "includes/cbmserb.h"
3534#include "includes/vc1541.h"
r3156r3157
311310
312311   if (level != old_level)
313312   {
314      DBG_LOG (3, "mos6510", ("irq %s\n", level ? "start" : "end"));
313      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "mos6510");
314      mame_printf_debug("irq %s\n", level ? "start" : "end");
315
315316      if (is_c128(machine))
316317      {
317318         if (0 && (cpu_getactivecpu() == 0))
r3156r3157
446447      if (c64_cia1_on)
447448         cia_1_w(machine, offset, data);
448449      else
449         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
450         {
451         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
452         mame_printf_debug("%.3x %.2x\n", offset, data);
453         }
450454   }
451455   else if (offset < 0xf00)
452456   {
453457      /* i/o 1 */
454         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
458      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
459      mame_printf_debug("%.3x %.2x\n", offset, data);
455460   }
456461   else
457462   {
458463      /* i/o 2 */
459         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
464      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io write");
465      mame_printf_debug("%.3x %.2x\n", offset, data);
460466   }
461467}
462468
r3156r3157
501507   else if (c64_cia1_on && (offset < 0xe00))
502508      return cia_1_r(machine, offset);
503509
504   DBG_LOG (1, "io read", ("%.3x\n", offset));
510   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "io read");
511   mame_printf_debug("%.3x\n", offset);
505512
506513   return 0xff;
507514}
r3156r3157
640647   if (!c64_game && c64_exrom)
641648      ultimax_mode = 1;
642649
643   DBG_LOG (1, "bankswitch", ("%d\n", data & 7));
650   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "bankswitch");
651   mame_printf_debug("%d\n", data & 0x07);
652
644653   loram  = (data & 1) ? 1 : 0;
645654   hiram  = (data & 2) ? 1 : 0;
646655   charen = (data & 4) ? 1 : 0;
src/mess/drivers/c65.c
r3156r3157
1515#include "sound/sid6581.h"
1616#include "machine/6526cia.h"
1717
18#define VERBOSE_DBG 0
1918#include "includes/cbm.h"
2019#include "machine/cbmipt.h"
2120#include "video/vic4567.h"
src/mess/drivers/cbmb.c
r3156r3157
162162#include "sound/sid6581.h"
163163#include "machine/6526cia.h"
164164
165#define VERBOSE_DBG 0
166165#include "includes/cbm.h"
167166#include "machine/tpi6525.h"
168167#include "machine/cbmipt.h"
src/mess/drivers/c128.c
r3156r3157
297297#include "sound/sid6581.h"
298298#include "machine/6526cia.h"
299299
300#define VERBOSE_DBG 0
301300#include "includes/cbm.h"
302301#include "machine/cbmipt.h"
303302#include "video/vic6567.h"
src/mess/drivers/pet.c
r3156r3157
116116
117117#include "driver.h"
118118
119#define VERBOSE_DBG 0
120119#include "includes/cbm.h"
121120#include "machine/6821pia.h"
122121#include "machine/6522via.h"
src/mess/drivers/c16.c
r3156r3157
156156#include "driver.h"
157157#include "sound/sid6581.h"
158158
159#define VERBOSE_DBG 0
160159#include "includes/cbm.h"
161160#include "includes/cbmserb.h"
162161#include "includes/vc1541.h"
src/mess/drivers/vc20.c
r3156r3157
153153
154154#include "driver.h"
155155
156#define VERBOSE_DBG 0
157156#include "includes/cbm.h"
158157#include "machine/6522via.h"
159158#include "includes/cbmserb.h"
src/mess/drivers/c64.c
r3156r3157
194194#include "sound/sid6581.h"
195195#include "machine/6526cia.h"
196196
197#define VERBOSE_DBG 0
198197#include "includes/cbm.h"
199198#include "machine/cbmipt.h"
200199#include "video/vic6567.h"

Previous 15994 Revisions Next


© 1998-2018 The MESS Team