mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-27 00:03:27 +01:00
Tidy up of tabbing, addition of key scanning (and ability to skip intro)
This commit is contained in:
Binary file not shown.
+12
-8
@@ -7,8 +7,8 @@ Linkflags = -aif -o $@
|
||||
|
||||
|
||||
# Final targets:
|
||||
@.!RunImage: @.o.CTheEscape @.o.Graphics @.o.Sound C:o.stubs
|
||||
Link $(Linkflags) @.o.CTheEscape @.o.Graphics @.o.Sound C:o.stubs
|
||||
@.!RunImage: @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input C:o.stubs
|
||||
Link $(Linkflags) @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input C:o.stubs
|
||||
|
||||
|
||||
# User-editable dependencies:
|
||||
@@ -21,7 +21,8 @@ Linkflags = -aif -o $@
|
||||
cc $(ccflags) -o @.o.Graphics @.c.Graphics
|
||||
@.o.Sound: @.c.Sound
|
||||
cc $(ccflags) -o @.o.Sound @.c.Sound
|
||||
|
||||
@.o.Input: @.c.Input
|
||||
cc $(ccflags) -o @.o.Input @.c.Input
|
||||
|
||||
# Dynamic dependencies:
|
||||
o.Graphics: c.Graphics
|
||||
@@ -38,8 +39,11 @@ o.CTheEscape: C:h.swis
|
||||
o.CTheEscape: C:h.kernel
|
||||
o.CTheEscape: C:h.kernel
|
||||
o.CTheEscape: h.Sound
|
||||
o.CTheEscape: c.CTheEscape
|
||||
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
|
||||
|
||||
+5
-1
@@ -78,11 +78,15 @@ void intro()
|
||||
currentstart += 100;
|
||||
|
||||
draw_sprite("tng",320,400);
|
||||
printf("%i elements at %i bytes\n",current_element,sizeof(composition[0]));
|
||||
sound_composition_start(clock());
|
||||
|
||||
while(sound_composition_incomplete())
|
||||
{
|
||||
sound_composition_tick(clock());
|
||||
|
||||
if(input_readkey(98))
|
||||
sound_composition_stop();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include "swis.h"
|
||||
#include <kernel.h>
|
||||
|
||||
// SWI Registers
|
||||
extern _kernel_swi_regs inreg;
|
||||
extern _kernel_swi_regs outreg;
|
||||
|
||||
int input_readkey(int key)
|
||||
{
|
||||
inreg.r[0] = 129;
|
||||
inreg.r[1] = key ^ 255;
|
||||
inreg.r[2] = 255;
|
||||
_kernel_swi(OS_Byte,&inreg,&outreg);
|
||||
|
||||
if(outreg.r[1] == 255)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -86,6 +86,8 @@ void sound_composition_debug()
|
||||
}
|
||||
}
|
||||
|
||||
printf("%i elements at %i bytes each\n",current_element,sizeof(composition[0]));
|
||||
|
||||
printf("------------------------------\n");
|
||||
}
|
||||
|
||||
@@ -94,6 +96,11 @@ void sound_composition_start(int cent)
|
||||
composition_startcent = cent;
|
||||
}
|
||||
|
||||
void sound_composition_stop()
|
||||
{
|
||||
current_playback_element = COMPOSITION_MAX;
|
||||
}
|
||||
|
||||
void sound_composition_tick(int cents)
|
||||
{
|
||||
int offset_cents = cents - composition_startcent;
|
||||
|
||||
Reference in New Issue
Block a user