src/mess/devices/messram.c
| r6255 | r6256 | |
| 136 | 136 | /* allocate space for the ram */ |
| 137 | 137 | messram->ram = auto_alloc_array(device->machine, UINT8, messram->size); |
| 138 | 138 | |
| 139 | /* reset ram to the default value */ |
| 140 | memset(messram->ram, config->default_value, messram->size); |
| 141 | |
| 139 | 142 | /* register for state saving */ |
| 140 | 143 | state_save_register_device_item(device, 0, messram->size); |
| 141 | 144 | state_save_register_device_item_pointer(device, 0, messram->ram, messram->size); |
| 142 | 145 | } |
| 143 | 146 | |
| 144 | | |
| 145 | | static DEVICE_RESET( messram ) |
| 146 | | { |
| 147 | | messram_state *messram = get_safe_token(device); |
| 148 | | ram_config *config = device->inline_config; |
| 149 | | |
| 150 | | /* reset ram to the default value */ |
| 151 | | memset(messram->ram, config->default_value, messram->size); |
| 152 | | } |
| 153 | | |
| 154 | | |
| 155 | 147 | static DEVICE_VALIDITY_CHECK( messram ) |
| 156 | 148 | { |
| 157 | 149 | ram_config *config = device->inline_config; |
| r6255 | r6256 | |
| 266 | 258 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 267 | 259 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(messram); break; |
| 268 | 260 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 269 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(messram); break; |
| 261 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 270 | 262 | case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(messram); break; |
| 271 | 263 | |
| 272 | 264 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |