mirror of
https://github.com/holub/mame
synced 2025-05-29 09:03:08 +03:00
Merge pull request #2129 from shattered/_5e08182
Pick low-hanging fruit from Coverity Scan results, basket 1.
This commit is contained in:
commit
006709e725
@ -1746,9 +1746,9 @@ void hdc92x4_device::seek_read_id()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cont = NEXT;
|
int cont = NEXT;
|
||||||
bool step_enable = (current_command() & 0x04)==1;
|
bool step_enable = BIT(current_command(), 2);
|
||||||
bool wait_seek_comp = (current_command() & 0x02)==1;
|
bool wait_seek_comp = BIT(current_command(), 1);
|
||||||
bool do_verify = (current_command() & 0x01)==1;
|
bool do_verify = BIT(current_command(), 0);
|
||||||
m_logical = true;
|
m_logical = true;
|
||||||
|
|
||||||
while (cont == NEXT)
|
while (cont == NEXT)
|
||||||
|
@ -361,8 +361,8 @@ void roc10957_t::write_char(int data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Display data
|
{ // Display data. Bit 6 is a "don't care" bit except for PNT and TAIL.
|
||||||
data &= 0x3F;
|
data &= 0x7F;
|
||||||
|
|
||||||
switch ( data )
|
switch ( data )
|
||||||
{
|
{
|
||||||
|
@ -173,9 +173,7 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
|
|||||||
int i, j = 0;
|
int i, j = 0;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
int version = data[0x0c];
|
int version, system, video_standard;
|
||||||
int system = data[0x0d];
|
|
||||||
int video_standard = data[0x0e];
|
|
||||||
int tap_frequency = 0;
|
int tap_frequency = 0;
|
||||||
|
|
||||||
int byte_samples = 0;
|
int byte_samples = 0;
|
||||||
@ -186,6 +184,14 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
|
|||||||
in Commodore tapes. Implementation here would follow */
|
in Commodore tapes. Implementation here would follow */
|
||||||
/* int waveamp_high, waveamp_low; */
|
/* int waveamp_high, waveamp_low; */
|
||||||
|
|
||||||
|
/* is the .tap file corrupted? */
|
||||||
|
if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
version = data[0x0c];
|
||||||
|
system = data[0x0d];
|
||||||
|
video_standard = data[0x0e];
|
||||||
|
|
||||||
/* Log .TAP info but only once */
|
/* Log .TAP info but only once */
|
||||||
if (!(buffer == nullptr))
|
if (!(buffer == nullptr))
|
||||||
{
|
{
|
||||||
@ -203,10 +209,6 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is the .tap file corrupted? */
|
|
||||||
if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
|
|
||||||
/* read the frequency from the .tap header */
|
/* read the frequency from the .tap header */
|
||||||
switch (system)
|
switch (system)
|
||||||
|
@ -114,7 +114,7 @@ WRITE8_MEMBER(argo_state::argo_io_w)
|
|||||||
{
|
{
|
||||||
uint8_t *RAM = memregion("videoram")->base();
|
uint8_t *RAM = memregion("videoram")->base();
|
||||||
m_scroll_ctrl = 0;
|
m_scroll_ctrl = 0;
|
||||||
memcpy(RAM, RAM+80, 24*80);
|
memmove(RAM, RAM+80, 24*80);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ DECLARE_WRITE8_MEMBER(dma_memw_cb);
|
|||||||
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||||
uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y);
|
uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y);
|
||||||
void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||||
void tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit);
|
void tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit);
|
||||||
void execute_sync_cmd();
|
void execute_sync_cmd();
|
||||||
void execute_dspon_cmd();
|
void execute_dspon_cmd();
|
||||||
void execute_dspdef_cmd();
|
void execute_dspdef_cmd();
|
||||||
@ -759,7 +759,7 @@ WRITE8_MEMBER(pc88va_state::idp_command_w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit)
|
void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit)
|
||||||
{
|
{
|
||||||
address_space &space = m_maincpu->space(AS_PROGRAM);
|
address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||||
|
|
||||||
|
@ -795,7 +795,7 @@ READ8_MEMBER(peplus_state::peplus_input0_r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_bv_pulse == 1) {
|
if (m_bv_pulse == 1) {
|
||||||
return (0x70 || m_in0->read()); // Add Bill Validator Credit Pulse
|
return (0x70 | m_in0->read()); // Add Bill Validator Credit Pulse
|
||||||
} else {
|
} else {
|
||||||
return m_in0->read();
|
return m_in0->read();
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ WRITE8_MEMBER( unior_state::vram_w )
|
|||||||
WRITE8_MEMBER( unior_state::scroll_w )
|
WRITE8_MEMBER( unior_state::scroll_w )
|
||||||
{
|
{
|
||||||
if (data)
|
if (data)
|
||||||
memcpy(m_p_vram, m_p_vram+80, 24*80);
|
memmove(m_p_vram, m_p_vram+80, 24*80);
|
||||||
}
|
}
|
||||||
|
|
||||||
I8275_DRAW_CHARACTER_MEMBER(unior_state::display_pixels)
|
I8275_DRAW_CHARACTER_MEMBER(unior_state::display_pixels)
|
||||||
|
@ -1009,7 +1009,7 @@ void x07_state::kb_irq()
|
|||||||
{
|
{
|
||||||
m_regs_r[0] = 0;
|
m_regs_r[0] = 0;
|
||||||
m_regs_r[1] = m_t6834_ram[0x400];
|
m_regs_r[1] = m_t6834_ram[0x400];
|
||||||
memcpy(m_t6834_ram + 0x400, m_t6834_ram + 0x401, 0xff);
|
memmove(m_t6834_ram + 0x400, m_t6834_ram + 0x401, 0xff);
|
||||||
m_kb_size--;
|
m_kb_size--;
|
||||||
m_regs_r[2] |= 0x01;
|
m_regs_r[2] |= 0x01;
|
||||||
m_maincpu->set_input_line(NSC800_RSTA, ASSERT_LINE);
|
m_maincpu->set_input_line(NSC800_RSTA, ASSERT_LINE);
|
||||||
|
Loading…
Reference in New Issue
Block a user