Skip to content

Commit

Permalink
cleanup and loose ends:
Browse files Browse the repository at this point in the history
* Added AsmJit to COPYING
* Changed some added code to better match surrounding code style
* Removed completely unused members from mw8080bw.h state class
* Made some code better align with MAME standards
  • Loading branch information
cuavas committed Jun 25, 2020
1 parent fc970b9 commit 8bf71ee
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 33 deletions.
5 changes: 4 additions & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ LZMA SDK code is compatible with open source licenses, for example, you
can include it to GNU GPL or GNU LGPL code.


Nano SVG = Simple stupid SVG parser
AsmJit - a lightweight library for machine code generation.
Copyright (c) 2008-2020 The AsmJit Authors

Nano SVG - Simple stupid SVG parser
Copyright (c) 2013-14 Mikko Mononen memon@inside.org

Simple DirectMedia Layer
Expand Down
3 changes: 2 additions & 1 deletion src/devices/bus/qbus/pc11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
***************************************************************************/

#include "emu.h"
#include "pc11.h"


//#define LOG_GENERAL (1U << 0)
#define LOG_DBG (1U << 2)

//#define VERBOSE (LOG_GENERAL | LOG_DBG)
//#define LOG_OUTPUT_FUNC printf
//#define LOG_OUTPUT_FUNC osd_printf_info

#include "logmacro.h"

Expand Down
8 changes: 3 additions & 5 deletions src/devices/bus/qbus/pc11.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
***************************************************************************/

#pragma once

#ifndef __PC11__
#define __PC11__
#ifndef MAME_BUS_QBUS_PC11_H
#define MAME_BUS_QBUS_PC11_H

#include "emu.h"
#pragma once

#include "qbus.h"

Expand Down
4 changes: 2 additions & 2 deletions src/devices/bus/qbus/qbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void qbus_cards(device_slot_interface &device)
// DEVICE DEFINITIONS
//**************************************************************************

DEFINE_DEVICE_TYPE(QBUS, qbus_device, "qbus", "QBUS bus")
DEFINE_DEVICE_TYPE(QBUS_SLOT, qbus_slot_device, "qbus_slot", "QBUS slot")
DEFINE_DEVICE_TYPE(QBUS, qbus_device, "qbus", "DEC Qbus bus")
DEFINE_DEVICE_TYPE(QBUS_SLOT, qbus_slot_device, "qbus_slot", "DEC Qbus slot")


//**************************************************************************
Expand Down
8 changes: 4 additions & 4 deletions src/emu/debug/textbuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ const char *text_buffer_get_seqnum_line(text_buffer *text, u32 seqnum)
return &text->buffer[text->lineoffs[(text->linestart + index) % text->linesize]];
}

text_buffer_lines text_buffer_get_lines(text_buffer* text)
text_buffer_lines text_buffer_get_lines(text_buffer *text)
{
return text_buffer_lines(*text);
}
Expand All @@ -324,13 +324,13 @@ text_buffer_lines text_buffer_get_lines(text_buffer* text)

text_buffer_line text_buffer_lines::text_buffer_line_iterator::operator*() const
{
const char* line = &m_buffer.buffer[m_buffer.lineoffs[m_lineptr]];
const char *line = &m_buffer.buffer[m_buffer.lineoffs[m_lineptr]];

auto next_lineptr = m_lineptr + 1;
if (next_lineptr == m_buffer.linesize)
next_lineptr = 0;

const char* nextline = &m_buffer.buffer[m_buffer.lineoffs[next_lineptr]];
const char *nextline = &m_buffer.buffer[m_buffer.lineoffs[next_lineptr]];

/* -1 for the '\0' at the end of line */

Expand All @@ -347,7 +347,7 @@ text_buffer_line text_buffer_lines::text_buffer_line_iterator::operator*() const
Moves to the next line.
-----------------------------------------------------------------------*/

text_buffer_lines::text_buffer_line_iterator& text_buffer_lines::text_buffer_line_iterator::operator++()
text_buffer_lines::text_buffer_line_iterator &text_buffer_lines::text_buffer_line_iterator::operator++()
{
if (++m_lineptr == m_buffer.linesize)
m_lineptr = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/emu/debug/textbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ struct text_buffer_line
class text_buffer_lines
{
private:
text_buffer& m_buffer;
text_buffer &m_buffer;

public:
text_buffer_lines(text_buffer& buffer) : m_buffer(buffer) { }

class text_buffer_line_iterator
{
text_buffer& m_buffer;
text_buffer &m_buffer;
s32 m_lineptr;
public:
text_buffer_line_iterator(text_buffer& buffer, s32 lineptr) :
text_buffer_line_iterator(text_buffer &buffer, s32 lineptr) :
m_buffer(buffer),
m_lineptr(lineptr)
{
Expand All @@ -48,15 +48,15 @@ class text_buffer_lines
/* technically this isn't a valid forward iterator, because
* operator * doesn't return a reference
*/
text_buffer_line operator *() const;
text_buffer_line_iterator& operator ++();
text_buffer_line operator*() const;
text_buffer_line_iterator &operator++();

bool operator != (const text_buffer_line_iterator& rhs)
bool operator!=(const text_buffer_line_iterator& rhs)
{
return m_lineptr != rhs.m_lineptr;
}
/* according to C++ spec, only != is needed; == is present for completeness. */
bool operator == (const text_buffer_line_iterator& rhs) { return !(operator !=(rhs)); }
bool operator==(const text_buffer_line_iterator& rhs) { return !operator!=(rhs); }
};

typedef text_buffer_line_iterator iterator;
Expand Down
2 changes: 1 addition & 1 deletion src/mame/drivers/rt1715.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define LOG_BANK (1U << 1)

#define VERBOSE (LOG_GENERAL)
//#define LOG_OUTPUT_FUNC printf
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"

#define LOGBANK(format, ...) LOGMASKED(LOG_BANK, "%11.6f at %s: " format, machine().time().as_double(), machine().describe_context(), __VA_ARGS__)
Expand Down
7 changes: 1 addition & 6 deletions src/mame/includes/mw8080bw.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,19 +379,14 @@ class zzzap_state : public mw8080bw_state
{
public:
zzzap_state(machine_config const &mconfig, device_type type, char const *tag) :
mw8080bw_state(mconfig, type, tag),
m_soundboard(*this, "soundboard")
mw8080bw_state(mconfig, type, tag)
{
}

void zzzap(machine_config &config);

private:
void io_w(offs_t offset, u8 data);

void io_map(address_map &map);

required_device<zzzap_audio_device> m_soundboard;
};


Expand Down
12 changes: 6 additions & 6 deletions src/mame/video/gime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,14 @@ void gime_device::update_memory(int bank)
// are we in onboard ROM or cart ROM?
if (block > 3)
{
if( m_cart_rom)
if (m_cart_rom)
{
// perform the look up
memory = &m_cart_rom[((block & 3) * 0x2000) % m_cart_size];
}
else
{
memory = 0;
memory = 0;
}
}
else
Expand All @@ -596,11 +596,11 @@ void gime_device::update_memory(int bank)
memory += offset;

// set the banks
if( memory )
if (memory)
{
read_bank->set_base(memory);
write_bank->set_base(is_read_only ? m_dummy_bank : memory);
}
read_bank->set_base(memory);
write_bank->set_base(is_read_only ? m_dummy_bank : memory);
}
else
{
read_bank->set_base(m_dummy_bank);
Expand Down

0 comments on commit 8bf71ee

Please sign in to comment.