Previous 15994 Revisions Next

r4111 Sunday 11th January, 2009 at 21:23:59 UTC by Nathan Woods
Minor code cleanups
[src/mess/devices]orch90.c

src/mess/devices/orch90.c
r4110r4111
1515#include "sound/dac.h"
1616
1717
18typedef struct _orch90_info orch90_info;
19struct _orch90_info
18/***************************************************************************
19    TYPE DEFINITIONS
20***************************************************************************/
21
22typedef struct _orch90_t orch90_t;
23struct _orch90_t
2024{
2125   int left_dac;
2226   int right_dac;
r4110r4111
2428
2529
2630
27/*-------------------------------------------------
28    orch90_get_info
29-------------------------------------------------*/
31/***************************************************************************
32    INLINE FUNCTIONS
33***************************************************************************/
3034
31static orch90_info *orch90_get_info(coco_cartridge *cartridge)
35INLINE orch90_t *get_token(coco_cartridge *cartridge)
3236{
3337   return cococart_get_extra_data(cartridge);
3438}
3539
3640
3741
42/***************************************************************************
43    IMPLEMENTATION
44***************************************************************************/
45
3846/*-------------------------------------------------
3947    orch90_init - initializer for the Orch-90
4048-------------------------------------------------*/
4149
4250static void orch90_init(running_machine *machine, coco_cartridge *cartridge)
4351{
44   orch90_info *info = orch90_get_info(cartridge);
52   orch90_t *info = get_token(cartridge);
4553
4654   /* TODO - when we can instantiate DACs, we can do something better here */
4755   info->left_dac = 0;
r4110r4111
5664
5765static void orch90_w(running_machine *machine, coco_cartridge *cartridge, UINT16 addr, UINT8 data)
5866{
59   orch90_info *info = orch90_get_info(cartridge);
67   orch90_t *info = get_token(cartridge);
6068
6169   switch(addr)
6270   {
r4110r4111
8492   switch(state)
8593   {
8694      /* --- 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;
8896
8997      /* --- the following bits of info are returned as pointers to data or functions --- */
9098      case COCOCARTINFO_PTR_INIT:                     info->init = orch90_init;   break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team