1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
}
|