Sound producing keyboard in just two lines of BASIC on the Commodore 64

  Рет қаралды 1,196

Commodore 64 & 6510 retro-programming

Commodore 64 & 6510 retro-programming

Күн бұрын

A BASIC two-liner on the Commodore 64, which enables a sound each time you press a key on the keyboard. Written in BASIC, the two lines store values in the memory and creates an IRQ driven routine.
The result is rather disappointing but the interesting thing about this two-liner is the process used through the instruction PRINT to write a short routine in machine language at $C031/49201. The screen RAM is indeed used to store values, which are 6502's opcodes modifying the values in the SID registers and the vector pointing to the interrupt handler $314/$315. This is something that might be obvious for experienced programmers, but not so much for beginners
#c64
#basic
#6502
#commodore64

Пікірлер: 12
@the_eminent_Joshua_E_Hrouda
@the_eminent_Joshua_E_Hrouda Ай бұрын
One way to make the program smaller or a little more streamlined is to use line numbers 1 & 2 instead of 5 & 10
@Commodoreretro-programming
@Commodoreretro-programming Ай бұрын
Well, try to use 0 and 1 instead! Yep 0 can be used in BASIC.
@davedavenport8673
@davedavenport8673 23 күн бұрын
Interesting how they used the high byte ($EA) of the original IRQ vector, which they jump back to at the end of the code, as the value for most of the SID registers, then STA the voice register with the waveform value to turn on the note. The key bounce feature is great as well. It would be fun to grab the keycode for whatever key is pressed and do some rotate to get it to a higher value and use that as the note high byte of the note, so each key would make a slightly different pitch.
@davedavenport8673
@davedavenport8673 23 күн бұрын
ah, nevermind on the EA thing. That is just the starting location for the data that goes into the SID voice 3 registers using the LDA,x opcode.
@Commodoreretro-programming
@Commodoreretro-programming 21 күн бұрын
Agree. It could be fun to change the code to get a different sound for each key pressed. It should not be difficult. I'll do it if I have some time.
@CityXen
@CityXen 21 күн бұрын
Cool deal man
@Commodoreretro-programming
@Commodoreretro-programming Ай бұрын
The two lines 5 ?"{clear}jelelid@o@@ble@bhe@bo@a@jb@kkmdol@im@mmdljm@ogjibahmabmddlcanjka@n@@@@b@@h"; 10 ?"@@@@@@@@@o":forf=0to41:A=1024+F+F:B=PEEK(A)*16+PEEK(A+1):poke49201+F,B:next:poke789,192:new
@przemekbundy
@przemekbundy Ай бұрын
Bonjour. ça m'est arrivé pour la première fois. sur votre tube. m'a proposé la chaîne française. J'ai grandi sur C64. Salutations de la Pologne.
@Commodoreretro-programming
@Commodoreretro-programming Ай бұрын
Bonjour et bienvenue. Moi aussi j'ai grandi avec un Commodore 64 :)
@the_eminent_Joshua_E_Hrouda
@the_eminent_Joshua_E_Hrouda Ай бұрын
All that typing. All those random-looking letters in the PRINT statement. And all it did was make one note!!?? What a crap program!! Not a bad video. I like how you explained how it worked.
@Commodoreretro-programming
@Commodoreretro-programming Ай бұрын
Maybe the video focussed on the process and the explanations rather than on the result itself... :)
@jimphone
@jimphone Ай бұрын
Let's see your more efficient code then. Post it here and maybe he can make a video about it.
Best POKE Ever? For Commodore 64
22:21
8-Bit Show And Tell
Рет қаралды 42 М.
How Machine Language Works
19:48
The 8-Bit Guy
Рет қаралды 945 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 7 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,6 МЛН
Everything you SHOULD know about your Computer but don't!
19:59
Dave's Garage
Рет қаралды 449 М.
C64 - Hiding machine language in a REM statement
10:07
Retro Old Guy
Рет қаралды 15 М.
Understanding how a demo works on the Commodore 64 (English)
8:41
Commodore 64 & 6510 retro-programming
Рет қаралды 6 М.
Assembly Programming is Hard…
20:00
Usagi Electric
Рет қаралды 99 М.
Programming Like It's 1979: 6502 Assembly language on the Apple ][
19:53
Using a Commodore 64 on the modern internet!
21:08
Veronica Explains
Рет қаралды 699 М.
Assembly Language in 100 Seconds
2:44
Fireship
Рет қаралды 1,5 МЛН
Machine Code Explained - Computerphile
20:32
Computerphile
Рет қаралды 112 М.
Coding a plasma effect demo on the Commodore 64 (tutorial DIY)
12:30
Commodore 64 & 6510 retro-programming
Рет қаралды 2,1 М.
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 8 МЛН
S24 Ultra and IPhone 14 Pro Max telephoto shooting comparison #shorts
0:15
Photographer Army
Рет қаралды 10 МЛН
ВАЖНО! Не проверяйте на своем iPhone после установки на экран!
0:19
ГЛАЗУРЬ СТЕКЛО для iPhone и аксессуары OTU
Рет қаралды 6 МЛН