Previous 15994 Revisions Next

r3168 Thursday 4th September, 2008 at 12:05:23 UTC by Fabio Priuli
a few more logerrors made conditional
[src/mess/audio]t6721.c ted7360.c vic6560.c
[src/mess/machine]tpi6525.c

src/mess/audio/vic6560.c
r3167r3168
1414#include "video/vic6560.h"
1515
1616
17#define VERBOSE_LEVEL 0
18#define DBG_LOG(N,M,A) \
19   { \
20      if(VERBOSE_LEVEL >= N) \
21      { \
22         if( M ) \
23            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) M ); \
24         logerror A; \
25      } \
26   }
27
28
1729/*
1830 * assumed model:
1931 * each write to a ton/noise generated starts it new
r3167r3168
8294         if (tone1samples == 0)
8395            tone1samples = 1;
8496      }
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);
97      DBG_LOG (1, "vic6560", ("tone1 %.2x %d\n", data, TONE1_FREQUENCY));
8798      break;
8899   case 0xb:
89100      vic6560[offset] = data;
r3167r3168
94105         if (tone2samples == 0)
95106            tone2samples = 1;
96107      }
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);
108      DBG_LOG (1, "vic6560", ("tone2 %.2x %d\n", data, TONE2_FREQUENCY));
99109      break;
100110   case 0xc:
101111      vic6560[offset] = data;
r3167r3168
106116         if (tone2samples == 0)
107117            tone2samples = 1;
108118      }
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);
119      DBG_LOG (1, "vic6560", ("tone3 %.2x %d\n", data, TONE3_FREQUENCY));
111120      break;
112121   case 0xd:
113122      vic6560[offset] = data;
r3167r3168
115124      {
116125         noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * machine->sample_rate
117126                          * NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
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
127         DBG_LOG (1, "vic6560", ("noise %.2x %d sample:%d\n",
128                           data, NOISE_FREQUENCY, noisesamples));
122129         if ((double) noisepos / noisesamples >= 1.0)
123130         {
124131            noisepos = 0;
r3167r3168
131138      break;
132139   case 0xe:
133140      vic6560[offset] = (old & ~0xf) | (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);
141      DBG_LOG (3, "vic6560", ("volume %d\n", data & 0xf));
136142      break;
137143   }
138144}
src/mess/audio/t6721.c
r3167r3168
1919
2020#include "machine/tpi6525.h"
2121
22
23#define VERBOSE_LEVEL 0
24#define DBG_LOG(N,M,A) \
25   { \
26      if(VERBOSE_LEVEL >= N) \
27      { \
28         if( M ) \
29            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) M ); \
30         logerror A; \
31      } \
32   }
33
34
35
2236/*
2337 c364 speech
2438 say 0 .. 10
r3167r3168
102116
103117WRITE8_HANDLER(c364_speech_w)
104118{
105   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "364");
106   mame_printf_debug("port write %.2x %.2x\n", offset, data);
107
119   DBG_LOG (2, "364", ("port write %.2x %.2x\n", offset, data));
108120   switch (offset) {
109121   case 0:
110122      if (data&0x80) {
r3167r3168
151163      break;
152164   case 2:
153165      speech.sample.data[speech.sample.index++]=data;
154      if (speech.sample.index==sizeof(speech.sample.data))
155      {
156         mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "t6721");
157         mame_printf_debug("%.2x%.2x%.2x%.2x%.2x%.2x\n", speech.sample.data[0], speech.sample.data[1],
158                  speech.sample.data[2], speech.sample.data[3], speech.sample.data[4], speech.sample.data[5]);
166      if (speech.sample.index==sizeof(speech.sample.data)) {
167         DBG_LOG(1,"t6721",("%.2x%.2x%.2x%.2x%.2x%.2x\n",
168                        speech.sample.data[0],
169                        speech.sample.data[1],
170                        speech.sample.data[2],
171                        speech.sample.data[3],
172                        speech.sample.data[4],
173                        speech.sample.data[5]));
159174         speech.sample.index=0;
160175         /*speech.endOfSample=false; */
161176         speech.busy=TRUE;
r3167r3168
178193      }
179194      break;
180195   }
181   mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "364");
182   mame_printf_debug("port read %.2x %.2x\n", offset, data);
196   DBG_LOG (2, "364", ("port read %.2x %.2x\n", offset, data));
183197   return data;
184198}
199
200
src/mess/audio/ted7360.c
r3167r3168
1414#include "video/ted7360.h"
1515
1616
17#define VERBOSE_LEVEL 0
18#define DBG_LOG(N,M,A) \
19   { \
20      if(VERBOSE_LEVEL >= N) \
21      { \
22         if( M ) \
23            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) M ); \
24         logerror A; \
25      } \
26   }
27
28
1729/* noise channel: look into vic6560.c */
1830#define NOISE_BUFFER_SIZE_SEC 5
1931
r3167r3168
5567      else
5668         ted7360[offset] = data;
5769      tone1samples = machine->sample_rate / TONE_FREQUENCY (TONE1_VALUE);
58      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
59      mame_printf_debug("tone1 %d %d sample:%d\n", TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), tone1samples);
70      DBG_LOG (1, "ted7360", ("tone1 %d %d sample:%d\n",
71               TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), tone1samples));
6072
6173      break;
6274   case 0xf:
6375   case 0x10:
6476      ted7360[offset] = data;
6577      tone2samples = machine->sample_rate / TONE_FREQUENCY (TONE2_VALUE);
66      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
67      mame_printf_debug("tone2 %d %d sample:%d\n", TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), tone2samples);
78      DBG_LOG (1, "ted7360", ("tone2 %d %d sample:%d\n",
79               TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), tone2samples));
6880
6981      noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * machine->sample_rate
7082                       * NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
71      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
72      mame_printf_debug("noise %d sample:%d\n", NOISE_FREQUENCY, noisesamples);
83      DBG_LOG (1, "ted7360", ("noise %d sample:%d\n",
84               NOISE_FREQUENCY, noisesamples));
7385      if (!NOISE_ON || ((double) noisepos / noisesamples >= 1.0))
7486      {
7587         noisepos = 0;
r3167r3168
7789      break;
7890   case 0x11:
7991      ted7360[offset] = data;
80
81      mame_printf_debug("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) "ted7360");
82      mame_printf_debug("%s volume %d, %s %s %s\n", TONE_ON?"on":"off", VOLUME,
83                     TONE1_ON?"tone1":"", TONE2_ON?"tone2":"", NOISE_ON?"noise":"");
84
92      DBG_LOG(1, "ted7360", ("%s volume %d, %s %s %s\n",
93                   TONE_ON?"on":"off",
94                   VOLUME, TONE1_ON?"tone1":"", TONE2_ON?"tone2":"",
95                   NOISE_ON?"noise":""));
8596      if (!TONE_ON||!TONE1_ON) tone1pos=0;
8697      if (!TONE_ON||!TONE2_ON) tone2pos=0;
8798      if (!TONE_ON||!NOISE_ON) noisepos=0;
r3167r3168
185196   }
186197   return (void *) ~0;
187198}
199
src/mess/machine/tpi6525.c
r3167r3168
7676
7777#include "tpi6525.h"
7878
79
80#define VERBOSE_LEVEL 0
81#define DBG_LOG(N,M,A) \
82   { \
83      if(VERBOSE_LEVEL >= N) \
84      { \
85         if( M ) \
86            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time()), (char*) M ); \
87         logerror A; \
88      } \
89   }
90
91
7992TPI6525 tpi6525[4]={
8093   { 0 },
8194   { 1 },
r3167r3168
113126{
114127   if (!This->interrupt.level && (This->air!=0)) {
115128      This->interrupt.level=1;
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
129      DBG_LOG (3, "tpi6525",("%d set interrupt\n",This->number));
120130      if (This->interrupt.output!=NULL)
121131         This->interrupt.output(machine, This->interrupt.level);
122132   }
r3167r3168
126136{
127137   if (This->interrupt.level && (This->air==0)) {
128138      This->interrupt.level=0;
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
139      DBG_LOG (3, "tpi6525",("%d clear interrupt\n",This->number));
133140      if (This->interrupt.output!=NULL)
134141         This->interrupt.output(machine, This->interrupt.level);
135142   }
r3167r3168
269276         if (This->c.read) data&=This->c.read();
270277         data=(data&~This->c.ddr)|(This->c.ddr&This->c.port);
271278      }
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);
279      DBG_LOG (2, "tpi6525",
280             ("%d read %.2x %.2x\n",This->number, offset,data));
274281      break;
275282   case 3:
276283      data=This->a.ddr;
r3167r3168
309316      tpi6525_clear_interrupt(machine, This);
310317      break;
311318   }
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);
319   DBG_LOG (3, "tpi6525",
320          ("%d read %.2x %.2x\n",This->number, offset,data));
314321   return data;
315322}
316323
317324static void tpi6525_port_w(running_machine *machine, TPI6525 *This, int offset, int data)
318325{
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);
326   DBG_LOG (2, "tpi6525",
327          ("%d write %.2x %.2x\n",This->number, offset,data));
321328
322329   switch (offset&7) {
323330   case 0:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team