mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Fixed a couple of float-to-double warnings. (nw)
This commit is contained in:
parent
f9495b9856
commit
4ef3203a49
@ -412,7 +412,7 @@ TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback)
|
||||
m_cymvol *= 0.94f;
|
||||
m_hihatvol *= 0.94f;
|
||||
|
||||
m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33); /* NO from msm5232 */
|
||||
m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33f); /* NO from msm5232 */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(equites_state::equites_c0f8_w)
|
||||
|
@ -1415,7 +1415,7 @@ WRITE8_MEMBER(mpu4_state::ic3ss_w)
|
||||
float num = (1720000/((m_t3l + 1)*(m_t3h + 1)));
|
||||
float denom1 = ((m_t3h *(m_t3l + 1)+ 1)/(2*(m_t1 + 1)));
|
||||
|
||||
int denom2 = denom1 +0.5;//need to round up, this gives same precision as chip
|
||||
int denom2 = denom1 + 0.5f;//need to round up, this gives same precision as chip
|
||||
int freq=num*denom2;
|
||||
|
||||
if (freq)
|
||||
|
@ -1887,9 +1887,9 @@ static void render_scanline(void *dest, INT32 scanline, const poly_extent *exten
|
||||
|
||||
void namcos23_state::render_apply_transform(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, poly_vertex &pv)
|
||||
{
|
||||
pv.x = (INT32((re->model.m[0]*INT64(xi) + re->model.m[1]*INT64(yi) + re->model.m[2]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0;
|
||||
pv.y = (INT32((re->model.m[3]*INT64(xi) + re->model.m[4]*INT64(yi) + re->model.m[5]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0;
|
||||
pv.p[0] = (INT32((re->model.m[6]*INT64(xi) + re->model.m[7]*INT64(yi) + re->model.m[8]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0;
|
||||
pv.x = (INT32((re->model.m[0]*INT64(xi) + re->model.m[1]*INT64(yi) + re->model.m[2]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0f;
|
||||
pv.y = (INT32((re->model.m[3]*INT64(xi) + re->model.m[4]*INT64(yi) + re->model.m[5]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0f;
|
||||
pv.p[0] = (INT32((re->model.m[6]*INT64(xi) + re->model.m[7]*INT64(yi) + re->model.m[8]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0f;
|
||||
}
|
||||
|
||||
void namcos23_state::render_apply_matrot(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, INT32 &x, INT32 &y, INT32 &z)
|
||||
@ -1975,7 +1975,7 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re)
|
||||
|
||||
render_apply_transform(u32_to_s24(v1), u32_to_s24(v2), u32_to_s24(v3), re, pv[i]);
|
||||
pv[i].p[1] = (((v1 >> 20) & 0xf00) | ((v2 >> 24 & 0xff))) + 0.5;
|
||||
pv[i].p[2] = (((v1 >> 16) & 0xf00) | ((v3 >> 24 & 0xff))) + 0.5 + tbase;
|
||||
pv[i].p[2] = (((v1 >> 16) & 0xf00) | ((v3 >> 24 & 0xff))) + 0.5f + tbase;
|
||||
|
||||
if(pv[i].p[0] > maxz)
|
||||
maxz = pv[i].p[0];
|
||||
@ -1999,12 +1999,12 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re)
|
||||
INT32 nz = u32_to_s10(norm);
|
||||
INT32 nrx, nry, nrz;
|
||||
render_apply_matrot(nx, ny, nz, re, nrx, nry, nrz);
|
||||
float lsi = float(nrx*m_light_vector[0] + nry*m_light_vector[1] + nrz*m_light_vector[2])/4194304.0;
|
||||
float lsi = float(nrx*m_light_vector[0] + nry*m_light_vector[1] + nrz*m_light_vector[2])/4194304.0f;
|
||||
if(lsi < 0)
|
||||
lsi = 0;
|
||||
|
||||
// Mapping taken out of a hat
|
||||
pv[i].p[3] = 0.25+1.5*lsi;
|
||||
pv[i].p[3] = 0.25f+1.5f*lsi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2022,7 +2022,7 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re)
|
||||
p->pv[i].p[2] *= w;
|
||||
p->pv[i].p[3] *= w;
|
||||
}
|
||||
p->zkey = 0.5*(minz+maxz);
|
||||
p->zkey = 0.5f*(minz+maxz);
|
||||
p->front = !(h & 0x00000001);
|
||||
p->rd.machine = &machine();
|
||||
p->rd.texture_lookup = render_texture_lookup_nocache_point;
|
||||
|
@ -1137,7 +1137,7 @@ void snes_state::machine_reset()
|
||||
}
|
||||
|
||||
/* Set STAT78 to NTSC or PAL */
|
||||
if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) >= 59.0f)
|
||||
if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) >= 59.0)
|
||||
m_ppu->m_stat78 = SNES_NTSC;
|
||||
else /* if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) == 50.0f) */
|
||||
m_ppu->m_stat78 = SNES_PAL;
|
||||
|
@ -825,9 +825,9 @@ int midzeus_state::zeus_fifo_process(const UINT32 *data, int numwords)
|
||||
data[2] & 0xffff, data[2] >> 16, data[0] & 0xffff,
|
||||
data[3] & 0xffff, data[3] >> 16, data[1] >> 16,
|
||||
data[4] & 0xffff, data[4] >> 16, data[1] & 0xffff,
|
||||
(float)(INT32)data[5] * (1.0f / 65536.0f),
|
||||
(float)(INT32)data[6] * (1.0f / 65536.0f),
|
||||
(float)(INT32)data[7] * (1.0f / (65536.0f * 512.0f)));
|
||||
(double)(INT32)data[5] * (1.0 / 65536.0),
|
||||
(double)(INT32)data[6] * (1.0 / 65536.0),
|
||||
(double)(INT32)data[7] * (1.0 / (65536.0 * 512.0)));
|
||||
}
|
||||
|
||||
/* extract the matrix from the raw data */
|
||||
@ -860,9 +860,9 @@ int midzeus_state::zeus_fifo_process(const UINT32 *data, int numwords)
|
||||
data[1] & 0xffff, data[2] & 0xffff, data[3] & 0xffff,
|
||||
data[1] >> 16, data[2] >> 16, data[3] >> 16,
|
||||
data[5] & 0xffff, data[6] & 0xffff, data[7] & 0xffff,
|
||||
(float)(INT32)data[10] * (1.0f / 65536.0f),
|
||||
(float)(INT32)data[11] * (1.0f / 65536.0f),
|
||||
(float)(INT32)data[12] * (1.0f / (65536.0f * 512.0f)));
|
||||
(double)(INT32)data[10] * (1.0 / 65536.0),
|
||||
(double)(INT32)data[11] * (1.0 / 65536.0),
|
||||
(double)(INT32)data[12] * (1.0 / (65536.0 * 512.0)));
|
||||
}
|
||||
|
||||
/* extract the first matrix from the raw data */
|
||||
@ -1178,7 +1178,7 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
|
||||
if (logit)
|
||||
{
|
||||
logerror("\t\t(%f,%f,%f) (%02X,%02X) (%03X,%03X,%03X) dot=%08X\n",
|
||||
vert[i].x * (1.0f / 65536.0f), vert[i].y * (1.0f / 65536.0f), vert[i].p[0] * (1.0f / 65536.0f),
|
||||
(double) vert[i].x * (1.0 / 65536.0), (double) vert[i].y * (1.0 / 65536.0), (double) vert[i].p[0] * (1.0 / 65536.0),
|
||||
(int)(vert[i].p[1] / 256.0f), (int)(vert[i].p[2] / 256.0f),
|
||||
(databuffer[10 + i] >> 20) & 0x3ff, (databuffer[10 + i] >> 10) & 0x3ff, (databuffer[10 + i] >> 0) & 0x3ff,
|
||||
dotnormal);
|
||||
@ -1202,7 +1202,7 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
|
||||
maxx = MAX(maxx, clipvert[i].x);
|
||||
maxy = MAX(maxy, clipvert[i].y);
|
||||
if (logit)
|
||||
logerror("\t\t\tTranslated=(%f,%f)\n", clipvert[i].x, clipvert[i].y);
|
||||
logerror("\t\t\tTranslated=(%f,%f)\n", (double) clipvert[i].x, (double) clipvert[i].y);
|
||||
}
|
||||
for (i = 0; i < numverts; i++)
|
||||
{
|
||||
|
@ -352,8 +352,8 @@ UINT32 midzeus2_state::screen_update_midzeus2(screen_device &screen, bitmap_rgb3
|
||||
|
||||
poly_wait(poly, "VIDEO_UPDATE");
|
||||
|
||||
if (machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); }
|
||||
if (machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); }
|
||||
if (machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", (double) zbase); }
|
||||
if (machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", (double) zbase); }
|
||||
|
||||
/* normal update case */
|
||||
if (!machine().input().code_pressed(KEYCODE_W))
|
||||
@ -808,12 +808,12 @@ int midzeus2_state::zeus2_fifo_process(const UINT32 *data, int numwords)
|
||||
{
|
||||
log_fifo_command(data, numwords, "");
|
||||
logerror("\n\t\tmatrix ( %8.2f %8.2f %8.2f ) ( %8.2f %8.2f %8.2f ) ( %8.2f %8.2f %8.2f )\n\t\tvector %8.2f %8.2f %8.5f\n",
|
||||
zeus_matrix[0][0], zeus_matrix[0][1], zeus_matrix[0][2],
|
||||
zeus_matrix[1][0], zeus_matrix[1][1], zeus_matrix[1][2],
|
||||
zeus_matrix[2][0], zeus_matrix[2][1], zeus_matrix[2][2],
|
||||
zeus_point[0],
|
||||
zeus_point[1],
|
||||
zeus_point[2]);
|
||||
(double) zeus_matrix[0][0], (double) zeus_matrix[0][1], (double) zeus_matrix[0][2],
|
||||
(double) zeus_matrix[1][0], (double) zeus_matrix[1][1], (double) zeus_matrix[1][2],
|
||||
(double) zeus_matrix[2][0], (double) zeus_matrix[2][1], (double) zeus_matrix[2][2],
|
||||
(double) zeus_point[0],
|
||||
(double) zeus_point[1],
|
||||
(double) zeus_point[2]);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -833,9 +833,9 @@ int midzeus2_state::zeus2_fifo_process(const UINT32 *data, int numwords)
|
||||
{
|
||||
log_fifo_command(data, numwords, "");
|
||||
logerror("\n\t\tvector %8.2f %8.2f %8.5f\n",
|
||||
zeus_point[0],
|
||||
zeus_point[1],
|
||||
zeus_point[2]);
|
||||
(double) zeus_point[0],
|
||||
(double) zeus_point[1],
|
||||
(double) zeus_point[2]);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -847,9 +847,9 @@ int midzeus2_state::zeus2_fifo_process(const UINT32 *data, int numwords)
|
||||
{
|
||||
log_fifo_command(data, numwords, " -- unknown control + hack clear screen\n");
|
||||
logerror("\t\tvector %8.2f %8.2f %8.5f\n",
|
||||
tms3203x_device::fp_to_float(data[1]),
|
||||
tms3203x_device::fp_to_float(data[2]),
|
||||
tms3203x_device::fp_to_float(data[3]));
|
||||
(double) tms3203x_device::fp_to_float(data[1]),
|
||||
(double) tms3203x_device::fp_to_float(data[2]),
|
||||
(double) tms3203x_device::fp_to_float(data[3]));
|
||||
|
||||
/* extract the translation point from the raw data */
|
||||
zeus_point2[0] = tms3203x_device::fp_to_float(data[1]);
|
||||
@ -1162,7 +1162,7 @@ In memory:
|
||||
if (logit)
|
||||
{
|
||||
logerror("\t\t(%f,%f,%f) (%02X,%02X)\n",
|
||||
vert[i].x, vert[i].y, vert[i].p[0],
|
||||
(double) vert[i].x, (double) vert[i].y, (double) vert[i].p[0],
|
||||
(int)(vert[i].p[1] / 256.0f), (int)(vert[i].p[2] / 256.0f));
|
||||
}
|
||||
}
|
||||
@ -1188,7 +1188,7 @@ In memory:
|
||||
maxx = MAX(maxx, clipvert[i].x);
|
||||
maxy = MAX(maxy, clipvert[i].y);
|
||||
if (logit)
|
||||
logerror("\t\t\tTranslated=(%f,%f)\n", clipvert[i].x, clipvert[i].y);
|
||||
logerror("\t\t\tTranslated=(%f,%f)\n", (double) clipvert[i].x, (double) clipvert[i].y);
|
||||
}
|
||||
for (i = 0; i < numverts; i++)
|
||||
{
|
||||
|
@ -900,8 +900,8 @@ void model1_state::push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
|
||||
#endif
|
||||
float dif=mult_vector(&vn, &view->light);
|
||||
float spec=compute_specular(&vn,&view->light,dif,lightmode);
|
||||
float ln=view->lightparams[lightmode].a + view->lightparams[lightmode].d*MAX(0.0,dif) + spec;
|
||||
int lumval=255.0*MIN(1.0,ln);
|
||||
float ln=view->lightparams[lightmode].a + view->lightparams[lightmode].d*MAX(0.0f,dif) + spec;
|
||||
int lumval=255.0f*MIN(1.0f,ln);
|
||||
int color=m_paletteram16[0x1000|(m_tgp_ram[tex_adr-0x40000] & 0x3ff)];
|
||||
int r=(color>>0x0)&0x1f;
|
||||
int g=(color>>0x5)&0x1f;
|
||||
@ -1059,7 +1059,7 @@ UINT16 *model1_state::push_direct(UINT16 *list)
|
||||
cquad.p[3] = p1;
|
||||
cquad.z = z;
|
||||
{
|
||||
int lumval=((float) (lum>>24)) * 2.0;
|
||||
int lumval=((float) (lum>>24)) * 2.0f;
|
||||
int color=m_paletteram16[0x1000|(m_tgp_ram[tex_adr-0x40000] & 0x3ff)];
|
||||
int r=(color>>0x0)&0x1f;
|
||||
int g=(color>>0x5)&0x1f;
|
||||
@ -1265,9 +1265,9 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
for(i=0;i<len;++i)
|
||||
{
|
||||
int v=readi(list+6+i*2);
|
||||
view->lightparams[i+adr].d=((float) (v&0xff))/255.0;
|
||||
view->lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0;
|
||||
view->lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0;
|
||||
view->lightparams[i+adr].d=((float) (v&0xff))/255.0f;
|
||||
view->lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0f;
|
||||
view->lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0f;
|
||||
view->lightparams[i+adr].p=(v>>24)&0xff;
|
||||
}
|
||||
list += 6+len*2;
|
||||
@ -1398,9 +1398,9 @@ void model1_state::tgp_scan()
|
||||
for(i=0;i<len;++i)
|
||||
{
|
||||
int v=readi(list+6+i*2);
|
||||
view->lightparams[i+adr].d=((float) (v&0xff))/255.0;
|
||||
view->lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0;
|
||||
view->lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0;
|
||||
view->lightparams[i+adr].d=((float) (v&0xff))/255.0f;
|
||||
view->lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0f;
|
||||
view->lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0f;
|
||||
view->lightparams[i+adr].p=(v>>24)&0xff;
|
||||
//LOG_TGP((" %02X\n",v));
|
||||
}
|
||||
|
@ -2293,9 +2293,9 @@ void powervr2_device::render_span(bitmap_rgb32 &bitmap, texinfo *ti,
|
||||
|
||||
if(0)
|
||||
fprintf(stderr, "%f %f %f %f -> %f %f | %f %f -> %f %f\n",
|
||||
y0,
|
||||
dy, dxldy, dxrdy, dy*dxldy, dy*dxrdy,
|
||||
xl, xr, xl + dy*dxldy, xr + dy*dxrdy);
|
||||
(double) y0,
|
||||
(double) dy, (double) dxldy, (double) dxrdy, (double) (dy*dxldy), (double) (dy*dxrdy),
|
||||
(double) xl, (double) xr, (double) (xl + dy*dxldy), (double) (xr + dy*dxrdy));
|
||||
xl += dy*dxldy;
|
||||
xr += dy*dxrdy;
|
||||
ul += dy*duldy;
|
||||
|
@ -607,10 +607,10 @@ static void draw_sprites(running_machine &machine, _BitmapClass &bitmap, const r
|
||||
{
|
||||
double theta = rotate * ((2.0 * M_PI) / 512.0);
|
||||
|
||||
int incxx = (int)((float)65536.0 * cos(theta));
|
||||
int incxy = (int)((float)65536.0 * -sin(theta));
|
||||
int incyx = (int)((float)65536.0 * sin(theta));
|
||||
int incyy = (int)((float)65536.0 * cos(theta));
|
||||
int incxx = (int)(65536.0 * cos(theta));
|
||||
int incxy = (int)(65536.0 * -sin(theta));
|
||||
int incyx = (int)(65536.0 * sin(theta));
|
||||
int incyy = (int)(65536.0 * cos(theta));
|
||||
|
||||
extent_x = extent_x >> 16;
|
||||
extent_y = extent_y >> 16;
|
||||
|
@ -577,7 +577,7 @@ void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_ti
|
||||
if (!floppy->mon_r()) {
|
||||
float tach = rpm[da] / 60 * SPINDLE_RATIO * MOTOR_POLES;
|
||||
|
||||
if (LOG_SCP) logerror("%s: motor speed %u rpm / tach %0.1f hz (DA %02x)\n", floppy->tag(), rpm[da], tach, da);
|
||||
if (LOG_SCP) logerror("%s: motor speed %u rpm / tach %0.1f hz (DA %02x)\n", floppy->tag(), rpm[da], (double) tach, da);
|
||||
|
||||
t_tach->adjust(attotime::from_hz(tach*2), 0, attotime::from_hz(tach*2));
|
||||
floppy->set_rpm(rpm[da]);
|
||||
|
Loading…
Reference in New Issue
Block a user