small tweaks

This commit is contained in:
IonutParau 2025-07-11 00:47:13 +02:00
parent 1fa8284aea
commit 4fecda06d4
2 changed files with 5 additions and 1 deletions

View File

@ -35,6 +35,10 @@
- `tape_drive` component, compatible with Computronics, except maybe with proper seek times and support for multiple tapes - `tape_drive` component, compatible with Computronics, except maybe with proper seek times and support for multiple tapes
- `cd_reader` and `cd_writer` components, to work with CDs - `cd_reader` and `cd_writer` components, to work with CDs
# API changes
- move controls into the component instances instead of using getters, to boost performance
# Internal changes # Internal changes
- use dynamic arrays for signals (and maybe components), but still keep the maximums to prevent memory hogging - use dynamic arrays for signals (and maybe components), but still keep the maximums to prevent memory hogging

View File

@ -43,7 +43,7 @@ void nni_drive_seekTo(nn_component *component, nni_drive *drive, nn_size_t secto
sector = sector - 1; // switch to 0 to N-1 sector addressing, sector = sector - 1; // switch to 0 to N-1 sector addressing,
// which is much nicer to do math with // which is much nicer to do math with
// and Lua made a big oopsie. // and Lua made a big oopsie.
size_t old = drive->currentSector; nn_size_t old = drive->currentSector;
nn_driveControl ctrl = nn_drive_getControl(component, drive); nn_driveControl ctrl = nn_drive_getControl(component, drive);
if(ctrl.seekSectorsPerTick == 0) return; // seek latency disabled if(ctrl.seekSectorsPerTick == 0) return; // seek latency disabled
nn_computer *computer = nn_getComputerOfComponent(component); nn_computer *computer = nn_getComputerOfComponent(component);