Makefile: autobuild media/ac97snd

git-svn-id: svn://kolibrios.org@1843 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2011-02-04 17:55:54 +00:00
parent bd11eaf356
commit 2dd3bf5ddb
8 changed files with 121 additions and 58 deletions

View File

@ -435,8 +435,42 @@ shell: .obj.shell/start.o .obj.shell/shell.o .obj.shell/kolibri.o .obj.shell/std
.obj.shell:
mkdir -p .obj.shell
# Rules for sdk/sound, used by media/ac97snd
SOUNDDIR=$(PROGS)/develop/sdk/trunk/sound/src
SOUND_OBJECTS:=$(patsubst $(SOUNDDIR)/%.asm,.sdk/%.obj,$(wildcard $(SOUNDDIR)/*.asm))
SOUND_INC_FILES:=$(wildcard $(SOUNDDIR)/*.inc)
.sdk/sound.lib: $(SOUND_OBJECTS)
win32-link /lib /out:$@ $^
$(SOUND_OBJECTS): .sdk/%.obj: $(SOUNDDIR)/%.asm $(SOUND_INC_FILES) | .sdk
fasm $< $@
.sdk:
mkdir -p .sdk
# Rules for media/ac97snd
# Not compilable from svn sources, using preloaded binary
AC97DIR=$(PROGS)/media/ac97snd
media/ac97snd: .obj.ac97snd/ac97snd.exe
$(msvc_final)
.obj.ac97snd/ac97snd.exe: .obj.ac97snd/ac97wav.obj .obj.ac97snd/crt.obj .obj.ac97snd/k_lib.obj \
.obj.ac97snd/mpg.lib .sdk/sound.lib $(AC97DIR)/ufmod.obj
$(msvc_link)
.obj.ac97snd/ac97wav.obj: $(AC97DIR)/ac97snd/ac97wav.c \
$(AC97DIR)/kolibri.h $(AC97DIR)/ac97snd/ac97wav.h $(AC97DIR)/mpg/mpg123.h \
$(AC97DIR)/sound.h $(AC97DIR)/ufmod-codec.h Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/crt.obj: $(AC97DIR)/ac97snd/crt.c $(AC97DIR)/ac97snd/crt.h Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/k_lib.obj: $(AC97DIR)/ac97snd/k_lib.asm $(AC97DIR)/ac97snd/proc32.inc | .obj.ac97snd
fasm $< $@
AC97SND_MPG_C_FILES:=$(wildcard $(AC97DIR)/mpg/*.c)
AC97SND_MPG_H_FILES:=$(wildcard $(AC97DIR)/mpg/*.h)
AC97SND_MPG_C_OBJECTS:=$(patsubst $(AC97DIR)/mpg/%.c,.obj.ac97snd/%.o,$(AC97SND_MPG_C_FILES))
.obj.ac97snd/mpg.lib: $(AC97SND_MPG_C_OBJECTS) .obj.ac97snd/pow.obj
win32-link /lib /ltcg /out:$@ $^
$(AC97SND_MPG_C_OBJECTS): .obj.ac97snd/%.o: $(AC97DIR)/mpg/%.c $(AC97SND_MPG_H_FILES) Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/pow.obj: $(AC97DIR)/mpg/pow.asm $(AC97DIR)/mpg/proc32.inc | .obj.ac97snd
fasm $< $@
.obj.ac97snd:
mkdir -p .obj.ac97snd
# Rules for atikms.dll
# Use Makefile from $(REPOSITORY)/drivers/ddk and $(REPOSITORY)/drivers/video/drm/radeon

Binary file not shown.

View File

@ -437,8 +437,42 @@ shell: .obj.shell/start.o .obj.shell/shell.o .obj.shell/kolibri.o .obj.shell/std
.obj.shell:
mkdir -p .obj.shell
# Rules for sdk/sound, used by media/ac97snd
SOUNDDIR=$(PROGS)/develop/sdk/trunk/sound/src
SOUND_OBJECTS:=$(patsubst $(SOUNDDIR)/%.asm,.sdk/%.obj,$(wildcard $(SOUNDDIR)/*.asm))
SOUND_INC_FILES:=$(wildcard $(SOUNDDIR)/*.inc)
.sdk/sound.lib: $(SOUND_OBJECTS)
win32-link /lib /out:$@ $^
$(SOUND_OBJECTS): .sdk/%.obj: $(SOUNDDIR)/%.asm $(SOUND_INC_FILES) | .sdk
fasm $< $@
.sdk:
mkdir -p .sdk
# Rules for media/ac97snd
# Not compilable from svn sources, using preloaded binary
AC97DIR=$(PROGS)/media/ac97snd
media/ac97snd: .obj.ac97snd/ac97snd.exe
$(msvc_final)
.obj.ac97snd/ac97snd.exe: .obj.ac97snd/ac97wav.obj .obj.ac97snd/crt.obj .obj.ac97snd/k_lib.obj \
.obj.ac97snd/mpg.lib .sdk/sound.lib $(AC97DIR)/ufmod.obj
$(msvc_link)
.obj.ac97snd/ac97wav.obj: $(AC97DIR)/ac97snd/ac97wav.c \
$(AC97DIR)/kolibri.h $(AC97DIR)/ac97snd/ac97wav.h $(AC97DIR)/mpg/mpg123.h \
$(AC97DIR)/sound.h $(AC97DIR)/ufmod-codec.h Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/crt.obj: $(AC97DIR)/ac97snd/crt.c $(AC97DIR)/ac97snd/crt.h Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/k_lib.obj: $(AC97DIR)/ac97snd/k_lib.asm $(AC97DIR)/ac97snd/proc32.inc | .obj.ac97snd
fasm $< $@
AC97SND_MPG_C_FILES:=$(wildcard $(AC97DIR)/mpg/*.c)
AC97SND_MPG_H_FILES:=$(wildcard $(AC97DIR)/mpg/*.h)
AC97SND_MPG_C_OBJECTS:=$(patsubst $(AC97DIR)/mpg/%.c,.obj.ac97snd/%.o,$(AC97SND_MPG_C_FILES))
.obj.ac97snd/mpg.lib: $(AC97SND_MPG_C_OBJECTS) .obj.ac97snd/pow.obj
win32-link /lib /ltcg /out:$@ $^
$(AC97SND_MPG_C_OBJECTS): .obj.ac97snd/%.o: $(AC97DIR)/mpg/%.c $(AC97SND_MPG_H_FILES) Makefile.msvc | .obj.ac97snd
$(msvc_compile)
.obj.ac97snd/pow.obj: $(AC97DIR)/mpg/pow.asm $(AC97DIR)/mpg/proc32.inc | .obj.ac97snd
fasm $< $@
.obj.ac97snd:
mkdir -p .obj.ac97snd
# Rules for atikms.dll
# Use Makefile from $(REPOSITORY)/drivers/ddk and $(REPOSITORY)/drivers/video/drm/radeon

Binary file not shown.

View File

@ -1,44 +0,0 @@
format MS COFF
include "snd.inc"
include "proc32.inc"
section '.text' align 16 code readable executable
public _SetPan@8
;public _GetPan@4
extrn hSound
align 4
proc _SetPan@8 stdcall, str:dword, pan:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
mov [handle], eax
mov [io_code], SND_SETPAN
mov [input], ebx
mov [inp_size], 8
mov [output], ecx
mov [out_size], ecx
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp

View File

@ -1182,7 +1182,7 @@ void uint2str(unsigned int value, char *string)
///*********
void *memmove ( void * dst, void * src, unsigned int count) /* uFMOD integration */
void *__cdecl memmove ( void * dst, const void * src, unsigned int count) /* uFMOD integration */
{ void *ret;
ret = dst;

View File

@ -2,20 +2,49 @@
#define atexitBufferSize 32
#ifdef AUTOBUILD
char kosExePath[1024];
char exeStack[16384];
char params[1024];
// must be alphabetically first in the image
#pragma data_seg(".1seg")
struct
{
char header[8];
int headerver;
void* entry;
void* i_end;
void* memsize;
void* stack;
void* params;
void* icon;
} __MENUET_APP_header = {
{'M', 'E', 'N', 'U', 'E', 'T', '0', '1'},
1,
&crtStartUp,
0, // filled by doexe2.asm
0, // filled by doexe2.asm
exeStack + sizeof(exeStack),
params,
kosExePath
};
#pragma data_seg()
#endif
char pureCallMessage[] = "PURE function call!";
char *__argv[2];
int __argc;
//char *__argv[2];
//int __argc;
void (__cdecl *atExitList[atexitBufferSize])();
int atExitFnNum = 0;
int main(int argc, char *argv[]);
void exit()
{ int i;
{ /*int i;
for ( i = atExitFnNum - 1; i >= 0; i-- )
atExitList[i]();
atExitList[i]();*/
__asm
{
@ -24,7 +53,7 @@ void exit()
};
};
int __cdecl atexit( void (__cdecl *func )( void ))
/*int __cdecl atexit( void (__cdecl *func )( void ))
{
//
if ( atExitFnNum < atexitBufferSize )
@ -37,7 +66,7 @@ int __cdecl atexit( void (__cdecl *func )( void ))
{
return 1;
}
}
}*/
int __cdecl _purecall()
{
@ -48,26 +77,36 @@ int __cdecl _purecall()
#pragma section(".CRT$XCA",long,read,write)
#pragma section(".CRT$XCZ",long,read,write)
typedef void (__cdecl *_PVFV)(void);
__declspec(allocate(".CRT$XCA")) _PVFV __xc_a[1] = { 0 };
__declspec(allocate(".CRT$XCZ")) _PVFV __xc_z[1] = { 0 };
//__declspec(allocate(".CRT$XCA")) _PVFV __xc_a[1] = { 0 };
//__declspec(allocate(".CRT$XCZ")) _PVFV __xc_z[1] = { 0 };
//
#pragma comment(linker, "/merge:.CRT=.rdata")
//
void crtStartUp()
{_PVFV *pbegin;
char* __argv[2];
#ifdef AUTOBUILD
__MENUET_APP_header.header;
#endif
_asm {fninit};
for ( pbegin = __xc_a; pbegin < __xc_z; pbegin++ )
/*for ( pbegin = __xc_a; pbegin < __xc_z; pbegin++ )
{
//
if ( *pbegin != 0 )
(**pbegin)();
}
__argc = 2;
__argc = 2;*/
#ifdef AUTOBUILD
__argv[0] = kosExePath;
__argv[1] = params;
#else
__argv[0] = *((char **)0x20);
__argv[1] = *((char **)0x1C);
main(__argc, __argv);
#endif
main(/*__argc*/2, __argv);
exit();
}

Binary file not shown.