Previous 199869 Revisions Next

r29490 Wednesday 9th April, 2014 at 16:16:36 UTC by Fabio Priuli
t6a04: updated to use inline configs. nw.
[src/emu/video]t6a04.c t6a04.h
[src/mess/drivers]ti85.c

trunk/src/emu/video/t6a04.h
r29489r29490
1111#ifndef __T6A04_H__
1212#define __T6A04_H__
1313
14#define MCFG_T6A04_ADD( _tag, _config ) \
15   MCFG_DEVICE_ADD( _tag, T6A04, 0 ) \
16   MCFG_DEVICE_CONFIG(_config)
17
1814//**************************************************************************
1915//  TYPE DEFINITIONS
2016//**************************************************************************
2117
22// ======================> t6a04_interface
23
24struct t6a04_interface
25{
26   UINT8 height;           // number of lines
27   UINT8 width;            // pixels for line
28};
29
3018// ======================> t6a04_device
3119
32class t6a04_device : public device_t,
33                  public t6a04_interface
20class t6a04_device : public device_t
3421{
3522public:
3623   // construction/destruction
3724   t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3825
26   static void set_size(device_t &device, int w, int h)
27   {
28      t6a04_device &dev = downcast<t6a04_device &>(device);
29      dev.m_width = w;
30      dev.m_height = h;
31   }
32   
3933   // device interface
4034   DECLARE_WRITE8_MEMBER(control_write);
4135   DECLARE_READ8_MEMBER(control_read);
r29489r29490
4842   // device-level overrides
4943   virtual void device_start();
5044   virtual void device_reset();
51   virtual void device_config_complete();
5245   virtual void device_validity_check(validity_checker &valid) const;
5346
5447private:
r29489r29490
6558   UINT8 m_opa1;
6659   UINT8 m_opa2;
6760   UINT8 m_output_reg;
61
62   UINT8 m_height;           // number of lines
63   UINT8 m_width;            // pixels for line
6864};
6965
7066// device type definition
7167extern const device_type T6A04;
7268
69#define MCFG_T6A04_SIZE(_width, _height) \
70   t6a04_device::set_size(*device, _width, _height);
71
7372#endif
trunk/src/emu/video/t6a04.c
r29489r29490
1818const device_type T6A04 = &device_creator<t6a04_device>;
1919
2020//-------------------------------------------------
21//  device_config_complete - perform any
22//  operations now that the configuration is
23//  complete
24//-------------------------------------------------
25
26void t6a04_device::device_config_complete()
27{
28   // inherit a copy of the static data
29   const t6a04_interface *intf = reinterpret_cast<const t6a04_interface *>(static_config());
30
31   if (intf != NULL)
32   {
33      *static_cast<t6a04_interface *>(this) = *intf;
34   }
35   // or initialize to defaults if none provided
36   else
37   {
38      height = width = 0;
39   }
40}
41
42//-------------------------------------------------
4321//  device_validity_check - perform validity checks
4422//  on this device
4523//-------------------------------------------------
4624
4725void t6a04_device::device_validity_check(validity_checker &valid) const
4826{
49   if (height == 0 || width == 0)
27   if (m_height == 0 || m_width == 0)
5028      mame_printf_error("Configured with invalid parameter\n");
5129}
5230
r29489r29490
5937//-------------------------------------------------
6038
6139t6a04_device::t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
62   device_t(mconfig, T6A04, "T6A04", tag, owner, clock, "t6a04", __FILE__)
40   device_t(mconfig, T6A04, "T6A04", tag, owner, clock, "t6a04", __FILE__),
41   m_height(0),
42   m_width(0)
6343{
6444}
6545
r29489r29490
11595
11696UINT32 t6a04_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11797{
118   UINT8 ypages = width>>3;
119   UINT8 last_line = m_zpos + height;
98   UINT8 ypages = m_width>>3;
99   UINT8 last_line = m_zpos + m_height;
120100
121101   if (m_display_on)
122102   {
trunk/src/mess/drivers/ti85.c
r29489r29490
537537MACHINE_CONFIG_END
538538
539539
540static const t6a04_interface ti82_display =
541{
542   64,                 // number of lines
543   96,                 // pixels for line
544};
545
546540static MACHINE_CONFIG_DERIVED( ti82, ti81 )
547541   MCFG_CPU_MODIFY("maincpu")
548542   MCFG_CPU_CLOCK( 6000000)        /* 6 MHz */
r29489r29490
557551   MCFG_PALETTE_ENTRIES(2)
558552   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
559553
560   MCFG_T6A04_ADD("t6a04", ti82_display)
554   MCFG_DEVICE_ADD("t6a04", T6A04, 0)
555   MCFG_T6A04_SIZE(96, 64)
561556
562557   MCFG_SPEAKER_STANDARD_MONO("mono")
563558   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
r29489r29490
587582   MCFG_PALETTE_ENTRIES(2)
588583   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
589584
590   MCFG_T6A04_ADD("t6a04", ti82_display)
585   MCFG_DEVICE_ADD("t6a04", T6A04, 0)
586   MCFG_T6A04_SIZE(96, 64)
591587MACHINE_CONFIG_END
592588
593589static MACHINE_CONFIG_DERIVED( ti86, ti85 )
r29489r29490
621617   MCFG_PALETTE_ENTRIES(2)
622618   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
623619
624   MCFG_T6A04_ADD("t6a04", ti82_display)
620   MCFG_DEVICE_ADD("t6a04", T6A04, 0)
621   MCFG_T6A04_SIZE(96, 64)
625622
626623   MCFG_DEVICE_REMOVE("nvram")
627624   MCFG_NVRAM_HANDLER(ti83p)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team