c64/spectrum multitasking

Started by
3 comments, last by En3my 21 years, 2 months ago
Earlier today I was listening to some 8-bit music remixes, and I came to think about the music played while loading a game from tape or floppy on the now ancient Commodore 64 or Spectrum. Ocean software in particular used this while their games were being loaded into memory. How could this be done back then? I mean there was no multi-tasking systems as we have today. Hopefully someone with experience from programming 8-bit computers will read this, cause I really would like to know the details. I also remember that a friend of mine had two really good books about programming the Commodore 64. I believe one of them was called something like the C64 Reference Guide and the other one I can''t remember but it was about machine code / C=64 architecture as well. Anyone know if these books can be bought somewhere, or perhaps there are any online resources? Thanks!
Advertisement
hint: timer interrupts
quote:Original post by En3my
I also remember that a friend of mine had two really good books about programming the Commodore 64. I believe one of them was called something like the C64 Reference Guide and the other one I can''t remember but it was about machine code / C=64 architecture as well. Anyone know if these books can be bought somewhere, or perhaps there are any online resources? Thanks!


http://www.devili.iki.fi/Computers/Commodore/C64/Programmers_Reference/front_cover.html

http://www.devili.iki.fi/pub/Commodore/docs/c64prg10.zip


and yes, timer interrupts, or IRQ as it''s called on the C64.

2DNow - Specializing in yesterday''s technology today!
thanks a lot of supplying me with a url where i can find old commodore 64 documentation.

so interupts are the secret! i plan to read through the programmer''s reference at one time or another, cause i''m dead curious. i still would like to know more about how it was done, and not just about loaders. now thinking of it the must much apply to the pc i have in front of me right now. problem is that the operating system hide it all for me. i know what interupts are, and how you set them up in Assembly and the C language, but could someone please write some pseudo-code briefly how it worked on the Commodore 64 (or in DOS for that matter). So-called multi-tasking when everything seems to be executed at the same time (rendering, music, sfx and so on). i begun my programming in the Windows enviroment, so i never had to think much about these things, but still i''m curious about the workings of such things.
The Multitasking in windows now is really just interrupts will knobs on. You run process A for x amount of time, then an interrupt occurs which call the operating system code to switch to process B which runs until the next interrupt which switches to another process. And so on.

Of course, there is a lot more to the reality than this, but you get the picture.

So, to play music in the background, just set up an interrupt routine which runs the music player. This routine should execute quickly and often giving the impression of multitasking.
In the case of music while loading from tape, you have to be careful of timing issues, but in the days of the C64 and spectrum, you could time your code to the clock cycle.

I wouldn''t use interrupts under windows though.

This topic is closed to new replies.

Advertisement