From 4e025b2e5ee4e09f34669ab41c6b4a050414a3be Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 23 May 2026 19:15:35 +0200 Subject: [PATCH] tests --- kern.h | 6 ++++-- nwtests.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/kern.h b/kern.h index a3ec0ef..606b737 100644 --- a/kern.h +++ b/kern.h @@ -3,6 +3,10 @@ #define KERN_CALL _Cdecl #else #define KERN_CALL + +extern int KERN_CALL Net_Call_NWCVLMREQ(UI flags, void *regblk, + UI p1, UI p2, UI p3); + #endif extern int KERN_CALL IPXinit(void); @@ -26,8 +30,6 @@ extern int KERN_CALL C32_NCP87_Raw_Probe(UI connLo, UI connHi, extern int KERN_CALL Net_Call_VLM_Raw(UI ax, UI bx, UI cx, UI dx, void *req, void *repl, UI p1, UI p2, UI p3); -extern int KERN_CALL Net_Call_NWCVLMREQ(UI flags, void *regblk, - UI p1, UI p2, UI p3); extern int KERN_CALL Net_Call_C(UI func, void *req, void *repl); extern int KERN_CALL Net_Call_CX(UI func, UI bx, UI cx, UI dx, void *req, void *repl); diff --git a/nwtests.c b/nwtests.c index 4125833..c5f0a95 100644 --- a/nwtests.c +++ b/nwtests.c @@ -1407,6 +1407,31 @@ static int tests_nwreq87c32matrix(void) } + +static void tests_set_reg_word(uint8 *r, int off, UI val) +{ + tests_put_word_lh(r + off, (uint16)val); +} + +static UI tests_get_reg_word(uint8 *r, int off) +{ + return (UI)(r[off] | ((UI)r[off + 1] << 8)); +} + +static void tests_dump_vlm_regs(char *title, uint8 *r) +{ + fprintf(stdout, "%s SI=%04X DS=%04X DI=%04X ES=%04X AX=%04X BX=%04X CX=%04X DX=%04X\n", + title, + tests_get_reg_word(r, 0), + tests_get_reg_word(r, 2), + tests_get_reg_word(r, 4), + tests_get_reg_word(r, 6), + tests_get_reg_word(r, 8), + tests_get_reg_word(r, 10), + tests_get_reg_word(r, 12), + tests_get_reg_word(r, 14)); +} + static int tests_c32primref(void) { uint8 regs[16];