| 251 | } |
| 252 | |
| 253 | static struct priv_s2devstruct *getps2devstruct(TrapContext *ctx, uae_u8 *iobuf, uaecptr request) |
| 254 | { |
| 255 | int idx; |
| 256 | |
| 257 | if (iobuf) { |
| 258 | idx = get_long_host(iobuf + 24); |
| 259 | } else { |
| 260 | idx = trap_get_long(ctx, request + 24); |
| 261 | } |
| 262 | if (idx < 0 || idx >= MAX_OPEN_DEVICES || pdevst[idx].inuse == 0) { |
| 263 | write_log (_T("%s: corrupt iorequest %08X %d\n"), SANA2NAME, request, idx); |
| 264 | return 0; |
| 265 | } |
| 266 | return &pdevst[idx]; |
| 267 | } |
| 268 | |
| 269 | static int dev_thread (void *devs); |
| 270 | static int start_thread (struct s2devstruct *dev) |
no test coverage detected