Previous 15994 Revisions Next

r4108 Sunday 11th January, 2009 at 19:45:11 UTC by Nathan Woods
Minor cleanups; commenting
[src/mess/devices]cartslot.c

src/mess/devices/cartslot.c
r4107r4108
2626    INLINE FUNCTIONS
2727***************************************************************************/
2828
29INLINE cartslot_t *get_token(const device_config *device)
30{
31   assert(device != NULL);
32   assert(device->type == CARTSLOT);
33   return (cartslot_t *) device->token;
34}
35
36
2937INLINE const cartslot_config *get_config(const device_config *device)
3038{
3139   assert(device != NULL);
r4107r4108
3846    IMPLEMENTATION
3947***************************************************************************/
4048
49/*-------------------------------------------------
50    load_cartridge
51-------------------------------------------------*/
52
4153static int load_cartridge(running_machine *machine, const rom_entry *romrgn, const rom_entry *roment, const device_config *image)
4254{
4355   const char *region;
r4107r4108
119131
120132
121133
134/*-------------------------------------------------
135    process_cartridge
136-------------------------------------------------*/
137
122138static int process_cartridge(const device_config *image, const device_config *file)
123139{
124140   const rom_source *source;
r4107r4108
149165}
150166
151167
168/*-------------------------------------------------
169    DEVICE_START( cartslot_specified )
170-------------------------------------------------*/
152171
153172static DEVICE_START( cartslot_specified )
154173{
r4107r4108
162181   return DEVICE_START_OK;
163182}
164183
184
185/*-------------------------------------------------
186    DEVICE_IMAGE_LOAD( cartslot_specified )
187-------------------------------------------------*/
188
165189static DEVICE_IMAGE_LOAD( cartslot_specified )
166190{   
167191   return process_cartridge(image, image);
168192}
169193
194
195/*-------------------------------------------------
196    DEVICE_IMAGE_UNLOAD( cartslot_specified )
197-------------------------------------------------*/
198
170199static DEVICE_IMAGE_UNLOAD( cartslot_specified )
171200{
172201   process_cartridge(image, NULL);
173202}
174203
175204
205/*-------------------------------------------------
206    DEVICE_SET_INFO( cartslot )
207-------------------------------------------------*/
176208
209static DEVICE_SET_INFO( cartslot )
210{
211   /* appease compiler */
212   get_token(device);
177213
178DEVICE_GET_INFO(cartslot)
214   switch (state)
215   {
216      /* no parameters to set */
217   }
218}
219
220
221/*-------------------------------------------------
222    DEVICE_GET_INFO( cartslot )
223-------------------------------------------------*/
224
225DEVICE_GET_INFO( cartslot )
179226{   
180   switch( state )
227   switch(state)
181228   {
182229      /* --- the following bits of info are returned as 64-bit signed integers --- */
183230      case DEVINFO_INT_TOKEN_BYTES:            info->i = sizeof(cartslot_t); break;
r4107r4108
195242                                       }
196243                                       break;
197244
198      /* --- the following bits of info are returned as pointers to data or functions --- */
245      /* --- the following bits of info are returned as pointers to functions --- */
246      case DEVINFO_FCT_SET_INFO:               info->set_info = DEVICE_SET_INFO_NAME(cartslot); break;
199247      case DEVINFO_FCT_START:                  if ( device && device->inline_config && get_config(device)->device_start) {
200248                                          info->start = get_config(device)->device_start;
201249                                       } else {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team