Mercurial > repos > blastem
comparison trans.c @ 212:e657a99b5abf
Fixed up trans for changes to translate_m68k_stream, but still need to deal with missing callbacks.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 16 Apr 2013 09:38:30 -0700 |
parents | 4717146a7606 |
children | 306986209cba |
comparison
equal
deleted
inserted
replaced
211:464513050c85 | 212:e657a99b5abf |
---|---|
7 int main(int argc, char ** argv) | 7 int main(int argc, char ** argv) |
8 { | 8 { |
9 long filesize; | 9 long filesize; |
10 unsigned short *filebuf; | 10 unsigned short *filebuf; |
11 char disbuf[1024]; | 11 char disbuf[1024]; |
12 size_t size = 1024 * 1024; | |
13 uint8_t * transbuf = alloc_code(&size); | |
14 uint8_t *trans_cur, *end; | |
15 unsigned short * cur; | 12 unsigned short * cur; |
16 x86_68k_options opts; | 13 x86_68k_options opts; |
17 m68k_context context; | 14 m68k_context context; |
18 FILE * f = fopen(argv[1], "rb"); | 15 FILE * f = fopen(argv[1], "rb"); |
19 fseek(f, 0, SEEK_END); | 16 fseek(f, 0, SEEK_END); |
31 //cartridge ROM | 28 //cartridge ROM |
32 context.mem_pointers[0] = filebuf; | 29 context.mem_pointers[0] = filebuf; |
33 context.target_cycle = 0x7FFFFFFF; | 30 context.target_cycle = 0x7FFFFFFF; |
34 //work RAM | 31 //work RAM |
35 context.mem_pointers[1] = malloc(64 * 1024); | 32 context.mem_pointers[1] = malloc(64 * 1024); |
36 translate_m68k_stream(transbuf, transbuf + size, 0, &context); | 33 uint32_t address; |
34 address = filebuf[2] << 16 | filebuf[3]; | |
35 translate_m68k_stream(address, &context); | |
37 m68k_reset(&context); | 36 m68k_reset(&context); |
38 return 0; | 37 return 0; |
39 } | 38 } |