trunk/src/emu/video/t6a04.h
| r29489 | r29490 | |
| 11 | 11 | #ifndef __T6A04_H__ |
| 12 | 12 | #define __T6A04_H__ |
| 13 | 13 | |
| 14 | | #define MCFG_T6A04_ADD( _tag, _config ) \ |
| 15 | | MCFG_DEVICE_ADD( _tag, T6A04, 0 ) \ |
| 16 | | MCFG_DEVICE_CONFIG(_config) |
| 17 | | |
| 18 | 14 | //************************************************************************** |
| 19 | 15 | // TYPE DEFINITIONS |
| 20 | 16 | //************************************************************************** |
| 21 | 17 | |
| 22 | | // ======================> t6a04_interface |
| 23 | | |
| 24 | | struct t6a04_interface |
| 25 | | { |
| 26 | | UINT8 height; // number of lines |
| 27 | | UINT8 width; // pixels for line |
| 28 | | }; |
| 29 | | |
| 30 | 18 | // ======================> t6a04_device |
| 31 | 19 | |
| 32 | | class t6a04_device : public device_t, |
| 33 | | public t6a04_interface |
| 20 | class t6a04_device : public device_t |
| 34 | 21 | { |
| 35 | 22 | public: |
| 36 | 23 | // construction/destruction |
| 37 | 24 | t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 38 | 25 | |
| 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 | |
| 39 | 33 | // device interface |
| 40 | 34 | DECLARE_WRITE8_MEMBER(control_write); |
| 41 | 35 | DECLARE_READ8_MEMBER(control_read); |
| r29489 | r29490 | |
| 48 | 42 | // device-level overrides |
| 49 | 43 | virtual void device_start(); |
| 50 | 44 | virtual void device_reset(); |
| 51 | | virtual void device_config_complete(); |
| 52 | 45 | virtual void device_validity_check(validity_checker &valid) const; |
| 53 | 46 | |
| 54 | 47 | private: |
| r29489 | r29490 | |
| 65 | 58 | UINT8 m_opa1; |
| 66 | 59 | UINT8 m_opa2; |
| 67 | 60 | UINT8 m_output_reg; |
| 61 | |
| 62 | UINT8 m_height; // number of lines |
| 63 | UINT8 m_width; // pixels for line |
| 68 | 64 | }; |
| 69 | 65 | |
| 70 | 66 | // device type definition |
| 71 | 67 | extern const device_type T6A04; |
| 72 | 68 | |
| 69 | #define MCFG_T6A04_SIZE(_width, _height) \ |
| 70 | t6a04_device::set_size(*device, _width, _height); |
| 71 | |
| 73 | 72 | #endif |
trunk/src/emu/video/t6a04.c
| r29489 | r29490 | |
| 18 | 18 | const device_type T6A04 = &device_creator<t6a04_device>; |
| 19 | 19 | |
| 20 | 20 | //------------------------------------------------- |
| 21 | | // device_config_complete - perform any |
| 22 | | // operations now that the configuration is |
| 23 | | // complete |
| 24 | | //------------------------------------------------- |
| 25 | | |
| 26 | | void 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 | | //------------------------------------------------- |
| 43 | 21 | // device_validity_check - perform validity checks |
| 44 | 22 | // on this device |
| 45 | 23 | //------------------------------------------------- |
| 46 | 24 | |
| 47 | 25 | void t6a04_device::device_validity_check(validity_checker &valid) const |
| 48 | 26 | { |
| 49 | | if (height == 0 || width == 0) |
| 27 | if (m_height == 0 || m_width == 0) |
| 50 | 28 | mame_printf_error("Configured with invalid parameter\n"); |
| 51 | 29 | } |
| 52 | 30 | |
| r29489 | r29490 | |
| 59 | 37 | //------------------------------------------------- |
| 60 | 38 | |
| 61 | 39 | t6a04_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) |
| 63 | 43 | { |
| 64 | 44 | } |
| 65 | 45 | |
| r29489 | r29490 | |
| 115 | 95 | |
| 116 | 96 | UINT32 t6a04_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 117 | 97 | { |
| 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; |
| 120 | 100 | |
| 121 | 101 | if (m_display_on) |
| 122 | 102 | { |
trunk/src/mess/drivers/ti85.c
| r29489 | r29490 | |
| 537 | 537 | MACHINE_CONFIG_END |
| 538 | 538 | |
| 539 | 539 | |
| 540 | | static const t6a04_interface ti82_display = |
| 541 | | { |
| 542 | | 64, // number of lines |
| 543 | | 96, // pixels for line |
| 544 | | }; |
| 545 | | |
| 546 | 540 | static MACHINE_CONFIG_DERIVED( ti82, ti81 ) |
| 547 | 541 | MCFG_CPU_MODIFY("maincpu") |
| 548 | 542 | MCFG_CPU_CLOCK( 6000000) /* 6 MHz */ |
| r29489 | r29490 | |
| 557 | 551 | MCFG_PALETTE_ENTRIES(2) |
| 558 | 552 | MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 ) |
| 559 | 553 | |
| 560 | | MCFG_T6A04_ADD("t6a04", ti82_display) |
| 554 | MCFG_DEVICE_ADD("t6a04", T6A04, 0) |
| 555 | MCFG_T6A04_SIZE(96, 64) |
| 561 | 556 | |
| 562 | 557 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 563 | 558 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| r29489 | r29490 | |
| 587 | 582 | MCFG_PALETTE_ENTRIES(2) |
| 588 | 583 | MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 ) |
| 589 | 584 | |
| 590 | | MCFG_T6A04_ADD("t6a04", ti82_display) |
| 585 | MCFG_DEVICE_ADD("t6a04", T6A04, 0) |
| 586 | MCFG_T6A04_SIZE(96, 64) |
| 591 | 587 | MACHINE_CONFIG_END |
| 592 | 588 | |
| 593 | 589 | static MACHINE_CONFIG_DERIVED( ti86, ti85 ) |
| r29489 | r29490 | |
| 621 | 617 | MCFG_PALETTE_ENTRIES(2) |
| 622 | 618 | MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 ) |
| 623 | 619 | |
| 624 | | MCFG_T6A04_ADD("t6a04", ti82_display) |
| 620 | MCFG_DEVICE_ADD("t6a04", T6A04, 0) |
| 621 | MCFG_T6A04_SIZE(96, 64) |
| 625 | 622 | |
| 626 | 623 | MCFG_DEVICE_REMOVE("nvram") |
| 627 | 624 | MCFG_NVRAM_HANDLER(ti83p) |