| 323 | int history_inuse_amount(int idx) { return history_value(idx, HIST_INUSE_AMOUNT); } |
| 324 | |
| 325 | void updateHistory() |
| 326 | { |
| 327 | size_t buffer_size = history_size(); |
| 328 | if (buffer_size < MAX_HISTORY_SIZE && size_t(history.ival(0)+1) == buffer_size) |
| 329 | history.ensure_data(hist_entry_size*++buffer_size); |
| 330 | history.ival(0) = (history.ival(0)+1) % buffer_size; |
| 331 | |
| 332 | size_t base = history.ival(0) * hist_entry_size; |
| 333 | |
| 334 | history.set_int28(base + HIST_COUNT*int28_size, item_count); |
| 335 | history.set_int28(base + HIST_AMOUNT*int28_size, item_amount); |
| 336 | history.set_int28(base + HIST_INUSE_COUNT*int28_size, item_inuse_count); |
| 337 | history.set_int28(base + HIST_INUSE_AMOUNT*int28_size, item_inuse_amount); |
| 338 | } |
| 339 | }; |
| 340 | |
| 341 | /****************************** |
no test coverage detected