src/mess/devices/cartslot.c
| r4107 | r4108 | |
| 26 | 26 | INLINE FUNCTIONS |
| 27 | 27 | ***************************************************************************/ |
| 28 | 28 | |
| 29 | INLINE 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 | |
| 29 | 37 | INLINE const cartslot_config *get_config(const device_config *device) |
| 30 | 38 | { |
| 31 | 39 | assert(device != NULL); |
| r4107 | r4108 | |
| 38 | 46 | IMPLEMENTATION |
| 39 | 47 | ***************************************************************************/ |
| 40 | 48 | |
| 49 | /*------------------------------------------------- |
| 50 | load_cartridge |
| 51 | -------------------------------------------------*/ |
| 52 | |
| 41 | 53 | static int load_cartridge(running_machine *machine, const rom_entry *romrgn, const rom_entry *roment, const device_config *image) |
| 42 | 54 | { |
| 43 | 55 | const char *region; |
| r4107 | r4108 | |
| 119 | 131 | |
| 120 | 132 | |
| 121 | 133 | |
| 134 | /*------------------------------------------------- |
| 135 | process_cartridge |
| 136 | -------------------------------------------------*/ |
| 137 | |
| 122 | 138 | static int process_cartridge(const device_config *image, const device_config *file) |
| 123 | 139 | { |
| 124 | 140 | const rom_source *source; |
| r4107 | r4108 | |
| 149 | 165 | } |
| 150 | 166 | |
| 151 | 167 | |
| 168 | /*------------------------------------------------- |
| 169 | DEVICE_START( cartslot_specified ) |
| 170 | -------------------------------------------------*/ |
| 152 | 171 | |
| 153 | 172 | static DEVICE_START( cartslot_specified ) |
| 154 | 173 | { |
| r4107 | r4108 | |
| 162 | 181 | return DEVICE_START_OK; |
| 163 | 182 | } |
| 164 | 183 | |
| 184 | |
| 185 | /*------------------------------------------------- |
| 186 | DEVICE_IMAGE_LOAD( cartslot_specified ) |
| 187 | -------------------------------------------------*/ |
| 188 | |
| 165 | 189 | static DEVICE_IMAGE_LOAD( cartslot_specified ) |
| 166 | 190 | { |
| 167 | 191 | return process_cartridge(image, image); |
| 168 | 192 | } |
| 169 | 193 | |
| 194 | |
| 195 | /*------------------------------------------------- |
| 196 | DEVICE_IMAGE_UNLOAD( cartslot_specified ) |
| 197 | -------------------------------------------------*/ |
| 198 | |
| 170 | 199 | static DEVICE_IMAGE_UNLOAD( cartslot_specified ) |
| 171 | 200 | { |
| 172 | 201 | process_cartridge(image, NULL); |
| 173 | 202 | } |
| 174 | 203 | |
| 175 | 204 | |
| 205 | /*------------------------------------------------- |
| 206 | DEVICE_SET_INFO( cartslot ) |
| 207 | -------------------------------------------------*/ |
| 176 | 208 | |
| 209 | static DEVICE_SET_INFO( cartslot ) |
| 210 | { |
| 211 | /* appease compiler */ |
| 212 | get_token(device); |
| 177 | 213 | |
| 178 | | DEVICE_GET_INFO(cartslot) |
| 214 | switch (state) |
| 215 | { |
| 216 | /* no parameters to set */ |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | |
| 221 | /*------------------------------------------------- |
| 222 | DEVICE_GET_INFO( cartslot ) |
| 223 | -------------------------------------------------*/ |
| 224 | |
| 225 | DEVICE_GET_INFO( cartslot ) |
| 179 | 226 | { |
| 180 | | switch( state ) |
| 227 | switch(state) |
| 181 | 228 | { |
| 182 | 229 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 183 | 230 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cartslot_t); break; |
| r4107 | r4108 | |
| 195 | 242 | } |
| 196 | 243 | break; |
| 197 | 244 | |
| 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; |
| 199 | 247 | case DEVINFO_FCT_START: if ( device && device->inline_config && get_config(device)->device_start) { |
| 200 | 248 | info->start = get_config(device)->device_start; |
| 201 | 249 | } else { |