(I wonder how many people in the world are still using Printmaster and Dot Matrix Printers?)
While fiddling around with the cpc6128 I did encounter a strange bug. For some reason when running with the cpc6128 some of the ap2000's input ports all of a sudden went from active low to active high. This makes the printer boot up into "Data Dump Mode" because it thinks I'm holding down the Line Feed and Form Feed buttons when it starts. It's really weird that the cpc6128's doing that, because the apple2 and the amiga don't have that problem.
I'm doing a subtarget/sources build, could that be causing a problem?
So let's see if the ibm5150 will work with print shop.
Testing the printer gives an error.
So let's see if we can figure out where it's hanging up.
We'll set an i/o watchpoint with wpi 378,8,r and then when it hits, set al=df (ack is active low) and then printshop will continue. After doing that we disable the watchpoint.
This diagram from art of asm shows the status register.
So going into src/devices/machine/pc_lpt.cpp and adding an xor on STATUS_ACK seems to fix the error message.
So I wanted to see what kind of waveforms were being generated by mame audio. With ubuntu, I had to use pavucontrol to select the monitor of Built-in audio to get the system-generated sound for Audacity to record.
I did discover something interesting, that the 1-bit DAC was generating a signal when it wasn't actually doing anything. I suppose this is correct behavior, but it does answer why I am always hearing pops and crackles. When there's an audio dropout, the waveform drops to zero and there's a "click" sound.
Lowering the volume slider to zero for the 1 bit DAC makes the clicking disappear and the VU meters go down to no signal.
If you look at the recorded waveform, there's no actual sound being played, there's just a bunch of "dropouts" where other tasks are grabbing the cpu (probably because I'm doing a bunch of printf's)
Audacity's monitor shows -46 db on the VU meter.
It's interesting when I have the mockingboard enabled as there are multiple outputs which can contribute to the clicking. If you change the volume on the different channel volumes, the biasing can constructively and destructively interfere and audacity's VU meters will go up and down.
The speaker click device the A2 uses simulates capacitive coupling because otherwise it was impossible to mix its output with a Mockingboard AY-3 or the GS's ES5503. After all, the definition of a speaker click device is that the voltage is either 0 or 5 volts, nothing in between.
Can we get back to what exactly made the AP2000 work? It was the NMI-at-startup and then something with the ADCs?
LASTPASSDIFFERENCE(long int, ADCONVSCANEACH_CYCLES, total_cycles(), "T cycles = %ld expected to see 192");
LASTPASSDIFFERENCE(double, ADCONVSCAN_TIME, machine().time().as_double(), "time = %e");
LASTPASSDIFFERENCE(long int, ADCONVSCAN_CYCLES, total_cycles(), "T cycles = %ld expected to see 768");
LASTPASSDIFFERENCE(double, ADCONVSCAN_TIME, machine().time().as_double(), "time = %e");
LASTPASSDIFFERENCE(long int, ADCONVSCAN_CYCLES, total_cycles(), "T cycles = %ld expected to see 768");
//printf("m_adcnt = %d\n",m_adcnt);
//LASTPASSPRINT(ADCONVSCAN_CYCLES, "T last = %ld", last);
//LASTPASSPRINT(ADCONVSCAN_CYCLES, "T cur = %ld", cur);
//LASTPASSPRINT(ADCONVSCAN_CYCLES, "T diff = %ld", diff);
so now I get something that looks pretty good and it fixes the super fast beeping when you press a control panel button.
Code
ADCONVSCANEACH_CYCLES: T cycles = 190 expected to see 192
ADCONVSCANEACH_CYCLES: T cycles = 195 expected to see 192
ADCONVSCANEACH_CYCLES: T cycles = 194 expected to see 192
ADCONVSCANEACH_CYCLES: T cycles = 190 expected to see 192
ADCONVSCANEACH_CYCLES: T cycles = 188 expected to see 192
I'll try to work up a patch, it doesn't change very much in the code.
If this really is a problem with inexact timing, then that exemplifies a common problem with MAME's MCU cores, many of which just execute each instruction all at once and then go back and run the timers and timer-based peripherals for the same number of cycles. This works fine for purely internal interrupt timers but often fails for more sensitive cases such as serial ports.
In the past, Vas Crabb has suggested "separate icount and bcount" as the one proper solution to this problem, but much like the modern floppy system (which at least does have some readable technical documentation), only Olivier Galibert seems to have fully mastered its implementation details. While I only half-understand how it works, I'm not convinced of its effectiveness as a solution, especially after finding that Olivier Galibert's MCS-96 core, despite having this thing called "bcount" (not defined in MAME's execution core), triggers high-speed outputs at the wrong times.