Add SDL newlib to autbuild

git-svn-id: svn://kolibrios.org@8495 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2020-12-29 14:32:46 +00:00
parent d6dcd6eccb
commit 3ae83680d2
3 changed files with 67 additions and 11 deletions

View File

@ -0,0 +1,33 @@
if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_NASM") ~= "" then return end
tup.include("../../../../../programs/use_gcc.lua")
tup.include("../../../../../programs/use_newlib.lua")
tup.include("../../../../../programs/use_sound.lua")
INCLUDES = INCLUDES .. " -I. -I../include -Ihermes -Iaudio -Ivideo -Ievents -Ijoystick -Icdrom -Ithread -Itimer -Iendian -Ifile -ISYSCALL/include"
CFLAGS = CFLAGS .. ' -D_REENTRANT -DPACKAGE=\"SDL\" -DVERSION=\"1.2.2\"'
CFLAGS = CFLAGS .. ' -DENABLE_AUDIO -UDISABLE_AUDIO -DDISABLE_JOYSTICK'
CFLAGS = CFLAGS .. ' -DDISABLE_CDROM -DDISABLE_THREADS -DENABLE_TIMERS'
CFLAGS = CFLAGS .. ' -DUSE_ASMBLIT -DENABLE_KOLIBRIOS -DNO_SIGNAL_H -DDISABLE_STDIO -DNEED_SDL_GETENV'
CFLAGS = CFLAGS .. ' -DENABLE_FILE -UDISABLE_FILE -D__KOLIBRIOS__ -DDEBUG_VIDEO -UWIN32'
FOLDERS = {
"",
"audio/",
"endian/",
"events/",
"file/",
"hermes/",
"joystick/",
"thread/",
"timer/",
"timer/dummy/",
"video/",
"video/menuetos/",
"SYSCALL/src/"
}
for i,v in ipairs(FOLDERS) do
compile_gcc(v .. "*.c", v .. "%B.o")
tup.append_table(OBJS,
tup.foreach_rule(v .. "*.asm", "nasm -f coff -o %o %f", v .. "%B.o")
)
end
tup.rule(OBJS, "kos32-ar rcs %o %f", {"../../../lib/libSDLn.a", "../../../lib/<libSDLn>"})

View File

@ -31,10 +31,20 @@ inline int get_skinh(void)
static int IsStyle4Available=0;
#endif
void kol_define_window(unsigned short x1,unsigned short y1,unsigned short xsize,unsigned short ysize,
unsigned long body_color,unsigned long grab_color,unsigned long frame_color)
{
unsigned long a,b;
a=(x1<<16)|xsize;
b=(y1<<16)|ysize;
__asm__ __volatile__("int $0x40"::"a"(0),"b"(a),"c"(b),"d"(body_color),"S"(grab_color),
"D"(frame_color));
}
void MenuetOS_SDL_RepaintWnd(void)
{
__menuet__window_redraw(1);
__menuet__define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4,
begin_draw();
kol_define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4,
#ifdef KEEP_OBSOLETE_STYLE3
IsStyle4Available?0x34000000:0x33000000
#else
@ -45,10 +55,9 @@ void MenuetOS_SDL_RepaintWnd(void)
// __asm__ __volatile__("int3");
if(vm_suf && vm_suf->hidden->__video_buffer)
__menuet__putimage(0,0,
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y,
vm_suf->hidden->__video_buffer);
__menuet__window_redraw(2);
draw_bitmap(vm_suf->hidden->__video_buffer, 0,0,
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y);
end_draw();
}
static int MenuetOS_AllocHWSurface(_THIS,SDL_Surface * surface)
@ -73,9 +82,8 @@ static void MenuetOS_DirectUpdate(_THIS,int numrects,SDL_Rect * rects)
{
if(numrects)
{
__menuet__putimage(0,0,
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y,
this->hidden->__video_buffer);
draw_bitmap(this->hidden->__video_buffer, 0,0,
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y);
}
}
@ -219,8 +227,7 @@ static int MenuetOS_VideoInit(_THIS,SDL_PixelFormat * vformat)
static int MenuetOS_FlipHWSurface(_THIS,SDL_Surface * surface)
{
__menuet__putimage(0,0,surface->w,surface->h,
surface->pixels);
draw_bitmap(surface->pixels, 0,0,surface->w,surface->h);
return 0;
}

16
programs/demos/SDL/Tupfile.lua Executable file
View File

@ -0,0 +1,16 @@
if tup.getconfig("NO_GCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
tup.include(HELPERDIR .. "/use_newlib.lua")
tup.include(HELPERDIR .. "/use_sound.lua")
CFLAGS = CFLAGS .. " -std=c99"
INCLUDES = INCLUDES .. " -I../../../contrib/sdk/sources/SDL-1.2.2_newlib/include"
table.insert(LIBDEPS, "../../../contrib/sdk/lib/<libSDLn>")
LIBS = "-lSDLn " .. LIBS
-- Subsystem native
LDFLAGS = LDFLAGS .. " --subsystem native"
compile_gcc{"SDLTest.c"}
link_gcc("SDLTest")