Retro Programming on the C64 Episode 4 - Raster Interrupts and How to Play SID Music in Code.

Retro Programming on the C64 Episode 4 - Raster Interrupts and How to Play SID Music in Code.

TheStuffMade

3 года назад

12,695 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ma3xiu1
@ma3xiu1 - 28.12.2023 07:16

This is a cool tutorial! I discovered that if you don't disable CIA timer interrupts, are selective about only calling the play routine on raster interrupts, and you jump to the standard IRQ handler afterwards, you can have the music playing in the background while running a BASIC program (you do need to alter top of BASIC so it doesn't clobber your ML routine though).

Ответить
@DJSpaceRetrotunes
@DJSpaceRetrotunes - 12.09.2023 17:38

Very informative video!. How can you play 2x speed SID files though?

Ответить
@sanjyuu2298
@sanjyuu2298 - 11.09.2023 10:05

Shouldn't SEI enable interrupts and CLI disable or is it inverted on 6510 in contrast to Arduino?

Ответить
@nkronert
@nkronert - 29.08.2023 20:23

Great tutorial!
Imagine if we had had this kind of info plus these tools when the C64 came out.
There would probably have been way more games available for it, not that I'm complaining.

On second thought, the potential game developers would probably have skipped the C64 and gone straight to Intel Core i7 with the graphics cards that are available now 😊.

Ответить
@otherwise6064
@otherwise6064 - 02.08.2023 06:46

been looking all over just trying to figure out how to play a sid on windows 10, so thank you for the reference to Sidplay ^_^

Ответить
@ian1630
@ian1630 - 02.03.2023 17:33

Excellent clear demonstration on something i’ve struggled with for some time… thanks!

Ответить
@YoreHistory
@YoreHistory - 08.02.2023 10:46

Fantastic video!

Ответить
@phil2768
@phil2768 - 29.12.2022 05:50

I wish you did more commodore tutorials - certainly regarding graphics (sprites), etc

Ответить
@erikrounds
@erikrounds - 26.11.2022 22:22

Thanks for these C=64 programming tutorials. When I was a kid, I wasn't able to wrap my head around the c64 assembler, but it seems so much easier now.

Ответить
@MiccaPhone
@MiccaPhone - 06.11.2022 22:51

Unfortunately raster interrupt was no BASIC feature, Bill (Gates). Imagine how cool an interrupt command would've been to jump to a certain BASIC line like this command line:

10 IRQJUMP 142,30000: REM JUMP TO LINE 30000 UPON RASTER LINE 142
20 ... SOME CODE ...
30 ... SOME CODE ...
...
...
30000 REM RASTER IRQ SUBROUTINE
30010 ...SOME SOUND COMMANDS...
30020 ...SOME MORE COMMANDS...
30030 ...
...
30100 RETURN: GO BACK TO WHERE YOU CAME FROM

Ответить
@dotmos
@dotmos - 31.10.2022 01:09

Awesome! This actually helped me fix a random raster interrupt crash in my sprite multiplexer that i was getting in a game i'm working on. It was driving me crazy!
In my code i changed
asl $D019 to inc $D019
and also added the
lda #$7f
and $D011
sta $D011
part before changing $D012.
Now it is working like a charm :)

Thanks for the video! :)

Ответить
@gadgetsandtech
@gadgetsandtech - 24.08.2022 14:21

Great tutorial! I just love the c64! As a kid there was a lot I never understood fully when it comes to assembly, but it makes more sense now , almost 40 years later 😀

Ответить
@vriska222
@vriska222 - 30.07.2022 11:39

any chance we'll get more of these? theyre amazing tutorials and its been fun to follow along

Ответить
@normanwehrle8519
@normanwehrle8519 - 28.06.2022 18:13

I really enjoyed your little 101-asm-bootcamp. I worked through 3 others (that are much longer) before and yours is by far the best. You are a natural talent to teach stuff! Please continue the series.

Ответить
@dartheugenio
@dartheugenio - 18.06.2022 16:05

this a fantastic tutorial, I hope you will go on with this series as it is one of the best I could ever find!

Ответить
@AxelWerner
@AxelWerner - 16.05.2022 11:54

what are those addresses $0314 and $0315 ? Who defined these addresses to have anything to do with "raster lines" ?! It aint any VIC2 nor CIA/VIA (hardware) registers. So whats happening there and why (or of whom).

Ответить
@ideegeniali
@ideegeniali - 10.05.2022 16:48

You are TALENTED for these programming tutorials. Thanks for providing these precious info!

Ответить
@ideegeniali
@ideegeniali - 10.05.2022 16:44

That raster interrupt setting macro is a killer gem! Thank you for sharing.

Ответить
@elnebuloso9391
@elnebuloso9391 - 30.12.2021 01:48

Very good step by step explanation how to use sid files from assembly. Thx 😃

Ответить
@JustWasted3HoursHere
@JustWasted3HoursHere - 23.11.2021 07:36

It's worth mentioning that there are several different types of interrupts supported on the C64 in addition to raster ones. The system timer, keyboard and user port can also generate interrupts that your program can respond to, though for game programmers raster interrupts will be the main one you'd use. I believe the 1541 can also cause interrupts, but that may be limited to its own internal memory and processes. Not 100% sure on that though.

On the SID playing, I wonder how much trouble it would be to write a small program that uses those SID properties to analyze the SID file and change all of the absolute jumps to a new address of your choosing (but still maintaining the relative jump distances from the original) in case the default location is incompatible with your code. For example, maybe your main code is larger than expected and the default loading location is inside your code space, or you just need to move it for some other reason. [edit: Whoops! I guess I should have watched the whole video before commenting! LOL]

[Also, if possible, always try to get the permission of the SID author before using it in your own program. They will almost always say yes as long as you give them the proper credit in the game credits.]

Ответить
@1stacbats
@1stacbats - 01.11.2021 02:11

Great explanation. Thanks

Ответить
@BadAssBradders
@BadAssBradders - 26.10.2021 01:44

Great video, so good. I have tried to add this example to my code but it isn't allowing me to enter the loop that looks for a keypress. I entered the loop where it says to do this, and the code has largely been untouched from your example. Not sure what I am doing wrong. HELP!

Ответить
@opium32
@opium32 - 14.10.2021 13:26

Very cool thanks! I haven't looked at the code for SID music...but is it pretty much accepted that there's a standard optimised way of paying music and all SID files use same method? Or does it vary from file to file?

Ответить
@diegoprat3709
@diegoprat3709 - 27.09.2021 14:29

Really nice explained thank you!!. What about to fade down the volumen of the sid? it's that possible?

Ответить
@umberto21
@umberto21 - 09.08.2021 11:40

excellent work

Ответить
@Marius-vw9hp
@Marius-vw9hp - 30.06.2021 14:03

Could you please make a video on the movement of the sprites at the start of Episode 3? I am trying to make a loop to move my sprites in a cool way, but get stuck when trying to figure out the loop structure.
Would love to see the code you wrote for that movement if you could share it also.

Ответить
@BeatMax2023
@BeatMax2023 - 25.05.2021 19:07

Nice!

Ответить
@briankumanchik2474
@briankumanchik2474 - 30.04.2021 18:34

Now we just need to see how to bring a sprite over from the petscii web app (by itself) and move it around with a joystick ;) I love your tutorials!

Ответить
@EngineeringVignettes
@EngineeringVignettes - 23.04.2021 03:25

Lots of good useful info. Good job!
Thanks for the links in the description, not everyone does that...
Cheers,

Ответить
@boredwithusernames
@boredwithusernames - 22.04.2021 20:39

Thank you, I have been looking forward to another episode on programming the C64. This is the clearest explanation I have seen on programming raster interrupts and with the examples you provided it is really easy to understand. I also like the explanation of the term "endian" I had no idea it was from a famous book publication. Excellent stuff, I am looking forward to the next episode when you have time to make it. Thanks again ;)

Ответить
@baardbi
@baardbi - 22.04.2021 13:58

Thank you so much for this video. This is the best explanation I have ever seen about raster interrupts. Finally I understand how it works.

Ответить