diff options
49 files changed, 293 insertions, 291 deletions
diff --git a/src/devices/cpu/alto2/a2curt.h b/src/devices/cpu/alto2/a2curt.h index cdfc6a22973..a09c790dbb2 100644 --- a/src/devices/cpu/alto2/a2curt.h +++ b/src/devices/cpu/alto2/a2curt.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2CURT_H_ -#define _A2CURT_H_ +#ifndef MAME_CPU_ALTO2_A2CURT_H +#define MAME_CPU_ALTO2_A2CURT_H //! F2 functions for cursor task enum { @@ -24,5 +24,5 @@ void activate_curt(); //!< curt_activate: called by th void init_curt(int task = task_curt); //!< initialize cursor task void exit_curt(); //!< deinitialize cursor task void reset_curt(); //!< reset cursor task -#endif // _A2CURT_H_ +#endif // MAME_CPU_A2CURT_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2dht.h b/src/devices/cpu/alto2/a2dht.h index 9ff7acc17f4..3d3bb305f76 100644 --- a/src/devices/cpu/alto2/a2dht.h +++ b/src/devices/cpu/alto2/a2dht.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2DHT_H_ -#define _A2DHT_H_ +#ifndef MAME_CPU_ALTO2_A2DHT_H +#define MAME_CPU_ALTO2_A2DHT_H //! F2 functions for display horizontal task enum { @@ -23,5 +23,5 @@ void activate_dht(); //!< called by the CPU when the void init_dht(int task = task_dht); //!< initialize display horizontal task void exit_dht(); //!< deinitialize display horizontal task void reset_dht(); //!< reset the display horizontal task -#endif // _A2DHT_H_ +#endif // MAME_CPU_ALTO2_A2DHT_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2disk.h b/src/devices/cpu/alto2/a2disk.h index 19efa66d66f..2bb7f98ce80 100644 --- a/src/devices/cpu/alto2/a2disk.h +++ b/src/devices/cpu/alto2/a2disk.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2DISK_H_ -#define _A2DISK_H_ +#ifndef MAME_CPU_ALTO2_A2DISK_H +#define MAME_CPU_ALTO2_A2DISK_H required_device_array<diablo_hd_device, 2> m_drive; //!< two diablo_hd_device drives @@ -95,5 +95,5 @@ void f2_late_strobon(); //!< f2_strobon late: branch on void init_disk(); //!< initialize the disk controller void exit_disk(); //!< deinitialize the disk controller void reset_disk(); //!< reset the disk controller -#endif // _A2DISK_H_ +#endif // MAME_CPU_ALTO2_A2DISK_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2disp.h b/src/devices/cpu/alto2/a2disp.h index c4d47047519..79240f90a31 100644 --- a/src/devices/cpu/alto2/a2disp.h +++ b/src/devices/cpu/alto2/a2disp.h @@ -190,8 +190,8 @@ * </PRE> */ -#ifndef _A2DISP_H_ -#define _A2DISP_H_ +#ifndef MAME_CPU_ALTO2_A2DISP_H +#define MAME_CPU_ALTO2_A2DISP_H struct { uint32_t state; //!< current state of the display_state_machine() uint32_t hlc; //!< horizontal line counter @@ -312,5 +312,5 @@ void init_disp(); //!< initialize the display context void exit_disp(); //!< deinitialize the display context void reset_disp(); //!< reset the display context -#endif // _A2DISP_H_ +#endif // MAME_CPU_ALTO2_A2DISP_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2dvt.h b/src/devices/cpu/alto2/a2dvt.h index 0d9430b1731..8b3cbbb587b 100644 --- a/src/devices/cpu/alto2/a2dvt.h +++ b/src/devices/cpu/alto2/a2dvt.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2DVT_H_ -#define _A2DVT_H_ +#ifndef MAME_CPU_ALTO2_A2DVT_H +#define MAME_CPU_ALTO2_A2DVT_H //! F2 functions for display vertical task enum { @@ -30,5 +30,5 @@ void exit_dvt(); //! Reset the display vertical task. void reset_dvt(); -#endif // _A2DVT_H_ +#endif // MAME_CPU_ALTO2_A2DVT_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2dwt.h b/src/devices/cpu/alto2/a2dwt.h index 788af460369..896f627f3e3 100644 --- a/src/devices/cpu/alto2/a2dwt.h +++ b/src/devices/cpu/alto2/a2dwt.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2DWT_H_ -#define _A2DWT_H_ +#ifndef MAME_CPU_ALTO2_A2DWT_H +#define MAME_CPU_ALTO2_A2DWT_H //! F2 functions for display word task enum { @@ -21,5 +21,5 @@ void f2_late_load_ddr(); //!< F2 func: load the display d void init_dwt(int task = task_dwt); //!< initialize the display word task void exit_dwt(); //!< deinitialize the display word task void reset_dwt(); //!< reset the display word task -#endif // _A2DWT_H_ +#endif // MAME_CPU_ALTO2_A2DWT_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2emu.h b/src/devices/cpu/alto2/a2emu.h index 5fd012b6196..03e681b5039 100644 --- a/src/devices/cpu/alto2/a2emu.h +++ b/src/devices/cpu/alto2/a2emu.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2EMU_H_ -#define _A2EMU_H_ +#ifndef MAME_CPU_ALTO2_A2EMU_H +#define MAME_CPU_ALTO2_A2EMU_H //! BUS source for emulator task enum { @@ -65,5 +65,5 @@ void f2_late_acsource(); //!< F2 func: branch on arithmet void init_emu(int task = task_emu); //!< initialize the emulator task void exit_emu(); //!< deinitialize the emulator task void reset_emu(); //!< reset the emulator task -#endif // _A2EMU_H_ +#endif // MAME_CPU_ALTO2_A2EMU_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2ether.h b/src/devices/cpu/alto2/a2ether.h index fe302fd0eef..48b29f6ea9b 100644 --- a/src/devices/cpu/alto2/a2ether.h +++ b/src/devices/cpu/alto2/a2ether.h @@ -11,8 +11,8 @@ #define ALTO2_ETHER_PACKET_SIZE 0400 //!< size of a packet in words #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2ETHER_H_ -#define _A2ETHER_H_ +#ifndef MAME_CPU_ALTO2_A2ETHER_H +#define MAME_CPU_ALTO2_A2ETHER_H //! BUS source for ethernet task enum { bs_ether_eidfct = bs_task_3 //!< ethernet task: Ethernet input data function @@ -112,5 +112,5 @@ void update_tclk(int tclk); //!< update all JK flip-flops fo void init_ether(int task = task_ether); //!< initialize the ethernet task void exit_ether(); //!< deinitialize the ethernet task void reset_ether(); //!< reset the ethernet task -#endif // _A2ETHER_H_ +#endif // MAME_CPU_ALTO2_A2ETHER_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2hw.h b/src/devices/cpu/alto2/a2hw.h index e429ca65699..d2c2a16e3ba 100644 --- a/src/devices/cpu/alto2/a2hw.h +++ b/src/devices/cpu/alto2/a2hw.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2HW_H_ -#define _A2HW_H_ +#ifndef MAME_CPU_ALTO2_A2HW_H +#define MAME_CPU_ALTO2_A2HW_H //! miscellaneous hardware registers in the memory mapped I/O range struct { uint16_t eia; //!< the EIA port at 0177001 @@ -62,5 +62,5 @@ void xbus_w(offs_t offset, uint16_t data); //!< write an XBUS address (?) void init_hw(); //!< initialize miscellaneous hardware void exit_hw(); //!< deinitialize miscellaneous hardware void reset_hw(); //!< reset miscellaneous hardware -#endif // _A2HW_H_ +#endif // MAME_CPU_ALTO2_A2HW_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2jkff.h b/src/devices/cpu/alto2/a2jkff.h index 49929474c19..8f5e853f72b 100644 --- a/src/devices/cpu/alto2/a2jkff.h +++ b/src/devices/cpu/alto2/a2jkff.h @@ -44,8 +44,8 @@ typedef enum { #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2JKFF_H_ -#define _A2JKFF_H_ +#ifndef MAME_CPU_ALTO2_A2JKFF_H +#define MAME_CPU_ALTO2_A2JKFF_H #if JKFF_DEBUG /** @@ -188,5 +188,5 @@ static inline jkff_t update_jkff(uint8_t s0, uint8_t s1, const char*) } #endif // JKFF_DEBUG -#endif // _A2JKFF_H_ +#endif // MAME_CPU_ALTO2_A2JKFF_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2kbd.h b/src/devices/cpu/alto2/a2kbd.h index 856695c4bd6..e48eeb65a9c 100644 --- a/src/devices/cpu/alto2/a2kbd.h +++ b/src/devices/cpu/alto2/a2kbd.h @@ -93,8 +93,8 @@ #define A2_KEY_FR5 MAKE_KEY(3,000) //!< ADL right function key 5 #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2KBD_H_ -#define _A2KBD_H_ +#ifndef MAME_CPU_ALTO2_A2KBD_H +#define MAME_CPU_ALTO2_A2KBD_H struct { uint16_t bootkey; //!< boot key - key code pressed before power on uint16_t matrix[4]; //!< a bit map of the keys pressed (ioports ROW0 ... ROW3) @@ -105,5 +105,5 @@ uint16_t kbd_ad_r(offs_t offset); //!< read the keyboard matrix void init_kbd(uint16_t bootkey = 0177777); //!< initialize the keyboard hardware, optionally set the boot key void exit_kbd(); //!< deinitialize the keyboard hardware void reset_kbd(); //!< reset the keyboard hardware -#endif // _A2KBD_H_ +#endif // MAME_CPU_ALTO2_A2KBD_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2ksec.h b/src/devices/cpu/alto2/a2ksec.h index 96c2530a2a5..2a908cbafd2 100644 --- a/src/devices/cpu/alto2/a2ksec.h +++ b/src/devices/cpu/alto2/a2ksec.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2KSEC_H_ -#define _A2KSEC_H_ +#ifndef MAME_CPU_ALTO2_A2KSEC_H +#define MAME_CPU_ALTO2_A2KSEC_H //! BUS source for disk sector task enum { bs_ksec_read_kstat = bs_task_3, //!< bus source: read disk status register @@ -44,5 +44,5 @@ void f1_early_ksec_block(void); //!< block ksec task void init_ksec(int task = task_ksec); //!< initialize the disk sector task void exit_ksec(); //!< deinitialize the disk sector task void reset_ksec(); //!< reset the disk sector task -#endif // _A2KSEC_H_ +#endif // MAME_CPU_ALTO2_A2KSEC_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2kwd.h b/src/devices/cpu/alto2/a2kwd.h index 678408501d2..18405379dd6 100644 --- a/src/devices/cpu/alto2/a2kwd.h +++ b/src/devices/cpu/alto2/a2kwd.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2KWD_H_ -#define _A2KWD_H_ +#ifndef MAME_CPU_ALTO2_A2KWD_H +#define MAME_CPU_ALTO2_A2KWD_H //! BUS source for disk word task enum { @@ -45,5 +45,5 @@ void f1_early_kwd_block(); //!< F1 func: disable the disk w void init_kwd(int task = task_kwd); //!< initialize the disk word task void exit_kwd(); //!< deinitialize the disk word task void reset_kwd(); //!< reset the disk word task -#endif // _A2KWD_H_ +#endif // MAME_CPU_ALTO2_A2KWD_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2mem.h b/src/devices/cpu/alto2/a2mem.h index 631f98cfbc7..3ce43a4da9f 100644 --- a/src/devices/cpu/alto2/a2mem.h +++ b/src/devices/cpu/alto2/a2mem.h @@ -12,8 +12,8 @@ #define ALTO2_IO_PAGE_SIZE 0001000 //!< size of the memory mapped io range #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2MEM_H_ -#define _A2MEM_H_ +#ifndef MAME_CPU_ALTO2_A2MEM_H +#define MAME_CPU_ALTO2_A2MEM_H //! memory access mode enum { ALTO2_MEM_NONE, @@ -135,5 +135,5 @@ void watch_read(uint32_t addr, uint32_t data); void init_memory(); //!< initialize the memory system void exit_memory(); //!< deinitialize the memory system void reset_memory(); //!< reset the memory system -#endif // _A2MEM_H_ +#endif // MAME_CPU_ALTO2_A2MEM_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2mouse.h b/src/devices/cpu/alto2/a2mouse.h index 375a37397a2..ad9de9cb5e9 100644 --- a/src/devices/cpu/alto2/a2mouse.h +++ b/src/devices/cpu/alto2/a2mouse.h @@ -8,8 +8,8 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2MOUSE_H_ -#define _A2MOUSE_H_ +#ifndef MAME_CPU_ALTO2_A2MOUSE_H +#define MAME_CPU_ALTO2_A2MOUSE_H /** * @brief PROM madr.a32 contains a lookup table to translate mouse motions * @@ -67,5 +67,5 @@ uint16_t mouse_read(); //!< return the mouse motion f void init_mouse(); //!< initialize the mouse context void exit_mouse(); //!< deinitialize the mouse context void reset_mouse(); //!< reset the mouse context -#endif // _A2MOUSE_H_ +#endif // MAME_CPU_ALTO2_A2MOUSE_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2mrt.h b/src/devices/cpu/alto2/a2mrt.h index 20b00724fc9..abaa4e92c24 100644 --- a/src/devices/cpu/alto2/a2mrt.h +++ b/src/devices/cpu/alto2/a2mrt.h @@ -8,12 +8,12 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2MRT_H_ -#define _A2MRT_H_ +#ifndef MAME_CPU_ALTO2_A2MRT_H +#define MAME_CPU_ALTO2_A2MRT_H void f1_early_mrt_block(); //!< F1 func: block the display word task void activate_mrt(); //!< called by the CPU when MRT becomes active void init_mrt(int task = task_mrt); //!< initialize the memory refresh task void exit_mrt(); //!< deinitialize the memory refresh task void reset_mrt(); //!< reset the memory refresh task -#endif // _A2MRT_H_ +#endif // MAME_CPU_ALTO2_A2MRT_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2part.h b/src/devices/cpu/alto2/a2part.h index 0bc8583bbbc..b9946a83f0c 100644 --- a/src/devices/cpu/alto2/a2part.h +++ b/src/devices/cpu/alto2/a2part.h @@ -8,11 +8,11 @@ #ifdef ALTO2_DEFINE_CONSTANTS #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2PART_H_ -#define _A2PART_H_ +#ifndef MAME_CPU_ALTO2_A2PART_H +#define MAME_CPU_ALTO2_A2PART_H void activate_part(); void init_part(int task = task_part); //!< initialize the parity task void exit_part(); //!< deinitialize the parity task void reset_part(); //!< reset the parity task -#endif // _A2PART_H_ +#endif // MAME_CPU_ALTO2_A2PART_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2ram.h b/src/devices/cpu/alto2/a2ram.h index 62745bdc5bd..adaafd63d05 100644 --- a/src/devices/cpu/alto2/a2ram.h +++ b/src/devices/cpu/alto2/a2ram.h @@ -11,8 +11,8 @@ #define ALTO2_UCODE_PAGE_MASK (ALTO2_UCODE_PAGE_SIZE-1) //!< mask for microcode ROM/RAM address #else // ALTO2_DEFINE_CONSTANTS -#ifndef _A2RAM_H_ -#define _A2RAM_H_ +#ifndef MAME_CPU_ALTO2_A2RAM_H +#define MAME_CPU_ALTO2_A2RAM_H //! BUS source for RAM related tasks enum { bs_ram_read_slocation= bs_task_3, //!< ram related: read S register @@ -41,5 +41,5 @@ void f1_late_load_srb(); //!< F1 func: load the S registe void init_ram(int task); //!< called by RAM related tasks void exit_ram(); //!< deinitialize the RAM related tasks void reset_ram(); //!< reset the RAM related tasks -#endif // A2RAM_H +#endif // MAME_CPU_ALTO2_A2RAM_H #endif // ALTO2_DEFINE_CONSTANTS diff --git a/src/devices/cpu/alto2/a2roms.h b/src/devices/cpu/alto2/a2roms.h index 1d1cc149660..1c9edd71791 100644 --- a/src/devices/cpu/alto2/a2roms.h +++ b/src/devices/cpu/alto2/a2roms.h @@ -5,8 +5,8 @@ * Xerox AltoII RAM PROM loading and decoding * *****************************************************************************/ -#ifndef _CPU_A2ROMS_H_ -#define _CPU_A2ROMS_H_ +#ifndef MAME_CPU_ALTO2_A2ROMS_H +#define MAME_CPU_ALTO2_A2ROMS_H /** @@ -39,4 +39,4 @@ typedef struct { #define DMAP_REVERSE_0_3 {3,2,1,0,} extern uint8_t* prom_load(running_machine& machine, const prom_load_t* prom, const uint8_t* src, int pages = 1, int segments = 1); -#endif // _CPU_A2ROMS_H_ +#endif // MAME_CPU_ALTO2_A2ROMS_H diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h index 603c5ac057a..172305574bd 100644 --- a/src/devices/cpu/alto2/alto2cpu.h +++ b/src/devices/cpu/alto2/alto2cpu.h @@ -5,8 +5,8 @@ * Xerox AltoII CPU core interface * *****************************************************************************/ -#ifndef MAME_DEVICES_CPU_ALTO2_H -#define MAME_DEVICES_CPU_ALTO2_H +#ifndef MAME_CPU_ALTO2_ALTO2CPU_H +#define MAME_CPU_ALTO2_ALTO2CPU_H #pragma once @@ -935,4 +935,4 @@ private: DECLARE_DEVICE_TYPE(ALTO2, alto2_cpu_device) -#endif // MAME_DEVICES_CPU_ALTO2_H +#endif // MAME_CPU_ALTO2_ALTO2CPU_H diff --git a/src/devices/video/poly.h b/src/devices/video/poly.h index 908a1954902..113e1c72589 100644 --- a/src/devices/video/poly.h +++ b/src/devices/video/poly.h @@ -57,7 +57,7 @@ //************************************************************************** // poly_manager is a template class -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> class poly_manager { public: @@ -69,26 +69,26 @@ public: struct vertex_t { vertex_t() { } - vertex_t(_BaseType _x, _BaseType _y) { x = _x; y = _y; } + vertex_t(BaseType _x, BaseType _y) { x = _x; y = _y; } - _BaseType x, y; // X, Y coordinates - _BaseType p[_MaxParams]; // interpolated parameters + BaseType x, y; // X, Y coordinates + BaseType p[MaxParams]; // interpolated parameters }; // a single extent describes a span and a list of parameter extents struct extent_t { - int16_t startx, stopx; // starting (inclusive)/ending (exclusive) endpoints + int16_t startx, stopx; // starting (inclusive)/ending (exclusive) endpoints struct { - _BaseType start; // parameter value at start - _BaseType dpdx; // dp/dx relative to start - } param[_MaxParams]; + BaseType start; // parameter value at start + BaseType dpdx; // dp/dx relative to start + } param[MaxParams]; void *userdata; // custom per-span data }; // delegate type for scanline callbacks - typedef delegate<void (int32_t, const extent_t &, const _ObjectData &, int)> render_delegate; + typedef delegate<void (int32_t, const extent_t &, const ObjectData &, int)> render_delegate; // construction/destruction poly_manager(running_machine &machine, uint8_t flags = 0); @@ -104,8 +104,8 @@ public: void wait(const char *debug_reason = "general"); // object data allocators - _ObjectData &object_data_alloc(); - _ObjectData &object_data_last() const { return m_object.last(); } + ObjectData &object_data_alloc(); + ObjectData &object_data_last() const { return m_object.last(); } // tiles uint32_t render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &v1, const vertex_t &v2); @@ -121,7 +121,7 @@ public: uint32_t render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v); // public helpers - int zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, _BaseType clipval); + int zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, BaseType clipval); private: poly_manager(running_machine &machine, screen_device *screen, uint8_t flags); @@ -141,7 +141,7 @@ private: struct polygon_info { poly_manager * m_owner; // pointer back to the poly manager - _ObjectData * m_object; // object data pointer + ObjectData * m_object; // object data pointer render_delegate m_callback; // callback to handle a scanline's worth of work }; @@ -222,18 +222,18 @@ private: }; // internal array types - typedef poly_array<polygon_info, _MaxPolys> polygon_array; - typedef poly_array<_ObjectData, _MaxPolys + 1> objectdata_array; - typedef poly_array<work_unit, std::min(_MaxPolys * UNITS_PER_POLY, 65535)> unit_array; + typedef poly_array<polygon_info, MaxPolys> polygon_array; + typedef poly_array<ObjectData, MaxPolys + 1> objectdata_array; + typedef poly_array<work_unit, std::min(MaxPolys * UNITS_PER_POLY, 65535)> unit_array; // round in a cross-platform consistent manner - inline int32_t round_coordinate(_BaseType value) + inline int32_t round_coordinate(BaseType value) { int32_t result = poly_floor(value); if ((value > 0) && (result < 0)) return INT_MAX-1; - return result + (value - _BaseType(result) > _BaseType(0.5)); + return result + (value - BaseType(result) > BaseType(0.5)); } // internal helpers @@ -286,22 +286,22 @@ private: // poly_manager - constructor //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(running_machine &machine, uint8_t flags) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::poly_manager(running_machine &machine, uint8_t flags) : poly_manager(machine, nullptr, flags) { } -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(screen_device &screen, uint8_t flags) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::poly_manager(screen_device &screen, uint8_t flags) : poly_manager(screen.machine(), &screen, flags) { } -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(running_machine &machine, screen_device *screen, uint8_t flags) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::poly_manager(running_machine &machine, screen_device *screen, uint8_t flags) : m_machine(machine) , m_screen(screen) , m_queue(nullptr) @@ -334,8 +334,8 @@ poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(runnin // ~poly_manager - destructor //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::~poly_manager() +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::~poly_manager() { #if KEEP_POLY_STATISTICS { @@ -372,8 +372,8 @@ poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::~poly_manager() // work_item_callback - process a work item //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -void *poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::work_item_callback(void *param, int threadid) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +void *poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::work_item_callback(void *param, int threadid) { while (1) { @@ -434,8 +434,8 @@ void *poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::work_item_cal // wait - stall until all work is complete //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -void poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::wait(const char *debug_reason) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +void poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::wait(const char *debug_reason) { osd_ticks_t time; @@ -468,7 +468,7 @@ void poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::wait(const cha // we need to preserve the last object data that was supplied if (m_object.count() > 0) { - _ObjectData temp = object_data_last(); + ObjectData temp = object_data_last(); m_object.reset(); m_object.next() = temp; } @@ -478,11 +478,11 @@ void poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::wait(const cha //------------------------------------------------- -// object_data_alloc - allocate a new _ObjectData +// object_data_alloc - allocate a new ObjectData //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -_ObjectData &poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::object_data_alloc() +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +ObjectData &poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::object_data_alloc() { // wait for a work item if we have to, then return the next item m_object.wait_for_space(); @@ -494,8 +494,8 @@ _ObjectData &poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::object // render_tile - render a tile //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2) { const vertex_t *v1 = &_v1; const vertex_t *v2 = &_v2; @@ -521,8 +521,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_til return 0; // determine total X extents - _BaseType minx = v1->x; - _BaseType maxx = v2->x; + BaseType minx = v1->x; + BaseType maxx = v2->x; if (minx > maxx) return 0; @@ -530,12 +530,12 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_til polygon_info &polygon = polygon_alloc(round_coordinate(minx), round_coordinate(maxx), v1yclip, v2yclip, callback); // compute parameter deltas - _BaseType param_dpdx[_MaxParams]; - _BaseType param_dpdy[_MaxParams]; + BaseType param_dpdx[MaxParams]; + BaseType param_dpdy[MaxParams]; if (paramcount > 0) { - _BaseType oox = poly_recip(v2->x - v1->x); - _BaseType ooy = poly_recip(v2->y - v1->y); + BaseType oox = poly_recip(v2->x - v1->x); + BaseType ooy = poly_recip(v2->y - v1->y); for (int paramnum = 0; paramnum < paramcount; paramnum++) { param_dpdx[paramnum] = oox * (v2->p[paramnum] - v1->p[paramnum]); @@ -591,7 +591,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_til for (int extnum = 0; extnum < unit.count_next; extnum++) { // compute the ending X based on which part of the triangle we're in - _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5); + BaseType fully = BaseType(curscan + extnum) + BaseType(0.5); // set the extent and update the total pixel count extent_t &extent = unit.extent[extnum]; @@ -601,7 +601,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_til pixels += istopx - istartx; // fill in the parameters for the extent - _BaseType fullstartx = _BaseType(istartx) + _BaseType(0.5); + BaseType fullstartx = BaseType(istartx) + BaseType(0.5); for (int paramnum = 0; paramnum < paramcount; paramnum++) { extent.param[paramnum].start = v1->p[paramnum] + fullstartx * param_dpdx[paramnum] + fully * param_dpdy[paramnum]; @@ -626,8 +626,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_til // given 3 vertexes //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2, const vertex_t &_v3) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2, const vertex_t &_v3) { const vertex_t *v1 = &_v1; const vertex_t *v2 = &_v2; @@ -666,8 +666,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri return 0; // determine total X extents - _BaseType minx = v1->x; - _BaseType maxx = v1->x; + BaseType minx = v1->x; + BaseType maxx = v1->x; if (v2->x < minx) minx = v2->x; else if (v2->x > maxx) maxx = v2->x; if (v3->x < minx) minx = v3->x; @@ -677,39 +677,39 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri polygon_info &polygon = polygon_alloc(round_coordinate(minx), round_coordinate(maxx), v1yclip, v3yclip, callback); // compute the slopes for each portion of the triangle - _BaseType dxdy_v1v2 = (v2->y == v1->y) ? _BaseType(0.0) : (v2->x - v1->x) / (v2->y - v1->y); - _BaseType dxdy_v1v3 = (v3->y == v1->y) ? _BaseType(0.0) : (v3->x - v1->x) / (v3->y - v1->y); - _BaseType dxdy_v2v3 = (v3->y == v2->y) ? _BaseType(0.0) : (v3->x - v2->x) / (v3->y - v2->y); + BaseType dxdy_v1v2 = (v2->y == v1->y) ? BaseType(0.0) : (v2->x - v1->x) / (v2->y - v1->y); + BaseType dxdy_v1v3 = (v3->y == v1->y) ? BaseType(0.0) : (v3->x - v1->x) / (v3->y - v1->y); + BaseType dxdy_v2v3 = (v3->y == v2->y) ? BaseType(0.0) : (v3->x - v2->x) / (v3->y - v2->y); // compute parameter starting points and deltas - _BaseType param_start[_MaxParams]; - _BaseType param_dpdx[_MaxParams]; - _BaseType param_dpdy[_MaxParams]; + BaseType param_start[MaxParams]; + BaseType param_dpdx[MaxParams]; + BaseType param_dpdy[MaxParams]; if (paramcount > 0) { - _BaseType a00 = v2->y - v3->y; - _BaseType a01 = v3->x - v2->x; - _BaseType a02 = v2->x*v3->y - v3->x*v2->y; - _BaseType a10 = v3->y - v1->y; - _BaseType a11 = v1->x - v3->x; - _BaseType a12 = v3->x*v1->y - v1->x*v3->y; - _BaseType a20 = v1->y - v2->y; - _BaseType a21 = v2->x - v1->x; - _BaseType a22 = v1->x*v2->y - v2->x*v1->y; - _BaseType det = a02 + a12 + a22; - - if (poly_abs(det) < _BaseType(0.00001)) + BaseType a00 = v2->y - v3->y; + BaseType a01 = v3->x - v2->x; + BaseType a02 = v2->x*v3->y - v3->x*v2->y; + BaseType a10 = v3->y - v1->y; + BaseType a11 = v1->x - v3->x; + BaseType a12 = v3->x*v1->y - v1->x*v3->y; + BaseType a20 = v1->y - v2->y; + BaseType a21 = v2->x - v1->x; + BaseType a22 = v1->x*v2->y - v2->x*v1->y; + BaseType det = a02 + a12 + a22; + + if (poly_abs(det) < BaseType(0.00001)) { for (int paramnum = 0; paramnum < paramcount; paramnum++) { - param_dpdx[paramnum] = _BaseType(0.0); - param_dpdy[paramnum] = _BaseType(0.0); + param_dpdx[paramnum] = BaseType(0.0); + param_dpdy[paramnum] = BaseType(0.0); param_start[paramnum] = v1->p[paramnum]; } } else { - _BaseType idet = poly_recip(det); + BaseType idet = poly_recip(det); for (int paramnum = 0; paramnum < paramcount; paramnum++) { param_dpdx[paramnum] = idet * (v1->p[paramnum]*a00 + v2->p[paramnum]*a10 + v3->p[paramnum]*a20); @@ -720,9 +720,9 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri } else // GCC 4.7.0 incorrectly claims these are uninitialized; humor it by initializing in the (hopefully rare) zero parameter case { - param_start[0] = _BaseType(0.0); - param_dpdx[0] = _BaseType(0.0); - param_dpdy[0] = _BaseType(0.0); + param_start[0] = BaseType(0.0); + param_dpdx[0] = BaseType(0.0); + param_dpdy[0] = BaseType(0.0); } // compute the X extents for each scanline @@ -749,9 +749,9 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri for (int extnum = 0; extnum < unit.count_next; extnum++) { // compute the ending X based on which part of the triangle we're in - _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5); - _BaseType startx = v1->x + (fully - v1->y) * dxdy_v1v3; - _BaseType stopx; + BaseType fully = BaseType(curscan + extnum) + BaseType(0.5); + BaseType startx = v1->x + (fully - v1->y) * dxdy_v1v3; + BaseType stopx; if (fully < v2->y) stopx = v1->x + (fully - v1->y) * dxdy_v1v2; else @@ -789,7 +789,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri pixels += istopx - istartx; // fill in the parameters for the extent - _BaseType fullstartx = _BaseType(istartx) + _BaseType(0.5); + BaseType fullstartx = BaseType(istartx) + BaseType(0.5); for (int paramnum = 0; paramnum < paramcount; paramnum++) { extent.param[paramnum].start = param_start[paramnum] + fullstartx * param_dpdx[paramnum] + fully * param_dpdy[paramnum]; @@ -814,8 +814,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri // triangles in a fan //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) { // iterate over vertices uint32_t pixels = 0; @@ -830,8 +830,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri // triangles in a strip //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) { // iterate over vertices uint32_t pixels = 0; @@ -846,8 +846,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri // render of an object, given specific extents //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents) { // clip coordinates int32_t v1yclip = std::max(startscanline, cliprect.top()); @@ -900,7 +900,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri extent.stopx = istopx; // fill in the parameters for the extent - for (int paramnum = 0; paramnum < _MaxParams; paramnum++) + for (int paramnum = 0; paramnum < MaxParams; paramnum++) { extent.param[paramnum].start = srcextent.param[paramnum].start; extent.param[paramnum].dpdx = srcextent.param[paramnum].dpdx; @@ -930,13 +930,13 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tri // to 32 vertices //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> template<int _NumVerts> -uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v) +uint32_t poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v) { // determine min/max Y vertices - _BaseType minx = v[0].x; - _BaseType maxx = v[0].x; + BaseType minx = v[0].x; + BaseType maxx = v[0].x; int minv = 0; int maxv = 0; for (int vertnum = 1; vertnum < _NumVerts; vertnum++) @@ -973,8 +973,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol int index; // index of this edge const vertex_t * v1; // pointer to first vertex const vertex_t * v2; // pointer to second vertex - _BaseType dxdy; // dx/dy along the edge - _BaseType dpdy[_MaxParams]; // per-parameter dp/dy values + BaseType dxdy; // dx/dy along the edge + BaseType dpdy[MaxParams]; // per-parameter dp/dy values }; poly_edge fedgelist[_NumVerts - 1]; poly_edge *edgeptr = &fedgelist[0]; @@ -989,7 +989,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol continue; // need dx/dy always, and parameter deltas as necessary - _BaseType ooy = poly_recip(edgeptr->v2->y - edgeptr->v1->y); + BaseType ooy = poly_recip(edgeptr->v2->y - edgeptr->v1->y); edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; for (int paramnum = 0; paramnum < paramcount; paramnum++) edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; @@ -1010,7 +1010,7 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol continue; // need dx/dy always, and parameter deltas as necessary - _BaseType ooy = poly_recip(edgeptr->v2->y - edgeptr->v1->y); + BaseType ooy = poly_recip(edgeptr->v2->y - edgeptr->v1->y); edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; for (int paramnum = 0; paramnum < paramcount; paramnum++) edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; @@ -1057,13 +1057,13 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol for (int extnum = 0; extnum < unit.count_next; extnum++) { // compute the ending X based on which part of the triangle we're in - _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5); + BaseType fully = BaseType(curscan + extnum) + BaseType(0.5); while (fully > ledge->v2->y && fully < v[maxv].y) ++ledge; while (fully > redge->v2->y && fully < v[maxv].y) ++redge; - _BaseType startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy; - _BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; + BaseType startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy; + BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; // clamp to full pixels int32_t istartx = round_coordinate(startx); @@ -1073,18 +1073,18 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol extent_t &extent = unit.extent[extnum]; if (paramcount > 0) { - _BaseType ldy = fully - ledge->v1->y; - _BaseType rdy = fully - redge->v1->y; - _BaseType oox = poly_recip(stopx - startx); + BaseType ldy = fully - ledge->v1->y; + BaseType rdy = fully - redge->v1->y; + BaseType oox = poly_recip(stopx - startx); // iterate over parameters for (int paramnum = 0; paramnum < paramcount; paramnum++) { - _BaseType lparam = ledge->v1->p[paramnum] + ldy * ledge->dpdy[paramnum]; - _BaseType rparam = redge->v1->p[paramnum] + rdy * redge->dpdy[paramnum]; - _BaseType dpdx = (rparam - lparam) * oox; + BaseType lparam = ledge->v1->p[paramnum] + ldy * ledge->dpdy[paramnum]; + BaseType rparam = redge->v1->p[paramnum] + rdy * redge->dpdy[paramnum]; + BaseType dpdx = (rparam - lparam) * oox; - extent.param[paramnum].start = lparam;// - (_BaseType(istartx) + 0.5f) * dpdx; + extent.param[paramnum].start = lparam;// - (BaseType(istartx) + 0.5f) * dpdx; extent.param[paramnum].dpdx = dpdx; } } @@ -1129,8 +1129,8 @@ uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_pol // a z coordinate //------------------------------------------------- -template<typename _BaseType, class _ObjectData, int _MaxParams, int _MaxPolys> -int poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, _BaseType clipval) +template<typename BaseType, class ObjectData, int MaxParams, int MaxPolys> +int poly_manager<BaseType, ObjectData, MaxParams, MaxPolys>::zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, BaseType clipval) { bool prevclipped = (v[numverts - 1].p[0] < clipval); vertex_t *nextout = outv; @@ -1145,7 +1145,7 @@ int poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::zclip_if_less(i { const vertex_t &v1 = v[(vertnum == 0) ? (numverts - 1) : (vertnum - 1)]; const vertex_t &v2 = v[vertnum]; - _BaseType frac = (clipval - v1.p[0]) / (v2.p[0] - v1.p[0]); + BaseType frac = (clipval - v1.p[0]) / (v2.p[0] - v1.p[0]); nextout->x = v1.x + frac * (v2.x - v1.x); nextout->y = v1.y + frac * (v2.y - v1.y); for (int paramnum = 0; paramnum < paramcount; paramnum++) @@ -1164,23 +1164,23 @@ int poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::zclip_if_less(i } -template<typename _BaseType, int _MaxParams> +template<typename BaseType, int MaxParams> struct frustum_clip_vertex { - _BaseType x, y, z, w; // A 3d coordinate already transformed by a projection matrix - _BaseType p[_MaxParams]; // Additional parameters to clip + BaseType x, y, z, w; // A 3d coordinate already transformed by a projection matrix + BaseType p[MaxParams]; // Additional parameters to clip }; -template<typename _BaseType, int _MaxParams> -int frustum_clip_w(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_vertices, frustum_clip_vertex<_BaseType, _MaxParams>* out) +template<typename BaseType, int MaxParams> +int frustum_clip_w(const frustum_clip_vertex<BaseType, MaxParams>* v, int num_vertices, frustum_clip_vertex<BaseType, MaxParams>* out) { if (num_vertices <= 0) return 0; - const _BaseType W_PLANE = 0.000001f; + const BaseType W_PLANE = 0.000001f; - frustum_clip_vertex<_BaseType, _MaxParams> clipv[10]; + frustum_clip_vertex<BaseType, MaxParams> clipv[10]; int clip_verts = 0; int previ = num_vertices - 1; @@ -1193,11 +1193,11 @@ int frustum_clip_w(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ if ((v1_side * v2_side) < 0) // edge goes through W plane { // insert vertex at intersection point - _BaseType wdiv = v[previ].w - v[i].w; + BaseType wdiv = v[previ].w - v[i].w; if (wdiv == 0.0f) // 0 edge means degenerate polygon return 0; - _BaseType t = fabs((W_PLANE - v[previ].w) / wdiv); + BaseType t = fabs((W_PLANE - v[previ].w) / wdiv); clipv[clip_verts].x = v[previ].x + ((v[i].x - v[previ].x) * t); clipv[clip_verts].y = v[previ].y + ((v[i].y - v[previ].y) * t); @@ -1205,7 +1205,7 @@ int frustum_clip_w(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ clipv[clip_verts].w = v[previ].w + ((v[i].w - v[previ].w) * t); // Interpolate the rest of the parameters - for (int pi = 0; pi < _MaxParams; pi++) + for (int pi = 0; pi < MaxParams; pi++) clipv[clip_verts].p[pi] = v[previ].p[pi] + ((v[i].p[pi] - v[previ].p[pi]) * t); ++clip_verts; @@ -1224,13 +1224,13 @@ int frustum_clip_w(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ } -template<typename _BaseType, int _MaxParams> -int frustum_clip(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_vertices, frustum_clip_vertex<_BaseType, _MaxParams>* out, int axis, int sign) +template<typename BaseType, int MaxParams> +int frustum_clip(const frustum_clip_vertex<BaseType, MaxParams>* v, int num_vertices, frustum_clip_vertex<BaseType, MaxParams>* out, int axis, int sign) { if (num_vertices <= 0) return 0; - frustum_clip_vertex<_BaseType, _MaxParams> clipv[10]; + frustum_clip_vertex<BaseType, MaxParams> clipv[10]; int clip_verts = 0; int previ = num_vertices - 1; @@ -1238,10 +1238,10 @@ int frustum_clip(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ve for (int i=0; i < num_vertices; i++) { int v1_side, v2_side; - _BaseType* v1a = (_BaseType*)&v[i]; - _BaseType* v2a = (_BaseType*)&v[previ]; + BaseType* v1a = (BaseType*)&v[i]; + BaseType* v2a = (BaseType*)&v[previ]; - _BaseType v1_axis, v2_axis; + BaseType v1_axis, v2_axis; if (sign) // +axis { @@ -1260,12 +1260,12 @@ int frustum_clip(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ve if ((v1_side * v2_side) < 0) // edge goes through W plane { // insert vertex at intersection point - _BaseType wdiv = ((v[previ].w - v2_axis) - (v[i].w - v1_axis)); + BaseType wdiv = ((v[previ].w - v2_axis) - (v[i].w - v1_axis)); if (wdiv == 0.0f) // 0 edge means degenerate polygon return 0; - _BaseType t = fabs((v[previ].w - v2_axis) / wdiv); + BaseType t = fabs((v[previ].w - v2_axis) / wdiv); clipv[clip_verts].x = v[previ].x + ((v[i].x - v[previ].x) * t); clipv[clip_verts].y = v[previ].y + ((v[i].y - v[previ].y) * t); @@ -1273,7 +1273,7 @@ int frustum_clip(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ve clipv[clip_verts].w = v[previ].w + ((v[i].w - v[previ].w) * t); // Interpolate the rest of the parameters - for (int pi = 0; pi < _MaxParams; pi++) + for (int pi = 0; pi < MaxParams; pi++) clipv[clip_verts].p[pi] = v[previ].p[pi] + ((v[i].p[pi] - v[previ].p[pi]) * t); ++clip_verts; @@ -1292,16 +1292,16 @@ int frustum_clip(const frustum_clip_vertex<_BaseType, _MaxParams>* v, int num_ve } -template<typename _BaseType, int _MaxParams> -int frustum_clip_all(frustum_clip_vertex<_BaseType, _MaxParams>* clip_vert, int num_vertices, frustum_clip_vertex<_BaseType, _MaxParams>* out) +template<typename BaseType, int MaxParams> +int frustum_clip_all(frustum_clip_vertex<BaseType, MaxParams>* clip_vert, int num_vertices, frustum_clip_vertex<BaseType, MaxParams>* out) { - num_vertices = frustum_clip_w<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert); - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 0, 0); // W <= -X - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 0, 1); // W <= +X - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 1, 0); // W <= -Y - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 1, 1); // W <= +X - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 2, 0); // W <= -Z - num_vertices = frustum_clip<_BaseType, _MaxParams>(clip_vert, num_vertices, clip_vert, 2, 1); // W <= +Z + num_vertices = frustum_clip_w<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert); + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 0, 0); // W <= -X + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 0, 1); // W <= +X + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 1, 0); // W <= -Y + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 1, 1); // W <= +X + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 2, 0); // W <= -Z + num_vertices = frustum_clip<BaseType, MaxParams>(clip_vert, num_vertices, clip_vert, 2, 1); // W <= +Z out = clip_vert; return num_vertices; } diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp index 94333cf6b87..b0c85c26bc6 100644 --- a/src/emu/drawgfx.cpp +++ b/src/emu/drawgfx.cpp @@ -2133,8 +2133,8 @@ void primask_copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, u32 n scrolling to one or more rows/columns -------------------------------------------------*/ -template<class _BitmapClass> -static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, u32 trans_pen) +template<class BitmapClass> +static inline void copyscrollbitmap_trans_common(BitmapClass &dest, const BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, u32 trans_pen) { // no rowscroll and no colscroll means no scroll if (numrows == 0 && numcols == 0) @@ -2236,8 +2236,8 @@ void copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, u32 num void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, u32 trans_pen) { copyscrollbitmap_trans_common(dest, src, numrows, rowscroll, numcols, colscroll, cliprect, trans_pen); } -template<class _BitmapClass> -static inline void prio_copyscrollbitmap_trans_common(_BitmapClass &dest, const _BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) +template<class BitmapClass> +static inline void prio_copyscrollbitmap_trans_common(BitmapClass &dest, const BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { // no rowscroll and no colscroll means no scroll if (numrows == 0 && numcols == 0) @@ -2339,8 +2339,8 @@ void prio_copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, u3 void prio_copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { prio_copyscrollbitmap_trans_common(dest, src, numrows, rowscroll, numcols, colscroll, cliprect, priority, pmask, trans_pen); } -template<class _BitmapClass> -static inline void primask_copyscrollbitmap_trans_common(_BitmapClass &dest, const _BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, u32 trans_pen, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff) +template<class BitmapClass> +static inline void primask_copyscrollbitmap_trans_common(BitmapClass &dest, const BitmapClass &src, u32 numrows, const s32 *rowscroll, u32 numcols, const s32 *colscroll, const rectangle &cliprect, u32 trans_pen, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff) { // no rowscroll and no colscroll means no scroll if (pcode == 0 && pmask == 0xff) diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h index 3302977f594..5b90a8fff96 100644 --- a/src/mame/includes/kaneko16.h +++ b/src/mame/includes/kaneko16.h @@ -121,13 +121,13 @@ protected: virtual void video_start() override; u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - template<class _BitmapClass> - u32 screen_update_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect); + template<class BitmapClass> + u32 screen_update_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - template<class _BitmapClass> - void fill_bitmap(_BitmapClass &bitmap, const rectangle &cliprect); + template<class BitmapClass> + void fill_bitmap(BitmapClass &bitmap, const rectangle &cliprect); void gtmr_oki1_map(address_map &map); void gtmr_oki2_map(address_map &map); diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h index 7f5fc5d007f..0e058e7bae7 100644 --- a/src/mame/includes/segag80v.h +++ b/src/mame/includes/segag80v.h @@ -78,10 +78,10 @@ public: DECLARE_WRITE_LINE_MEMBER(service_switch_w); DECLARE_WRITE_LINE_MEMBER(irq_ack_w); - template<int _Index> + template<int Index> DECLARE_WRITE_LINE_MEMBER( coin_w ) { - const u8 mask = 1 << _Index; + const u8 mask = 1 << Index; if (state == 0 && (m_coin_last_state & mask) != 0) m_coin_ff_state |= mask; diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h index 021fa988e58..79f0f433c35 100644 --- a/src/mame/includes/tatsumi.h +++ b/src/mame/includes/tatsumi.h @@ -69,8 +69,8 @@ protected: uint8_t tatsumi_hack_ym2151_r(); void tatsumi_reset(); - template<class _BitmapClass> void draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank); - template<class _BitmapClass> inline void roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, const rectangle &clip, + template<class BitmapClass> void draw_sprites(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank); + template<class BitmapClass> inline void roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, int scalex, int scaley, int rotate, int write_priority_only ); void update_cluts(int fake_palette_offset, int object_base, int length); diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h index e8ddb1ecf76..ffd480bbaef 100644 --- a/src/mame/includes/wecleman.h +++ b/src/mame/includes/wecleman.h @@ -173,8 +173,8 @@ private: int shadow_mode = 0, flags = 0; }; - template<class _BitmapClass> void do_blit_zoom32(_BitmapClass &bitmap, const rectangle &cliprect, const sprite_t &sprite); - template<class _BitmapClass> void sprite_draw(_BitmapClass &bitmap, const rectangle &cliprect); + template<class BitmapClass> void do_blit_zoom32(BitmapClass &bitmap, const rectangle &cliprect, const sprite_t &sprite); + template<class BitmapClass> void sprite_draw(BitmapClass &bitmap, const rectangle &cliprect); std::unique_ptr<sprite_t []> m_sprite_list; sprite_t **m_spr_ptr_list; diff --git a/src/mame/video/atarist.h b/src/mame/video/atarist.h index da66ff3a17e..4a057478ddd 100644 --- a/src/mame/video/atarist.h +++ b/src/mame/video/atarist.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Curt Coder, Olivier Galibert -#ifndef _VIDEO_ATARIST_H_ -#define _VIDEO_ATARIST_H_ +#ifndef MAME_VIDEO_ATARIST_H +#define MAME_VIDEO_ATARIST_H + +#pragma once // 32028400 also exists #define Y2 32084988.0 @@ -38,4 +40,4 @@ #define ATARIST_BLITTER_CTRL_HOG 0x40 #define ATARIST_BLITTER_CTRL_BUSY 0x80 -#endif +#endif // MAME_VIDEO_ATARIST_H diff --git a/src/mame/video/deco16ic.cpp b/src/mame/video/deco16ic.cpp index 31d8124096c..497ccc1bb37 100644 --- a/src/mame/video/deco16ic.cpp +++ b/src/mame/video/deco16ic.cpp @@ -422,10 +422,10 @@ TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info_b) by the Mame core. */ -template<class _BitmapClass> +template<class BitmapClass> void deco16ic_device::custom_tilemap_draw( screen_device &screen, - _BitmapClass &bitmap, + BitmapClass &bitmap, const rectangle &cliprect, tilemap_t *tilemap0_8x8, tilemap_t *tilemap0_16x16, @@ -443,7 +443,7 @@ void deco16ic_device::custom_tilemap_draw( u8 pmask ) { - typename _BitmapClass::pixel_t *dest; + typename BitmapClass::pixel_t *dest; int rgb; if (sizeof(*dest) == 2) rgb = 0; else rgb = 1; @@ -953,8 +953,8 @@ void deco16ic_device::print_debug_info(bitmap_ind16 &bitmap) /*****************************************************************************************/ -template<class _BitmapClass> -void deco16ic_device::tilemap_1_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) +template<class BitmapClass> +void deco16ic_device::tilemap_1_draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) { if (m_use_custom_pf1) { @@ -976,8 +976,8 @@ void deco16ic_device::tilemap_1_draw(screen_device &screen, bitmap_rgb32 &bitmap { tilemap_1_draw_common(screen, bitmap, cliprect, flags, priority, pmask); } -template<class _BitmapClass> -void deco16ic_device::tilemap_2_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) +template<class BitmapClass> +void deco16ic_device::tilemap_2_draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) { if (m_use_custom_pf2) { diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 15b1ad92c7d..29a1604f880 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -72,10 +72,10 @@ public: void pf_update(const u16 *rowscroll_1_ptr, const u16 *rowscroll_2_ptr); - template<class _BitmapClass> - void tilemap_1_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); - template<class _BitmapClass> - void tilemap_2_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); + template<class BitmapClass> + void tilemap_1_draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); + template<class BitmapClass> + void tilemap_2_draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); void tilemap_1_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); void tilemap_1_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); void tilemap_2_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff); @@ -101,10 +101,10 @@ public: /* used by nslasher */ void set_tilemap_colour_bank(int tmap, int bank); - template<class _BitmapClass> + template<class BitmapClass> void custom_tilemap_draw( screen_device &screen, - _BitmapClass &bitmap, + BitmapClass &bitmap, const rectangle &cliprect, tilemap_t *tilemap0_8x8, tilemap_t *tilemap0_16x16, diff --git a/src/mame/video/decospr.cpp b/src/mame/video/decospr.cpp index 3f76594f56c..a86c21976b8 100644 --- a/src/mame/video/decospr.cpp +++ b/src/mame/video/decospr.cpp @@ -182,8 +182,8 @@ void decospr_device::alloc_sprite_bitmap() screen().register_screen_bitmap(m_sprite_bitmap); } -template<class _BitmapClass> -void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords) +template<class BitmapClass> +void decospr_device::draw_sprites_common(BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords) { //printf("cliprect %04x, %04x\n", cliprect.top(), cliprect.bottom()); diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index c3a5d04b12e..03e652b15d2 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -67,8 +67,8 @@ protected: int m_transpen; // used by fncywld (tumbleb.cpp) private: - template<class _BitmapClass> - void draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords); + template<class BitmapClass> + void draw_sprites_common(BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords); required_device<gfxdecode_device> m_gfxdecode; }; diff --git a/src/mame/video/jalblend.cpp b/src/mame/video/jalblend.cpp index 6dc734c9229..dedc03fc866 100644 --- a/src/mame/video/jalblend.cpp +++ b/src/mame/video/jalblend.cpp @@ -94,8 +94,8 @@ rgb_t jaleco_blend_device::func(rgb_t dest, rgb_t addMe, u8 alpha) return rgb_t(r,g,b); } -template<class _BitmapClass> -void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, +template<class BitmapClass> +void jaleco_blend_device::drawgfx_common(palette_device &palette,BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy, u8 transparent_color) { @@ -146,7 +146,7 @@ void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &d for (int y = sy; y < ey; y++) { const u8 *source = source_base + y_index*gfx->rowbytes(); - typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); + typename BitmapClass::pixel_t *dest = &dest_bmp.pix(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { diff --git a/src/mame/video/jalblend.h b/src/mame/video/jalblend.h index cbaa0d1729b..059a774bf1a 100644 --- a/src/mame/video/jalblend.h +++ b/src/mame/video/jalblend.h @@ -28,8 +28,8 @@ protected: virtual void device_reset() override; private: - template<class _BitmapClass> - void drawgfx_common(palette_device &palette,_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, + template<class BitmapClass> + void drawgfx_common(palette_device &palette,BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy, u8 transparent_color); }; diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp index dffa617c968..93bf4ac03b5 100644 --- a/src/mame/video/k053246_k053247_k055673.cpp +++ b/src/mame/video/k053246_k053247_k055673.cpp @@ -258,8 +258,8 @@ int k053247_device::k053246_is_irq_enabled(void) * The rest of the sprite remains normal. */ -template<class _BitmapClass> -void k053247_device::k053247_sprites_draw_common(_BitmapClass &bitmap, const rectangle &cliprect) +template<class BitmapClass> +void k053247_device::k053247_sprites_draw_common(BitmapClass &bitmap, const rectangle &cliprect) { #define NUM_SPRITES 256 @@ -283,7 +283,7 @@ void k053247_device::k053247_sprites_draw_common(_BitmapClass &bitmap, const rec */ if (palette().shadows_enabled()) { - if (sizeof(typename _BitmapClass::pixel_t) == 4 && (palette().hilights_enabled())) + if (sizeof(typename BitmapClass::pixel_t) == 4 && (palette().hilights_enabled())) shdmask = 3; // enable all shadows and highlights else shdmask = 0; // enable default shadows diff --git a/src/mame/video/k053246_k053247_k055673.h b/src/mame/video/k053246_k053247_k055673.h index 62c93832217..48e47396c26 100644 --- a/src/mame/video/k053246_k053247_k055673.h +++ b/src/mame/video/k053246_k053247_k055673.h @@ -118,8 +118,8 @@ public: u32 code, u32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int alpha, int drawmode, int zcode, int pri, u8* gx_objzbuf, u8* gx_shdzbuf); - template<class _BitmapClass> - inline void k053247_draw_single_sprite_gxcore(_BitmapClass &bitmap , rectangle const &cliprect, + template<class BitmapClass> + inline void k053247_draw_single_sprite_gxcore(BitmapClass &bitmap , rectangle const &cliprect, u8* gx_objzbuf, u8* gx_shdzbuf, int code, u16* gx_spriteram, int offs, int color, int alpha, int drawmode, int zcode, int pri, int primask, int shadow, u8* drawmode_table, u8* shadowmode_table, int shdmask) @@ -292,8 +292,8 @@ public: } - template<class _BitmapClass> - void k053247_draw_yxloop_gx(_BitmapClass &bitmap, const rectangle &cliprect, + template<class BitmapClass> + void k053247_draw_yxloop_gx(BitmapClass &bitmap, const rectangle &cliprect, int code, int color, int height, int width, @@ -446,7 +446,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - template <class _BitmapClass> void k053247_sprites_draw_common(_BitmapClass &bitmap, const rectangle &cliprect); + template <class BitmapClass> void k053247_sprites_draw_common(BitmapClass &bitmap, const rectangle &cliprect); }; DECLARE_DEVICE_TYPE(K053247, k053247_device) diff --git a/src/mame/video/k054156_k054157_k056832.cpp b/src/mame/video/k054156_k054157_k056832.cpp index 3ccf6c03cd0..26bc2f48982 100644 --- a/src/mame/video/k054156_k054157_k056832.cpp +++ b/src/mame/video/k054156_k054157_k056832.cpp @@ -1100,8 +1100,8 @@ void k056832_device::b_w(offs_t offset, u8 data) } } -template<class _BitmapClass> -int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, int page, int flags ) +template<class BitmapClass> +int k056832_device::update_linemap( screen_device &screen, BitmapClass &bitmap, int page, int flags ) { if (m_page_tile_mode[page]) return(0); @@ -1218,8 +1218,8 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, return(0); } -template<class _BitmapClass> -void k056832_device::tilemap_draw_common( screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int layer, uint32_t flags, uint32_t priority ) +template<class BitmapClass> +void k056832_device::tilemap_draw_common( screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int layer, uint32_t flags, uint32_t priority ) { uint32_t last_dx, last_visible, new_colorbase, last_active; int sx, sy, ay, tx, ty, width, height; diff --git a/src/mame/video/k054156_k054157_k056832.h b/src/mame/video/k054156_k054157_k056832.h index 79bd099386f..a157a4eeba4 100644 --- a/src/mame/video/k054156_k054157_k056832.h +++ b/src/mame/video/k054156_k054157_k056832.h @@ -186,11 +186,11 @@ private: void change_rombank(); int rom_read_b(int offset, int blksize, int blksize2, int zerosec); - template<class _BitmapClass> - int update_linemap(screen_device &screen, _BitmapClass &bitmap, int page, int flags); + template<class BitmapClass> + int update_linemap(screen_device &screen, BitmapClass &bitmap, int page, int flags); - template<class _BitmapClass> - void tilemap_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int layer, uint32_t flags, uint32_t priority); + template<class BitmapClass> + void tilemap_draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int layer, uint32_t flags, uint32_t priority); void create_gfx(); void create_tilemaps(); diff --git a/src/mame/video/kaneko16.cpp b/src/mame/video/kaneko16.cpp index 1ac1ee998c8..4f4aff0ed8b 100644 --- a/src/mame/video/kaneko16.cpp +++ b/src/mame/video/kaneko16.cpp @@ -28,8 +28,8 @@ void kaneko16_state::video_start() /* Fill the bitmap with a single colour. This is wrong, but will work most of the times. To do it right, each pixel should be drawn with pen 0 of the bottomost tile that covers it (which is pretty tricky to do) */ -template<class _BitmapClass> -void kaneko16_state::fill_bitmap(_BitmapClass &bitmap, const rectangle &cliprect) +template<class BitmapClass> +void kaneko16_state::fill_bitmap(BitmapClass &bitmap, const rectangle &cliprect) { int pen = 0; @@ -41,7 +41,7 @@ void kaneko16_state::fill_bitmap(_BitmapClass &bitmap, const rectangle &cliprect } } - typename _BitmapClass::pixel_t *dest; + typename BitmapClass::pixel_t *dest; (void)dest; // shut up Visual Studio if (sizeof(*dest) == 2) { @@ -55,8 +55,8 @@ void kaneko16_state::fill_bitmap(_BitmapClass &bitmap, const rectangle &cliprect } -template<class _BitmapClass> -u32 kaneko16_state::screen_update_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect) +template<class BitmapClass> +u32 kaneko16_state::screen_update_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index d55557f69b5..1bd0c19d02f 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -546,12 +546,12 @@ void kaneko16_sprite_device::regs_w(offs_t offset, u16 data, u16 mem_mask) void kaneko16_sprite_device::copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { copybitmap_common(bitmap, cliprect, priority_bitmap); } void kaneko16_sprite_device::copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { copybitmap_common(bitmap, cliprect, priority_bitmap); } -template<class _BitmapClass> -void kaneko16_sprite_device::copybitmap_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) +template<class BitmapClass> +void kaneko16_sprite_device::copybitmap_common(BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { const pen_t *pal = gfx(0)->palette().pens(); - typename _BitmapClass::pixel_t *dstbitmap; + typename BitmapClass::pixel_t *dstbitmap; int rgb; if (sizeof(*dstbitmap) == 2) rgb = 0; else rgb = 1; diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index 69539361711..afe6af0c3e3 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -51,8 +51,8 @@ public: void copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); void copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); - template<class _BitmapClass> - void copybitmap_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); + template<class BitmapClass> + void copybitmap_common(BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); void bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes); diff --git a/src/mame/video/kaneko_tmap.cpp b/src/mame/video/kaneko_tmap.cpp index a81b349c9b3..f05bc3af220 100644 --- a/src/mame/video/kaneko_tmap.cpp +++ b/src/mame/video/kaneko_tmap.cpp @@ -194,8 +194,8 @@ void kaneko_view2_tilemap_device::vram_w(int _N_, offs_t offset, u16 data, u16 m void kaneko_view2_tilemap_device::prepare(bitmap_ind16 &bitmap, const rectangle &cliprect) { prepare_common(bitmap, cliprect); } void kaneko_view2_tilemap_device::prepare(bitmap_rgb32 &bitmap, const rectangle &cliprect) { prepare_common(bitmap, cliprect); } -template<class _BitmapClass> -void kaneko_view2_tilemap_device::prepare_common(_BitmapClass &bitmap, const rectangle &cliprect) +template<class BitmapClass> +void kaneko_view2_tilemap_device::prepare_common(BitmapClass &bitmap, const rectangle &cliprect) { const u16 layers_flip_0 = m_regs[4]; @@ -240,8 +240,8 @@ void kaneko_view2_tilemap_device::prepare_common(_BitmapClass &bitmap, const rec void kaneko_view2_tilemap_device::render_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri) { render_tilemap_common(screen, bitmap, cliprect, pri); } void kaneko_view2_tilemap_device::render_tilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri) { render_tilemap_common(screen, bitmap, cliprect, pri); } -template<class _BitmapClass> -void kaneko_view2_tilemap_device::render_tilemap_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri) +template<class BitmapClass> +void kaneko_view2_tilemap_device::render_tilemap_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int pri) { m_tmap[0]->draw(screen, bitmap, cliprect, pri, pri, 0); m_tmap[1]->draw(screen, bitmap, cliprect, pri, pri, 0); @@ -250,8 +250,8 @@ void kaneko_view2_tilemap_device::render_tilemap_common(screen_device &screen, _ void kaneko_view2_tilemap_device::render_tilemap_alt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int v2pri) { render_tilemap_alt_common(screen, bitmap, cliprect, pri, v2pri); } void kaneko_view2_tilemap_device::render_tilemap_alt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri, int v2pri) { render_tilemap_alt_common(screen, bitmap, cliprect, pri, v2pri); } -template<class _BitmapClass> -void kaneko_view2_tilemap_device::render_tilemap_alt_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, int v2pri) +template<class BitmapClass> +void kaneko_view2_tilemap_device::render_tilemap_alt_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int pri, int v2pri) { m_tmap[0]->draw(screen, bitmap, cliprect, pri, v2pri ? pri : 0, 0); m_tmap[1]->draw(screen, bitmap, cliprect, pri, v2pri ? pri : 0, 0); diff --git a/src/mame/video/kaneko_tmap.h b/src/mame/video/kaneko_tmap.h index c08d4876b2f..c8c9e4c1dbf 100644 --- a/src/mame/video/kaneko_tmap.h +++ b/src/mame/video/kaneko_tmap.h @@ -35,12 +35,12 @@ public: void vram_w(int _N_, offs_t offset, u16 data, u16 mem_mask = u16(~0)); // call to do the rendering etc. - template<class _BitmapClass> - void prepare_common(_BitmapClass &bitmap, const rectangle &cliprect); - template<class _BitmapClass> - void render_tilemap_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri); - template<class _BitmapClass> - void render_tilemap_alt_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, int v2pri); + template<class BitmapClass> + void prepare_common(BitmapClass &bitmap, const rectangle &cliprect); + template<class BitmapClass> + void render_tilemap_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int pri); + template<class BitmapClass> + void render_tilemap_alt_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int pri, int v2pri); void prepare(bitmap_ind16 &bitmap, const rectangle &cliprect); void prepare(bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/video/segaic24.cpp b/src/mame/video/segaic24.cpp index 08a3113e008..805f6bb4cb1 100644 --- a/src/mame/video/segaic24.cpp +++ b/src/mame/video/segaic24.cpp @@ -346,8 +346,8 @@ void segas24_tile_device::draw_rect(screen_device &screen, bitmap_ind16 &bm, bit } } -template<class _BitmapClass> -void segas24_tile_device::draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int layer, int lpri, int flags) +template<class BitmapClass> +void segas24_tile_device::draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int layer, int lpri, int flags) { uint16_t hscr = tile_ram[0x5000+(layer >> 1)]; uint16_t vscr = tile_ram[0x5004+(layer >> 1)]; diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h index 320c00b28de..e0877c36381 100644 --- a/src/mame/video/segaic24.h +++ b/src/mame/video/segaic24.h @@ -69,8 +69,8 @@ private: void draw_rect(screen_device &screen, bitmap_ind16 &bm, bitmap_ind8 &tm, bitmap_rgb32 &dm, const uint16_t *mask, uint16_t tpri, uint8_t lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2); - template<class _BitmapClass> - void draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int layer, int pri, int flags); + template<class BitmapClass> + void draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int layer, int pri, int flags); devcb_write16 m_xhout_write_cb; devcb_write16 m_xvout_write_cb; diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index f3354dc2355..6114e9cc8be 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -91,8 +91,8 @@ TILE_GET_INFO_MEMBER(tatsumi_state::get_text_tile_info) 0); } -template<class _BitmapClass> -inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, const rectangle &clip, +template<class BitmapClass> +inline void tatsumi_state::roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, int scalex, int scaley, int rotate, int write_priority_only ) { @@ -260,7 +260,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c for( y=sy; y<ey; y++ ) { const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes(); - typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); + typename BitmapClass::pixel_t *dest = &dest_bmp.pix(y); int x, x_index = x_index_base; for( x=sx; x<ex; x++ ) @@ -354,8 +354,8 @@ static void mycopyrozbitmap_core(bitmap_rgb32 &bitmap,bitmap_rgb32 &srcbitmap, } } -template<class _BitmapClass> -void tatsumi_state::draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank) +template<class BitmapClass> +void tatsumi_state::draw_sprites(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank) { int offs, flip_x, flip_y, x, y, color; int w, h, index, lines, scale, rotate; diff --git a/src/mame/video/tetrisp2.cpp b/src/mame/video/tetrisp2.cpp index 5270589b8eb..e843ccda810 100644 --- a/src/mame/video/tetrisp2.cpp +++ b/src/mame/video/tetrisp2.cpp @@ -316,8 +316,8 @@ VIDEO_START_MEMBER(tetrisp2_state,rocknms) /* sprites should be able to create shadows too, how? -- it appears that sprites which should be shadows are often rendered *UNDER* the tilemaps, maybe related? */ -template<class _BitmapClass> -static void tetrisp2_draw_sprites(_BitmapClass &bitmap, bitmap_ind8 &bitmap_pri, const rectangle &cliprect, u8* priority_ram, +template<class BitmapClass> +static void tetrisp2_draw_sprites(BitmapClass &bitmap, bitmap_ind8 &bitmap_pri, const rectangle &cliprect, u8* priority_ram, u16 *sprram_top, size_t sprram_size, ms32_sprite_device *chip, int flip, bool is_yuv) { u16 *source = sprram_top; diff --git a/src/mame/video/tmap038.cpp b/src/mame/video/tmap038.cpp index d12e5c2d9d1..9b007e28a2c 100644 --- a/src/mame/video/tmap038.cpp +++ b/src/mame/video/tmap038.cpp @@ -256,8 +256,8 @@ void tilemap038_device::prepare() void tilemap038_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 flags, u8 pri, u8 pri_mask) { draw_common(screen, bitmap, cliprect, flags, pri, pri_mask); } void tilemap038_device::draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 flags, u8 pri, u8 pri_mask) { draw_common(screen, bitmap, cliprect, flags, pri, pri_mask); } -template<class _BitmapClass> -void tilemap038_device::draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, u32 flags, u8 pri, u8 pri_mask) +template<class BitmapClass> +void tilemap038_device::draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, u32 flags, u8 pri, u8 pri_mask) { m_tmap->draw(screen, bitmap, cliprect, flags, pri, pri_mask); } diff --git a/src/mame/video/tmap038.h b/src/mame/video/tmap038.h index 28076199641..05e9755e554 100644 --- a/src/mame/video/tmap038.h +++ b/src/mame/video/tmap038.h @@ -27,8 +27,8 @@ public: void set_yoffs(int yoffs, int flipped_yoffs) { m_yoffs = yoffs; m_flipped_yoffs = flipped_yoffs; } // call to do the rendering etc. - template<class _BitmapClass> - void draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, u32 flags, u8 pri = 0, u8 pri_mask = ~0); + template<class BitmapClass> + void draw_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, u32 flags, u8 pri = 0, u8 pri_mask = ~0); void prepare(); void draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 flags, u8 pri = 0, u8 pri_mask = ~0); diff --git a/src/mame/video/wecleman.cpp b/src/mame/video/wecleman.cpp index c76dfa8d6a7..e771a50e8ce 100644 --- a/src/mame/video/wecleman.cpp +++ b/src/mame/video/wecleman.cpp @@ -153,8 +153,8 @@ void wecleman_state::sortsprite(int *idx_array, int *key_array, int size) } // draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation) -template<class _BitmapClass> -void wecleman_state::do_blit_zoom32(_BitmapClass &bitmap, const rectangle &cliprect, const sprite_t &sprite) +template<class BitmapClass> +void wecleman_state::do_blit_zoom32(BitmapClass &bitmap, const rectangle &cliprect, const sprite_t &sprite) { #define PRECISION_X 20 #define PRECISION_Y 20 @@ -241,7 +241,7 @@ void wecleman_state::do_blit_zoom32(_BitmapClass &bitmap, const rectangle &clipr { uint8_t *row_base = sprite.pen_data + (src_f0y>>PRECISION_Y) * sprite.line_offset; src_fpx = src_f0x; - typename _BitmapClass::pixel_t *dst_ptr = &bitmap.pix(sy); + typename BitmapClass::pixel_t *dst_ptr = &bitmap.pix(sy); if (bitmap.format() == BITMAP_FORMAT_RGB32) // Wec Le Mans { @@ -313,8 +313,8 @@ void wecleman_state::do_blit_zoom32(_BitmapClass &bitmap, const rectangle &clipr } } -template<class _BitmapClass> -void wecleman_state::sprite_draw(_BitmapClass &bitmap, const rectangle &cliprect) +template<class BitmapClass> +void wecleman_state::sprite_draw(BitmapClass &bitmap, const rectangle &cliprect) { int i; |