3
3
/* **************************************************************************
4
4
5
5
Mini Vaders (Space Invaders's mini game)
6
- (c)1990 Taito Corporation
6
+ (c) 1990 Taito Corporation
7
7
8
8
Driver by Takahiro Nogi 1999/12/19 -
9
9
10
- This is a test board sold together with the cabinet (as required by law in
11
- Japan). It has no sound.
10
+ This is a test board sold together with cabinets (as required by law in
11
+ Japan). It has no sound.
12
12
13
13
PCB Layout
14
14
----------
@@ -45,18 +45,20 @@ class minivadr_state : public driver_device
45
45
{
46
46
public:
47
47
minivadr_state (const machine_config &mconfig, device_type type, const char *tag)
48
- : driver_device(mconfig, type, tag),
49
- m_videoram (*this , " videoram" ),
50
- m_maincpu(*this , " maincpu" ) { }
48
+ : driver_device(mconfig, type, tag)
49
+ , m_videoram(*this , " videoram" )
50
+ , m_maincpu(*this , " maincpu" )
51
+ {}
51
52
52
- void minivadr (machine_config &config);
53
+ void minivadr (machine_config &config) ATTR_COLD ;
53
54
54
55
private:
55
- /* memory pointers */
56
56
required_shared_ptr<uint8_t > m_videoram;
57
- uint32_t screen_update_minivadr (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
58
57
required_device<cpu_device> m_maincpu;
59
- void minivadr_map (address_map &map) ATTR_COLD;
58
+
59
+ uint32_t screen_update (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
60
+
61
+ void main_map (address_map &map) ATTR_COLD;
60
62
};
61
63
62
64
/* ************************************
@@ -65,32 +67,26 @@ class minivadr_state : public driver_device
65
67
*
66
68
*************************************/
67
69
68
- uint32_t minivadr_state::screen_update_minivadr (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
70
+ uint32_t minivadr_state::screen_update (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
69
71
{
70
- for (offs_t offs = 0 ; offs < m_videoram. bytes (); offs ++)
72
+ for (int y = cliprect. top (); y <= cliprect. bottom (); y ++)
71
73
{
72
- uint8_t x = offs << 3 ;
73
- const int y = offs >> 5 ;
74
- uint8_t data = m_videoram[offs];
75
-
76
- for (int i = 0 ; i < 8 ; i++)
74
+ uint8_t const *const src = &m_videoram[y << 5 ];
75
+ uint32_t *const dst = &bitmap.pix (y);
76
+ for (int x = cliprect.left (); x <= cliprect.right (); x++)
77
77
{
78
- pen_t pen = (data & 0x80 ) ? rgb_t::white () : rgb_t::black ();
79
- bitmap.pix (y, x) = pen;
80
-
81
- data <<= 1 ;
82
- x++;
78
+ dst[x] = BIT (src[x >> 3 ], ~x & 7 ) ? rgb_t::white () : rgb_t::black ();
83
79
}
84
80
}
85
81
86
82
return 0 ;
87
83
}
88
84
89
85
90
- void minivadr_state::minivadr_map (address_map &map)
86
+ void minivadr_state::main_map (address_map &map)
91
87
{
92
88
map (0x0000 , 0x1fff ).rom ();
93
- map (0xa000 , 0xbfff ).ram ().share (" videoram " );
89
+ map (0xa000 , 0xbfff ).ram ().share (m_videoram );
94
90
map (0xe008 , 0xe008 ).portr (" INPUTS" ).nopw (); // W - ???
95
91
}
96
92
@@ -110,20 +106,20 @@ INPUT_PORTS_END
110
106
111
107
void minivadr_state::minivadr(machine_config &config)
112
108
{
113
- /* basic machine hardware */
114
- Z80 (config, m_maincpu, XTAL ( 24'000'000 ) / 6 );
115
- m_maincpu->set_addrmap (AS_PROGRAM, &minivadr_state::minivadr_map );
109
+ // basic machine hardware
110
+ Z80 (config, m_maincpu, 24_MHz_XTAL / 6 );
111
+ m_maincpu->set_addrmap (AS_PROGRAM, &minivadr_state::main_map );
116
112
m_maincpu->set_vblank_int (" screen" , FUNC (minivadr_state::irq0_line_hold));
117
113
118
- /* video hardware */
114
+ // video hardware
119
115
screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
120
116
screen.set_refresh_hz (60 );
121
117
screen.set_vblank_time (ATTOSECONDS_IN_USEC (0 ));
122
118
screen.set_size (256 , 256 );
123
119
screen.set_visarea (0 , 256 -1 , 16 , 240 -1 );
124
- screen.set_screen_update (FUNC (minivadr_state::screen_update_minivadr ));
120
+ screen.set_screen_update (FUNC (minivadr_state::screen_update ));
125
121
126
- /* the board has no sound hardware */
122
+ // the board has no sound hardware
127
123
}
128
124
129
125
0 commit comments