diff options
Diffstat (limited to 'reverse-engineering/dosbox_snif/main_dump.c')
-rw-r--r-- | reverse-engineering/dosbox_snif/main_dump.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/reverse-engineering/dosbox_snif/main_dump.c b/reverse-engineering/dosbox_snif/main_dump.c new file mode 100644 index 0000000..68bd4c0 --- /dev/null +++ b/reverse-engineering/dosbox_snif/main_dump.c @@ -0,0 +1,39 @@ +#include "rsp.h" +#include "rsp_lemm.h" +#include "utils.h" + +#include <string.h> /* memset() */ +#include <stdio.h> /* printf() */ + +int main(int argc, char *argv[]) { + int rv, end=0; + struct rsp_state rsp; + char ds_si[10], command[16]; + + rv=rsp_lemm_init(&rsp, ds_si); + if ( rv != 0 ) { + printf("Error rsp_lemm_init() returns %i\n", rv); + return 1; + } + + while (!end) { + rsp_query(&rsp, "c"); // Continue + if ( rsp.replied != 1 ) printf("Bug 03\n"); + rsp_recv_full(&rsp); + if ( rsp_check_and_clear(&rsp, "S05") != 0 ) printf("Bug 04\n"); + + snprintf(command, 15, "m%s,0x2d", ds_si); + rsp_query(&rsp, command); // Read a lemming record + if ( rsp_decode(&rsp) != 0x2d * 2 ) { + printf("Bug 07\n"); + } else { + printf("%s\n", rsp.decoded); + } + } + + + rsp_quit(&rsp); + return 0; +} + + |