1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
diff -Naur jzintv-1.0-beta3/src/cp1600/emu_link.c jzintv-1.0-beta3.patched/src/cp1600/emu_link.c
--- jzintv-1.0-beta3/src/cp1600/emu_link.c 2006-07-05 22:11:46.000000000 -0400
+++ jzintv-1.0-beta3.patched/src/cp1600/emu_link.c 2009-02-04 19:12:58.000000000 -0500
@@ -103,18 +103,18 @@
if (cpu->r[0] != 0x4A5A)
return;
- //dprintf(("\nEMU-LINK %.4X %.4X %.4X\n", cpu->r[1], cpu->r[2], cpu->r[3]));
+ //jzintv_dprintf(("\nEMU-LINK %.4X %.4X %.4X\n", cpu->r[1], cpu->r[2], cpu->r[3]));
if (cpu->r[1] > emu_link_api_cnt ||
emu_link_api[cpu->r[1]] == NULL)
{
- //dprintf(("EMU-LINK Invalid API\n"));
+ //jzintv_dprintf(("EMU-LINK Invalid API\n"));
cpu->C = 1;
cpu->r[0] = 0xFFFF;
return;
}
cpu->r[0] = emu_link_api[cpu->r[1]](cpu, &fail);
- //dprintf(("EMU-LINK Result: %.4X %d\n", cpu->r[0], fail));
+ //jzintv_dprintf(("EMU-LINK Result: %.4X %d\n", cpu->r[0], fail));
cpu->C = fail != 0;
return;
diff -Naur jzintv-1.0-beta3/src/gif/lzw_enc.c jzintv-1.0-beta3.patched/src/gif/lzw_enc.c
--- jzintv-1.0-beta3/src/gif/lzw_enc.c 2006-07-03 01:04:46.000000000 -0400
+++ jzintv-1.0-beta3.patched/src/gif/lzw_enc.c 2009-02-04 19:12:58.000000000 -0500
@@ -14,9 +14,9 @@
#include "config.h"
#ifdef DEBUG
-# define dprintf(x) jzp_printf x
+# define jzintv_dprintf(x) jzp_printf x
#else
-# define dprintf(x)
+# define jzintv_dprintf(x)
#endif
@@ -46,7 +46,7 @@
if (i_buf[i] > max_sym)
max_sym = i_buf[i];
dict_stride = max_sym + 1;
- dprintf(("max_sym = %.2X\n", max_sym));
+ jzintv_dprintf(("max_sym = %.2X\n", max_sym));
/* -------------------------------------------------------------------- */
/* Compute and output the starting code-size. */
@@ -54,7 +54,7 @@
for (code_size = 2; code_size < 8; code_size++)
if ((1 << code_size) > max_sym)
break;
- dprintf(("code_size = %.2X\n", code_size));
+ jzintv_dprintf(("code_size = %.2X\n", code_size));
/* -------------------------------------------------------------------- */
/* Allocate the dictionary. We store the tree in a 2-D array. One */
/* dimension is the code number, and the other is the codes it chains */
@@ -89,7 +89,7 @@
/* -------------------------------------------------------------------- */
while (i_ptr <= i_end && code != end_of_info)
{
- dprintf(("remaining: %10d\n", i_end - i_ptr));
+ jzintv_dprintf(("remaining: %10d\n", i_end - i_ptr));
/* ---------------------------------------------------------------- */
/* If dictionary's full, send a clear code and flush dictionary. */
@@ -97,7 +97,7 @@
/* ---------------------------------------------------------------- */
if (next_new_code == 0x1000)
{
- dprintf(("CLEAR %.3X %d\n", clear_code, curr_size));
+ jzintv_dprintf(("CLEAR %.3X %d\n", clear_code, curr_size));
curr_word |= clear_code << curr_bits;
curr_bits += curr_size;
@@ -106,7 +106,7 @@
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n",
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n",
last_len_byte, o_ptr));
*last_len_byte = 255;
@@ -125,7 +125,7 @@
memset(dict, 0, 4096*sizeof(uint_16)*dict_stride);
} else
{
- dprintf(("new code: %.3X = %.3X + %.2X\n", next_new_code,
+ jzintv_dprintf(("new code: %.3X = %.3X + %.2X\n", next_new_code,
code, next_char));
dict[code*dict_stride + next_char] = next_new_code;
@@ -135,7 +135,7 @@
}
code = next_char; /* Previous concat becomes new initial code */
- dprintf(("next code: %.2X %c\n", code, code == end_of_info ? '*':' '));
+ jzintv_dprintf(("next code: %.2X %c\n", code, code == end_of_info ? '*':' '));
/* ---------------------------------------------------------------- */
/* Keep concatenating as long as we stay in the dictionary. */
@@ -143,7 +143,7 @@
if (i_ptr == i_end)
{
next_char = end_of_info;
- dprintf(("--> next is EOI!\n"));
+ jzintv_dprintf(("--> next is EOI!\n"));
} else
{
next_code = -1;
@@ -151,7 +151,7 @@
{
next_char = *i_ptr++;
next_code = dict[code*dict_stride + next_char];
- dprintf(("--> code: %.3X + %.2X = %.3X\n", code,
+ jzintv_dprintf(("--> code: %.3X + %.2X = %.3X\n", code,
next_char, next_code));
if (next_code)
@@ -162,7 +162,7 @@
if (next_char == end_of_info)
{
- dprintf(("--> next is EOI! (b)\n"));
+ jzintv_dprintf(("--> next is EOI! (b)\n"));
}
}
@@ -174,14 +174,14 @@
/* ---------------------------------------------------------------- */
curr_word |= code << curr_bits;
curr_bits += curr_size;
- dprintf(("SEND %.4X %d curr: %.8X %2d\n", code, curr_size,
+ jzintv_dprintf(("SEND %.4X %d curr: %.8X %2d\n", code, curr_size,
curr_word, curr_bits));
while (curr_bits > 8)
{
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte,
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte,
o_ptr));
*last_len_byte = 255;
last_len_byte = o_ptr++;
@@ -203,7 +203,7 @@
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte, o_ptr));
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte, o_ptr));
*last_len_byte = 255;
last_len_byte = o_ptr++;
}
@@ -223,7 +223,7 @@
*last_len_byte = o_ptr - last_len_byte - 1;
*o_ptr++ = 0;
- dprintf(("encoded %d bytes\n", o_ptr - o_buf));
+ jzintv_dprintf(("encoded %d bytes\n", o_ptr - o_buf));
return o_ptr - o_buf;
@@ -232,11 +232,11 @@
}
//#define DEBUG
-#undef dprintf
+#undef jzintv_dprintf
#ifdef DEBUG
-# define dprintf(x) jzp_printf x
+# define jzintv_dprintf(x) jzp_printf x
#else
-# define dprintf(x)
+# define jzintv_dprintf(x)
#endif
int lzw_encode2(const uint_8 *i_buf, const uint_8 *i_buf_alt,
@@ -270,7 +270,7 @@
}
dict_stride = max_sym + 1;
- dprintf(("max_sym = %.2X\n", max_sym));
+ jzintv_dprintf(("max_sym = %.2X\n", max_sym));
/* -------------------------------------------------------------------- */
/* Compute and output the starting code-size. */
@@ -278,7 +278,7 @@
for (code_size = 2; code_size < 8; code_size++)
if ((1 << code_size) > max_sym)
break;
- dprintf(("code_size = %.2X\n", code_size));
+ jzintv_dprintf(("code_size = %.2X\n", code_size));
/* -------------------------------------------------------------------- */
/* Allocate the dictionary. We store the tree in a 2-D array. One */
/* dimension is the code number, and the other is the codes it chains */
@@ -312,7 +312,7 @@
/* -------------------------------------------------------------------- */
while (i_idx <= i_len && code != end_of_info)
{
- dprintf(("remaining: %10d\n", i_len - i_idx));
+ jzintv_dprintf(("remaining: %10d\n", i_len - i_idx));
/* ---------------------------------------------------------------- */
/* If dictionary's full, send a clear code and flush dictionary. */
@@ -320,7 +320,7 @@
/* ---------------------------------------------------------------- */
if (next_new_code == 0x1000)
{
- dprintf(("CLEAR %.3X %d\n", clear_code, curr_size));
+ jzintv_dprintf(("CLEAR %.3X %d\n", clear_code, curr_size));
curr_word |= clear_code << curr_bits;
curr_bits += curr_size;
@@ -329,7 +329,7 @@
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n",
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n",
last_len_byte, o_ptr));
*last_len_byte = 255;
@@ -348,7 +348,7 @@
memset(dict, 0, 4096*sizeof(uint_16)*dict_stride);
} else
{
- dprintf(("new code: %.3X = %.3X + %.2X\n", next_new_code,
+ jzintv_dprintf(("new code: %.3X = %.3X + %.2X\n", next_new_code,
code, next_char));
dict[code*dict_stride + next_char] = next_new_code;
@@ -358,7 +358,7 @@
}
code = next_char; /* Previous concat becomes new initial code */
- dprintf(("next code: %.2X %c\n", code, code == end_of_info ? '*':' '));
+ jzintv_dprintf(("next code: %.2X %c\n", code, code == end_of_info ? '*':' '));
/* ---------------------------------------------------------------- */
/* Keep concatenating as long as we stay in the dictionary. */
@@ -366,7 +366,7 @@
if (i_idx == i_len)
{
next_char = end_of_info;
- dprintf(("--> next is EOI!\n"));
+ jzintv_dprintf(("--> next is EOI!\n"));
} else
{
next_code = -1;
@@ -378,19 +378,19 @@
if ((tmp = dict[code*dict_stride + i_buf[i_idx]]) != 0)
{
next_code = tmp;
- dprintf(("--> code: %.3X + %.2X(a) = %.3X\n", code,
+ jzintv_dprintf(("--> code: %.3X + %.2X(a) = %.3X\n", code,
next_char, next_code));
} else
if ((tmp = dict[code*dict_stride + i_buf_alt[i_idx]]) != 0)
{
next_char = i_buf_alt[i_idx];
next_code = tmp;
- dprintf(("--> code: %.3X + %.2X(b) = %.3X\n", code,
+ jzintv_dprintf(("--> code: %.3X + %.2X(b) = %.3X\n", code,
next_char, next_code));
} else
{
next_code = 0;
- dprintf(("--> code: %.3X + %.2X(c) = %.3X\n", code,
+ jzintv_dprintf(("--> code: %.3X + %.2X(c) = %.3X\n", code,
next_char, next_code));
}
i_idx++;
@@ -403,7 +403,7 @@
if (next_char == end_of_info)
{
- dprintf(("--> next is EOI! (b)\n"));
+ jzintv_dprintf(("--> next is EOI! (b)\n"));
}
}
@@ -415,14 +415,14 @@
/* ---------------------------------------------------------------- */
curr_word |= code << curr_bits;
curr_bits += curr_size;
- dprintf(("SEND %.4X %d curr: %.8X %2d\n", code, curr_size,
+ jzintv_dprintf(("SEND %.4X %d curr: %.8X %2d\n", code, curr_size,
curr_word, curr_bits));
while (curr_bits > 8)
{
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte,
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte,
o_ptr));
*last_len_byte = 255;
last_len_byte = o_ptr++;
@@ -444,7 +444,7 @@
/* Handle packaging data into 256-byte records */
if (o_ptr - last_len_byte == 256)
{
- dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte, o_ptr));
+ jzintv_dprintf(("last_len_byte=%.8X o_ptr=%.8X\n", last_len_byte, o_ptr));
*last_len_byte = 255;
last_len_byte = o_ptr++;
}
@@ -464,7 +464,7 @@
*last_len_byte = o_ptr - last_len_byte - 1;
*o_ptr++ = 0;
- dprintf(("encoded %d bytes\n", o_ptr - o_buf));
+ jzintv_dprintf(("encoded %d bytes\n", o_ptr - o_buf));
return o_ptr - o_buf;
diff -Naur jzintv-1.0-beta3/src/ivoice/ivoice.c jzintv-1.0-beta3.patched/src/ivoice/ivoice.c
--- jzintv-1.0-beta3/src/ivoice/ivoice.c 2006-07-05 22:11:46.000000000 -0400
+++ jzintv-1.0-beta3.patched/src/ivoice/ivoice.c 2009-02-04 19:12:58.000000000 -0500
@@ -44,9 +44,9 @@
//#define DEBUG
#ifdef DEBUG
-#define dprintf(x) jzp_printf x ; jzp_flush()
+#define jzintv_dprintf(x) jzp_printf x ; jzp_flush()
#else
-#define dprintf(x)
+#define jzintv_dprintf(x)
#endif
#undef HIGH_QUALITY
@@ -1086,7 +1086,7 @@
iv_smp_ckupd(iv, immed4*16 + opcode);
- dprintf(("$%.4X.%.1X: OPCODE %d%d%d%d.%d%d\n",
+ jzintv_dprintf(("$%.4X.%.1X: OPCODE %d%d%d%d.%d%d\n",
(iv->pc >> 3) - 1, iv->pc & 7,
!!(opcode & 1), !!(opcode & 2),
!!(opcode & 4), !!(opcode & 8),
@@ -1211,7 +1211,7 @@
/* ---------------------------------------------------------------- */
if (ctrl_xfer)
{
- dprintf(("jumping to $%.4X.%.1X: ", iv->pc >> 3, iv->pc & 7));
+ jzintv_dprintf(("jumping to $%.4X.%.1X: ", iv->pc >> 3, iv->pc & 7));
/* ------------------------------------------------------------ */
/* Set our "FIFO Selected" flag based on whether we're going */
@@ -1219,7 +1219,7 @@
/* ------------------------------------------------------------ */
iv->fifo_sel = iv->pc == FIFO_ADDR;
- dprintf(("%s ", iv->fifo_sel ? "FIFO" : "ROM"));
+ jzintv_dprintf(("%s ", iv->fifo_sel ? "FIFO" : "ROM"));
/* ------------------------------------------------------------ */
/* Control transfers to the FIFO cause it to discard the */
@@ -1227,14 +1227,14 @@
/* ------------------------------------------------------------ */
if (iv->fifo_sel && iv->fifo_bitp)
{
- dprintf(("bitp = %d -> Flush", iv->fifo_bitp));
+ jzintv_dprintf(("bitp = %d -> Flush", iv->fifo_bitp));
/* Discard partially-read decle. */
if (iv->fifo_tail < iv->fifo_head) iv->fifo_tail++;
iv->fifo_bitp = 0;
}
- dprintf(("\n"));
+ jzintv_dprintf(("\n"));
continue;
}
@@ -1255,7 +1255,7 @@
#endif
iv->filt.rpt = repeat + 1;
- dprintf(("repeat = %d\n", repeat));
+ jzintv_dprintf(("repeat = %d\n", repeat));
i = (opcode << 3) | (iv->mode & 6);
idx0 = sp0256_df_idx[i++];
@@ -1285,7 +1285,7 @@
field = cr & CR_FIELD;
value = 0;
- dprintf(("$%.4X.%.1X: len=%2d shf=%2d prm=%2d d=%d f=%d ",
+ jzintv_dprintf(("$%.4X.%.1X: len=%2d shf=%2d prm=%2d d=%d f=%d ",
iv->pc >> 3, iv->pc & 7, len, shf, prm, !!delta, !!field));
/* ------------------------------------------------------------ */
/* Clear any registers that were requested to be cleared. */
@@ -1313,7 +1313,7 @@
}
else
{
- dprintf((" (no update)\n"));
+ jzintv_dprintf((" (no update)\n"));
continue;
}
@@ -1331,7 +1331,7 @@
if (shf)
value <<= shf;
- dprintf(("v=%.2X (%c%.2X) ", value & 0xFF,
+ jzintv_dprintf(("v=%.2X (%c%.2X) ", value & 0xFF,
value & 0x80 ? '-' : '+',
0xFF & (value & 0x80 ? -value : value)));
@@ -1342,12 +1342,12 @@
/* ------------------------------------------------------------ */
if (field)
{
- dprintf(("--field-> r[%2d] = %.2X -> ", prm, iv->filt.r[prm]));
+ jzintv_dprintf(("--field-> r[%2d] = %.2X -> ", prm, iv->filt.r[prm]));
iv->filt.r[prm] &= ~(~0 << shf); /* Clear the old bits. */
iv->filt.r[prm] |= value; /* Merge in the new bits. */
- dprintf(("%.2X\n", iv->filt.r[prm]));
+ jzintv_dprintf(("%.2X\n", iv->filt.r[prm]));
continue;
}
@@ -1357,11 +1357,11 @@
/* ------------------------------------------------------------ */
if (delta)
{
- dprintf(("--delta-> r[%2d] = %.2X -> ", prm, iv->filt.r[prm]));
+ jzintv_dprintf(("--delta-> r[%2d] = %.2X -> ", prm, iv->filt.r[prm]));
iv->filt.r[prm] += value;
- dprintf(("%.2X\n", iv->filt.r[prm]));
+ jzintv_dprintf(("%.2X\n", iv->filt.r[prm]));
continue;
}
@@ -1370,7 +1370,7 @@
/* Otherwise, just write the new value. */
/* ------------------------------------------------------------ */
iv->filt.r[prm] = value;
- dprintf(("--value-> r[%2d] = %.2X\n", prm, iv->filt.r[prm]));
+ jzintv_dprintf(("--value-> r[%2d] = %.2X\n", prm, iv->filt.r[prm]));
}
/* ---------------------------------------------------------------- */
@@ -1727,7 +1727,7 @@
/* ---------------------------------------------------------------- */
if ((ivoice->fifo_head - ivoice->fifo_tail) >= 64)
{
- dprintf(("IV: Dropped FIFO write\n"));
+ jzintv_dprintf(("IV: Dropped FIFO write\n"));
return;
}
|