; The timer interrupting, which is what a music routine actually wants. ; ; 125,000 cycles is a sixteenth note at 120 beats a minute. THE SCREEN CANNOT EXPRESS IT: a ; frame is 16,667 cycles, so that beat is seven and a half of them, and a program timing music ; on frames has to pick a tempo whose subdivisions happen to land on whole ones. ; ; Eight of them is a second, and what is recorded is that it took one - and that the machine ; slept through nearly all of it, which is the difference between waiting for a beat and ; counting up to it. ; ; Written by Anachronaut #Program start: ; 125,000 cycles: a sixteenth note at 120 beats a minute, which the screen's frame ; cannot express at all. INIA 0x01 OUTA 0x52 INIA 0xE8 OUTA 0x53 INIA 0x48 OUTA 0x54 ; 0x01E848 = 125,000 INIA 0x07 OUTA 0x51 ; Run, repeat, interrupt. SIF INIB 0d8 everyBeat: WAIT INIA 0d46 OUTA 0x00 DECB BNB everyBeat CIF RSTA OUTA 0x51 INIA 0d10 OUTA 0x00 HALT beat: RETI #Vectors Boot start Device 0x50 beat