Previous 199869 Revisions Next

r17547 Tuesday 28th August, 2012 at 22:01:51 UTC by Angelo Salese
Added blinking, last one for this M50458 thing
[src/emu/video]m50458.c m50458.h
[src/mame/drivers]nss.c

trunk/src/mame/drivers/nss.c
r17546r17547
844844   state->m_joy_flag = 1;
845845}
846846
847static M50458_INTERFACE( m50458_intf )
848{
849   "osd"
850};
851
847852static MACHINE_CONFIG_DERIVED( nss, snes )
848853
849854   MCFG_CPU_ADD("bios", Z80, 4000000)
r17546r17547
851856   MCFG_CPU_IO_MAP(bios_io_map)
852857   MCFG_CPU_VBLANK_INT("screen", nss_vblank_irq)
853858
854   MCFG_M50458_ADD("m50458",4000000) /* TODO: clock */
859   MCFG_M50458_ADD("m50458",m50458_intf,4000000) /* TODO: clock */
855860   MCFG_S3520CF_ADD("s3520cf") /* RTC */
856861   MCFG_RP5H01_ADD("rp5h01")
857862   MCFG_M6M80011AP_ADD("m6m80011ap")
trunk/src/emu/video/m50458.c
r17546r17547
3232   AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w)
3333   AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w)
3434   AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w)
35   AM_RANGE(0x0248, 0x0249) AM_WRITE(vreg_124_w)
36   AM_RANGE(0x024a, 0x024b) AM_WRITE(vreg_125_w)
3537   AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w)
3638   AM_RANGE(0x024e, 0x024f) AM_WRITE(vreg_127_w)
3739ADDRESS_MAP_END
r17546r17547
8688//   printf("%02x %02x %02x\n",m_scrr,m_scrf,m_space);
8789}
8890
91WRITE16_MEMBER( m50458_device::vreg_124_w)
92{
93
94}
95
96WRITE16_MEMBER( m50458_device::vreg_125_w)
97{
98   /* blinking cycle */
99   m_blink = data & 4 ? 0x20 : 0x40;
100}
101
89102WRITE16_MEMBER( m50458_device::vreg_126_w)
90103{
91104   /* Raster Color Setting */
r17546r17547
175188}
176189
177190
191void m50458_device::device_config_complete()
192{
193   // inherit a copy of the static data
194   const m50458_interface *intf = reinterpret_cast<const m50458_interface *>(static_config());
195   if (intf != NULL)
196      *static_cast<m50458_interface *>(this) = *intf;
197
198   // or initialize to defaults if none provided
199   else
200   {
201      // ...
202   }
203}
204
178205//-------------------------------------------------
179206//  device_start - device-specific startup
180207//-------------------------------------------------
r17546r17547
222249         m_shadow_gfx[dst] |= (tmp >> 8);
223250      }
224251   }
252
253   // find screen
254   m_screen = machine().device<screen_device>(m_screen_tag);
255
256   if (m_screen == NULL)
257   {
258      m_screen = owner()->subdevice<screen_device>(m_screen_tag);
259   }
225260}
226261
227262
r17546r17547
236271   /* clear VRAM at boot */
237272   for(i=0;i<0x120;i++)
238273      write_word(i,0x007f);
274
275   m_blink = 0x40;
239276}
240277
241278
r17546r17547
338375               int res_y,res_x;
339376               UINT8 xh,yh;
340377
341               /* TODO: blinking, bit 7 (RTC test in NSS) */
342
343378               if(xi>=8)
344379                  pix = ((pcg[offset+1] >> (7-(xi & 0x7))) & 1) << 1;
345380               else
r17546r17547
350385               else
351386                  pix |= ((m_shadow_gfx[offset+0] >> (7-(xi & 0x7))) & 1);
352387
388               /* blinking, VERY preliminary */
389               if(tile & 0x800 && m_screen->frame_number() & m_blink)
390                  pix = 0;
391
353392               if(yi == 17 && tile & 0x1000) /* underline? */
354393                  pix |= 1;
355394
trunk/src/emu/video/m50458.h
r17546r17547
1515//  INTERFACE CONFIGURATION MACROS
1616//**************************************************************************
1717
18#define MCFG_M50458_ADD(_tag,_freq) \
18#define MCFG_M50458_ADD(_tag,_config,_freq) \
1919   MCFG_DEVICE_ADD(_tag, M50458,_freq) \
20   MCFG_DEVICE_CONFIG(_config) \
2021
2122
23#define M50458_INTERFACE(name) \
24   const m50458_interface (name) =
25
26
2227//**************************************************************************
2328//  TYPE DEFINITIONS
2429//**************************************************************************
r17546r17547
2934   OSD_SET_DATA
3035} m50458_state_t;
3136
37// ======================> upd7220_interface
38
39struct m50458_interface
40{
41   const char *m_screen_tag;
42};
43
3244// ======================> m50458_device
3345
3446class m50458_device :   public device_t,
35                  public device_memory_interface
47                  public device_memory_interface,
48                  public m50458_interface
3649{
3750public:
3851   // construction/destruction
r17546r17547
4659   DECLARE_WRITE16_MEMBER(vreg_121_w);
4760   DECLARE_WRITE16_MEMBER(vreg_122_w);
4861   DECLARE_WRITE16_MEMBER(vreg_123_w);
62   DECLARE_WRITE16_MEMBER(vreg_124_w);
63   DECLARE_WRITE16_MEMBER(vreg_125_w);
4964   DECLARE_WRITE16_MEMBER(vreg_126_w);
5065   DECLARE_WRITE16_MEMBER(vreg_127_w);
5166
r17546r17547
5873   virtual void device_start();
5974   virtual void device_reset();
6075   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
76   virtual void device_config_complete();
6177
78   screen_device *m_screen;
79
6280   int m_latch;
6381   int   m_reset_line;
6482   int   m_clock_line;
r17546r17547
7391   UINT8 m_space;
7492   UINT8 m_hsz1,m_hsz2,m_hsz3;
7593   UINT8 m_vsz1,m_vsz2,m_vsz3;
94   UINT8 m_blink;
7695
7796   m50458_state_t m_osd_state;
7897

Previous 199869 Revisions Next


© 1997-2024 The MAME Team