This commit is contained in:
Mario Fetka
2026-05-23 18:11:08 +02:00
parent 3bd41dd828
commit 07784e8e9c

View File

@@ -1334,6 +1334,86 @@ static int tests_c32mapconn(void)
}
static int tests_c32mapconn_value(UI conn16, UI label)
{
uint8 regs[16];
uint8 reply[128];
int rc;
memset(regs, 0, sizeof(regs));
memset(reply, 0, sizeof(reply));
tests_set_reg_word(regs, 4, FP_OFF(reply)); /* DI */
tests_set_reg_word(regs, 6, FP_SEG(reply)); /* ES */
tests_set_reg_word(regs, 12, conn16); /* CX */
fprintf(stdout, "\nC32MAPCONN value=%u label=%u\n", conn16, label);
tests_dump_vlm_regs("REG in :", regs);
fprintf(stdout, "Call NWCVLMREQ flags=2 p1=000D p2=0010 p3=0000\n");
rc = Net_Call_NWCVLMREQ(2, regs, 0x000D, 0x0010, 0);
fprintf(stdout, "NWCVLMREQ rc=%04X\n", rc);
tests_dump_vlm_regs("REG out:", regs);
tests_dump_bytes("REPLY:", reply, 64);
fprintf(stdout, "REPLY text: %s\n", reply);
return rc;
}
static int tests_c32mapconnone(int argc, char *argv[])
{
UI val;
if (argc < 3) {
fprintf(stdout, "Usage: TESTS C32MAPCONNONE value\n");
return(1);
}
val = (UI)atoi(argv[2]);
return tests_c32mapconn_value(val, val);
}
static int tests_c32mapconnmatrix(void)
{
int drive;
uint8 connid = 0;
uint8 dhandle = 0;
uint8 flags = 0;
UI values[12];
int i;
drive = tests_get_current_drive();
get_drive_info((uint8)drive, &connid, &dhandle, &flags);
values[0] = 0;
values[1] = 1;
values[2] = 2;
values[3] = 3;
values[4] = 4;
values[5] = (UI)connid;
values[6] = (UI)dhandle;
values[7] = (UI)drive;
values[8] = (UI)(drive + 1);
values[9] = 0x31;
values[10] = 0x3130;
values[11] = 0xffff;
fprintf(stdout, "TEST C32MAPCONNMATRIX paged\n");
fprintf(stdout, "drive=%c: connid=%u dhandle=%u flags=%02X\n",
'A' + drive, connid, dhandle, flags);
tests_wait_key();
for (i = 0; i < 12; i++) {
tests_c32mapconn_value(values[i], (UI)i);
if (i != 11)
tests_wait_key();
}
return(0);
}
int func_tests(int argc, char *argv[], int mode)
{
if (argc >= 2) {
@@ -1355,6 +1435,12 @@ int func_tests(int argc, char *argv[], int mode)
if (tests_same_arg(argv[1], "C32MAPCONN"))
return tests_c32mapconn();
if (tests_same_arg(argv[1], "C32MAPCONNONE"))
return tests_c32mapconnone(argc, argv);
if (tests_same_arg(argv[1], "C32MAPCONNMATRIX"))
return tests_c32mapconnmatrix();
if (tests_same_arg(argv[1], "NWREQ87"))
return tests_nwreq87(argc, argv);