Thursday, February 18, 2016

Adding a %c to printf

So looking at debugcmd.cpp there's a routine to do printf.


/*-------------------------------------------------
mini_printf - safe printf to a buffer
-------------------------------------------------*/

static int mini_printf(running_machine &machine, char *buffer, const char *format, int params, UINT64 *param)
{


and if I add this just underneath the case 'D'
    case 'c':
    if (params == 0)
    {
     debug_console_printf(machine, "Not enough parameters for format!\n");
     return 0;
    }
    p += sprintf(p, "%c", (UINT32)*param);
    param++;
    params--;
    break;

I can do this:


No comments:

Post a Comment