codestudy/tic80

tic80

dz / codestudy / tic80

Summary

Studying components of the codebase for TIC-80.

Node Tree

Nodes

sound_c
content sound.c: sound engine
children sound_public_funcs, static_asserts, notefreqs
file reference codestudy/tic80/sound.c:0

notefreqs
content NoteFreqs: a giant array of ints, presumably some kind of conversion table. Probably generated, as it's all on one line.
parents sound_c
file reference codestudy/tic80/sound.c:38

static_asserts
content static asserts? I've never seen these before. I'm assuming they are compile-time checks.
parents sound_c
file reference codestudy/tic80/sound.c:39-45

sound_public_funcs
content Public functions in sound.c
children tic_core_sound_tick_start, tic_api_music, tic_api_sfx, tic_core_synth_sound, tic_core_sound_tick_end
parents sound_c

tic_api_music
content tic_api_music()
parents sound_public_funcs
file reference codestudy/tic80/sound.c:498-506

tic_api_sfx
content tic_api_sfx
parents sound_public_funcs
file reference codestudy/tic80/sound.c:508-512

tic_core_synth_sound
content tic_core_synth_sound()
children blip_read_samples
parents tic80_sound, sound_public_funcs
file reference codestudy/tic80/sound.c:542-561

tic_core_sound_tick_start
content tic_core_sound_tick_start()
parents tick_funcs, sound_public_funcs
file reference codestudy/tic80/sound.c:563-581

tic_core_sound_tick_end
content tic_core_sound_tick_end()
parents tick_funcs, sound_public_funcs
file reference codestudy/tic80/sound.c:583-598

blip_read_samples
content calls to blip_read_samples()
children blip_set_rates (I believe this is how the rates are being set)
parents tic_core_synth_sound
remarks These are calls from a third-party library called blip-buf Looking at the README for it, this seems to handle audio re-sampling.
file reference codestudy/tic80/sound.c:551-552

blip_set_rates
content blip_set_rates: used to set "clock" and regular samplerates
parents blip_read_samples
remarks it's set somewhere outside of this file

tick_funcs
content A tick is a unit of time where things happen. It includes sound events and input events, among other things.
children tic_core_sound_tick_start, tic_core_sound_tick_end

tic_c
content tic.c
children tic80_sound
file reference codestudy/tic80/tic.c:0

tic80_sound
content tic80_sound()
children studio_sound (tic80_sound is also used in sokol API calls.), tic_core_synth_sound
parents tic_c
remarks this seems to be a top-level sound function.
file reference codestudy/tic80/tic.c:127-131

studio_c
content studio.c
children studio_sound
file reference codestudy/tic80/studio.c:0

studio_sound
content studio_sound()
parents tic80_sound, studio_c
remarks This seems to be called by sokol, so this might be the way sound is rendered in TIC80?
file reference codestudy/tic80/studio.c:2446-2459