@@ -34,7 +34,7 @@ class freeway_state : public driver_device
34
34
, m_charram(*this , " charram" )
35
35
, m_colorram(*this , " colorram" )
36
36
, m_gfx_rom(*this , " gfx" )
37
- , m_color_rom(*this , " cor " )
37
+ , m_color_rom(*this , " color_rom " )
38
38
, m_lamps(*this , " lamp%u" , 1U )
39
39
{
40
40
}
@@ -64,6 +64,8 @@ class freeway_state : public driver_device
64
64
required_region_ptr<u8> m_color_rom;
65
65
66
66
output_finder<3 > m_lamps;
67
+
68
+ void palette_init (palette_device &palette) const ;
67
69
};
68
70
69
71
void freeway_state::machine_start ()
@@ -168,9 +170,33 @@ static INPUT_PORTS_START(freeway)
168
170
INPUT_PORTS_END
169
171
170
172
static GFXDECODE_START(gfx_freeway)
171
- GFXDECODE_ENTRY(" gfx" , 0 , gfx_8x8x3_planar, 0x0 , 1 )
173
+ GFXDECODE_ENTRY(" gfx" , 0 , gfx_8x8x3_planar, 0x0 , 0x20 )
172
174
GFXDECODE_END
173
175
176
+ // TODO: diverges between freeway and freewaya
177
+ // makes more sense with latter, different?
178
+ void freeway_state::palette_init(palette_device &palette) const
179
+ {
180
+ uint8_t const *const data = m_color_rom;
181
+
182
+ u8 value = 0 ;
183
+
184
+ for (int i = 0 ; i < palette.entries (); i++)
185
+ {
186
+ value = data[i + 0x7c00 ];
187
+ int const r = (value == 0xff ) ? 0 : 0x0e * BIT (value, 0 ) + 0x1f * BIT (value, 1 ) + 0x43 * BIT (value, 2 ) + 0x8f * BIT (value, 3 );
188
+
189
+ value = data[i + 0x7d00 ];
190
+ int const g = (value == 0xff ) ? 0 : 0x0e * BIT (value, 0 ) + 0x1f * BIT (value, 1 ) + 0x43 * BIT (value, 2 ) + 0x8f * BIT (value, 3 );
191
+
192
+ value = data[i + 0x7f00 ];
193
+ int const b = (value == 0xff ) ? 0 : 0x0e * BIT (value, 0 ) + 0x1f * BIT (value, 1 ) + 0x43 * BIT (value, 2 ) + 0x8f * BIT (value, 3 );
194
+
195
+ palette.set_pen_color (i, rgb_t (r, g, b));
196
+ }
197
+ }
198
+
199
+
174
200
void freeway_state::freeway (machine_config &config)
175
201
{
176
202
I8088 (config, m_maincpu, 10_MHz_XTAL / 2 ); // divider unknown
@@ -190,7 +216,7 @@ void freeway_state::freeway(machine_config &config)
190
216
screen.set_raw (10_MHz_XTAL / 2 , 320 , 0 , 256 , 312 , 0 , 256 );
191
217
screen.set_screen_update (" crtc" , FUNC (mc6845_device::screen_update));
192
218
193
- PALETTE (config, " palette" ). set_entries ( 0x10 );
219
+ PALETTE (config, " palette" , FUNC (freeway_state::palette_init), 0x100 );
194
220
GFXDECODE (config, " gfxdecode" , " palette" , gfx_freeway);
195
221
196
222
mc6845_device &crtc (MC6845 (config, " crtc" , 10_MHz_XTAL / 16 ));
@@ -231,7 +257,7 @@ ROM_START(freeway)
231
257
ROM_LOAD (" sb_52.bin" , 0x08000 , 0x8000 , CRC(f2b33acd) SHA1(e4786b4f00871d771aadacd9d6ec767691f4d939))
232
258
ROM_LOAD (" sb_53.bin" , 0x10000 , 0x8000 , CRC(50407ae6) SHA1(2c6c4803905bed5f27c6783f99a24f8dee62c19b))
233
259
234
- ROM_REGION (0x8000 , " cor " , 0 )
260
+ ROM_REGION (0x8000 , " color_rom " , 0 )
235
261
ROM_LOAD (" sb_cor.bin" , 0x0000 , 0x8000 , CRC(5f86a160) SHA1(f21b7e0e6a407371c252d6fde6fcb32a2682824c)) // all 0xFF fill until 0x7C00; valid data is only 4 bits wide
236
262
ROM_END
237
263
@@ -244,7 +270,7 @@ ROM_START(freewaya)
244
270
ROM_LOAD (" rgb 2fw 256 vr 512b" , 0x08000 , 0x8000 , CRC(ed1bb4d8) SHA1(78f9eced819c1fa269e685bb176671158ffcec26))
245
271
ROM_LOAD (" rgb 3fw 256 vr 512b" , 0x10000 , 0x8000 , CRC(c685c530) SHA1(deec9ce1df500f14b9ebd007d482473f97b3ecf3))
246
272
247
- ROM_REGION (0x8000 , " cor " , 0 )
273
+ ROM_REGION (0x8000 , " color_rom " , 0 )
248
274
ROM_LOAD (" color_431b_eprom-256" , 0x0000 , 0x8000 , CRC(e49fc782) SHA1(2c50cf644b7c6449880ed3d6e778ba116e123ae2)) // FIXED BITS (0000xxxx)
249
275
250
276
ROM_REGION (0x21ee , " nvram" , 0 )
0 commit comments