Commodore 64


FBnil

my lonely NES is skilling me
Joined
Dec 14, 2012
Messages
4,352
Location
Yurp
Or would expect a lookup table in the 64K RAM?
That would have been awesome to have. Everybody pre-calculates their sines, why not give us half a sine, which could have been used for, say, volume ramping. Maybe the BASIC could have been written more efficiently to make space for it. (or use a ROM, like the C128 does - but yeah, price).

C64 38911 Basic Bytes Free -> 64*1024-38911=26625 bytes used for Basic
C128 122365 Basic Bytes Free -> 2*64*1024-122365=8707 bytes used for Basic

Enough room for Graphical basic (beyond the splitscreen graphical mode):
1631661654876.png




About bankswitching, and how to make your C128 have 1MB RAM
Lot's of nice technical details. It does explain why you could add a GEOS cardridge and still have RAM to do work on the system.


Testing if your C128 has 16k or 64k video RAM
Source: https://atariage.com/forums/topic/241658-c-128-vdc-ram-upgrade/
And in general, which C128 had more video RAM
Type this line in 80 column mode:

Code:
POKE DEC("D600"),28:POKE DEC("D601"),63:SYS DEC("FF62"):SCNCLR <RETURN>

If the screen looks normal and says READY, and all that, you've got 64K
display memory. If the screen is full of 0's and looks like a programming
nightmare, you've got 16K (just hit Stop/Restore and let Mr. Kernel fix it).

Want more C128 software goodies? This site has it:

Some light reading (same rant as always, but very enjoyable):
 
  • Like
Reactions: rSl

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
14,761
Location
Somewhere off the coast of the EU
That would have been awesome to have. Everybody pre-calculates their sines, why not give us half a sine, which could have been used for, say, volume ramping.
Actually, sine waves have fourfold symmetry, each hoop is followed by a negative hoop and the up of the hoop is left-right symmetrical with the down of the up hoop. So a full sine wave is look up table, look up table in reverse, 0-look up table (or just invert the bits, gives you negative-1 which is close enough most of the time), 0-lookup table in reverse, then back the the start.

But I'm not sure the SID chip actually has access to the full system RAM, plus in most 8-bit systems the sin look up table is in the BASIC ROM, which might get switched out by games, at least on the 8-bit systems I'm familiar with.
 

hmn

Member
Joined
Mar 8, 2010
Messages
225
The oscillators are digital (20 bit phase accumulator IIRC).

None of the old digital sound chips have sine wave, they only have triangle as a crude approximation :)

For digital sine wave, you'd use a wavetable. That can be done in software on the C64 of course (the same way sample playback is done).
 
  • Like
Reactions: rSl

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
14,761
Location
Somewhere off the coast of the EU
We get: Feed a square wave through a low pass filter, and you get a sine wave.
That is true of course. Filter out all of the harmonics out of any sound and you get a sine wave. The only trouble is unless you've got an extremely specific and tight low pass filter (and the classic capacitor and inductor class of filters were never that tight) you'll never filter off all of the harmonics, and since the square wave oscilator oscillates at different frequencies, unless you modify your low pass filter for each note, it won't be right for everything, and using all of that die area for differently tuned filters is still to the best of my knowledge not something anyone's done in reality. Most of these 8-bit sound chips can produce 256 different semitones of pitch which I work out to be 21+1/3 octaves which seems a little excessive, so maybe they only actually produce 128 semitones.
 
Last edited:

FBnil

my lonely NES is skilling me
Joined
Dec 14, 2012
Messages
4,352
Location
Yurp
Released 6 oct 2021 (4 days ago):


If that is too dry, watch this guy:

 
  • Love
Reactions: rSl
Top