---------------------------------------------------------------------------- Write state. ----------------------------------------------------------------------------
| 356 | // Write state. |
| 357 | // ---------------------------------------------------------------------------- |
| 358 | void cSID::write_state(const State& state) |
| 359 | { |
| 360 | int i; |
| 361 | |
| 362 | for (i = 0; i <= 0x18; i++) { |
| 363 | write(i, state.sid_register[i]); |
| 364 | } |
| 365 | |
| 366 | bus_value = state.bus_value; |
| 367 | bus_value_ttl = state.bus_value_ttl; |
| 368 | |
| 369 | for (i = 0; i < 3; i++) { |
| 370 | voice[i].wave.accumulator = state.accumulator[i]; |
| 371 | voice[i].wave.shift_register = state.shift_register[i]; |
| 372 | voice[i].envelope.rate_counter = state.rate_counter[i]; |
| 373 | voice[i].envelope.rate_period = state.rate_counter_period[i]; |
| 374 | voice[i].envelope.exponential_counter = state.exponential_counter[i]; |
| 375 | voice[i].envelope.exponential_counter_period = state.exponential_counter_period[i]; |
| 376 | voice[i].envelope.envelope_counter = state.envelope_counter[i]; |
| 377 | voice[i].envelope.state = state.envelope_state[i]; |
| 378 | voice[i].envelope.hold_zero = state.hold_zero[i]; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | |
| 383 | // ---------------------------------------------------------------------------- |