Ok, sorry I tend to go off on tangents. 8-)

I think that the NMI would be fixed if it didn't hit right as it starts up, maybe delayed by a little bit.


I found the ADC conversion wasn't timing correctly.

Making some crap macros to help me see how many cycles and how much time ran in between.

Code

#define LASTPASSDIFFERENCE(t, name, func, str) \
  static t staticlast##name; \
  t last##name = staticlast##name; \
  t diff##name; \
  t cur##name = func; \
  diff##name = cur##name - staticlast##name;  diff##name=diff##name;\
  printf(#name": "); \
  printf(str "\n",cur##name-last##name);\
  printf("\n");\
  staticlast##name = cur##name;

#define LASTPASSPRINT(name, str, item) \
  printf(str "\n",item##name);



so I could do

Code
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.