1
1
/***************************************************************************
3
Sega G-80 raster hardware
3
Sega G-80 raster hardware
5
5
***************************************************************************/
8
#include "vidhrdw/generic.h"
40
39
unsigned char backfill;
41
40
unsigned char fill_background;
42
41
unsigned int backshift;
43
struct mame_bitmap *horizbackbitmap;
44
struct mame_bitmap *vertbackbitmap;
42
mame_bitmap *horizbackbitmap;
43
mame_bitmap *vertbackbitmap;
45
44
} SEGAR_VID_STRUCT;
47
46
static SEGAR_VID_STRUCT sv;
65
64
palette_set_color(0,0,0,0);
67
66
/* Space Odyssey uses a static palette for the background, so
68
our choice of colors isn't exactly arbitrary. S.O. uses a
69
6-bit color setup, so we make sure that every 0x40 colors
70
gets a nice 6-bit palette.
67
our choice of colors isn't exactly arbitrary. S.O. uses a
68
6-bit color setup, so we make sure that every 0x40 colors
69
gets a nice 6-bit palette.
72
71
(All of the other G80 games overwrite the default colors on startup)
74
73
for (i = 0;i < (Machine->drv->total_colors - 1);i++)
76
75
int r = color_scale[((i & 0x30) >> 4)];
221
220
This is the refresh code that is common across all the G80 games. This
222
221
corresponds to the VIDEO I board.
223
222
***************************************************************************/
224
static void segar_common_screenrefresh(struct mame_bitmap *bitmap, int sprite_transparency, int copy_transparency)
223
static void segar_common_screenrefresh(mame_bitmap *bitmap, int sprite_transparency, int copy_transparency)
230
229
/* since last time and update it accordingly. */
231
230
for (offs = videoram_size - 1;offs >= 0;offs--)
233
if ((sv.char_refresh) && (sv.dirtychar[videoram[offs]]))
232
if ((sv.char_refresh) || (sv.dirtychar[videoram[offs]]))
234
233
dirtybuffer[offs]=1;
236
235
/* Redraw every character if our palette or scene changed */
324
323
/***************************************************************************
325
This port controls which background to draw for Space Odyssey. The temp_scene
324
This port controls which background to draw for Space Odyssey. The temp_scene
326
325
and temp_charset are analogous to control lines used to select the background.
327
326
If the background changed, refresh the screen.
328
327
***************************************************************************/
359
358
/***************************************************************************
360
This port controls the Space Odyssey background scrolling. Each write to
359
This port controls the Space Odyssey background scrolling. Each write to
361
360
this port scrolls the background by one bit. Faster speeds are achieved
362
361
by the program writing more often to this port. Oddly enough, the value
363
362
sent to this port also seems to indicate the speed, but the value itself
567
/* other ports are also used */
568
static UINT8 monster2_bbdata;
569
static UINT8 monster2_b9data;
571
WRITE8_HANDLER( monster2_bb_back_port_w )
573
unsigned int temp_scene, temp_charset;
576
monster2_bbdata=data;
578
temp_scene = (monster2_b9data & 0x03)|monster2_bbdata<<2;
579
temp_charset = monster2_b9data & 0x03;
581
temp_scene = 0x400*temp_scene;
583
sv.back_scene = temp_scene;
586
sv.back_charset = temp_charset;
589
/* printf("bb_data %02x\n",data); */
592
WRITE8_HANDLER( monster2_b9_back_port_w )
594
unsigned int temp_scene, temp_charset;
596
monster2_b9data = data;
599
temp_scene = (monster2_b9data & 0x03)|monster2_bbdata<<2;
600
temp_charset = monster2_b9data & 0x03;
602
temp_scene = 0x400*temp_scene;
604
/* printf("data %02x\n",data); */
606
if (sv.back_scene != temp_scene)
608
sv.back_scene = temp_scene;
611
if (sv.back_charset != temp_charset)
613
sv.back_charset = temp_charset;
617
/* This bit turns the background off and on. */
618
if ((data & 0x80) && (sv.background_enable==0))
620
sv.background_enable=1;
623
else if (((data & 0x80)==0) && (sv.background_enable==1))
625
sv.background_enable=0;
567
630
/***************************************************************************
568
631
Special refresh for Monster Bash, this code refreshes the static background.
569
632
***************************************************************************/
588
651
/* since last time and update it accordingly. */
589
652
for (offs = videoram_size - 1;offs >= 0;offs--)
591
if ((sv.char_refresh) && (sv.dirtychar[videoram[offs]]))
654
if ((sv.char_refresh) || (sv.dirtychar[videoram[offs]]))
592
655
dirtybuffer[offs]=1;
594
657
/* Redraw every background character if our palette or scene changed */
765
828
/* since last time and update it accordingly. */
766
829
for (offs = videoram_size - 1;offs >= 0;offs--)
768
if ((sv.char_refresh) && (sv.dirtychar[videoram[offs]]))
831
if ((sv.char_refresh) || (sv.dirtychar[videoram[offs]]))
769
832
dirtybuffer[offs]=1;
771
834
/* Redraw every background character if our palette or scene changed */