comparison z80_to_x86.c @ 967:1eb616b8cbe9

Fix bug in Z80 rrd implementation. This fixes the annoying high pitched wine in Afterburner II.
author Michael Pavone <pavone@retrodev.com>
date Wed, 20 Apr 2016 23:19:13 -0700
parents f765c2fc7508
children fbfb821e92a8
comparison
equal deleted inserted replaced
966:f765c2fc7508 967:1eb616b8cbe9
1433 zreg_to_native(opts, Z80_A, opts->gen.scratch2); 1433 zreg_to_native(opts, Z80_A, opts->gen.scratch2);
1434 ror_ir(code, 4, opts->gen.scratch1, SZ_W); 1434 ror_ir(code, 4, opts->gen.scratch1, SZ_W);
1435 shl_ir(code, 4, opts->gen.scratch2, SZ_W); 1435 shl_ir(code, 4, opts->gen.scratch2, SZ_W);
1436 and_ir(code, 0xF00F, opts->gen.scratch1, SZ_W); 1436 and_ir(code, 0xF00F, opts->gen.scratch1, SZ_W);
1437 and_ir(code, 0xF0, opts->regs[Z80_A], SZ_B); 1437 and_ir(code, 0xF0, opts->regs[Z80_A], SZ_B);
1438 and_ir(code, 0xF0, opts->gen.scratch2, SZ_W);
1438 //opts->gen.scratch1 = 0x2001 1439 //opts->gen.scratch1 = 0x2001
1439 //opts->gen.scratch2 = 0x0040 1440 //opts->gen.scratch2 = 0x0040
1440 or_rr(code, opts->gen.scratch2, opts->gen.scratch1, SZ_W); 1441 or_rr(code, opts->gen.scratch2, opts->gen.scratch1, SZ_W);
1441 //opts->gen.scratch1 = 0x2041 1442 //opts->gen.scratch1 = 0x2041
1442 ror_ir(code, 8, opts->gen.scratch1, SZ_W); 1443 ror_ir(code, 8, opts->gen.scratch1, SZ_W);