diff options
author | Ludovic Pouzenc <lpouzenc@gmail.com> | 2013-09-07 13:02:00 +0200 |
---|---|---|
committer | Ludovic Pouzenc <lpouzenc@gmail.com> | 2013-09-07 13:02:00 +0200 |
commit | 282edee739b22152ecbe57eb41a8644276b20eaa (patch) | |
tree | 9460aa3cf462242afb44739e26b46cddd19981bf /src/dosbox_snif/main_dump_ds0.c | |
parent | c5fea717cde9012c08372cc6987043bc316a736b (diff) | |
download | mplemmings-282edee739b22152ecbe57eb41a8644276b20eaa.tar.gz mplemmings-282edee739b22152ecbe57eb41a8644276b20eaa.tar.bz2 mplemmings-282edee739b22152ecbe57eb41a8644276b20eaa.zip |
Ajout du prog de dump du debut de segment de data (pour identification vars) + disasm
Diffstat (limited to 'src/dosbox_snif/main_dump_ds0.c')
-rw-r--r-- | src/dosbox_snif/main_dump_ds0.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/dosbox_snif/main_dump_ds0.c b/src/dosbox_snif/main_dump_ds0.c new file mode 100644 index 0000000..e54589d --- /dev/null +++ b/src/dosbox_snif/main_dump_ds0.c @@ -0,0 +1,61 @@ +#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, i, end=0; + struct rsp_state rsp; + char ds_si[10], command[16]; + unsigned int addr, ds_offset; + + 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"); + + // For the beginning of the ds segment + ds_offset=0; + /* For this chunk of code : + 000052A3 83E307 and bx,byte +0x7 bx = 0x5660 + lemm.x_effective % 8; + 000052A6 81C36056 add bx,0x5660 // + 000052AA 8A27 mov ah,[bx] ah = [bx]; + */ + ds_offset = 0x5660; + /* For understanding pixel collision tests at 00005280 + di = lemm.y_effective - 16; + if ( di >= 0 ) di=0; //WTF ??? + di *= (LEVEL_WIDTH/8); + di += 0x6d60 + lemm.x_effective / 8; + */ + ds_offset = 0x6d60; + + ds_offset = 0x3f; + for (i=0;i<8;i++) { + addr = (0xb55 << 4) + ds_offset + (i * 0x20); + snprintf(command, 15, "m%06x,0x20", addr ); + rsp_query(&rsp, command); + if ( rsp_decode(&rsp) != 0x20 *2) { + printf("%06x : Bug\n", addr); + } else { + printf("%06x : %s\n", addr, rsp.decoded); + } + } + printf("\n"); + } + + + rsp_quit(&rsp); + return 0; +} + + |