mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
(nw) be strictly POSIX compliant, reduce fragmentation, get rid of an unused member
This commit is contained in:
parent
76a2e99d6b
commit
2012b38e1e
@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#pragma once
|
#ifndef MAME_CPU_DSPP_DSPP_H
|
||||||
|
#define MAME_CPU_DSPP_DSPP_H
|
||||||
|
|
||||||
#ifndef DEVICES_CPU_DSPP_DSPP_H
|
#pragma once
|
||||||
#define DEVICES_CPU_DSPP_DSPP_H
|
|
||||||
|
|
||||||
#include "cpu/drcfe.h"
|
#include "cpu/drcfe.h"
|
||||||
#include "cpu/drcuml.h"
|
#include "cpu/drcuml.h"
|
||||||
@ -392,4 +392,4 @@ public: // TODO
|
|||||||
DECLARE_DEVICE_TYPE(DSPP, dspp_device);
|
DECLARE_DEVICE_TYPE(DSPP, dspp_device);
|
||||||
|
|
||||||
|
|
||||||
#endif // DEVICES_CPU_DSPP_DSPP_H
|
#endif // MAME_CPU_DSPP_DSPP_H
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
DSPP disassembler shim
|
DSPP disassembler shim
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DEVICES_CPU_DSPP_DSPPDASM_H
|
#ifndef MAME_CPU_DSPP_DSPPDASM_H
|
||||||
#define DEVICES_CPU_DSPP_DSPPDASM_H
|
#define MAME_CPU_DSPP_DSPPDASM_H
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
@ -19,4 +19,4 @@ public:
|
|||||||
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override;
|
virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DEVICES_CPU_DSPP_DSPPDASM_H
|
#endif // MAME_CPU_DSPP_DSPPDASM_H
|
||||||
|
@ -72,7 +72,7 @@ private:
|
|||||||
NSVGimage *m_image;
|
NSVGimage *m_image;
|
||||||
NSVGrasterizer *m_rasterizer;
|
NSVGrasterizer *m_rasterizer;
|
||||||
std::vector<bool> m_key_state;
|
std::vector<bool> m_key_state;
|
||||||
std::vector<std::list<NSVGshape *>> m_keyed_shapes;
|
std::vector<std::vector<NSVGshape *>> m_keyed_shapes;
|
||||||
std::unordered_map<std::string, int> m_key_ids;
|
std::unordered_map<std::string, int> m_key_ids;
|
||||||
int m_key_count;
|
int m_key_count;
|
||||||
|
|
||||||
@ -95,29 +95,29 @@ private:
|
|||||||
screen_device::svg_renderer::svg_renderer(memory_region *region)
|
screen_device::svg_renderer::svg_renderer(memory_region *region)
|
||||||
{
|
{
|
||||||
// nanosvg makes assumptions about the global locale
|
// nanosvg makes assumptions about the global locale
|
||||||
char *s = new char[region->bytes()+1];
|
{
|
||||||
memcpy(s, region->base(), region->bytes());
|
const std::unique_ptr<char []> s(new char[region->bytes() + 1]);
|
||||||
s[region->bytes()] = 0;
|
memcpy(s.get(), region->base(), region->bytes());
|
||||||
const char *const lcctype(std::setlocale(LC_CTYPE, nullptr));
|
s[region->bytes()] = 0;
|
||||||
const char *const lcnumeric(std::setlocale(LC_NUMERIC, nullptr));
|
const std::string lcctype(std::setlocale(LC_CTYPE, nullptr));
|
||||||
std::setlocale(LC_CTYPE, "C");
|
const std::string lcnumeric(std::setlocale(LC_NUMERIC, nullptr));
|
||||||
std::setlocale(LC_NUMERIC, "C");
|
std::setlocale(LC_CTYPE, "C");
|
||||||
m_image = nsvgParse(s, "px", 72);
|
std::setlocale(LC_NUMERIC, "C");
|
||||||
std::setlocale(LC_CTYPE, lcctype);
|
m_image = nsvgParse(s.get(), "px", 72);
|
||||||
std::setlocale(LC_NUMERIC, lcnumeric);
|
std::setlocale(LC_CTYPE, lcctype.c_str());
|
||||||
delete[] s;
|
std::setlocale(LC_NUMERIC, lcnumeric.c_str());
|
||||||
|
}
|
||||||
m_rasterizer = nsvgCreateRasterizer();
|
m_rasterizer = nsvgCreateRasterizer();
|
||||||
|
|
||||||
m_key_count = 0;
|
m_key_count = 0;
|
||||||
|
|
||||||
for (NSVGshape *shape = m_image->shapes; shape != nullptr; shape = shape->next)
|
for (NSVGshape *shape = m_image->shapes; shape; shape = shape->next)
|
||||||
if(shape->title[0]) {
|
if(shape->title[0]) {
|
||||||
auto it = m_key_ids.find(shape->title);
|
const auto it = m_key_ids.find(shape->title);
|
||||||
if(it != m_key_ids.end())
|
if(it != m_key_ids.end())
|
||||||
m_keyed_shapes[it->second].push_back(shape);
|
m_keyed_shapes[it->second].push_back(shape);
|
||||||
else {
|
else {
|
||||||
int id = m_key_count;
|
const int id = m_key_count++;
|
||||||
m_key_count++;
|
|
||||||
m_keyed_shapes.resize(m_key_count);
|
m_keyed_shapes.resize(m_key_count);
|
||||||
m_keyed_shapes[id].push_back(shape);
|
m_keyed_shapes[id].push_back(shape);
|
||||||
m_key_ids[shape->title] = id;
|
m_key_ids[shape->title] = id;
|
||||||
|
@ -8,9 +8,8 @@
|
|||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "3dom2.h"
|
#include "3dom2.h"
|
||||||
#include <algorithm> // std::min
|
|
||||||
#include "screen.h"
|
|
||||||
|
|
||||||
|
#include <algorithm> // std::min
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
@ -8,17 +8,19 @@
|
|||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#ifndef MAME_MACHINE_3DOM2_H
|
#ifndef MAME_MACHINE_3DOM2_H
|
||||||
#define MAME_MACHINE_3DOM2_H
|
#define MAME_MACHINE_3DOM2_H
|
||||||
|
|
||||||
#include "emu.h"
|
#pragma once
|
||||||
|
|
||||||
|
#include "video/3dom2_te.h"
|
||||||
|
|
||||||
#include "cpu/dspp/dspp.h"
|
#include "cpu/dspp/dspp.h"
|
||||||
#include "cpu/powerpc/ppc.h"
|
#include "cpu/powerpc/ppc.h"
|
||||||
#include "video/3dom2_te.h"
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
|
|
||||||
#define M2_BAD_TIMING 0 // HACK
|
#define M2_BAD_TIMING 0 // HACK
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -190,7 +190,6 @@ private:
|
|||||||
void load_texture();
|
void load_texture();
|
||||||
|
|
||||||
m2_bda_device *m_bda;
|
m2_bda_device *m_bda;
|
||||||
const address_space_config m_space_config; // TODO: Why is this still here?
|
|
||||||
|
|
||||||
devcb_write_line m_general_int_handler;
|
devcb_write_line m_general_int_handler;
|
||||||
devcb_write_line m_dfinstr_int_handler;
|
devcb_write_line m_dfinstr_int_handler;
|
||||||
|
Loading…
Reference in New Issue
Block a user