trunk/src/mess/drivers/jtc.c
| r26675 | r26676 | |
| 6 | 6 | |
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | | #include "includes/jtc.h" |
| 9 | #include "emu.h" |
| 10 | #include "cpu/z8/z8.h" |
| 11 | #include "imagedev/cassette.h" |
| 12 | #include "bus/centronics/ctronics.h" |
| 13 | #include "machine/ram.h" |
| 14 | #include "sound/speaker.h" |
| 15 | #include "sound/wave.h" |
| 10 | 16 | |
| 17 | #define SCREEN_TAG "screen" |
| 18 | #define UB8830D_TAG "ub8830d" |
| 19 | #define CENTRONICS_TAG "centronics" |
| 20 | |
| 21 | #define JTC_ES40_VIDEORAM_SIZE 0x2000 |
| 22 | |
| 23 | class jtc_state : public driver_device |
| 24 | { |
| 25 | public: |
| 26 | jtc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | : driver_device(mconfig, type, tag), |
| 28 | m_maincpu(*this, UB8830D_TAG), |
| 29 | m_cassette(*this, "cassette"), |
| 30 | m_speaker(*this, "speaker"), |
| 31 | m_centronics(*this, CENTRONICS_TAG), |
| 32 | m_video_ram(*this, "video_ram"){ } |
| 33 | |
| 34 | required_device<cpu_device> m_maincpu; |
| 35 | required_device<cassette_image_device> m_cassette; |
| 36 | required_device<speaker_sound_device> m_speaker; |
| 37 | required_device<centronics_device> m_centronics; |
| 38 | |
| 39 | virtual void machine_start(); |
| 40 | |
| 41 | virtual void video_start(); |
| 42 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 43 | |
| 44 | DECLARE_WRITE8_MEMBER( p2_w ); |
| 45 | DECLARE_READ8_MEMBER( p3_r ); |
| 46 | DECLARE_WRITE8_MEMBER( p3_w ); |
| 47 | DECLARE_PALETTE_INIT(jtc_es40); |
| 48 | optional_shared_ptr<UINT8> m_video_ram; |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | class jtces88_state : public jtc_state |
| 53 | { |
| 54 | public: |
| 55 | jtces88_state(const machine_config &mconfig, device_type type, const char *tag) |
| 56 | : jtc_state(mconfig, type, tag) |
| 57 | { } |
| 58 | }; |
| 59 | |
| 60 | |
| 61 | class jtces23_state : public jtc_state |
| 62 | { |
| 63 | public: |
| 64 | jtces23_state(const machine_config &mconfig, device_type type, const char *tag) |
| 65 | : jtc_state(mconfig, type, tag) |
| 66 | { } |
| 67 | |
| 68 | virtual void video_start(); |
| 69 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 70 | }; |
| 71 | |
| 72 | |
| 73 | class jtces40_state : public jtc_state |
| 74 | { |
| 75 | public: |
| 76 | jtces40_state(const machine_config &mconfig, device_type type, const char *tag) |
| 77 | : jtc_state(mconfig, type, tag) |
| 78 | { } |
| 79 | |
| 80 | virtual void video_start(); |
| 81 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 82 | |
| 83 | DECLARE_READ8_MEMBER( videoram_r ); |
| 84 | DECLARE_WRITE8_MEMBER( videoram_w ); |
| 85 | DECLARE_WRITE8_MEMBER( banksel_w ); |
| 86 | |
| 87 | UINT8 m_video_bank; |
| 88 | UINT8 *m_color_ram_r; |
| 89 | UINT8 *m_color_ram_g; |
| 90 | UINT8 *m_color_ram_b; |
| 91 | }; |
| 92 | |
| 93 | |
| 11 | 94 | /* Read/Write Handlers */ |
| 12 | 95 | |
| 13 | 96 | WRITE8_MEMBER( jtc_state::p2_w ) |
trunk/src/mess/includes/jtc.h
| r26675 | r26676 | |
| 1 | | #pragma once |
| 2 | | |
| 3 | | #ifndef __JTC__ |
| 4 | | #define __JTC__ |
| 5 | | |
| 6 | | |
| 7 | | #include "emu.h" |
| 8 | | #include "cpu/z8/z8.h" |
| 9 | | #include "imagedev/cassette.h" |
| 10 | | #include "bus/centronics/ctronics.h" |
| 11 | | #include "machine/ram.h" |
| 12 | | #include "sound/speaker.h" |
| 13 | | #include "sound/wave.h" |
| 14 | | |
| 15 | | #define SCREEN_TAG "screen" |
| 16 | | #define UB8830D_TAG "ub8830d" |
| 17 | | #define CENTRONICS_TAG "centronics" |
| 18 | | |
| 19 | | #define JTC_ES40_VIDEORAM_SIZE 0x2000 |
| 20 | | |
| 21 | | class jtc_state : public driver_device |
| 22 | | { |
| 23 | | public: |
| 24 | | jtc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 25 | | : driver_device(mconfig, type, tag), |
| 26 | | m_maincpu(*this, UB8830D_TAG), |
| 27 | | m_cassette(*this, "cassette"), |
| 28 | | m_speaker(*this, "speaker"), |
| 29 | | m_centronics(*this, CENTRONICS_TAG), |
| 30 | | m_video_ram(*this, "video_ram"){ } |
| 31 | | |
| 32 | | required_device<cpu_device> m_maincpu; |
| 33 | | required_device<cassette_image_device> m_cassette; |
| 34 | | required_device<speaker_sound_device> m_speaker; |
| 35 | | required_device<centronics_device> m_centronics; |
| 36 | | |
| 37 | | virtual void machine_start(); |
| 38 | | |
| 39 | | virtual void video_start(); |
| 40 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 41 | | |
| 42 | | DECLARE_WRITE8_MEMBER( p2_w ); |
| 43 | | DECLARE_READ8_MEMBER( p3_r ); |
| 44 | | DECLARE_WRITE8_MEMBER( p3_w ); |
| 45 | | DECLARE_PALETTE_INIT(jtc_es40); |
| 46 | | optional_shared_ptr<UINT8> m_video_ram; |
| 47 | | }; |
| 48 | | |
| 49 | | class jtces88_state : public jtc_state |
| 50 | | { |
| 51 | | public: |
| 52 | | jtces88_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | | : jtc_state(mconfig, type, tag) |
| 54 | | { } |
| 55 | | }; |
| 56 | | |
| 57 | | class jtces23_state : public jtc_state |
| 58 | | { |
| 59 | | public: |
| 60 | | jtces23_state(const machine_config &mconfig, device_type type, const char *tag) |
| 61 | | : jtc_state(mconfig, type, tag) |
| 62 | | { } |
| 63 | | |
| 64 | | virtual void video_start(); |
| 65 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 66 | | }; |
| 67 | | |
| 68 | | class jtces40_state : public jtc_state |
| 69 | | { |
| 70 | | public: |
| 71 | | jtces40_state(const machine_config &mconfig, device_type type, const char *tag) |
| 72 | | : jtc_state(mconfig, type, tag) |
| 73 | | { } |
| 74 | | |
| 75 | | virtual void video_start(); |
| 76 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 77 | | |
| 78 | | DECLARE_READ8_MEMBER( videoram_r ); |
| 79 | | DECLARE_WRITE8_MEMBER( videoram_w ); |
| 80 | | DECLARE_WRITE8_MEMBER( banksel_w ); |
| 81 | | |
| 82 | | UINT8 m_video_bank; |
| 83 | | UINT8 *m_color_ram_r; |
| 84 | | UINT8 *m_color_ram_g; |
| 85 | | UINT8 *m_color_ram_b; |
| 86 | | }; |
| 87 | | |
| 88 | | #endif |