Browse Source

Fix bugs in BIT; add trace for IRQ; make MMU mapping logs trace-level.

master
Ben Kurtovic 8 years ago
parent
commit
df3277a2b6
3 changed files with 4 additions and 3 deletions
  1. +1
    -1
      src/mmu.c
  2. +1
    -0
      src/z80.c
  3. +2
    -2
      src/z80_ops.inc.c

+ 1
- 1
src/mmu.c View File

@@ -86,7 +86,7 @@ void mmu_load_rom(MMU *mmu, const uint8_t *data, size_t size)
*/
static inline void map_slot(MMU *mmu, size_t slot, size_t bank)
{
DEBUG("MMU mapping memory slot %zu to bank 0x%02zX", slot, bank)
TRACE("MMU mapping memory slot %zu to bank 0x%02zX", slot, bank)
mmu->map_slots[slot] = mmu->rom_banks[bank];
}



+ 1
- 0
src/z80.c View File

@@ -278,6 +278,7 @@ static inline uint8_t get_interrupt_mode(const Z80 *z80)
*/
static inline uint8_t handle_interrupt(Z80 *z80)
{
TRACE("Z80 triggering mode-%d interrupt", get_interrupt_mode(z80))
z80->regfile.iff1 = z80->regfile.iff2 = 0;
stack_push(z80, z80->regfile.pc);



+ 2
- 2
src/z80_ops.inc.c View File

@@ -848,7 +848,7 @@ static uint8_t z80_inst_dec_ss(Z80 *z80, uint8_t opcode)
static uint8_t z80_inst_bit_b_r(Z80 *z80, uint8_t opcode)
{
uint8_t *reg = extract_reg(z80, opcode << 3);
uint8_t bit = opcode >> 3;
uint8_t bit = (opcode >> 3) & 0x07;
bool z = (((*reg) >> bit) & 1) == 0;
if (z)
update_flags(z80, 0, 0, 1, 0, 1, 0, 1, 0, 0xFE);
@@ -866,7 +866,7 @@ static uint8_t z80_inst_bit_b_r(Z80 *z80, uint8_t opcode)
static uint8_t z80_inst_bit_b_hl(Z80 *z80, uint8_t opcode)
{
uint8_t val = mmu_read_byte(z80->mmu, get_pair(z80, REG_HL));
uint8_t bit = opcode >> 3;
uint8_t bit = (opcode >> 3) & 0x07;
bool z = ((val >> bit) & 1) == 0;
if (z)
update_flags(z80, 0, 0, 1, 0, 1, 0, 1, 0, 0xFE);


Loading…
Cancel
Save