From 6e3e3f64fedefec5df9110a5b4504d03e17af4b5 Mon Sep 17 00:00:00 2001 From: stevenhowes <38082088+stevenhowes@users.noreply.github.com> Date: Fri, 19 Mar 2021 23:52:19 +0000 Subject: [PATCH] Audio setup, very hacky hud/font handling --- !RunImage,ff8 | Bin 5896 -> 6608 bytes Makefile,fe1 | 16 +++++------ c/CTheEscape | 77 +++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 9 deletions(-) diff --git a/!RunImage,ff8 b/!RunImage,ff8 index 157d8c2888812c097f603b3d1233056df991a6f5..377dbea41e91cb12a4a2809b81c80a4fd5381216 100644 GIT binary patch delta 2103 zcmb7FeQZ-z6hH6vYb&kowlX$0=!VxOcMz(`9x73E!I|lznK49+ncv%@WMqD|k4M-#<01(X4c6c7-bSl*Bzi1`tifc;5Q)Et32WkjpXt zF(79V{TSmPLbMwBuLAi##%}_`5PcKl*CYB9`Q1Q1nL7c@d? zAbbeu`&{S01E|*_$@;QDxD{wG;@OQTy-$)gSW6bLec;Z_!K@0?XCdD6*So4iYC) zHI(7fua>c$Sc4J?IpP=4Y3BFOiv9G`v)f-E7852Q)CM(?DniikW)7Vf@-sthUdF42) zvaz#eCApmf6CsNv^MzX-fp9hju4=1u6q92^IISX}WWuJ8 z^eBn^Q-U4u#3BVlTQ~*Nk z^MA)&T=aoLesr-|Es*~|o0xt)W8xQ_zr8h1uMgWgc7mv~&g0(eLWDE9siE1u$Lncs z1-H$;x3Ol%r41fmv$LTlHY)b1A#2Gskp>H*(Z~}p3+&s!qY?fMm`brLee9-TxgQ_z z!ORVas9SjtE&qZ3`{;G$C;Sn}urH9Y7@4Q>JOZ=gbnK5tC+nS_2E3gT)QS7X3g!m> zHELc#ZYGwEZe!PRl^P$zlMgm+9Y5ItzmkPL(&EMEAx^-v4NsFgbv|($22_HpqgSWh z4xUf@>DUE0u8i6ENjj~(WyJSY?}*hxVWot66khK(=y|RQJ|A=r@B_$w8;cr@W=A78 zv6{*zFIBesn%(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c.Graphics o.Graphics: C:h.swis o.Graphics: C:h.kernel o.Graphics: C:h.kernel +o.Input: c.Input +o.Input: C:h.swis +o.Input: C:h.kernel +o.Input: C:h.kernel +o.Input: c.Input +o.Input: C:h.swis +o.Input: C:h.kernel +o.Input: C:h.kernel o.CTheEscape: c.CTheEscape o.CTheEscape: C:h.swis o.CTheEscape: C:h.kernel @@ -48,11 +56,3 @@ o.CTheEscape: C:h.swis o.CTheEscape: C:h.kernel o.CTheEscape: C:h.kernel o.CTheEscape: h.Sound -o.Input: c.Input -o.Input: C:h.swis -o.Input: C:h.kernel -o.Input: C:h.kernel -o.Input: c.Input -o.Input: C:h.swis -o.Input: C:h.kernel -o.Input: C:h.kernel diff --git a/c/CTheEscape b/c/CTheEscape index ea12bf3..c2c12de 100644 --- a/c/CTheEscape +++ b/c/CTheEscape @@ -26,6 +26,8 @@ extern int current_element; enum sprite_e{player_ship, durno_ship,player_shipl,player_shipr}; char *sprites[] = {"player_ship","durno_ship","player_shipl","player_shipr"}; +int font = 0; + struct EntityLocation_s { short int X,Y; }; @@ -205,9 +207,65 @@ void game_input_tick() } } +void game_setup_audio() +{ + sound_voices(4); + + sound_set_voice(1,"WaveSynth-Beep"); + sound_set_voice(2,"Percussion-Noise"); + sound_set_voice(3,"Percussion-Soft"); + sound_set_voice(4,"Percussion-Noise"); +} + +void game_draw_hud() +{ + draw_sprite("lcars",4,DISPLAY_Y-180); + +inreg.r[0] = font; +inreg.r[1] = (int)"Shields"; +inreg.r[2] = 1 << 4; +inreg.r[3] = 75; +inreg.r[4] = DISPLAY_Y-60; +inreg.r[5] = 0; +inreg.r[6] = 0; +inreg.r[7] = 0; +_kernel_swi(Font_Paint,&inreg,&outreg); + +inreg.r[0] = font; +inreg.r[1] = (int)"Integrity"; +inreg.r[2] = 1 << 4; +inreg.r[3] = 75; +inreg.r[4] = DISPLAY_Y-90; +inreg.r[5] = 0; +inreg.r[6] = 0; +inreg.r[7] = 0; +_kernel_swi(Font_Paint,&inreg,&outreg); + +inreg.r[0] = font; +inreg.r[1] = (int)"Velocity"; +inreg.r[2] = 1 << 4; +inreg.r[3] = 75; +inreg.r[4] = DISPLAY_Y-120; +inreg.r[5] = 0; +inreg.r[6] = 0; +inreg.r[7] = 0; +_kernel_swi(Font_Paint,&inreg,&outreg); + +inreg.r[0] = font; +inreg.r[1] = (int)"Distance"; +inreg.r[2] = 1 << 4; +inreg.r[3] = 75; +inreg.r[4] = DISPLAY_Y-150; +inreg.r[5] = 0; +inreg.r[6] = 0; +inreg.r[7] = 0; +_kernel_swi(Font_Paint,&inreg,&outreg); +} + void game_setup() { game_setup_input(); + game_setup_audio(); game_setup_stars(); game_setup_player(); tick = clock(); @@ -226,6 +284,8 @@ void game_tick() game_draw_stars(); game_draw_player(); + + game_draw_hud(); } int main(int argc, char *argv[]) @@ -235,10 +295,25 @@ int main(int argc, char *argv[]) display_mode(DISPLAY_MODE); load_sprites("Spr"); - intro(); + //intro(); display_mode(DISPLAY_MODE); +inreg.r[0] = 0; +inreg.r[1] = (int)"System.Medium"; +inreg.r[2] = 12*16; +inreg.r[3] = 8*16; +inreg.r[4] = 0; +inreg.r[5] = 0; +_kernel_swi(Font_FindFont,&inreg,&outreg); + +font = outreg.r[0]; +inreg.r[0] = 0; +inreg.r[1] = 0xffaaa000; // TODO: Not purple +inreg.r[2] = 0x11111000; +inreg.r[3] = 14; +_kernel_swi(ColourTrans_SetFontColours, &inreg, &outreg); + game_setup(); while(1)