summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/pokemini.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/pokemini.cpp')
-rw-r--r--src/mame/drivers/pokemini.cpp44
1 files changed, 18 insertions, 26 deletions
diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp
index 70205b76e24..d99f74beb14 100644
--- a/src/mame/drivers/pokemini.cpp
+++ b/src/mame/drivers/pokemini.cpp
@@ -1554,12 +1554,10 @@ void pokemini_state::prc_counter_callback()
/* Check if the background should be drawn */
if ( m_prc.background_enabled )
{
- int x, y;
- for ( y = 0; y < 8; y++ ) {
- for ( x = 0; x < 12; x++ ) {
+ for ( int y = 0; y < 8; y++ ) {
+ for ( int x = 0; x < 12; x++ ) {
uint8_t tile = m_p_ram[ 0x360 + ( y * m_prc.map_size_x ) + x ];
- int i;
- for( i = 0; i < 8; i++ ) {
+ for( int i = 0; i < 8; i++ ) {
m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space.read_byte( m_prc.bg_tiles + ( tile * 8 ) + i );
}
}
@@ -1569,9 +1567,7 @@ void pokemini_state::prc_counter_callback()
/* Check if the sprites should be drawn */
if ( m_prc.sprites_enabled )
{
- uint16_t spr;
-
- for ( spr = 0x35C; spr >= 0x300; spr -= 4 )
+ for ( uint16_t spr = 0x35C; spr >= 0x300; spr -= 4 )
{
int spr_x = ( m_p_ram[ spr + 0 ] & 0x7F ) - 16;
int spr_y = ( m_p_ram[ spr + 1 ] & 0x7F ) - 16;
@@ -1580,19 +1576,17 @@ void pokemini_state::prc_counter_callback()
if ( spr_flag & 0x08 )
{
- uint16_t gfx, mask;
uint32_t spr_base = m_prc.spr_tiles + spr_tile * 64;
- int i, j;
- for ( i = 0; i < 16; i++ )
+ for ( int i = 0; i < 16; i++ )
{
if ( spr_x + i >= 0 && spr_x + i < 96 )
{
int rel_x = ( spr_flag & 0x01 ) ? 15 - i : i;
uint32_t s = spr_base + ( ( rel_x & 0x08 ) << 2 ) + ( rel_x & 0x07 );
- mask = ~ ( space.read_byte( s ) | ( space.read_byte( s + 8 ) << 8 ) );
- gfx = space.read_byte( s + 16 ) | ( space.read_byte( s + 24 ) << 8 );
+ uint16_t mask = ~ ( space.read_byte( s ) | ( space.read_byte( s + 8 ) << 8 ) );
+ uint16_t gfx = space.read_byte( s + 16 ) | ( space.read_byte( s + 24 ) << 8 );
/* Are the colors inverted? */
if ( spr_flag & 0x04 )
@@ -1600,7 +1594,7 @@ void pokemini_state::prc_counter_callback()
gfx = ~gfx;
}
- for ( j = 0; j < 16; j++ )
+ for ( int j = 0; j < 16; j++ )
{
if ( spr_y + j >= 0 && spr_y + j < 64 )
{
@@ -1647,20 +1641,18 @@ void pokemini_state::prc_counter_callback()
/* Check if the rendered data should be copied to the LCD */
if ( m_prc.copy_enabled )
{
- int x, y;
-
- for( y = 0; y < 64; y += 8 ) {
- for( x = 0; x < 96; x++ ) {
+ for( int y = 0; y < 64; y += 8 ) {
+ for( int x = 0; x < 96; x++ ) {
uint8_t data = m_p_ram[ ( y * 12 ) + x ];
- m_bitmap.pix16(y + 0, x) = ( data & 0x01 ) ? 3 : 0;
- m_bitmap.pix16(y + 1, x) = ( data & 0x02 ) ? 3 : 0;
- m_bitmap.pix16(y + 2, x) = ( data & 0x04 ) ? 3 : 0;
- m_bitmap.pix16(y + 3, x) = ( data & 0x08 ) ? 3 : 0;
- m_bitmap.pix16(y + 4, x) = ( data & 0x10 ) ? 3 : 0;
- m_bitmap.pix16(y + 5, x) = ( data & 0x20 ) ? 3 : 0;
- m_bitmap.pix16(y + 6, x) = ( data & 0x40 ) ? 3 : 0;
- m_bitmap.pix16(y + 7, x) = ( data & 0x80 ) ? 3 : 0;
+ m_bitmap.pix(y + 0, x) = ( data & 0x01 ) ? 3 : 0;
+ m_bitmap.pix(y + 1, x) = ( data & 0x02 ) ? 3 : 0;
+ m_bitmap.pix(y + 2, x) = ( data & 0x04 ) ? 3 : 0;
+ m_bitmap.pix(y + 3, x) = ( data & 0x08 ) ? 3 : 0;
+ m_bitmap.pix(y + 4, x) = ( data & 0x10 ) ? 3 : 0;
+ m_bitmap.pix(y + 5, x) = ( data & 0x20 ) ? 3 : 0;
+ m_bitmap.pix(y + 6, x) = ( data & 0x40 ) ? 3 : 0;
+ m_bitmap.pix(y + 7, x) = ( data & 0x80 ) ? 3 : 0;
}
}