I wrote:

It seems the the OS_Mouse SWI is not working when called
from C code with RPCEmu 0.88 on Windows 7.

while (1)
{
 if (_kernel_swi(OS_Mouse, &regs, &regs) == 0)
{
      printf("\004%d,%d\n\005", regs.r[0], regs.r[1]);
}
}

[snip]

Having debugged RPCEmu using a version of the above code
using _swix I believe I have found the problem. On my setup
(RISC OS 4 using GCC4) this code ends up using OS_CallASWIR12
rather than calling OS_Mouse directly so the code that intercepts
OS_Mouse in RPCEmu is never called.

A fix would be to add:

/* Get actual switch number of OS_CallASWI and OS_CallASWIR12 */
if (templ == 0x6f) templ=armregs[10] & 0xdffff;
else if (templ == 0x71) templ = armregs[12] & 0xdffff;

in the osSWI subroutine in arm_common.c after:

void
opSWI(uint32_t opcode)
{
   uint32_t templ;

   inscount++;
   rinscount++;
   templ = opcode & 0xdffff;

Can someone check this and update the source code so it is
fixed for the next release please?

Regards,
Alan


_______________________________________________
Rpcemu mailing list
[email protected]
http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu

Reply via email to