Previous 199869 Revisions Next

r31654 Thursday 14th August, 2014 at 14:18:28 UTC by Alex Jackson
Implemented the Namco Custom 116 palette and raster IRQ controller as a device,
and hooked it up to the namcos1, namconb1 and namcofl drivers [Alex Jackson]

digfx.c: Make some members protected instead of private to be less fascistic
and more consistent with other device_interfaces.
[src/emu]digfx.h
[src/mame]mame.mak
[src/mame/drivers]namcofl.c namconb1.c namcos1.c
[src/mame/includes]namcofl.h namconb1.h namcos1.h namcos2.h
[src/mame/video]c116.c* c116.h* c45.c namcofl.c namconb1.c namcos1.c

trunk/src/mame/includes/namcofl.h
r31653r31654
11#include "namcos2.h"
2#include "video/c116.h"
23
34#define NAMCOFL_HTOTAL      (288)   /* wrong */
45#define NAMCOFL_HBSTART (288)
r31653r31654
2223      : namcos2_shared_state(mconfig, type, tag),
2324      m_maincpu(*this,"maincpu"),
2425      m_mcu(*this,"mcu"),
25      m_shareram(*this, "shareram"),
26      m_generic_paletteram_32(*this, "paletteram"){ }
26      m_c116(*this,"c116"),
27      m_shareram(*this, "shareram") { }
2728
2829   required_device<cpu_device> m_maincpu;
2930   required_device<cpu_device> m_mcu;
31   required_device<namco_c116_device> m_c116;
3032   emu_timer *m_raster_interrupt_timer;
3133   UINT32 *m_workram;
3234   required_shared_ptr<UINT16> m_shareram;
33   required_shared_ptr<UINT32> m_generic_paletteram_32;
3435   UINT8 m_mcu_port6;
3536   UINT32 m_sprbank;
3637
r31653r31654
3839   DECLARE_READ32_MEMBER(fl_network_r);
3940   DECLARE_READ32_MEMBER(namcofl_sysreg_r);
4041   DECLARE_WRITE32_MEMBER(namcofl_sysreg_w);
41   DECLARE_WRITE32_MEMBER(namcofl_paletteram_w);
42   DECLARE_WRITE8_MEMBER(namcofl_c116_w);
4243   DECLARE_READ32_MEMBER(namcofl_share_r);
4344   DECLARE_WRITE32_MEMBER(namcofl_share_w);
4445   DECLARE_WRITE16_MEMBER(mcu_shared_w);
trunk/src/mame/includes/namcos1.h
r31653r31654
11#include "machine/c117.h"
22#include "sound/dac.h"
33#include "sound/namco.h"
4#include "video/c116.h"
45
56class namcos1_state : public driver_device
67{
r31653r31654
1112      m_subcpu(*this, "subcpu"),
1213      m_audiocpu(*this, "audiocpu"),
1314      m_mcu(*this, "mcu"),
15      m_c116(*this, "c116"),
1416      m_c117(*this, "c117"),
1517      m_dac(*this, "dac"),
1618      m_gfxdecode(*this, "gfxdecode"),
1719      m_palette(*this, "palette"),
18      m_paletteram(*this, "paletteram"),
1920      m_videoram(*this, "videoram"),
2021      m_spriteram(*this, "spriteram"),
2122      m_playfield_control(*this, "pfcontrol"),
r31653r31654
2627   required_device<cpu_device> m_subcpu;
2728   required_device<cpu_device> m_audiocpu;
2829   required_device<cpu_device> m_mcu;
30   required_device<namco_c116_device> m_c116;
2931   required_device<namco_c117_device> m_c117;
3032   required_device<dac_device> m_dac;
3133   required_device<gfxdecode_device> m_gfxdecode;
3234   required_device<palette_device> m_palette;
3335
34   required_shared_ptr<UINT8> m_paletteram;
3536   required_shared_ptr<UINT8> m_videoram;
3637   required_shared_ptr<UINT8> m_spriteram;
3738   required_shared_ptr<UINT8> m_playfield_control;
r31653r31654
6061   int m_strobe;
6162   int m_strobe_count;
6263   int m_stored_input[2];
63   UINT8 m_cus116[0x10];
6464   tilemap_t *m_bg_tilemap[6];
6565   UINT8 *m_tilemap_maskdata;
6666   int m_copy_sprites;
r31653r31654
117117   void namcos1_update_DACs();
118118   void namcos1_init_DACs();
119119   DECLARE_WRITE8_MEMBER( namcos1_videoram_w );
120   DECLARE_WRITE8_MEMBER( namcos1_paletteram_w );
121120   DECLARE_WRITE8_MEMBER( namcos1_spriteram_w );
122121   WRITE8_MEMBER( namcos1_3dcs_w );
123122   READ8_MEMBER( no_key_r );
trunk/src/mame/includes/namconb1.h
r31653r31654
66
77#include "namcos2.h"
88#include "machine/eeprompar.h"
9#include "video/c116.h"
910
1011#define NAMCONB1_HTOTAL     (288)   /* wrong */
1112#define NAMCONB1_HBSTART    (288)
r31653r31654
2728public:
2829   namconb1_state(const machine_config &mconfig, device_type type, const char *tag)
2930      : namcos2_shared_state(mconfig, type, tag),
30      m_maincpu(*this,"maincpu"),
31      m_mcu(*this,"mcu"),
31      m_maincpu(*this, "maincpu"),
32      m_mcu(*this, "mcu"),
33      m_c116(*this, "c116"),
3234      m_eeprom(*this, "eeprom"),
3335      m_spritebank32(*this, "spritebank32"),
3436      m_tilebank32(*this, "tilebank32"),
35      m_namconb_shareram(*this, "namconb_share"),
36      m_generic_paletteram_32(*this, "paletteram") { }
37      m_namconb_shareram(*this, "namconb_share") { }
3738
3839   required_device<cpu_device> m_maincpu;
3940   required_device<cpu_device> m_mcu;
41   required_device<namco_c116_device> m_c116;
4042   required_device<eeprom_parallel_28xx_device> m_eeprom;
4143   required_shared_ptr<UINT32> m_spritebank32;
4244   optional_shared_ptr<UINT32> m_tilebank32;
4345   required_shared_ptr<UINT16> m_namconb_shareram;
44   required_shared_ptr<UINT32> m_generic_paletteram_32;
4546
4647   UINT8 m_vbl_irq_level;
4748   UINT8 m_pos_irq_level;
trunk/src/mame/includes/namcos2.h
r31653r31654
352352#define NAMCOS21_NUM_COLORS 0x8000
353353
354354/**************************************************************/
355/*  Shared video palette function handlers                    */
356/**************************************************************/
357
358#define VIRTUAL_PALETTE_BANKS 30
359
360/**************************************************************/
361355/*  ROZ - Rotate & Zoom memory function handlers              */
362356/**************************************************************/
363357
trunk/src/mame/mame.mak
r31653r31654
15171517   $(MACHINE)/namco62.o \
15181518   $(AUDIO)/namco52.o \
15191519   $(AUDIO)/namco54.o \
1520   $(VIDEO)/c116.o \
15201521   $(VIDEO)/c45.o \
15211522   $(VIDEO)/bosco.o \
15221523   $(VIDEO)/digdug.o \
trunk/src/mame/video/c116.c
r0r31654
1// license:BSD-3-Clause
2// copyright-holders:Alex W. Jackson
3/*
4Namco Custom 116, used in:
5System 1
6System 2
7NB-1/NB-2
8System FL
9
10C116 controls palette RAM, blanking/clipping, and generates raster IRQs.
11It is paired with one of two priority mixer chips, depending on the board.
12On System 1, its partner is Custom 120; on System 2, NB-1, NB-2, and System
13FL, its partner is Custom 156. Based on schematics, C156 has more color input
14pins than C120 in order to support sprites with higher bit depth; other
15differences between the two mixer chips are unknown.
16
17The mixer (C120 or C156) outputs a 13-bit address corresponding to the color
18index of the highest-priority input pixel to three 6264 SRAMs, one for each of
19red, green and blue. The data from the RAMs is output to C116, which either
20sends it to the DAC or clips it to black if the beam position is outside the
21visible area programmed via its registers.
22
23When accessing the palette RAM from the CPU, data lines D0-D7 and address lines
24A11 and A12 go to C116; these two address lines select between the three RAMs
25and the C116 internal registers. A0-A10, A13 and A14 go to C120 or C156, which
26simply pass them through to the RAMs (A13 becoming A11 and A14 becoming A12).
27Thus, the palette RAM and the C116 registers are laid out like this from the
28perspective of the CPU:
29
300000-07FF: Red   (first 2048 pens)
310800-0FFF: Green ("")
321000-17FF: Blue  ("")
331800-1FFF: C116 registers
342000-27FF: Red   (second 2048 pens)
352800-2FFF: Green ("")
363000-37FF: Blue  ("")
373800-3FFF: C116 registers (mirror)
384000-47FF: Red   (third 2048 pens)
394800-4FFF: Green ("")
405000-57FF: Blue  ("")
415800-5FFF: C116 registers (mirror)
426000-67FF: Red (last 2048 pens)
436800-6FFF: Green ("")
447000-77FF: Blue  ("")
457800-7FFF: C116 registers (mirror)
46
47C116 has six (or eight?) 16-bit registers:
48
4900-01: left clip
5002-03: right clip
5104-05: top clip
5206-07: bottom clip
5308-09: raster IRQ horizontal position?
540A-0B: raster IRQ scanline
550C-0D: unknown, some games write 0 here, but probably unused
560E-0F: ""
57
58The registers are mirrored every 0x10 bytes within the address ranges
59indicated above.
60
61Although the registers are logically 16-bit, the chip's external interface
62is 8-bit, so the registers are written a byte at a time and in a big-endian
63fashion (even addresses access the MSB and odd addresses access the LSB)
64regardless of the endianness of the CPU. Thus System FL, which has an Intel
65i960 CPU, needs to write its clip and raster values byteswapped.
66*/
67
68#include "emu.h"
69#include "video/c116.h"
70
71
72//-------------------------------------------------
73//  namco_c116_device -- constructor
74//-------------------------------------------------
75
76namco_c116_device::namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
77   : device_t(mconfig, NAMCO_C116, "Namco C116 Video Controller", tag, owner, clock, "namco_c116", __FILE__),
78      device_gfx_interface(mconfig, *this),
79      device_video_interface(mconfig, *this)
80{
81}
82
83
84//-------------------------------------------------
85//  device_start - device-specific startup
86//-------------------------------------------------
87
88void namco_c116_device::device_start()
89{
90   m_ram_r.resize(0x2000);
91   m_ram_g.resize(0x2000);
92   m_ram_b.resize(0x2000);
93   memset(m_regs, 0, sizeof(m_regs));
94
95   save_item(NAME(m_ram_r));
96   save_item(NAME(m_ram_g));
97   save_item(NAME(m_ram_b));
98   save_item(NAME(m_regs));
99}
100
101
102READ8_MEMBER(namco_c116_device::read)
103{
104   UINT8 *RAM;
105
106   switch (offset & 0x1800)
107   {
108      case 0x0000:
109         RAM = m_ram_r;
110         break;
111      case 0x0800:
112         RAM = m_ram_g;
113         break;
114      case 0x1000:
115         RAM = m_ram_b;
116         break;
117      default: // case 0x1800 (internal registers)
118      {
119         int reg = (offset & 0xf) >> 1;
120         if (offset & 1)
121            return m_regs[reg] & 0xff;
122         else
123            return m_regs[reg] >> 8;
124      }
125   }
126
127   return RAM[((offset & 0x6000) >> 2) | (offset & 0x7ff)];
128}
129
130
131WRITE8_MEMBER(namco_c116_device::write)
132{
133   UINT8 *RAM;
134
135   switch (offset & 0x1800)
136   {
137      case 0x0000:
138         RAM = m_ram_r;
139         break;
140      case 0x0800:
141         RAM = m_ram_g;
142         break;
143      case 0x1000:
144         RAM = m_ram_b;
145         break;
146      default: // case 0x1800 (internal registers)
147      {
148         int reg = (offset & 0xf) >> 1;
149         if (offset & 1)
150            m_regs[reg] = (m_regs[reg] & 0xff00) | data;
151         else
152            m_regs[reg] = (m_regs[reg] & 0x00ff) | (data << 8);
153         //printf("reg%d = %d\n", reg, m_regs[reg]);
154         return;
155      }
156   }
157   int color = ((offset & 0x6000) >> 2) | (offset & 0x7ff);
158   RAM[color] = data;
159   m_palette->set_pen_color(color,m_ram_r[color],m_ram_g[color],m_ram_b[color]);
160}
161
162
163const device_type NAMCO_C116 = &device_creator<namco_c116_device>;
Property changes on: trunk/src/mame/video/c116.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/video/c116.h
r0r31654
1// license:BSD-3-Clause
2// copyright-holders:Alex W. Jackson
3
4#pragma once
5
6#ifndef __C116_H__
7#define __C116_H__
8
9
10//***************************************************************************
11//  TYPE DEFINITIONS
12//***************************************************************************
13
14class namco_c116_device :
15   public device_t,
16   public device_gfx_interface,
17   public device_video_interface
18{
19public:
20   //construction/destruction
21   namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22
23   //read/write handlers
24   DECLARE_READ8_MEMBER( read );
25   DECLARE_WRITE8_MEMBER( write );
26
27   //getters
28   UINT16 get_reg(int reg) { return m_regs[reg]; }
29
30protected:
31   // device-level overrides
32   virtual void device_start();
33
34private:
35   // internal state
36   dynamic_array<UINT8> m_ram_r;
37   dynamic_array<UINT8> m_ram_g;
38   dynamic_array<UINT8> m_ram_b;
39   UINT16 m_regs[8];
40};
41
42extern const device_type NAMCO_C116;
43
44#endif
Property changes on: trunk/src/mame/video/c116.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/video/namcofl.c
r31653r31654
4545} /* nth_byte32 */
4646#endif
4747
48static void namcofl_install_palette(running_machine &machine)
49{
50   namcofl_state *state = machine.driver_data<namcofl_state>();
51   int pen, page, dword_offset, byte_offset;
52   UINT32 r,g,b;
53   UINT32 *pSource;
54
55   /* this is unnecessarily expensive.  Better would be to mark palette entries dirty as
56    * they are modified, and only process those that have changed.
57    */
58   pen = 0;
59   for( page=0; page<4; page++ )
60   {
61      pSource = &state->m_generic_paletteram_32[page*0x2000/4];
62      for( dword_offset=0; dword_offset<0x800/4; dword_offset++ )
63      {
64         r = pSource[dword_offset+0x0000/4];
65         g = pSource[dword_offset+0x0800/4];
66         b = pSource[dword_offset+0x1000/4];
67
68         for( byte_offset=0; byte_offset<4; byte_offset++ )
69         {
70            state->m_palette->set_pen_color(pen++, r&0xff, g&0xff, b&0xff);
71            r>>=8; g>>=8; b>>=8;
72         }
73      }
74   }
75}
7648static void TilemapCB(running_machine &machine, UINT16 code, int *tile, int *mask )
7749{
7850   *tile = code;
r31653r31654
8456{
8557   int pri;
8658
87   namcofl_install_palette(machine());
88
8959   bitmap.fill(m_palette->black_pen(), cliprect );
9060
9161   for( pri=0; pri<16; pri++ )
trunk/src/mame/video/namconb1.c
r31653r31654
7171   }
7272} /* NB2TilemapCB */
7373
74static void namconb1_install_palette(running_machine &machine)
75{
76   namconb1_state *state = machine.driver_data<namconb1_state>();
77   int pen, page, dword_offset, byte_offset;
78   UINT32 r,g,b;
79   UINT32 *pSource;
80
81   /**
82    * This is unnecessarily expensive.  Better would be to mark palette entries dirty as
83    * they are modified, and only process those that have changed.
84    */
85   pen = 0;
86   for( page=0; page<4; page++ )
87   {
88      pSource = &state->m_generic_paletteram_32[page*0x2000/4];
89      for( dword_offset=0; dword_offset<0x800/4; dword_offset++ )
90      {
91         r = pSource[dword_offset+0x0000/4];
92         g = pSource[dword_offset+0x0800/4];
93         b = pSource[dword_offset+0x1000/4];
94
95         for( byte_offset=0; byte_offset<4; byte_offset++ )
96         {
97            state->m_palette->set_pen_color(pen++, r>>24, g>>24, b>>24 );
98            r<<=8; g<<=8; b<<=8;
99         }
100      }
101   }
102} /* namconb1_install_palette */
103
10474static void
10575video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bROZ )
10676{
10777   namconb1_state *state = screen.machine().driver_data<namconb1_state>();
10878   int pri;
109   namconb1_install_palette(screen.machine());
11079
11180   if( bROZ )
11281   {
r31653r31654
137106   /* compute window for custom screen blanking */
138107   rectangle clip;
139108   //004a 016a 0021 0101 0144 0020 (nebulas ray)
140   UINT32 xclip = m_generic_paletteram_32[0x1800/4];
141   UINT32 yclip = m_generic_paletteram_32[0x1804/4];
142   clip.min_x = (xclip>>16)    - 0x4a;
143   clip.max_x = (xclip&0xffff) - 0x4a - 1;
144   clip.min_y = (yclip>>16)    - 0x21;
145   clip.max_y = (yclip&0xffff) - 0x21 - 1;
109   clip.min_x = m_c116->get_reg(0) - 0x4a;
110   clip.max_x = m_c116->get_reg(1) - 0x4a - 1;
111   clip.min_y = m_c116->get_reg(2) - 0x21;
112   clip.max_y = m_c116->get_reg(3) - 0x21 - 1;
146113   /* intersect with master clip rectangle */
147114   clip &= cliprect;
148115
r31653r31654
174141   /* compute window for custom screen blanking */
175142   rectangle clip;
176143   //004a016a 00210101 01440020
177   UINT32 xclip = m_generic_paletteram_32[0x1800/4];
178   UINT32 yclip = m_generic_paletteram_32[0x1804/4];
179   clip.min_x = (xclip>>16)    - 0x4b;
180   clip.max_x = (xclip&0xffff) - 0x4b - 1;
181   clip.min_y = (yclip>>16)    - 0x21;
182   clip.max_y = (yclip&0xffff) - 0x21 - 1;
144   clip.min_x = m_c116->get_reg(0) - 0x4b;
145   clip.max_x = m_c116->get_reg(1) - 0x4b - 1;
146   clip.min_y = m_c116->get_reg(2) - 0x21;
147   clip.max_y = m_c116->get_reg(3) - 0x21 - 1;
183148   /* intersect with master clip rectangle */
184149   clip &= cliprect;
185150
trunk/src/mame/video/namcos1.c
r31653r31654
125125   m_bg_tilemap[4]->set_scrolldy(16, 16);
126126   m_bg_tilemap[5]->set_scrolldy(16, 16);
127127
128   /* register videoram to the save state system (post-allocation) */
129   save_item(NAME(m_cus116));
130
131128   /* set table for sprite color == 0x7f */
132129   for (i = 0;i < 15;i++)
133130      m_drawmode_table[i] = DRAWMODE_SHADOW;
134131   m_drawmode_table[15] = DRAWMODE_NONE;
135132
136   /* clear paletteram */
137   memset(m_paletteram, 0, 0x8000);
138   memset(m_cus116, 0, 0x10);
139   for (i = 0; i < 0x2000; i++)
140      m_palette->set_pen_color(i, rgb_t(0, 0, 0));
141
142133   /* all palette entries are not affected by shadow sprites... */
143134   for (i = 0;i < 0x2000;i++)
144135      m_palette->shadow_table()[i] = i;
r31653r31654
177168}
178169
179170
180WRITE8_MEMBER( namcos1_state::namcos1_paletteram_w )
181{
182   if (m_paletteram[offset] == data)
183      return;
184
185   if ((offset & 0x1800) != 0x1800)
186   {
187      int r,g,b;
188      int color = ((offset & 0x6000) >> 2) | (offset & 0x7ff);
189
190      m_paletteram[offset] = data;
191
192      offset &= ~0x1800;
193      r = m_paletteram[offset];
194      g = m_paletteram[offset + 0x0800];
195      b = m_paletteram[offset + 0x1000];
196      m_palette->set_pen_color(color,rgb_t(r,g,b));
197   }
198   else
199   {
200      int i, j;
201
202      m_cus116[offset & 0x0f] = data;
203
204      for (i = 0x1800; i < 0x8000; i += 0x2000)
205      {
206         offset = (offset & 0x0f) | i;
207
208         for (j = 0; j < 0x80; j++, offset += 0x10)
209            m_paletteram[offset] = data;
210      }
211   }
212}
213
214
215
216171WRITE8_MEMBER( namcos1_state::namcos1_spriteram_w )
217172{
218173   /* 0000-07ff work ram */
r31653r31654
335290   bitmap.fill(m_palette->black_pen(), cliprect);
336291
337292   /* berabohm uses asymmetrical visibility windows to iris on the character */
338   i = ((m_cus116[0] << 8) | m_cus116[1]) - 1;         // min x
293   i = m_c116->get_reg(0) - 1;                         // min x
339294   if (new_clip.min_x < i) new_clip.min_x = i;
340   i = ((m_cus116[2] << 8) | m_cus116[3]) - 1 - 1;     // max x
295   i = m_c116->get_reg(1) - 1 - 1;                     // max x
341296   if (new_clip.max_x > i) new_clip.max_x = i;
342   i = ((m_cus116[4] << 8) | m_cus116[5]) - 0x11;      // min y
297   i = m_c116->get_reg(2) - 0x11;                      // min y
343298   if (new_clip.min_y < i) new_clip.min_y = i;
344   i = ((m_cus116[6] << 8) | m_cus116[7]) - 0x11 - 1;  // max y
299   i = m_c116->get_reg(3) - 0x11 - 1;                  // max y
345300   if (new_clip.max_y > i) new_clip.max_y = i;
346301
347302   if (new_clip.empty())
trunk/src/mame/video/c45.c
r31653r31654
131131WRITE16_MEMBER( namco_c45_road_device::tileram_w )
132132{
133133   COMBINE_DATA(&m_tileram[offset]);
134   gfx(0)->mark_dirty(offset / WORDS_PER_ROAD_TILE);
134   m_gfx[0]->mark_dirty(offset / WORDS_PER_ROAD_TILE);
135135}
136136
137137
r31653r31654
198198         while (numpixels-- > 0)
199199         {
200200            int pen = source_gfx[sourcex >> 16];
201            if (palette()->pen_indirect(pen) != m_transparent_color)
201            if (m_palette->pen_indirect(pen) != m_transparent_color)
202202            {
203203               if (m_clut != NULL)
204204                  pen = (pen & ~0xff) | m_clut[pen & 0xff];
trunk/src/mame/drivers/namcos1.c
r31653r31654
415415
416416static ADDRESS_MAP_START( virtual_map, AS_PROGRAM, 8, namcos1_state )
417417   AM_RANGE(0x2c0000, 0x2c1fff) AM_WRITE(namcos1_3dcs_w)
418   AM_RANGE(0x2e0000, 0x2e7fff) AM_RAM_WRITE(namcos1_paletteram_w) AM_SHARE("paletteram")
418   AM_RANGE(0x2e0000, 0x2e7fff) AM_DEVREADWRITE("c116", namco_c116_device, read, write)
419419   AM_RANGE(0x2f0000, 0x2f7fff) AM_RAM_WRITE(namcos1_videoram_w) AM_SHARE("videoram")
420420   AM_RANGE(0x2f8000, 0x2f9fff) AM_READWRITE(no_key_r, no_key_w)
421421   AM_RANGE(0x2fc000, 0x2fcfff) AM_RAM_WRITE(namcos1_spriteram_w) AM_SHARE("spriteram")
r31653r31654
10701070   MCFG_PALETTE_ADD("palette", 0x2000)
10711071   MCFG_PALETTE_ENABLE_SHADOWS()
10721072
1073   MCFG_DEVICE_ADD("c116", NAMCO_C116, 0)
1074   MCFG_GFX_PALETTE("palette")
1075
10731076   /* sound hardware */
10741077   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
10751078
trunk/src/mame/drivers/namcofl.c
r31653r31654
197197   }
198198}
199199
200WRITE32_MEMBER(namcofl_state::namcofl_paletteram_w)
200// FIXME: remove this trampoline once the IRQ is moved into the actual device
201WRITE8_MEMBER(namcofl_state::namcofl_c116_w)
201202{
202   COMBINE_DATA(&m_generic_paletteram_32[offset]);
203   m_c116->write(space, offset, data);
203204
204   if ((offset == 0x1808/4) && ACCESSING_BITS_16_31)
205   if ((offset & 0x180e) == 0x180a)
205206   {
206      UINT16 v = m_generic_paletteram_32[offset] >> 16;
207      UINT16 v = m_c116->get_reg(5);
207208      UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1);
208209
209210      m_raster_interrupt_timer->adjust(m_screen->time_until_pos(triggerscanline));
r31653r31654
232233   AM_RANGE(0x30284000, 0x3028bfff) AM_READWRITE(namcofl_share_r, namcofl_share_w)
233234   AM_RANGE(0x30300000, 0x30303fff) AM_RAM /* COMRAM */
234235   AM_RANGE(0x30380000, 0x303800ff) AM_READ(fl_network_r ) /* network registers */
235   AM_RANGE(0x30400000, 0x3040ffff) AM_RAM_WRITE(namcofl_paletteram_w) AM_SHARE("paletteram")
236   AM_RANGE(0x30400000, 0x30407fff) AM_DEVREAD8("c116", namco_c116_device,read,0xffffffff) AM_WRITE8(namcofl_c116_w,0xffffffff)
236237   AM_RANGE(0x30800000, 0x3080ffff) AM_READWRITE16(c123_tilemap_videoram_r,c123_tilemap_videoram_w,0xffffffff)
237238   AM_RANGE(0x30a00000, 0x30a0003f) AM_READWRITE16(c123_tilemap_control_r,c123_tilemap_control_w,0xffffffff)
238239   AM_RANGE(0x30c00000, 0x30c1ffff) AM_READWRITE16(c169_roz_videoram_r,c169_roz_videoram_w,0xffffffff) AM_SHARE("rozvideoram")
r31653r31654
604605
605606   MCFG_GFXDECODE_ADD("gfxdecode", "palette", 2)
606607
608   MCFG_DEVICE_ADD("c116", NAMCO_C116, 0)
609   MCFG_GFX_PALETTE("palette")
610
607611   MCFG_VIDEO_START_OVERRIDE(namcofl_state,namcofl)
608612
609613   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/drivers/namconb1.c
r31653r31654
293293   }
294294
295295   // Handle POSIRQ
296   UINT32 posirq_scanline = (m_generic_paletteram_32[0x1808/4] & 0xffff) - 32;
296   UINT32 posirq_scanline = m_c116->get_reg(5) - 32;
297297
298298   if (scanline == posirq_scanline)
299299   {
r31653r31654
667667   AM_RANGE(0x660000, 0x66003f) AM_READWRITE16(c123_tilemap_control_r,c123_tilemap_control_w,0xffffffff)
668668   AM_RANGE(0x680000, 0x68000f) AM_RAM AM_SHARE("spritebank32")
669669   AM_RANGE(0x6e0000, 0x6e001f) AM_READ(custom_key_r) AM_WRITENOP
670   AM_RANGE(0x700000, 0x707fff) AM_RAM AM_SHARE("paletteram")
670   AM_RANGE(0x700000, 0x707fff) AM_DEVREADWRITE8("c116", namco_c116_device, read, write, 0xffffffff)
671671ADDRESS_MAP_END
672672
673673static ADDRESS_MAP_START( namconb2_am, AS_PROGRAM, 32, namconb1_state )
r31653r31654
684684   AM_RANGE(0x6c0000, 0x6c003f) AM_READWRITE16(c123_tilemap_control_r,c123_tilemap_control_w,0xffffffff)
685685   AM_RANGE(0x700000, 0x71ffff) AM_READWRITE16(c169_roz_videoram_r,c169_roz_videoram_w,0xffffffff) AM_SHARE("rozvideoram")
686686   AM_RANGE(0x740000, 0x74001f) AM_READWRITE16(c169_roz_control_r,c169_roz_control_w,0xffffffff)
687   AM_RANGE(0x800000, 0x807fff) AM_RAM AM_SHARE("paletteram")
687   AM_RANGE(0x800000, 0x807fff) AM_DEVREADWRITE8("c116", namco_c116_device, read, write, 0xffffffff)
688688   AM_RANGE(0x900008, 0x90000f) AM_RAM AM_SHARE("spritebank32")
689689   AM_RANGE(0x940000, 0x94000f) AM_RAM AM_SHARE("tilebank32")
690690   AM_RANGE(0x980000, 0x98000f) AM_READWRITE16(c169_roz_bank_r,c169_roz_bank_w,0xffffffff)
r31653r31654
11161116   MCFG_SCREEN_PALETTE("palette")
11171117
11181118   MCFG_GFXDECODE_ADD("gfxdecode", "palette", namconb1)
1119
11201119   MCFG_PALETTE_ADD("palette", 0x2000)
11211120   MCFG_PALETTE_ENABLE_SHADOWS()
11221121
1122   MCFG_DEVICE_ADD("c116", NAMCO_C116, 0)
1123   MCFG_GFX_PALETTE("palette")
1124
11231125   MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb1)
11241126
11251127   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r31653r31654
11541156   MCFG_PALETTE_ADD("palette", 0x2000)
11551157   MCFG_PALETTE_ENABLE_SHADOWS()
11561158
1159   MCFG_DEVICE_ADD("c116", NAMCO_C116, 0)
1160   MCFG_GFX_PALETTE("palette")
1161
11571162   MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb2)
11581163
11591164   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/emu/digfx.h
r31653r31654
212212   virtual void interface_pre_start();
213213   virtual void interface_post_start();
214214
215   palette_device *            m_palette;                  // pointer to the palette device
216   auto_pointer<gfx_element>   m_gfx[MAX_GFX_ELEMENTS];    // array of pointers to graphic sets
217
215218private:
216219   // configuration
217220   const gfx_decode_entry *    m_gfxdecodeinfo;        // pointer to array of gfx decode information
r31653r31654
220223
221224   // internal state
222225   bool                        m_decoded;                  // have we processed our decode info yet?
223   palette_device *            m_palette;                  // pointer to the palette device
224   auto_pointer<gfx_element>   m_gfx[MAX_GFX_ELEMENTS];    // array of pointers to graphic sets
225226};
226227
227228// iterator

Previous 199869 Revisions Next


© 1997-2024 The MAME Team