diff options
author | 2012-07-15 18:44:16 +0000 | |
---|---|---|
committer | 2012-07-15 18:44:16 +0000 | |
commit | 41d03848d22e1d1779b6b5d4b641eb78e50e9f8f (patch) | |
tree | 2659bf75d0cebaacfdc1632a71ead126a3fec3cd /src/emu/machine/roc10937.h | |
parent | cc531f091b14dbad1277ee41abb7bac224c24fa1 (diff) |
ROC10937 converted to a modern device - still needs proper character clock timing for the brightness effects.
Displays now have to be added to the CONFIG_START, and take the form 'MCFG_ROC10937_ADD(tag,port,RIGHT_TO_LEFT/LEFT_TO_RIGHT)'
The last option represents the direction for moving from start to end on the display.
Converted all drivers that used the old form, adding improved serial communications where documentation is known.
Made BFM_BD1 save states properly this time.
Diffstat (limited to 'src/emu/machine/roc10937.h')
-rw-r--r-- | src/emu/machine/roc10937.h | 127 |
1 files changed, 110 insertions, 17 deletions
diff --git a/src/emu/machine/roc10937.h b/src/emu/machine/roc10937.h index 75e092e90e9..a260d78332e 100644 --- a/src/emu/machine/roc10937.h +++ b/src/emu/machine/roc10937.h @@ -4,31 +4,124 @@ OKI MSC1937 is a clone of this chip **********************************************************************/ +#pragma once -#ifndef ROC10937 -#define ROC10937 +#ifndef ROC10937_H +#define ROC10937_H -#define MAX_ROCK_ALPHAS 3 // max number of displays emulated +#define LEFT_TO_RIGHT 1 +#define RIGHT_TO_LEFT 0 -#define ROCKWELL10937 0 // Rockwell 10937 -#define MSC1937 0 // OKI MSC1937 clone of Rockwell 10937 -#define ROCKWELL10957 1 // Rockwell 10957 +#define MCFG_ROC10937_ADD(_tag,_val,_reversed) \ + MCFG_DEVICE_ADD(_tag, ROC10937,60)\ + MCFG_ROC10937_PORT(_val) \ + MCFG_ROC10937_REVERSE(_reversed) \ -void ROC10937_init( int id, int type,int reversed ); // setup a display +#define MCFG_ROC10937_PORT(_val) \ + roc10937_t::static_set_value(*device, _val); \ -void ROC10937_reset( int id); // reset the alpha +#define MCFG_ROC10937_REVERSE(_reversed) \ + roc10937_t::static_set_zero(*device, _reversed); \ + +#define MCFG_ROC10937_REMOVE(_tag) \ + MCFG_DEVICE_REMOVE(_tag) -void ROC10937_shift_data(int id, int data); // clock in a bit of data +#define MCFG_ROC10957_ADD(_tag,_val,_reversed) \ + MCFG_DEVICE_ADD(_tag, ROC10957,60)\ + MCFG_ROC10957_PORT(_val) \ + MCFG_ROC10957_REVERSE(_reversed) \ -int ROC10937_newdata( int id, int data); // clock in 8 bits of data +#define MCFG_ROC10957_PORT(_val) \ + roc10957_t::static_set_value(*device, _val); \ -UINT32 *ROC10937_get_segments(int id); // get current segments displayed -UINT32 *ROC10937_set_outputs(int id); // convert segments to standard for display -UINT32 *ROC10937_get_outputs(int id); // get converted segments +#define MCFG_ROC10957_REVERSE(_reversed) \ + roc10957_t::static_set_zero(*device, _reversed); \ -char *ROC10937_get_string( int id); // get current string displayed (not as accurate) +#define MCFG_ROC10957_REMOVE(_tag) \ + MCFG_DEVICE_REMOVE(_tag) -void ROC10937_draw_16seg(int id); -void ROC10937_draw_14seg(int id); -#endif +#define MCFG_MSC1937_ADD(_tag,_val,_reversed) \ + MCFG_DEVICE_ADD(_tag, ROC10937,60)\ + MCFG_MSC1937_PORT(_val) \ + MCFG_MSC1937_REVERSE(_reversed) \ + +#define MCFG_MSC1937_PORT(_val) \ + MCFG_ROC10937_PORT(_val) + +#define MCFG_MSC1937_REVERSE(_reversed) \ + roc10937_t::static_set_zero(*device, _reversed); \ + +#define MCFG_MSC1937_REMOVE(_tag) \ + MCFG_DEVICE_REMOVE(_tag) + + +class rocvfd_t : public device_t { +public: + typedef delegate<void (bool state)> line_cb; + + rocvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); + + // inline configuration helpers + static void static_set_value(device_t &device, int val); + static void static_set_zero(device_t &device, bool reversed); + virtual void update_display(); + UINT8 m_port_val; + bool m_reversed; + void blank(int data); + void shift_data(int data); + void write_char(int data); + void setdata(int segdata, int data); + UINT32 set_display(UINT32 segin); + + +protected: + int m_cursor_pos; + int m_window_size; // window size + int m_shift_count; + int m_shift_data; + int m_pcursor_pos; + int m_brightness; + int m_count; + int m_duty; + int m_disp; + UINT8 m_cursor; + UINT32 m_chars[16]; + UINT32 m_outputs[16]; + + virtual void device_start(); + virtual void device_reset(); + virtual void device_post_load(); +}; + + +class roc10937_t : public rocvfd_t { +public: + roc10937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: +}; + +class msc1937_t : public rocvfd_t { +public: + msc1937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + +}; + +class roc10957_t : public rocvfd_t { +public: + roc10957_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + void write_char(int data); + +protected: + +}; + +extern const device_type ROC10937; +extern const device_type MSC1937; +extern const device_type ROC10957; + +#endif |