Fix build on MSVC thanks to Rene, also fix debug_break crashes

This commit is contained in:
therealmogminer@gmail.com 2016-06-08 20:43:41 +02:00
parent a3af73bafc
commit 0ae82382cb
35 changed files with 58 additions and 45 deletions

View File

@ -244,7 +244,7 @@ UINT8 s3virge_vga_device::s3_crtc_reg_read(UINT8 index)
break;
default:
res = vga.crtc.data[index];
//machine.debugger().debug_break();
//machine.debug_break();
//printf("%02x\n",index);
break;
}

View File

@ -274,7 +274,7 @@ void alpha8201_cpu_device::M_UNDEFINED()
osd_printf_debug("alpha8201: PC = %03x, Unimplemented opcode = %02x\n", m_pc.w.l-1, M_RDMEM(m_pc.w.l-1));
#endif
#if BREAK_ON_UNKNOWN_OPCODE
machine().debugger().debug_break();
machine().debug_break();
#endif
}
@ -287,7 +287,7 @@ void alpha8201_cpu_device::M_UNDEFINED2()
osd_printf_debug("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm);
#endif
#if BREAK_ON_UNKNOWN_OPCODE
machine().debugger().debug_break();
machine().debug_break();
#endif
}

View File

@ -1390,7 +1390,7 @@ void arm_cpu_device::HandleCoProVL86C020( UINT32 insn )
0x00<<0 <- Revision number, 0
*/
SetRegister(rn, 0x41560300);
//machine().debugger().debug_break();
//machine().debug_break();
}
else
SetRegister(rn, m_coproRegister[crn]);
@ -1407,7 +1407,7 @@ void arm_cpu_device::HandleCoProVL86C020( UINT32 insn )
else
{
printf("%08x: Unimplemented VL86C020 copro instruction %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn);
machine().debugger().debug_break();
machine().debug_break();
}
}

View File

@ -706,7 +706,7 @@ void avr8_device::set_lock_bits(const UINT8 byte)
void avr8_device::unimplemented_opcode(UINT32 op)
{
// machine().debugger().debug_break();
// machine().debug_break();
fatalerror("AVR8: unknown opcode (%08x) at %08x\n", op, m_shifted_pc);
}
@ -2915,7 +2915,7 @@ READ8_MEMBER( avr8_device::regs_r )
default:
printf("[%08X] AVR8: Unknown Register Read: 0x%03X\n", m_shifted_pc, offset);
// machine().debugger().debug_break();
// machine().debug_break();
return 0;
}
}

View File

@ -358,7 +358,7 @@ inline void dsp32c_device::dau_set_val_flags(int aidx, double res)
else if (absres > 3.40282e38)
{
m_VUflags = VFLAGBIT;
// machine().debugger().debug_break();
// machine().debug_break();
// fprintf(stderr, "Result = %g\n", absres);
res = (res < 0) ? -3.40282e38 : 3.40282e38;
}
@ -403,7 +403,7 @@ inline UINT32 dsp32c_device::double_to_dsp(double val)
return 0x00000000;
else if (exponent > 255)
{
// machine().debugger().debug_break();
// machine().debug_break();
// fprintf(stderr, "Exponent = %d\n", exponent);
return ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) ? 0x7fffffff : 0x800000ff;
}

View File

@ -224,7 +224,7 @@ void mips3_device::generate_exception(int exception, int backup)
if (exception != 0)
{
fprintf(stderr, "Exception: PC=%08X, PPC=%08X\n", m_core->pc, m_ppc);
machine().debugger().debug_break();
machine().debug_break();
}
*/

View File

@ -299,7 +299,7 @@ WRITE32_MEMBER( psxcpu_device::biu_w )
void psxcpu_device::stop()
{
machine().debugger().debug_break();
machine().debug_break();
debugger_instruction_hook( this, m_pc );
}

View File

@ -3028,7 +3028,7 @@ inline void sh34_base_device::op1111_0xf13(const UINT16 opcode)
FRCHG();
break;
default:
machine().debugger().debug_break();
machine().debug_break();
break;
}
} else {
@ -3041,7 +3041,7 @@ inline void sh34_base_device::op1111_0xf13(const UINT16 opcode)
void sh34_base_device::dbreak(const UINT16 opcode)
{
machine().debugger().debug_break();
machine().debug_break();
}

View File

@ -74,7 +74,7 @@ void tms3203x_device::illegal(UINT32 op)
if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
machine().debugger().debug_break();
machine().debug_break();
}
}

View File

@ -814,7 +814,7 @@ void tms3203x_device::execute_run()
{
// watch for out-of-range stack pointers
if (IREG(TMR_SP) & 0xff000000)
machine().debugger().debug_break();
machine().debug_break();
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
if ((INT32)--IREG(TMR_RC) >= 0)

View File

@ -99,7 +99,7 @@ void tms340x0_device::unimpl(UINT16 op)
if (m_pc == 0 || s_opcode_table[m_direct->read_word(TOBYTE(m_pc)) >> 4] == &tms34010_device::unimpl)
{
set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
machine().debugger().debug_break();
machine().debug_break();
}
}

View File

@ -165,7 +165,7 @@ void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param
READ8_MEMBER( aakart_device::read )
{
m_out_tx_cb(CLEAR_LINE);
//machine().debugger().debug_break();
//machine().debug_break();
return m_rx;
}

View File

@ -211,7 +211,7 @@ void ata_hle_device::process_command()
m_status |= IDE_STATUS_ERR;
m_error = IDE_ERROR_ABRT;
set_irq(ASSERT_LINE);
//machine().debugger().debug_break();
//machine().debug_break();
break;
}
}

View File

@ -295,7 +295,7 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_data_w)
READ16_MEMBER(l7a1045_sound_device::sound_data_r)
{
//printf("%04x (%04x %04x)\n",offset,m_audioregister,m_audiochannel);
//machine().debugger().debug_break();
//machine().debug_break();
l7a1045_voice *vptr = &m_voice[m_audiochannel];
switch(m_audioregister)

View File

@ -2664,7 +2664,7 @@ UINT8 s3_vga_device::s3_crtc_reg_read(UINT8 index)
break;
default:
res = vga.crtc.data[index];
//machine().debugger().debug_break();
//machine().debug_break();
//printf("%02x\n",index);
break;
}

View File

@ -93,8 +93,7 @@ void debugger_interrupt_hook(device_t *device, int irqline)
void debugger_manager::debug_break()
{
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
m_cpu->get_visible_cpu()->debug()->halt_on_next_instruction("Internal breakpoint\n");
m_cpu->get_visible_cpu()->debug()->halt_on_next_instruction("Internal breakpoint\n");
}

View File

@ -9,8 +9,10 @@
#pragma once
#ifndef EMU_DEBUGGER_H
#define EMU_DEBUGGER_H
#ifndef __DEBUGGER_H__
#define __DEBUGGER_H__
#include "emu.h"
class debugger_commands;
class debugger_cpu;

View File

@ -727,6 +727,17 @@ void running_machine::add_logerror_callback(logerror_callback callback)
}
//-------------------------------------------------
// debug_break - breaks into the debugger, if
// enabled
//-------------------------------------------------
void running_machine::debug_break()
{
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
debugger().debug_break();
}
//-------------------------------------------------
// base_datetime - retrieve the time of the host
// system; useful for RTC implementations

View File

@ -212,6 +212,7 @@ public:
void call_notifiers(machine_notification which);
void add_logerror_callback(logerror_callback callback);
void set_ui_active(bool active) { m_ui_active = active; }
void debug_break();
// TODO: Do saves and loads still require scheduling?
void immediate_save(const char *filename);

View File

@ -167,7 +167,7 @@ inline UINT32 atvtrack_state::decode64_32(offs_t offset64, UINT64 data, UINT64 m
return (UINT32)(data >> 32);
}
logerror("Wrong word size in external access\n");
//machine().debugger().debug_break();
//machine().debug_break();
return 0;
}

View File

@ -171,7 +171,7 @@ WRITE8_MEMBER(icatel_state::ci8_w)
READ8_MEMBER(icatel_state::ci15_r)
{
/* TODO: Implement-me! */
//machine().debugger().debug_break();
//machine().debug_break();
//logerror("read: ci15\n");
return (1 << 3) | (1 << 0);
}

View File

@ -1817,7 +1817,7 @@ inline int naomi_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *
if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context());
//machine().debugger().debug_break();
//machine().debug_break();
}
if (mem_mask == U64(0xffffffff00000000))

View File

@ -553,7 +553,7 @@ WRITE8_MEMBER(noki3310_state::mad2_io_w)
{
case 0x02:
//printf("DSP %s\n", data & 1 ? "RUN" : "HOLD");
//if (data & 0x01) machine().debugger().debug_break();
//if (data & 0x01) machine().debug_break();
break;
case 0x08:
ack_fiq(data);

View File

@ -818,7 +818,7 @@ WRITE8_MEMBER( pasopia7_state::video_misc_w )
//if(data & 2)
//{
// printf("VIDEO MISC %02x\n",data);
// machine().debugger().debug_break();
// machine().debug_break();
//}
m_cursor_blink = data & 0x20;
m_attr_wrap = data & 0x10;

View File

@ -2341,7 +2341,7 @@ IRQ_CALLBACK_MEMBER(pc8801_state::pc8801_irq_callback)
}
printf("IRQ triggered but no vector on the bus! %02x %02x %02x %02x\n",m_i8214_irq_level,m_sound_irq_latch,m_vrtc_irq_latch,m_timer_irq_latch);
machine().debugger().debug_break();
machine().debug_break();
return 4*2; //TODO: mustn't happen
}

View File

@ -856,7 +856,7 @@ WRITE16_MEMBER(raiden2_state::sprite_prot_src_w)
dst1 += 8;
}
//printf("[%08x] %08x %08x %04x %04x\n",src,dx,dy,dst1,dst2);
//machine().debugger().debug_break();
//machine().debug_break();
}
READ16_MEMBER(raiden2_state::sprite_prot_dst1_r)

View File

@ -750,7 +750,7 @@ void segas24_state::reset_reset()
m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_subcpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
//osd_printf_debug("enable 2nd cpu!\n");
//machine().debugger().debug_break();
//machine().debug_break();
if (m_gground_hack_timer)
{
m_subcpu->set_clock_scale(0.7f); // reduce clock speed temporarily so a check passes, see notes above

View File

@ -1004,7 +1004,7 @@ WRITE32_MEMBER(_3do_state::_3do_clio_w)
case 0x17fc/4:
/* TODO: DSPP enabled just before enabling DSPP irq! */
if(data & 1)
machine().debugger().debug_break();
machine().debug_break();
//printf("%08x\n",data);
break;

View File

@ -244,7 +244,7 @@ int dc_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context());
//machine().debugger().debug_break();
//machine().debug_break();
}
if (mem_mask == U64(0xffffffff00000000))
@ -268,7 +268,7 @@ int dc_state::decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
(mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context());
//machine().debugger().debug_break();
//machine().debug_break();
}
if (mem_mask & U64(0x0000ffff00000000))

View File

@ -119,16 +119,16 @@ READ32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r )
{
case SB_GDSTARD:
printf("G1CTRL: GDSTARD %08x\n", atapi_xferbase); // Hello Kitty reads here
machine().debugger().debug_break();
machine().debug_break();
return atapi_xferbase;
case SB_GDST:
break;
case SB_GDLEND:
//machine().debugger().debug_break();
//machine().debug_break();
return atapi_xferlen; // TODO: check me
default:
printf("G1CTRL: Unmapped read %08x\n", 0x5f7400+offset*4);
machine().debugger().debug_break();
machine().debug_break();
break;
}
return g1bus_regs[offset];

View File

@ -414,6 +414,6 @@ static void decode_dos21(device_t *device,offs_t pc)
if((ax & 0xff00)==0x0900)
{
device->machine().debugger().debug_break();
device->machine().debug_break();
}
}

View File

@ -377,7 +377,7 @@ WRITE8_MEMBER(midway_serial_pic2_device::write)
memcpy(m_buffer, m_data, 16);
m_total = 16;
m_index = 0;
machine().debugger().debug_break();
machine().debug_break();
}
break;

View File

@ -1241,13 +1241,13 @@ WRITE16_MEMBER(tx1_state::buggyboy_math_w)
else
{
osd_printf_debug("BB_DSEL was not 3 for P->S load!\n");
machine().debugger().debug_break();
machine().debug_break();
}
}
else
{
osd_printf_debug("Buggy Boy unknown math state!\n");
machine().debugger().debug_break();
machine().debug_break();
}
if (offset & BB_INSLD)

View File

@ -294,7 +294,7 @@ WRITE16_MEMBER( namcos2_state::rozram_word_w )
m_tilemap_roz->mark_tile_dirty(offset);
//if( space.machine().input().code_pressed(KEYCODE_Q) )
//{
// machine().debugger().debug_break();
// machine().debug_break();
//}
}

View File

@ -1502,13 +1502,13 @@ WRITE32_MEMBER( powervr2_device::ta_yuv_tex_ctrl_w )
/* TODO */
READ32_MEMBER( powervr2_device::ta_yuv_tex_cnt_r )
{
machine().debugger().debug_break();
machine().debug_break();
return ta_yuv_tex_cnt;
}
WRITE32_MEMBER( powervr2_device::ta_yuv_tex_cnt_w )
{
machine().debugger().debug_break();
machine().debug_break();
COMBINE_DATA(&ta_yuv_tex_cnt);
}