From 1ffb3e6c6b00f7fa401c6a5b36a84c4d21b189b8 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 23 Oct 2021 20:03:22 +0300 Subject: [PATCH] Shell command execution wip --- filesys.asm | 221 +++++++++++++++++++++- filesys.cpp | 158 ++++++++++++++++ filesys_bootrom.cpp | 176 +++++++++++------ include/filesys.h | 4 + include/native2amiga_api.h | 1 + native2amiga.cpp | 9 + od-win32/cloanto/RetroPlatformIPC-doc.txt | 144 +++++++++++--- od-win32/cloanto/RetroPlatformIPC.h | 130 +++++++++++-- od-win32/keyboard_win32.cpp | 11 +- od-win32/rp.cpp | 56 ++++++ od-win32/rp.h | 1 + 11 files changed, 803 insertions(+), 108 deletions(-) diff --git a/filesys.asm b/filesys.asm index db0c7152..7bfafab6 100644 --- a/filesys.asm +++ b/filesys.asm @@ -508,6 +508,8 @@ FSIN_chip_done rts EREM + ; d1 = stacksize + ; d2 = priority createproc movem.l d2-d5/a2/a6,-(sp) moveq #0,d5 @@ -674,7 +676,16 @@ EXTT_notificationhack: bra.w EXTT_loop EXTT_shellexec cmp.w #6,d0 + bgt.s EXTT_shellexec2 + bsr.s doshellexecute + bra.w EXTT_loop +EXTT_shellexec2 + cmp.w #7,d0 bgt.w EXTT_loop + bsr.s doshellexecute2 + bra.w EXTT_loop + +doshellexecute lea shellexecname(pc),a0 lea shellexecproc(pc),a1 moveq #1,d0 @@ -685,7 +696,215 @@ EXTT_shellexec bsr.w getrtbaselocal moveq #20,d0 jsr (a0) - bra.w EXTT_loop + rts + +doshellexecute2 + movem.l d2-d4/a2-a4,-(sp) + sub.l a4,a4 + moveq #0,d3 + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbaselocal + move.l a0,a3 + moveq #30,d0 + jsr (a3) + ; returns requested data size in D0 + move.l d0,d2 + beq.s .end1 + move.l #65536+1,d1 + jsr AllocMem(a6) + move.l d0,a4 + tst.l d0 + beq.s .she1 + move.l d2,(a4) + lea shellexecname(pc),a0 + lea shellexecproc2(pc),a1 + moveq #1,d0 + move.l #4096,d1 + bsr.w createproc + move.l d0,d3 + beq.s .she1 + sub.l #92,d3 +.she1 + moveq #31,d0 + move.l a4,a0 + ; send process struct and data + move.l d3,d1 + jsr (a3) + tst.l d3 + beq.s .end2 + move.l a4,d0 + beq.s .end2 + move.l d3,a1 ; Task + moveq #0,d0 + bset #13,d0 ; SIGBREAK_CTRL_D + jsr -$144(a6) ; Signal + bra.s .end1 +.end2 + move.l a4,d0 + beq.s .end1 + move.l a4,a1 + move.l (a4),d0 + jsr FreeMem(a6) +.end1 + movem.l (sp)+,d2-d4/a2-a4 + rts + + cnop 0,4 + dc.l 16 +shellexecproc2 + dc.l 0 + + move.l 4.w,a6 + lea doslibname(pc),a1 + moveq #0,d0 + jsr -$228(a6) ; OpenLibrary + move.l d0,d6 + + moveq #0,d0 + bset #13,d0 ; SIGBREAK_CTRL_D + jsr -$013e(a6) ;Wait + + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbaselocal + moveq #32,d0 + ; get data + jsr (a0) + move.l d0,a4 ;data + + ; 0 L size (including this field) + ; 4 PT command + ; 8 PT params + ; 12 PT dir + ; 16 PT command + params + ; 20 L stack size + ; 24 L priority + ; 28 L flags + ; 32 L id + ; 36 L datasize + ; 40 PT data + + exg d6,a6 + + move.l sp,a3 + lea -8*8(sp),sp + move.l sp,d5 + move.l d5,a2 + + ; SYS_Input + move.l #$80000000+32+1,(a2)+ + lea nil_name(pc),a0 + move.l a0,d1 + move.l #1005,d2 + jsr -$1e(a6) ;Open + move.l d0,(a2)+ + + ; SYS_Output + move.l #$80000000+32+2,(a2)+ + lea nil_name(pc),a0 + move.l a0,d1 + jsr -$1e(a6) ;Open + move.l d0,(a2)+ + + ; NP_CurrentDir + moveq #1,d0 ; TAG_IGNORE + move.l d0,(a2)+ + moveq #0,d0 + move.l d0,(a2)+ + move.l 12(a4),a0 + tst.b (a0) + beq.s .nodir1 + move.l a0,d1 + moveq #-2,d2 + jsr -$0054(a6) ;Lock + tst.l d0 + beq.s .nodir1 + subq.l #8,a2 + move.l #$80000000+1000+10,(a2)+ + move.l d0,(a2)+ +.nodir1 + + ; NP_StackSize + move.l 20(a4),d0 + beq.s .stk1 + move.l #$80000000+1000+11,(a2)+ + move.l d0,(a2)+ +.stk1 + + ; NP_Priority + move.l #$80000000+1000+13,(a2)+ + move.l 24(a4),(a2)+ + + ; NP_WindowPtr + moveq #1,d0 ; TAG_IGNORE + move.l d0,(a2)+ + moveq #0,d0 + move.l d0,(a2)+ + move.l 28(a4),d0 + btst #2,d0 + beq.s .nowp1 + subq.l #8,a2 + move.l #$80000000+1000+15,(a2)+ + moveq #-1,d0 + move.l d0,(a2)+ +.nowp1 + + clr.l (a2)+ + clr.l (a2) + move.l d5,a2 + + cmp.w #36,20(a6) + bcc.s .seproc5 + + move.l 16(a4),d1 ; Command + moveq #0,d2 ;Input + move.l 1*8+4(a2),d3 ;Output + jsr -$de(a6) ;Execute + + bra.s .seproc4 + +.seproc5 + move.l 16(a4),d1 + move.l a2,d2 + jsr -$25e(a6) ; SystemTagList + +.seproc4 + move.l d0,d2 + + move.l 0*8+4(a2),d1 + beq.s .nof2 + jsr -$24(a6) ;Close +.nof2 + move.l 1*8+4(a2),d1 + beq.s .nof3 + jsr -$24(a6) ;Close +.nof3 + cmp.l #-1,d2 + bne.s .nof1 + move.l 2*8+4(a2),d1 + beq.s .nof1 + jsr -$5a(a6) ;Unlock +.nof1 + + move.l a3,sp + + exg d6,a6 + + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbaselocal + moveq #33,d0 + move.l d2,d1 + move.l a4,a1 + ; return status + jsr (a0) + + move.l d6,a1 + jsr -$19e(a6) + + move.l a4,a1 + move.l (a4),d0 + jsr FreeMem(a6) + moveq #0,d0 + rts exter_server_new: moveq #0,d0 diff --git a/filesys.cpp b/filesys.cpp index d92c7505..245c9577 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -481,6 +481,156 @@ typedef struct _unit { } Unit; +struct ShellExecute2 +{ + uae_u32 size; + char *file, *parms, *currentdir; + char *fileparms; + uae_u32 stack; + uae_s32 priority; + uae_u32 flags; + uae_u32 id; + uae_u32 binsize; + uae_u8 *bin; + + uaecptr process; + uaecptr buffer; + uae_u32 exitcode; + shellexecute2_callback cb; +}; + +static struct ShellExecute2 shellexecute2[1]; + +static void shellexecute2_free(struct ShellExecute2 *se2) +{ + xfree(se2->file); + xfree(se2->currentdir); + xfree(se2->parms); + xfree(se2->bin); + memset(se2, 0, sizeof(struct ShellExecute2)); +} + +#define ShellExecute2_Struct_Start (5 * 4) +#define ShellExecute2_Struct_Start2 (4 * 4) + +static int filesys_shellexecute2_process(int mode, TrapContext *ctx) +{ + struct ShellExecute2 *se2 = &shellexecute2[0]; + + write_log(_T("filesys_shellexecute2_process %d\n"), mode); + + if (mode == 30) { + // request Amiga side buffer size + int size = ShellExecute2_Struct_Start + ShellExecute2_Struct_Start2; + size += 2 * (strlen(se2->file) + 1); + size += strlen(se2->currentdir) + 1; + size += 2 * (strlen(se2->parms) + 1); + size++; + size += se2->binsize + 4; + return size; + } + if (mode == 31) { + // a0 = buffer + // d1 = process pointer + se2->buffer = trap_get_areg(ctx, 0); + se2->process = trap_get_dreg(ctx, 1); + if (!se2->buffer) { + // amiga side out of memory + shellexecute2_free(se2); + return 0; + } + uaecptr dptr = se2->buffer + ShellExecute2_Struct_Start + ShellExecute2_Struct_Start2; + trap_put_long(ctx, se2->buffer + 4, dptr); + dptr += trap_put_string(ctx, se2->file, dptr, -1) + 1; + trap_put_long(ctx, se2->buffer + 8, dptr); + dptr += trap_put_string(ctx, se2->parms, dptr, -1) + 1; + trap_put_long(ctx, se2->buffer + 12, dptr); + dptr += trap_put_string(ctx, se2->currentdir, dptr, -1) + 1; + + trap_put_long(ctx, se2->buffer + 16, dptr); + dptr += trap_put_string(ctx, se2->file, dptr, -1) + 1; + if (se2->parms[0]) { + trap_put_byte(ctx, dptr - 1, ' '); + trap_put_long(ctx, se2->buffer + 20, dptr); + dptr += trap_put_string(ctx, se2->parms, dptr, -1) + 1; + } + dptr += 3; + dptr &= ~3; + + uaecptr ptr = se2->buffer + ShellExecute2_Struct_Start; + trap_put_long(ctx, ptr, se2->stack); + ptr += 4; + trap_put_long(ctx, ptr, se2->priority); + ptr += 4; + trap_put_long(ctx, ptr, se2->id); + ptr += 4; + + if (se2->bin) { + trap_put_long(ctx, ptr, se2->binsize); + ptr += 4; + trap_put_long(ctx, ptr, dptr); + ptr += 4; + trap_put_bytes(ctx, se2->bin, dptr, se2->binsize); + } else { + trap_put_long(ctx, ptr, 0); + ptr += 4; + trap_put_long(ctx, ptr, 0); + ptr += 4; + } + return 1; + } + if (mode == 32) { + // called by new process, requests buffer + return se2->buffer; + } + if (mode == 33) { + // exit status + // d0 = status + // a1 = buffer + se2->exitcode = trap_get_dreg(ctx, 1); + if (se2->cb) { + se2->cb(se2->id, se2->exitcode, se2->flags); + } + shellexecute2_free(se2); + } + + return 0; +} + +int filesys_shellexecute2(TCHAR *file, TCHAR *currentdir, TCHAR *parms, uae_u32 stack, uae_s32 priority, uae_u32 id, uae_u32 flags, uae_u8 *bin, uae_u32 binsize, shellexecute2_callback cb) +{ + struct ShellExecute2 *se2 = &shellexecute2[0]; + + if (uae_boot_rom_type <= 0) { + return 0; + } + if (se2->file) { + return 0; + } + + se2->file = ua(file); + se2->currentdir = ua(currentdir); + se2->parms = ua(parms); + + se2->id = id; + se2->stack = stack; + se2->priority = priority; + se2->flags = flags; + if (bin && binsize > 0) { + se2->bin = xmalloc(uae_u8, binsize); + memcpy(se2->bin, bin, binsize); + se2->binsize = binsize; + } + + se2->cb = cb; + + uae_ShellExecute2(se2->id); + + return 1; +} + + + int nr_units (void) { int cnt = 0; @@ -6799,6 +6949,8 @@ static uae_u32 REGPARAM2 exter_int_helper(TrapContext *ctx) } else if (n == 22) { // ack return 0; + } else if (n >= 30 && n <= 39) { + return filesys_shellexecute2_process(n, ctx); } if (n == 1) { @@ -6907,6 +7059,12 @@ static uae_u32 REGPARAM2 exter_int_helper(TrapContext *ctx) return 6; // create process } + case 6: /* shell execute 2 */ + { + trap_set_areg(ctx, 0, read_comm_pipe_u32_blocking(&native2amiga_pending)); + return 7; + } + default: write_log(_T("exter_int_helper: unknown native action %X\n"), cmd); break; diff --git a/filesys_bootrom.cpp b/filesys_bootrom.cpp index 36729766..7c28ef6b 100644 --- a/filesys_bootrom.cpp +++ b/filesys_bootrom.cpp @@ -1,27 +1,27 @@ - db(0x00); db(0x00); db(0x0b); db(0x85); db(0x00); db(0x00); db(0x00); db(0x00); - db(0x60); db(0x02); db(0x00); db(0x0d); db(0x60); db(0x00); db(0x0e); db(0xf4); - db(0x00); db(0x00); db(0x0c); db(0x2a); db(0x00); db(0x00); db(0x01); db(0x8e); - db(0x00); db(0x00); db(0x22); db(0x22); db(0x00); db(0x00); db(0x00); db(0x34); - db(0x00); db(0x00); db(0x06); db(0x5e); db(0x00); db(0x00); db(0x1d); db(0xc4); - db(0x00); db(0x00); db(0x01); db(0x40); db(0x00); db(0x00); db(0x1e); db(0x20); - db(0x00); db(0x00); db(0x1e); db(0xce); db(0x00); db(0x00); db(0x22); db(0xec); - db(0x00); db(0x00); db(0x00); db(0x48); db(0x43); db(0xfa); db(0x2d); db(0x39); + db(0x00); db(0x00); db(0x0b); db(0xf5); db(0x00); db(0x00); db(0x00); db(0x00); + db(0x60); db(0x02); db(0x00); db(0x0d); db(0x60); db(0x00); db(0x10); db(0xb4); + db(0x00); db(0x00); db(0x0d); db(0xea); db(0x00); db(0x00); db(0x01); db(0x8e); + db(0x00); db(0x00); db(0x23); db(0xe2); db(0x00); db(0x00); db(0x00); db(0x34); + db(0x00); db(0x00); db(0x08); db(0x1e); db(0x00); db(0x00); db(0x1f); db(0x84); + db(0x00); db(0x00); db(0x01); db(0x40); db(0x00); db(0x00); db(0x1f); db(0xe0); + db(0x00); db(0x00); db(0x20); db(0x8e); db(0x00); db(0x00); db(0x24); db(0xac); + db(0x00); db(0x00); db(0x00); db(0x48); db(0x43); db(0xfa); db(0x2e); db(0xf9); db(0x4e); db(0xae); db(0xff); db(0xa0); db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x16); db(0x20); db(0x40); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x4e); db(0x7a); db(0x08); db(0x08); db(0x08); db(0xc0); db(0x00); db(0x01); db(0x4e); db(0x7b); db(0x08); db(0x08); db(0x4e); db(0xd5); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x07); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x07); db(0xe5); db(0x89); db(0x2e); db(0x01); - db(0x60); db(0x00); db(0x0e); db(0x92); db(0x00); db(0x00); db(0x00); db(0x00); + db(0x60); db(0x00); db(0x10); db(0x52); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x01); db(0x00); db(0x00); db(0x00); db(0x04); db(0x00); db(0x00); db(0x00); db(0x02); db(0x4a); db(0xfc); db(0x00); db(0x00); - db(0x00); db(0x00); db(0x00); db(0x00); db(0x2d); db(0x98); db(0x00); db(0x01); - db(0x00); db(0x00); db(0x00); db(0x00); db(0x2c); db(0x95); db(0x00); db(0x00); + db(0x00); db(0x00); db(0x00); db(0x00); db(0x2f); db(0x58); db(0x00); db(0x01); + db(0x00); db(0x00); db(0x00); db(0x00); db(0x2e); db(0x55); db(0x00); db(0x00); db(0x00); db(0x00); db(0xff); db(0xff); db(0xff); db(0x84); db(0x48); db(0xe7); db(0xe0); db(0xe2); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x0c); db(0x6e); db(0x00); db(0x27); db(0x00); db(0x14); db(0x64); db(0x58); db(0x0c); db(0x6e); db(0x00); db(0x25); db(0x00); db(0x14); db(0x65); db(0x50); db(0x30); db(0x3c); - db(0xff); db(0x38); db(0x72); db(0x11); db(0x61); db(0x00); db(0x2b); db(0x96); + db(0xff); db(0x38); db(0x72); db(0x11); db(0x61); db(0x00); db(0x2d); db(0x56); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0x40); db(0x70); db(0x14); db(0x24); db(0x00); db(0x72); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x4a); db(0x80); db(0x67); db(0x32); db(0x24); db(0x40); db(0x20); db(0x4a); @@ -40,21 +40,21 @@ db(0x67); db(0x06); db(0x4e); db(0xb9); db(0x00); db(0xf0); db(0x00); db(0x00); db(0x4e); db(0xf9); db(0x00); db(0xf0); db(0x00); db(0x00); db(0x00); db(0x00); db(0x48); db(0xe7); db(0x3f); db(0x3e); db(0x2c); db(0x78); db(0x00); db(0x04); - db(0x43); db(0xfa); db(0x2c); db(0x43); db(0x70); db(0x00); db(0x4e); db(0xae); + db(0x43); db(0xfa); db(0x2e); db(0x03); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x22); db(0x00); db(0x30); db(0x3c); db(0x3f); db(0xf8); - db(0x61); db(0x00); db(0x2a); db(0xf2); db(0x20); db(0x81); db(0x43); db(0xfa); - db(0x2c); db(0x1b); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x61); db(0x00); db(0x2c); db(0xb2); db(0x20); db(0x81); db(0x43); db(0xfa); + db(0x2d); db(0xdb); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x22); db(0x00); db(0x30); db(0x3c); db(0x3f); db(0xf4); db(0x61); db(0x00); - db(0x2a); db(0xdc); db(0x20); db(0x81); db(0x61); db(0x00); db(0x00); db(0x0a); + db(0x2c); db(0x9c); db(0x20); db(0x81); db(0x61); db(0x00); db(0x00); db(0x0a); db(0x4c); db(0xdf); db(0x7c); db(0xfc); db(0x70); db(0x00); db(0x4e); db(0x75); - db(0x61); db(0x00); db(0x16); db(0xa8); db(0x61); db(0x00); db(0x1a); db(0x6c); - db(0x61); db(0x00); db(0x24); db(0x16); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x61); db(0x00); db(0x18); db(0x68); db(0x61); db(0x00); db(0x1c); db(0x2c); + db(0x61); db(0x00); db(0x25); db(0xd6); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xff); db(0xfe); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); - db(0xff); db(0xec); db(0x61); db(0x00); db(0x2a); db(0xb0); db(0x2a); db(0x50); + db(0xff); db(0xec); db(0x61); db(0x00); db(0x2c); db(0x70); db(0x2a); db(0x50); db(0x7a); db(0x00); db(0x70); db(0x00); db(0x0c); db(0x6e); db(0x00); db(0x21); - db(0x00); db(0x14); db(0x65); db(0x1c); db(0x43); db(0xfa); db(0x2b); db(0xf0); + db(0x00); db(0x14); db(0x65); db(0x1c); db(0x43); db(0xfa); db(0x2d); db(0xb0); db(0x70); db(0x24); db(0x7a); db(0x01); db(0x4e); db(0xae); db(0xfd); db(0xd8); - db(0x4a); db(0x80); db(0x66); db(0x0c); db(0x43); db(0xfa); db(0x2b); db(0xe0); + db(0x4a); db(0x80); db(0x66); db(0x0c); db(0x43); db(0xfa); db(0x2d); db(0xa0); db(0x70); db(0x00); db(0x7a); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x4a); db(0xad); db(0x01); db(0x0c); db(0x67); db(0x00); db(0x00); db(0x62); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x38); @@ -63,7 +63,7 @@ db(0x7c); db(0x00); db(0xbc); db(0x6d); db(0x01); db(0x0e); db(0x64); db(0x32); db(0x2f); db(0x06); db(0x2e); db(0x2d); db(0x01); db(0x10); db(0x4a); db(0x45); db(0x67); db(0x04); db(0x08); db(0xc7); db(0x00); db(0x02); db(0x2f); db(0x0b); - db(0x20); db(0x4b); db(0x61); db(0x00); db(0x0a); db(0x26); db(0x26); db(0x5f); + db(0x20); db(0x4b); db(0x61); db(0x00); db(0x0b); db(0xe6); db(0x26); db(0x5f); db(0x27); db(0x41); db(0x01); db(0xa4); db(0x0c); db(0x80); db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xd6); db(0x2c); db(0x1f); db(0x52); db(0x46); @@ -74,10 +74,10 @@ db(0x0c); db(0x6e); db(0x00); db(0x22); db(0x00); db(0x14); db(0x65); db(0x00); db(0x00); db(0x9e); db(0x78); db(0x03); db(0x0c); db(0x6e); db(0x00); db(0x24); db(0x00); db(0x14); db(0x65); db(0x04); db(0x00); db(0x44); db(0x01); db(0x00); - db(0x30); db(0x3c); db(0xff); db(0x80); db(0x61); db(0x00); db(0x29); db(0xee); + db(0x30); db(0x3c); db(0xff); db(0x80); db(0x61); db(0x00); db(0x2b); db(0xae); db(0x4e); db(0x90); db(0x2a); db(0x00); db(0x20); db(0x49); db(0x20); db(0x01); db(0x67); db(0x0c); db(0x22); db(0x04); db(0x74); db(0xfb); db(0x43); db(0xfa); - db(0x2b); db(0x54); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x0c); db(0x85); + db(0x2d); db(0x14); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x0c); db(0x85); db(0x00); db(0x40); db(0x00); db(0x00); db(0x65); db(0x26); db(0xba); db(0xae); db(0x00); db(0x3e); db(0x67); db(0x20); db(0x4e); db(0xae); db(0xff); db(0x88); db(0x2d); db(0x45); db(0x00); db(0x3e); db(0x70); db(0x00); db(0x72); db(0x17); @@ -88,40 +88,40 @@ db(0x66); db(0x18); db(0x22); db(0x04); db(0x74); db(0xf6); db(0x20); db(0x7c); db(0x00); db(0x20); db(0x00); db(0x00); db(0x20); db(0x05); db(0x90); db(0x88); db(0x65); db(0x08); db(0x67); db(0x06); db(0x93); db(0xc9); db(0x4e); db(0xae); - db(0xfd); db(0x96); db(0x41); db(0xfa); db(0x2a); db(0x4c); db(0x43); db(0xfa); - db(0x00); db(0x5a); db(0x70); db(0x0a); db(0x61); db(0x00); db(0x0f); db(0x98); + db(0xfd); db(0x96); db(0x41); db(0xfa); db(0x2c); db(0x0c); db(0x43); db(0xfa); + db(0x00); db(0x5a); db(0x70); db(0x0a); db(0x61); db(0x00); db(0x11); db(0x58); db(0x22); db(0x40); db(0x72); db(0x01); db(0x30); db(0x3c); db(0xff); db(0x48); - db(0x61); db(0x00); db(0x29); db(0x6a); db(0x4e); db(0x90); db(0x4c); db(0xdf); + db(0x61); db(0x00); db(0x2b); db(0x2a); db(0x4e); db(0x90); db(0x4c); db(0xdf); db(0x7f); db(0xff); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x3c); db(0x22); db(0x7a); db(0x00); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x24); db(0x00); db(0x28); db(0x01); db(0x26); db(0x09); db(0x24); db(0x48); db(0x43); db(0xfa); - db(0x2a); db(0x6f); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x2c); db(0x2f); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x67); db(0x16); db(0x2c); db(0x40); db(0x22); db(0x0a); db(0xe4); db(0x8b); db(0x4e); db(0xae); db(0xff); db(0x76); db(0x2a); db(0x00); db(0x22); db(0x4e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x20); db(0x05); db(0x4c); db(0xdf); db(0x44); db(0x3c); db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x00); db(0x08); db(0xc0); db(0x00); db(0x0d); db(0x4e); db(0xae); db(0xfe); db(0xc2); - db(0x41); db(0xfa); db(0x2a); db(0x0f); db(0x43); db(0xfa); db(0x00); db(0x16); + db(0x41); db(0xfa); db(0x2b); db(0xcf); db(0x43); db(0xfa); db(0x00); db(0x16); db(0x70); db(0x0f); db(0x22); db(0x3c); db(0x00); db(0x00); db(0x1f); db(0x40); db(0x61); db(0x00); db(0xff); db(0xa2); db(0x60); db(0xdc); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); db(0x72); db(0x02); db(0x30); db(0x3c); db(0xff); db(0x48); db(0x61); db(0x00); - db(0x28); db(0xdc); db(0x4e); db(0x90); db(0x22); db(0x00); db(0x6b); db(0x04); - db(0x61); db(0x00); db(0x0a); db(0xdc); db(0x70); db(0x00); db(0x4e); db(0x75); + db(0x2a); db(0x9c); db(0x4e); db(0x90); db(0x22); db(0x00); db(0x6b); db(0x04); + db(0x61); db(0x00); db(0x0c); db(0x9c); db(0x70); db(0x00); db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x01); db(0x00); db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x7e); db(0x00); db(0x20); db(0x3c); db(0x00); db(0x00); db(0xf0); db(0x00); db(0x61); db(0x00); - db(0x28); db(0xc4); db(0x22); db(0x48); db(0x20); db(0x3c); db(0x00); db(0x00); - db(0x40); db(0x00); db(0x61); db(0x00); db(0x28); db(0xb8); db(0x7c); db(0x03); + db(0x2a); db(0x84); db(0x22); db(0x48); db(0x20); db(0x3c); db(0x00); db(0x00); + db(0x40); db(0x00); db(0x61); db(0x00); db(0x2a); db(0x78); db(0x7c); db(0x03); db(0x4a); db(0x29); db(0x00); db(0x03); db(0x67); db(0x42); db(0x0c); db(0x29); db(0x00); db(0xfd); db(0x00); db(0x07); db(0x66); db(0x3a); db(0x52); db(0x87); db(0x49); db(0xe8); db(0x00); db(0x54); db(0x4b); db(0xe9); db(0x00); db(0x04); db(0x48); db(0xe7); db(0x03); db(0xce); db(0x38); db(0x15); db(0x4c); db(0xd4); db(0x07); db(0x00); db(0x4c); db(0xd4); db(0x00); db(0x07); db(0x0c); db(0x44); - db(0x00); db(0x12); db(0x66); db(0x06); db(0x61); db(0x00); db(0x1d); db(0xde); + db(0x00); db(0x12); db(0x66); db(0x06); db(0x61); db(0x00); db(0x1f); db(0x9e); db(0x60); db(0x0a); db(0x0c); db(0x44); db(0x00); db(0x13); db(0x66); db(0x04); - db(0x61); db(0x00); db(0x1d); db(0xec); db(0x4c); db(0xdf); db(0x73); db(0xc0); + db(0x61); db(0x00); db(0x1f); db(0xac); db(0x4c); db(0xdf); db(0x73); db(0xc0); db(0x28); db(0x80); db(0x1b); db(0x7c); db(0x00); db(0x02); db(0x00); db(0x03); db(0xd0); db(0xfc); db(0x20); db(0x00); db(0xd2); db(0xfc); db(0x00); db(0x08); db(0x51); db(0xce); db(0xff); db(0xae); db(0x4a); db(0x87); db(0x67); db(0x00); @@ -129,7 +129,7 @@ db(0x00); db(0x04); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x01); db(0x00); db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x61); db(0x04); db(0x60); db(0xf2); db(0x4e); db(0x75); db(0x7e); db(0x0a); db(0x30); db(0x3c); db(0xff); db(0x50); - db(0x61); db(0x00); db(0x28); db(0x2a); db(0x20); db(0x07); db(0x4e); db(0x90); + db(0x61); db(0x00); db(0x29); db(0xea); db(0x20); db(0x07); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0xec); db(0x7e); db(0x0b); db(0x0c); db(0x40); db(0x00); db(0x01); db(0x6d); db(0x00); db(0xff); db(0xe8); db(0x6e); db(0x06); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0xde); db(0x0c); db(0x40); @@ -147,16 +147,72 @@ db(0x35); db(0x7c); db(0x12); db(0x34); db(0x00); db(0x18); db(0x25); db(0x49); db(0x00); db(0x1a); db(0x20); db(0x69); db(0x00); db(0x10); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x00); db(0xff); db(0x6e); - db(0x0c); db(0x40); db(0x00); db(0x06); db(0x6e); db(0x00); db(0xff); db(0x66); - db(0x41); db(0xfa); db(0x29); db(0x36); db(0x43); db(0xfa); db(0x00); db(0x42); - db(0x70); db(0x01); db(0x22); db(0x3c); db(0x00); db(0x00); db(0x27); db(0x10); - db(0x61); db(0x00); db(0xfe); db(0x32); db(0x22); db(0x00); db(0x30); db(0x3c); - db(0xff); db(0x50); db(0x61); db(0x00); db(0x27); db(0x78); db(0x70); db(0x14); - db(0x4e); db(0x90); db(0x60); db(0x00); db(0xff); db(0x40); db(0x70); db(0x00); - db(0x20); db(0x59); db(0x4a); db(0x10); db(0x67); db(0x10); db(0x2c); db(0x59); - db(0x22); db(0x51); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x01); db(0x00); - db(0x4e); db(0xae); db(0xfe); db(0xbc); db(0x70); db(0x01); db(0x4a); db(0x40); - db(0x4e); db(0x75); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00); db(0x10); + db(0x0c); db(0x40); db(0x00); db(0x06); db(0x6e); db(0x06); db(0x61); db(0x12); + db(0x60); db(0x00); db(0xff); db(0x62); db(0x0c); db(0x40); db(0x00); db(0x07); + db(0x6e); db(0x00); db(0xff); db(0x5a); db(0x61); db(0x28); db(0x60); db(0x00); + db(0xff); db(0x54); db(0x41); db(0xfa); db(0x2a); db(0xe4); db(0x43); db(0xfa); + db(0x01); db(0xf0); db(0x70); db(0x01); db(0x22); db(0x3c); db(0x00); db(0x00); + db(0x27); db(0x10); db(0x61); db(0x00); db(0xfe); db(0x20); db(0x22); db(0x00); + db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x29); db(0x26); + db(0x70); db(0x14); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x38); db(0x38); db(0x99); db(0xcc); db(0x76); db(0x00); db(0x30); db(0x3c); + db(0xff); db(0x50); db(0x61); db(0x00); db(0x29); db(0x10); db(0x26); db(0x48); + db(0x70); db(0x1e); db(0x4e); db(0x93); db(0x24); db(0x00); db(0x67); db(0x5a); + db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x28); db(0x40); db(0x4a); db(0x80); db(0x67); db(0x20); + db(0x28); db(0x82); db(0x41); db(0xfa); db(0x2a); db(0x94); db(0x43); db(0xfa); + db(0x00); db(0x4c); db(0x70); db(0x01); db(0x22); db(0x3c); db(0x00); db(0x00); + db(0x10); db(0x00); db(0x61); db(0x00); db(0xfd); db(0xd0); db(0x26); db(0x00); + db(0x67); db(0x06); db(0x04); db(0x83); db(0x00); db(0x00); db(0x00); db(0x5c); + db(0x70); db(0x1f); db(0x20); db(0x4c); db(0x22); db(0x03); db(0x4e); db(0x93); + db(0x4a); db(0x83); db(0x67); db(0x12); db(0x20); db(0x0c); db(0x67); db(0x0e); + db(0x22); db(0x43); db(0x70); db(0x00); db(0x08); db(0xc0); db(0x00); db(0x0d); + db(0x4e); db(0xae); db(0xfe); db(0xbc); db(0x60); db(0x0c); db(0x20); db(0x0c); + db(0x67); db(0x08); db(0x22); db(0x4c); db(0x20); db(0x14); db(0x4e); db(0xae); + db(0xff); db(0x2e); db(0x4c); db(0xdf); db(0x1c); db(0x1c); db(0x4e); db(0x75); + db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x43); db(0xfa); db(0x29); db(0xc9); + db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x2c); db(0x00); + db(0x70); db(0x00); db(0x08); db(0xc0); db(0x00); db(0x0d); db(0x4e); db(0xae); + db(0xfe); db(0xc2); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); + db(0x28); db(0x7c); db(0x70); db(0x20); db(0x4e); db(0x90); db(0x28); db(0x40); + db(0xcd); db(0x8e); db(0x26); db(0x4f); db(0x4f); db(0xef); db(0xff); db(0xc0); + db(0x2a); db(0x0f); db(0x24); db(0x45); db(0x24); db(0xfc); db(0x80); db(0x00); + db(0x00); db(0x21); db(0x41); db(0xfa); db(0x28); db(0xe0); db(0x22); db(0x08); + db(0x24); db(0x3c); db(0x00); db(0x00); db(0x03); db(0xed); db(0x4e); db(0xae); + db(0xff); db(0xe2); db(0x24); db(0xc0); db(0x24); db(0xfc); db(0x80); db(0x00); + db(0x00); db(0x22); db(0x41); db(0xfa); db(0x28); db(0xc8); db(0x22); db(0x08); + db(0x4e); db(0xae); db(0xff); db(0xe2); db(0x24); db(0xc0); db(0x70); db(0x01); + db(0x24); db(0xc0); db(0x70); db(0x00); db(0x24); db(0xc0); db(0x20); db(0x6c); + db(0x00); db(0x0c); db(0x4a); db(0x10); db(0x67); db(0x16); db(0x22); db(0x08); + db(0x74); db(0xfe); db(0x4e); db(0xae); db(0xff); db(0xac); db(0x4a); db(0x80); + db(0x67); db(0x0a); db(0x51); db(0x8a); db(0x24); db(0xfc); db(0x80); db(0x00); + db(0x03); db(0xf2); db(0x24); db(0xc0); db(0x20); db(0x2c); db(0x00); db(0x14); + db(0x67); db(0x08); db(0x24); db(0xfc); db(0x80); db(0x00); db(0x03); db(0xf3); + db(0x24); db(0xc0); db(0x24); db(0xfc); db(0x80); db(0x00); db(0x03); db(0xf5); + db(0x24); db(0xec); db(0x00); db(0x18); db(0x70); db(0x01); db(0x24); db(0xc0); + db(0x70); db(0x00); db(0x24); db(0xc0); db(0x20); db(0x2c); db(0x00); db(0x1c); + db(0x08); db(0x00); db(0x00); db(0x02); db(0x67); db(0x0c); db(0x51); db(0x8a); + db(0x24); db(0xfc); db(0x80); db(0x00); db(0x03); db(0xf7); db(0x70); db(0xff); + db(0x24); db(0xc0); db(0x42); db(0x9a); db(0x42); db(0x92); db(0x24); db(0x45); + db(0x0c); db(0x6e); db(0x00); db(0x24); db(0x00); db(0x14); db(0x64); db(0x10); + db(0x22); db(0x2c); db(0x00); db(0x10); db(0x74); db(0x00); db(0x26); db(0x2a); + db(0x00); db(0x0c); db(0x4e); db(0xae); db(0xff); db(0x22); db(0x60); db(0x0a); + db(0x22); db(0x2c); db(0x00); db(0x10); db(0x24); db(0x0a); db(0x4e); db(0xae); + db(0xfd); db(0xa2); db(0x24); db(0x00); db(0x22); db(0x2a); db(0x00); db(0x04); + db(0x67); db(0x04); db(0x4e); db(0xae); db(0xff); db(0xdc); db(0x22); db(0x2a); + db(0x00); db(0x0c); db(0x67); db(0x04); db(0x4e); db(0xae); db(0xff); db(0xdc); + db(0x0c); db(0x82); db(0xff); db(0xff); db(0xff); db(0xff); db(0x66); db(0x0a); + db(0x22); db(0x2a); db(0x00); db(0x14); db(0x67); db(0x04); db(0x4e); db(0xae); + db(0xff); db(0xa6); db(0x2e); db(0x4b); db(0xcd); db(0x8e); db(0x30); db(0x3c); + db(0xff); db(0x50); db(0x61); db(0x00); db(0x27); db(0x88); db(0x70); db(0x21); + db(0x22); db(0x02); db(0x22); db(0x4c); db(0x4e); db(0x90); db(0x22); db(0x46); + db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x22); db(0x4c); db(0x20); db(0x14); + db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x70); db(0x00); db(0x4e); db(0x75); + db(0x70); db(0x00); db(0x20); db(0x59); db(0x4a); db(0x10); db(0x67); db(0x10); + db(0x2c); db(0x59); db(0x22); db(0x51); db(0x20); db(0x3c); db(0x00); db(0x00); + db(0x01); db(0x00); db(0x4e); db(0xae); db(0xfe); db(0xbc); db(0x70); db(0x01); + db(0x4a); db(0x40); db(0x4e); db(0x75); db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x43); db(0xfa); db(0x28); db(0x75); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x2a); db(0x40); db(0xcb); db(0x4e); db(0x60); db(0x0e); @@ -203,21 +259,21 @@ db(0x00); db(0x22); db(0x67); db(0x0e); db(0x4a); db(0xa8); db(0x00); db(0x3c); db(0x67); db(0x08); db(0x22); db(0x69); db(0x00); db(0x10); db(0x22); db(0xa8); db(0x00); db(0x44); db(0x70); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); - db(0xf1); db(0xe0); db(0x2e); db(0x00); db(0x61); db(0x00); db(0xfa); db(0x30); + db(0xf1); db(0xe0); db(0x2e); db(0x00); db(0x61); db(0x00); db(0xf8); db(0x70); db(0x20); db(0x3c); db(0x00); db(0x00); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x25); db(0xdc); db(0x24); db(0x48); db(0x74); db(0x00); db(0x08); db(0x07); db(0x00); db(0x00); db(0x67); db(0x10); db(0x41); db(0xfa); db(0x26); db(0xad); - db(0x43); db(0xfa); db(0xfd); db(0x74); db(0x70); db(0x14); db(0x61); db(0x00); + db(0x43); db(0xfa); db(0xfb); db(0xb4); db(0x70); db(0x14); db(0x61); db(0x00); db(0x0b); db(0xe6); db(0x24); db(0x00); db(0x76); db(0x00); db(0x08); db(0x07); db(0x00); db(0x01); db(0x67); db(0x10); db(0x41); db(0xfa); db(0x26); db(0xa3); - db(0x43); db(0xfa); db(0xfc); db(0xd6); db(0x70); db(0x19); db(0x61); db(0x00); + db(0x43); db(0xfa); db(0xfb); db(0x16); db(0x70); db(0x19); db(0x61); db(0x00); db(0x0b); db(0xce); db(0x26); db(0x00); db(0x70); db(0x2a); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); db(0x41); db(0xe9); db(0x00); db(0x1a); db(0x20); db(0xca); db(0x20); db(0xce); db(0x20); db(0xc2); db(0x20); db(0x83); db(0x41); db(0xfa); db(0x26); db(0x51); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x45); db(0xe9); db(0x00); db(0x1a); db(0x23); db(0x4a); db(0x00); db(0x0e); db(0x41); db(0xfa); - db(0xfd); db(0xfe); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); + db(0xfe); db(0x00); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); db(0x02); db(0x14); db(0x00); db(0x08); db(0x70); db(0x03); db(0x4e); db(0xae); db(0xff); db(0x58); db(0x20); db(0x02); db(0x22); db(0x03); db(0x61); db(0x00); db(0xfe); db(0xd2); db(0x30); db(0x3c); db(0xff); db(0x38); db(0x72); db(0x04); @@ -394,7 +450,7 @@ db(0xff); db(0x28); db(0x61); db(0x00); db(0x1f); db(0xf8); db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); db(0x01); db(0x90); db(0x42); db(0xa8); db(0x01); db(0x94); db(0x4e); db(0x91); db(0x26); db(0x00); db(0x0c); db(0x43); - db(0xff); db(0xfe); db(0x67); db(0x00); db(0xf6); db(0x8e); db(0x20); db(0x28); + db(0xff); db(0xfe); db(0x67); db(0x00); db(0xf4); db(0xce); db(0x20); db(0x28); db(0x01); db(0x90); db(0x6f); db(0x12); db(0x2f); db(0x08); db(0x72); db(0x01); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x5f); db(0x21); db(0x40); db(0x01); db(0x94); db(0x4a); db(0x83); @@ -417,15 +473,15 @@ db(0x4c); db(0xdf); db(0x03); db(0x01); db(0x42); db(0xa9); db(0x01); db(0x90); db(0x23); db(0x48); db(0x01); db(0x94); db(0x4a); db(0x80); db(0x67); db(0x0a); db(0x4a); db(0xa9); db(0x01); db(0x98); db(0x67); db(0x04); db(0x61); db(0x00); - db(0xf9); db(0xf4); db(0x4a); db(0x83); db(0x6b); db(0x00); db(0xf5); db(0xd4); + db(0xf9); db(0xf4); db(0x4a); db(0x83); db(0x6b); db(0x00); db(0xf4); db(0x14); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x2f); db(0x09); db(0x43); db(0xfa); db(0x20); db(0xb4); db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x22); db(0x5f); db(0x22); db(0x00); db(0x30); db(0x3c); db(0xff); db(0x18); db(0x61); db(0x00); db(0x1f); db(0x0c); db(0x4e); db(0x90); db(0x20); db(0x03); db(0x16); db(0x29); db(0x00); db(0x4f); db(0x4a); db(0x80); db(0x66); db(0x24); db(0x27); db(0x7c); db(0x00); db(0x00); db(0x17); db(0x70); db(0x00); db(0x14); db(0x41); db(0xfa); - db(0xf2); db(0xb4); db(0x70); db(0xff); db(0x22); db(0x0c); db(0x66); db(0x06); - db(0x41); db(0xfa); db(0xf3); db(0x0a); db(0x70); db(0x00); db(0x27); db(0x40); + db(0xf0); db(0xf4); db(0x70); db(0xff); db(0x22); db(0x0c); db(0x66); db(0x06); + db(0x41); db(0xfa); db(0xf1); db(0x4a); db(0x70); db(0x00); db(0x27); db(0x40); db(0x00); db(0x24); db(0x20); db(0x08); db(0xe4); db(0x88); db(0x27); db(0x40); db(0x00); db(0x20); db(0x08); db(0x07); db(0x00); db(0x03); db(0x66); db(0x48); db(0x08); db(0x07); db(0x00); db(0x00); db(0x67); db(0x42); db(0x0c); db(0x03); @@ -783,7 +839,7 @@ db(0x13); db(0xd4); db(0x20); db(0x0d); db(0x4e); db(0x90); db(0x41); db(0xfa); db(0x14); db(0x6b); db(0x43); db(0xfa); db(0x01); db(0x14); db(0x70); db(0xf6); db(0x22); db(0x3c); db(0x00); db(0x00); db(0x27); db(0x10); db(0x61); db(0x00); - db(0xea); db(0x6c); db(0x70); db(0x00); db(0x4c); db(0xdf); db(0x60); db(0x00); + db(0xe8); db(0xac); db(0x70); db(0x00); db(0x4c); db(0xdf); db(0x60); db(0x00); db(0x4e); db(0x75); db(0x30); db(0x3c); db(0xff); db(0x38); db(0x72); db(0x0a); db(0x61); db(0x00); db(0x13); db(0xaa); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x61); db(0xf0); db(0x20); db(0x0d); db(0x67); db(0x1c); db(0x2c); db(0x6d); @@ -909,7 +965,7 @@ db(0x4c); db(0xdf); db(0x01); db(0x03); db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x41); db(0xfa); db(0x10); db(0xfe); db(0x43); db(0xfa); db(0x00); db(0x14); db(0x70); db(0x0f); db(0x22); db(0x3c); db(0x00); db(0x00); - db(0x1f); db(0x40); db(0x61); db(0x00); db(0xe6); db(0x78); db(0x4e); db(0x75); + db(0x1f); db(0x40); db(0x61); db(0x00); db(0xe4); db(0xb8); db(0x4e); db(0x75); db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x00); db(0x43); db(0xfa); db(0x10); db(0xe7); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x2c); db(0x40); @@ -968,7 +1024,7 @@ db(0x43); db(0xfa); db(0x0f); db(0x6c); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x67); db(0x40); db(0x24); db(0x4e); db(0x2c); db(0x40); db(0x4e); db(0xae); db(0xff); db(0xd0); db(0x4a); db(0x80); - db(0x67); db(0x2c); db(0x20); db(0x40); db(0x43); db(0xfa); db(0xe1); db(0xb2); + db(0x67); db(0x2c); db(0x20); db(0x40); db(0x43); db(0xfa); db(0xdf); db(0xf2); db(0x20); db(0x09); db(0x42); db(0x40); db(0x21); db(0x40); db(0x00); db(0x20); db(0x21); db(0x7c); db(0x00); db(0x01); db(0x00); db(0x00); db(0x00); db(0x24); db(0x31); db(0x7c); db(0x01); db(0x04); db(0x00); db(0x10); db(0x31); db(0x7c); @@ -1115,7 +1171,7 @@ db(0x30); db(0x3c); db(0xff); db(0x38); db(0x61); db(0x00); db(0x09); db(0x7e); db(0x24); db(0x0d); db(0x72); db(0x14); db(0x4e); db(0x90); db(0x7e); db(0x00); db(0x4e); db(0xae); db(0xff); db(0x76); db(0x20); db(0x07); db(0x4e); db(0x75); - db(0x0f); db(0xbe); db(0x14); db(0xba); db(0x06); db(0x30); db(0x03); db(0x74); + db(0x11); db(0x7e); db(0x16); db(0x7a); db(0x07); db(0xf0); db(0x03); db(0x74); db(0x03); db(0xfa); db(0x00); db(0x00); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x30); db(0x72); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x4a); db(0x80); db(0x67); db(0x6c); db(0x26); db(0x40); db(0x41); db(0xfa); @@ -1414,9 +1470,9 @@ db(0x61); db(0x00); db(0xfc); db(0x7c); db(0x4f); db(0xef); db(0x00); db(0x50); db(0x26); db(0xaf); db(0x00); db(0x30); db(0x20); db(0x2f); db(0x00); db(0x14); db(0x4c); db(0xdf); db(0x2c); db(0x04); db(0xde); db(0xfc); db(0x00); db(0x2c); - db(0x4e); db(0x75); db(0x00); db(0x00); db(0x41); db(0xfa); db(0xd3); db(0xb6); + db(0x4e); db(0x75); db(0x00); db(0x00); db(0x41); db(0xfa); db(0xd1); db(0xf6); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); db(0xd1); db(0xc0); - db(0x4e); db(0x75); db(0x00); db(0x00); db(0x41); db(0xfa); db(0xd3); db(0xa6); + db(0x4e); db(0x75); db(0x00); db(0x00); db(0x41); db(0xfa); db(0xd1); db(0xe6); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); db(0xd1); db(0xc0); db(0x4e); db(0x75); db(0x4e); db(0x71); db(0x4e); db(0x71); db(0x69); db(0x6e); db(0x70); db(0x75); db(0x74); db(0x2e); db(0x64); db(0x65); db(0x76); db(0x69); diff --git a/include/filesys.h b/include/filesys.h index c2bc0883..c15bd261 100644 --- a/include/filesys.h +++ b/include/filesys.h @@ -163,4 +163,8 @@ extern void gethdfgeometry(uae_u64 size, struct uaedev_config_info*); void add_cpuboard_unit(int unit, struct uaedev_config_info *uci, struct romconfig *rc); +typedef void (*shellexecute2_callback)(uae_u32, uae_u32, uae_u32); + +int filesys_shellexecute2(TCHAR *file, TCHAR *currentdir, TCHAR *parms, uae_u32 stack, uae_s32 priority, uae_u32 id, uae_u32 flags, uae_u8 *bin, uae_u32 binsize, shellexecute2_callback cb); + #endif /* UAE_FILESYS_H */ diff --git a/include/native2amiga_api.h b/include/native2amiga_api.h index c2969cbb..e94b7da1 100644 --- a/include/native2amiga_api.h +++ b/include/native2amiga_api.h @@ -19,6 +19,7 @@ void uae_Signal(uaecptr task, uae_u32 mask); void uae_Signal_with_Func(uaecptr task, uae_u32 mask, UAE_PROCESSED state); void uae_NotificationHack(uaecptr, uaecptr); void uae_ShellExecute(TCHAR *command); +void uae_ShellExecute2(uae_u32 id); #endif int native2amiga_isfree(void); void uae_nativesem_wait(void); diff --git a/native2amiga.cpp b/native2amiga.cpp index 4410945c..c006f52f 100644 --- a/native2amiga.cpp +++ b/native2amiga.cpp @@ -135,6 +135,15 @@ void uae_ShellExecute(TCHAR *command) uae_nativesem_post(); } +void uae_ShellExecute2(uae_u32 id) +{ + uae_nativesem_wait(); + write_comm_pipe_int(&native2amiga_pending, 6, 0); + write_comm_pipe_int(&native2amiga_pending, id, 1); + do_uae_int_requested(); + uae_nativesem_post(); +} + #endif uaecptr uae_AllocMem (TrapContext *ctx, uae_u32 size, uae_u32 flags, uaecptr sysbase) diff --git a/od-win32/cloanto/RetroPlatformIPC-doc.txt b/od-win32/cloanto/RetroPlatformIPC-doc.txt index 6523eeb5..da6ca4df 100644 --- a/od-win32/cloanto/RetroPlatformIPC-doc.txt +++ b/od-win32/cloanto/RetroPlatformIPC-doc.txt @@ -4,12 +4,12 @@ Client : Cloanto Corporation Support : http://www.retroplatform.com Legal : CONFIDENTIAL TRADE SECRET PROPERTY OF CLOANTO CORPORATION - : Copyright © Cloanto Corporation 2007-2019. + : Copyright © Cloanto Corporation 2007-2021. : All rights reserved, except where licensed, : assigned or transferred by contract. Authors : os, m Created : 2007-08-23 10:08:25 - Updated : 2019-01-27 10:56:32 + Updated : 2021-10-14 11:42:34 Comment : Reference for RetroPlatformIPC.h (RP Player interprocess communication include file) *****************************************************************************/ @@ -329,6 +329,8 @@ Description: that the appropriate data can be sent to the host (e.g. Content set to "KeyboardCustom Left=0x4B Right=0x4D Up=0x48 Down=0x50 Fire=0x52"), which in turn may need to display it in the user interface. + In the user interface, a device (drive) icon, perhaps with an empty state, + may persist even for devices like empty drives (floppy, CD). Data sent: pData = a RPDEVICECONTENT structure (see RetroPlatformIPC.h); the szContent field of the structure @@ -523,21 +525,47 @@ Description: (e.g. lLeft and lTop fields of the RPSCREENOVERLAY structure) Data sent: WPARAM = mouse buttons state - (bit 0 = left button state, bit 1 = right button state, ...) + (flags: RP_MOUSE_BUTTON_LEFT, RP_MOUSE_BUTTON_RIGHT, RP_MOUSE_BUTTON_MIDDLE) LPARAM = screen coordinates combined with the MAKELONG macro (i.e. MAKELONG(x,y)) Response: none +Message: + RP_IPC_TO_HOST_TEXT_CURSOR_INFO +Description: + when virtual mouse is enabled, the guest send RP_IPC_TO_HOST_TEXT_CURSOR_INFO + messages to the host, in order to provide information about the text cursor + and some cursor-related screen and mouse data; + this information is not sent at every mouse move, but only when the mouse + hovers a new character position (e.g. dwCursorColumn and/or dwCursorRow field + is different, compared to the previously sent data), or when the mouse + is moved outside of the text area +Data sent: + pData = a RPTEXTCURSORINFO structure (see RetroPlatformIPC.h) +Response: + none + + +Message: + RP_IPC_TO_HOST_EXECUTE_RESULT +Description: + this message notifies the host that a program, previously launched via + the RP_IPC_TO_GUEST_EXECUTE message, has terminated its execution; + this notification is only sent when one of the + RP_EXECUTE_RETURN_EXIT_CODE and RP_EXECUTE_RETURN_OUTPUT flags is set + in the RPEXECUTEINFO structure of the RP_IPC_TO_GUEST_EXECUTE message; + the dwExecuteID field of the structure sent with this notification + references the ID that the host specified in the + RP_IPC_TO_GUEST_EXECUTE message +Data sent: + pData = a RPEXECUTERESULT structure (see RetroPlatformIPC.h) +Response: + none + + Messages: - RP_IPC_TO_HOST_PRIVATE_REGISTER - RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT - RP_IPC_TO_HOST_PRIVATE_TYPECLIPDONE - RP_IPC_TO_HOST_PRIVATE_KEYEVENT - RP_IPC_TO_HOST_PRIVATE_GUESTEVENT - RP_IPC_TO_HOST_PRIVATE_KEYPROMPT - RP_IPC_TO_HOST_PRIVATE_CLOSEKBDWIN - RP_IPC_TO_HOST_PRIVATE_MENUEVENT + RP_IPC_TO_HOST_PRIVATE_* Description: these are private messages, sent by code in RPGuest.dll @@ -911,17 +939,89 @@ Response: LRESULT = 1 if the guest acknowledged the command or 0 otherwise +Message: + RP_IPC_TO_GUEST_WRITESTRING +Description: + The host sends this message to ask the guest to write a string + (e.g. by calling an output function or by inserting the string + in the system keyboard buffer). +Data sent: + pData = an null-terminated string based on the emulated system character set (typically 8-bit) +Response: + LRESULT = 1 if the guest acknowledged the command or 0 otherwise + + +Message: + RP_IPC_TO_GUEST_TRIGGER_TRAP +Description: + The host sends this message to ask the guest to execute a callback function + where it is possible to read and/or write the memory of the emulated system. + Based on the guest implementation and on the specified RP_TRAPF_* flags, + the callback function may by called synchronously or asynchronously. +Callback function: + When the function is called, its dwFlags argument contain only one of the + RP_TRAPF_SYNC_MODE and RP_TRAPF_ASYNC_MODE flags (stating how the function has been called) + and the lParam1 argument contains the value specified in the lCallbackParam field + of the RPTRAPDATA structure. + The code can read the emulated system memory (if RP_TRAPF_READ_ACCESS was specified) + calling pfnReadMemory(dwAddress, dwSize, pdwValue, lParam1, lParam2) + (where dwAddress is the memory address to read from, + dwSize is the bit size of the value to read - e.g. 8 for 8-bit value, + pdwValue is the address receiving the read result, + lParam1 is an optional guest-specific custom value (e.g. memory bank), + lParam2 is the lParam2 argument passed to the callback function) + or can write memory (if RP_TRAPF_WRITE_ACCESS was specified) + calling pfnWriteMemory(dwAddress, dwSize, dwValue, lParam1, lParam2) + (where dwAddress is the memory address to write to, + dwSize is the bit size of the value to write - e.g. 8 for 8-bit value, + dwValue is the value to write to the specified address, + lParam1 is an optional guest-specific custom value (e.g. memory bank), + lParam2 is the lParam2 argument passed to the callback function) +Data sent: + pData = an RPTRAPDATA structure where + dwFlags contains a combination of RP_TRAPF_* flags, + pfnCallback is the address of the function to be called, + lCallbackParam is the value passed as lParam1 to the callback function +Response: + LRESULT = RP_TRAP_UNSUPPORTED (this functionality is not supported) or + RP_TRAP_OK_SYNC (the function was called synchronously) or + RP_TRAP_OK_ASYNC (the function was called asynchronously) or + RP_TRAP_SYNC_NOT_POSSIBLE (RP_TRAPF_SYNC_MODE only was requested, but it is not allowed) or + RP_TRAP_ASYNC_NOT_POSSIBLE (RP_TRAPF_ASYNC_MODE only was requested, but it is not allowed) or + RP_TRAP_ERROR (an unspecified orror occurred) + + +Messages: + RP_IPC_TO_GUEST_SET_CURSOR_POSITION +Description: + This message is sent to ask the guest to move the text cursor +Data sent: + WPARAM = cursor column and row combined with the MAKELONG macro; + e.g. MAKELONG(0, 1) to set the cursor at the first column + of the second screen row +Response: + LRESULT = 1 if the guest acknowledged the command or 0 otherwise + + +Message: + RP_IPC_TO_GUEST_EXECUTE +Description: + The host sends this message to execute a program on the emulated system. + In case the RP_EXECUTE_RETURN_EXIT_CODE flag or the RP_EXECUTE_RETURN_OUTPUT flag + is set, the guest will send a RP_IPC_TO_HOST_EXECUTE_RESULT notification to the host, + when the launched program terminates. + The program can either be referenced via the szFile array, or its data may follow + the RPEXECUTEINFO structure in the data of this message (in such a case, + the dwFileDataSize and dwFileDataOffset fields are properly set to + reach the program binary data). +Data sent: + pData = a RPEXECUTEINFO structure, optionally followed by program binary data. +Response: + LRESULT = 1, if the guest successfully executed the command, or 0 otherwise + + Messages: - RP_IPC_TO_GUEST_PRIVATE_STARTUP - RP_IPC_TO_GUEST_PRIVATE_TYPECLIP - RP_IPC_TO_GUEST_PRIVATE_RELEASEKEYS - RP_IPC_TO_GUEST_PRIVATE_CANESCAPE - RP_IPC_TO_GUEST_PRIVATE_LOGGING - RP_IPC_TO_GUEST_PRIVATE_INPUTDEVICES - RP_IPC_TO_GUEST_PRIVATE_NOKEYPROMPT - RP_IPC_TO_GUEST_PRIVATE_KEYBOARDWINDOW - RP_IPC_TO_GUEST_PRIVATE_MENUMODE - RP_IPC_TO_GUEST_PRIVATE_SETFRGWINDOW + RP_IPC_TO_GUEST_PRIVATE_* Description: these are private messages, received by code in RPGuest.dll; - they never reach the message function in guest code + they never reach the message function in guest code. diff --git a/od-win32/cloanto/RetroPlatformIPC.h b/od-win32/cloanto/RetroPlatformIPC.h index c9e8227c..5bd76a2e 100644 --- a/od-win32/cloanto/RetroPlatformIPC.h +++ b/od-win32/cloanto/RetroPlatformIPC.h @@ -2,14 +2,14 @@ Name : RetroPlatformIPC.h Project : RetroPlatform Player Support : http://www.retroplatform.com - Legal : Copyright 2007-2019 Cloanto Corporation - All rights reserved. This + Legal : Copyright 2007-2021 Cloanto Corporation - All rights reserved. This : file is multi-licensed under the terms of the Mozilla Public License : version 2.0 as published by Mozilla Corporation and the GNU General : Public License, version 2 or later, as published by the Free : Software Foundation. Authors : os, m Created : 2007-08-27 13:55:49 - Updated : 2019-01-27 10:47:18 + Updated : 2021-10-17 10:43:32 Comment : RetroPlatform Player interprocess communication include file *****************************************************************************/ @@ -18,9 +18,9 @@ #include -#define RETROPLATFORM_API_VER "7.6" -#define RETROPLATFORM_API_VER_MAJOR 7 -#define RETROPLATFORM_API_VER_MINOR 6 +#define RETROPLATFORM_API_VER "10.0" +#define RETROPLATFORM_API_VER_MAJOR 10 +#define RETROPLATFORM_API_VER_MINOR 0 #define RPIPC_HostWndClass "RetroPlatformHost%s" #define RPIPC_GuestWndClass "RetroPlatformGuest%d" @@ -68,6 +68,10 @@ #define RP_IPC_TO_HOST_MOUSEMOVE (WM_APP + 38) // introduced in RetroPlatform API 7.5 #define RP_IPC_TO_HOST_MOUSEBUTTON (WM_APP + 39) // introduced in RetroPlatform API 7.5 #define RP_IPC_TO_HOST_PRIVATE_MENUEVENT (WM_APP + 40) // introduced in RetroPlatform API 7.5 +#define RP_IPC_TO_HOST_PRIVATE_DOCKKBDWIN (WM_APP + 41) // introduced in RetroPlatform API 7.7 +#define RP_IPC_TO_HOST_TEXT_CURSOR_INFO (WM_APP + 42) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_HOST_SET_MOUSE_CURSOR (WM_APP + 43) // introduced in RetroPlatform API 7.10 +#define RP_IPC_TO_HOST_EXECUTE_RESULT (WM_APP + 44) // introduced in RetroPlatform API 10.0 // **************************************************************************** // Host-to-Guest Messages @@ -107,6 +111,17 @@ #define RP_IPC_TO_GUEST_PRIVATE_MENUMODE (WM_APP + 235) // introduced in RetroPlatform API 7.5 #define RP_IPC_TO_GUEST_PRIVATE_SETFRGWINDOW (WM_APP + 236) // introduced in RetroPlatform API 7.5 #define RP_IPC_TO_GUEST_SHOWDEBUGGER (WM_APP + 237) // introduced in RetroPlatform API 7.6 +#define RP_IPC_TO_GUEST_PRIVATE_SETWINDOWPOS (WM_APP + 238) // introduced in RetroPlatform API 7.8 +#define RP_IPC_TO_GUEST_PRIVATE_SHOWWINDOW (WM_APP + 239) // introduced in RetroPlatform API 7.8 +#define RP_IPC_TO_GUEST_PRIVATE_SETWINDOWTEXT (WM_APP + 240) // introduced in RetroPlatform API 7.8 +#define RP_IPC_TO_GUEST_PRIVATE_SETWINDOWLONG (WM_APP + 241) // introduced in RetroPlatform API 7.8 +#define RP_IPC_TO_GUEST_PRIVATE_SHAREDEVENT (WM_APP + 242) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_GUEST_WRITESTRING (WM_APP + 243) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_GUEST_TRIGGER_TRAP (WM_APP + 244) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_GUEST_PRIVATE_COPYTEXT (WM_APP + 245) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_GUEST_SETCURSORPOSITION (WM_APP + 246) // introduced in RetroPlatform API 7.9 +#define RP_IPC_TO_GUEST_PRIVATE_TEXTSELMENU (WM_APP + 247) // introduced in RetroPlatform API 7.10 +#define RP_IPC_TO_GUEST_EXECUTE (WM_APP + 248) // introduced in RetroPlatform API 10.0 // **************************************************************************** // Message Data Structures and Defines @@ -119,7 +134,7 @@ #define RP_FEATURE_SCREEN3X 0x00000008 // 3x mode is available #define RP_FEATURE_SCREEN4X 0x00000010 // 4x mode is available #define RP_FEATURE_FULLSCREEN 0x00000020 // fullscreen display is available -#define RP_FEATURE_RESERVED 0x00000040 // unused - reserved for future use (to not cause side effects during screen capture changes in 201303 beta) +#define RP_FEATURE_WRITESTRING 0x00000040 // RP_IPC_TO_GUEST_WRITESTRING is supported #define RP_FEATURE_PAUSE 0x00000080 // pause functionality is available (see RP_IPC_TO_GUEST_PAUSE message) #define RP_FEATURE_TURBO_CPU 0x00000100 // turbo CPU functionality is available (see RP_IPC_TO_GUEST_TURBO message) #define RP_FEATURE_VOLUME 0x00000200 // volume adjustment is possible (see RP_IPC_TO_GUEST_VOLUME message) @@ -194,6 +209,7 @@ typedef struct RPScreenMode #define RP_SCREENMODE_SCANLINES 0x00080000 // show video scan lines #define RP_SCREENMODE_SCALING_SUBPIXEL 0x00100000 // use sub-pixel (non-integer) scaling in RP_SCREENMODE_SCALE_TARGET or RP_SCREENMODE_SCALE_MAX modes; if not set, up to four black bars may be added; if set, up to two black bars may be added #define RP_SCREENMODE_SCALING_STRETCH 0x00200000 // "stretch to fill" (do not preserve original ratio) in RP_SCREENMODE_SCALE_TARGET or RP_SCREENMODE_SCALE_MAX modes; if set, no black bars are added +#define RP_SCREENMODE_PIXEL_ORIGINAL_RATIO 0x00400000 // use pixel original ratio (when not set, square pixel ratio or a multiple thereof is used, which grants optimal sharpness and avoids screen distortions) // Clip Flags (used only from host to guest, never from guest to host) #define RP_CLIPFLAGS_AUTOCLIP 0x00000001 // ignore all 4 Clip values (same as all values = -1) and use "smart" offset and size @@ -491,16 +507,10 @@ typedef struct RPScreenCapture #define RP_MAKE_HOSTVERSION(major,minor,build) ((LPARAM) (((LPARAM)((major) & 0xFFF)<<20) | ((LPARAM)((minor) & 0x3FF)<<10) | ((LPARAM)((build) & 0x3FF)))) -// RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT wParam -#define RP_SHARED_EVENT_ESCAPE 1 -#define RP_SHARED_EVENT_TURBO 2 -#define RP_SHARED_EVENT_PAUSE 3 -#define RP_SHARED_EVENT_SCREENCAPTURECLIP 4 -#define RP_SHARED_EVENT_SCREENCAPTUREFILE 5 -#define RP_SHARED_EVENT_PLUGINOPTIONS 6 -// RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT lParam -#define RP_SHARED_EVENT_PRESSED 0x0000 -#define RP_SHARED_EVENT_RELEASED 0x0001 +// RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT LOWORD lParam +#define RP_SHARED_EVENT_PRESSED 0x0000 +#define RP_SHARED_EVENT_PRESSED_DEFERRED 0x0002 +#define RP_SHARED_EVENT_RELEASED 0x0001 // RP_IPC_TO_GUEST_PRIVATE_TYPECLIP return code #define PRIVATETYPECLIP_NOTIMPL 0 @@ -535,6 +545,94 @@ typedef struct RPScreenOverlay #define RP_MENU_EVENT_BACK 6 +// RPTextCursorInfo (used by RP_IPC_TO_HOST_TEXT_CURSOR_INFO) + +typedef struct RPTextCursorInfo +{ + DWORD dwCursorColumn; // current cursor column or RP_NO_COLUMN + DWORD dwCursorRow; // current cursor row or RP_NO_ROW + DWORD dwColumns; // total number of columns + DWORD dwRows; // total number of rows + RECT rcCursor; // text cursor position (in window coordinates) (empty rectangle, if mouse is outside of text area) + RECT rcTextArea; // text area (in window coordinates) + DWORD dwMouseButtons; // RP_MOUSE_BUTTON_* flags + POINT ptMousePosition;// mouse coordinates relative to the emulation window (or -1,-1, when mouse is moved outside the emulation window) +} RPTEXTCURSORINFO; + +#define RP_NO_COLUMN ((DWORD)-1) // mouse is outside of text area +#define RP_NO_ROW ((DWORD)-1) // mouse is outside of text area + + +// RP_IPC_TO_HOST_MOUSEBUTTON and RP_IPC_TO_HOST_TEXT_CURSOR_INFO +#define RP_MOUSE_BUTTON_LEFT 0x0001 +#define RP_MOUSE_BUTTON_RIGHT 0x0002 +#define RP_MOUSE_BUTTON_MIDDLE 0x0004 + + +// RP_IPC_TO_GUEST_TRIGGER_TRAP +typedef HRESULT (CALLBACK *RP_READ_MEMORY_CALLBACK)(DWORD dwAddress, DWORD dwSize, DWORD *pdwValue, LPARAM lParam1, LPARAM lParam2); +typedef HRESULT (CALLBACK *RP_WRITE_MEMORY_CALLBACK)(DWORD dwAddress, DWORD dwSize, DWORD dwValue, LPARAM lParam1, LPARAM lParam2); +typedef void (CALLBACK *RP_TRAP_CALLBACK)(RP_READ_MEMORY_CALLBACK pfnReadMemory, RP_WRITE_MEMORY_CALLBACK pfnWriteMemory, DWORD dwFlags, LPARAM lParam1, LPARAM lParam2); +typedef struct RPTrapData +{ + DWORD dwFlags; // see RP_TRAPF_* defines below + RP_TRAP_CALLBACK pfnCallback; + LPARAM lCallbackParam; +} RPTRAPDATA; +// RPTRAPDATA dwFlags +#define RP_TRAPF_READ_ACCESS 0x00000001 +#define RP_TRAPF_WRITE_ACCESS 0x00000002 +#define RP_TRAPF_SYNC_MODE 0x00000004 +#define RP_TRAPF_ASYNC_MODE 0x00000008 +// RP_IPC_TO_GUEST_TRIGGER_TRAP return code +#define RP_TRAP_UNSUPPORTED 0 +#define RP_TRAP_OK_SYNC 1 +#define RP_TRAP_OK_ASYNC 2 +#define RP_TRAP_SYNC_NOT_POSSIBLE 3 +#define RP_TRAP_ASYNC_NOT_POSSIBLE 4 +#define RP_TRAP_ERROR 5 + + +// RP_IPC_TO_HOST_SET_MOUSE_CURSOR return codes +#define RP_SMC_UNSUPPORTED 0 +#define RP_SMC_CURSOR_NOT_SET 1 +#define RP_SMC_CURSOR_SET 2 + + +// RPExecuteInfo (used by RP_IPC_TO_GUEST_EXECUTE) + +typedef struct RPExecuteInfo +{ + DWORD cbSize; // the size of this structure, in bytes + WCHAR szFile[260]; // program to be executed (may include a path), or an empty string (if dwFileDataSize is != 0) + WCHAR szParameters[260]; // command line parameters + WCHAR szDirectory[260]; // program current directory + DWORD dwStackSize; // stack size of the new process (0 = default stack size) + LONG lPriority; // process priority (0 = default priority) + DWORD dwFlags; // RP_EXECUTE_* flags (see below) + DWORD dwExecuteID; // unique ID of this execute request (used by guest to later send a RP_IPC_TO_HOST_EXECUTE_RESULT message) + DWORD dwFileDataSize; // size, in bytes, of the file binary data (set to 0, if szFile contains a valid program file string) + DWORD dwFileDataOffset; // offset, relative from the beginning of this structure, where file data begins +} RPEXECUTEINFO; + +#define RP_EXECUTE_RETURN_EXIT_CODE 0x00000001 // wait for the program to finish and return its exit code +#define RP_EXECUTE_RETURN_OUTPUT 0x00000002 // wait for the program to finish and return its output +#define RP_EXECUTE_SILENT 0x00000004 // error messages and other UI interactions should be suppressed + + +// RPExecutionResult (used by RP_IPC_TO_HOST_EXECUTE_RESULT) + +typedef struct RPExecuteResult +{ + DWORD cbSize; // the size of this structure, in bytes (not including the extra size of the szOutput array) + DWORD dwExecuteID; // execute request ID (see dwExecuteID in RPExecuteInfo) + HRESULT hrExecuteResult; // if != NOERROR, the program was not launched (S_FALSE for generic error, or detailed HRESULT error code) + DWORD dwExitCode; // program exit code + DWORD dwOutputLength; // length of the output string (not including the terminating null character) + WCHAR szOutput[1]; // output string (variable-sized array) +} RPEXECUTERESULT; + + // Legacy Compatibility #ifndef RP_NO_LEGACY // Changed in 7.0 diff --git a/od-win32/keyboard_win32.cpp b/od-win32/keyboard_win32.cpp index 8fed6dc5..1a0540fe 100644 --- a/od-win32/keyboard_win32.cpp +++ b/od-win32/keyboard_win32.cpp @@ -404,15 +404,8 @@ bool my_kbd_handler (int keyboard, int scancode, int newstate, bool alwaysreleas #if 0 if (scancode == DIK_F1) { if (newstate) { - char msg[20000]; - FILE *f = fopen("test.txt", "rb"); - memset(msg, 0, sizeof msg); - fread(msg, 1, sizeof msg, f); - void parse_guest_event(const TCHAR *ss); - TCHAR *txt = au(msg); - parse_guest_event(txt); - free(txt); - fclose(f); + extern void rp_test(void); + rp_test(); } return true; } diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 13038bd8..dcd9d73d 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -135,6 +135,7 @@ static const TCHAR *getmsg (int msg) case RP_IPC_TO_HOST_KEYBOARDLAYOUT: return _T("RP_IPC_TO_HOST_KEYBOARDLAYOUT"); case RP_IPC_TO_HOST_MOUSEMOVE: return _T("RP_IPC_TO_HOST_MOUSEMOVE"); case RP_IPC_TO_HOST_MOUSEBUTTON: return _T("RP_IPC_TO_HOST_MOUSEBUTTON"); + case RP_IPC_TO_HOST_EXECUTE_RESULT: return _T("RP_IPC_TO_HOST_EXECUTE_RESULT"); case RP_IPC_TO_GUEST_CLOSE: return _T("RP_IPC_TO_GUEST_CLOSE"); case RP_IPC_TO_GUEST_SCREENMODE: return _T("RP_IPC_TO_GUEST_SCREENMODE"); @@ -161,6 +162,7 @@ static const TCHAR *getmsg (int msg) case RP_IPC_TO_GUEST_MOVESCREENOVERLAY: return _T("RP_IPC_TO_GUEST_MOVESCREENOVERLAY"); case RP_IPC_TO_GUEST_SENDMOUSEEVENTS: return _T("RP_IPC_TO_GUEST_SENDMOUSEEVENTS"); case RP_IPC_TO_GUEST_SHOWDEBUGGER: return _T("RP_IPC_TO_GUEST_SHOWDEBUGGER"); + case RP_IPC_TO_GUEST_EXECUTE: return _T("RP_IPC_TO_GUEST_EXECUTE"); default: return _T("UNKNOWN"); } } @@ -1251,6 +1253,42 @@ static int screenoverlay(LPCVOID pData) return D3D_extoverlay(&eo); } +static void dos_execute_callback(uae_u32 id, uae_u32 status, uae_u32 flags) +{ + RPExecuteResult *er; + int size = sizeof(RPExecuteResult); + + if (flags & (RP_EXECUTE_RETURN_EXIT_CODE | RP_EXECUTE_RETURN_OUTPUT)) { + er = (RPExecuteResult *)xcalloc(uae_u8, size); + if (er) { + er->cbSize = size; + er->dwExecuteID = id; + er->dwExitCode = status; + er->dwOutputLength = 0; + er->hrExecuteResult = S_OK; + er->szOutput[0] = 0; + RPSendMessagex(RP_IPC_TO_HOST_EXECUTE_RESULT, 0, 0, er, size, &guestinfo, NULL); + xfree(er); + } + } +} + +static int dosexecute(TCHAR *file, TCHAR *currentdir, TCHAR *parms, uae_u32 stack, uae_s32 priority, uae_u32 id, uae_u32 flags, uae_u8 *bin, uae_u32 binsize) +{ + if (flags & RP_EXECUTE_RETURN_OUTPUT) { + return 0; + } + int ret = filesys_shellexecute2(file, currentdir, parms, stack, priority, id, flags, bin, binsize, dos_execute_callback); + return ret; +} + +static int execute(LPCVOID pData) +{ + struct RPExecuteInfo *ei = (struct RPExecuteInfo*)pData; + int v = dosexecute(ei->szFile, ei->szDirectory, ei->szParameters, ei->dwStackSize, ei->lPriority, ei->dwExecuteID, ei->dwFlags, ei->dwFileDataOffset ? (uae_u8*)pData + ei->dwFileDataOffset : NULL , ei->dwFileDataSize); + return v; +} + extern int screenshotf(int monid, const TCHAR *spath, int mode, int doprepare, int imagemode, struct vidbuffer *vb); extern int screenshotmode; static int screencap(LPCVOID pData, struct AmigaMonitor *mon) @@ -1487,6 +1525,8 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM case RP_IPC_TO_GUEST_SHOWDEBUGGER: activate_debugger(); return 1; + case RP_IPC_TO_GUEST_EXECUTE: + return execute(pData); } return FALSE; } @@ -2331,3 +2371,19 @@ void rp_reset(void) return; device_add_vsync_pre(rp_vsync); } + +void rp_test(void) +{ +#if 0 + struct AmigaMonitor *mon = &AMonitors[0]; + struct RPScreenCapture rpsc = { 0 }; + + _tcscpy(rpsc.szScreenRaw, _T("c:\\temp\\test.png")); + + screencap((void*)&rpsc, mon); +#endif +#if 1 + dosexecute(_T("c:list"), _T("sys:"), _T(""), 4000, 3, 0x12345678, 0, NULL, 0); + +#endif +} diff --git a/od-win32/rp.h b/od-win32/rp.h index 45f2c6ed..fa1917cb 100644 --- a/od-win32/rp.h +++ b/od-win32/rp.h @@ -23,6 +23,7 @@ extern USHORT rp_rawbuttons(LPARAM lParam, USHORT usButtonFlags); extern bool rp_mouseevent(int x, int y, int buttons, int buttonmask); extern bool rp_ismouseevent(void); extern void rp_reset(void); +extern void rp_test(void); extern TCHAR *rp_param; extern int rp_rpescapekey; -- 2.47.3