@@ -470,10 +470,10 @@ namespace Nes
470470
471471 const byte data[4 ] =
472472 {
473- ctrl,
474- clock & 0xFF ,
475- clock >> 8 ,
476- cycles.frameDivider
473+ static_cast <byte>( ctrl) ,
474+ static_cast <byte>( clock & 0xFF ) ,
475+ static_cast <byte>( clock >> 8 ) ,
476+ static_cast <byte>( cycles.frameDivider )
477477 };
478478
479479 state.Begin ( AsciiId<' F' ,' R' ,' M' >::V ).Write ( data ).End ();
@@ -494,9 +494,9 @@ namespace Nes
494494
495495 const byte data[3 ] =
496496 {
497- clock & 0xFF ,
498- clock >> 8 ,
499- cycles.frameIrqRepeat % 3
497+ static_cast <byte>( clock & 0xFF ) ,
498+ static_cast <byte>( clock >> 8 ) ,
499+ static_cast <byte>( cycles.frameIrqRepeat % 3 )
500500 };
501501
502502 state.Begin ( AsciiId<' I' ,' R' ,' Q' >::V ).Write ( data ).End ();
@@ -532,10 +532,10 @@ namespace Nes
532532 {
533533 const byte data[4 ] =
534534 {
535- cycles.rateCounter & 0xFFU ,
536- cycles.rateCounter >> 8 ,
537- cycles.rateCounter >> 16 ,
538- cycles.rateCounter >> 24 ,
535+ static_cast <byte>( cycles.rateCounter & 0xFFU ) ,
536+ static_cast <byte>( cycles.rateCounter >> 8 ) ,
537+ static_cast <byte>( cycles.rateCounter >> 16 ) ,
538+ static_cast <byte>( cycles.rateCounter >> 24 ) ,
539539 };
540540
541541 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
@@ -1065,7 +1065,7 @@ namespace Nes
10651065 const byte data[3 ] =
10661066 {
10671067 count,
1068- regs[0 ] | (reset ? 0x80U : 0x00U ),
1068+ static_cast <byte>( regs[0 ] | (reset ? 0x80U : 0x00U ) ),
10691069 regs[1 ]
10701070 };
10711071
@@ -1158,18 +1158,18 @@ namespace Nes
11581158 {
11591159 const byte data[12 ] =
11601160 {
1161- acc & 0xFFU ,
1162- acc >> 8 ,
1163- acc >> 16 ,
1164- acc >> 24 ,
1165- prev & 0xFFU ,
1166- prev >> 8 ,
1167- prev >> 16 ,
1168- prev >> 24 ,
1169- next & 0xFFU ,
1170- next >> 8 ,
1171- next >> 16 ,
1172- next >> 24 ,
1161+ static_cast <byte>( acc & 0xFFU ) ,
1162+ static_cast <byte>( acc >> 8 ) ,
1163+ static_cast <byte>( acc >> 16 ) ,
1164+ static_cast <byte>( acc >> 24 ) ,
1165+ static_cast <byte>( prev & 0xFFU ) ,
1166+ static_cast <byte>( prev >> 8 ) ,
1167+ static_cast <byte>( prev >> 16 ) ,
1168+ static_cast <byte>( prev >> 24 ) ,
1169+ static_cast <byte>( next & 0xFFU ) ,
1170+ static_cast <byte>( next >> 8 ) ,
1171+ static_cast <byte>( next >> 16 ) ,
1172+ static_cast <byte>( next >> 24 ) ,
11731173 };
11741174
11751175 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
@@ -1380,19 +1380,19 @@ namespace Nes
13801380 {
13811381 const byte data[13 ] =
13821382 {
1383- step,
1384- timer & 0xFFU ,
1385- timer >> 8 ,
1386- timer >> 16 ,
1387- timer >> 24 ,
1388- frequency & 0xFFU ,
1389- frequency >> 8 ,
1390- frequency >> 16 ,
1391- frequency >> 24 ,
1392- amp & 0xFFU ,
1393- amp >> 8 ,
1394- amp >> 16 ,
1395- amp >> 24 ,
1383+ static_cast <byte>( step) ,
1384+ static_cast <byte>( timer & 0xFFU ) ,
1385+ static_cast <byte>( timer >> 8 ) ,
1386+ static_cast <byte>( timer >> 16 ) ,
1387+ static_cast <byte>( timer >> 24 ) ,
1388+ static_cast <byte>( frequency & 0xFFU ) ,
1389+ static_cast <byte>( frequency >> 8 ) ,
1390+ static_cast <byte>( frequency >> 16 ) ,
1391+ static_cast <byte>( frequency >> 24 ) ,
1392+ static_cast <byte>( amp & 0xFFU ) ,
1393+ static_cast <byte>( amp >> 8 ) ,
1394+ static_cast <byte>( amp >> 16 ) ,
1395+ static_cast <byte>( amp >> 24 ) ,
13961396 };
13971397
13981398 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
@@ -1682,9 +1682,9 @@ namespace Nes
16821682 {
16831683 const byte data[4 ] =
16841684 {
1685- waveLength & 0xFFU ,
1686- waveLength >> 8 ,
1687- linearCounter | (uint (status) << 7 ),
1685+ static_cast <byte>( waveLength & 0xFFU ) ,
1686+ static_cast <byte>( waveLength >> 8 ) ,
1687+ static_cast <byte>( linearCounter | (uint (status) << 7 ) ),
16881688 linearCtrl
16891689 };
16901690
@@ -1696,15 +1696,15 @@ namespace Nes
16961696 {
16971697 const byte data[9 ] =
16981698 {
1699- step,
1700- timer & 0xFFU ,
1701- timer >> 8 ,
1702- timer >> 16 ,
1703- timer >> 24 ,
1704- amp & 0xFFU ,
1705- amp >> 8 ,
1706- amp >> 16 ,
1707- amp >> 24 ,
1699+ static_cast <byte>( step) ,
1700+ static_cast <byte>( timer & 0xFFU ) ,
1701+ static_cast <byte>( timer >> 8 ) ,
1702+ static_cast <byte>( timer >> 16 ) ,
1703+ static_cast <byte>( timer >> 24 ) ,
1704+ static_cast <byte>( amp & 0xFFU ) ,
1705+ static_cast <byte>( amp >> 8 ) ,
1706+ static_cast <byte>( amp >> 16 ) ,
1707+ static_cast <byte>( amp >> 24 ) ,
17081708 };
17091709
17101710 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
@@ -1925,12 +1925,12 @@ namespace Nes
19251925 {
19261926 const byte data[6 ] =
19271927 {
1928- bits & 0xFFU ,
1929- bits >> 8 ,
1930- timer & 0xFFU ,
1931- timer >> 8 ,
1932- timer >> 16 ,
1933- timer >> 24
1928+ static_cast <byte>( bits & 0xFFU ) ,
1929+ static_cast <byte>( bits >> 8 ) ,
1930+ static_cast <byte>( timer & 0xFFU ) ,
1931+ static_cast <byte>( timer >> 8 ) ,
1932+ static_cast <byte>( timer >> 16 ) ,
1933+ static_cast <byte>( timer >> 24 )
19341934 };
19351935
19361936 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
@@ -2147,21 +2147,21 @@ namespace Nes
21472147 {
21482148 const byte data[12 ] =
21492149 {
2150- dmcClock & 0xFF ,
2151- dmcClock >> 8 ,
2152- (
2153- ( ( regs.ctrl & REG0_FREQUENCY ) ) |
2154- ( ( regs.ctrl & REG0_LOOP ) ? 0x10U : 0U ) |
2155- ( ( regs.ctrl & REG0_IRQ_ENABLE ) ? 0x20U : 0U ) |
2156- ( ( dma.lengthCounter ) ? 0x40U : 0U )
2157- ),
2158- ( regs.address - 0xC000U ) >> 6 ,
2159- ( regs.lengthCounter - 1U ) >> 4 ,
2160- ( dma.address >> 0 & 0xFFU ),
2161- ( dma.address >> 8 & 0x7FU ) | (dma.buffered ? 0x80 : 0x00 ),
2162- dma.lengthCounter ? (dma.lengthCounter - 1U ) >> 4 : 0 ,
2163- dma.buffer ,
2164- 7 - out.shifter ,
2150+ static_cast <byte>( dmcClock & 0xFF ) ,
2151+ static_cast <byte>( dmcClock >> 8 ) ,
2152+ static_cast <byte>( (
2153+ ( ( regs.ctrl & REG0_FREQUENCY ) ) |
2154+ ( ( regs.ctrl & REG0_LOOP ) ? 0x10U : 0U ) |
2155+ ( ( regs.ctrl & REG0_IRQ_ENABLE ) ? 0x20U : 0U ) |
2156+ ( ( dma.lengthCounter ) ? 0x40U : 0U )
2157+ ) ),
2158+ static_cast <byte>(( regs.address - 0xC000U ) >> 6 ) ,
2159+ static_cast <byte>(( regs.lengthCounter - 1U ) >> 4 ) ,
2160+ static_cast <byte>(( dma.address >> 0 & 0xFFU ) ),
2161+ static_cast <byte>(( dma.address >> 8 & 0x7FU ) | (dma.buffered ? 0x80 : 0x00 ) ),
2162+ static_cast <byte>( dma.lengthCounter ? (dma.lengthCounter - 1U ) >> 4 : 0 ) ,
2163+ static_cast <byte>( dma.buffer ) ,
2164+ static_cast <byte>( 7 - out.shifter ) ,
21652165 out.buffer ,
21662166 out.dac ,
21672167 };
@@ -2172,10 +2172,10 @@ namespace Nes
21722172 {
21732173 const byte data[4 ] =
21742174 {
2175- linSample & 0xFFU ,
2176- linSample >> 8 ,
2177- dma.lengthCounter & 0xFFU ,
2178- dma.lengthCounter >> 8 ,
2175+ static_cast <byte>( linSample & 0xFFU ) ,
2176+ static_cast <byte>( linSample >> 8 ) ,
2177+ static_cast <byte>( dma.lengthCounter & 0xFFU ) ,
2178+ static_cast <byte>( dma.lengthCounter >> 8 ) ,
21792179 };
21802180
21812181 state.Begin ( AsciiId<' S' ,' 0' ,' 0' >::V ).Write ( data ).End ();
0 commit comments