Merge remote-tracking branch 'mainline/master'

This commit is contained in:
therealmogminer@gmail.com 2016-06-19 18:21:06 +02:00
commit e91517e11e
83 changed files with 3246 additions and 1530 deletions

View File

@ -804,6 +804,18 @@ if (VIDEOS["V9938"]~=null) then
}
end
--------------------------------------------------
--
--@src/devices/video/zeus2.h,VIDEOS["ZEUS2"] = true
--------------------------------------------------
if (VIDEOS["ZEUS2"]~=null) then
files {
MAME_DIR .. "src/devices/video/zeus2.cpp",
MAME_DIR .. "src/devices/video/zeus2.h",
}
end
--------------------------------------------------
--
--@src/devices/video/voodoo.h,VIDEOS["VOODOO"] = true

View File

@ -332,6 +332,7 @@ VIDEOS["V9938"] = true
--VIDEOS["VIC4567"] = true
VIDEOS["VOODOO"] = true
VIDEOS["VOODOO_PCI"] = true
VIDEOS["ZEUS2"] = true
--------------------------------------------------
-- specify available machine cores

View File

@ -380,7 +380,11 @@ void adsp21xx_device::write_reg1(int regnum, INT32 val)
break;
case 3:
logerror("ADSP %04x: Writing to an invalid register!\n", m_ppc);
// Check for DMOVLAY instruction callback
if (regnum == 0xf && !m_dmovlay_cb.isnull())
m_dmovlay_cb(val & 0x3fff);
else
logerror("ADSP %04x: Writing to an invalid register! RGP=01 RegCode=%1X Val=%04X\n", m_ppc, regnum, val);
break;
}
}
@ -505,7 +509,7 @@ INT32 adsp21xx_device::read_reg3(int regnum)
case 0x08: if (!m_sport_rx_cb.isnull()) return m_sport_rx_cb(0); else return 0;
case 0x0a: if (!m_sport_rx_cb.isnull()) return m_sport_rx_cb(1); else return 0;
case 0x0f: return pc_stack_pop_val();
default: logerror("ADSP %04x: Reading from an invalid register!\n", m_ppc); return 0;
default: logerror("ADSP %04x: Reading from an invalid register! RGP=b11 RegCode=%1X\n", m_ppc, regnum); return 0;
}
}

View File

@ -157,7 +157,8 @@ adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type
(m_chip_type >= CHIP_TYPE_ADSP2101) ? 0x3f : 0x0f),
m_sport_rx_cb(*this),
m_sport_tx_cb(*this),
m_timer_fired_cb(*this)
m_timer_fired_cb(*this),
m_dmovlay_cb(*this)
{
// initialize remaining state
memset(&m_core, 0, sizeof(m_core));
@ -405,6 +406,7 @@ void adsp21xx_device::device_start()
m_sport_rx_cb.resolve();
m_sport_tx_cb.resolve();
m_timer_fired_cb.resolve();
m_dmovlay_cb.resolve();
// get our address spaces
m_program = &space(AS_PROGRAM);

View File

@ -192,6 +192,9 @@ enum
#define MCFG_ADSP21XX_TIMER_FIRED_CB(_devcb) \
devcb = &adsp21xx_device::set_timer_fired_callback(*device, DEVCB_##_devcb);
#define MCFG_ADSP21XX_DMOVLAY_CB(_devcb) \
devcb = &adsp21xx_device::set_dmovlay_callback(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@ -220,6 +223,7 @@ public:
template<class _Object> static devcb_base &set_sport_rx_callback(device_t &device, _Object object) { return downcast<adsp21xx_device &>(device).m_sport_rx_cb.set_callback(object); }
template<class _Object> static devcb_base &set_sport_tx_callback(device_t &device, _Object object) { return downcast<adsp21xx_device &>(device).m_sport_tx_cb.set_callback(object); }
template<class _Object> static devcb_base &set_timer_fired_callback(device_t &device, _Object object) { return downcast<adsp21xx_device &>(device).m_timer_fired_cb.set_callback(object); }
template<class _Object> static devcb_base &set_dmovlay_callback(device_t &device, _Object object) { return downcast<adsp21xx_device &>(device).m_dmovlay_cb.set_callback(object); }
// public interfaces
void load_boot_data(UINT8 *srcdata, UINT32 *dstdata);
@ -459,6 +463,7 @@ protected:
devcb_read32 m_sport_rx_cb; // callback for serial receive
devcb_write32 m_sport_tx_cb; // callback for serial transmit
devcb_write_line m_timer_fired_cb; // callback for timer fired
devcb_write_line m_dmovlay_cb; // callback for DMOVLAY instruction
// debugging
#if ADSP_TRACK_HOTSPOTS

View File

@ -267,7 +267,7 @@ offs_t sparc_dasm(char *buffer, offs_t pc, UINT32 op)
if (RS1 == RD)
print(buffer, "btog %d,%s", SIMM13, regnames[RD]);
else
print(buffer, "xor %s,%d,%s", regnames[RS1], SIMM13, regnames[RD]); break;
print(buffer, "xor %s,%d,%s", regnames[RS1], SIMM13, regnames[RD]);
break;
case 4:
if (RS1 == RD)
@ -443,7 +443,7 @@ offs_t sparc_dasm(char *buffer, offs_t pc, UINT32 op)
if (RS1 == RD)
print(buffer, "btog %s,%s", regnames[RS2], regnames[RD]);
else
print(buffer, "xor %s,%s,%s", regnames[RS1], regnames[RS2], regnames[RD]); break;
print(buffer, "xor %s,%s,%s", regnames[RS1], regnames[RS2], regnames[RD]);
break;
case 4: print(buffer, "sub %s,%s,%s", regnames[RS1], regnames[RS2], regnames[RD]); break;
case 5:

View File

@ -357,59 +357,60 @@ void cassette_image_device::call_unload()
}
//-------------------------------------------------
// display a small tape animation, with the
// current position in the tape image
//-------------------------------------------------
#define ANIMATION_FPS 1
#define ANIMATION_FRAMES 4
/*
display a small tape icon, with the current position in the tape image
*/
int cassette_image_device::call_display(std::string& s)
std::string cassette_image_device::call_display()
{
/* abort if we should not be showing the image */
if (!exists())
return -1;
if (!is_motor_on())
return -1;
const int ANIMATION_FPS = 1;
char buf[65];
int n;
double position, length;
cassette_state uistate;
static const UINT8 shapes[8] = { 0x2d, 0x5c, 0x7c, 0x2f, 0x2d, 0x20, 0x20, 0x20 };
std::string result;
/* figure out where we are in the cassette */
position = get_position();
length = get_length();
uistate = (cassette_state)(get_state() & CASSETTE_MASK_UISTATE);
/* choose which frame of the animation we are at */
n = ((int)position / ANIMATION_FPS) % ANIMATION_FRAMES;
/* Since you can have anything in a BDF file, we will use crude ascii characters instead */
snprintf(buf, ARRAY_LENGTH(buf), "%c%c %c %02d:%02d (%04d) [%02d:%02d (%04d)]",
shapes[n], /* cassette icon left */
shapes[n | 4], /* cassette icon right */
(uistate == CASSETTE_PLAY) ? 0x50 : 0x52, /* play (P) or record (R) */
((int)position / 60),
((int)position % 60),
(int)position,
((int)length / 60),
((int)length % 60),
(int)length);
s = buf;
// make sure tape stops at end when playing
if ((m_state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
// only show the image when a cassette is loaded and the motor is on
if (exists() && is_motor_on())
{
if ( m_cassette )
int n;
double position, length;
cassette_state uistate;
static const char *shapes[] = { u8"\u2500", u8"\u2572", u8"\u2502", u8"\u2571" };
// figure out where we are in the cassette
position = get_position();
length = get_length();
uistate = (cassette_state)(get_state() & CASSETTE_MASK_UISTATE);
// choose which frame of the animation we are at
n = ((int)position / ANIMATION_FPS) % ARRAY_LENGTH(shapes);
// play or record
const char *status_icon = (uistate == CASSETTE_PLAY)
? u8"\u25BA"
: u8"\u25CF";
// Since you can have anything in a BDF file, we will use crude ascii characters instead
result = string_format("%s %s %02d:%02d (%04d) [%02d:%02d (%04d)]",
shapes[n], // animation
status_icon, // play or record
((int)position / 60),
((int)position % 60),
(int)position,
((int)length / 60),
((int)length % 60),
(int)length);
// make sure tape stops at end when playing
if ((m_state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
{
if (get_position() > get_length())
if (m_cassette)
{
m_state = (cassette_state)(( m_state & ~CASSETTE_MASK_UISTATE ) | CASSETTE_STOPPED);
if (get_position() > get_length())
{
m_state = (cassette_state)((m_state & ~CASSETTE_MASK_UISTATE) | CASSETTE_STOPPED);
}
}
}
}
return cassette_device_iterator(machine().root_device()).indexof(*this);
return result;
}

View File

@ -58,7 +58,7 @@ public:
virtual bool call_load() override;
virtual bool call_create(int format_type, option_resolution *format_options) override;
virtual void call_unload() override;
virtual int call_display(std::string& s) override;
virtual std::string call_display() override;
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); }
virtual iodevice_t image_type() const override { return IO_CASSETTE; }

View File

@ -61,7 +61,7 @@ void cdrom_image_device::device_config_complete()
{
m_extension_list = "chd,cue,toc,nrg,gdi,iso,cdr";
m_formatlist.append(*global_alloc(image_device_format("chdcd", "CD-ROM drive", m_extension_list, cd_option_spec)));
m_formatlist.push_back(std::make_unique<image_device_format>("chdcd", "CD-ROM drive", m_extension_list, cd_option_spec));
// set brief and instance name
update_names();

View File

@ -56,7 +56,7 @@ diablo_image_device::~diablo_image_device()
void diablo_image_device::device_config_complete()
{
m_formatlist.append(*global_alloc(image_device_format("chd", "CHD Hard drive", "chd,dsk", dsk_option_spec)));
m_formatlist.push_back(std::make_unique<image_device_format>("chd", "CHD Hard drive", "chd,dsk", dsk_option_spec));
// set brief and instance name
update_names();

View File

@ -821,7 +821,7 @@ void legacy_floppy_image_device::device_config_complete()
// only add if creatable
if (floppy_options[i].param_guidelines) {
// allocate a new format and append it to the list
m_formatlist.append(*global_alloc(image_device_format(floppy_options[i].name, floppy_options[i].description, floppy_options[i].extensions, floppy_options[i].param_guidelines)));
m_formatlist.push_back(std::make_unique<image_device_format>(floppy_options[i].name, floppy_options[i].description, floppy_options[i].extensions, floppy_options[i].param_guidelines));
}
image_specify_extension( m_extension_list, 256, floppy_options[i].extensions );
}

View File

@ -242,7 +242,7 @@ void floppy_image_device::set_formats(const floppy_format_type *formats)
else
fif_list->append(fif);
m_formatlist.append(*global_alloc(image_device_format(fif->name(), fif->description(), fif->extensions(), "")));
m_formatlist.push_back(std::make_unique<image_device_format>(fif->name(), fif->description(), fif->extensions(), ""));
image_specify_extension( extension_list, 256, fif->extensions() );
}

View File

@ -79,7 +79,7 @@ harddisk_image_device::~harddisk_image_device()
void harddisk_image_device::device_config_complete()
{
m_formatlist.append(*global_alloc(image_device_format("chd", "CHD Hard drive", "chd,hd", hd_option_spec)));
m_formatlist.push_back(std::make_unique<image_device_format>("chd", "CHD Hard drive", "chd,hd", hd_option_spec));
// set brief and instance name
update_names();

View File

@ -1686,17 +1686,16 @@ void hp_taco_device::call_unload()
set_tape_present(false);
}
int hp_taco_device::call_display(std::string& s)
std::string hp_taco_device::call_display()
{
std::string buffer;
// Mostly lifted from cassette_image_device::call_display ;)
// Do not show anything if image not loaded or tape not moving
if (!exists() || m_start_time.is_never()) {
return -1;
return buffer;
}
char buffer[ 64 ];
char track = BIT(m_status_reg , STATUS_TRACKB_BIT) ? 'B' : 'A';
char r_w = m_tape_wr ? 'W' : 'R';
char m1;
@ -1712,12 +1711,10 @@ int hp_taco_device::call_display(std::string& s)
int pos_in = current_tape_pos() / ONE_INCH_POS;
snprintf(buffer , sizeof(buffer) , "%c %c %c%c [%04d/1824]" , track , r_w , m1 , m2 , pos_in);
s = buffer;
buffer = string_format("%c %c %c%c [%04d/1824]" , track , r_w , m1 , m2 , pos_in);
// Not correct when there are 2 or more instances of TACO
return 0;
return buffer;
}
const char *hp_taco_device::file_extensions() const

View File

@ -47,7 +47,7 @@ public:
virtual bool call_load() override;
virtual bool call_create(int format_type, option_resolution *format_options) override;
virtual void call_unload() override;
virtual int call_display(std::string& s) override;
virtual std::string call_display() override;
virtual iodevice_t image_type() const override { return IO_MAGTAPE; }
virtual bool is_readable() const override { return true; }
virtual bool is_writeable() const override { return true; }

View File

@ -603,10 +603,8 @@ void ay8910_device::ay8910_write_reg(int r, int v)
/* No action required */
break;
case AY_ECOARSE:
#ifdef MAME_DEBUG
if ( (v & 0x0f) > 0)
popmessage("ECoarse");
#endif
osd_printf_verbose("ECoarse\n");
/* No action required */
break;
case AY_ENABLE:
@ -628,10 +626,8 @@ void ay8910_device::ay8910_write_reg(int r, int v)
m_last_enable = m_regs[AY_ENABLE];
break;
case AY_ESHAPE:
#ifdef MAME_DEBUG
if ( (v & 0x0f) > 0)
popmessage("EShape");
#endif
osd_printf_verbose("EShape\n");
m_attack = (m_regs[AY_ESHAPE] & 0x04) ? m_env_step_mask : 0x00;
if ((m_regs[AY_ESHAPE] & 0x08) == 0)
{

1311
src/devices/video/zeus2.cpp Normal file

File diff suppressed because it is too large Load Diff

286
src/devices/video/zeus2.h Normal file
View File

@ -0,0 +1,286 @@
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/*************************************************************************
Midway Zeus2 Video
**************************************************************************/
#ifndef __ZEUS2_H__
#define __ZEUS2_H__
#include "emu.h"
#include "video/poly.h"
#include "video/rgbutil.h"
#include "cpu/tms32031/tms32031.h"
#pragma once
/*************************************
* Constants
*************************************/
#define ZEUS2_VIDEO_CLOCK XTAL_66_6667MHz
#define DUMP_WAVE_RAM 0
#define TRACK_REG_USAGE 0
#define WAVERAM0_WIDTH 1024
#define WAVERAM0_HEIGHT 2048
#define WAVERAM1_WIDTH 512
#define WAVERAM1_HEIGHT 1024
/*************************************
* Type definitions
*************************************/
struct zeus2_poly_extra_data
{
const void * palbase;
const void * texbase;
UINT16 solidcolor;
INT16 zoffset;
UINT16 transcolor;
UINT16 texwidth;
UINT16 color;
UINT32 alpha;
};
/*************************************
* Macros
*************************************/
#define WAVERAM_BLOCK0(blocknum) ((void *)((UINT8 *)waveram[0] + 8 * (blocknum)))
#define WAVERAM_BLOCK1(blocknum) ((void *)((UINT8 *)waveram[1] + 12 * (blocknum)))
#define WAVERAM_BLOCK0_EXT(blocknum) ((void *)((UINT8 *)m_state->waveram[0] + 8 * (blocknum)))
#define WAVERAM_BLOCK1_EXT(blocknum) ((void *)((UINT8 *)m_state->waveram[1] + 12 * (blocknum)))
#define WAVERAM_PTR8(base, bytenum) ((UINT8 *)(base) + BYTE4_XOR_LE(bytenum))
#define WAVERAM_READ8(base, bytenum) (*WAVERAM_PTR8(base, bytenum))
#define WAVERAM_WRITE8(base, bytenum, data) do { *WAVERAM_PTR8(base, bytenum) = (data); } while (0)
#define WAVERAM_PTR16(base, wordnum) ((UINT16 *)(base) + BYTE_XOR_LE(wordnum))
#define WAVERAM_READ16(base, wordnum) (*WAVERAM_PTR16(base, wordnum))
#define WAVERAM_WRITE16(base, wordnum, data) do { *WAVERAM_PTR16(base, wordnum) = (data); } while (0)
#define WAVERAM_PTR32(base, dwordnum) ((UINT32 *)(base) + (dwordnum))
#define WAVERAM_READ32(base, dwordnum) (*WAVERAM_PTR32(base, dwordnum))
#define WAVERAM_WRITE32(base, dwordnum, data) do { *WAVERAM_PTR32(base, dwordnum) = (data); } while (0)
#define PIXYX_TO_DWORDNUM(y, x) (((((y) & 0x1ff) << 8) | (((x) & 0x1fe) >> 1)) * 3 + ((x) & 1))
#define DEPTHYX_TO_DWORDNUM(y, x) (PIXYX_TO_DWORDNUM(y, (x) & ~1) + 2)
#define WAVERAM_PTRPIX(base, y, x) WAVERAM_PTR32(base, PIXYX_TO_DWORDNUM(y, x))
#define WAVERAM_READPIX(base, y, x) (*WAVERAM_PTRPIX(base, y, x))
#define WAVERAM_WRITEPIX(base, y, x, color) do { *WAVERAM_PTRPIX(base, y, x) = (color); } while (0)
#define WAVERAM_PTRDEPTH(base, y, x) WAVERAM_PTR16(base, DEPTHYX_TO_DWORDNUM(y, x) * 2 + (x & 1))
#define WAVERAM_READDEPTH(base, y, x) (*WAVERAM_PTRDEPTH(base, y, x))
#define WAVERAM_WRITEDEPTH(base, y, x, color) do { *WAVERAM_PTRDEPTH(base, y, x) = (color); } while (0)
/*************************************
* Polygon renderer
*************************************/
class zeus2_device;
class zeus2_renderer : public poly_manager<float, zeus2_poly_extra_data, 4, 10000>
{
public:
zeus2_renderer(zeus2_device *state);
void render_poly_8bit(INT32 scanline, const extent_t& extent, const zeus2_poly_extra_data& object, int threadid);
void zeus2_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit);
private:
zeus2_device* m_state;
};
typedef zeus2_renderer::vertex_t z2_poly_vertex;
typedef zeus2_renderer::extent_t z2_poly_extent;
/*************************************
* Zeus2 Video Device
*************************************/
#define MCFG_ZEUS2_VBLANK_CB(_devcb) \
devcb = &zeus2_device::set_vblank_callback(*device, DEVCB_##_devcb);
#define MCFG_ZEUS2_IRQ_CB(_devcb) \
devcb = &zeus2_device::set_irq_callback(*device, DEVCB_##_devcb);
class zeus2_device : public device_t
{
public:
zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
screen_device *m_screen; /* the screen we are acting on */
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ32_MEMBER( zeus2_r );
DECLARE_WRITE32_MEMBER( zeus2_w );
TIMER_CALLBACK_MEMBER(display_irq_off);
TIMER_CALLBACK_MEMBER(display_irq);
template<class _Object> static devcb_base &set_vblank_callback(device_t &device, _Object object) { return downcast<zeus2_device &>(device).m_vblank.set_callback(object); }
template<class _Object> static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast<zeus2_device &>(device).m_irq.set_callback(object); }
devcb_write_line m_vblank;
devcb_write_line m_irq;
UINT32 m_zeusbase[0x80];
zeus2_renderer* poly;
void *zeus_renderbase;
rectangle zeus_cliprect;
float zeus_matrix[3][3];
float zeus_point[3];
float zeus_point2[3];
UINT32 zeus_texbase;
UINT32 zeus_unknown_40;
int zeus_quad_size;
UINT32 *waveram[2];
emu_timer *int_timer;
emu_timer *vblank_timer;
int m_yScale;
int yoffs;
int texel_width;
float zbase;
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_stop() override;
private:
TIMER_CALLBACK_MEMBER(int_timer_callback);
void zeus2_register32_w(offs_t offset, UINT32 data, int logit);
void zeus2_register_update(offs_t offset, UINT32 oldval, int logit);
int zeus2_fifo_process(const UINT32 *data, int numwords);
void zeus2_pointer_write(UINT8 which, UINT32 value);
void zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit);
void log_fifo_command(const UINT32 *data, int numwords, const char *suffix);
/*************************************
* Member variables
*************************************/
UINT8 log_fifo;
UINT32 zeus_fifo[20];
UINT8 zeus_fifo_words;
UINT32 m_fill_color;
UINT16 m_fill_depth;
#if TRACK_REG_USAGE
struct reg_info
{
struct reg_info *next;
UINT32 value;
};
reg_info *regdata[0x80];
int regdata_count[0x80];
int regread_count[0x80];
int regwrite_count[0x80];
reg_info *subregdata[0x100];
int subregdata_count[0x80];
int subregwrite_count[0x100];
#endif
public:
/*************************************
* Inlines for block addressing
*************************************/
inline void *waveram0_ptr_from_expanded_addr(UINT32 addr)
{
UINT32 blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 16) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH;
return WAVERAM_BLOCK0(blocknum);
}
inline void *waveram1_ptr_from_expanded_addr(UINT32 addr)
{
UINT32 blocknum = (addr % WAVERAM1_WIDTH) + ((addr >> 16) % WAVERAM1_HEIGHT) * WAVERAM1_WIDTH;
return WAVERAM_BLOCK1(blocknum);
}
#ifdef UNUSED_FUNCTION
inline void *waveram0_ptr_from_texture_addr(UINT32 addr, int width)
{
UINT32 blocknum = ((addr & ~1) * width) / 8;
return WAVERAM_BLOCK0(blocknum);
}
#endif
/*************************************
* Inlines for rendering
*************************************/
#ifdef UNUSED_FUNCTION
inline void WAVERAM_plot(int y, int x, UINT32 color)
{
if (zeus_cliprect.contains(x, y))
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
}
#endif
inline void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth)
{
if (zeus_cliprect.contains(x, y))
{
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
WAVERAM_WRITEDEPTH(zeus_renderbase, y, x, depth);
}
}
#ifdef UNUSED_FUNCTION
inline void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth)
{
if (zeus_cliprect.contains(x, y))
{
UINT16 *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x);
if (depth <= *depthptr)
{
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
*depthptr = depth;
}
}
}
#endif
#ifdef UNUSED_FUNCTION
inline void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 depth)
{
if (zeus_cliprect.contains(x, y))
{
UINT16 *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x);
if (depth <= *depthptr)
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
}
}
#endif
/*************************************
* Inlines for texel accesses
*************************************/
inline UINT8 get_texel_8bit(const void *base, int y, int x, int width)
{
UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3);
return WAVERAM_READ8(base, byteoffs);
}
#ifdef UNUSED_FUNCTION
inline UINT8 get_texel_4bit(const void *base, int y, int x, int width)
{
UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3);
return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f;
}
#endif
};
// device type definition
extern const device_type ZEUS2;
#endif

View File

@ -2332,7 +2332,9 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[])
return;
if (!validate_cpu_space_parameter((params > 4) ? param[4] : nullptr, AS_PROGRAM, space))
return;
if (!validate_cpu_space_parameter((params > 4) ? param[4] : nullptr, AS_DECRYPTED_OPCODES, decrypted_space))
if (space->device().memory().has_space(AS_DECRYPTED_OPCODES))
decrypted_space = &space->device().memory().space(AS_DECRYPTED_OPCODES);
else
decrypted_space = space;
/* determine the width of the bytes */
@ -2520,7 +2522,9 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
address_space *space, *decrypted_space;
if (!validate_cpu_space_parameter((params > 0) ? param[0] : nullptr, AS_PROGRAM, space))
return;
if (!validate_cpu_space_parameter((params > 0) ? param[0] : nullptr, AS_DECRYPTED_OPCODES, decrypted_space))
if (space->device().memory().has_space(AS_DECRYPTED_OPCODES))
decrypted_space = &space->device().memory().space(AS_DECRYPTED_OPCODES);
else
decrypted_space = space;
UINT64 count = device_debug::HISTORY_SIZE;

View File

@ -197,9 +197,9 @@ image_error_t device_image_interface::set_image_filename(const char *filename)
const image_device_format *device_image_interface::device_get_named_creatable_format(const char *format_name)
{
for (const image_device_format &format : m_formatlist)
if (strcmp(format.name(), format_name) == 0)
return &format;
for (auto &format : m_formatlist)
if (strcmp(format->name(), format_name) == 0)
return format.get();
return nullptr;
}
@ -1096,7 +1096,16 @@ bool device_image_interface::finish_load()
bool device_image_interface::create(const char *path, const image_device_format *create_format, option_resolution *create_args)
{
int format_index = (create_format != nullptr) ? m_formatlist.indexof(*create_format) : 0;
int format_index = 0;
int cnt = 0;
for (auto &format : m_formatlist)
{
if (create_format == format.get()) {
format_index = cnt;
break;
}
cnt++;
}
return load_internal(path, TRUE, format_index, create_args, FALSE);
}

View File

@ -71,24 +71,19 @@ struct image_device_type_info
class image_device_format
{
friend class simple_list<image_device_format>;
public:
image_device_format(const char *name, const char *description, const char *extensions, const char *optspec)
: m_next(nullptr),
m_name(name),
: m_name(name),
m_description(description),
m_extensions(extensions),
m_optspec(optspec) { }
image_device_format *next() const { return m_next; }
const char *name() const { return m_name.c_str(); }
const char *description() const { return m_description.c_str(); }
const char *extensions() const { return m_extensions.c_str(); }
const char *optspec() const { return m_optspec.c_str(); }
private:
image_device_format *m_next;
std::string m_name;
std::string m_description;
std::string m_extensions;
@ -152,7 +147,7 @@ public:
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return FALSE; }
virtual bool call_create(int format_type, option_resolution *format_options) { return FALSE; }
virtual void call_unload() { }
virtual int call_display(std::string& s) { return -1; }
virtual std::string call_display() { return std::string(); }
virtual device_image_partialhash_func get_partial_hash() const { return nullptr; }
virtual bool core_opens_image_file() const { return TRUE; }
virtual iodevice_t image_type() const = 0;
@ -165,7 +160,7 @@ public:
virtual const char *file_extensions() const = 0;
virtual const option_guide *create_option_guide() const = 0;
const image_device_format *device_get_indexed_creatable_format(int index) const { return m_formatlist.find(index); }
const image_device_format *device_get_indexed_creatable_format(int index) const { if (index < m_formatlist.size()) return m_formatlist.at(index).get(); else return nullptr; }
const image_device_format *device_get_named_creatable_format(const char *format_name);
const option_guide *device_get_creation_option_guide() const { return create_option_guide(); }
@ -226,7 +221,7 @@ public:
const char *instance_name() const { return m_instance_name.c_str(); }
const char *brief_instance_name() const { return m_brief_instance_name.c_str(); }
bool uses_file_extension(const char *file_extension) const;
const simple_list<image_device_format> &formatlist() const { return m_formatlist; }
const std::vector<std::unique_ptr<image_device_format>> &formatlist() const { return m_formatlist; }
bool load(const char *path);
bool open_image_file(emu_options &options);
@ -320,7 +315,7 @@ protected:
std::string m_instance_name;
/* creation info */
simple_list<image_device_format> m_formatlist;
std::vector<std::unique_ptr<image_device_format>> m_formatlist;
/* in the case of arcade cabinet with fixed carts inserted,
we want to disable command line cart loading... */

View File

@ -91,9 +91,9 @@ int device_sound_interface::inputs() const
{
// scan the list counting streams we own and summing their inputs
int inputs = 0;
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &m_device)
inputs += stream.input_count();
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &m_device)
inputs += stream->input_count();
return inputs;
}
@ -107,9 +107,9 @@ int device_sound_interface::outputs() const
{
// scan the list counting streams we own and summing their outputs
int outputs = 0;
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &m_device)
outputs += stream.output_count();
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &m_device)
outputs += stream->output_count();
return outputs;
}
@ -125,15 +125,15 @@ sound_stream *device_sound_interface::input_to_stream_input(int inputnum, int &s
assert(inputnum >= 0);
// scan the list looking for streams owned by this device
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &m_device)
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &m_device)
{
if (inputnum < stream.input_count())
if (inputnum < stream->input_count())
{
stream_inputnum = inputnum;
return &stream;
return stream.get();
}
inputnum -= stream.input_count();
inputnum -= stream->input_count();
}
// not found
@ -152,15 +152,15 @@ sound_stream *device_sound_interface::output_to_stream_output(int outputnum, int
assert(outputnum >= 0);
// scan the list looking for streams owned by this device
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &device())
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &device())
{
if (outputnum < stream.output_count())
if (outputnum < stream->output_count())
{
stream_outputnum = outputnum;
return &stream;
return stream.get();
}
outputnum -= stream.output_count();
outputnum -= stream->output_count();
}
// not found
@ -192,10 +192,10 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
// handle ALL_OUTPUTS as a special case
if (outputnum == ALL_OUTPUTS)
{
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &device())
for (int num = 0; num < stream.output_count(); num++)
stream.set_output_gain(num, gain);
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &device())
for (int num = 0; num < stream->output_count(); num++)
stream->set_output_gain(num, gain);
}
// look up the stream and stream output index
@ -217,10 +217,10 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
int device_sound_interface::inputnum_from_device(device_t &source_device, int outputnum) const
{
int overall = 0;
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &device())
for (int inputnum = 0; inputnum < stream.input_count(); inputnum++, overall++)
if (stream.input_source_device(inputnum) == &source_device && stream.input_source_outputnum(inputnum) == outputnum)
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &device())
for (int inputnum = 0; inputnum < stream->input_count(); inputnum++, overall++)
if (stream->input_source_device(inputnum) == &source_device && stream->input_source_outputnum(inputnum) == outputnum)
return overall;
return -1;
}
@ -342,9 +342,9 @@ void device_sound_interface::interface_post_start()
void device_sound_interface::interface_pre_reset()
{
// update all streams on this device prior to reset
for (sound_stream &stream : m_device.machine().sound().streams())
if (&stream.device() == &device())
stream.update();
for (auto &stream : m_device.machine().sound().streams())
if (&stream->device() == &device())
stream->update();
}

View File

@ -466,7 +466,7 @@ void palette_device::device_start()
for (int color = 0; color < m_indirect_entries; color++)
{
// alpha = 0 ensures change is detected the first time set_indirect_color() is called
m_indirect_colors[color] = rgb_t(0, 0, 0, 0);
m_indirect_colors[color] = rgb_t::transparent;
}
m_indirect_pens.resize(m_entries);

View File

@ -772,6 +772,11 @@ render_container::item &render_container::add_generic(UINT8 type, float x0, floa
{
item *newitem = m_item_allocator.alloc();
assert(x0 == x0);
assert(x1 == x1);
assert(y0 == y0);
assert(y1 == y1);
// copy the data into the new item
newitem->m_type = type;
newitem->m_bounds.x0 = x0;

View File

@ -1097,8 +1097,8 @@ void screen_device::realloc_screen_bitmaps()
INT32 effheight = MAX(m_height, m_visarea.max_y + 1);
// reize all registered screen bitmaps
for (auto_bitmap_item &item : m_auto_bitmap_list)
item.m_bitmap.resize(effwidth, effheight);
for (auto &item : m_auto_bitmap_list)
item->m_bitmap.resize(effwidth, effheight);
// re-set up textures
if (m_palette != nullptr)
@ -1449,12 +1449,12 @@ void screen_device::register_vblank_callback(vblank_state_delegate vblank_callba
assert(!vblank_callback.isnull());
// do nothing if we already have this callback registered
for (callback_item &item : m_callback_list)
if (item.m_callback == vblank_callback)
for (auto &item : m_callback_list)
if (item->m_callback == vblank_callback)
return;
// if not found, register
m_callback_list.append(*global_alloc(callback_item(vblank_callback)));
m_callback_list.push_back(std::make_unique<callback_item>(vblank_callback));
}
@ -1466,7 +1466,7 @@ void screen_device::register_vblank_callback(vblank_state_delegate vblank_callba
void screen_device::register_screen_bitmap(bitmap_t &bitmap)
{
// append to the list
m_auto_bitmap_list.append(*global_alloc(auto_bitmap_item(bitmap)));
m_auto_bitmap_list.push_back(std::make_unique<auto_bitmap_item>(bitmap));
// if allocating now, just do it
bitmap.allocate(width(), height());
@ -1491,8 +1491,8 @@ void screen_device::vblank_begin()
machine().video().frame_update();
// call the screen specific callbacks
for (callback_item &item : m_callback_list)
item.m_callback(*this, true);
for (auto &item : m_callback_list)
item->m_callback(*this, true);
if (!m_screen_vblank.isnull())
m_screen_vblank(*this, true);
@ -1515,8 +1515,8 @@ void screen_device::vblank_begin()
void screen_device::vblank_end()
{
// call the screen specific callbacks
for (callback_item &item : m_callback_list)
item.m_callback(*this, false);
for (auto &item : m_callback_list)
item->m_callback(*this, false);
if (!m_screen_vblank.isnull())
m_screen_vblank(*this, false);

View File

@ -345,28 +345,21 @@ private:
{
public:
callback_item(vblank_state_delegate callback)
: m_next(nullptr),
m_callback(std::move(callback)) { }
callback_item *next() const { return m_next; }
: m_callback(std::move(callback)) { }
callback_item * m_next;
vblank_state_delegate m_callback;
};
simple_list<callback_item> m_callback_list; // list of VBLANK callbacks
std::vector<std::unique_ptr<callback_item>> m_callback_list; // list of VBLANK callbacks
// auto-sizing bitmaps
class auto_bitmap_item
{
public:
auto_bitmap_item(bitmap_t &bitmap)
: m_next(nullptr),
m_bitmap(bitmap) { }
auto_bitmap_item *next() const { return m_next; }
auto_bitmap_item * m_next;
: m_bitmap(bitmap) { }
bitmap_t & m_bitmap;
};
simple_list<auto_bitmap_item> m_auto_bitmap_list; // list of registered bitmaps
std::vector<std::unique_ptr<auto_bitmap_item>> m_auto_bitmap_list; // list of registered bitmaps
// static data
static UINT32 m_id_counter; // incremented for each constructed screen_device,

View File

@ -75,7 +75,7 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
m_callback = stream_update_delegate(FUNC(device_sound_interface::sound_stream_update),(device_sound_interface *)sound);
// create a unique tag for saving
std::string state_tag = string_format("%d", m_device.machine().sound().m_stream_list.count());
std::string state_tag = string_format("%d", m_device.machine().sound().m_stream_list.size());
m_device.machine().save().save_item(&m_device, "stream", state_tag.c_str(), 0, NAME(m_sample_rate));
m_device.machine().save().register_postload(save_prepost_delegate(FUNC(sound_stream::postload), this));
@ -894,7 +894,8 @@ void sound_manager::stop_recording()
sound_stream *sound_manager::stream_alloc(device_t &device, int inputs, int outputs, int sample_rate, stream_update_delegate callback)
{
return &m_stream_list.append(*global_alloc(sound_stream(device, inputs, outputs, sample_rate, callback)));
m_stream_list.push_back(std::make_unique<sound_stream>(device, inputs, outputs, sample_rate, callback));
return m_stream_list.back().get();
}
@ -1109,15 +1110,15 @@ void sound_manager::update(void *ptr, int param)
}
// iterate over all the streams and update them
for (sound_stream &stream : m_stream_list)
stream.update_with_accounting(second_tick);
for (auto &stream : m_stream_list)
stream->update_with_accounting(second_tick);
// remember the update time
m_last_update = curtime;
// update sample rates if they have changed
for (sound_stream &stream : m_stream_list)
stream.apply_sample_rate_changes();
for (auto &stream : m_stream_list)
stream->apply_sample_rate_changes();
g_profiler.stop();
}

View File

@ -52,7 +52,6 @@ struct mixer_input
class sound_stream
{
friend class simple_list<sound_stream>;
friend class sound_manager;
typedef void (*stream_update_func)(device_t *device, sound_stream *stream, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
@ -94,10 +93,10 @@ class sound_stream
static const UINT32 FRAC_ONE = 1 << FRAC_BITS;
static const UINT32 FRAC_MASK = FRAC_ONE - 1;
public:
// construction/destruction
sound_stream(device_t &device, int inputs, int outputs, int sample_rate, stream_update_delegate callback);
public:
// getters
sound_stream *next() const { return m_next; }
device_t &device() const { return m_device; }
@ -199,7 +198,7 @@ public:
// getters
running_machine &machine() const { return m_machine; }
int attenuation() const { return m_attenuation; }
const simple_list<sound_stream> &streams() const { return m_stream_list; }
const std::vector<std::unique_ptr<sound_stream>> &streams() const { return m_stream_list; }
attotime last_update() const { return m_last_update; }
attoseconds_t update_attoseconds() const { return m_update_attoseconds; }
@ -245,7 +244,7 @@ private:
wav_file * m_wavfile;
// streams data
simple_list<sound_stream> m_stream_list; // list of streams
std::vector<std::unique_ptr<sound_stream>> m_stream_list; // list of streams
attoseconds_t m_update_attoseconds; // attoseconds between global updates
attotime m_last_update; // last update time
};

View File

@ -430,12 +430,12 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
// extract other attributes
m_line = xml_get_attribute_int(&entrynode, "line", 0);
m_justify = JUSTIFY_LEFT;
m_justify = ui::text_layout::LEFT;
const char *align = xml_get_attribute_string(&entrynode, "align", "left");
if (strcmp(align, "center") == 0)
m_justify = JUSTIFY_CENTER;
m_justify = ui::text_layout::CENTER;
else if (strcmp(align, "right") == 0)
m_justify = JUSTIFY_RIGHT;
m_justify = ui::text_layout::RIGHT;
else if (strcmp(align, "left") != 0)
throw emu_fatalerror("%s.xml(%d): invalid alignment '%s' specified\n", filename, entrynode.line, align);
@ -509,7 +509,7 @@ void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &arginde
curarg += arg->values(argindex, &params[curarg]);
// generate the astring
manager.get_output_astring(m_line, m_justify) = string_format(m_format,
manager.get_output_string(m_line, m_justify) = string_format(m_format,
(UINT32)params[0], (UINT32)params[1], (UINT32)params[2], (UINT32)params[3],
(UINT32)params[4], (UINT32)params[5], (UINT32)params[6], (UINT32)params[7],
(UINT32)params[8], (UINT32)params[9], (UINT32)params[10], (UINT32)params[11],
@ -545,9 +545,9 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const
cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
if (m_line != 0)
cheatfile.printf(" line=\"%d\"", m_line);
if (m_justify == JUSTIFY_CENTER)
if (m_justify == ui::text_layout::CENTER)
cheatfile.printf(" align=\"center\"");
else if (m_justify == JUSTIFY_RIGHT)
else if (m_justify == ui::text_layout::RIGHT)
cheatfile.printf(" align=\"right\"");
if (m_arglist.size() == 0)
cheatfile.printf(" />\n");
@ -1236,19 +1236,19 @@ void cheat_manager::render_text(mame_ui_manager &mui, render_container &containe
// output the text
mui.draw_text_full(&container, m_output[linenum].c_str(),
0.0f, (float)linenum * mui.get_line_height(), 1.0f,
m_justify[linenum], WRAP_NEVER, DRAW_OPAQUE,
m_justify[linenum], ui::text_layout::NEVER, mame_ui_manager::OPAQUE_,
rgb_t::white, rgb_t::black, nullptr, nullptr);
}
}
//-------------------------------------------------
// get_output_astring - return a reference to
// get_output_string - return a reference to
// the given row's string, and set the
// justification
//-------------------------------------------------
std::string &cheat_manager::get_output_astring(int row, int justify)
std::string &cheat_manager::get_output_string(int row, ui::text_layout::text_justify justify)
{
// if the row is not specified, grab the next one
if (row == 0)

View File

@ -15,6 +15,7 @@
#include "debug/express.h"
#include "debug/debugcpu.h"
#include "ui/text.h"
//**************************************************************************
@ -174,12 +175,12 @@ private:
void validate_format(const char *filename, int line);
// internal state
parsed_expression m_condition; // condition under which this is executed
parsed_expression m_expression; // expression to execute
std::string m_format; // string format to print
std::vector<std::unique_ptr<output_argument>> m_arglist; // list of arguments
INT8 m_line; // which line to print on
UINT8 m_justify; // justification when printing
parsed_expression m_condition; // condition under which this is executed
parsed_expression m_expression; // expression to execute
std::string m_format; // string format to print
std::vector<std::unique_ptr<output_argument>> m_arglist; // list of arguments
INT8 m_line; // which line to print on
ui::text_layout::text_justify m_justify; // justification when printing
// constants
static const int MAX_ARGUMENTS = 32;
@ -288,7 +289,7 @@ public:
void render_text(mame_ui_manager &mui, render_container &container);
// output helpers
std::string &get_output_astring(int row, int justify);
std::string &get_output_string(int row, ui::text_layout::text_justify justify);
// global helpers
static std::string quote_expression(const parsed_expression &expression);
@ -305,7 +306,7 @@ private:
std::vector<std::unique_ptr<cheat_entry>> m_cheatlist; // cheat list
UINT64 m_framecount; // frame count
std::vector<std::string> m_output; // array of output strings
std::vector<UINT8> m_justify; // justification for each string
std::vector<ui::text_layout::text_justify> m_justify; // justification for each string
UINT8 m_numlines; // number of lines available for output
INT8 m_lastline; // last line used for output
bool m_disabled; // true if the cheat engine is disabled

View File

@ -1490,7 +1490,7 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
// retrieve all parameters
int sc_width = sc->visible_area().width();
int sc_height = sc->visible_area().height();
int justify = JUSTIFY_LEFT;
auto justify = ui::text_layout::LEFT;
float y, x = 0;
if(lua_isnumber(L, 2))
{
@ -1501,9 +1501,9 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
{
std::string just_str = lua_tostring(L, 2);
if(just_str == "right")
justify = JUSTIFY_RIGHT;
justify = ui::text_layout::RIGHT;
else if(just_str == "center")
justify = JUSTIFY_CENTER;
justify = ui::text_layout::CENTER;
y = lua_tonumber(L, 3);
}
const char *msg = luaL_checkstring(L,4);
@ -1516,7 +1516,7 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
// draw the text
render_container &rc = sc->container();
mame_machine_manager::instance()->ui().draw_text_full(&rc, msg, x, y, (1.0f - x),
justify, WRAP_WORD, DRAW_NORMAL, textcolor,
justify, ui::text_layout::WORD, mame_ui_manager::NORMAL, textcolor,
bgcolor, nullptr, nullptr);
return 0;
}

View File

@ -114,7 +114,7 @@ void menu_audit::handle()
if (m_first)
{
ui().draw_text_box(container, _("Audit in progress..."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
ui().draw_text_box(container, _("Audit in progress..."), ui::text_layout::CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
m_first = false;
return;
}

View File

@ -210,8 +210,8 @@ void menu_custom_filter::custom_render(void *selectedref, float top, float botto
float width;
// get the size of the text
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@ -230,8 +230,8 @@ void menu_custom_filter::custom_render(void *selectedref, float top, float botto
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------
@ -525,8 +525,8 @@ void menu_swcustom_filter::custom_render(void *selectedref, float top, float bot
float width;
// get the size of the text
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@ -545,8 +545,8 @@ void menu_swcustom_filter::custom_render(void *selectedref, float top, float bot
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------

View File

@ -165,8 +165,8 @@ void menu_custom_ui::custom_render(void *selectedref, float top, float bottom, f
{
float width;
ui().draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -185,8 +185,8 @@ void menu_custom_ui::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------
@ -381,8 +381,8 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
// top text
std::string topbuf(_("UI Fonts Settings"));
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -401,15 +401,15 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
if ((FPTR)selectedref == INFOS_SIZE)
{
topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr, m_info_size);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr, m_info_size);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(origx2 - origx1, width);
@ -428,8 +428,8 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size);
}
}
@ -539,8 +539,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
// top text
std::string topbuf(_("UI Colors Settings"));
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -559,16 +559,16 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// bottom text
// get the text for 'UI Select'
std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
topbuf = string_format(_("Double click or press %1$s to change the color value"), ui_select_text);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -587,14 +587,14 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// compute maxwidth
topbuf = _("Menu Preview");
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
maxwidth = width + 2.0f * UI_BOX_LR_BORDER;
std::string sampletxt[5];
@ -607,8 +607,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
for (auto & elem: sampletxt)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
}
@ -629,8 +629,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
y2 -= UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// compute our bounds for menu preview
x1 -= UI_BOX_LR_BORDER;
@ -647,30 +647,30 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw normal text
ui().draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
ui().draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
y1 += line_height;
// draw subitem text
ui().draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
ui().draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
y1 += line_height;
// draw selected text
highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_SELECTED_BG_COLOR].color);
ui().draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr);
ui().draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr);
y1 += line_height;
// draw mouse over text
highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_MOUSEOVER_BG_COLOR].color);
ui().draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr);
ui().draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr);
y1 += line_height;
// draw clone text
ui().draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
ui().draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
}
@ -880,8 +880,8 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
// top text
std::string topbuf = std::string(m_title).append(_(" - ARGB Settings"));
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -900,13 +900,13 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
std::string sampletxt(_("Color preview ="));
maxwidth = origx2 - origx1;
ui().draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -925,8 +925,8 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
y1 += UI_BOX_TB_BORDER;
// draw the normal text
ui().draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, rgb_t::white, rgb_t::black, nullptr, nullptr);
ui().draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, rgb_t::white, rgb_t::black, nullptr, nullptr);
float t_x2 = x1 - UI_BOX_LR_BORDER + maxwidth;
x1 = x2 + 2.0f * UI_BOX_LR_BORDER;

View File

@ -129,8 +129,8 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
float width;
std::string driver = (m_issoft == true) ? m_swinfo->longname : m_driver->description;
ui().draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -148,14 +148,14 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
ui().draw_text_full(container, driver.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, driver.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
maxwidth = 0;
for (auto & elem : m_items_list)
{
ui().draw_text_full(container, elem.label.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.label.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
maxwidth += width;
}
@ -180,13 +180,13 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
x1 += space;
rgb_t fcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0x00) : UI_TEXT_COLOR;
rgb_t bcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0xff) : UI_TEXT_BG_COLOR;
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NONE, fcolor, bcolor, &width, nullptr);
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NONE, fcolor, bcolor, &width, nullptr);
if (bcolor != UI_TEXT_BG_COLOR)
ui().draw_textured_box(container, x1 - (space / 2), y1, x1 + width + (space / 2), y2, bcolor, rgb_t(255, 43, 43, 43),
hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NORMAL, fcolor, bcolor, &width, nullptr);
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fcolor, bcolor, &width, nullptr);
x1 += width + space;
++x;
}
@ -194,7 +194,7 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
// bottom
std::string revision;
revision.assign(_("Revision: ")).append(m_items_list[m_actual].revision);
ui().draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(origx2 - origx1, width);
@ -213,8 +213,8 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------

View File

@ -118,8 +118,8 @@ void menu_directory::custom_render(void *selectedref, float top, float bottom, f
float width;
// get the size of the text
ui().draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@ -138,8 +138,8 @@ void menu_directory::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
/**************************************************
@ -217,13 +217,13 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
for (auto & elem : m_folders)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = MAX(maxwidth, width);
}
// get the size of the text
ui().draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = MAX(width, maxwidth);
@ -242,8 +242,8 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// compute our bounds
x1 = 0.5f - 0.5f * maxwidth;
@ -262,8 +262,8 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
// draw the text within it
for (auto & elem : m_folders)
{
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
y1 += lineh;
}
@ -506,8 +506,8 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
// get the size of the text
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = MAX(width, maxwidth);
}
@ -529,16 +529,16 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
// draw the text within it
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
y1 = y1 + ui().get_line_height();
}
// bottom text
tempbuf[0] = _("Press TAB to set");
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -557,8 +557,8 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@ -643,7 +643,7 @@ void menu_remove_folder::custom_render(void *selectedref, float top, float botto
std::string tempbuf = string_format(_("Remove %1$s Folder"), _(s_folders[m_ref].name));
// get the size of the text
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@ -662,7 +662,7 @@ void menu_remove_folder::custom_render(void *selectedref, float top, float botto
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL,
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL,
UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}

View File

@ -224,7 +224,7 @@ void menu_file_create::populate()
item_append(_("New Image Name:"), new_image_name, 0, ITEMREF_NEW_IMAGE_NAME);
// do we support multiple formats?
if (ENABLE_FORMATS) format = m_image->formatlist().first();
if (ENABLE_FORMATS) format = m_image->formatlist().front().get();
if (ENABLE_FORMATS && (format != nullptr))
{
item_append(_("Image Format:"), m_current_format->description(), 0, ITEMREF_FORMAT);

View File

@ -694,9 +694,9 @@ void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2,
0,
y1 + (DIP_SWITCH_HEIGHT - UI_TARGET_FONT_HEIGHT) / 2,
x1 - ui().get_string_width(" "),
JUSTIFY_RIGHT,
WRAP_NEVER,
DRAW_NORMAL,
ui::text_layout::RIGHT,
ui::text_layout::NEVER,
mame_ui_manager::NORMAL,
UI_TEXT_COLOR,
PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA),
nullptr ,

View File

@ -88,6 +88,7 @@ std::vector<std::unique_ptr<bitmap_argb32>> menu::icons_bitmap;
std::unique_ptr<bitmap_rgb32> menu::hilight_main_bitmap;
std::vector<std::shared_ptr<bitmap_argb32>> menu::toolbar_bitmap;
std::vector<std::shared_ptr<bitmap_argb32>> menu::sw_toolbar_bitmap;
std::vector<const game_driver *> menu::m_old_icons;
/***************************************************************************
INLINE FUNCTIONS
@ -187,6 +188,7 @@ void menu::exit(running_machine &machine)
}
icons_bitmap.clear();
m_old_icons.clear();
}
@ -503,7 +505,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
if (ui().show_fps_counter())
{
ui().draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::OPAQUE_, rgb_t::white, rgb_t::black, nullptr, nullptr);
}
bool const customonly = (flags & PROCESS_CUSTOM_ONLY);
@ -580,6 +582,8 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
top_line = 0;
if (top_line > item.size() - visible_lines || selected == (item.size() - 1))
top_line = item.size() - visible_lines;
if (selected >= top_line + visible_lines)
top_line = selected - (visible_lines / 2);
bool show_top_arrow = false;
bool show_bottom_arrow = false;
@ -695,7 +699,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
container->add_line(visible_left + visible_width - ((visible_width - heading_width) / 2) + UI_BOX_LR_BORDER, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
}
// otherwise, draw the item on the left and the subitem text on the right
@ -707,7 +711,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
// draw the left-side text
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, nullptr);
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, &item_width, nullptr);
// give 2 spaces worth of padding
item_width += 2.0f * gutter_width;
@ -732,7 +736,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
// draw the subitem right-justified
ui().draw_text_full(container, subitem_text, effective_left + item_width, line_y, effective_width - item_width,
JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, nullptr);
ui::text_layout::RIGHT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, nullptr);
// apply arrows
if (itemnum == selected && (pitem.flags & FLAG_LEFT_ARROW))
@ -771,7 +775,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
// compute the multi-line target width/height
ui().draw_text_full(container, pitem.subtext, 0, 0, visible_width * 0.75f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
// determine the target location
target_x = visible_left + visible_width - target_width - UI_BOX_LR_BORDER;
@ -785,8 +789,9 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
target_x + target_width + UI_BOX_LR_BORDER,
target_y + target_height + UI_BOX_TB_BORDER,
subitem_invert ? UI_SELECTED_BG_COLOR : UI_BACKGROUND_COLOR);
ui().draw_text_full(container, pitem.subtext, target_x, target_y, target_width,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
}
// if there is something special to add, do it by calling the virtual method
@ -815,7 +820,7 @@ void menu::draw_text_box()
// compute the multi-line target width/height
ui().draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER - 2.0f * gutter_width,
JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
target_height += 2.0f * line_height;
if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
target_height = floorf((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
@ -845,7 +850,7 @@ void menu::draw_text_box()
target_y + target_height + UI_BOX_TB_BORDER,
(item[0].flags & FLAG_REDTEXT) ? UI_RED_COLOR : UI_BACKGROUND_COLOR);
ui().draw_text_full(container, text, target_x, target_y, target_width,
JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// draw the "return to prior menu" text with a hilight behind it
highlight(container,
@ -855,7 +860,7 @@ void menu::draw_text_box()
target_y + target_height,
UI_SELECTED_BG_COLOR);
ui().draw_text_full(container, backtext, target_x, target_y + target_height - line_height, target_width,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
// artificially set the hover to the last item so a double-click exits
hover = item.size() - 1;
@ -1369,6 +1374,7 @@ void menu::init_ui(running_machine &machine, ui_options &mopt)
// allocate icons
for (auto & icons : icons_texture)
{
m_old_icons.emplace_back(nullptr);
icons_bitmap.emplace_back(std::make_unique<bitmap_argb32>());
icons = mrender.texture_alloc();
}
@ -1439,7 +1445,6 @@ void menu::draw_select_game(UINT32 flags)
float primary_left = (1.0f - visible_width) * 0.5f;
float primary_width = visible_width;
bool is_swlist = (item[0].flags & FLAG_UI_SWLIST);
bool is_favorites = (item[0].flags & FLAG_UI_FAVORITE);
// draw background image if available
if (ui().options().use_background_image() && bgrnd_bitmap->valid())
@ -1577,41 +1582,27 @@ void menu::draw_select_game(UINT32 flags)
else if (pitem.subtext == nullptr)
{
int item_invert = pitem.flags & FLAG_INVERT;
float space = 0.0f;
if (ui_globals::has_icons && !is_swlist)
{
if (is_favorites)
{
ui_software_info *soft = (ui_software_info *)item[itemnum].ref;
if (soft->startempty == 1)
draw_icon(linenum, (void *)soft->driver, effective_left, line_y);
}
else
draw_icon(linenum, item[itemnum].ref, effective_left, line_y);
space = ud_arrow_width * 1.5f;
}
ui().draw_text_full(container, pitem.text, effective_left + space, line_y, effective_width - space, JUSTIFY_LEFT, WRAP_TRUNCATE,
DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
auto icon = draw_icon(linenum, item[itemnum].ref, effective_left, line_y);
ui().draw_text_full(container, pitem.text, effective_left + icon, line_y, effective_width - icon, ui::text_layout::LEFT, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
}
else
{
int item_invert = pitem.flags & FLAG_INVERT;
auto item_invert = pitem.flags & FLAG_INVERT;
float item_width, subitem_width;
// compute right space for subitem
ui().draw_text_full(container, pitem.subtext, effective_left, line_y, ui().get_string_width(pitem.subtext),
JUSTIFY_RIGHT, WRAP_NEVER, DRAW_NONE, item_invert ? fgcolor3 : fgcolor, bgcolor, &subitem_width, nullptr);
ui::text_layout::RIGHT, ui::text_layout::NEVER, mame_ui_manager::NONE, item_invert ? fgcolor3 : fgcolor, bgcolor, &subitem_width, nullptr);
subitem_width += gutter_width;
// draw the item left-justified
ui().draw_text_full(container, pitem.text, effective_left, line_y, effective_width - subitem_width,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, &item_width, nullptr);
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, &item_width, nullptr);
// draw the subitem right-justified
ui().draw_text_full(container, pitem.subtext, effective_left + item_width, line_y, effective_width - item_width,
JUSTIFY_RIGHT, WRAP_NEVER, DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
ui::text_layout::RIGHT, ui::text_layout::NEVER, mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
}
}
@ -1648,8 +1639,8 @@ void menu::draw_select_game(UINT32 flags)
container->add_line(visible_left, line + 0.5f * line_height, visible_left + visible_width, line + 0.5f * line_height,
UI_LINE_WIDTH, UI_TEXT_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
else
ui().draw_text_full(container, pitem.text, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui().draw_text_full(container, pitem.text, effective_left, line, effective_width, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
line += line_height;
}
@ -2199,7 +2190,7 @@ float menu::draw_right_box_title(float x1, float y1, float x2, float y2)
bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, buffer[cells].c_str(), x1 + UI_LINE_WIDTH, y1, midl - UI_LINE_WIDTH,
JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
x1 += midl;
}
@ -2223,8 +2214,8 @@ std::string menu::arts_render_common(float origx1, float origy1, float origx2, f
// apply title to right panel
for (int x = FIRST_VIEW; x < LAST_VIEW; x++)
{
ui().draw_text_full(container, _(arts_info[x].first), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &txt_lenght, nullptr);
ui().draw_text_full(container, _(arts_info[x].first), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &txt_lenght, nullptr);
txt_lenght += 0.01f;
title_size = MAX(txt_lenght, title_size);
}
@ -2242,8 +2233,8 @@ std::string menu::arts_render_common(float origx1, float origy1, float origx2, f
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
origy1 + line_height, bgcolor, rgb_t(43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curimage_view, FIRST_VIEW, LAST_VIEW, title_size);
@ -2297,7 +2288,7 @@ void menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software)
hover = HOVER_B_FAV + z;
color = rgb_t::white;
float ypos = y2 + ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER;
ui().draw_text_box(container, _(hover_msg[z]), JUSTIFY_CENTER, 0.5f, ypos, UI_BACKGROUND_COLOR);
ui().draw_text_box(container, _(hover_msg[z]), ui::text_layout::CENTER, 0.5f, ypos, UI_BACKGROUND_COLOR);
}
container->add_quad(x1, y1, x2, y2, color, t_texture[z], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@ -2451,16 +2442,29 @@ void menu::draw_common_arrow(float origx1, float origy1, float origx2, float ori
// draw icons
//-------------------------------------------------
void menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
float menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
{
static const game_driver *olddriver[MAX_ICONS_RENDER] = { nullptr };
auto x1 = x0 + ui().get_line_height() * container->manager().ui_aspect(container);
auto y1 = y0 + ui().get_line_height();
auto driver = (const game_driver *)selectedref;
if (!ui_globals::has_icons || (item[0].flags & FLAG_UI_SWLIST))
return 0.0f;
if (olddriver[linenum] != driver || ui_globals::redraw_icon)
float ud_arrow_width = ui().get_line_height() * container->manager().ui_aspect(container);
const game_driver *driver = nullptr;
if (item[0].flags & FLAG_UI_FAVORITE)
{
olddriver[linenum] = driver;
ui_software_info *soft = (ui_software_info *)selectedref;
if (soft->startempty == 1)
driver = soft->driver;
}
else
driver = (const game_driver *)selectedref;
auto x1 = x0 + ud_arrow_width;
auto y1 = y0 + ui().get_line_height();
if (m_old_icons[linenum] != driver || ui_globals::redraw_icon)
{
m_old_icons[linenum] = driver;
// set clone status
bool cloneof = strcmp(driver->parent, "0");
@ -2531,7 +2535,6 @@ void menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
else
dest_bitmap = tmp;
icons_bitmap[linenum]->reset();
icons_bitmap[linenum]->allocate(panel_width_pixel, panel_height_pixel);
for (int x = 0; x < dest_xPixel; x++)
@ -2550,6 +2553,8 @@ void menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
if (icons_bitmap[linenum] != nullptr && icons_bitmap[linenum]->valid())
container->add_quad(x0, y0, x1, y1, rgb_t::white, icons_texture[linenum], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
return ud_arrow_width * 1.5f;
}
//-------------------------------------------------
@ -2732,7 +2737,7 @@ void menu::draw_palette_menu()
// if we don't have a subitem, just draw the string centered
else if (pitem.subtext == nullptr)
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
// otherwise, draw the item on the left and the subitem text on the right
else
@ -2742,7 +2747,7 @@ void menu::draw_palette_menu()
// draw the left-side text
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
// give 2 spaces worth of padding
float subitem_width = ui().get_string_width("FF00FF00");
@ -2867,8 +2872,8 @@ void menu::draw_dats_menu()
// draw dats text
else if (pitem.subtext == nullptr)
{
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width, ui::text_layout::LEFT, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
}
}
@ -2892,8 +2897,8 @@ void menu::draw_dats_menu()
else
{
highlight(container, line_x0, line_y0, line_x1, line_y1, bgcolor);
ui().draw_text_full(container, itemtext, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui().draw_text_full(container, itemtext, effective_left, line, effective_width, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
}
line += line_height;
}

View File

@ -347,7 +347,7 @@ private:
// handle mouse
void handle_main_events();
void draw_icon(int linenum, void *selectedref, float x1, float y1);
float draw_icon(int linenum, void *selectedref, float x1, float y1);
void extra_text_draw_box(float origx1, float origx2, float origy, float yspan, const char *text, int direction);
bool m_special_main_menu;
@ -358,6 +358,7 @@ private:
event m_event; // the UI event that occurred
pool *m_pool; // list of memory pools
focused_menu m_focus;
static std::vector<const game_driver *> m_old_icons;
static std::unique_ptr<menu> menu_stack;
static std::unique_ptr<menu> menu_free;

View File

@ -813,8 +813,8 @@ void menu_machine_configure::custom_render(void *selectedref, float top, float b
for (auto & elem : text)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
}
@ -836,8 +836,8 @@ void menu_machine_configure::custom_render(void *selectedref, float top, float b
// draw the text within it
for (auto & elem : text)
{
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
y1 += ui().get_line_height();
}
}
@ -957,8 +957,8 @@ void menu_plugins_configure::custom_render(void *selectedref, float top, float b
{
float width;
ui().draw_text_full(container, _("Plugins"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Plugins"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -977,8 +977,8 @@ void menu_plugins_configure::custom_render(void *selectedref, float top, float b
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Plugins"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Plugins"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
} // namespace ui

View File

@ -297,8 +297,8 @@ void menu_game_options::populate()
void menu_game_options::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
ui().draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -317,8 +317,8 @@ void menu_game_options::custom_render(void *selectedref, float top, float bottom
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Settings"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}

View File

@ -168,8 +168,8 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_");
// get the size of the text
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@ -188,16 +188,16 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// bottom text
// get the text for 'UI Select'
std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
tempbuf = string_format(_("Double click or press %1$s to select"), ui_select_text);
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@ -216,8 +216,8 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------

View File

@ -464,7 +464,7 @@ void menu_select_game::handle()
// if we're in an error state, overlay an error message
if (ui_error)
ui().draw_text_box(container, _("The selected machine is missing one or more required ROM or CHD images. "
"Please select a different machine.\n\nPress any key to continue."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
"Please select a different machine.\n\nPress any key to continue."), ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
// handle filters selection from key shortcuts
if (check_filter)
@ -801,8 +801,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
// get the size of the text
for (int line = 0; line < 2; ++line)
{
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(width, maxwidth);
}
@ -830,8 +830,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
// draw the text within it
for (int line = 0; line < 2; ++line)
{
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
y1 += ui().get_line_height();
}
@ -956,8 +956,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
}
@ -989,8 +989,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
// draw all lines
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
y1 += ui().get_line_height();
}
}
@ -1905,8 +1905,8 @@ float menu_select_game::draw_left_panel(float x1, float y1, float x2, float y2)
convert_command_glyph(str);
}
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
y1 += line_height_max;
}
@ -2014,8 +2014,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
for (int x = UI_FIRST_LOAD; x < UI_LAST_LOAD; ++x)
{
ui().draw_text_full(container, _(dats_info[x]), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
WRAP_NEVER, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
ui().draw_text_full(container, _(dats_info[x]), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::NEVER, mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
txt_length += 0.01f;
title_size = (std::max)(txt_length, title_size);
}
@ -2039,8 +2039,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curdats_view, UI_FIRST_LOAD, UI_LAST_LOAD, title_size);
@ -2076,8 +2076,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
if (buffer.empty())
{
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
else if (ui_globals::curdats_view != UI_STORY_LOAD && ui_globals::curdats_view != UI_COMMAND_LOAD)
@ -2115,8 +2115,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
size_t last_underscore = tempbuf.find_last_of("_");
if (last_underscore == std::string::npos)
{
ui().draw_text_full(container, tempbuf.c_str(), origx1, oy1, origx2 - origx1, JUSTIFY_CENTER,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
ui().draw_text_full(container, tempbuf.c_str(), origx1, oy1, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
}
else
{
@ -2127,11 +2127,11 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
float item_width;
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &item_width, nullptr, tmp_size2);
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &item_width, nullptr, tmp_size2);
ui().draw_text_full(container, last_part.c_str(), effective_left + item_width, oy1,
origx2 - origx1 - 2.0f * gutter_width - item_width, JUSTIFY_RIGHT, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
origx2 - origx1 - 2.0f * gutter_width - item_width, ui::text_layout::RIGHT, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
}
}
@ -2150,19 +2150,19 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
std::string first_part(tempbuf.substr(0, first_dspace));
std::string last_part(tempbuf.substr(first_dspace + 1));
strtrimspace(last_part);
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, JUSTIFY_LEFT,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, ui::text_layout::LEFT,
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
ui().draw_text_full(container, last_part.c_str(), effective_left, oy1, origx2 - origx1 - 2.0f * gutter_width,
JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
ui::text_layout::RIGHT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
}
else
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
}
else
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
oy1 += (line_height * text_size);
}
@ -2179,8 +2179,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
// apply title to right panel
if (soft->usage.empty())
{
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui_globals::cur_sw_dats_view = 0;
}
else
@ -2193,8 +2193,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
for (auto & elem: t_text)
{
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
txt_length += 0.01f;
title_size = (std::max)(txt_length, title_size);
}
@ -2214,7 +2214,7 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
}
@ -2237,8 +2237,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
if (buffer.empty())
{
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
else
@ -2264,8 +2264,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
else if (r == r_visible_lines - 1 && itemline != totallines - 1)
info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width);
else
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
oy1 += (line_height * text_size);
}

View File

@ -375,7 +375,7 @@ void menu_select_software::handle()
if (ui_error)
ui().draw_text_box(container, _("The selected software is missing one or more required files. "
"Please select a different software.\n\nPress any key to continue."),
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
// handle filters selection from key shortcuts
if (check_filter)
@ -688,8 +688,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
for (int line = 0; line < 3; ++line)
{
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(width, maxwidth);
}
@ -717,8 +717,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
// draw the text within it
for (int line = 0; line < 3; ++line)
{
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
y1 += ui().get_line_height();
}
@ -837,8 +837,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
}
@ -870,8 +870,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
// draw all lines
for (auto & elem : tempbuf)
{
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
y1 += ui().get_line_height();
}
}
@ -1488,8 +1488,8 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float
convert_command_glyph(str);
}
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
y1 += line_height;
}
@ -1567,8 +1567,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
{
float title_size = 0.0f;
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &title_size, nullptr);
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &title_size, nullptr);
title_size += 0.01f;
rgb_t fgcolor = UI_TEXT_COLOR;
@ -1585,8 +1585,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
ui_globals::cur_sw_dats_view = 0;
}
else
@ -1599,8 +1599,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
for (auto & elem : t_text)
{
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr);
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr);
txt_lenght += 0.01f;
title_size = MAX(txt_lenght, title_size);
}
@ -1625,7 +1625,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
ui().draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
}
@ -1648,8 +1648,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
if (buffer.empty())
{
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
else
@ -1677,7 +1677,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width);
else
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR,
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR,
nullptr, nullptr, text_size);
oy1 += (line_height * text_size);
}
@ -1986,8 +1986,8 @@ void software_parts::handle()
void software_parts::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
ui().draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -2006,8 +2006,8 @@ void software_parts::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------
@ -2127,8 +2127,8 @@ void bios_selection::handle()
void bios_selection::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
ui().draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -2147,8 +2147,8 @@ void bios_selection::custom_render(void *selectedref, float top, float bottom, f
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
} // namespace ui

View File

@ -136,7 +136,7 @@ void simple_menu_select_game::handle()
ui().draw_text_box(container,
"The selected game is missing one or more required ROM or CHD images. "
"Please select a different game.\n\nPress any key to continue.",
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
}
@ -298,8 +298,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
tempbuf[0] = _("Type name or select: (random)");
// get the size of the text
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(width, origx2 - origx1);
@ -318,8 +318,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// determine the text to render below
driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
@ -388,8 +388,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
maxwidth = origx2 - origx1;
for (line = 0; line < 4; line++)
{
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
}
@ -418,8 +418,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
// draw all lines
for (line = 0; line < 4; line++)
{
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
y1 += ui().get_line_height();
}
}

View File

@ -226,7 +226,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
// determine the text height
ui().draw_text_full(container, tempstring.c_str(), 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, nullptr, &text_height);
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, nullptr, &text_height);
// draw the thermometer
bar_left = x1 + UI_BOX_LR_BORDER;
@ -253,7 +253,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
// draw the actual text
ui().draw_text_full(container, tempstring.c_str(), x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, &text_height);
ui::text_layout::CENTER, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, &text_height);
}
}

View File

@ -146,8 +146,8 @@ void menu_sound_options::populate()
void menu_sound_options::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
ui().draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -166,8 +166,8 @@ void menu_sound_options::custom_render(void *selectedref, float top, float botto
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
} // namespace ui

View File

@ -414,8 +414,8 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
{
float width;
ui().draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@ -434,16 +434,16 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
if (selectedref != nullptr)
{
option &selected_sm_option = *reinterpret_cast<option *>(selectedref);
if (selected_sm_option.entry != nullptr)
{
ui().draw_text_full(container, selected_sm_option.entry->description(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
ui().draw_text_full(container, selected_sm_option.entry->description(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(origx2 - origx1, width);
@ -463,8 +463,8 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container, selected_sm_option.entry->description(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui().draw_text_full(container, selected_sm_option.entry->description(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
}
}

View File

@ -78,9 +78,10 @@ CORE IMPLEMENTATION
//-------------------------------------------------
text_layout::text_layout(render_font &font, float xscale, float yscale, float width, text_layout::text_justify justify, text_layout::word_wrapping wrap)
: m_font(font), m_xscale(xscale), m_yscale(yscale), m_width(width), m_justify(justify), m_wrap(wrap), m_current_line(nullptr), m_last_break(0), m_text_position(0)
: m_font(font), m_xscale(xscale), m_yscale(yscale), m_width(width), m_justify(justify), m_wrap(wrap), m_current_line(nullptr), m_last_break(0), m_text_position(0), m_truncating(false)
{
invalidate_calculated_actual_width();
}
@ -89,9 +90,10 @@ text_layout::text_layout(render_font &font, float xscale, float yscale, float wi
//-------------------------------------------------
text_layout::text_layout(text_layout &&that)
: m_font(that.m_font), m_xscale(that.m_xscale), m_yscale(that.m_yscale), m_width(that.m_width), m_justify(that.m_justify), m_wrap(that.m_wrap), m_lines(std::move(that.m_lines)),
m_current_line(that.m_current_line), m_last_break(that.m_last_break), m_text_position(that.m_text_position)
: m_font(that.m_font), m_xscale(that.m_xscale), m_yscale(that.m_yscale), m_width(that.m_width), m_calculated_actual_width(that.m_calculated_actual_width), m_justify(that.m_justify), m_wrap(that.m_wrap), m_lines(std::move(that.m_lines)),
m_current_line(that.m_current_line), m_last_break(that.m_last_break), m_text_position(that.m_text_position), m_truncating(false)
{
that.invalidate_calculated_actual_width();
}
@ -115,6 +117,9 @@ void text_layout::add_text(const char *text, const char_style &style)
while(position < text_length)
{
// adding a character - we might change the width
invalidate_calculated_actual_width();
// do we need to create a new line?
if (m_current_line == nullptr)
{
@ -159,10 +164,9 @@ void text_layout::add_text(const char *text, const char_style &style)
start_new_line(LEFT, style.size);
// and then close up the current line
update_maximum_line_width();
m_current_line = nullptr;
}
else
else if (!m_truncating)
{
// if we hit a space, remember the location and width *without* the space
if (is_space_character(ch))
@ -202,12 +206,40 @@ void text_layout::add_text(const char *text, const char_style &style)
//-------------------------------------------------
// update_maximum_line_width
// invalidate_calculated_actual_width
//-------------------------------------------------
void text_layout::update_maximum_line_width()
void text_layout::invalidate_calculated_actual_width()
{
m_maximum_line_width = actual_width();
m_calculated_actual_width = -1;
}
//-------------------------------------------------
// actual_left
//-------------------------------------------------
float text_layout::actual_left() const
{
float result;
if (empty())
{
// degenerate scenario
result = 0;
}
else
{
result = 1.0f;
for (const auto &line : m_lines)
{
result = std::min(result, line->xoffset());
// take an opportunity to break out easily
if (result <= 0)
break;
}
}
return result;
}
@ -217,8 +249,18 @@ void text_layout::update_maximum_line_width()
float text_layout::actual_width() const
{
float current_line_width = m_current_line ? m_current_line->width() : 0;
return MAX(m_maximum_line_width, current_line_width);
// do we need to calculate the width?
if (m_calculated_actual_width < 0)
{
// calculate the actual width
m_calculated_actual_width = 0;
for (const auto &line : m_lines)
m_calculated_actual_width = std::max(m_calculated_actual_width, line->width());
}
// return it
return m_calculated_actual_width;
}
@ -247,9 +289,9 @@ void text_layout::start_new_line(text_layout::text_justify justify, float height
std::unique_ptr<line> new_line(global_alloc_clear<line>(*this, justify, actual_height(), height * yscale()));
// update the current line
update_maximum_line_width();
m_current_line = new_line.get();
m_last_break = 0;
m_truncating = false;
// append it
m_lines.push_back(std::move(new_line));
@ -272,6 +314,8 @@ float text_layout::get_char_width(unicode_char ch, float size)
void text_layout::truncate_wrap()
{
const unicode_char elipsis = 0x2026;
// for now, lets assume that we're only truncating the last character
size_t truncate_position = m_current_line->character_count() - 1;
const auto& truncate_char = m_current_line->character(truncate_position);
@ -285,7 +329,7 @@ void text_layout::truncate_wrap()
source.span = 0;
// figure out how wide an elipsis is
float elipsis_width = 3 * get_char_width('.', style.size);
float elipsis_width = get_char_width(elipsis, style.size);
// where should we really truncate from?
while (truncate_position > 0 && m_current_line->character(truncate_position).xoffset + elipsis_width < width())
@ -295,10 +339,10 @@ void text_layout::truncate_wrap()
m_current_line->truncate(truncate_position);
// and append the elipsis
m_current_line->add_character('.', style, source);
m_current_line->add_character(elipsis, style, source);
// finally start a new line
start_new_line(m_current_line->justify(), style.size);
// take note that we are truncating; supress new characters
m_truncating = true;
}
@ -489,7 +533,7 @@ void text_layout::line::add_character(unicode_char ch, const char_style &style,
m_width += chwidth;
// we might be bigger
m_height = MAX(m_height, style.size * m_layout.yscale());
m_height = std::max(m_height, style.size * m_layout.yscale());
}

View File

@ -58,13 +58,15 @@ public:
word_wrapping wrap() const { return m_wrap; }
// methods
float actual_left() const;
float actual_width() const;
float actual_height() const;
bool empty() const { return m_lines.size() == 0; }
bool hit_test(float x, float y, size_t &start, size_t &span) const;
void restyle(size_t start, size_t span, rgb_t *fgcolor, rgb_t *bgcolor);
int get_wrap_info(std::vector<int> &xstart, std::vector<int> &xend) const;
void emit(render_container *container, float x, float y);
void add_text(const char *text, rgb_t fgcolor = rgb_t::white, rgb_t bgcolor = rgb_t(0,0,0,0), float size = 1.0)
void add_text(const char *text, rgb_t fgcolor = rgb_t::white, rgb_t bgcolor = rgb_t::transparent, float size = 1.0)
{
// create the style
char_style style = { 0, };
@ -138,13 +140,14 @@ private:
float m_xscale;
float m_yscale;
float m_width;
float m_maximum_line_width;
mutable float m_calculated_actual_width;
text_justify m_justify;
word_wrapping m_wrap;
std::vector<std::unique_ptr<line>> m_lines;
line *m_current_line;
size_t m_last_break;
size_t m_text_position;
bool m_truncating;
// methods
void add_text(const char *text, const char_style &style);
@ -152,7 +155,7 @@ private:
float get_char_width(unicode_char ch, float size);
void truncate_wrap();
void word_wrap();
void update_maximum_line_width();
void invalidate_calculated_actual_width();
};
} // namespace ui

View File

@ -401,7 +401,7 @@ void mame_ui_manager::update_and_render(render_container *container)
// display any popup messages
if (osd_ticks() < m_popup_text_end)
draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
draw_text_box(container, messagebox_poptext.c_str(), ui::text_layout::CENTER, 0.5f, 0.9f, messagebox_backcolor);
else
m_popup_text_end = 0;
@ -543,7 +543,7 @@ void mame_ui_manager::draw_outlined_box(render_container *container, float x0, f
void mame_ui_manager::draw_text(render_container *container, const char *buf, float x, float y)
{
draw_text_full(container, buf, x, y, 1.0f - x, JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
draw_text_full(container, buf, x, y, 1.0f - x, ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@ -553,20 +553,20 @@ void mame_ui_manager::draw_text(render_container *container, const char *buf, fl
// and full size computation
//-------------------------------------------------
void mame_ui_manager::draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight, float text_size)
void mame_ui_manager::draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight, float text_size)
{
// create the layout
auto layout = create_layout(container, origwrapwidth, (ui::text_layout::text_justify)justify, (ui::text_layout::word_wrapping)wrap);
auto layout = create_layout(container, origwrapwidth, justify, wrap);
// append text to it
layout.add_text(
origs,
fgcolor,
draw == DRAW_OPAQUE ? bgcolor : rgb_t(0, 0, 0, 0),
draw == OPAQUE_ ? bgcolor : rgb_t::transparent,
text_size);
// and emit it (if we are asked to do so)
if (draw != DRAW_NONE)
if (draw != NONE)
layout.emit(container, x, y);
// return width/height
@ -582,51 +582,45 @@ void mame_ui_manager::draw_text_full(render_container *container, const char *or
// message with a box around it
//-------------------------------------------------
void mame_ui_manager::draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor)
void mame_ui_manager::draw_text_box(render_container *container, const char *text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor)
{
float line_height = get_line_height();
float max_width = 2.0f * ((xpos <= 0.5f) ? xpos : 1.0f - xpos) - 2.0f * UI_BOX_LR_BORDER;
float target_width = max_width;
float target_height = line_height;
float target_x = 0, target_y = 0;
float last_target_height = 0;
// cap the maximum width
float maximum_width = 1.0f - UI_BOX_LR_BORDER * 2;
// limit this iteration to a finite number of passes
for (int pass = 0; pass < 5; pass++)
{
// determine the target location
target_x = xpos - 0.5f * target_width;
target_y = ypos - 0.5f * target_height;
// create a layout
ui::text_layout layout = create_layout(container, maximum_width, justify);
// make sure we stay on-screen
if (target_x < UI_BOX_LR_BORDER)
target_x = UI_BOX_LR_BORDER;
if (target_x + target_width + UI_BOX_LR_BORDER > 1.0f)
target_x = 1.0f - UI_BOX_LR_BORDER - target_width;
if (target_y < UI_BOX_TB_BORDER)
target_y = UI_BOX_TB_BORDER;
if (target_y + target_height + UI_BOX_TB_BORDER > 1.0f)
target_y = 1.0f - UI_BOX_TB_BORDER - target_height;
// add text to it
layout.add_text(text);
// compute the multi-line target width/height
draw_text_full(container, text, target_x, target_y, target_width + 0.00001f,
justify, WRAP_WORD, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &target_width, &target_height);
if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
target_height = floorf((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
// and draw the result
draw_text_box(container, layout, xpos, ypos, backcolor);
}
// if we match our last value, we're done
if (target_height == last_target_height)
break;
last_target_height = target_height;
}
//-------------------------------------------------
// draw_text_box - draw a multiline text
// message with a box around it
//-------------------------------------------------
void mame_ui_manager::draw_text_box(render_container *container, ui::text_layout &layout, float xpos, float ypos, rgb_t backcolor)
{
// xpos and ypos are where we want to "pin" the layout, but we need to adjust for the actual size of the payload
auto actual_left = layout.actual_left();
auto actual_width = layout.actual_width();
auto actual_height = layout.actual_height();
auto x = std::min(std::max(xpos - actual_width / 2, UI_BOX_LR_BORDER), 1.0f - actual_width - UI_BOX_LR_BORDER);
auto y = std::min(std::max(ypos - actual_height / 2, UI_BOX_TB_BORDER), 1.0f - actual_height - UI_BOX_TB_BORDER);
// add a box around that
draw_outlined_box(container, target_x - UI_BOX_LR_BORDER,
target_y - UI_BOX_TB_BORDER,
target_x + target_width + UI_BOX_LR_BORDER,
target_y + target_height + UI_BOX_TB_BORDER, backcolor);
draw_text_full(container, text, target_x, target_y, target_width + 0.00001f,
justify, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
draw_outlined_box(container,
x - UI_BOX_LR_BORDER,
y - UI_BOX_TB_BORDER,
x + actual_width + UI_BOX_LR_BORDER,
y + actual_height + UI_BOX_TB_BORDER, backcolor);
// emit the text
layout.emit(container, x - actual_left, y);
}
@ -637,7 +631,7 @@ void mame_ui_manager::draw_text_box(render_container *container, const char *tex
void mame_ui_manager::draw_message_window(render_container *container, const char *text)
{
draw_text_box(container, text, JUSTIFY_LEFT, 0.5f, 0.5f, UI_BACKGROUND_COLOR);
draw_text_box(container, text, ui::text_layout::text_justify::LEFT, 0.5f, 0.5f, UI_BACKGROUND_COLOR);
}
@ -1010,7 +1004,7 @@ std::string &mame_ui_manager::game_info_astring(std::string &str)
UINT32 mame_ui_manager::handler_messagebox(render_container *container)
{
draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor);
return 0;
}
@ -1026,7 +1020,7 @@ UINT32 mame_ui_manager::handler_messagebox_anykey(render_container *container)
UINT32 state = 0;
// draw a standard message window
draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor);
// if the user cancels, exit out completely
if (machine().ui_input().pressed(IPT_UI_CANCEL))
@ -1169,6 +1163,52 @@ void mame_ui_manager::paste()
}
//-------------------------------------------------
// draw_fps_counter
//-------------------------------------------------
void mame_ui_manager::draw_fps_counter(render_container *container)
{
draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
ui::text_layout::RIGHT, ui::text_layout::WORD, OPAQUE_, rgb_t::white, rgb_t::black, nullptr, nullptr);
}
//-------------------------------------------------
// draw_timecode_counter
//-------------------------------------------------
void mame_ui_manager::draw_timecode_counter(render_container *container)
{
std::string tempstring;
draw_text_full(container, machine().video().timecode_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
ui::text_layout::RIGHT, ui::text_layout::WORD, OPAQUE_, rgb_t(0xf0, 0xf0, 0x10, 0x10), rgb_t::black, nullptr, nullptr);
}
//-------------------------------------------------
// draw_timecode_total
//-------------------------------------------------
void mame_ui_manager::draw_timecode_total(render_container *container)
{
std::string tempstring;
draw_text_full(container, machine().video().timecode_total_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
ui::text_layout::LEFT, ui::text_layout::WORD, OPAQUE_, rgb_t(0xf0, 0x10, 0xf0, 0x10), rgb_t::black, nullptr, nullptr);
}
//-------------------------------------------------
// draw_profiler
//-------------------------------------------------
void mame_ui_manager::draw_profiler(render_container *container)
{
const char *text = g_profiler.text(machine());
draw_text_full(container, text, 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::WORD, OPAQUE_, rgb_t::white, rgb_t::black, nullptr, nullptr);
}
//-------------------------------------------------
// image_handler_ingame - execute display
// callback function for each image device
@ -1177,20 +1217,29 @@ void mame_ui_manager::paste()
void mame_ui_manager::image_handler_ingame()
{
// run display routine for devices
if (machine().phase() == MACHINE_PHASE_RUNNING)
for (device_image_interface &image : image_interface_iterator(machine().root_device())) {
std::string str;
int idx = image.call_display(str);
if (idx >= 0) {
float x, y;
/* choose a location on the screen */
x = 0.2f;
y = 0.5f + idx;
y *= get_line_height() + 2.0f * UI_BOX_TB_BORDER;
if (machine().phase() == MACHINE_PHASE_RUNNING)
{
auto layout = create_layout(&machine().render().ui_container());
draw_text_box(&machine().render().ui_container(), str.c_str(), JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
// loop through all devices, build their text into the layout
for (device_image_interface &image : image_interface_iterator(machine().root_device()))
{
std::string str = image.call_display();
if (!str.empty())
{
layout.add_text(str.c_str());
layout.add_text("\n");
}
}
// did we actually create anything?
if (!layout.empty())
{
float x = 0.2f;
float y = 0.5f * get_line_height() + 2.0f * UI_BOX_TB_BORDER;
draw_text_box(&machine().render().ui_container(), layout, x, y, UI_BACKGROUND_COLOR);
}
}
}
//-------------------------------------------------
@ -1204,31 +1253,19 @@ UINT32 mame_ui_manager::handler_ingame(render_container *container)
// first draw the FPS counter
if (show_fps_counter())
{
draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
}
draw_fps_counter(container);
// Show the duration of current part (intro or gameplay or extra)
if (show_timecode_counter()) {
std::string tempstring;
draw_text_full(container, machine().video().timecode_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0xf0,0x10,0x10), rgb_t::black, nullptr, nullptr);
}
// Show the total time elapsed for the video preview (all parts intro, gameplay, extras)
if (show_timecode_total()) {
std::string tempstring;
draw_text_full(container, machine().video().timecode_total_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0x10,0xf0,0x10), rgb_t::black, nullptr, nullptr);
}
if (show_timecode_counter())
draw_timecode_counter(container);
// Show the total time elapsed for the video preview (all parts intro, gameplay, extras)
if (show_timecode_total())
draw_timecode_total(container);
// draw the profiler if visible
if (show_profiler())
{
const char *text = g_profiler.text(machine());
draw_text_full(container, text, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
}
draw_profiler(container);
// if we're single-stepping, pause now
if (single_step())
@ -1575,7 +1612,7 @@ UINT32 mame_ui_manager::handler_confirm_quit(render_container *container)
ui_select_text,
ui_cancel_text);
draw_text_box(container, quit_message.c_str(), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
draw_text_box(container, quit_message.c_str(), ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
machine().pause();
// if the user press ENTER, quit the game

View File

@ -70,30 +70,6 @@ class menu_item;
/* cancel return value for a UI handler */
#define UI_HANDLER_CANCEL ((UINT32)~0)
/* justification options for ui_draw_text_full */
enum
{
JUSTIFY_LEFT = 0,
JUSTIFY_CENTER,
JUSTIFY_RIGHT
};
/* word wrapping options for ui_draw_text_full */
enum
{
WRAP_NEVER,
WRAP_TRUNCATE,
WRAP_WORD
};
/* drawing options for ui_draw_text_full */
enum
{
DRAW_NONE,
DRAW_NORMAL,
DRAW_OPAQUE
};
#define SLIDER_DEVICE_SPACING 0x0ff
#define SLIDER_SCREEN_SPACING 0x0f
#define SLIDER_INPUT_SPACING 0x0f
@ -167,6 +143,13 @@ enum ui_callback_type
class mame_ui_manager : public ui_manager, public slider_changed_notifier
{
public:
enum draw_mode
{
NONE,
NORMAL,
OPAQUE_
};
// construction/destruction
mame_ui_manager(running_machine &machine);
@ -222,8 +205,9 @@ public:
void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor);
void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor);
void draw_text(render_container *container, const char *buf, float x, float y);
void draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f);
void draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor);
void draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f);
void draw_text_box(render_container *container, const char *text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor);
void draw_text_box(render_container *container, ui::text_layout &layout, float xpos, float ypos, rgb_t backcolor);
void draw_message_window(render_container *container, const char *text);
// load/save options to file
@ -248,6 +232,10 @@ public:
void increase_frameskip();
void decrease_frameskip();
void request_quit();
void draw_fps_counter(render_container *container);
void draw_timecode_counter(render_container *container);
void draw_timecode_total(render_container *container);
void draw_profiler(render_container *container);
// print the game info string into a buffer
std::string &game_info_astring(std::string &str);

View File

@ -21,6 +21,7 @@
const rgb_t rgb_t::black(0,0,0);
const rgb_t rgb_t::white(255,255,255);
const rgb_t rgb_t::transparent(0, 0, 0, 0);
// the colors below are commonly used screen colors
const rgb_t rgb_t::green(0, 255, 0);

View File

@ -80,6 +80,7 @@ public:
static const rgb_t white;
static const rgb_t green;
static const rgb_t amber;
static const rgb_t transparent;
private:
UINT32 m_data;

View File

@ -557,6 +557,7 @@ MACHINE_CONFIG_FRAGMENT( dcs2_audio_denver )
MCFG_CPU_ADD("denver", ADSP2181, XTAL_33_333MHz)
MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */
MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(dcs_audio_device,timer_enable_callback)) /* callback for timer fired */
MCFG_ADSP21XX_DMOVLAY_CB(WRITE32(dcs_audio_device, dmovlay_callback)) // callback for adsp 2181 dmovlay instruction
MCFG_CPU_PROGRAM_MAP(denver_program_map)
MCFG_CPU_DATA_MAP(denver_data_map)
MCFG_CPU_IO_MAP(denver_io_map)
@ -688,6 +689,8 @@ TIMER_CALLBACK_MEMBER( dcs_audio_device::dcs_reset )
/* rev 4: reset the Denver ASIC */
case 4:
m_dmovlay_val = 0;
dmovlay_remap_memory();
denver_reset();
break;
}
@ -752,6 +755,7 @@ void dcs_audio_device::dcs_register_state()
save_item(NAME(m_control_regs));
save_item(NAME(m_sounddata_bank));
save_item(NAME(m_dmovlay_val));
save_item(NAME(m_auto_ack));
save_item(NAME(m_latch_control));
@ -786,6 +790,9 @@ void dcs_audio_device::dcs_register_state()
if (m_rev == 2)
machine().save().register_postload(save_prepost_delegate(FUNC(dcs_audio_device::sdrc_remap_memory), this));
if (m_rev == 4)
machine().save().register_postload(save_prepost_delegate(FUNC(dcs_audio_device::dmovlay_remap_memory), this));
}
@ -958,8 +965,12 @@ void dcs2_audio_device::device_start()
/* supports both RAM and ROM variants */
if (m_dram_in_mb != 0)
{
m_sounddata = auto_alloc_array(machine(), UINT16, m_dram_in_mb << (20-1));
save_pointer(NAME(m_sounddata), m_dram_in_mb << (20-1));
UINT32 ramSize = m_dram_in_mb << (20 - 1);
// Add one extra bank for internal ram in ADSP 2181
if (m_rev == 4)
ramSize += soundbank_words;
m_sounddata = auto_alloc_array(machine(), UINT16, ramSize);
save_pointer(NAME(m_sounddata), ramSize);
m_sounddata_words = (m_dram_in_mb << 20) / 2;
}
else
@ -973,6 +984,7 @@ void dcs2_audio_device::device_start()
m_data_bank->configure_entries(0, m_sounddata_banks, m_sounddata, soundbank_words*2);
}
/* allocate memory for the SRAM */
m_sram = auto_alloc_array(machine(), UINT16, 0x8000*4/2);
@ -1330,7 +1342,7 @@ WRITE16_MEMBER( dcs_audio_device::dsio_w )
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
m_data_bank->set_entry(DSIO_DM_PG % m_sounddata_banks);
dmovlay_remap_memory();
break;
}
}
@ -1388,7 +1400,7 @@ WRITE16_MEMBER( dcs_audio_device::denver_w )
m_dmadac[chan] = subdevice<dmadac_sound_device>(buffer);
}
dmadac_enable(&m_dmadac[0], m_channels, enable);
if (m_channels < 6)
if (m_channels <= 6)
dmadac_enable(&m_dmadac[m_channels], 6 - m_channels, FALSE);
recompute_sample_rate();
}
@ -1399,7 +1411,6 @@ WRITE16_MEMBER( dcs_audio_device::denver_w )
dsio.reg[2] = data;
m_data_bank->set_entry(DENV_DM_PG % m_sounddata_banks);
break;
/* offset 3 controls FIFO reset */
case 3:
if (!m_fifo_reset_w.isnull())
@ -1460,6 +1471,32 @@ READ32_MEMBER( dcs_audio_device::dsio_idma_data_r )
return result;
}
void dcs_audio_device::dmovlay_remap_memory()
{
// Switch banks
// Internal ram is bank 0
int bankSel;
if (m_dmovlay_val == 0) {
bankSel = 0;
m_data_bank->set_entry(bankSel);
} else {
bankSel = 1 + (DSIO_DM_PG % m_sounddata_banks);
m_data_bank->set_entry(bankSel);
}
if (LOG_DCS_IO)
logerror("%s dmovlay_remap_memory: Switching data ram location bankSel = %i\n", machine().describe_context(), bankSel);
}
WRITE32_MEMBER(dcs_audio_device::dmovlay_callback)
{
// Do some checking first
if (data < 0 || data > 1) {
logerror("dmovlay_callback: Error! dmovlay called with value = %X\n", data);
} else {
m_dmovlay_val = data;
dmovlay_remap_memory();
}
}
/***************************************************************************
@ -1872,10 +1909,10 @@ WRITE16_MEMBER(dcs_audio_device:: adsp_control_w )
switch (offset)
{
case SYSCONTROL_REG:
/* bit 9 forces a reset */
if (data & 0x0200)
/* bit 9 forces a reset (not on 2181) */
if ((data & 0x0200) && !(m_rev == 3 || m_rev == 4))
{
logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", space.device().safe_pc());
logerror("%04X:Rebooting DCS due to SYSCONTROL write = %04X\n", space.device().safe_pc(), data);
m_cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
dcs_boot();
m_control_regs[SYSCONTROL_REG] = 0;
@ -1950,9 +1987,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::dcs_irq )
{
int count = m_size / (2*(m_incs ? m_incs : 1));
// sf2049se was having overflow issues with fixed size of 0x400 buffer (m_size==0xb40, count=0x5a0).
//INT16 buffer[0x400];
std::unique_ptr<INT16[]> buffer;
buffer = std::make_unique<INT16[]>(count);
INT16 buffer[0x800];
int i;
for (i = 0; i < count; i++)
@ -1962,7 +1997,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::dcs_irq )
}
if (m_channels)
dmadac_transfer(&m_dmadac[0], m_channels, 1, m_channels, count / m_channels, buffer.get());
dmadac_transfer(&m_dmadac[0], m_channels, 1, m_channels, count / m_channels, buffer);
}
/* check for wrapping */

View File

@ -47,6 +47,8 @@ public:
DECLARE_WRITE32_MEMBER( dsio_idma_addr_w );
DECLARE_WRITE32_MEMBER( dsio_idma_data_w );
DECLARE_READ32_MEMBER( dsio_idma_data_r );
void dmovlay_remap_memory();
WRITE32_MEMBER(dmovlay_callback);
// non public
void dcs_boot();
@ -202,6 +204,8 @@ protected:
UINT32 *m_internal_program_ram;
UINT32 *m_external_program_ram;
int m_dmovlay_val;
sdrc_state m_sdrc;
dsio_state m_dsio;
hle_transfer_state m_transfer;

View File

@ -456,7 +456,7 @@ void arcadia_state::machine_start()
switch (m_cart->get_type())
{
case ARCADIA_STD:
m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0xffff, read8_delegate(FUNC(arcadia_cart_slot_device::extra_rom),(arcadia_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x7fff, read8_delegate(FUNC(arcadia_cart_slot_device::extra_rom),(arcadia_cart_slot_device*)m_cart));
break;
case ARCADIA_GOLF:
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x4fff, read8_delegate(FUNC(arcadia_cart_slot_device::extra_rom),(arcadia_cart_slot_device*)m_cart));

View File

@ -863,7 +863,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( brixian_map, AS_PROGRAM, 8, arkanoid_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("protram")
AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("protram") AM_REGION("maincpu", 0xc000)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
AM_RANGE(0xd008, 0xd008) AM_WRITE(brixian_d008_w) /* gfx bank, flip screen etc. */

View File

@ -1044,7 +1044,7 @@ GAME( 1979, asteroid, 0, asteroid, asteroid, driver_device, 0,
GAME( 1979, asteroid2, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1979, asteroid1, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1979, asteroidb, asteroid, asteroid, asteroidb, asteroid_state, asteroidb, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, spcrocks, asteroid, asteroid, aerolitos, driver_device, 0, ROT0, "J.Estevez (Barcelona)", "Space Rocks (Spanish clone of Asteroids)", MACHINE_SUPPORTS_SAVE ) // Space Rocks seems to be a legit set. Cabinet registered to 'J.Estevez (Barcelona).
GAME( 1981, spcrocks, asteroid, asteroid, aerolitos, driver_device, 0, ROT0, "Atari (J.Estevez license)", "Space Rocks (Spanish clone of Asteroids)", MACHINE_SUPPORTS_SAVE ) // Space Rocks seems to be a legit set. Cabinet registered to 'J.Estevez (Barcelona).
GAME( 1980, aerolitos, asteroid, asteroid, aerolitos, driver_device, 0, ROT0, "bootleg (Rodmar Elec.)","Aerolitos (Spanish bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) // 'Aerolitos' appears on the cabinet, this was distributed in Spain, the Spanish text is different to that contained in the original version (corrected)
GAME( 1979, asterock, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Sidam)", "Asterock (Sidam bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
GAME( 1979, asterockv, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Videotron)", "Asterock (Videotron bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )

View File

@ -43,8 +43,7 @@
#include "machine/vrc4373.h"
#include "machine/pci9050.h"
#include "machine/pci-ide.h"
#include "includes/midzeus.h"
#include "includes/midzeus2.h"
#include "video/zeus2.h"
#include "machine/nvram.h"
#include "coreutil.h"
@ -62,19 +61,22 @@
// These need more verification
#define IOASIC_IRQ_SHIFT 0
#define GALILEO_IRQ_SHIFT 1
#define ZEUS_IRQ_SHIFT 2
#define PARALLEL_IRQ_SHIFT 3
#define UART0_SHIFT 4
#define UART1_SHIFT 5
#define ZEUS_IRQ_SHIFT 2
#define VBLANK_IRQ_SHIFT 7
#define GALILEO_IRQ_SHIFT 0
/* static interrupts */
#define GALILEO_IRQ_NUM MIPS3_IRQ0
#define VBLANK_IRQ_NUM MIPS3_IRQ3
#define IDE_IRQ_NUM MIPS3_IRQ4
#define LOG_RTC (1)
#define LOG_ZEUS (0)
#define LOG_RTC (0)
#define LOG_RED (0)
#define LOG_PORT (0)
#define LOG_IRQ (0)
class atlantis_state : public driver_device
{
@ -83,6 +85,8 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_zeus(*this, "zeus2"),
m_dcs(*this, "dcs"),
m_ioasic(*this, "ioasic"),
m_uart0(*this, "uart0"),
@ -95,14 +99,14 @@ public:
UINT32 screen_update_mwskins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<mips3_device> m_maincpu;
required_device<screen_device> m_screen;
//required_device<dcs2_audio_dsio_device> m_dcs;
//required_device<dcs2_audio_denver_device> m_dcs;
optional_device<palette_device> m_palette;
required_device<zeus2_device> m_zeus;
required_device<dcs_audio_device> m_dcs;
required_device<midway_ioasic_device> m_ioasic;
required_device<ns16550_device> m_uart0;
required_device<ns16550_device> m_uart1;
required_device<nvram_device> m_rtc;
UINT8 m_rtc_data[0x800];
UINT8 m_rtc_data[0x8000];
UINT32 m_last_offset;
READ8_MEMBER(cmos_r);
@ -110,6 +114,7 @@ public:
DECLARE_WRITE32_MEMBER(cmos_protect_w);
DECLARE_READ32_MEMBER(cmos_protect_r);
UINT32 m_cmos_write_enabled;
UINT32 m_serial_count;
DECLARE_READ32_MEMBER(status_leds_r);
DECLARE_WRITE32_MEMBER(status_leds_w);
@ -118,15 +123,6 @@ public:
DECLARE_WRITE32_MEMBER(asic_fifo_w);
DECLARE_WRITE32_MEMBER(dcs3_fifo_full_w);
DECLARE_WRITE32_MEMBER(zeus_w);
DECLARE_READ32_MEMBER(zeus_r);
UINT32 m_zeus_data[0x80];
READ8_MEMBER (red_r);
WRITE8_MEMBER(red_w);
UINT8 m_red_data[0x1000];
int m_red_count;
READ32_MEMBER (green_r);
WRITE32_MEMBER(green_w);
READ8_MEMBER (blue_r);
@ -142,6 +138,8 @@ public:
UINT8 board_ctrl[CTRL_SIZE];
void update_asic_irq();
DECLARE_WRITE_LINE_MEMBER(vblank_irq);
DECLARE_WRITE_LINE_MEMBER(zeus_irq);
DECLARE_WRITE_LINE_MEMBER(ide_irq);
DECLARE_WRITE_LINE_MEMBER(ioasic_irq);
@ -154,37 +152,6 @@ public:
UINT32 m_port_ctrl_reg[0x8];
};
READ8_MEMBER (atlantis_state::red_r)
{
UINT8 data = m_red_data[offset];
logerror("%06X: red_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data);
m_last_offset = offset | 0x10000;
return data;
}
WRITE8_MEMBER(atlantis_state::red_w)
{
COMBINE_DATA(&m_red_data[offset]);
switch (offset) {
case 0:
// User I/O 0 = Allow write to red[0]. Serial Write Enable?
if (m_user_io_state & 0x1) {
// Data written is shifted by 1 bit each time. Maybe a serial line output?
if (m_red_count == 0)
logerror("%06X: red_w start serial %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data);
m_red_count++;
if (m_red_count == 8)
m_red_count = 0;
break;
} // Fall through to default if not enabled
default:
logerror("%06X: red_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data);
break;
}
m_last_offset = offset | 0x10000;
}
READ32_MEMBER(atlantis_state::green_r)
{
// If not 0x80 cpu writes to 00e80000 = 0
@ -222,10 +189,12 @@ READ32_MEMBER(atlantis_state::board_ctrl_r)
if (1 && m_screen->vblank())
data |= 0x80;
if (m_last_offset != (newOffset | 0x40000))
logerror("%s:board_ctrl_r read from CTRL_STATUS offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_r read from CTRL_STATUS offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
default:
logerror("%s:board_ctrl_r read from offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_r read from offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
}
m_last_offset = newOffset | 0x40000;
@ -251,66 +220,70 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w)
m_dcs->reset_w(CLEAR_LINE);
}
}
logerror("%s:board_ctrl_w write to CTRL_POWER0 offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_w write to CTRL_POWER0 offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
case CTRL_POWER1:
// 0x1 VBlank clear?
// 0x1 VBlank clear?
if (changeData & 0x1) {
if ((data & 0x0001) == 0) {
//UINT32 status_bit = (1 << VBLANK_IRQ_SHIFT);
UINT32 status_bit = (1 << 7);
board_ctrl[CTRL_CAUSE] &= ~status_bit;
board_ctrl[CTRL_STATUS] &= ~status_bit;
update_asic_irq();
}
else {
}
}
logerror("%s:board_ctrl_w write to CTRL_POWER1 offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_w write to CTRL_POWER1 offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
case CTRL_GLOBAL_EN:
// Zero bit will clear cause
board_ctrl[CTRL_CAUSE] &= data;
update_asic_irq();
logerror("%s:board_ctrl_w write to CTRL_GLOBAL_EN offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_w write to CTRL_GLOBAL_EN offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
default:
logerror("%s:board_ctrl_w write to offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
if (LOG_IRQ)
logerror("%s:board_ctrl_w write to offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
}
}
WRITE32_MEMBER(atlantis_state::asic_fifo_w)
{
m_ioasic->fifo_w(data);
}
READ8_MEMBER(atlantis_state::cmos_r)
{
UINT8 result = m_rtc_data[offset];
switch (offset) {
case 0x7F9:
case 0x7FA:
case 0x7FB:
case 0x7FC:
case 0x7FD:
case 0x7FE:
case 0x7FF:
if ((m_rtc_data[0x7F8] & 0x40)==0) {
case 0x7FF9:
case 0x7FFA:
case 0x7FFB:
case 0x7FFC:
case 0x7FFD:
case 0x7FFE:
case 0x7FFF:
if ((m_rtc_data[0x7FF8] & 0x40)==0) {
system_time systime;
// get the current date/time from the core
machine().current_datetime(systime);
m_rtc_data[0x7F9] = dec_2_bcd(systime.local_time.second);
m_rtc_data[0x7FA] = dec_2_bcd(systime.local_time.minute);
m_rtc_data[0x7FB] = dec_2_bcd(systime.local_time.hour);
m_rtc_data[0x7FF9] = dec_2_bcd(systime.local_time.second);
m_rtc_data[0x7FFA] = dec_2_bcd(systime.local_time.minute);
m_rtc_data[0x7FFB] = dec_2_bcd(systime.local_time.hour);
m_rtc_data[0x7FC] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7);
m_rtc_data[0x7FD] = dec_2_bcd(systime.local_time.mday);
m_rtc_data[0x7FE] = dec_2_bcd(systime.local_time.month + 1);
m_rtc_data[0x7FF] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900
m_rtc_data[0x7FFC] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7);
m_rtc_data[0x7FFD] = dec_2_bcd(systime.local_time.mday);
m_rtc_data[0x7FFE] = dec_2_bcd(systime.local_time.month + 1);
m_rtc_data[0x7FFF] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900
result = m_rtc_data[offset];
}
break;
default:
if (LOG_RTC)
logerror("%s:RTC read from offset %04X = %08X m_rtc_data[0x7F8] %02X\n", machine().describe_context(), offset, result, m_rtc_data[0x7F8]);
logerror("%s:RTC read from offset %04X = %08X m_rtc_data[0x7FF8] %02X\n", machine().describe_context(), offset, result, m_rtc_data[0x7FF8]);
break;
}
return result;
@ -319,23 +292,31 @@ READ8_MEMBER(atlantis_state::cmos_r)
WRITE8_MEMBER(atlantis_state::cmos_w)
{
system_time systime;
if (m_cmos_write_enabled) {
// User I/O 0 = Allow write to cmos[0]. Serial Write Enable?
if (offset == 0 && (m_user_io_state & 0x1)) {
// Data written is shifted by 1 bit each time. Maybe a serial line output?
if (LOG_RTC && m_serial_count == 0)
logerror("%06X: cmos_w[0] start serial %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data);
m_serial_count++;
if (m_serial_count == 8)
m_serial_count = 0;
}
else if (m_cmos_write_enabled) {
COMBINE_DATA(&m_rtc_data[offset]);
m_cmos_write_enabled = FALSE;
switch (offset) {
case 0x7F8: // M48T02 time
case 0x7FF8: // M48T02 time
if (data & 0x40) {
// get the current date/time from the core
machine().current_datetime(systime);
m_rtc_data[0x7F9] = dec_2_bcd(systime.local_time.second);
m_rtc_data[0x7FA] = dec_2_bcd(systime.local_time.minute);
m_rtc_data[0x7FB] = dec_2_bcd(systime.local_time.hour);
m_rtc_data[0x7FF9] = dec_2_bcd(systime.local_time.second);
m_rtc_data[0x7FFA] = dec_2_bcd(systime.local_time.minute);
m_rtc_data[0x7FFB] = dec_2_bcd(systime.local_time.hour);
m_rtc_data[0x7FC] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7);
m_rtc_data[0x7FD] = dec_2_bcd(systime.local_time.mday);
m_rtc_data[0x7FE] = dec_2_bcd(systime.local_time.month + 1);
m_rtc_data[0x7FF] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900
m_rtc_data[0x7FFC] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7);
m_rtc_data[0x7FFD] = dec_2_bcd(systime.local_time.mday);
m_rtc_data[0x7FFE] = dec_2_bcd(systime.local_time.month + 1);
m_rtc_data[0x7FFF] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900
}
if (LOG_RTC)
logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset, data, mem_mask);
@ -396,42 +377,16 @@ WRITE32_MEMBER(atlantis_state::status_leds_w)
}
}
READ32_MEMBER(atlantis_state::zeus_r)
{
UINT32 result = m_zeus_data[offset];
switch (offset) {
case 0x1:
/* bit $000C0070 are tested in a loop until 0 */
/* bits $00080000 is tested in a loop until 0 */
/* bit $00000004 is tested for toggling; probably VBLANK */
// zeus is reset if 0x80 is read
//if (m_screen->vblank())
m_zeus_data[offset] = (m_zeus_data[offset] + 1) & 0xf;
break;
case 0x41:
// CPU resets map2, writes 0xffffffff here, and then expects this read
result &= 0x1fff03ff;
break;
}
if (LOG_ZEUS)
logerror("%s:zeus_r read from offset %04X = %08X & %08X\n", machine().describe_context(), offset, result, mem_mask);
return result;
}
WRITE32_MEMBER(atlantis_state::zeus_w)
{
COMBINE_DATA(&m_zeus_data[offset]);
if (LOG_ZEUS)
logerror("%s:zeus_w write to offset %04X = %08X & %08X\n", machine().describe_context(), offset, data, mem_mask);
m_last_offset = offset | 0x30000;
}
READ32_MEMBER(atlantis_state::cmos_protect_r)
{
return m_cmos_write_enabled;
}
WRITE32_MEMBER(atlantis_state::asic_fifo_w)
{
m_ioasic->fifo_w(data);
}
WRITE32_MEMBER(atlantis_state::dcs3_fifo_full_w)
{
m_ioasic->fifo_full_w(data);
@ -495,13 +450,49 @@ WRITE_LINE_MEMBER(atlantis_state::uart1_irq_callback)
logerror("atlantis_state::uart1_irq_callback state = %1x\n", state);
}
/*************************************
* Video interrupts
*************************************/
WRITE_LINE_MEMBER(atlantis_state::vblank_irq)
{
//logerror("%s: atlantis_state::vblank state = %i\n", machine().describe_context(), state);
if (1) {
if (state) {
board_ctrl[CTRL_STATUS] |= (1 << VBLANK_IRQ_SHIFT);
update_asic_irq();
}
else {
board_ctrl[CTRL_STATUS] &= ~(1 << VBLANK_IRQ_SHIFT);
board_ctrl[CTRL_CAUSE] &= ~(1 << VBLANK_IRQ_SHIFT);
update_asic_irq();
}
} else {
m_maincpu->set_input_line(VBLANK_IRQ_NUM, state);
}
}
WRITE_LINE_MEMBER(atlantis_state::zeus_irq)
{
//logerror("%s: atlantis_state::zeus_irq state = %i\n", machine().describe_context(), state);
if (state) {
board_ctrl[CTRL_STATUS] |= (1 << ZEUS_IRQ_SHIFT);
update_asic_irq();
}
else {
board_ctrl[CTRL_STATUS] &= ~(1 << ZEUS_IRQ_SHIFT);
board_ctrl[CTRL_CAUSE] &= ~(1 << ZEUS_IRQ_SHIFT);
update_asic_irq();
}
}
/*************************************
* IDE interrupts
*************************************/
WRITE_LINE_MEMBER(atlantis_state::ide_irq)
{
m_maincpu->set_input_line(IDE_IRQ_NUM, state);
logerror("%s: atlantis_state::ide_irq state = %i\n", machine().describe_context(), state);
if (LOG_IRQ)
logerror("%s: atlantis_state::ide_irq state = %i\n", machine().describe_context(), state);
}
/*************************************
@ -509,7 +500,8 @@ WRITE_LINE_MEMBER(atlantis_state::ide_irq)
*************************************/
WRITE_LINE_MEMBER(atlantis_state::ioasic_irq)
{
logerror("%s: atlantis_state::ioasic_irq state = %i\n", machine().describe_context(), state);
if (LOG_IRQ)
logerror("%s: atlantis_state::ioasic_irq state = %i\n", machine().describe_context(), state);
if (state) {
board_ctrl[CTRL_STATUS] |= (1 << IOASIC_IRQ_SHIFT);
update_asic_irq();
@ -535,13 +527,13 @@ void atlantis_state::update_asic_irq()
if (irqBits && !currState) {
m_maincpu->set_input_line(MIPS3_IRQ0 + irqIndex, ASSERT_LINE);
m_irq_state |= (1 << irqIndex);
if (1)
if (LOG_IRQ)
logerror("atlantis_state::update_asic_irq Asserting IRQ(%d) CAUSE = %02X\n", irqIndex, board_ctrl[CTRL_CAUSE]);
}
else if (!(causeBits) && currState) {
m_maincpu->set_input_line(MIPS3_IRQ0 + irqIndex, CLEAR_LINE);
m_irq_state &= ~(1 << irqIndex);
if (1)
if (LOG_IRQ)
logerror("atlantis_state::update_asic_irq Clearing IRQ(%d) CAUSE = %02X\n", irqIndex, board_ctrl[CTRL_CAUSE]);
}
}
@ -553,7 +545,8 @@ READ32_MEMBER(atlantis_state::port_ctrl_r)
{
UINT32 newOffset = offset >> 17;
UINT32 result = m_port_ctrl_reg[newOffset];
logerror("%s: port_ctrl_r newOffset = %02X data = %08X\n", machine().describe_context(), newOffset, result);
if (LOG_PORT)
logerror("%s: port_ctrl_r newOffset = %02X data = %08X\n", machine().describe_context(), newOffset, result);
return result;
}
@ -562,22 +555,24 @@ WRITE32_MEMBER(atlantis_state::port_ctrl_w)
UINT32 newOffset = offset >> 17;
COMBINE_DATA(&m_port_ctrl_reg[newOffset]);
switch (newOffset) {
//case 1:
// m_port_ctrl_reg[newOffset] = 0;
// if (!(data & 0x8))
// m_port_ctrl_reg[newOffset] = 0*3; // Row 0
// else if (!(data & 0x10))
// m_port_ctrl_reg[newOffset] = 1*3; // Row 1
// else if (!(data & 0x20))
// m_port_ctrl_reg[newOffset] = 2*3; // Row 2
// else if (!(data & 0x40))
// m_port_ctrl_reg[newOffset] = 3*3; // Row 3
// logerror("%s: port_ctrl_w Keypad Row Sel = %04X data = %08X\n", machine().describe_context(), m_port_ctrl_reg[newOffset], data);
// break;
default:
logerror("%s: port_ctrl_w write to offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
break;
//switch (newOffset) {
if (newOffset == 1) {
UINT32 bits = ioport("KEYPAD")->read();
m_port_ctrl_reg[2] = 0;
if (!(data & 0x8))
m_port_ctrl_reg[2] = bits & 7; // Row 0
else if (!(data & 0x10))
m_port_ctrl_reg[2] = (bits >> 4) & 7; // Row 1
else if (!(data & 0x20))
m_port_ctrl_reg[2] = (bits >> 8) & 7; // Row 2
else if (!(data & 0x40))
m_port_ctrl_reg[2] = (bits >> 12) & 7; // Row 3
if (LOG_PORT)
logerror("%s: port_ctrl_w Keypad Row Sel = %04X bits = %08X\n", machine().describe_context(), data, bits);
}
else {
if (LOG_PORT)
logerror("%s: port_ctrl_w write to offset %04X = %08X & %08X bus offset = %08X\n", machine().describe_context(), newOffset, data, mem_mask, offset);
}
}
@ -625,24 +620,17 @@ void atlantis_state::machine_reset()
m_dcs->reset_w(0);
m_user_io_state = 0;
m_cmos_write_enabled = FALSE;
memset(m_zeus_data, 0, sizeof(m_zeus_data));
m_red_count = 0;
m_serial_count = 0;
m_irq_state = 0;
memset(board_ctrl, 0, sizeof(board_ctrl));
memset(m_port_ctrl_reg, 0, sizeof(m_port_ctrl_reg));
}
/*************************************
*
* Main CPU memory handlers
*
* Address Maps
*************************************/
static ADDRESS_MAP_START( map0, AS_PROGRAM, 32, atlantis_state )
AM_RANGE(0x00000000, 0x00000fff) AM_READWRITE8(red_r, red_w, 0xff)
AM_RANGE(0x0001e000, 0x0001ffff) AM_READWRITE8(cmos_r, cmos_w, 0xff)
AM_RANGE(0x00000000, 0x0001ffff) AM_READWRITE8(cmos_r, cmos_w, 0xff)
AM_RANGE(0x00100000, 0x0010001f) AM_DEVREADWRITE8("uart0", ns16550_device, ins8250_r, ins8250_w, 0xff) // Serial UART0 (TL16C552 CS0)
AM_RANGE(0x00180000, 0x0018001f) AM_DEVREADWRITE8("uart1", ns16550_device, ins8250_r, ins8250_w, 0xff) // Serial UART1 (TL16C552 CS1)
//AM_RANGE(0x00200000, 0x0020001f) // Parallel UART (TL16C552 CS2)
@ -666,21 +654,20 @@ static ADDRESS_MAP_START( map1, AS_PROGRAM, 32, atlantis_state )
AM_RANGE(0x00000000, 0x0000003f) AM_DEVREADWRITE("ioasic", midway_ioasic_device, read, write)
// asic_fifo_w
// dcs3_fifo_full_w
//AM_RANGE(0x00200000, 0x00200003)
AM_RANGE(0x00200000, 0x00200003) AM_WRITE(dcs3_fifo_full_w)
AM_RANGE(0x00400000, 0x00400003) AM_DEVWRITE("dcs", dcs_audio_device, dsio_idma_addr_w)
AM_RANGE(0x00600000, 0x00600003) AM_DEVREADWRITE("dcs", dcs_audio_device, dsio_idma_data_r, dsio_idma_data_w)
//AM_RANGE(0x00800000, 0x00800003) AM_WRITE(dcs3_fifo_full_w)
//AM_RANGE(0x00800000, 0x00800003) AM_WRITE(asic_fifo_w)
//AM_RANGE(0x00800000, 0x00a00003) AM_READWRITE(port_ctrl_r, port_ctrl_w)
AM_RANGE(0x00800000, 0x00900003) AM_READWRITE(port_ctrl_r, port_ctrl_w)
//AM_RANGE(0x00800000, 0x00800003) // Written once = 0000fff8
//AM_RANGE(0x00880000, 0x00880003) // Initial write 0000fff0, follow by sequence ffef, ffdf, ffbf, fff7. Row Select?
//AM_RANGE(0x00900000, 0x00900003) // Read once before each sequence write to 0x00880000. Code checks bits 0,1,2. Keypad?
//AM_RANGE(0x00980000, 0x00980003) // Read / Write. Bytes written 0x8f, 0xcf. Code if read 0x1 then read 00a00000. POTs?
//AM_RANGE(0x00a00000, 0x00a00003)
ADDRESS_MAP_END
AM_RANGE(0x00980000, 0x00980003) AM_NOP // AM_WRITE(asic_fifo_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START(map2, AS_PROGRAM, 32, atlantis_state)
AM_RANGE(0x00000000, 0x000001ff) AM_READWRITE(zeus_r, zeus_w)
AM_RANGE(0x00000000, 0x000001ff) AM_DEVREADWRITE("zeus2", zeus2_device, zeus2_r, zeus2_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( map3, AS_PROGRAM, 32, atlantis_state )
@ -696,26 +683,26 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( mwskins )
PORT_START("DIPS")
PORT_DIPNAME(0x0003, 0x0003, "Boot Mode")
PORT_DIPSETTING(0x0003, "Normal Boot")
PORT_DIPSETTING(0x0003, "Run Game")
PORT_DIPSETTING(0x0002, "Boot EEPROM Based Self Test")
PORT_DIPSETTING(0x0001, "Boot Disk Based Self Test")
PORT_DIPSETTING(0x0000, "Run Factory Tests")
PORT_DIPNAME(0x0004, 0x0004, "Unknown0004")
PORT_DIPSETTING(0x0004, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0008, 0x0008, "Unknown0008")
PORT_DIPNAME(0x0004, 0x0004, "Boot Message")
PORT_DIPSETTING(0x0004, "Quiet")
PORT_DIPSETTING(0x0000, "Squawk During Boot")
PORT_DIPNAME(0x0008, 0x0008, "Reserved")
PORT_DIPSETTING(0x0008, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0010, 0x0010, "Unknown0010")
PORT_DIPNAME(0x0010, 0x0010, "Reserved")
PORT_DIPSETTING(0x0010, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0020, 0x0020, "Unknown0020")
PORT_DIPNAME(0x0020, 0x0020, "Reserved")
PORT_DIPSETTING(0x0020, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0040, 0x0040, "Unknown0040")
PORT_DIPNAME(0x0040, 0x0040, "Reserved")
PORT_DIPSETTING(0x0040, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0080, 0x0080, "Unknown0080")
PORT_DIPNAME(0x0080, 0x0080, "Reserved")
PORT_DIPSETTING(0x0080, DEF_STR(Off))
PORT_DIPSETTING(0x0000, DEF_STR(On))
PORT_DIPNAME(0x0100, 0x0100, "Unknown0100")
@ -783,18 +770,18 @@ static INPUT_PORTS_START( mwskins )
PORT_BIT(0xffff, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("KEYPAD")
PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) /* keypad 3 */
PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) /* keypad 1 */
PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) /* keypad 2 */
PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) /* keypad 6 */
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) /* keypad 4 */
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) /* keypad 5 */
PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) /* keypad 9 */
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) /* keypad 7 */
PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) /* keypad 8 */
PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad #") PORT_CODE(KEYCODE_PLUS_PAD) /* keypad # */
PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad *") PORT_CODE(KEYCODE_MINUS_PAD) /* keypad * */
PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) /* keypad 0 */
PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) /* keypad 1 */
PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) /* keypad 2 */
PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) /* keypad 3 */
PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) /* keypad 4 */
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) /* keypad 5 */
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) /* keypad 6 */
PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) /* keypad 7 */
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) /* keypad 8 */
PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) /* keypad 9 */
PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad *") PORT_CODE(KEYCODE_MINUS_PAD) /* keypad - */
PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) /* keypad 0 */
PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SPECIAL) PORT_NAME("Keypad #") PORT_CODE(KEYCODE_PLUS_PAD) /* keypad + */
INPUT_PORTS_END
@ -830,21 +817,18 @@ static MACHINE_CONFIG_START( mwskins, atlantis_state )
MCFG_IDE_PCI_IRQ_HANDLER(DEVWRITELINE(":", atlantis_state, ide_irq))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(320, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
MCFG_SCREEN_UPDATE_DRIVER(atlantis_state, screen_update_mwskins)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("zeus2", ZEUS2, ZEUS2_VIDEO_CLOCK)
MCFG_ZEUS2_IRQ_CB(WRITELINE(atlantis_state, zeus_irq))
MCFG_ZEUS2_VBLANK_CB(WRITELINE(atlantis_state, vblank_irq))
MCFG_PALETTE_ADD_BBBBBGGGGGRRRRR("palette")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(ZEUS2_VIDEO_CLOCK / 8, 529, 0, 400, 278, 0, 256)
MCFG_SCREEN_UPDATE_DEVICE("zeus2", zeus2_device, screen_update)
/* sound hardware */
//MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DSIO, 0)
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(8)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
MCFG_DCS2_AUDIO_POLLING_OFFSET(0) /* no place to hook :-( */
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)

View File

@ -2195,7 +2195,7 @@ GAME( 1987, ddragon6809a,ddragon, ddragon6809, ddragon, ddragon_state, ddragon
GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2u, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2j, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump
GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "bootleg", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
/* these were conversions of double dragon */
GAME( 1991, tstrike, 0, darktowr, tstrike, ddragon_state, darktowr, ROT0, "East Coast Coin Company", "Thunder Strike (set 1)", MACHINE_SUPPORTS_SAVE ) // same manufacturer as The Game Room?

View File

@ -214,6 +214,7 @@ UINT32 dlair_state::screen_update_dleuro(screen_device &screen, bitmap_ind16 &bi
for (x = 0; x < 32; x++)
{
UINT8 *base = &videoram[y * 64 + x * 2 + 1];
// TODO: opaque?
m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, base[0], base[1], 0, 0, 10 * x, 16 * y);
}
@ -472,13 +473,13 @@ Address in ROM:
*
*************************************/
// TODO: DIPs still needs work
static INPUT_PORTS_START( dlair )
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:2,1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:1")
PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
// PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( Unused ) ) // TODO: kill me
PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_HIGH, "A:2")
PORT_DIPNAME( 0x04, 0x00, "Difficulty Mode" ) PORT_DIPLOCATION("A:3")
PORT_DIPSETTING( 0x04, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
@ -499,7 +500,7 @@ static INPUT_PORTS_START( dlair )
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, "Sound every 8 attracts" ) PORT_DIPLOCATION("B:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("B:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -549,9 +550,9 @@ static INPUT_PORTS_START( dlaire )
PORT_INCLUDE(dlair)
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x08, 0x08, "LD Player" ) /* In Rev F, F2 and so on... before it was Joystick Sound Feedback */
PORT_DIPSETTING( 0x00, "LD-PR7820" )
PORT_DIPSETTING( 0x08, "LDV-1000" )
PORT_DIPNAME( 0x08, 0x00, "LD Player" ) PORT_DIPLOCATION("B:3") /* In Rev F, F2 and so on... before it was Joystick Sound Feedback */
PORT_DIPSETTING( 0x08, "LD-PR7820" )
PORT_DIPSETTING( 0x00, "LDV-1000" )
INPUT_PORTS_END
@ -576,11 +577,10 @@ static INPUT_PORTS_START( dleuro )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_command_r, nullptr) /* command strobe */
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:2,1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:1")
PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
// PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( Unused ) )
PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_HIGH, "A:2")
PORT_DIPNAME( 0x04, 0x00, "Difficulty Mode" ) PORT_DIPLOCATION("A:3")
PORT_DIPSETTING( 0x04, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
@ -673,7 +673,7 @@ static INPUT_PORTS_START( spaceace )
INPUT_PORTS_END
// TODO: dips for Space Ace euro
// TODO: dips for Space Ace euro, different than NTSC
/*************************************
*
@ -802,7 +802,7 @@ ROM_START( dlair ) /* revision F2 */
ROM_LOAD( "dl_f2_u4.bin", 0x6000, 0x2000, CRC(f5ec23d2) SHA1(71149e2d359cc5944fbbb53dd7d0c2b42fbc9bb4) )
DISK_REGION( "ld_ldv1000" )
DISK_IMAGE_READONLY( "dlair", 0, NO_DUMP )
DISK_IMAGE_READONLY( "dlair", 0, SHA1(da70bac4fe526e48d556ad3fea72cde022c26648) )
ROM_END
ROM_START( dlair_1 ) /* Serial #001, courtesy Jason Finn */

View File

@ -7367,13 +7367,14 @@ static const gfx_layout super9_tilelayout = // Green is OK. Red needs normal go
128*8 /* every char takes 128 consecutive bytes */
};
static const gfx_layout flaming7_charlayout =
{
8,8, /* 8*8 characters */
4096, /* 4096 characters */
3, /* 3 bits per pixel */
{ 2, 4, 6 }, /* the bitplanes are packed in one byte */
{ 2*8+1, 2*8+0, 3*8+1, 3*8+0, 0*8+1, 0*8+0, 1*8+1, 1*8+0 },
{ 2*8+0, 2*8+1, 3*8+0, 3*8+1, 0*8+0, 0*8+1, 1*8+0, 1*8+1 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
32*8 /* every char takes 32 consecutive bytes */
};
@ -7386,9 +7387,9 @@ static const gfx_layout flaming7_tilelayout =
{ 0, 2, 4, 6 },
{ 2*8+0, 2*8+1, 3*8+0, 3*8+1, 0, 1, 1*8+0, 1*8+1 },
{ 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8,
32*8, 36*8, 40*8, 44*8, 48*8, 52*8, 56*8, 60*8,
64*8, 68*8, 72*8, 76*8, 80*8, 84*8, 88*8, 92*8,
96*8, 100*8, 104*8, 108*8, 112*8, 116*8, 120*8, 124*8 },
32*8, 36*8, 40*8, 44*8, 48*8, 52*8, 56*8, 60*8,
64*8, 68*8, 72*8, 76*8, 80*8, 84*8, 88*8, 92*8,
96*8, 100*8, 104*8, 108*8, 112*8, 116*8, 120*8, 124*8 },
128*8 /* every char takes 128 consecutive bytes */
};
@ -7496,9 +7497,9 @@ static GFXDECODE_START( super9 )
GFXDECODE_ENTRY( "gfx2", 0, super9_tilelayout, 128, 8 )
GFXDECODE_END
static GFXDECODE_START( flaming7 )
static GFXDECODE_START( flaming7 ) // still wrong... FIXME
GFXDECODE_ENTRY( "gfx1", 0, flaming7_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, flaming7_tilelayout, 128, 8 )
GFXDECODE_ENTRY( "gfx2", 0, flaming7_tilelayout, 104, 8 )
GFXDECODE_END
@ -14260,7 +14261,8 @@ ROM_START( fl7_50 ) // Serial 00000069A1C9.
/* Proper bipolar PROM dump */
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0200, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0100, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_CONTINUE( 0x0000, 0x0100) // palette data is stored in the second half.
ROM_REGION( 0x20, "proms2", 0 )
ROM_LOAD( "dummy", 0x0000, 0x0020, NO_DUMP )
@ -14291,7 +14293,8 @@ ROM_START( fl7_500 ) // Serial 000000125873.
/* Proper bipolar PROM dump */
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0200, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0100, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_CONTINUE( 0x0000, 0x0100) // palette data is stored in the second half.
ROM_REGION( 0x20, "proms2", 0 )
ROM_LOAD( "dummy", 0x0000, 0x0020, NO_DUMP )
@ -14322,7 +14325,8 @@ ROM_START( fl7_2000 ) // Serial 00000063A47F.
/* Proper bipolar PROM dump */
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0200, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_LOAD( "am27s29.u1", 0x0000, 0x0100, CRC(3fe7e369) SHA1(cf4ae287cb58581a4bf9e9ff1994426461fb38cc) )
ROM_CONTINUE( 0x0000, 0x0100) // palette data is stored in the second half.
ROM_REGION( 0x20, "proms2", 0 )
ROM_LOAD( "dummy", 0x0000, 0x0020, NO_DUMP )
@ -14477,7 +14481,7 @@ DRIVER_INIT_MEMBER(cb3_state, chrygld)
dump_to_file(ROM);
}
DRIVER_INIT_MEMBER(cmaster_state,cm)
DRIVER_INIT_MEMBER(cmaster_state, cm)
{
UINT8 *ROM = memregion("maincpu")->base();
@ -14499,7 +14503,7 @@ DRIVER_INIT_MEMBER(cmaster_state, cmv4)
ROM[0x020d] = 0x9b;
}
DRIVER_INIT_MEMBER(goldstar_state,cmast91)
DRIVER_INIT_MEMBER(goldstar_state, cmast91)
{
UINT8 *ROM = memregion("maincpu")->base();
@ -14980,6 +14984,31 @@ DRIVER_INIT_MEMBER(goldstar_state, wcherry)
}
}
/*
Flaming 7's
Cyberdyne Systems.
Original custom hardware graphics decryption.
*/
DRIVER_INIT_MEMBER(wingco_state, flaming7)
{
/* bank 1 graphics */
int i;
UINT8 *src = memregion("gfx1")->base();
for (i = 0; i < 0x20000; i++)
{
src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7); // OK
}
/* bank 2 graphics */
UINT8 *src2 = memregion("gfx2")->base();
for (i = 0; i < 0x8000; i++)
{
src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7); // OK
}
}
/*********************************************
* Game Drivers *
@ -15078,9 +15107,9 @@ GAMEL( 1993, bingownga, bingowng, bingownga,bingownga,driver_device, 0,
// --- Flaming 7's hardware (W-4 derivative) ---
GAME( 199?, fl7_3121, 0, flam7_w4, flaming7, driver_device, 0, ROT0, "Cyberdyne Systems", "Flaming 7 (W4 Hardware, Red, White & Blue 7's + Hollywood Nights)", 0 )
GAME( 199?, fl7_50, 0, flaming7, flaming7, driver_device, 0, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 50)", MACHINE_NOT_WORKING )
GAME( 199?, fl7_500, fl7_50, flaming7, flaming7, driver_device, 0, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 500)", MACHINE_NOT_WORKING )
GAME( 199?, fl7_2000, fl7_50, flaming7, flaming7, driver_device, 0, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 2000)", MACHINE_NOT_WORKING )
GAME( 199?, fl7_50, 0, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 50)", MACHINE_NOT_WORKING )
GAME( 199?, fl7_500, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 500)", MACHINE_NOT_WORKING )
GAME( 199?, fl7_2000, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 2000)", MACHINE_NOT_WORKING )
// --- Wing W-8 hardware ---

View File

@ -206,7 +206,6 @@ Video sync 6 F Video sync Post 6 F Post
#define CLIP_SKIP (VIS_MINY * SCREEN_WIDTH + VIS_MINX)
#define CLIP_W (VIS_MAXX - VIS_MINX + 1)
#define CLIP_H (VIS_MAXY - VIS_MINY + 1)
#define CLIP_BYTEW (CLIP_W << 1)
class halleys_state : public driver_device
@ -435,76 +434,69 @@ if (0) {
bank = ((code & BANKBIT0) | (color & BANKBIT1)) << 8;
pal_ptr = m_internal_palette.get();
// the crossroad of fate
if (code & BGLAYER || command & 7) goto COMMAND_MODE;
// reject off-screen objects
if (flags & MIRROR_Y) { flags |= FLIP_Y; y -= (h - 1); }
if (flags & MIRROR_X) { flags |= FLIP_X; x -= (w - 1); }
if (y > VIS_MAXY || (y + h) <= VIS_MINY) return;
if (x > VIS_MAXX || (x + w) <= VIS_MINX) return;
// clip objects against the visible area
yclip = y; xclip = x; hclip = h; wclip = w;
src_yskip = src_xskip = 0;
if (yclip < VIS_MINY) { src_yskip = VIS_MINY - yclip; yclip = VIS_MINY; hclip -= src_yskip; }
if (yclip + hclip > VIS_MAXY+1) { hclip = VIS_MAXY+1 - yclip; }
if (xclip < VIS_MINX) { src_xskip = VIS_MINX - xclip; xclip = VIS_MINX; wclip -= src_xskip; }
if (xclip + wclip > VIS_MAXX+1) { wclip = VIS_MAXX+1 - xclip; }
dst_skip = (yclip << SCREEN_WIDTH_L2) + xclip;
// adjust orientations
eax = 0;
if (flags & (S1_REV | S2_REV)) { flags ^= FLIP_Y | FLIP_X; eax -= w * h - 8; }
if (flags & FLIP_Y)
if (!(code & BGLAYER || command & 7))
{
eax += w * (h - 1);
src_yskip = -src_yskip;
src_dy = (flags & FLIP_X) ? -w + wclip : -w - wclip;
// reject off-screen objects
if (flags & MIRROR_Y) { flags |= FLIP_Y; y -= (h - 1); }
if (flags & MIRROR_X) { flags |= FLIP_X; x -= (w - 1); }
if (y > VIS_MAXY || (y + h) <= VIS_MINY) return;
if (x > VIS_MAXX || (x + w) <= VIS_MINX) return;
}
else src_dy = (flags & FLIP_X) ? w + wclip : w - wclip;
// clip objects against the visible area
yclip = y; xclip = x; hclip = h; wclip = w;
src_yskip = src_xskip = 0;
if (yclip < VIS_MINY) { src_yskip = VIS_MINY - yclip; yclip = VIS_MINY; hclip -= src_yskip; }
if (yclip + hclip > VIS_MAXY+1) { hclip = VIS_MAXY+1 - yclip; }
if (xclip < VIS_MINX) { src_xskip = VIS_MINX - xclip; xclip = VIS_MINX; wclip -= src_xskip; }
if (xclip + wclip > VIS_MAXX+1) { wclip = VIS_MAXX+1 - xclip; }
dst_skip = (yclip << SCREEN_WIDTH_L2) + xclip;
if (flags & FLIP_X)
{
eax += w - 1;
src_xskip = -src_xskip;
src_dx = -1;
}
else src_dx = 1;
// adjust orientations
eax = 0;
if (flags & (S1_REV | S2_REV)) { flags ^= FLIP_Y | FLIP_X; eax -= w * h - 8; }
if (flags & FLIP_Y)
{
eax += w * (h - 1);
src_yskip = -src_yskip;
src_dy = (flags & FLIP_X) ? -w + wclip : -w - wclip;
}
else src_dy = (flags & FLIP_X) ? w + wclip : w - wclip;
// calculate entry points and loop constants
src1_ptr = m_gfx_plane02 + ((bank + src1)<<3) + eax;
src2_ptr = m_gfx_plane13 + ((bank + src2)<<3) + eax;
if (flags & FLIP_X)
{
eax += w - 1;
src_xskip = -src_xskip;
src_dx = -1;
}
else src_dx = 1;
if (!(flags & (S1_IDLE | S2_IDLE)))
{
eax = src_yskip * w + src_xskip;
src1_ptr += eax;
src2_ptr += eax;
}
else src_dy = src_dx = 0;
// calculate entry points and loop constants
src1_ptr = m_gfx_plane02 + ((bank + src1)<<3) + eax;
src2_ptr = m_gfx_plane13 + ((bank + src2)<<3) + eax;
dst_ptr = m_render_layer[layer] + dst_skip;
if (!(flags & (S1_IDLE | S2_IDLE)))
{
eax = src_yskip * w + src_xskip;
src1_ptr += eax;
src2_ptr += eax;
}
else src_dy = src_dx = 0;
dst_ptr = m_render_layer[layer] + dst_skip;
// look up pen values and set rendering flags
pen0 = code>>3 & 0x10;
pen1 = 0;
if (command == EFX1) { flags |= BACKMODE; pen0 |= SP_2BACK; }
if (src1 == src2)
{
flags |= SINGLE_PEN;
eax = (UINT32)penxlat[color & PENCOLOR];
if (eax) pen1 = pen0 + eax;
}
else if (color & PENCOLOR) flags |= RGB_MASK;
// look up pen values and set rendering flags
pen0 = code>>3 & 0x10;
pen1 = 0;
if (command == EFX1) { flags |= BACKMODE; pen0 |= SP_2BACK; }
if (src1 == src2)
{
flags |= SINGLE_PEN;
eax = (UINT32)penxlat[color & PENCOLOR];
if (eax) pen1 = pen0 + eax;
}
else if (color & PENCOLOR) flags |= RGB_MASK;
//--------------------------------------------------------------------------
@ -518,224 +510,213 @@ if (0) {
//--------------------------------------------------------------------------
// multi-pen block or transparent blit
if ((flags & (SINGLE_PEN | RGB_MASK | COLOR_ON)) == COLOR_ON)
{
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
dst_ptr += wclip;
ecx = wclip = -wclip;
edx = src_dx;
if (flags & PPCD_ON) goto COLLISION_MODE;
al = ah = (UINT8)pen0;
if (!(flags & BACKMODE))
// multi-pen block or transparent blit
if ((flags & (SINGLE_PEN | RGB_MASK | COLOR_ON)) == COLOR_ON)
{
do {
do {
al |= *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al; al = ah;}
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
dst_ptr += wclip;
ecx = wclip = -wclip;
edx = src_dx;
if (!(flags & PPCD_ON))
{
al = ah = (UINT8)pen0;
if (!(flags & BACKMODE))
{
do {
do {
al |= *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al; al = ah;}
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (--hclip);
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (--hclip);
}
else
{
do {
do {
al |= *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_2BACK; al = ah; }
else
{
do {
do {
al |= *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_2BACK; al = ah; }
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (--hclip);
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
return;
}
while (--hclip);
}
return;
COLLISION_MODE:
ax = 0;
if (group)
{
do {
ax = 0;
if (group)
{
do {
al = *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_COLLD; } // set collision flag on group one pixels
do {
al = *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_COLLD; } // set collision flag on group one pixels
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
while (--hclip);
}
while (--hclip);
}
else
{
do {
else
{
do {
al = *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { ax |= dst_ptr[ecx]; dst_ptr[ecx] = (UINT16)al; } // combine collision flags in ax
do {
al = *src1_ptr;
src1_ptr += edx;
al |= *src2_ptr;
src2_ptr += edx;
if (al & 0xf) { ax |= dst_ptr[ecx]; dst_ptr[ecx] = (UINT16)al; } // combine collision flags in ax
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
while (--hclip);
}
while (--hclip);
}
// update collision list if object collided with the other group
if (status & ACTIVE && ax & SP_COLLD)
{
m_collision_list[m_collision_count & (MAX_SPRITES-1)] = offset;
m_collision_count++;
// update collision list if object collided with the other group
if (status & ACTIVE && ax & SP_COLLD)
{
m_collision_list[m_collision_count & (MAX_SPRITES-1)] = offset;
m_collision_count++;
#if HALLEYS_DEBUG
popmessage("ID:%02x CC:%3d", offset, m_collision_count);
#endif
}
} else
#if HALLEYS_DEBUG
popmessage("ID:%02x CC:%3d", offset, m_collision_count);
#endif
}
} else
//--------------------------------------------------------------------------
// multi-pen, RGB masked block or transparent blit
if ((flags & (RGB_MASK | COLOR_ON)) == RGB_MASK + COLOR_ON)
{
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
// multi-pen, RGB masked block or transparent blit
if ((flags & (RGB_MASK | COLOR_ON)) == RGB_MASK + COLOR_ON)
{
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
dst_ptr += wclip;
ecx = wclip = -wclip;
al = ah = (UINT8)pen0;
ebx = rgbmask[color & PENCOLOR] | 0xffffff00;
dst_ptr += wclip;
ecx = wclip = -wclip;
al = ah = (UINT8)pen0;
ebx = rgbmask[color & PENCOLOR] | 0xffffff00;
do {
do {
al |= *src1_ptr;
src1_ptr += src_dx;
al |= *src2_ptr;
src2_ptr += src_dx;
if (al & 0xf) { edx = (UINT32)al; al = ah; dst_ptr[ecx] = pal_ptr[edx] & ebx; }
do {
al |= *src1_ptr;
src1_ptr += src_dx;
al |= *src2_ptr;
src2_ptr += src_dx;
if (al & 0xf) { edx = (UINT32)al; al = ah; dst_ptr[ecx] = pal_ptr[edx] & ebx; }
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (++ecx);
ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH;
}
while (--hclip);
} else
while (--hclip);
} else
//--------------------------------------------------------------------------
// single-pen block or transparent blit
if ((flags & (SINGLE_PEN | COLOR_ON)) == SINGLE_PEN + COLOR_ON)
{
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
if ((flags & (SINGLE_PEN | COLOR_ON)) == SINGLE_PEN + COLOR_ON)
{
if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON
dst_ptr += wclip;
ebx = hclip;
ecx = wclip = -wclip;
edx = src_dx;
ax = (UINT16)pen1;
dst_ptr += wclip;
ebx = hclip;
ecx = wclip = -wclip;
edx = src_dx;
ax = (UINT16)pen1;
do {
do {
if (*src1_ptr) dst_ptr[ecx] = ax;
src1_ptr += edx;
}
while (++ecx);
do {
if (*src1_ptr) dst_ptr[ecx] = ax;
src1_ptr += edx;
}
while (++ecx);
ecx = wclip;
src1_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
}
while (--ebx);
} else
//--------------------------------------------------------------------------
// transparent wipe
if ((flags & (IGNORE_0 | COLOR_ON)) == IGNORE_0)
{
dst_ptr += wclip;
wclip = -wclip;
ecx = wclip;
src1_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
}
while (--ebx);
edx = src_dx;
} else
//--------------------------------------------------------------------------
// transparent wipe
if ((flags & (IGNORE_0 | COLOR_ON)) == IGNORE_0)
{
dst_ptr += wclip;
wclip = -wclip;
ecx = wclip;
edx = src_dx;
if (flags & PPCD_ON && !group)
{
// preserve collision flags when wiping group zero objects
do {
if (flags & PPCD_ON && !group)
{
// preserve collision flags when wiping group zero objects
do {
al = *src1_ptr;
ah = *src2_ptr;
src1_ptr += edx;
src2_ptr += edx;
if (al | ah) dst_ptr[ecx] &= SP_COLLD;
}
while (++ecx);
do {
al = *src1_ptr;
ah = *src2_ptr;
src1_ptr += edx;
src2_ptr += edx;
if (al | ah) dst_ptr[ecx] &= SP_COLLD;
}
while (++ecx);
ecx = wclip;
src1_ptr += src_dy;
src2_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
ecx = wclip;
src1_ptr += src_dy;
src2_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
}
while (--hclip);
}
while (--hclip);
}
else
{
do {
else
{
do {
al = *src1_ptr;
ah = *src2_ptr;
src1_ptr += edx;
src2_ptr += edx;
if (al | ah) dst_ptr[ecx] = 0;
do {
al = *src1_ptr;
ah = *src2_ptr;
src1_ptr += edx;
src2_ptr += edx;
if (al | ah) dst_ptr[ecx] = 0;
}
while (++ecx);
ecx = wclip;
src1_ptr += src_dy;
src2_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
}
while (++ecx);
ecx = wclip;
src1_ptr += src_dy;
src2_ptr += src_dy;
dst_ptr += SCREEN_WIDTH;
while (--hclip);
}
while (--hclip);
}
} else
} else
//--------------------------------------------------------------------------
// block wipe
if ((flags & (IGNORE_0 | COLOR_ON)) == 0) BLOCK_WIPE_COMMON
// block wipe
if ((flags & (IGNORE_0 | COLOR_ON)) == 0) BLOCK_WIPE_COMMON
//--------------------------------------------------------------------------
// End of Standard Mode
return;
// End of Standard Mode
return;
//--------------------------------------------------------------------------
COMMAND_MODE:
}
#define GFX_HI 0x10000
// reject illegal blits and adjust parameters
if (command)
{
@ -1302,205 +1283,140 @@ void halleys_state::video_start()
void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy)
{
//--------------------------------------------------------------------------
#define OPCOPY_COMMON { \
memcpy(edi, esi+sx, rcw); \
memcpy((UINT8*)edi+rcw, esi, CLIP_BYTEW-rcw); \
esi += SCREEN_WIDTH; \
edi += edx; }
//--------------------------------------------------------------------------
UINT16 *esi, *edi;
int rcw, bch, ecx, edx;
sx = -sx & 0xff;
sy = -sy & 0xff;
if ((rcw = CLIP_W - sx) < 0) rcw = 0; else rcw <<= 1;
if ((bch = CLIP_H - sy) < 0) bch = 0;
int rcw = CLIP_W - sx;
if (rcw < 0)
rcw = 0;
esi = source + CLIP_SKIP + (sy << SCREEN_WIDTH_L2);
edi = &bitmap.pix16(VIS_MINY, VIS_MINX);
edx = bitmap.rowpixels();
int bch = CLIP_H - sy;
if (bch < 0)
bch = 0;
const UINT16 *src = source + CLIP_SKIP + sy * SCREEN_WIDTH;
// draw top split
for (ecx=bch; ecx; ecx--) OPCOPY_COMMON
for (int y=0; y != bch; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
memcpy(dest, src+sx, 2*rcw);
memcpy(dest + rcw, src, 2*(CLIP_W - rcw));
src += SCREEN_WIDTH;
}
esi = source + CLIP_SKIP;
src = source + CLIP_SKIP;
// draw bottom split
for (ecx=CLIP_H-bch; ecx; ecx--) OPCOPY_COMMON
#undef OPCOPY_COMMON
for (int y = bch; y != CLIP_H; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
memcpy(dest, src+sx, 2*rcw);
memcpy(dest + rcw, src, 2*(CLIP_W - rcw));
src += SCREEN_WIDTH;
}
}
void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy)
{
//--------------------------------------------------------------------------
#define XCOPY_COMMON \
if (ecx) { \
if (ecx & 1) { ecx--; ax = *esi; esi++; if (ax) *edi = ax; edi++; } \
esi += ecx; edi += ecx; ecx = -ecx; \
while (ecx) { \
ax = esi[ecx]; \
bx = esi[ecx+1]; \
if (ax) edi[ecx] = ax; \
if (bx) edi[ecx+1] = bx; \
ecx += 2; \
} \
}
//--------------------------------------------------------------------------
#define YCOPY_COMMON { \
esi = src_base + sx; ecx = rcw; XCOPY_COMMON \
esi = src_base; ecx = CLIP_W - rcw; XCOPY_COMMON \
src_base += SCREEN_WIDTH; \
edi += dst_adv; \
}
//--------------------------------------------------------------------------
int rcw, bch, dst_adv;
UINT16 *src_base, *esi, *edi;
int ecx, edx;
UINT16 ax, bx;
sx = -sx & 0xff;
sy = -sy & 0xff;
if ((rcw = CLIP_W - sx) < 0) rcw = 0;
if ((bch = CLIP_H - sy) < 0) bch = 0;
int rcw = CLIP_W - sx;
if (rcw < 0)
rcw = 0;
src_base = source + CLIP_SKIP + (sy << SCREEN_WIDTH_L2);
edi = &bitmap.pix16(VIS_MINY, VIS_MINX);
dst_adv = bitmap.rowpixels() - CLIP_W;
int bch = CLIP_H - sy;
if (bch < 0)
bch = 0;
const UINT16 *src_base = source + CLIP_SKIP + sy * SCREEN_WIDTH;
// draw top split
for (edx=bch; edx; edx--) YCOPY_COMMON
for (int y=0; y != bch; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
const UINT16 *src = src_base + sx;
for(int x=0; x != rcw; x++) {
UINT16 pixel = *src++;
if(pixel)
*dest = pixel;
dest++;
}
src = src_base;
for(int x=rcw; x != CLIP_W; x++) {
UINT16 pixel = *src++;
if(pixel)
*dest = pixel;
dest++;
}
src_base += SCREEN_WIDTH;
}
src_base = source + CLIP_SKIP;
// draw bottom split
for (edx=CLIP_H-bch; edx; edx--) YCOPY_COMMON
for (int y = bch; y != CLIP_H; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
const UINT16 *src = src_base + sx;
for(int x=0; x != rcw; x++) {
UINT16 pixel = *src++;
if(pixel)
*dest = pixel;
dest++;
}
#undef XCOPY_COMMON
#undef YCOPY_COMMON
src = src_base;
for(int x=rcw; x != CLIP_W; x++) {
UINT16 pixel = *src++;
if(pixel)
*dest = pixel;
dest++;
}
src_base += SCREEN_WIDTH;
}
}
void halleys_state::copy_fixed_xp(bitmap_ind16 &bitmap, UINT16 *source)
{
UINT16 *esi, *edi;
int dst_pitch, ecx, edx;
UINT16 ax, bx;
UINT16 *src = source + CLIP_SKIP;
for(int y=0; y != CLIP_H; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
for(int x=0; x != CLIP_W; x++) {
UINT16 pixel = src[x];
esi = source + CLIP_SKIP + CLIP_W;
edi = &bitmap.pix16(VIS_MINY, VIS_MINX + CLIP_W);
dst_pitch = bitmap.rowpixels();
ecx = -CLIP_W;
edx = CLIP_H;
do {
do {
ax = esi[ecx];
bx = esi[ecx+1];
if (ax) edi[ecx ] = ax;
ax = esi[ecx+2];
if (bx) edi[ecx+1] = bx;
bx = esi[ecx+3];
if (ax) edi[ecx+2] = ax;
ax = esi[ecx+4];
if (bx) edi[ecx+3] = bx;
bx = esi[ecx+5];
if (ax) edi[ecx+4] = ax;
ax = esi[ecx+6];
if (bx) edi[ecx+5] = bx;
bx = esi[ecx+7];
if (ax) edi[ecx+6] = ax;
if (bx) edi[ecx+7] = bx;
if (pixel)
dest[x] = pixel;
}
while (ecx += 8);
ecx = -CLIP_W;
esi += SCREEN_WIDTH;
edi += dst_pitch;
src += SCREEN_WIDTH;
}
while (--edx);
}
void halleys_state::copy_fixed_2b(bitmap_ind16 &bitmap, UINT16 *source)
{
UINT16 *esi, *edi;
int dst_pitch, ecx, edx;
UINT16 ax, bx;
UINT16 *src = source + CLIP_SKIP;
for(int y=0; y != CLIP_H; y++) {
UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX);
for(int x=0; x != CLIP_W; x++) {
UINT16 pixel = src[x];
esi = source + CLIP_SKIP + CLIP_W;
edi = &bitmap.pix16(VIS_MINY, VIS_MINX + CLIP_W);
dst_pitch = bitmap.rowpixels();
ecx = -CLIP_W;
edx = CLIP_H;
do {
do {
ax = esi[ecx];
bx = esi[ecx+1];
if (!(ax)) goto SKIP0;
if (!(ax&SP_2BACK)) goto DRAW0;
if (edi[ecx ]) goto SKIP0;
DRAW0: edi[ecx ] = ax; SKIP0: ax = esi[ecx+2];
if (!(bx)) goto SKIP1;
if (!(bx&SP_2BACK)) goto DRAW1;
if (edi[ecx+1]) goto SKIP1;
DRAW1: edi[ecx+1] = bx; SKIP1: bx = esi[ecx+3];
if (!(ax)) goto SKIP2;
if (!(ax&SP_2BACK)) goto DRAW2;
if (edi[ecx+2]) goto SKIP2;
DRAW2: edi[ecx+2] = ax; SKIP2: ax = esi[ecx+4];
if (!(bx)) goto SKIP3;
if (!(bx&SP_2BACK)) goto DRAW3;
if (edi[ecx+3]) goto SKIP3;
DRAW3: edi[ecx+3] = bx; SKIP3: bx = esi[ecx+5];
if (!(ax)) goto SKIP4;
if (!(ax&SP_2BACK)) goto DRAW4;
if (edi[ecx+4]) goto SKIP4;
DRAW4: edi[ecx+4] = ax; SKIP4: ax = esi[ecx+6];
if (!(bx)) goto SKIP5;
if (!(bx&SP_2BACK)) goto DRAW5;
if (edi[ecx+5]) goto SKIP5;
DRAW5: edi[ecx+5] = bx; SKIP5: bx = esi[ecx+7];
if (!(ax)) goto SKIP6;
if (!(ax&SP_2BACK)) goto DRAW6;
if (edi[ecx+6]) goto SKIP6;
DRAW6: edi[ecx+6] = ax; SKIP6:
if (!(bx)) continue;
if (!(bx&SP_2BACK)) goto DRAW7;
if (edi[ecx+7]) continue;
DRAW7: edi[ecx+7] = bx;
if ((pixel && !(pixel & SP_2BACK)) || !dest[x])
dest[x] = pixel;
}
while (ecx += 8);
ecx = -CLIP_W;
esi += SCREEN_WIDTH;
edi += dst_pitch;
src += SCREEN_WIDTH;
}
while (--edx);
}
void halleys_state::filter_bitmap(bitmap_ind16 &bitmap, int mask)
{
return;
int dst_pitch;
UINT32 *pal_ptr, *edi;

View File

@ -1590,4 +1590,4 @@ GAME( 1985, striv, 0, striv, striv, jack_state, striv, ROT27
GAME( 1983, joinem, 0, joinem, joinem, jack_state, zzyzzyxx, ROT90, "Global Corporation", "Joinem", MACHINE_SUPPORTS_SAVE )
GAME( 1983, unclepoo, 0, unclepoo, unclepoo, jack_state, zzyzzyxx, ROT90, "Diatec", "Uncle Poo", MACHINE_SUPPORTS_SAVE ) // based on Joinem?
GAME( 1983, loverboy, 0, joinem, loverboy, jack_state, loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", MACHINE_SUPPORTS_SAVE )
GAME( 1993, trikitri, loverboy, joinem, loverboy, jack_state, loverboy, ROT90, "DDT Enterprise Inc", "Triki Triki (Lover Boy bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, trikitri, loverboy, joinem, loverboy, jack_state, loverboy, ROT90, "bootleg (DDT Enterprise Inc)", "Triki Triki (Lover Boy bootleg)", MACHINE_SUPPORTS_SAVE )

View File

@ -77,18 +77,28 @@ Game Dongle Sticker printed on PIC
2 Spicy 253-5508-0491 317-0491-COM ^DVP-0027A
After Burner Climax (EXPORT) 253-5508-0440A ^317-0440-COM DVP-0009
After Burner Climax CE ? ? DVP-0031A
Ami-Gyo ? ? ?
Answer X Answer 253-5508-0618J 317-0618-JPN ?
After Burner Climax SDX (rev A) ? ? DVP-0018A
Ami-Gyo (rev C) ? ? DVP-0007C
Ami-Gyo ? ? DVP-0028
Answer X Answer 253-5508-0618J 317-0618-JPN DVP-0025H ???
Answer X Answer 1.1 ? ? ?
Answer X Answer DX ? ? ?
Answer X Answer Premium ? ? ?
Answer X Answer 2 ? ? DVP-0067
Atractive Deck Poker (rev C) ? ? DVP-0033C
Cloud Nine (rev E) ? ? DVP-0034E
Club Majesty Extend ? ? ?
Club Majesty Formal ? ? ?
Cosmic Challenge ? ? DVP-0032
Cosmic Challenge (rev C) ? ? DVP-0032C
Derby Owners Club 2008: Feel the Rush ? ? DVP-0047A
Derby Owners Club 2008: Feel the Rush ? ? DVP-5006C
Derby Owners Club 2008: Feel the Rush V2.0 ? ? ?
Derby Owners Club 2009: Ride For the Life ? ? DVP-5014
Ghost Squad Evolution ? ? ^DVP-0029A
Harley Davidson: King of the Road ? ? ?
Hummer Extreme 253-5508-???? ^317-????-COM ?
Hummer ? ? DVP-0057B
Hummer Extreme 253-5508-???? ^317-????-COM DVP-0079 ???
Initial D Arcade Stage 4 253-5508-0620 317-0620-COM DVP-0019
Initial D Arcade Stage 4 (rev A) 253-5508-0620 317-0620-COM DVP-0019A
Initial D Arcade Stage 4 (rev B) 253-5508-0620 317-0620-COM DVP-0019B
@ -99,34 +109,51 @@ Initial D4 253-5508-0486E 317-0486-COM
Initial D4 (rev B) 253-5508-0486E 317-0486-COM DVP-0030B
Initial D4 (rev C) 253-5508-0486E 317-0486-COM ^DVP-0030C
Initial D4 (rev D) 253-5508-0486E 317-0486-COM ^DVP-0030D
Initial D Arcade Stage 5 ? ? ?
Initial D Arcade Stage 5 (rev A) ? ? DVP-0070A
Initial D Arcade Stage 5 EXP 2.0 ? ? DVP-0075
INFO STATION 2 (rev C) ? ? DVP-0050C
Let's Go Jungle (EXPORT) 253-5508-0442 317-0442-COM DVP-0011
MJ4 ? ? ?
Let's Go Jungle Special (rev A) ? ? DVP-0036A
MJ4 (rev F) ? ? DVP-0049F
MJ4 Evolution ? ? DVP-0081
OutRun 2 Special Tours (EXPORT) 253-5508-0452 317-0452-COM ?
OutRun 2 SP SDX ? ? DVP-0015A
Primeval Hunt 253-5508-0512 317-0512-COM ^DVP-0048A
R-Tuned: Ultimate Street Racing ? ? DVP-0060
Rambo (EXPORT) 253-5508-0540 ^317-0540-COM ^DVP-0069
SEGA Network Casino Club Ver. 2 ? ? DVP-0053
SEGA Network Casino Club Ver. 2 (rev B) ? ? DVP-0053B
SEGA Network Taisen Mahjong MJ4 (rev A) ? ? DVP-0049A
SEGA Network Taisen Mahjong MJ4 (rev F) ? ? DVP-0049F
SEGA Network Taisen Mahjong MJ4 (rev G) ? ? DVP-0049G
SEGA-Race TV (EXPORT) 253-5508-0504 ^317-0504-COM ^DVP-0044
StarHorse 2: New Generation (rev J) ? ? DVP-0001J
StarHorse 2: Second Fusion (rev E) ? ? DVP-0024E
StarHorse 2: Third Evolution (rev G) ? ? DVP-0046G
StarHorse 2: Third Evolution (rev D) ? ? DVP-0054D
StarHorse 2: Fifth Expansion (rev D) ? ? DVP-0082D
StarHorse 2: Fifth Expansion (rev E) ? ? DVP-0082E
The House Of The Dead 4 (EXPORT) (rev A) 253-5508-0427 ^317-0427-COM ^DVP-0003A
The House Of The Dead 4 (EXPORT) (rev B) ? ? DVP-0003B
The House Of The Dead EX (JAPAN) 253-5508-0550 ^317-0550-JPN ?
The House Of the Dead 4 Special ? ? ?
The House Of The Dead EX (JAPAN) 253-5508-0550 ^317-0550-JPN DVP-0063
The House Of the Dead 4 Special (rev B) ? ? DVP-0010B
Router Update [For VTF] ? ? DVP-0026
VBIOS Update ? ? ^DVP-0021B
VBIOS Update [For VTF] ? ? DVP-0023A
Virtua Fighter 5 (EXPORT) 253-5508-0438 317-0438-COM DVP-0008E
VBIOS Update [For VTF] ? ? DVP-0023C
Virtua Fighter 5 ? ? DVP-00043
Virtua Fighter 5 R (rev D) ? ? DVP-5004D
Virtua Fighter 5 (EXPORT) (rev A) 253-5508-0438 317-0438-COM DVP-0008A
Virtua Fighter 5 (EXPORT) (rev B) 253-5508-0438 317-0438-COM DVP-0008B
Virtua Fighter 5 (EXPORT) (rev E) 253-5508-0438 317-0438-COM DVP-0008E
Virtua Tennis 3 (Power Smash 3) ? ? DVP-0005
Virtua Tennis 3 (Power Smash 3) (EXPORT) 253-5508-0434 ^317-0434-COM DVP-0005A
Virtua Tennis 3 (JAPAN) 253-5508-0506 317-0506-JPN ^DVP-0005C
WCC Football Intercontinental Clubs 2006-2007 ? ? ?
WCC Football Intercontinental Clubs 2007-2008 ? ? ?
WCC Football Intercontinental Clubs 2008-2009 ? ? ?
WCC Football Intercontinental Clubs 2008-2009 ? ? DVP-5012
WCC Football Intercontinental Clubs 2009-2010 ? ? ?
Wheel Maniacs (rev D) ? ? DVP-0035D
^ denotes these parts are archived.
This list is not necessarily correct or complete.

View File

@ -458,4 +458,4 @@ DRIVER_INIT_MEMBER(metlfrzr_state, metlfrzr)
GAME( 1989, metlfrzr, 0, metlfrzr, metlfrzr, metlfrzr_state, metlfrzr, ROT270, "Seibu", "Metal Freezer (Japan)", MACHINE_NO_COCKTAIL )
GAME( 1989, metlfrzr, 0, metlfrzr, metlfrzr, metlfrzr_state, metlfrzr, ROT270, "Seibu Kaihatsu", "Metal Freezer (Japan)", MACHINE_NO_COCKTAIL )

View File

@ -37,6 +37,7 @@ The Grid v1.2 10/18/2000
#include "machine/nvram.h"
#include "crusnexo.lh"
#include "video/zeus2.h"
#define CPU_CLOCK XTAL_60MHz
@ -114,6 +115,10 @@ INTERRUPT_GEN_MEMBER(midzeus_state::display_irq)
machine().scheduler().timer_set(attotime::from_hz(30000000), timer_expired_delegate(FUNC(midzeus_state::display_irq_off),this));
}
WRITE_LINE_MEMBER(midzeus2_state::zeus_irq)
{
m_maincpu->set_input_line(2, ASSERT_LINE);
}
/*************************************
@ -575,7 +580,7 @@ static ADDRESS_MAP_START( zeus2_map, AS_PROGRAM, 32, midzeus2_state )
AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE("ram_base")
AM_RANGE(0x400000, 0x43ffff) AM_RAM
AM_RANGE(0x808000, 0x80807f) AM_READWRITE(tms32031_control_r, tms32031_control_w) AM_SHARE("tms32031_ctl")
AM_RANGE(0x880000, 0x88007f) AM_READWRITE(zeus2_r, zeus2_w) AM_SHARE("zeusbase")
AM_RANGE(0x880000, 0x88007f) AM_DEVREADWRITE("zeus2", zeus2_device, zeus2_r, zeus2_w)
AM_RANGE(0x8a0000, 0x8a003f) AM_READWRITE(linkram_r, linkram_w) AM_SHARE("linkram")
AM_RANGE(0x8d0000, 0x8d000a) AM_READWRITE(bitlatches_r, bitlatches_w)
AM_RANGE(0x900000, 0x91ffff) AM_READWRITE(zpram_r, zpram_w) AM_SHARE("nvram") AM_MIRROR(0x020000)
@ -1134,7 +1139,7 @@ static MACHINE_CONFIG_START( midzeus2, midzeus2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", TMS32032, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(zeus2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", midzeus2_state, display_irq)
MCFG_CPU_VBLANK_INT_DRIVER("screen", midzeus2_state, display_irq)
MCFG_MACHINE_START_OVERRIDE(midzeus2_state,midzeus)
MCFG_MACHINE_RESET_OVERRIDE(midzeus2_state,midzeus)
@ -1143,9 +1148,10 @@ static MACHINE_CONFIG_START( midzeus2, midzeus2_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MIDZEUS_VIDEO_CLOCK/4, 666, 0, 512, 438, 0, 400)
MCFG_SCREEN_UPDATE_DRIVER(midzeus2_state, screen_update_midzeus2)
MCFG_SCREEN_UPDATE_DEVICE("zeus2", zeus2_device, screen_update)
MCFG_VIDEO_START_OVERRIDE(midzeus2_state,midzeus2)
MCFG_DEVICE_ADD("zeus2", ZEUS2, ZEUS2_VIDEO_CLOCK)
MCFG_ZEUS2_IRQ_CB(WRITELINE(midzeus2_state, zeus_irq))
/* sound hardware */
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0)

View File

@ -6532,6 +6532,7 @@ ROM_START( numcrash )
ROM_LOAD( "nc-6.6m", 0x1800, 0x0800, CRC(7b8de692) SHA1(7d5fe625ee9acf3cced2d98df99f5dee6c8122b1) )
ROM_LOAD( "nc-3.6h", 0x2000, 0x0800, CRC(e47f7cf3) SHA1(47e513cf4fe80617547093210ca6582646a9b256) )
/* 0x2800 - 0x2fff unpopulated? would usually be 6n */
/* at offset 0x4ce bit 7 reads inconsistently, the EPROM itself might be bad :( */
ROM_LOAD( "nc-4.6j", 0x3000, 0x0800, CRC(c67450d2) SHA1(b940093c979795d0de4b203200c3f824d5d9ac7f) )
/* 0x3800 - 0x3fff unpopulated? would usually be 6p */

View File

@ -1,16 +1,22 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
/*
Unknown game, dump was marked 'slot 72 - poker'
// copyright-holders:David Haywood, Robbbert
/************************************************************************************************
Poker Monarch
GFX roms contain
'Extrema Systems International Ltd'
as well as a logo for the company.
There are also 'Lucky Boy' graphics in various places, which might be the title.
There are also 'Lucky Boy' graphics in various places.
* Turn on all the dips of SW1
* Restart game
* If it says ERROR OF RAM GAME STOP, press F2
* When you get a blank blue screen Press Alt+2
* This gives a setup screen. Press F2 to see cards and logo (and it beeps)
* Depending on settings of SW1, you can get other cards, or other test screens.
*/
*************************************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
@ -89,17 +95,15 @@ WRITE8_MEMBER(poker72_state::poker72_paletteram_w)
WRITE8_MEMBER(poker72_state::output_w)
{
UINT8 *ROM = memregion("maincpu")->base();
printf("%02x\n",data);
/* if((data & 0xc) == 0xc)
membank("bank1")->set_base(&ROM[0x10000]);
membank("bank1")->set_entry(2);
else*/
if(data & 8)
membank("bank1")->set_base(&ROM[0x08000]);
membank("bank1")->set_entry(1);
else
membank("bank1")->set_base(&ROM[0x00000]);
membank("bank1")->set_entry(0);
}
WRITE8_MEMBER(poker72_state::tile_bank_w)
@ -108,17 +112,17 @@ WRITE8_MEMBER(poker72_state::tile_bank_w)
}
static ADDRESS_MAP_START( poker72_map, AS_PROGRAM, 8, poker72_state )
AM_RANGE(0x0000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0xc000, 0xdfff) AM_RAM //work ram
AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("vram")
AM_RANGE(0xf000, 0xfbff) AM_RAM_WRITE(poker72_paletteram_w) AM_SHARE("pal")
AM_RANGE(0xfc00, 0xfdff) AM_RAM //???
AM_RANGE(0xfe08, 0xfe08) AM_READ_PORT("IN0")
AM_RANGE(0xfe08, 0xfe08) AM_READ_PORT("SW1")
AM_RANGE(0xfe09, 0xfe09) AM_READ_PORT("IN1")
AM_RANGE(0xfe0a, 0xfe0a) AM_READ_PORT("IN2")
AM_RANGE(0xfe0c, 0xfe0c) AM_READ_PORT("IN3")
AM_RANGE(0xfe0d, 0xfe0d) AM_READ_PORT("IN4")
AM_RANGE(0xfe0e, 0xfe0e) AM_READ_PORT("IN5")
AM_RANGE(0xfe0c, 0xfe0c) AM_READ_PORT("SW4")
AM_RANGE(0xfe0d, 0xfe0d) AM_READ_PORT("SW5")
AM_RANGE(0xfe0e, 0xfe0e) AM_READ_PORT("SW6")
AM_RANGE(0xfe17, 0xfe17) AM_READNOP //irq ack
AM_RANGE(0xfe20, 0xfe20) AM_WRITE(output_w) //output, irq enable?
@ -142,8 +146,8 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( poker72 )
PORT_START("IN0")
PORT_DIPNAME( 0x01, 0x00, "IN0" )
PORT_START("SW1")
PORT_DIPNAME( 0x01, 0x00, "SW1" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -169,28 +173,28 @@ static INPUT_PORTS_START( poker72 )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("M. Bet")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Black")
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) // Z
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) // X
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) // C
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) // V
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) // B
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("M. Bet")
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Black")
PORT_START("IN2")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red")
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Red")
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_GAMBLE_D_UP )
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_GAMBLE_TAKE )
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_GAMBLE_DEAL ) // '2'
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_GAMBLE_BET ) // M
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SERVICE1 ) // '9'
PORT_SERVICE( 0x0080, IP_ACTIVE_HIGH ) // F2
PORT_START("IN3")
PORT_DIPNAME( 0x01, 0x00, "IN3" )
PORT_START("SW4")
PORT_DIPNAME( 0x01, 0x00, "SW4" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -214,8 +218,8 @@ static INPUT_PORTS_START( poker72 )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN4")
PORT_DIPNAME( 0x01, 0x00, "IN4" )
PORT_START("SW5")
PORT_DIPNAME( 0x01, 0x00, "SW5" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -239,8 +243,8 @@ static INPUT_PORTS_START( poker72 )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN5")
PORT_DIPNAME( 0x01, 0x00, "IN5" )
PORT_START("SW6")
PORT_DIPNAME( 0x01, 0x00, "SW6" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -266,8 +270,8 @@ static INPUT_PORTS_START( poker72 )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("DSW0")
PORT_DIPNAME( 0x01, 0x00, "DSW0" )
PORT_START("SW2")
PORT_DIPNAME( 0x01, 0x00, "SW2" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -292,8 +296,8 @@ static INPUT_PORTS_START( poker72 )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, "DSW1" )
PORT_START("SW3")
PORT_DIPNAME( 0x01, 0x00, "SW3" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
@ -354,9 +358,7 @@ PALETTE_INIT_MEMBER(poker72_state, poker72)
void poker72_state::machine_reset()
{
UINT8 *ROM = memregion("maincpu")->base();
membank("bank1")->set_base(&ROM[0]);
membank("bank1")->set_entry(0);
}
static MACHINE_CONFIG_START( poker72, poker72_state )
@ -384,15 +386,15 @@ static MACHINE_CONFIG_START( poker72, poker72_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay", AY8910, 8000000/8) /* ? Mhz */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW2"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("SW3"))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
ROM_START( poker72 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_REGION( 0x20000, "roms", 0 )
ROM_LOAD( "27010.bin", 0x00000, 0x20000, CRC(62447341) SHA1(e442c1f834a5dd2ab6ab3bdd316dfa86f2ca6647) )
ROM_REGION( 0x1000, "89c51", 0 )
@ -407,9 +409,14 @@ ROM_END
DRIVER_INIT_MEMBER(poker72_state,poker72)
{
UINT8 *rom = memregion("maincpu")->base();
UINT8 *rom = memregion("roms")->base();
rom[0x4a9] = 0x28;
// configure and intialize bank 1
membank("bank1")->configure_entries(0, 4, memregion("roms")->base(), 0x8000);
membank("bank1")->set_entry(0);
//rom[0x4a9] = 0x28;
rom[0x4aa] = 0x00;
}
GAME( 1995, poker72, 0, poker72, poker72, poker72_state, poker72, ROT0, "Extrema Systems International Ltd.", "Poker Monarch (v2.50)", MACHINE_NOT_WORKING ) // actually unknown, was marked 'slot 72 poker' Manufacturers logo and 'Lucky Boy' gfx in rom..
GAME( 1995, poker72, 0, poker72, poker72, poker72_state, poker72, ROT0, "Extrema Systems International Ltd.", "Poker Monarch (v2.50)", MACHINE_NOT_WORKING )

View File

@ -4869,7 +4869,7 @@ GAME( 1991, rascot, 0, sega_rascot, rascot, segaxbd_new_state
// decrypted bootlegs
GAME( 1987, thndrbldd, thndrbld,sega_xboard, thndrbld, driver_device, 0, ROT0, "Sega", "Thunder Blade (upright) (bootleg of FD1094 317-0056 set)", 0 )
GAME( 1987, thndrbldd, thndrbld,sega_xboard, thndrbld, driver_device, 0, ROT0, "bootleg", "Thunder Blade (upright) (bootleg of FD1094 317-0056 set)", 0 )
GAME( 1989, racherod, rachero, sega_xboard, rachero, driver_device, 0, ROT0, "bootleg", "Racing Hero (bootleg of FD1094 317-0144 set)", 0 )

View File

@ -3067,7 +3067,7 @@ GAME( 1989, sparkmana, sparkman, sparkman, sparkman, suna8_state, sparkman, ROT
GAME( 1990, starfigh, 0, starfigh, starfigh, suna8_state, starfigh, ROT90, "SunA", "Star Fighter (v1)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1991, hardhea2, 0, hardhea2, hardhea2, suna8_state, hardhea2, ROT0, "SunA", "Hard Head 2 (v2.0)", 0 )
GAME( 1991, hardhea2b, hardhea2, hardhea2b,hardhea2, suna8_state, hardhea2b, ROT0, "SunA", "Hard Head 2 (v2.0, bootleg)", MACHINE_NOT_WORKING )
GAME( 1991, hardhea2b, hardhea2, hardhea2b,hardhea2, suna8_state, hardhea2b, ROT0, "bootleg", "Hard Head 2 (v2.0, bootleg)", MACHINE_NOT_WORKING )
GAME( 1992, brickzn, 0, brickzn, brickznv6,suna8_state, brickzn, ROT90, "SunA", "Brick Zone (v6.0, Joystick)", 0 )
GAME( 1992, brickznv5, brickzn, brickzn, brickzn, suna8_state, brickznv5, ROT90, "SunA", "Brick Zone (v5.0, Joystick)", 0 )

View File

@ -57,12 +57,13 @@
Any i/o read disables this extended bitmap ram.
- I/O port $700 bit 7 of X1 Turbo is a sound (dip-)switch / jumper setting. I don't know yet what is for,
but King's Knight needs it to be active otherwise it refuses to boot.
- ROM format is:
0x00 ROM id (must be 0x01)
0x01 - 0x0e ROM header
0xff16 - 0xff17 start-up vector
In theory, you can convert your tape / floppy games into ROM format easily, provided that you know what's the pinout of the
cartridge slot and it doesn't exceed 64k (0x10000) of size.
- ROM format header:
[0x00] ROM identifier, must be 0x01 / SOH
[0x01 to 0x0d] ROM header, i.e. title for the loader
[0x12 - 0x13] initial copy size
[0x14 - 0x15] destination address start address
[0x16 to 0x17] start boot jump vector
[0x1d to 0x1f] start boot data vector
- Gruppe: shows a random bitmap graphic then returns "program load error" ... it wants that the floppy has write protection enabled (!) (btanb)
- Maidum: you need to load BOTH disk with write protection disabled, otherwise it refuses to run. (btanb)
- Marvelous: needs write protection disabled (btanb)

View File

@ -169,6 +169,7 @@ public:
DECLARE_DRIVER_INIT(lucky8a);
DECLARE_DRIVER_INIT(magoddsc);
DECLARE_DRIVER_INIT(flaming7);
DECLARE_VIDEO_START(bingowng);
DECLARE_VIDEO_START(magical);

View File

@ -29,7 +29,7 @@ public:
required_shared_ptr<UINT32> m_ram_base;
optional_shared_ptr<UINT32> m_linkram;
required_shared_ptr<UINT32> m_tms32031_control;
required_shared_ptr<UINT32> m_zeusbase;
optional_shared_ptr<UINT32> m_zeusbase;
optional_device<timekeeper_device> m_m48t35;
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;

View File

@ -5,13 +5,16 @@
Driver for Midway Zeus games
**************************************************************************/
#include "video/zeus2.h"
class midzeus2_state : public midzeus_state
{
public:
midzeus2_state(const machine_config &mconfig, device_type type, const char *tag)
: midzeus_state(mconfig, type, tag) { }
: midzeus_state(mconfig, type, tag), m_zeus(*this, "zeus2") { }
required_device<zeus2_device> m_zeus;
DECLARE_WRITE_LINE_MEMBER(zeus_irq);
DECLARE_VIDEO_START(midzeus2);
UINT32 screen_update_midzeus2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ32_MEMBER( zeus2_r );

View File

@ -1,83 +1,51 @@
<?xml version="1.0"?>
<mamelayout version="2">
<element name="digit" defstate="10">
<led7seg>
<color red="1.0" green="0.3" blue="0.0" />
</led7seg>
<!-- define elements -->
<element name="digit" defstate="0">
<led7seg><color red="1.0" green="0.1" blue="0.15" /></led7seg>
</element>
<view name="Simple LEDs">
<element name="text_p1"><text string="PLAYER 1 SCORE"><color red="0.9" green="0.8" blue="0.05" /></text></element>
<element name="text_p2"><text string="PLAYER 2 SCORE"><color red="0.9" green="0.8" blue="0.05" /></text></element>
<element name="text_lives"><text string="LIVES" align="1"><color red="0.9" green="0.8" blue="0.05" /></text></element>
<element name="text_credits"><text string="CREDITS" align="1"><color red="0.9" green="0.8" blue="0.05" /></text></element>
<!-- build screen -->
<view name="Internal Layout">
<bounds x="0" y="0" width="4950" height="3000" />
<screen index="0">
<bounds left="0" top="0" right="4" bottom="3" />
<bounds x="0" y="0" width="4000" height="3000" />
</screen>
<bezel element="text_p1"><bounds x="4086" y="280" width="788" height="85" /></bezel>
<bezel name="digit0" element="digit"><bounds x="4086" y="380" width="118" height="165" /></bezel>
<bezel name="digit1" element="digit"><bounds x="4220" y="380" width="118" height="165" /></bezel>
<bezel name="digit2" element="digit"><bounds x="4354" y="380" width="118" height="165" /></bezel>
<bezel name="digit3" element="digit"><bounds x="4488" y="380" width="118" height="165" /></bezel>
<bezel name="digit4" element="digit"><bounds x="4622" y="380" width="118" height="165" /></bezel>
<bezel name="digit5" element="digit"><bounds x="4756" y="380" width="118" height="165" /></bezel>
<bezel name="digit0" element="digit">
<bounds x="1.4" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel element="text_lives"><bounds x="4580" y="639" width="400" height="85" /></bezel>
<bezel name="digit6" element="digit"><bounds x="4419" y="599" width="118" height="165" /></bezel>
<bezel name="digit1" element="digit">
<bounds x="1.6" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel element="text_p2"><bounds x="4086" y="783" width="788" height="85" /></bezel>
<bezel name="digit8" element="digit"><bounds x="4086" y="883" width="118" height="165" /></bezel>
<bezel name="digit9" element="digit"><bounds x="4220" y="883" width="118" height="165" /></bezel>
<bezel name="digit10" element="digit"><bounds x="4354" y="883" width="118" height="165" /></bezel>
<bezel name="digit11" element="digit"><bounds x="4488" y="883" width="118" height="165" /></bezel>
<bezel name="digit12" element="digit"><bounds x="4622" y="883" width="118" height="165" /></bezel>
<bezel name="digit13" element="digit"><bounds x="4756" y="883" width="118" height="165" /></bezel>
<bezel name="digit2" element="digit">
<bounds x="1.8" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel element="text_lives"><bounds x="4580" y="1144" width="400" height="85" /></bezel>
<bezel name="digit7" element="digit"><bounds x="4419" y="1104" width="118" height="165" /></bezel>
<bezel name="digit3" element="digit">
<bounds x="2.0" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel element="text_credits"><bounds x="4580" y="1413" width="400" height="85" /></bezel>
<bezel name="digit14" element="digit"><bounds x="4285" y="1383" width="118" height="165" /></bezel>
<bezel name="digit15" element="digit"><bounds x="4419" y="1383" width="118" height="165" /></bezel>
<bezel name="digit4" element="digit">
<bounds x="2.2" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel name="digit5" element="digit">
<bounds x="2.4" y="-1.5" width="0.2" height="0.3" />
</bezel>
<bezel name="digit6" element="digit">
<bounds x="1.9" y="-1.2" width="0.2" height="0.3" />
</bezel>
<bezel name="digit8" element="digit">
<bounds x="1.4" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit9" element="digit">
<bounds x="1.6" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit10" element="digit">
<bounds x="1.8" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit11" element="digit">
<bounds x="2.0" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit12" element="digit">
<bounds x="2.2" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit13" element="digit">
<bounds x="2.4" y="-0.9" width="0.2" height="0.3" />
</bezel>
<bezel name="digit7" element="digit">
<bounds x="1.9" y="-0.6" width="0.2" height="0.3" />
</bezel>
<bezel name="digit14" element="digit">
<bounds x="1.7" y="-0.3" width="0.2" height="0.3" />
</bezel>
<bezel name="digit15" element="digit">
<bounds x="1.9" y="-0.3" width="0.2" height="0.3" />
</bezel>
</view>
</mamelayout>

View File

@ -94,7 +94,7 @@ void datapack_device::device_start()
void datapack_device::device_config_complete()
{
m_formatlist.append(*global_alloc(image_device_format("opk", "Psion Datapack image", "opk", datapack_option_spec)));
m_formatlist.push_back(std::make_unique<image_device_format>("opk", "Psion Datapack image", "opk", datapack_option_spec));
// set brief and instance name
update_names();

View File

@ -2,13 +2,14 @@
// copyright-holders:Olivier Galibert, Angelo Salese, David Haywood, Tomasz Slanina
/***************************************************************************
Seibu Cop (Co-Processor) device simulation
Seibu Cop (Co-Processor) device emulation
(new implementation, based on Raiden 2 code)
TODO:
- improve documentation, ffs!
- split commands into own file, 2000+ lines is excessive;
- improve class OO public/protected/private;
- give this one own folder;
- nuke legacy command implementations;
- assert for something that needs actual playtesting is bad.
- add better debug facilities in a new sub-class, including but not limited to:
@ -16,7 +17,16 @@
- printing facilities;
- debugger break on pre-setted commands;
- ...
Tech notes:
-----------
[0x6fc] DMA mode bit scheme:
---1 ---1 ---- ---- fill op if true, else transfer
---- ---- x--- ---- palette brightness
---- ---- ---x ---- internal buffer selector
---- ---- ---- x--- size modifier? Bus transfer size actually?
---- ---- ---- -xxx select channel
***************************************************************************/
#include "emu.h"
@ -648,6 +658,156 @@ UINT8 raiden2cop_device::fade_table(int v)
return (low * (high | (high >> 5)) + 0x210) >> 10;
}
// ALL games use this - tilemap DMA (RAM -> private buffer)
void raiden2cop_device::dma_tilemap_buffer()
{
int src = cop_dma_src[cop_dma_mode] << 6;
if (src == 0xcfc0) src = 0xd000; // R2, why?? everything else sets the right pointer (it also sets up odd size / dest regs, they probably counteract this)
for (int i = 0; i < 0x2800 / 2; i++)
{
UINT16 tileval = m_host_space->read_word(src);
src += 2;
m_videoramout_cb(i, tileval, 0xffff);
}
}
// ALL games use this - palette DMA (RAM -> private buffer)
void raiden2cop_device::dma_palette_buffer()
{
int src = cop_dma_src[cop_dma_mode] << 6;
for (int i = 0; i < 0x1000 / 2; i++) // todo, use length register
{
UINT16 palval = m_host_space->read_word(src);
src += 2;
m_palette->set_pen_color(i, pal5bit(palval >> 0), pal5bit(palval >> 5), pal5bit(palval >> 10));
}
}
// these are typically used to transfer palette data from one RAM buffer to another, applying fade values to it prior to the 0x15 transfer
void raiden2cop_device::dma_palette_brightness()
{
UINT32 src, dst, size, i;
/*
Apparently all of those are just different DMA channels, brightness effects are done through a RAM table and the pal_brightness_val / mode
0x80 is used by Legionnaire
0x81 is used by SD Gundam and Godzilla
0x82 is used by Zero Team and X Se Dae
0x86 is used by Seibu Cup Soccer
0x87 is used by Denjin Makai
TODO:
- Denjin Makai mode 4 is totally guessworked.
- SD Gundam doesn't fade colors correctly, it should have the text layer / sprites with normal gradient and the rest dimmed in most cases,
presumably bad RAM table or bad algorithm
*/
//if(dma_trigger != 0x87)
//printf("SRC: %08x %08x DST:%08x SIZE:%08x TRIGGER: %08x %02x %02x\n",cop_dma_src[cop_dma_mode] << 6,cop_dma_adr_rel * 0x400,cop_dma_dst[cop_dma_mode] << 6,cop_dma_size[cop_dma_mode] << 5,cop_dma_mode,pal_brightness_val,pal_brightness_mode);
src = (cop_dma_src[cop_dma_mode] << 6);
dst = (cop_dma_dst[cop_dma_mode] << 6);
size = ((cop_dma_size[cop_dma_mode] << 5) - (cop_dma_dst[cop_dma_mode] << 6) + 0x20) / 2;
for (i = 0; i < size; i++)
{
UINT16 pal_val;
int r, g, b;
int rt, gt, bt;
if (pal_brightness_mode == 5)
{
bt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x7c00) >> 5;
bt = fade_table(bt | (pal_brightness_val ^ 0));
b = ((m_host_space->read_word(src)) & 0x7c00) >> 5;
b = fade_table(b | (pal_brightness_val ^ 0x1f));
pal_val = ((b + bt) & 0x1f) << 10;
gt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x03e0);
gt = fade_table(gt | (pal_brightness_val ^ 0));
g = ((m_host_space->read_word(src)) & 0x03e0);
g = fade_table(g | (pal_brightness_val ^ 0x1f));
pal_val |= ((g + gt) & 0x1f) << 5;
rt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x001f) << 5;
rt = fade_table(rt | (pal_brightness_val ^ 0));
r = ((m_host_space->read_word(src)) & 0x001f) << 5;
r = fade_table(r | (pal_brightness_val ^ 0x1f));
pal_val |= ((r + rt) & 0x1f);
}
else if (pal_brightness_mode == 4) //Denjin Makai
{
UINT16 targetpaldata = m_host_space->read_word(src + (cop_dma_adr_rel * 0x400));
UINT16 paldata = m_host_space->read_word(src); // ^1 !!! (why?)
bt = (targetpaldata & 0x7c00) >> 10;
b = (paldata & 0x7c00) >> 10;
gt = (targetpaldata & 0x03e0) >> 5;
g = (paldata & 0x03e0) >> 5;
rt = (targetpaldata & 0x001f) >> 0;
r = (paldata & 0x001f) >> 0;
if (pal_brightness_val == 0x10)
pal_val = bt << 10 | gt << 5 | rt << 0;
else if (pal_brightness_val == 0xff) // TODO: might be the back plane or it still doesn't do any mod, needs PCB tests
pal_val = 0;
else
{
bt = fade_table(bt << 5 | ((pal_brightness_val * 2) ^ 0));
b = fade_table(b << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val = ((b + bt) & 0x1f) << 10;
gt = fade_table(gt << 5 | ((pal_brightness_val * 2) ^ 0));
g = fade_table(g << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val |= ((g + gt) & 0x1f) << 5;
rt = fade_table(rt << 5 | ((pal_brightness_val * 2) ^ 0));
r = fade_table(r << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val |= ((r + rt) & 0x1f);
}
}
else
{
printf("Warning: palette DMA used with mode %02x!\n", pal_brightness_mode);
pal_val = m_host_space->read_word(src);
}
m_host_space->write_word(dst, pal_val);
src += 2;
dst += 2;
}
}
void raiden2cop_device::dma_fill()
{
UINT32 length, address;
int i;
if (cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid?
return;
address = (cop_dma_src[cop_dma_mode] << 6);
length = (cop_dma_size[cop_dma_mode] + 1) << 5;
//printf("%08x %08x\n",address,length);
for (i = address; i < address + length; i += 4)
m_host_space->write_dword(i, (cop_dma_v1) | (cop_dma_v2 << 16));
/*
UINT32 length, address;
int i;
if(cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid?
return;
address = (cop_dma_src[cop_dma_mode] << 6);
length = (cop_dma_size[cop_dma_mode]+1) << 5;
//printf("%08x %08x\n",address,length);
for (i=address;i<address+length;i+=4)
{
m_host_space->write_dword(i, m_fill_val);
}
*/
}
WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w)
{
@ -663,138 +823,33 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w)
cop_dma_dst[cop_dma_mode]);
}
#endif
switch (cop_dma_mode)
{
/********************************************************************************************************************/
case 0x14:
{ // ALL games use this - tilemap DMA (RAM -> private buffer)
case 0x14:
{
dma_tilemap_buffer();
break;
}
case 0x15:
{
int src = cop_dma_src[cop_dma_mode] << 6;
if (src == 0xcfc0) src = 0xd000; // R2, why?? everything else sets the right pointer (it also sets up odd size / dest regs, they probably counteract this)
for (int i = 0; i < 0x2800 / 2; i++)
{
UINT16 tileval =m_host_space->read_word(src);
src += 2;
m_videoramout_cb(i, tileval, 0xffff);
}
dma_palette_buffer();
break;
}
break;
}
/********************************************************************************************************************/
case 0x15:
{ // ALL games use this - palette DMA (RAM -> private buffer)
int src = cop_dma_src[cop_dma_mode] << 6;
for (int i = 0; i < 0x1000 / 2; i++) // todo, use length register
{
UINT16 palval = m_host_space->read_word(src);
src += 2;
m_palette->set_pen_color(i, pal5bit(palval >> 0), pal5bit(palval >> 5), pal5bit(palval >> 10));
}
break;
}
/********************************************************************************************************************/
case 0x80:
case 0x81:
case 0x82:
case 0x83:
case 0x84:
case 0x85:
case 0x86:
case 0x87:
{ // these are typically used to transfer palette data from one RAM buffer to another, applying fade values to it prior to the 0x15 transfer
UINT32 src, dst, size, i;
/*
Apparently all of those are just different DMA channels, brightness effects are done through a RAM table and the pal_brightness_val / mode
0x80 is used by Legionnaire
0x81 is used by SD Gundam and Godzilla
0x82 is used by Zero Team and X Se Dae
0x86 is used by Seibu Cup Soccer
0x87 is used by Denjin Makai
TODO:
- Denjin Makai mode 4 is totally guessworked.
- SD Gundam doesn't fade colors correctly, it should have the text layer / sprites with normal gradient and the rest dimmed in most cases,
presumably bad RAM table or bad algorithm
*/
//if(dma_trigger != 0x87)
//printf("SRC: %08x %08x DST:%08x SIZE:%08x TRIGGER: %08x %02x %02x\n",cop_dma_src[cop_dma_mode] << 6,cop_dma_adr_rel * 0x400,cop_dma_dst[cop_dma_mode] << 6,cop_dma_size[cop_dma_mode] << 5,cop_dma_mode,pal_brightness_val,pal_brightness_mode);
src = (cop_dma_src[cop_dma_mode] << 6);
dst = (cop_dma_dst[cop_dma_mode] << 6);
size = ((cop_dma_size[cop_dma_mode] << 5) - (cop_dma_dst[cop_dma_mode] << 6) + 0x20) / 2;
for (i = 0; i < size; i++)
{
UINT16 pal_val;
int r, g, b;
int rt, gt, bt;
if (pal_brightness_mode == 5)
{
bt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x7c00) >> 5;
bt = fade_table(bt | (pal_brightness_val ^ 0));
b = ((m_host_space->read_word(src)) & 0x7c00) >> 5;
b = fade_table(b | (pal_brightness_val ^ 0x1f));
pal_val = ((b + bt) & 0x1f) << 10;
gt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x03e0);
gt = fade_table(gt | (pal_brightness_val ^ 0));
g = ((m_host_space->read_word(src)) & 0x03e0);
g = fade_table(g | (pal_brightness_val ^ 0x1f));
pal_val |= ((g + gt) & 0x1f) << 5;
rt = ((m_host_space->read_word(src + (cop_dma_adr_rel * 0x400))) & 0x001f) << 5;
rt = fade_table(rt | (pal_brightness_val ^ 0));
r = ((m_host_space->read_word(src)) & 0x001f) << 5;
r = fade_table(r | (pal_brightness_val ^ 0x1f));
pal_val |= ((r + rt) & 0x1f);
}
else if (pal_brightness_mode == 4) //Denjin Makai
{
UINT16 targetpaldata = m_host_space->read_word(src + (cop_dma_adr_rel * 0x400));
UINT16 paldata = m_host_space->read_word(src); // ^1 !!! (why?)
bt = (targetpaldata & 0x7c00) >> 10;
b = (paldata & 0x7c00) >> 10;
gt = (targetpaldata & 0x03e0) >> 5;
g = (paldata & 0x03e0) >> 5;
rt = (targetpaldata & 0x001f) >> 0;
r = (paldata & 0x001f) >> 0;
if (pal_brightness_val == 0x10)
pal_val = bt << 10 | gt << 5 | rt << 0;
else if (pal_brightness_val == 0xff) // TODO: might be the back plane or it still doesn't do any mod, needs PCB tests
pal_val = 0;
else
{
bt = fade_table(bt << 5 | ((pal_brightness_val * 2) ^ 0));
b = fade_table(b << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val = ((b + bt) & 0x1f) << 10;
gt = fade_table(gt << 5 | ((pal_brightness_val * 2) ^ 0));
g = fade_table(g << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val |= ((g + gt) & 0x1f) << 5;
rt = fade_table(rt << 5 | ((pal_brightness_val * 2) ^ 0));
r = fade_table(r << 5 | ((pal_brightness_val * 2) ^ 0x1f));
pal_val |= ((r + rt) & 0x1f);
}
}
else
{
printf("Warning: palette DMA used with mode %02x!\n", pal_brightness_mode);
pal_val = m_host_space->read_word(src);
}
m_host_space->write_word(dst, pal_val);
src += 2;
dst += 2;
case 0x80:
case 0x81:
case 0x82:
case 0x83:
case 0x84:
case 0x85:
case 0x86:
case 0x87:
{ dma_palette_brightness();
break;
}
break;
}
/********************************************************************************************************************/
case 0x09: {
UINT32 src, dst, size;
@ -852,50 +907,18 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w)
break;
}
/********************************************************************************************************************/
case 0x118:
case 0x119:
case 0x11a:
case 0x11b:
case 0x11c:
case 0x11d:
case 0x11e:
case 0x11f: {
UINT32 length, address;
int i;
if (cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid?
return;
address = (cop_dma_src[cop_dma_mode] << 6);
length = (cop_dma_size[cop_dma_mode] + 1) << 5;
//printf("%08x %08x\n",address,length);
for (i = address; i < address + length; i += 4)
case 0x118:
case 0x119:
case 0x11a:
case 0x11b:
case 0x11c:
case 0x11d:
case 0x11e:
case 0x11f:
{
m_host_space->write_dword(i, (cop_dma_v1) | (cop_dma_v2 << 16));
dma_fill();
break;
}
/*
UINT32 length, address;
int i;
if(cop_dma_dst[cop_dma_mode] != 0x0000) // Invalid?
return;
address = (cop_dma_src[cop_dma_mode] << 6);
length = (cop_dma_size[cop_dma_mode]+1) << 5;
//printf("%08x %08x\n",address,length);
for (i=address;i<address+length;i+=4)
{
m_host_space->write_dword(i, m_fill_val);
}
*/
break;
}
}
}

View File

@ -267,6 +267,11 @@ private:
UINT8 cop_read_byte(int address);
void cop_write_word(int address, UINT16 data);
void cop_write_byte(int address, UINT8 data);
void dma_tilemap_buffer();
void dma_palette_buffer();
void dma_fill();
void dma_palette_brightness();
};
extern const device_type RAIDEN2COP;

View File

@ -231,74 +231,36 @@ READ8_MEMBER(vt100_video_device::lba7_r)
return m_lba7;
}
// Also used by Rainbow-100 ************
WRITE8_MEMBER(vt100_video_device::dc012_w)
{
// Writes to [10C] and [0C] are treated differently
// - see 3.1.3.9.5 DC012 Programming Information (PC-100 spec)
// MHFU is disabled by writing 00 to port 010C.
// Code recognition is abysmal - sorry for that.
if (data == 0)
if ((offset & 0x100) && (data == 0) ) // MHFU is disabled by writing 00 to port 010C.
{
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
if (rom != nullptr)
{
UINT32 PC = space.device().safe_pc();
if ((rom[ PC - 1] == 0xe6) &&
(rom[ PC ] == 0x0c)
)
{
// OUT 0C,al < DO NOTHING >
}
else
{
//UINT8 magic1= rom[PC - 1];
//printf("\n PC %05x - MHFU MAGIC -1 %02x\n", PC, magic1);
//UINT8 magic2 = rom[PC - 2];
//printf("\n PC %05x - MHFU MAGIC -2 %02x\n", PC, magic2);
//if (VERBOSE)
//if(1 )
if ((rom[PC - 2] == 0x0C) &&
(rom[PC - 1] == 0x01)
)
{
if (MHFU_FLAG == true)
printf("MHFU *** DISABLED *** %05x \n", PC);
MHFU_FLAG = false;
MHFU_counter = 0;
}
}
} // DATA == 0 ONLY ....
if (MHFU_FLAG == true)
printf("MHFU *** DISABLED *** \n");
MHFU_FLAG = false;
MHFU_counter = 0; // ?
}
else
{
//if (VERBOSE)
if (MHFU_FLAG == false)
printf("MHFU ___ENABLED___ %05x \n", space.device().safe_pc());
// RESET
MHFU_FLAG = true;
MHFU_counter = 0;
MHFU_counter = 0;
}
if (!(data & 0x08))
{
if (!(data & 0x04))
{
m_scroll_latch_valid = false; // LSB is written first.
// set lower part scroll
m_scroll_latch = data & 0x03;
m_scroll_latch_valid = false;
m_scroll_latch = data & 0x03; // LSB is written first.
}
else
else // set MSB of scroll_latch
{
// set higher part scroll
m_scroll_latch = (m_scroll_latch & 0x03) | ((data & 0x03) << 2);
m_scroll_latch_valid = true;
}
@ -883,16 +845,23 @@ int rainbow_video_device::MHFU(int ASK)
return MHFU_FLAG;
case -1: // -1: increment IF ENABLED, return counter value (=> Rainbow.c)
if (MHFU_FLAG == true)
MHFU_counter++;
//if (MHFU_FLAG == true)
if (MHFU_counter < 255)
MHFU_counter++;
case -2:
return MHFU_counter;
case -250: // -250 : RESET counter (NOTHING ELSE!)
MHFU_counter = 0;
return MHFU_FLAG;
case -100: // -100 : RESET and ENABLE MHFU counter
MHFU_counter = 0;
if(1) //if (VERBOSE)
if(0) //if (VERBOSE)
printf("-100 MHFU * reset and ENABLE * \n");
if(1) // if (VERBOSE)
if(0) // if (VERBOSE)
{
if (MHFU_FLAG == false)
printf("-100 MHFU ___ENABLED___\n");
@ -904,10 +873,10 @@ int rainbow_video_device::MHFU(int ASK)
case -200: // -200 : RESET and DISABLE MHFU
MHFU_counter = 0;
if(1) //if (VERBOSE)
if(0) //if (VERBOSE)
{
if (MHFU_FLAG == true)
printf("MHFU *** DISABLED *** \n");
printf("MHFU *** DISABLED ***xxx \n");
}
MHFU_FLAG = false;

View File

@ -77,6 +77,7 @@ public:
bool exec_cmd; // console only
int src_sel;
char console_input[512];
std::vector<std::string> console_history;
};
class debug_imgui : public osd_module, public debug_module
@ -94,7 +95,8 @@ public:
font_size(0),
m_key_char(0),
m_hide(false),
m_win_count(0)
m_win_count(0),
m_initialised(false)
{
}
@ -127,6 +129,7 @@ private:
void draw_view(debug_area* view_ptr, bool exp_change);
void update_cpu_view(device_t* device);
static bool get_view_source(void* data, int idx, const char** out_text);
static int history_set(ImGuiTextEditCallbackData* data);
running_machine* m_machine;
INT32 m_mouse_x;
@ -141,6 +144,7 @@ private:
UINT8 m_key_char;
bool m_hide;
int m_win_count; // number of active windows, does not decrease, used to ID individual windows
bool m_initialised; // true after initial views are created
};
// globals
@ -148,6 +152,7 @@ static std::vector<debug_area*> view_list;
static debug_area* view_main_console = nullptr;
static debug_area* view_main_disasm = nullptr;
static debug_area* view_main_regs = nullptr;
static int history_pos;
static void view_list_add(debug_area* item)
{
@ -427,6 +432,7 @@ void debug_imgui::handle_console(running_machine* machine)
{
m_machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
view_main_console->exec_cmd = false;
history_pos = view_main_console->console_history.size();
return;
}
m_machine->debugger().console().execute_command(view_main_console->console_input, true);
@ -459,11 +465,39 @@ void debug_imgui::handle_console(running_machine* machine)
m_running = true;
if(strcmp(view_main_console->console_input,"next") == 0)
m_running = true;
view_main_console->console_history.push_back(std::string(view_main_console->console_input));
history_pos = view_main_console->console_history.size();
strcpy(view_main_console->console_input,"");
view_main_console->exec_cmd = false;
}
}
int debug_imgui::history_set(ImGuiTextEditCallbackData* data)
{
if(view_main_console->console_history.size() == 0)
return 0;
switch(data->EventKey)
{
case ImGuiKey_UpArrow:
if(history_pos > 0)
history_pos--;
break;
case ImGuiKey_DownArrow:
if(history_pos < view_main_console->console_history.size())
history_pos++;
break;
}
if(history_pos == view_main_console->console_history.size())
data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", "");
else
data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", view_main_console->console_history[history_pos].c_str());
data->BufDirty = true;
return 0;
}
void debug_imgui::update_cpu_view(device_t* device)
{
const debug_view_source *source;
@ -948,11 +982,11 @@ void debug_imgui::draw_console()
ImGui::EndChild();
ImGui::Separator();
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue;
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackHistory;
if(m_running)
flags |= ImGuiInputTextFlags_ReadOnly;
ImGui::PushItemWidth(-1.0f);
if(ImGui::InputText("##console_input",view_main_console->console_input,512,flags))
if(ImGui::InputText("##console_input",view_main_console->console_input,512,flags,history_set))
view_main_console->exec_cmd = true;
if ((ImGui::IsRootWindowOrAnyChildFocused() && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)))
ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget
@ -1078,7 +1112,7 @@ void debug_imgui::wait_for_debugger(device_t &device, bool firststop)
{
UINT32 width = m_machine->render().ui_target().width();
UINT32 height = m_machine->render().ui_target().height();
if(firststop && view_list.empty())
if(firststop && !m_initialised)
{
view_main_console = dview_alloc(device.machine(), DVT_CONSOLE);
view_main_console->title = "MAME Debugger";
@ -1095,6 +1129,7 @@ void debug_imgui::wait_for_debugger(device_t &device, bool firststop)
view_main_regs->width = 180;
view_main_regs->height = 440;
strcpy(view_main_console->console_input,""); // clear console input
m_initialised = true;
}
if(firststop)
{