Skip to content

Commit b812a27

Browse files
authored
jaleco/jaleco_zoomspr.cpp: Tidy.
1 parent 5e707e3 commit b812a27

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/mame/jaleco/jaleco_zoomspr.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "jaleco_zoomspr.h"
2323

2424
DEFINE_DEVICE_TYPE(JALECO_ZOOMSPR, jaleco_zoomspr_device, "jaleco_zoomspr", "Jaleco Zoomable Sprite Generator")
25-
DEFINE_DEVICE_TYPE(JALECO_ZOOMSPR_BIGRUN, jaleco_zoomspr_bigrun_device, "jaleco_zoomspr_bigrun", "Jaleco Zoomable Sprite Generator (Big Run Configuration)")
25+
DEFINE_DEVICE_TYPE(JALECO_ZOOMSPR_BIGRUN, jaleco_zoomspr_bigrun_device, "jaleco_zoomspr_bigrun", "Jaleco Zoomable Sprite Generator (Big Run configuration)")
2626

2727
jaleco_zoomspr_device::jaleco_zoomspr_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
2828
: device_t(mconfig, type, tag, owner, clock)
@@ -105,16 +105,15 @@ constexpr int jaleco_zoomspr_shrink(int org, int fact)
105105

106106
void jaleco_zoomspr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority1, int priority2, const u16 *source, u32 ramsize)
107107
{
108-
const u16 *finish = source + ramsize;
108+
u16 const *const finish = source + ramsize;
109109

110110
/* Move the priority values in place */
111111
const bool high_sprites = (priority1 >= 16) | (priority2 >= 16);
112112
priority1 &= 0xf;
113113
priority2 &= 0xf;
114114

115-
int min_priority, max_priority;
116-
if (priority1 < priority2) { min_priority = priority1; max_priority = priority2; }
117-
else { min_priority = priority2; max_priority = priority1; }
115+
const int min_priority = std::min(priority1, priority2);
116+
const int max_priority = std::max(priority1, priority2);
118117

119118
for (; source < finish; source += 0x10 / 2)
120119
{
@@ -125,7 +124,7 @@ void jaleco_zoomspr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &
125124
const u16 attr = source[7];
126125
const int pri = (attr & 0x700) >> 8; // (attr & 0xf00) >> 8 ?
127126

128-
/* high byte is a priority information */
127+
/* high byte is priority information */
129128
if ((pri < min_priority) || (pri > max_priority))
130129
continue;
131130

@@ -237,17 +236,15 @@ void jaleco_zoomspr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &
237236

238237
void jaleco_zoomspr_bigrun_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority1, int priority2, const u16 *source, u32 ramsize)
239238
{
240-
const u16 *finish = source + ramsize;
239+
u16 const *const finish = source + ramsize;
241240

242241
/* Move the priority values in place */
243242
const bool high_sprites = (priority1 >= 16) | (priority2 >= 16);
244243
priority1 &= 0xf;
245244
priority2 &= 0xf;
246245

247-
int min_priority, max_priority;
248-
249-
if (priority1 < priority2) { min_priority = priority1; max_priority = priority2; }
250-
else { min_priority = priority2; max_priority = priority1; }
246+
const int min_priority = std::min(priority1, priority2);
247+
const int max_priority = std::max(priority1, priority2);
251248

252249
for (; source < finish; source += 0x10 / 2)
253250
{

0 commit comments

Comments
 (0)