comparison z80_to_x86.c @ 662:66388360f873

Remove dedicated registers for Z80 bank reg and Z80 bank pointer as they are no longer used
author Michael Pavone <pavone@retrodev.com>
date Thu, 01 Jan 2015 23:37:24 -0800
parents e7cae6d9aaa6
children 7a5461001242
comparison
equal deleted inserted replaced
661:01c51f397db2 662:66388360f873
1954 options->regs[Z80_SP] = R9; 1954 options->regs[Z80_SP] = R9;
1955 options->regs[Z80_AF] = -1; 1955 options->regs[Z80_AF] = -1;
1956 options->regs[Z80_IX] = RDX; 1956 options->regs[Z80_IX] = RDX;
1957 options->regs[Z80_IY] = R8; 1957 options->regs[Z80_IY] = R8;
1958 1958
1959 options->bank_reg = R15;
1960 options->bank_pointer = R12;
1961
1962 options->gen.context_reg = RSI; 1959 options->gen.context_reg = RSI;
1963 options->gen.cycles = RBP; 1960 options->gen.cycles = RBP;
1964 options->gen.limit = RDI; 1961 options->gen.limit = RDI;
1965 options->gen.scratch1 = R13; 1962 options->gen.scratch1 = R13;
1966 options->gen.scratch2 = R14; 1963 options->gen.scratch2 = R14;
2001 if (options->regs[Z80_SP] >= 0) { 1998 if (options->regs[Z80_SP] >= 0) {
2002 mov_rrdisp(code, options->regs[Z80_SP], options->gen.context_reg, offsetof(z80_context, sp), SZ_W); 1999 mov_rrdisp(code, options->regs[Z80_SP], options->gen.context_reg, offsetof(z80_context, sp), SZ_W);
2003 } 2000 }
2004 mov_rrdisp(code, options->gen.limit, options->gen.context_reg, offsetof(z80_context, target_cycle), SZ_D); 2001 mov_rrdisp(code, options->gen.limit, options->gen.context_reg, offsetof(z80_context, target_cycle), SZ_D);
2005 mov_rrdisp(code, options->gen.cycles, options->gen.context_reg, offsetof(z80_context, current_cycle), SZ_D); 2002 mov_rrdisp(code, options->gen.cycles, options->gen.context_reg, offsetof(z80_context, current_cycle), SZ_D);
2006 mov_rrdisp(code, options->bank_reg, options->gen.context_reg, offsetof(z80_context, bank_reg), SZ_W);
2007 mov_rrdisp(code, options->bank_pointer, options->gen.context_reg, offsetof(z80_context, mem_pointers) + sizeof(uint8_t *) * 1, SZ_PTR);
2008 retn(code); 2003 retn(code);
2009 2004
2010 options->load_context_scratch = code->cur; 2005 options->load_context_scratch = code->cur;
2011 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, scratch1), options->gen.scratch1, SZ_W); 2006 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, scratch1), options->gen.scratch1, SZ_W);
2012 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, scratch2), options->gen.scratch2, SZ_W); 2007 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, scratch2), options->gen.scratch2, SZ_W);
2032 if (options->regs[Z80_SP] >= 0) { 2027 if (options->regs[Z80_SP] >= 0) {
2033 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, sp), options->regs[Z80_SP], SZ_W); 2028 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, sp), options->regs[Z80_SP], SZ_W);
2034 } 2029 }
2035 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, target_cycle), options->gen.limit, SZ_D); 2030 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, target_cycle), options->gen.limit, SZ_D);
2036 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, current_cycle), options->gen.cycles, SZ_D); 2031 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, current_cycle), options->gen.cycles, SZ_D);
2037 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, bank_reg), options->bank_reg, SZ_W);
2038 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, mem_pointers) + sizeof(uint8_t *) * 1, options->bank_pointer, SZ_PTR);
2039 retn(code); 2032 retn(code);
2040 2033
2041 options->native_addr = code->cur; 2034 options->native_addr = code->cur;
2042 call(code, options->gen.save_context); 2035 call(code, options->gen.save_context);
2043 push_r(code, options->gen.context_reg); 2036 push_r(code, options->gen.context_reg);