Hacker News new | ask | show | jobs
by rzzzt 798 days ago
The timer interrupt could also do the loading:

- maintain a, say, ring buffer :) for I/O commands (operation, file handle, offset, buffer address, callback address)

- add requests to the buffer from the game loop

- timer wakes up periodically, splits requests into palatable chunks, completes a portion of the requested work, when it reaches the end it either sets a flag on the request to signal its completion and/or jumps to its callback address

- game loop can periodically check and empty the request buffer or set the requests to self-destruct on completion

2 comments

That does not really work since the only IO was the BIOS-provided one that was 1. synchronous and 2. really slow. If you tried to do that you'd just get insanely bad pauses.
Yeah either way, my hunch was just I wouldn’t want to drop frames in the game, so it’s nice have a timer on the graphics.