hoglet67 / PiTubeDirect

Bare-metal Raspberry Pi project that attaches to the Acorn TUBE interface and emulates many BBC Micro Co Processors
GNU General Public License v3.0
187 stars 23 forks source link

tube_SWI_NumberFromString doesn't work for OS_WriteI #146

Closed dp111 closed 2 years ago

dp111 commented 2 years ago

in tube-swi.c tube_SWI_NumberFromString doesn't work :

  // Special case OS_WriteI as they are not in the handler table
  if (!strcmp(mod_name, "OS") && !strcmp(swi_name, "WriteI")) {
     reg[0] = x_flag + 0x100 + i;
     return;
  }

In the above code "i" is effectively uninitialised

dp111 commented 2 years ago

Does this mean the OS SWI table could be extended to have OS_WriteI at the end and the special case isn't needed ?

hoglet67 commented 2 years ago

I initially did that, then changed to the current pattern for a reason I don't recall!

Looking at the code now, I don't see why we couldn't do that.

But possibly we have more pressing bugs, e.g. #147