src/mess/devices/orch90.c
| r4110 | r4111 | |
| 15 | 15 | #include "sound/dac.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | | typedef struct _orch90_info orch90_info; |
| 19 | | struct _orch90_info |
| 18 | /*************************************************************************** |
| 19 | TYPE DEFINITIONS |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | typedef struct _orch90_t orch90_t; |
| 23 | struct _orch90_t |
| 20 | 24 | { |
| 21 | 25 | int left_dac; |
| 22 | 26 | int right_dac; |
| r4110 | r4111 | |
| 24 | 28 | |
| 25 | 29 | |
| 26 | 30 | |
| 27 | | /*------------------------------------------------- |
| 28 | | orch90_get_info |
| 29 | | -------------------------------------------------*/ |
| 31 | /*************************************************************************** |
| 32 | INLINE FUNCTIONS |
| 33 | ***************************************************************************/ |
| 30 | 34 | |
| 31 | | static orch90_info *orch90_get_info(coco_cartridge *cartridge) |
| 35 | INLINE orch90_t *get_token(coco_cartridge *cartridge) |
| 32 | 36 | { |
| 33 | 37 | return cococart_get_extra_data(cartridge); |
| 34 | 38 | } |
| 35 | 39 | |
| 36 | 40 | |
| 37 | 41 | |
| 42 | /*************************************************************************** |
| 43 | IMPLEMENTATION |
| 44 | ***************************************************************************/ |
| 45 | |
| 38 | 46 | /*------------------------------------------------- |
| 39 | 47 | orch90_init - initializer for the Orch-90 |
| 40 | 48 | -------------------------------------------------*/ |
| 41 | 49 | |
| 42 | 50 | static void orch90_init(running_machine *machine, coco_cartridge *cartridge) |
| 43 | 51 | { |
| 44 | | orch90_info *info = orch90_get_info(cartridge); |
| 52 | orch90_t *info = get_token(cartridge); |
| 45 | 53 | |
| 46 | 54 | /* TODO - when we can instantiate DACs, we can do something better here */ |
| 47 | 55 | info->left_dac = 0; |
| r4110 | r4111 | |
| 56 | 64 | |
| 57 | 65 | static void orch90_w(running_machine *machine, coco_cartridge *cartridge, UINT16 addr, UINT8 data) |
| 58 | 66 | { |
| 59 | | orch90_info *info = orch90_get_info(cartridge); |
| 67 | orch90_t *info = get_token(cartridge); |
| 60 | 68 | |
| 61 | 69 | switch(addr) |
| 62 | 70 | { |
| r4110 | r4111 | |
| 84 | 92 | switch(state) |
| 85 | 93 | { |
| 86 | 94 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 87 | | case COCOCARTINFO_INT_DATASIZE: info->i = sizeof(orch90_info); break; |
| 95 | case COCOCARTINFO_INT_DATASIZE: info->i = sizeof(orch90_t); break; |
| 88 | 96 | |
| 89 | 97 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 90 | 98 | case COCOCARTINFO_PTR_INIT: info->init = orch90_init; break; |