From 3772880c0ada686aad13f578c0e219ecc1bd4d85 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 31 Jan 2009 00:48:40 +0100 Subject: [PATCH] fn_598b4 implemented --- rsb-lz.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/rsb-lz.c b/rsb-lz.c index ed0c813..4f077b1 100644 --- a/rsb-lz.c +++ b/rsb-lz.c @@ -428,10 +428,12 @@ void fn_59560(unsigned int arg1) { + fprintf(stderr,"%s\n", __func__); } void fn_59578(unsigned int arg1, unsigned int arg2, unsigned int arg3, unsigned int arg4) { + fprintf(stderr,"%s\n", __func__); } void fn_59788() @@ -449,14 +451,56 @@ struct s_59b78 { unsigned int fn_59848(struct s_59b78 *data) { + fprintf(stderr,"%s\n", __func__); return 0; } -unsigned int fn_598b4(struct s_59b78 *data, unsigned int arg2) +unsigned int fn_597c8(struct s_59b78 *r11_data) { + fprintf(stderr,"%s\n", __func__); return 0; } +unsigned int fn_598b4(struct s_59b78 *r11_data, unsigned int r10_arg2) +{ + unsigned int r1; + unsigned int r2; + unsigned int r6; + unsigned int r7; + + fprintf(stderr,"%s\n", __func__); + + r1 = r10_arg2 - 1; + r6 = 1 << r1; + + r7 = 0; + do { + r1 = r11_data->y; + if (r1 == 0x80) { + r1 = fn_597c8(r11_data); + } + r11_data->x = r1; + r1 = r11_data->y; + r2 = r11_data->x; + r1 = r1 & r2; + if (r1 != 0) + r7 = r7 | r6; + + r6 = r6 >> 1; + + r2 = r11_data->y; + r2 = r2 >> 1; + r11_data->y = r2; + + r1 = r11_data->y; + if(r1 == 0) { + r11_data->y = 0x80; + } + } while (r6 != 0); + + return r7; +} + void fn_5980c(unsigned int arg1, unsigned int mem[]) { unsigned char *r1; @@ -560,6 +604,7 @@ unsigned int crc_check_59684(unsigned char *arg1, unsigned int arg2, unsigned in void fn_59508() { + fprintf(stderr,"%s\n", __func__); } void extract_lz_file(unsigned char *buf, unsigned char *name) -- 2.39.5