summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/diimage.c')
-rw-r--r--src/emu/diimage.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index d2aa51b879f..fa50ccf7703 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -175,7 +175,7 @@ static void memory_error(const char *message)
device_image_interface::device_image_interface(running_machine &machine, const device_config &config, device_t &device)
: device_interface(machine, config, device),
- m_image_config(dynamic_cast<const device_config_image_interface &>(config)),
+ m_image_config(dynamic_cast<const device_config_image_interface &>(config)),
m_file(NULL),
m_full_software_name(NULL),
m_software_info_ptr(NULL),
@@ -192,7 +192,7 @@ device_image_interface::device_image_interface(running_machine &machine, const d
device_image_interface::~device_image_interface()
{
- pool_free_lib(m_mempool);
+ pool_free_lib(m_mempool);
}
/*-------------------------------------------------
@@ -205,7 +205,7 @@ image_error_t device_image_interface::set_image_filename(const char *filename)
m_name = filename;
zippath_parent(&m_working_directory, filename);
m_basename = m_name.cpy(m_name);
-
+
int loc1 = m_name.rchr(0,'\\');
int loc2 = m_name.rchr(0,'/');
int loc3 = m_name.rchr(0,':');
@@ -328,7 +328,7 @@ void device_image_interface::seterror(image_error_t err, const char *message)
void device_image_interface::message(const char *format, ...)
{
va_list args;
- char buffer[256];
+ char buffer[256];
/* format the message */
va_start(args, format);
@@ -412,7 +412,7 @@ void device_image_interface::setup_working_directory()
// valid even if not mounted
//-------------------------------------------------
-const char * device_image_interface::working_directory()
+const char * device_image_interface::working_directory()
{
/* check to see if we've never initialized the working directory */
if (m_working_directory.len() == 0)
@@ -544,7 +544,7 @@ int device_image_interface::read_hash_config(const char *sysname)
goto done;
/* copy the relevant entries */
- m_longname = info->longname ? astring(info->longname) : "";
+ m_longname = info->longname ? astring(info->longname) : "";
m_manufacturer = info->manufacturer ? astring(info->manufacturer) : "";
m_year = info->year ? astring(info->year) : "";
m_playable = info->playable ? astring(info->playable) : "";
@@ -625,11 +625,11 @@ void device_image_interface::image_checkhash()
return;
}
-UINT32 device_image_interface::crc()
-{
+UINT32 device_image_interface::crc()
+{
UINT32 crc = 0;
- image_checkhash();
+ image_checkhash();
if (m_hash != NULL)
crc = hash_data_extract_crc32(m_hash);
@@ -671,4 +671,4 @@ void device_image_interface::battery_save(const void *buffer, int length)
image_battery_save_by_name(astring_c(fname), buffer, length);
astring_free(fname);
}
- \ No newline at end of file
+
'>207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
// license:BSD-3-Clause
// copyright-holders:Stefan Jokisch
/***************************************************************************

Taito Super Speed Race video emulation

***************************************************************************/

#include "emu.h"
#include "includes/sspeedr.h"


WRITE8_MEMBER(sspeedr_state::sspeedr_driver_horz_w)
{
	m_driver_horz = (m_driver_horz & 0x100) | data;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_driver_horz_2_w)
{
	m_driver_horz = (m_driver_horz & 0xff) | ((data & 1) << 8);
}


WRITE8_MEMBER(sspeedr_state::sspeedr_driver_vert_w)
{
	m_driver_vert = data;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_driver_pic_w)
{
	m_driver_pic = data & 0x1f;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_drones_horz_w)
{
	m_drones_horz = (m_drones_horz & 0x100) | data;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_drones_horz_2_w)
{
	m_drones_horz = (m_drones_horz & 0xff) | ((data & 1) << 8);
}


WRITE8_MEMBER(sspeedr_state::sspeedr_drones_mask_w)
{
	m_drones_mask = data & 0x3f;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_drones_vert_w)
{
	m_drones_vert[offset] = data;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_track_horz_w)
{
	m_track_horz = (m_track_horz & 0x100) | data;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_track_horz_2_w)
{
	m_track_horz = (m_track_horz & 0xff) | ((data & 1) << 8);
}


WRITE8_MEMBER(sspeedr_state::sspeedr_track_vert_w)
{
	m_track_vert[offset] = data & 0x7f;
}


WRITE8_MEMBER(sspeedr_state::sspeedr_track_ice_w)
{
	m_track_ice = data & 0x07;
}


void sspeedr_state::draw_track(bitmap_ind16 &bitmap)
{
	const UINT8* p = memregion("gfx3")->base();

	int x;
	int y;

	for (x = 0; x < 376; x++)
	{
		unsigned counter_x = x + m_track_horz + 0x50;

		int flag = 0;

		if (m_track_ice & 2)
		{
			flag = 1;
		}
		else if (m_track_ice & 4)
		{
			if (m_track_ice & 1)
			{
				flag = (counter_x <= 0x1ff);
			}
			else
			{
				flag = (counter_x >= 0x200);
			}
		}

		if (counter_x >= 0x200)
		{
			counter_x -= 0x1c8;
		}

		y = 0;

		/* upper landscape */

		for (; y < m_track_vert[0]; y++)
		{
			unsigned counter_y = y - m_track_vert[0];

			int offset =
				((counter_y & 0x1f) << 3) |
				((counter_x & 0x1c) >> 2) |
				((counter_x & 0xe0) << 3);

			if (counter_x & 2)
			{
				bitmap.pix16(y, x) = p[offset] / 16;
			}
			else
			{
				bitmap.pix16(y, x) = p[offset] % 16;
			}
		}

		/* street */

		for (; y < 128 + m_track_vert[1]; y++)
		{
			bitmap.pix16(y, x) = flag ? 15 : 0;
		}

		/* lower landscape */

		for (; y < 248; y++)
		{
			unsigned counter_y = y - m_track_vert[1];

			int offset =
				((counter_y & 0x1f) << 3) |
				((counter_x & 0x1c) >> 2) |
				((counter_x & 0xe0) << 3);

			if (counter_x & 2)
			{
				bitmap.pix16(y, x) = p[offset] / 16;
			}
			else
			{
				bitmap.pix16(y, x) = p[offset] % 16;
			}
		}
	}
}


void sspeedr_state::draw_drones(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	static const UINT8 code[6] =
	{
		0xf, 0x4, 0x3, 0x9, 0x7, 0xc
	};

	int i;

	for (i = 0; i < 6; i++)
	{
		int x;
		int y;

		if ((m_drones_mask >> i) & 1)
		{
			continue;
		}

		x = (code[i] << 5) - m_drones_horz - 0x50;

		if (x <= -32)
		{
			x += 0x1c8;
		}

		y = 0xf0 - m_drones_vert[i >> 1];


			m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
			code[i] ^ m_toggle,
			0,
			0, 0,
			x,
			y, 0);
	}
}


void sspeedr_state::draw_driver(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x;
	int y;

	if (!(m_driver_pic & 0x10))
	{
		return;
	}

	x = 0x1e0 - m_driver_horz - 0x50;

	if (x <= -32)
	{
		x += 0x1c8;
	}

	y = 0xf0 - m_driver_vert;


		m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
		m_driver_pic,
		0,
		0, 0,
		x,
		y, 0);
}


void sspeedr_state::video_start()
{
	m_toggle = 0;
}


UINT32 sspeedr_state::screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	draw_track(bitmap);
	draw_drones(bitmap, cliprect);
	draw_driver(bitmap, cliprect);
	return 0;
}


void sspeedr_state::screen_eof_sspeedr(screen_device &screen, bool state)
{
	// rising edge
	if (state)
	{
		m_toggle ^= 1;
	}
}