1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-08 20:31:31 +00:00
cc65/libsrc/rp6502/xregn.c
2024-02-17 16:02:57 -08:00

20 lines
455 B
C

#include <rp6502.h>
#include <stdarg.h>
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
...)
{
va_list args;
va_start (args, count);
RIA.xstack = device;
RIA.xstack = channel;
RIA.xstack = address;
while (count--) {
unsigned v = va_arg (args, unsigned);
RIA.xstack = v >> 8;
RIA.xstack = v;
}
va_end (args);
return ria_call_int_errno (RIA_OP_XREG);
}