comparison transz80.c @ 659:759c38bf97f8

Minor Z80 core cleanup
author Michael Pavone <pavone@retrodev.com>
date Thu, 01 Jan 2015 20:26:22 -0800
parents b7b7a1cab44a
children
comparison
equal deleted inserted replaced
658:6aa29ac33f1a 659:759c38bf97f8
36 36
37 int main(int argc, char ** argv) 37 int main(int argc, char ** argv)
38 { 38 {
39 long filesize; 39 long filesize;
40 uint8_t *filebuf; 40 uint8_t *filebuf;
41 x86_z80_options opts; 41 z80_options opts;
42 z80_context context; 42 z80_context context;
43 if (argc < 2) { 43 if (argc < 2) {
44 fputs("usage: transz80 zrom [cartrom]\n", stderr); 44 fputs("usage: transz80 zrom [cartrom]\n", stderr);
45 exit(1); 45 exit(1);
46 } 46 }
68 for(unsigned short * cur = cart; cur - cart < (filesize/2); ++cur) 68 for(unsigned short * cur = cart; cur - cart < (filesize/2); ++cur)
69 { 69 {
70 *cur = (*cur >> 8) | (*cur << 8); 70 *cur = (*cur >> 8) | (*cur << 8);
71 } 71 }
72 } 72 }
73 init_x86_z80_opts(&opts); 73 init_z80_opts(&opts);
74 init_z80_context(&context, &opts); 74 init_z80_context(&context, &opts);
75 //Z80 RAM 75 //Z80 RAM
76 context.mem_pointers[0] = z80_ram; 76 context.mem_pointers[0] = z80_ram;
77 context.sync_cycle = context.target_cycle = MCLKS_PER_FRAME/MCLKS_PER_Z80; 77 context.sync_cycle = context.target_cycle = MCLKS_PER_FRAME/MCLKS_PER_Z80;
78 context.int_cycle = CYCLE_NEVER; 78 context.int_cycle = CYCLE_NEVER;