Previous 199869 Revisions Next

r40087 Thursday 30th July, 2015 at 16:26:46 UTC by Dirk Best
8080bw: use standard 3-bit palettes where applicable, clean up palette
handling
[src/mame/drivers]8080bw.c
[src/mame/includes]8080bw.h
[src/mame/video]8080bw.c

trunk/src/mame/drivers/8080bw.c
r248598r248599
421421   MCFG_SCREEN_MODIFY("screen")
422422   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2)
423423
424   MCFG_PALETTE_ADD_3BIT_RBG("palette")
425
424426   /* sound hardware */
425427   MCFG_FRAGMENT_ADD(invaders_samples_audio)
426428MACHINE_CONFIG_END
r248598r248599
623625   MCFG_SCREEN_MODIFY("screen")
624626   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_cosmo)
625627
628   MCFG_PALETTE_ADD_3BIT_RGB("palette")
629
626630   /* sound hardware */
627631   MCFG_FRAGMENT_ADD(invaders_samples_audio)
628632MACHINE_CONFIG_END
r248598r248599
893897   MCFG_SCREEN_MODIFY("screen")
894898   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2)
895899
900   MCFG_PALETTE_ADD_3BIT_RBG("palette")
901
896902   /* sound hardware */
897903   MCFG_SPEAKER_STANDARD_MONO("mono")
898904
r248598r248599
10561062   MCFG_SCREEN_MODIFY("screen")
10571063   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2)
10581064
1065   MCFG_PALETTE_ADD_3BIT_RBG("palette")
1066
10591067   /* sound hardware */
10601068   MCFG_SPEAKER_STANDARD_MONO("mono")
10611069
r248598r248599
13851393   MCFG_SCREEN_MODIFY("screen")
13861394   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_schaser)
13871395
1396   MCFG_PALETTE_ADD_3BIT_RBG("palette")
1397
13881398   /* sound hardware */
13891399   MCFG_SPEAKER_STANDARD_MONO("mono")
13901400
r248598r248599
14901500   MCFG_SCREEN_MODIFY("screen")
14911501   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_schasercv)
14921502
1503   MCFG_PALETTE_ADD_3BIT_RBG("palette")
1504
14931505   /* sound hardware */
14941506   MCFG_FRAGMENT_ADD(invaders_samples_audio)
14951507
r248598r248599
15701582   /* video hardware */
15711583   MCFG_SCREEN_MODIFY("screen")
15721584   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_sflush)
1585
1586   MCFG_PALETTE_ADD("palette", 8)
1587   MCFG_PALETTE_INIT_OWNER(_8080bw_state, sflush)
15731588MACHINE_CONFIG_END
15741589
15751590
r248598r248599
16701685   MCFG_SCREEN_MODIFY("screen")
16711686   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt)
16721687
1688   MCFG_PALETTE_ADD_3BIT_RGB("palette")
1689
16731690   /* sound hardware */
16741691   MCFG_SPEAKER_STANDARD_MONO("mono")
16751692
r248598r248599
17141731   MCFG_SCREEN_MODIFY("screen")
17151732   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_lupin3)
17161733
1734   MCFG_PALETTE_ADD_3BIT_RBG("palette")
1735
17171736   /* sound hardware */
17181737   MCFG_SPEAKER_STANDARD_MONO("mono")
17191738
r248598r248599
18651884   MCFG_SCREEN_MODIFY("screen")
18661885   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_polaris)
18671886
1887   MCFG_PALETTE_ADD_3BIT_RBG("palette")
1888
18681889   /* sound hardware */
18691890   MCFG_SPEAKER_STANDARD_MONO("mono")
18701891
r248598r248599
19892010   MCFG_SCREEN_MODIFY("screen")
19902011   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_ballbomb)
19912012
2013   MCFG_PALETTE_ADD_3BIT_RBG("palette")
2014
19922015   /* sound hardware */
19932016   MCFG_FRAGMENT_ADD(invaders_samples_audio)
19942017
r248598r248599
22302253   MCFG_SCREEN_MODIFY("screen")
22312254   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt)
22322255
2256   MCFG_PALETTE_ADD_3BIT_RGB("palette")
2257
22332258   /* sound hardware */
22342259   MCFG_FRAGMENT_ADD(invaders_samples_audio)
22352260
r248598r248599
22532278   MCFG_SCREEN_MODIFY("screen")
22542279   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt)
22552280
2281   MCFG_PALETTE_ADD_3BIT_RGB("palette")
2282
22562283   /* sound hardware */
22572284   MCFG_FRAGMENT_ADD(invaders_samples_audio)
22582285MACHINE_CONFIG_END
r248598r248599
23242351   MCFG_SCREEN_MODIFY("screen")
23252352   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2)
23262353
2354   MCFG_PALETTE_ADD_3BIT_RBG("palette")
2355
23272356   /* sound hardware */
23282357   MCFG_FRAGMENT_ADD(invaders_samples_audio)
23292358MACHINE_CONFIG_END
trunk/src/mame/includes/8080bw.h
r248598r248599
127127   DECLARE_MACHINE_START(claybust);
128128
129129   DECLARE_PALETTE_INIT(rollingc);
130   DECLARE_PALETTE_INIT(sflush);
130131
131132   UINT32 screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
132133   UINT32 screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
r248598r248599
150151   DECLARE_WRITE8_MEMBER(polaris_sh_port_3_w);
151152
152153   void schaser_reinit_555_time_remain();
153   void invadpt2_get_pens( pen_t *pens );
154   void sflush_get_pens( pen_t *pens );
155   void cosmo_get_pens( pen_t *pens );
156   inline void set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, const pen_t *pens, UINT8 color );
157   inline void set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, const pen_t *pens, UINT8 fore_color, UINT8 back_color );
158   void clear_extra_columns( bitmap_rgb32 &bitmap, const pen_t *pens, UINT8 color );
154   inline void set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, int color );
155   inline void set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, int fore_color, int back_color );
156   void clear_extra_columns( bitmap_rgb32 &bitmap, int color );
159157   void invmulti_bankswitch_restore();
160158};
161159
trunk/src/mame/video/8080bw.c
r248598r248599
1212#include "includes/8080bw.h"
1313
1414
15#define NUM_PENS    (8)
16
17
1815MACHINE_START_MEMBER(_8080bw_state,extra_8080bw_vh)
1916{
2017   save_item(NAME(m_flip_screen));
r248598r248599
4441}
4542
4643
47void _8080bw_state::invadpt2_get_pens( pen_t *pens )
44PALETTE_INIT_MEMBER( _8080bw_state, sflush )
4845{
49   offs_t i;
46   // standard 3-bit rbg palette
47   palette.palette_init_3bit_rbg(palette);
5048
51   for (i = 0; i < NUM_PENS; i++)
52   {
53      pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 2), pal1bit(i >> 1));
54   }
49   // but background color is bright blue
50   palette.set_pen_color(0, 0x80, 0x80, 0xff);
5551}
5652
5753
58void _8080bw_state::sflush_get_pens( pen_t *pens )
54inline void _8080bw_state::set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, int color )
5955{
60   offs_t i;
61
62   pens[0] = rgb_t(0x80, 0x80, 0xff);
63
64   for (i = 1; i < NUM_PENS; i++)
65   {
66      pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 2), pal1bit(i >> 1));
67   }
68}
69
70
71void _8080bw_state::cosmo_get_pens( pen_t *pens )
72{
73   offs_t i;
74
75   for (i = 0; i < NUM_PENS; i++)
76   {
77      pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
78   }
79}
80
81
82inline void _8080bw_state::set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, const pen_t *pens, UINT8 color )
83{
8456   if (y >= MW8080BW_VCOUNTER_START_NO_VBLANK)
8557   {
8658      if (m_flip_screen)
87         bitmap.pix32(MW8080BW_VBSTART - 1 - (y - MW8080BW_VCOUNTER_START_NO_VBLANK), MW8080BW_HPIXCOUNT - 1 - x) = pens[color];
59         bitmap.pix32(MW8080BW_VBSTART - 1 - (y - MW8080BW_VCOUNTER_START_NO_VBLANK), MW8080BW_HPIXCOUNT - 1 - x) = color;
8860      else
89         bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = pens[color];
61         bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = m_palette->pen_color(color);
9062   }
9163}
9264
9365
94inline void _8080bw_state::set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, const pen_t *pens, UINT8 fore_color, UINT8 back_color )
66inline void _8080bw_state::set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, int fore_color, int back_color )
9567{
9668   int i;
9769
9870   for (i = 0; i < 8; i++)
9971   {
100      set_pixel(bitmap, y, x, pens, (data & 0x01) ? fore_color : back_color);
72      set_pixel(bitmap, y, x, (data & 0x01) ? fore_color : back_color);
10173
10274      x = x + 1;
10375      data = data >> 1;
r248598r248599
10678
10779
10880/* this is needed as this driver doesn't emulate the shift register like mw8080bw does */
109void _8080bw_state::clear_extra_columns( bitmap_rgb32 &bitmap, const pen_t *pens, UINT8 color )
81void _8080bw_state::clear_extra_columns( bitmap_rgb32 &bitmap, int color )
11082{
11183   UINT8 x;
11284
r248598r248599
11789      for (y = MW8080BW_VCOUNTER_START_NO_VBLANK; y != 0; y++)
11890      {
11991         if (m_flip_screen)
120            bitmap.pix32(MW8080BW_VBSTART - 1 - (y - MW8080BW_VCOUNTER_START_NO_VBLANK), MW8080BW_HPIXCOUNT - 1 - (256 + x)) = pens[color];
92            bitmap.pix32(MW8080BW_VBSTART - 1 - (y - MW8080BW_VCOUNTER_START_NO_VBLANK), MW8080BW_HPIXCOUNT - 1 - (256 + x)) = m_palette->pen_color(color);
12193         else
122            bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, 256 + x) = pens[color];
94            bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, 256 + x) = m_palette->pen_color(color);
12395      }
12496   }
12597}
r248598r248599
12799
128100UINT32 _8080bw_state::screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
129101{
130   pen_t pens[NUM_PENS];
131   offs_t offs;
132   UINT8 *prom;
133   UINT8 *color_map_base;
102   UINT8 *prom = memregion("proms")->base();
103   UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
134104
135   invadpt2_get_pens(pens);
136
137   prom = memregion("proms")->base();
138   color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
139
140   for (offs = 0; offs < m_main_ram.bytes(); offs++)
105   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
141106   {
142107      UINT8 y = offs >> 5;
143108      UINT8 x = offs << 3;
r248598r248599
147112      UINT8 data = m_main_ram[offs];
148113      UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07;
149114
150      set_8_pixels(bitmap, y, x, data, pens, fore_color, 0);
115      set_8_pixels(bitmap, y, x, data, fore_color, 0);
151116   }
152117
153   clear_extra_columns(bitmap, pens, 0);
118   clear_extra_columns(bitmap, 0);
154119
155120   return 0;
156121}
r248598r248599
158123
159124UINT32 _8080bw_state::screen_update_ballbomb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
160125{
161   pen_t pens[NUM_PENS];
162   offs_t offs;
163   UINT8 *color_map_base;
164   UINT8 *prom;
126   UINT8 *prom = memregion("proms")->base();
127   UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
165128
166   invadpt2_get_pens(pens);
167
168   prom = memregion("proms")->base();
169   color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
170
171   for (offs = 0; offs < m_main_ram.bytes(); offs++)
129   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
172130   {
173131      UINT8 y = offs >> 5;
174132      UINT8 x = offs << 3;
r248598r248599
179137      UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07;
180138
181139      /* blue background */
182      set_8_pixels(bitmap, y, x, data, pens, fore_color, 2);
140      set_8_pixels(bitmap, y, x, data, fore_color, 2);
183141   }
184142
185   clear_extra_columns(bitmap, pens, 2);
143   clear_extra_columns(bitmap, 2);
186144
187145   return 0;
188146}
r248598r248599
190148
191149UINT32 _8080bw_state::screen_update_schaser(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
192150{
193   pen_t pens[NUM_PENS];
194   offs_t offs;
195   UINT8 *background_map_base;
151   UINT8 *background_map_base = memregion("proms")->base();
196152
197   invadpt2_get_pens(pens);
198
199   background_map_base = memregion("proms")->base();
200
201   for (offs = 0; offs < m_main_ram.bytes(); offs++)
153   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
202154   {
203155      UINT8 back_color = 0;
204156
r248598r248599
219171         back_color = (((back_data & 0x0c) == 0x0c) && m_schaser_background_select) ? 4 : 2;
220172      }
221173
222      set_8_pixels(bitmap, y, x, data, pens, fore_color, back_color);
174      set_8_pixels(bitmap, y, x, data, fore_color, back_color);
223175   }
224176
225   clear_extra_columns(bitmap, pens, m_schaser_background_disable ? 0 : 2);
177   clear_extra_columns(bitmap, m_schaser_background_disable ? 0 : 2);
226178
227179   return 0;
228180}
r248598r248599
230182
231183UINT32 _8080bw_state::screen_update_schasercv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
232184{
233   pen_t pens[NUM_PENS];
234   offs_t offs;
235
236   invadpt2_get_pens(pens);
237
238   for (offs = 0; offs < m_main_ram.bytes(); offs++)
185   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
239186   {
240187      UINT8 y = offs >> 5;
241188      UINT8 x = offs << 3;
r248598r248599
244191      UINT8 fore_color = m_colorram[offs & 0x1f9f] & 0x07;
245192
246193      /* blue background */
247      set_8_pixels(bitmap, y, x, data, pens, fore_color, 2);
194      set_8_pixels(bitmap, y, x, data, fore_color, 2);
248195   }
249196
250   clear_extra_columns(bitmap, pens, 2);
197   clear_extra_columns(bitmap, 2);
251198
252199   return 0;
253200}
r248598r248599
255202
256203UINT32 _8080bw_state::screen_update_rollingc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
257204{
258   offs_t offs;
259
260   for (offs = 0; offs < m_main_ram.bytes(); offs++)
205   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
261206   {
262207      UINT8 y = offs >> 5;
263208      UINT8 x = offs << 3;
r248598r248599
266211      UINT8 fore_color = m_colorram[offs & 0x1f1f] & 0x0f;
267212      UINT8 back_color = m_colorram2[offs & 0x1f1f] & 0x0f;
268213
269      set_8_pixels(bitmap, y, x, data, m_palette->pens(), fore_color, back_color);
214      set_8_pixels(bitmap, y, x, data, fore_color, back_color);
270215   }
271216
272   clear_extra_columns(bitmap, m_palette->pens(), 0);
217   clear_extra_columns(bitmap, 0);
273218
274219   return 0;
275220}
r248598r248599
277222
278223UINT32 _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
279224{
280   pen_t pens[NUM_PENS];
281   offs_t offs;
282   UINT8 *color_map_base;
283   UINT8 *cloud_gfx;
225   UINT8 *color_map_base = memregion("proms")->base();
226   UINT8 *cloud_gfx = memregion("user1")->base();
284227
285   invadpt2_get_pens(pens);
286
287   color_map_base = memregion("proms")->base();
288   cloud_gfx = memregion("user1")->base();
289
290   for (offs = 0; offs < m_main_ram.bytes(); offs++)
228   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
291229   {
292230      UINT8 y = offs >> 5;
293231      UINT8 x = offs << 3;
r248598r248599
309247
310248      if ((color_map_base[color_address] & 0x08) || (cloud_y >= 64))
311249      {
312         set_8_pixels(bitmap, y, x, data, pens, fore_color, back_color);
250         set_8_pixels(bitmap, y, x, data, fore_color, back_color);
313251      }
314252      else
315253      {
r248598r248599
332270               color = (cloud_gfx[cloud_gfx_offs] & bit) ? 7 : back_color;
333271            }
334272
335            set_pixel(bitmap, y, x, pens, color);
273            set_pixel(bitmap, y, x, color);
336274
337275            x = x + 1;
338276            data = data >> 1;
r248598r248599
340278      }
341279   }
342280
343   clear_extra_columns(bitmap, pens, 6);
281   clear_extra_columns(bitmap, 6);
344282
345283   return 0;
346284}
r248598r248599
348286
349287UINT32 _8080bw_state::screen_update_lupin3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
350288{
351   pen_t pens[NUM_PENS];
352   offs_t offs;
353
354   invadpt2_get_pens(pens);
355
356   for (offs = 0; offs < m_main_ram.bytes(); offs++)
289   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
357290   {
358291      UINT8 y = offs >> 5;
359292      UINT8 x = offs << 3;
r248598r248599
361294      UINT8 data = m_main_ram[offs];
362295      UINT8 fore_color = ~m_colorram[offs & 0x1f9f] & 0x07;
363296
364      set_8_pixels(bitmap, y, x, data, pens, fore_color, 0);
297      set_8_pixels(bitmap, y, x, data, fore_color, 0);
365298   }
366299
367   clear_extra_columns(bitmap, pens, 0);
300   clear_extra_columns(bitmap, 0);
368301
369302   return 0;
370303}
r248598r248599
372305
373306UINT32 _8080bw_state::screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
374307{
375   pen_t pens[NUM_PENS];
376   offs_t offs;
377
378   cosmo_get_pens(pens);
379
380   for (offs = 0; offs < m_main_ram.bytes(); offs++)
308   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
381309   {
382310      UINT8 y = offs >> 5;
383311      UINT8 x = offs << 3;
r248598r248599
387315      UINT8 data = m_main_ram[offs];
388316      UINT8 fore_color = m_colorram[color_address] & 0x07;
389317
390      set_8_pixels(bitmap, y, x, data, pens, fore_color, 0);
318      set_8_pixels(bitmap, y, x, data, fore_color, 0);
391319   }
392320
393   clear_extra_columns(bitmap, pens, 0);
321   clear_extra_columns(bitmap, 0);
394322
395323   return 0;
396324}
r248598r248599
398326
399327UINT32 _8080bw_state::screen_update_indianbt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
400328{
401   pen_t pens[NUM_PENS];
402   offs_t offs;
403   UINT8 *color_map_base;
404   UINT8 *prom;
329   UINT8 *prom = memregion("proms")->base();
330   UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
405331
406   cosmo_get_pens(pens);
407
408   prom = memregion("proms")->base();
409   color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000];
410
411   for (offs = 0; offs < m_main_ram.bytes(); offs++)
332   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
412333   {
413334      UINT8 y = offs >> 5;
414335      UINT8 x = offs << 3;
r248598r248599
418339      UINT8 data = m_main_ram[offs];
419340      UINT8 fore_color = color_map_base[color_address] & 0x07;
420341
421      set_8_pixels(bitmap, y, x, data, pens, fore_color, 0);
342      set_8_pixels(bitmap, y, x, data, fore_color, 0);
422343   }
423344
424   clear_extra_columns(bitmap, pens, 0);
345   clear_extra_columns(bitmap, 0);
425346
426347   return 0;
427348}
r248598r248599
429350
430351UINT32 _8080bw_state::screen_update_sflush(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
431352{
432   pen_t pens[NUM_PENS];
433   offs_t offs;
434
435   sflush_get_pens(pens);
436
437   for (offs = 0; offs < m_main_ram.bytes(); offs++)
353   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
438354   {
439355      UINT8 y = offs >> 5;
440356      UINT8 x = offs << 3;
r248598r248599
442358      UINT8 data = m_main_ram[offs];
443359      UINT8 fore_color = m_colorram[offs & 0x1f9f] & 0x07;
444360
445      set_8_pixels(bitmap, y, x, data, pens, fore_color, 0);
361      set_8_pixels(bitmap, y, x, data, fore_color, 0);
446362   }
447363
448   clear_extra_columns(bitmap, pens, 0);
364   clear_extra_columns(bitmap, 0);
449365
450366   return 0;
451367}
r248598r248599
453369
454370UINT32 _8080bw_state::screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
455371{
456   pen_t pens[2] = { rgb_t::black, rgb_t::white };
457   offs_t offs;
458
459   for (offs = 0; offs < m_main_ram.bytes(); offs++)
372   for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++)
460373   {
461      int i;
462
463374      UINT8 y = offs >> 5;
464375      UINT8 x = offs << 3;
465376
466377      UINT8 data = m_main_ram[offs];
467378
468      for (i = 0; i < 8; i++)
379      for (int i = 0; i < 8; i++)
469380      {
470381         if (m_flip_screen)
471            bitmap.pix32(191-y, 255-(x|i)) = pens[BIT(data, 7)];
382            bitmap.pix32(191-y, 255-(x|i)) = BIT(data, 7) ? rgb_t::white : rgb_t::black;
472383         else
473            bitmap.pix32(y, x|i) = pens[BIT(data, 7)];
384            bitmap.pix32(y, x|i) = BIT(data, 7) ? rgb_t::white : rgb_t::black;
474385         data <<= 1;
475386      }
476387   }
r248598r248599
481392
482393UINT32 _8080bw_state::screen_update_spacecom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
483394{
484   pen_t pens[2] = { rgb_t::black, rgb_t::white };
485   offs_t offs;
486
487   for (offs = 0; offs < 0x1c00; offs++)
395   for (offs_t offs = 0; offs < 0x1c00; offs++)
488396   {
489      int i;
490
491397      UINT8 y = offs >> 5;
492398      UINT8 x = offs << 3;
493399      UINT8 flipx = m_flip_screen ? 7 : 0;
494400
495401      UINT8 data = m_main_ram[offs+0x400];
496402
497      for (i = 0; i < 8; i++)
403      for (int i = 0; i < 8; i++)
498404      {
499         bitmap.pix32(y, x | (i^flipx)) = pens[data & 1];
405         bitmap.pix32(y, x | (i^flipx)) = BIT(data, 0) ? rgb_t::white : rgb_t::black;
500406         data >>= 1;
501407      }
502408   }


Previous 199869 Revisions Next


© 1997-2024 The MAME Team