Programming the Amiga to Play a Sound (C/C++)

  Рет қаралды 2,272

Dave Poo 2

Dave Poo 2

Күн бұрын

In this video I'm going to do some C code to see how it's possible to play audio (a simple tone and a sampled sound), using the custom chips on the Amiga. We are going to take over the system and program a sound by accessing the Amiga custom chip hardware directly.
Visual Studio Code: code.visualstudio.com/
Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE:
github.com/BartmanAbyss/vscod...
Chapters
0:00 Amiga-Debug VSCode Extension
1:06 Initialising a new Amiga Project
2:41 Stripping down the project
4:20 Hardware registers data structure
5:28 Playing a simple tone
17:13 Playing a sampled sound
23:16 Playing a sampled sound once only
33:33 Summary
Links:
Code from this video: github.com/davepoo/AmigaAudioC
Only Amiga Makes it Possible - • Only Amiga Makes it Po...
Amiga Interrupts - www.winnicki.net/amiga/memmap/...

Пікірлер: 16
@boydpukalo8980
@boydpukalo8980 10 ай бұрын
Pretty cool. Many Amiga folk have it institutionalized that assembly is the only way on Amiga, so this is cool to see. Maybe that is whe there are soo few Amiga programmers still around even though there is a sizeable community?
@DavePoo2
@DavePoo2 10 ай бұрын
I think the C/C++ compilers back in the day were not as good as they are now, so back then it was probably better to write in ASM for the speed and size. I think nowadays there is no reason to. This toolkit was used to re-create bubble bobble for the Amiga, and it runs twice as fast and provides all th e missing features that the ASM version (from back in the day) couldn't do. I think it either way, it still takes a while to create a good game for the Amiga, and there would certainly be nothing but Kudos for the developer in it now, so it's about whether any devlopers right now have the time to create stuff. I certainly would love to be developing an Amiga title, but I know it would take up too much time and wouldn't get finished.
@JensAndree
@JensAndree 9 ай бұрын
C++ on Amiga (Lattice C) wasn't very good and it quickly got pretty bloated if you didn't know what you were doing, and with bloat I mean size. Amiga had only 512kb chip mem and usually another 512 kb fast mem (expansion). If a compiler creates a much larger binary than if you wrote the same feature in 68k assembler it was a no brainer which you choose ;) It was also a snob thing in the demo scene! Assembler or GTFO... Hahahaha! I was a demo coder for years and since we did everything bare metal assembler was the faster choice. I'm glad I really learned assembler on the Amiga because it helped me to understand the processor (and the coprocessors as well) from a hardware point of view. Understanding how memory was accessed and what a clock cycle really was! It helped me later to optimise all the code I wrote professionally since I understood what was going on underneath the fluff. Counting clock cycles in loops to gain performance (or just to make things fit in memory) was something we did almost daily sometimes... C++ today is a powerful language but it creates a terrible output but nobody notices this nowadays since we're equipped with almost infinite memory - gigabytes of memory! On Amiga or earlier home computers with 6502 or Z80, or even earlier Intel 8080, you had even less memory. Using unused bits in allocated bytes was common. If you needed a flag i.e. then you could just use a bit somewhere - and making sure to comment this in the code so you don't overwrite the byte somewhere in runtime... Most of us who stopped coding for the Amiga simply don't remember interrupts etc and it would take a fair bit of time to get productive again. A few years ago when Photon (Scoopex) did an assembler school on youtube I actually got inspired and wrote a little demo in assembler, but it was hard since I've forgotten so much, but it was fun. Anyone that's keeping the Amiga community alive does a great job! I wish there was more but almost everyone moved on, got jobs, got a PC etc etc. Seeing C++ cross compiled source today was fun though but I still say that assembler is much more effective - and it would be much faster to write as well. At least for me. Please do more Amiga stuff! p.s. My view that asm is faster to code than C++ for Amiga is with regards to the demo scene. Writing a game is a whole other thing and here C++ (or plain C to be honest) is king with the resources available today!
@screemoh
@screemoh Жыл бұрын
Very nice Dave ! - not many of these C guides for amiga, more experiments would be very interesting to see :)
@DavePoo2
@DavePoo2 Жыл бұрын
Thanks. This video is a bit of an experiment for this channel to see if anyone is going interested in seeing more of this kind of thing.
@josh1234567892
@josh1234567892 Жыл бұрын
Damn, your channel is underrated!
@GadgetUK164
@GadgetUK164 Жыл бұрын
Great stuff Dave =D You have me wanting to tinker with the Amiga now!
@DavePoo2
@DavePoo2 Жыл бұрын
Yeah, this VSCode extension is really easy to get going and start tinkering or just making a whole game. The debugger also works and the performance profiler is amazing.
@RyanMcDonald
@RyanMcDonald 3 ай бұрын
This is a GREAT tutorial! Does the VSC plugin bring in everything needed (GCC/UAE/etc)? Does it add a bunch of files to your system or does everything stay within the VSC plugin's folder?
@DavePoo2
@DavePoo2 3 ай бұрын
You don't need any external tools. You don't even need a kickstart rom anymore I think as it comes with a legal kickstart replacement (but you can use your own roms if you have them)
@bitoxic
@bitoxic Жыл бұрын
Hey Dave, can you please put your sample code on Github? Save from typing it out myself!
@DavePoo2
@DavePoo2 Жыл бұрын
No problem -> github.com/davepoo/AmigaAudioC
@JarppaGuru
@JarppaGuru 6 ай бұрын
32:00 const UBYTE SampleIsRestarting = 2; if(AudPlayCount[0]==SampleIsRestarting){ custom->dmacon=DMAF_AUD0; } AudPlayCount[0]++; // now it count how many times play and not restarts xD
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 3 ай бұрын
NUMBER_OF_SAMPLES=(sizeof(SAMPLES[0])/sizeof(unsigned short int)); (Sorry for shouting)
@rawberg_se
@rawberg_se Жыл бұрын
Very cool. However I get an error saying the makefile can't be found when trying to build the init project. I just did exactly what you did. EDIT: OK, so it seems my Microsoft.PowerShell_profile.ps1 in my documents folder broke it.
@DavePoo2
@DavePoo2 Жыл бұрын
Weird, I never had that problem. It just worked out of the box. The older version needed you to at least specify the location of a kickstart ROM, as it didn't ship with one due to copyright reasons, but it's since been updated that now it ships with the Amiga kickstart replacement, so you can get going straight away with very little fuss.
I made the same game in Assembly, C and C++
4:20
Nathan Baggs
Рет қаралды 637 М.
Remembering how to use AmigaDOS (because it's been like 30 years)
27:36
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
1❤️
00:20
すしらーめん《りく》
Рет қаралды 25 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
computers suck at division (a painful discovery)
5:09
Low Level Learning
Рет қаралды 1,5 МЛН
C++ in Python the Easy Way! #pybind11
9:57
Jack of Some
Рет қаралды 95 М.
The C Programming Language is Over 50 Years Old, So Today I Learned Rust
8:14
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,5 МЛН
Один из лучших? | Arch Linux (Обзор и мнение)
17:16
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53