summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/orbit.cpp
diff options
context:
space:
mode:
author andreasnaive <andreasnaive@gmail.com>2019-03-25 23:13:40 +0100
committer andreasnaive <andreasnaive@gmail.com>2019-03-25 23:13:40 +0100
commitb380514764cf857469bae61c11143a19f79a74c5 (patch)
tree63c8012e262618f08a332da31dd714281aa2c5ed /src/mame/drivers/orbit.cpp
parentc24473ddff715ecec2e258a6eb38960cf8c8e98e (diff)
Revert "conflict resolution (nw)"
This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
Diffstat (limited to 'src/mame/drivers/orbit.cpp')
-rw-r--r--src/mame/drivers/orbit.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp
index 1cd1a45117e..41097621386 100644
--- a/src/mame/drivers/orbit.cpp
+++ b/src/mame/drivers/orbit.cpp
@@ -265,14 +265,14 @@ void orbit_state::machine_reset()
*
*************************************/
-void orbit_state::orbit(machine_config &config)
-{
+MACHINE_CONFIG_START(orbit_state::orbit)
+
/* basic machine hardware */
- M6800(config, m_maincpu, MASTER_CLOCK / 16);
- m_maincpu->set_addrmap(AS_PROGRAM, &orbit_state::main_map);
- m_maincpu->set_vblank_int("screen", FUNC(orbit_state::interrupt));
+ MCFG_DEVICE_ADD(m_maincpu, M6800, MASTER_CLOCK / 16)
+ MCFG_DEVICE_PROGRAM_MAP(main_map)
+ MCFG_DEVICE_VBLANK_INT_DRIVER("screen", orbit_state, interrupt)
- TIMER(config, "32v").configure_scanline(FUNC(orbit_state::nmi_32v), "screen", 0, 32);
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", orbit_state, nmi_32v, "screen", 0, 32)
F9334(config, m_latch); // M6
/* BIT0 => UNUSED */
@@ -291,12 +291,12 @@ void orbit_state::orbit(machine_config &config)
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
- SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- m_screen->set_raw(MASTER_CLOCK*2, 384*2, 0, 256*2, 261*2, 0, 240*2);
- m_screen->set_screen_update(FUNC(orbit_state::screen_update));
- m_screen->set_palette(m_palette);
+ MCFG_SCREEN_ADD(m_screen, RASTER)
+ MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK*2, 384*2, 0, 256*2, 261*2, 0, 240*2)
+ MCFG_SCREEN_UPDATE_DRIVER(orbit_state, screen_update)
+ MCFG_SCREEN_PALETTE(m_palette)
- GFXDECODE(config, m_gfxdecode, m_palette, gfx_orbit);
+ MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_orbit)
PALETTE(config, m_palette, palette_device::MONOCHROME);
@@ -304,10 +304,10 @@ void orbit_state::orbit(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- DISCRETE(config, m_discrete, orbit_discrete);
- m_discrete->add_route(0, "lspeaker", 1.0);
- m_discrete->add_route(1, "rspeaker", 1.0);
-}
+ MCFG_DEVICE_ADD(m_discrete, DISCRETE, orbit_discrete)
+ MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
+ MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+MACHINE_CONFIG_END
miter */ .highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ .highlight .se { color: #4e9a06 } /* Literal.String.Escape */ .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ .highlight .sx { color: #4e9a06 } /* Literal.String.Other */ .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ .highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #000000 } /* Name.Function.Magic */ .highlight .vc { color: #000000 } /* Name.Variable.Class */ .highlight .vg { color: #000000 } /* Name.Variable.Global */ .highlight .vi { color: #000000 } /* Name.Variable.Instance */ .highlight .vm { color: #000000 } /* Name.Variable.Magic */ .highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************

    crsshair.h

    Crosshair handling.
***************************************************************************/

#pragma once

#ifndef __CRSSHAIR_H__
#define __CRSSHAIR_H__


/***************************************************************************
    CONSTANTS
***************************************************************************/

#define CROSSHAIR_SCREEN_NONE   ((screen_device *) 0)
#define CROSSHAIR_SCREEN_ALL    ((screen_device *) ~0)

/* user settings for visibility mode */
#define CROSSHAIR_VISIBILITY_OFF                0
#define CROSSHAIR_VISIBILITY_ON                 1
#define CROSSHAIR_VISIBILITY_AUTO               2
#define CROSSHAIR_VISIBILITY_DEFAULT            CROSSHAIR_VISIBILITY_AUTO

/* range allowed for auto visibility */
#define CROSSHAIR_VISIBILITY_AUTOTIME_MIN           0
#define CROSSHAIR_VISIBILITY_AUTOTIME_MAX           50
#define CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT       15

/* maximum crosshair pic filename size */
#define CROSSHAIR_PIC_NAME_LENGTH               12



/***************************************************************************
    TYPE DEFINITIONS
***************************************************************************/

/* user-controllable settings for a player */
struct crosshair_user_settings
{
	UINT8           used;       /* is used */
	UINT8           mode;       /* visibility mode */
	UINT8           auto_time;  /* time in seconds to blank crosshair if no movement */
	char            name[CROSSHAIR_PIC_NAME_LENGTH + 1];        /* bitmap name */
};


// ======================> crosshair_manager

class crosshair_manager
{
public:
	// construction/destruction
	crosshair_manager(running_machine &machine);

	/* draws crosshair(s) in a given screen, if necessary */
	void render(screen_device &screen);

	/* sets the screen(s) for a given player's crosshair */
	void set_screen(int player, screen_device *screen) { m_screen[player] = screen; }

	/* return TRUE if any crosshairs are used */
	int get_usage() const { return m_usage; }

	/* return the current crosshair settings for the given player */
	void get_user_settings(UINT8 player, crosshair_user_settings *settings);

	/* modify the current crosshair settings for the given player */
	void set_user_settings(UINT8 player, crosshair_user_settings *settings);
	// getters
	running_machine &machine() const { return m_machine; }
private:
	void create_bitmap(int player);
	void exit();
	void animate(screen_device &device, bool vblank_state);

	void config_load(config_type cfg_type, xml_data_node *parentnode);
	void config_save(config_type cfg_type, xml_data_node *parentnode);

	// internal state
	running_machine &   m_machine;                  // reference to our machine

	UINT8               m_usage;                  /* true if any crosshairs are used */
	UINT8               m_used[MAX_PLAYERS];      /* usage per player */
	UINT8               m_mode[MAX_PLAYERS];      /* visibility mode per player */
	UINT8               m_visible[MAX_PLAYERS];   /* visibility per player */
	std::unique_ptr<bitmap_argb32>  m_bitmap[MAX_PLAYERS];    /* bitmap per player */
	render_texture *    m_texture[MAX_PLAYERS];   /* texture per player */
	screen_device *     m_screen[MAX_PLAYERS];    /* the screen on which this player's crosshair is drawn */
	float               m_x[MAX_PLAYERS];         /* current X position */
	float               m_y[MAX_PLAYERS];         /* current Y position */
	float               m_last_x[MAX_PLAYERS];    /* last X position */
	float               m_last_y[MAX_PLAYERS];    /* last Y position */
	UINT8               m_fade;                   /* color fading factor */
	UINT8               m_animation_counter;      /* animation frame index */
	UINT16              m_auto_time;              /* time in seconds to turn invisible */
	UINT16              m_time[MAX_PLAYERS];      /* time since last movement */
	char                m_name[MAX_PLAYERS][CROSSHAIR_PIC_NAME_LENGTH + 1];   /* name of crosshair png file */
};

#endif  /* __CRSSHAIR_H__ */