Previous 199869 Revisions Next

r33038 Tuesday 28th October, 2014 at 14:40:22 UTC by David Haywood
psychic5.c: a little more 2014 (nw)
[src/mame/drivers]psychic5.c
[src/mame/includes]psychic5.h
[src/mame/video]psychic5.c

trunk/src/mame/drivers/psychic5.c
r241549r241550
408408static ADDRESS_MAP_START( psychic5_main_map, AS_PROGRAM, 8, psychic5_state )
409409   AM_RANGE(0x0000, 0x7fff) AM_ROM
410410   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
411   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(psychic5_paged_ram_r, psychic5_paged_ram_w)
411   AM_RANGE(0xc000, 0xdfff) AM_DEVICE("vrambank", address_map_bank_device, amap8)
412412   AM_RANGE(0xe000, 0xefff) AM_RAM
413413   AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch_byte_w)
414414   AM_RANGE(0xf001, 0xf001) AM_READNOP AM_WRITE(psychic5_coin_counter_w)
r241549r241550
421421   AM_RANGE(0xf800, 0xffff) AM_RAM
422422ADDRESS_MAP_END
423423
424
425static ADDRESS_MAP_START( psychic5_vrambank_map, AS_PROGRAM, 8, psychic5_state )
426   AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram")
427   AM_RANGE(0x1000, 0x1fff) AM_RAM
428
429   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SYSTEM")
430   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("P1")
431   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("P2")
432   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("DSW1")
433   AM_RANGE(0x2004, 0x2004) AM_READ_PORT("DSW2")
434
435   AM_RANGE(0x2308, 0x230c) AM_RAM AM_SHARE("bg_control")
436
437   AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(sprite_col_w) AM_SHARE("palette_ram_sp")
438   AM_RANGE(0x2800, 0x29ff) AM_RAM_WRITE(bg_col_w) AM_SHARE("palette_ram_bg")
439   AM_RANGE(0x2a00, 0x2bff) AM_RAM_WRITE(tx_col_w) AM_SHARE("palette_ram_tx")
440
441   AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram")
442
443ADDRESS_MAP_END
444
445
424446static ADDRESS_MAP_START( psychic5_sound_map, AS_PROGRAM, 8, psychic5_state )
425447   AM_RANGE(0x0000, 0x7fff) AM_ROM
426448   AM_RANGE(0xc000, 0xc7ff) AM_RAM
r241549r241550
450472   AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_SHARE("spriteram")
451473   AM_RANGE(0xd800, 0xdfff) AM_RAM
452474
453   AM_RANGE(0xe000, 0xffff) AM_READWRITE(psychic5_paged_ram_r, bombsa_paged_ram_w)
475   AM_RANGE(0xe000, 0xffff) AM_DEVICE("vrambank", address_map_bank_device, amap8)
454476ADDRESS_MAP_END
455477
456478static ADDRESS_MAP_START( bombsa_sound_map, AS_PROGRAM, 8, psychic5_state )
r241549r241550
466488   AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
467489ADDRESS_MAP_END
468490
491static ADDRESS_MAP_START( bombsa_vrambank_map, AS_PROGRAM, 8, psychic5_state )
492   AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram")
493   AM_RANGE(0x1000, 0x1fff) AM_RAM
469494
495   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SYSTEM")
496   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("P1")
497   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("P2")
498   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("DSW1")
499   AM_RANGE(0x2004, 0x2004) AM_READ_PORT("DSW2")
500
501   AM_RANGE(0x2308, 0x230c) AM_RAM AM_SHARE("bg_control")
502
503   AM_RANGE(0x3000, 0x31ff) AM_RAM_WRITE(sprite_col_w) AM_SHARE("palette_ram_sp")
504   AM_RANGE(0x3200, 0x33ff) AM_RAM_WRITE(bg_col_w) AM_SHARE("palette_ram_bg")
505   AM_RANGE(0x3400, 0x35ff) AM_RAM_WRITE(tx_col_w) AM_SHARE("palette_ram_tx")
506
507   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram")
508ADDRESS_MAP_END
509
510
470511static INPUT_PORTS_START( psychic5 )
471512   PORT_START("SYSTEM")    /* system control */
472513   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r241549r241550
655696   MCFG_CPU_PROGRAM_MAP(psychic5_main_map)
656697   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
657698
699   MCFG_DEVICE_ADD("vrambank", ADDRESS_MAP_BANK, 0)
700   MCFG_DEVICE_PROGRAM_MAP(psychic5_vrambank_map)
701   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
702   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
703   MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(14)
704   MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000)
705
658706   MCFG_CPU_ADD("audiocpu", Z80, XTAL_5MHz)
659707   MCFG_CPU_PROGRAM_MAP(psychic5_sound_map)
660708   MCFG_CPU_IO_MAP(psychic5_soundport_map)
r241549r241550
700748   MCFG_CPU_PROGRAM_MAP(bombsa_main_map)
701749   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
702750
751   MCFG_DEVICE_ADD("vrambank", ADDRESS_MAP_BANK, 0)
752   MCFG_DEVICE_PROGRAM_MAP(bombsa_vrambank_map)
753   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
754   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
755   MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(14)
756   MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000)
757
703758   MCFG_CPU_ADD("audiocpu", Z80, XTAL_5MHz )
704759   MCFG_CPU_PROGRAM_MAP(bombsa_sound_map)
705760   MCFG_CPU_IO_MAP(bombsa_soundport_map)
r241549r241550
718773   MCFG_PALETTE_ADD("palette", 768)
719774
720775   MCFG_VIDEO_START_OVERRIDE(psychic5_state,bombsa)
721   MCFG_VIDEO_RESET_OVERRIDE(psychic5_state,bombsa)
776   MCFG_VIDEO_RESET_OVERRIDE(psychic5_state,psychic5)
722777
723778   /* sound hardware */
724779   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/includes/psychic5.h
r241549r241550
1#include "machine/bankdev.h"
2
13class psychic5_state : public driver_device
24{
35public:
r241549r241550
79      m_maincpu(*this, "maincpu"),
810      m_audiocpu(*this, "audiocpu"),
911      m_gfxdecode(*this, "gfxdecode"),
10      m_palette(*this, "palette")  { }
12      m_palette(*this, "palette"),
13      m_vrambank(*this, "vrambank"),
14      m_fg_videoram(*this, "fg_videoram"),
15      m_bg_videoram(*this, "bg_videoram"),
16      m_bg_control(*this, "bg_control"),
1117
18      m_ps5_palette_ram_bg(*this, "palette_ram_bg"),
19      m_ps5_palette_ram_sp(*this, "palette_ram_sp"),
20      m_ps5_palette_ram_tx(*this, "palette_ram_tx")
21
22   { }
23
1224   UINT8 m_bank_latch;
1325   UINT8 m_ps5_vram_page;
1426   UINT8 m_bg_clip_mode;
1527   UINT8 m_title_screen;
16   UINT8 m_bg_status;
17   UINT8 *m_ps5_pagedram[2];
18   UINT8 *m_bg_videoram;
19   UINT8 *m_ps5_dummy_bg_ram;
20   UINT8 *m_ps5_io_ram;
21   UINT8 *m_ps5_palette_ram;
22   UINT8 *m_fg_videoram;
28
2329   tilemap_t *m_bg_tilemap;
2430   tilemap_t *m_fg_tilemap;
25   int m_bg_palette_ram_base;
26   int m_bg_palette_base;
2731   UINT16 m_palette_intensity;
2832   UINT8 m_bombsa_unknown;
2933   int m_sx1;
r241549r241550
3842   DECLARE_READ8_MEMBER(psychic5_vram_page_select_r);
3943   DECLARE_WRITE8_MEMBER(psychic5_vram_page_select_w);
4044   DECLARE_WRITE8_MEMBER(psychic5_title_screen_w);
41   DECLARE_READ8_MEMBER(psychic5_paged_ram_r);
42   DECLARE_WRITE8_MEMBER(psychic5_paged_ram_w);
43   DECLARE_WRITE8_MEMBER(bombsa_paged_ram_w);
4445   DECLARE_WRITE8_MEMBER(bombsa_unknown_w);
4546   TILE_GET_INFO_MEMBER(get_bg_tile_info);
4647   TILE_GET_INFO_MEMBER(get_fg_tile_info);
r241549r241550
4849   DECLARE_VIDEO_START(psychic5);
4950   DECLARE_VIDEO_RESET(psychic5);
5051   DECLARE_VIDEO_START(bombsa);
51   DECLARE_VIDEO_RESET(bombsa);
5252   UINT32 screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5353   UINT32 screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5454   TIMER_DEVICE_CALLBACK_MEMBER(psychic5_scanline);
55   void psychic5_change_palette(int color, int offset);
55   void psychic5_change_palette(int offset, UINT8* palram, int palbase);
5656   void psychic5_change_bg_palette(int color, int lo_offs, int hi_offs);
5757   void set_background_palette_intensity();
5858   void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
r241549r241550
6262   required_device<cpu_device> m_audiocpu;
6363   required_device<gfxdecode_device> m_gfxdecode;
6464   required_device<palette_device> m_palette;
65   optional_device<address_map_bank_device> m_vrambank;
66   required_shared_ptr<UINT8> m_fg_videoram;
67   required_shared_ptr<UINT8> m_bg_videoram;
68   required_shared_ptr<UINT8> m_bg_control;
69
70   required_shared_ptr<UINT8> m_ps5_palette_ram_bg;
71   required_shared_ptr<UINT8> m_ps5_palette_ram_sp;
72   required_shared_ptr<UINT8> m_ps5_palette_ram_tx;
73
74
75
76   DECLARE_WRITE8_MEMBER(fg_videoram_w);
77   DECLARE_WRITE8_MEMBER(bg_videoram_w);
78   DECLARE_WRITE8_MEMBER(sprite_col_w);
79   DECLARE_WRITE8_MEMBER(bg_col_w);
80   DECLARE_WRITE8_MEMBER(tx_col_w);
81
6582};
trunk/src/mame/video/psychic5.c
r241549r241550
1010#include "video/jalblend.h"
1111#include "includes/psychic5.h"
1212
13#define BG_SCROLLX_LSB      0x308
14#define BG_SCROLLX_MSB      0x309
15#define BG_SCROLLY_LSB      0x30a
16#define BG_SCROLLY_MSB      0x30b
17#define BG_SCREEN_MODE      0x30c
13
1814#define BG_PAL_INTENSITY_RG 0x1fe
1915#define BG_PAL_INTENSITY_BU 0x1ff
2016
r241549r241550
2319  Palette color
2420***************************************************************************/
2521
26void psychic5_state::psychic5_change_palette(int color, int offset)
22void psychic5_state::psychic5_change_palette(int offset, UINT8* palram, int palbase)
2723{
28   UINT8 lo = m_ps5_palette_ram[offset & ~1];
29   UINT8 hi = m_ps5_palette_ram[offset | 1];
30   jal_blend_set(color, hi & 0x0f);
31   m_palette->set_pen_color(color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
24   UINT8 lo = palram[(offset) & ~1];
25   UINT8 hi = palram[(offset) | 1];
26
27   int color = offset >> 1;
28
29   jal_blend_set(palbase + color, hi & 0x0f);
30   m_palette->set_pen_color(palbase + color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
3231}
3332
3433void psychic5_state::psychic5_change_bg_palette(int color, int lo_offs, int hi_offs)
r241549r241550
4443
4544   irgb = rgb_t(ir,ig,ib);
4645
47   lo = m_ps5_palette_ram[lo_offs];
48   hi = m_ps5_palette_ram[hi_offs];
46   lo = m_ps5_palette_ram_bg[lo_offs];
47   hi = m_ps5_palette_ram_bg[hi_offs];
4948
5049   /* red,green,blue component */
5150   r = pal4bit(lo >> 4);
r241549r241550
5352   b = pal4bit(hi >> 4);
5453
5554   /* Grey background enable */
56   if (m_bg_status & 2)
55   if (m_bg_control[4] & 2)
5756   {
5857      UINT8 val = (r + g + b) / 3;        /* Grey */
5958      /* Just leave plain grey */
r241549r241550
7372void psychic5_state::set_background_palette_intensity()
7473{
7574   int i;
76   m_palette_intensity = m_ps5_palette_ram[BG_PAL_INTENSITY_BU] |
77                  (m_ps5_palette_ram[BG_PAL_INTENSITY_RG]<<8);
75   m_palette_intensity = m_ps5_palette_ram_sp[BG_PAL_INTENSITY_BU] |
76                  (m_ps5_palette_ram_sp[BG_PAL_INTENSITY_RG]<<8);
7877
7978   /* for all of the background palette */
8079   for (i = 0; i < 0x100; i++)
81      psychic5_change_bg_palette(m_bg_palette_base+i,m_bg_palette_ram_base+i*2,m_bg_palette_ram_base+i*2+1);
80      psychic5_change_bg_palette(i+0x100,i*2,i*2+1);
8281}
8382
8483
r241549r241550
9493WRITE8_MEMBER(psychic5_state::psychic5_vram_page_select_w)
9594{
9695   m_ps5_vram_page = data & 1;
96   m_vrambank->set_bank(data);
9797}
9898
9999WRITE8_MEMBER(psychic5_state::psychic5_title_screen_w)
r241549r241550
101101   m_title_screen = data;
102102}
103103
104READ8_MEMBER(psychic5_state::psychic5_paged_ram_r)
105{
106   if (m_ps5_vram_page == 1)
107   {
108      switch (offset)
109      {
110         case 0x00: return ioport("SYSTEM")->read();
111         case 0x01: return ioport("P1")->read();
112         case 0x02: return ioport("P2")->read();
113         case 0x03: return ioport("DSW1")->read();
114         case 0x04: return ioport("DSW2")->read();
115      }
116   }
117104
118   return m_ps5_pagedram[m_ps5_vram_page][offset];
105
106WRITE8_MEMBER(psychic5_state::sprite_col_w)
107{
108   m_ps5_palette_ram_sp[offset] = data;
109   psychic5_change_palette(offset,m_ps5_palette_ram_sp, 0x000);
119110}
120111
121WRITE8_MEMBER(psychic5_state::psychic5_paged_ram_w)
112WRITE8_MEMBER(psychic5_state::bg_col_w)
122113{
123   m_ps5_pagedram[m_ps5_vram_page][offset] = data;
114   m_ps5_palette_ram_bg[offset] = data;
115   psychic5_change_palette(offset,m_ps5_palette_ram_bg, 0x100);
116}
124117
125   if (m_ps5_vram_page == 0)
126   {
127      if (offset <= 0xfff)
128         m_bg_tilemap->mark_tile_dirty(offset >> 1);
129   }
130   else
131   {
132      if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB)
133      {
134         UINT16 bg_scrollx = m_ps5_io_ram[BG_SCROLLX_LSB] | (m_ps5_io_ram[BG_SCROLLX_MSB] << 8);
135         m_bg_tilemap->set_scrollx(0, bg_scrollx);
136      }
137      else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB)
138      {
139         UINT16 bg_scrolly = m_ps5_io_ram[BG_SCROLLY_LSB] | (m_ps5_io_ram[BG_SCROLLY_MSB] << 8);
140         m_bg_tilemap->set_scrolly(0, bg_scrolly);
141      }
142      else if (offset == BG_SCREEN_MODE)
143      {
144         m_bg_status = m_ps5_io_ram[BG_SCREEN_MODE];
145      }
146      else if (offset >= 0x400 && offset <= 0x5ff)    /* Sprite color */
147         psychic5_change_palette(((offset >> 1) & 0xff)+0x000,offset-0x400);
148      else if (offset >= 0x800 && offset <= 0x9ff)    /* BG color */
149         psychic5_change_palette(((offset >> 1) & 0xff)+0x100,offset-0x400);
150      else if (offset >= 0xa00 && offset <= 0xbff)    /* Text color */
151         psychic5_change_palette(((offset >> 1) & 0xff)+0x200,offset-0x400);
152      else if (offset >= 0x1000)
153         m_fg_tilemap->mark_tile_dirty((offset-0x1000) >> 1);
154   }
118WRITE8_MEMBER(psychic5_state::tx_col_w)
119{
120   m_ps5_palette_ram_tx[offset] = data;
121   psychic5_change_palette(offset,m_ps5_palette_ram_tx, 0x200);
155122}
156123
157WRITE8_MEMBER(psychic5_state::bombsa_paged_ram_w)
124
125WRITE8_MEMBER(psychic5_state::fg_videoram_w)
158126{
159   m_ps5_pagedram[m_ps5_vram_page][offset] = data;
127   m_fg_videoram[offset] = data;
128   m_fg_tilemap->mark_tile_dirty(offset >> 1);
129}
160130
161   if (m_ps5_vram_page == 0)
162   {
163      m_bg_tilemap->mark_tile_dirty(offset >> 1);
164   }
165   else
166   {
167      if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB)
168      {
169         UINT16 bg_scrollx = m_ps5_io_ram[BG_SCROLLX_LSB] | (m_ps5_io_ram[BG_SCROLLX_MSB] << 8);
170         m_bg_tilemap->set_scrollx(0, bg_scrollx);
171      }
172      else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB)
173      {
174         UINT16 bg_scrolly = m_ps5_io_ram[BG_SCROLLY_LSB] | (m_ps5_io_ram[BG_SCROLLY_MSB] << 8);
175         m_bg_tilemap->set_scrolly(0, bg_scrolly);
176      }
177      else if (offset == BG_SCREEN_MODE)
178      {
179         m_bg_status = m_ps5_io_ram[BG_SCREEN_MODE];
180      }
181      else if (offset >= 0x0800 && offset <= 0x0fff)
182         m_fg_tilemap->mark_tile_dirty((offset & 0x7ff) >> 1);
183      else if (offset >= 0x1000 && offset <= 0x15ff)
184         psychic5_change_palette((offset >> 1) & 0x3ff, offset-0x1000);
185   }
131WRITE8_MEMBER( psychic5_state::bg_videoram_w )
132{   
133   m_bg_videoram[offset] = data;
134   m_bg_tilemap->mark_tile_dirty(offset >> 1);
186135}
187136
137
138
188139WRITE8_MEMBER(psychic5_state::bombsa_unknown_w)
189140{
190141   m_bombsa_unknown = data;
r241549r241550
224175
225176VIDEO_START_MEMBER(psychic5_state,psychic5)
226177{
227   /*                          info              offset             w   h  col  row */
228178   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
229179   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,  8,  8, 32, 32);
230
231180   m_fg_tilemap->set_transparent_pen(15);
232
233   m_ps5_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x2000);
234   m_ps5_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x2000);
235
236   m_bg_videoram  = &m_ps5_pagedram[0][0x0000];
237   m_ps5_dummy_bg_ram      = &m_ps5_pagedram[0][0x1000];
238   m_ps5_io_ram            = &m_ps5_pagedram[1][0x0000];
239   m_ps5_palette_ram       = &m_ps5_pagedram[1][0x0400];
240   m_fg_videoram  = &m_ps5_pagedram[1][0x1000];
241
242181   jal_blend_init(machine(), 1);
243182
244   m_bg_palette_ram_base = 0x400;
245   m_bg_palette_base = 0x100;
246183}
247184
248185VIDEO_START_MEMBER(psychic5_state,bombsa)
249186{
250   /*                          info              offset             w   h   col  row */
251187   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
252188   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,  8,  8,  32, 32);
253
254189   m_fg_tilemap->set_transparent_pen(15);
255
256   m_ps5_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x2000);
257   m_ps5_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x2000);
258
259   m_bg_videoram  = &m_ps5_pagedram[0][0x0000];
260   m_ps5_dummy_bg_ram      = &m_ps5_pagedram[0][0x1000];
261   m_ps5_io_ram            = &m_ps5_pagedram[1][0x0000];
262   m_fg_videoram  = &m_ps5_pagedram[1][0x0800];
263   m_ps5_palette_ram       = &m_ps5_pagedram[1][0x1000];
264
265190   jal_blend_init(machine(), 0);
266
267   m_bg_palette_ram_base = 0x000;
268   m_bg_palette_base = 0x000;
269191}
270192
271193VIDEO_RESET_MEMBER(psychic5_state,psychic5)
272194{
273195   m_bg_clip_mode = 0;
274196   m_ps5_vram_page = 0;
275   m_bg_status = 0;
276   memset(m_ps5_pagedram[0],0,0x2000);
277   memset(m_ps5_pagedram[1],0,0x2000);
278   m_palette_intensity = 0;
279}
280
281VIDEO_RESET_MEMBER(psychic5_state,bombsa)
282{
283   m_ps5_vram_page = 0;
284   m_bg_status = 0;
285197   m_title_screen = 0;
286   memset(m_ps5_pagedram[0],0,0x2000);
287   memset(m_ps5_pagedram[1],0,0x2000);
288198   m_palette_intensity = 0;
289199}
290200
291201
202
292203/***************************************************************************
293204  Screen refresh
294205***************************************************************************/
r241549r241550
406317
407318UINT32 psychic5_state::screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
408319{
320   UINT16 bg_scrollx = m_bg_control[0] | (m_bg_control[1] << 8);
321   m_bg_tilemap->set_scrollx(0, bg_scrollx);
322   UINT16 bg_scrolly = m_bg_control[2] | (m_bg_control[3] << 8);
323   m_bg_tilemap->set_scrolly(0, bg_scrolly);
324
409325   bitmap.fill(m_palette->black_pen(), cliprect);
410   if (m_bg_status & 1)    /* Backgound enable */
326   if (m_bg_control[4] & 1)    /* Backgound enable */
411327      draw_background(screen, bitmap, cliprect);
412328   if (!(m_title_screen & 1))
413329      draw_sprites(bitmap, cliprect);
r241549r241550
417333
418334UINT32 psychic5_state::screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
419335{
420   if (m_bg_status & 1)    /* Backgound enable */
336   UINT16 bg_scrollx = m_bg_control[0] | (m_bg_control[1] << 8);
337   m_bg_tilemap->set_scrollx(0, bg_scrollx);
338   UINT16 bg_scrolly = m_bg_control[2] | (m_bg_control[3] << 8);
339   m_bg_tilemap->set_scrolly(0, bg_scrolly);
340   bitmap.fill(m_palette->black_pen(), cliprect);
341
342   if (m_bg_control[4] & 1)    /* Backgound enable */
421343      m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
422344   else
423345      bitmap.fill(m_palette->pen(0x0ff), cliprect);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team