gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit a137f9407d891f05b284701cf0e19d49444111bc parent d800011859af9b5dc47395bf4590aec2b3809a7d Author: bbbbbr <bbbbbr@users.noreply.github.com> Date: Thu, 28 Jul 2022 10:57:12 -0700 Merge pull request #395 from bbbbbr/examples_sound GB Examples: sgb sfx: Add sfx names Diffstat:
| M | gbdk-lib/examples/gb/sgb_sfx/Makefile | 2 | +- |
| M | gbdk-lib/examples/gb/sgb_sfx/main.c | 12 | +++++++++--- |
| A | gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.c | 85 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.h | 3 | +++ |
4 files changed, 98 insertions(+), 4 deletions(-)
diff --git a/gbdk-lib/examples/gb/sgb_sfx/Makefile b/gbdk-lib/examples/gb/sgb_sfx/Makefile @@ -1,7 +1,7 @@ CC = ../../../bin/lcc all: - $(CC) -Wm-ys -o sgb_sfx.gb main.c + $(CC) -Wm-ys -o sgb_sfx.gb main.c sgb_sfx_names.c compile.bat: Makefile @echo "REM Automatically generated from Makefile" > compile.bat diff --git a/gbdk-lib/examples/gb/sgb_sfx/main.c b/gbdk-lib/examples/gb/sgb_sfx/main.c @@ -7,6 +7,7 @@ #include <gbdk/console.h> #include "sgb_snd_sfx.h" +#include "sgb_sfx_names.h" // Stores button presses @@ -41,7 +42,7 @@ void sgb_sound_effect(uint8_t sfx_a, uint8_t sfx_b) { } -#define DISP_SFX_A_START 4 +#define DISP_SFX_A_START 3 #define DISP_SFX_B_START 10 // Display basic operation info on the screen @@ -66,11 +67,16 @@ void init_display() { // Update the display if either of the sfx types have changed void update_display(void) { - gotoxy(7, DISP_SFX_A_START); + gotoxy(7u, DISP_SFX_A_START); printf("0x%hx", (uint8_t)sfx_num_a); + gotoxy(1u, DISP_SFX_A_START + 4u); + printf("%s", (const char *)sgb_sfx_names_table_a[sfx_num_a]); - gotoxy(7, DISP_SFX_B_START); + + gotoxy(7u, DISP_SFX_B_START); printf("0x%hx", (uint8_t)sfx_num_b); + gotoxy(1u, DISP_SFX_B_START + 4u); + printf("%s", (const char *)sgb_sfx_names_table_b[sfx_num_b]); } diff --git a/gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.c b/gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.c @@ -0,0 +1,85 @@ + + +// From Pandocs +// Padded to a uniform maximum length so they +// overwrite each other cleanly when printing + +const char * sgb_sfx_names_table_a[] = { + "Dummy flag, re-trigger ", + "Nintendo ", + "Game Over ", + "Drop ", + "OK A ", + "OK B ", + "Select A ", + "Select B ", + "Select C ", + "Mistake Buzzer ", + "Catch Item ", + "Gate squeaks 1 time ", + "Explosion small ", + "Explosion medium ", + "Explosion large ", + "Attacked A ", + "Attacked B ", + "Hit (punch) A ", + "Hit (punch) B ", + "Breath in air ", + "Rocket Projectile A ", + "Rocket Projectile B ", + "Escaping Bubble ", + "Jump ", + "Fast Jump ", + "Jet (rocket) takeoff ", + "Jet (rocket) landing ", + "Cup breaking ", + "Glass breaking ", + "Level UP ", + "Insert air ", + "Sword swing ", + "Water falling ", + "Fire ", + "Wall collapsing ", + "Cancel ", + "Walking ", + "Blocking strike ", + "Picture floats on & off ", + "Fade in ", + "Fade out ", + "Window being opened ", + "Window being closed ", + "Big Laser ", + "Stone gate closes/opens ", + "Teleportation ", + "Lightning ", + "Earthquake ", + "Small Laser "}; + +const char * sgb_sfx_names_table_b[] = { + "Dummy flag, re-trigger ", + "Applause small group ", + "Applause medium group ", + "Applause large group ", + "Wind ", + "Rain ", + "Storm ", + "Storm with wind/thunder ", + "Lightning ", + "Earthquake ", + "Avalanche ", + "Wave ", + "River ", + "Waterfall ", + "Small character running ", + "Horse running ", + "Warning sound ", + "Approaching car ", + "Jet flying ", + "UFO flying ", + "Electromagnetic waves ", + "Score UP ", + "Fire ", + "Camera shutter, formanto", + "Write, formanto ", + "Show up title, formanto "}; + diff --git a/gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.h b/gbdk-lib/examples/gb/sgb_sfx/sgb_sfx_names.h @@ -0,0 +1,3 @@ + +extern const char * sgb_sfx_names_table_a[]; +extern const char * sgb_sfx_names_table_b[];
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.