/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/include/menuet/os.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/Makefile |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile |
---|
51,16 → 51,15 |
mv -f $(LIBNAME) $(SDK_DIR)/lib |
$(LIBNAME).a: $(OBJS) |
$(MAKE) -C SYSCALL/src |
$(AR) -crs $(LIBNAME).a $(OBJS) SYSCALL/src/os.o |
$(AR) -crs $(LIBNAME).a $(OBJS) |
$(LIBNAME).dll: libSDL.def $(OBJS) |
$(LD) $(LDFLAGS) -o $@ libSDL.def $(OBJS) SYSCALL/src/os.o $(LIBS) -ldll -lsound -lc.dll |
$(LD) $(LDFLAGS) -o $@ libSDL.def $(OBJS) $(LIBS) -ldll -lsound -lc.dll |
$(STRIP) $@ |
%.o : %.asm Makefile |
nasm -f coff $< |
nasm -Ihermes -f coff $< |
%.o : %.c Makefile |
$(CC) $(CFLAGS) -o $@ $< |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile.tcc |
---|
0,0 → 1,54 |
KTCC_DIR=../../../../../programs/develop/ktcc/trunk |
CC = $(KTCC_DIR)/bin/kos32-tcc |
AR = kos32-ar |
LIBNAME=libSDL |
endian_OBJS = endian/SDL_endian.o |
file_OBJS = file/SDL_rwops.o |
hermes_OBJS = hermes/mmxp2_32.o hermes/mmx_main.o hermes/x86p_16.o \ |
hermes/x86p_32.o hermes/x86_main.o |
thread_OBJS = thread/SDL_syscond.o thread/SDL_sysmutex.o thread/SDL_syssem.o \ |
thread/SDL_systhread.o thread/SDL_thread.o |
timer_OBJS = timer/SDL_timer.o timer/dummy/SDL_systimer.o |
event_OBJS = events/SDL_active.o events/SDL_events.o events/SDL_expose.o \ |
events/SDL_keyboard.o events/SDL_mouse.o events/SDL_quit.o \ |
events/SDL_resize.o |
video_OBJS = video/SDL_blit_0.o video/SDL_blit_1.o video/SDL_blit_A.o \ |
video/SDL_blit.o video/SDL_blit_N.o video/SDL_bmp.o \ |
video/SDL_cursor.o video/SDL_gamma.o video/SDL_pixels.o \ |
video/SDL_RLEaccel.o video/SDL_stretch.o video/SDL_surface.o \ |
video/SDL_video.o video/SDL_yuv.o video/SDL_yuv_mmx.o \ |
video/SDL_yuv_sw.o video/menuetos/SDL_menuetevents.o \ |
video/menuetos/SDL_menuetvideo.o |
audio_OBJS = audio/SDL_kolibri_audio.o |
curr_OBJS = SDL.o SDL_error.o SDL_fatal.o SDL_getenv.o |
OBJS = $(endian_OBJS) $(file_OBJS) $(hermes_OBJS) $(thread_OBJS) \ |
$(timer_OBJS) $(event_OBJS) $(video_OBJS) $(curr_OBJS) $(audio_OBJS) |
CFLAGS = -c -O2 -D_REENTRANT -I../include -I syscall/include -I. -DPACKAGE=\"SDL\" -DVERSION=\"1.2.2\" \ |
-fexpensive-optimizations -Wall -DENABLE_AUDIO -UDISABLE_AUDIO -DDISABLE_JOYSTICK \ |
-DDISABLE_CDROM -DDISABLE_THREADS -DENABLE_TIMERS \ |
-DUSE_ASMBLIT -Ihermes -Iaudio -Ivideo -Ievents \ |
-Ijoystick -Icdrom -Ithread -Itimer -Iendian -Ifile -DENABLE_KOLIBRIOS \ |
-DNO_SIGNAL_H -DDISABLE_STDIO -DNEED_SDL_GETENV -DENABLE_FILE -UDISABLE_FILE \ |
-D__KOLIBRIOS__ -DDEBUG_VIDEO \ |
-I$(KTCC_DIR)/libc.obj/include -I../../sound/include |
all: $(LIBNAME).a |
$(LIBNAME).a: $(OBJS) |
$(AR) -crs $(LIBNAME).a $(OBJS) |
%.o : %.asm Makefile |
nasm -Ihermes -f elf32 $< |
%.o : %.c Makefile |
$(CC) $(CFLAGS) -o $@ $< |
clean: |
rm -f */*.o \ rm *.o \ rm */*/*.o |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SDL_kos.h |
---|
0,0 → 1,106 |
#ifndef SDL_kos |
#define SDL_kos |
#ifdef __cplusplus |
extern "C" { |
#endif |
typedef unsigned char __u8; |
typedef unsigned short __u16; |
typedef unsigned long __u32; |
struct process_table_entry |
{ |
__u32 cpu_usage; |
__u16 pos_in_windowing_stack; |
__u16 win_stack_val_at_ecx; |
__u16 reserved1; |
char name[12]; |
__u32 memstart; |
__u32 memused; |
__u32 pid; |
__u32 winx_start,winy_start; |
__u32 winx_size,winy_size; |
__u16 thread_state; |
__u16 reserved2; |
__u32 client_left,client_top,client_width,client_height; |
__u8 window_state; |
__u8 reserved3[1024-71]; |
}; |
static inline |
void __kos__define_window(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize, |
__u32 body_color,__u32 grab_color,__u32 frame_color) |
{ |
__u32 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)); |
} |
static inline void __kos__window_redraw(int status) |
{ |
__asm__ __volatile__("int $0x40"::"a"(12),"b"(status)); |
} |
static inline |
void __kos__draw_bitmap(void *bitmap, int x, int y, int w, int h) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(7), "b"(bitmap), |
"c"((w << 16) | h), |
"d"((x << 16) | y)); |
} |
static inline |
int __kos__getkey(void) |
{ |
__u16 __ret; |
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(2)); |
if(!(__ret & 0xFF)) return (__ret>>8)&0xFF; else return 0; |
} |
static inline |
int __kos__check_for_event(void) |
{ |
__u32 __ret; |
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(11)); |
return __ret; |
} |
static inline |
int __kos__set_events_mask(__u32 mask) |
{ |
register __u32 val; |
asm volatile ("int $0x40":"=a"(val):"a"(40), "b"(mask)); |
return val; |
} |
static inline |
void __kos__delay100(int time) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(5), "b"(time) |
:"memory"); |
}; |
static inline |
int __kos__get_button_id() |
{ |
__u32 val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(17) |
); |
return val>>8; |
} |
#ifdef __cplusplus |
} |
#endif |
#endif |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/Tupfile.lua |
---|
2,7 → 2,7 |
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" |
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' |
21,7 → 21,6 |
"timer/dummy/", |
"video/", |
"video/menuetos/", |
"SYSCALL/src/" |
} |
for i,v in ipairs(FOLDERS) do |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c |
---|
1,11 → 1,12 |
#include "SDL_audio.h" |
#include <kos32sys.h> |
#include <menuet/os.h> |
#include <SDL_kos.h> |
#include <stdlib.h> |
#include <string.h> |
#include <sound.h> |
#include <stdio.h> |
extern void SDL_printf(const char * fmt,...); |
static void GetNotify(__u32* event) |
{ |
__asm__("int $0x40" :: "a"(68),"b"(14),"c"(event)); |
143,7 → 144,7 |
} |
} |
if (bPaused) |
delay(5); |
__kos__delay100(5); |
else |
{ |
GetNotify(event); |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/hermes/mmx_main.asm |
---|
12,6 → 12,7 |
%include "common.inc" |
SDL_FUNC _ConvertMMX |
SDL_FUNC ConvertMMX |
SECTION .text |
30,6 → 31,7 |
;; 32: void (*converter_function)() |
;; 36: int32 *lookup |
ConvertMMX |
_ConvertMMX: |
push ebp |
mov ebp,esp |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/hermes/mmxp2_32.asm |
---|
28,6 → 28,13 |
SDL_FUNC _ConvertMMXpII32_16RGB555 |
SDL_FUNC _ConvertMMXpII32_16BGR555 |
SDL_FUNC ConvertMMXpII32_24RGB888 |
SDL_FUNC ConvertMMXpII32_16RGB565 |
SDL_FUNC ConvertMMXpII32_16BGR565 |
SDL_FUNC ConvertMMXpII32_16RGB555 |
SDL_FUNC ConvertMMXpII32_16BGR555 |
;; Macros for conversion routines |
%macro _push_immq_mask 1 |
60,6 → 67,7 |
SECTION .text |
ConvertMMXpII32_24RGB888: |
_ConvertMMXpII32_24RGB888: |
; set up mm6 as the mask, mm7 as zero |
122,7 → 130,7 |
retn |
ConvertMMXpII32_16RGB565: |
_ConvertMMXpII32_16RGB565: |
; set up masks |
190,7 → 198,7 |
.L4: |
retn |
ConvertMMXpII32_16BGR565: |
_ConvertMMXpII32_16BGR565: |
load_immq mm5, mmx32_rgb565_r |
260,6 → 268,7 |
.L4: |
retn |
ConvertMMXpII32_16BGR555: |
_ConvertMMXpII32_16BGR555: |
; the 16BGR555 converter is identical to the RGB555 one, |
274,6 → 283,8 |
; would almost certainly be faster, even if only a little. |
; I did rename 'mmx32_rgb555_add' to 'mmx32_rgb555_mul', which is |
; (I think) a more accurate name.. |
ConvertMMXpII32_16RGB555: |
_ConvertMMXpII32_16RGB555: |
load_immq mm7, mmx32_rgb555_mul |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/hermes/x86_main.asm |
---|
16,6 → 16,9 |
SDL_FUNC _ConvertX86 |
SDL_FUNC _Hermes_X86_CPU |
SDL_FUNC ConvertX86 |
SDL_FUNC Hermes_X86_CPU |
SECTION .data |
cpu_flags dd 0 |
36,6 → 39,7 |
;; 32: void (*converter_function)() |
;; 36: int32 *lookup |
ConvertX86: |
_ConvertX86: |
push ebp |
mov ebp,esp |
72,7 → 76,7 |
endconvert: |
ret |
Hermes_X86_CPU: |
_Hermes_X86_CPU: |
pushfd |
pop eax |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/hermes/x86p_16.asm |
---|
19,10 → 19,18 |
SDL_FUNC _ConvertX86p16_16BGR555 |
SDL_FUNC _ConvertX86p16_8RGB332 |
SDL_FUNC ConvertX86p16_16BGR565 |
SDL_FUNC ConvertX86p16_16RGB555 |
SDL_FUNC ConvertX86p16_16BGR555 |
SDL_FUNC ConvertX86p16_8RGB332 |
EXTERN _ConvertX86 |
EXTERN ConvertX86 |
SECTION .text |
ConvertX86p16_16BGR565: |
_ConvertX86p16_16BGR565: |
; check short |
128,11 → 136,7 |
.L7: |
retn |
ConvertX86p16_16RGB555: |
_ConvertX86p16_16RGB555: |
; check short |
236,11 → 240,7 |
.L7: pop ebp |
retn |
ConvertX86p16_16BGR555: |
_ConvertX86p16_16BGR555: |
; check short |
358,7 → 358,7 |
ConvertX86p16_8RGB332: |
_ConvertX86p16_8RGB332: |
; check short |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/hermes/x86p_32.asm |
---|
24,6 → 24,18 |
SDL_FUNC _ConvertX86p32_16BGR555 |
SDL_FUNC _ConvertX86p32_8RGB332 |
SDL_FUNC ConvertX86p32_32BGR888 |
SDL_FUNC ConvertX86p32_32RGBA888 |
SDL_FUNC ConvertX86p32_32BGRA888 |
SDL_FUNC ConvertX86p32_24RGB888 |
SDL_FUNC ConvertX86p32_24BGR888 |
SDL_FUNC ConvertX86p32_16RGB565 |
SDL_FUNC ConvertX86p32_16BGR565 |
SDL_FUNC ConvertX86p32_16RGB555 |
SDL_FUNC ConvertX86p32_16BGR555 |
SDL_FUNC ConvertX86p32_8RGB332 |
SECTION .text |
;; _Convert_* |
35,6 → 47,7 |
;; EAX, EBX, EDX |
ConvertX86p32_32BGR888: |
_ConvertX86p32_32BGR888: |
; check short |
115,7 → 128,7 |
ConvertX86p32_32RGBA888: |
_ConvertX86p32_32RGBA888: |
; check short |
186,7 → 199,7 |
ConvertX86p32_32BGRA888: |
_ConvertX86p32_32BGRA888: |
; check short |
262,6 → 275,7 |
;; 32 bit RGB 888 to 24 BIT RGB 888 |
ConvertX86p32_24RGB888: |
_ConvertX86p32_24RGB888: |
; check short |
359,6 → 373,7 |
;; 32 bit RGB 888 to 24 bit BGR 888 |
ConvertX86p32_24BGR888: |
_ConvertX86p32_24BGR888: |
; check short |
458,7 → 473,7 |
;; 32 bit RGB 888 to 16 BIT RGB 565 |
ConvertX86p32_16RGB565: |
_ConvertX86p32_16RGB565: |
; check short |
cmp ecx,BYTE 16 |
574,6 → 589,7 |
;; 32 bit RGB 888 to 16 BIT BGR 565 |
ConvertX86p32_16BGR565: |
_ConvertX86p32_16BGR565: |
; check short |
687,7 → 703,7 |
;; 32 BIT RGB TO 16 BIT RGB 555 |
ConvertX86p32_16RGB555: |
_ConvertX86p32_16RGB555: |
; check short |
798,7 → 814,7 |
;; 32 BIT RGB TO 16 BIT BGR 555 |
ConvertX86p32_16BGR555: |
_ConvertX86p32_16BGR555: |
; check short |
916,9 → 932,10 |
;; FROM 32 BIT RGB to 8 BIT RGB (rrrgggbbb) |
;; This routine writes FOUR pixels at once (dword) and then, if they exist |
;; the trailing three pixels |
ConvertX86p32_8RGB332: |
_ConvertX86p32_8RGB332: |
.L_ALIGNED: |
push ecx |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c |
---|
26,16 → 26,14 |
#endif |
#include <stdio.h> |
#include <sys/time.h> |
#include <signal.h> |
#include <unistd.h> |
#include <time.h> |
#include <string.h> |
#include <errno.h> |
#include <kos32sys.h> |
#include "SDL_error.h" |
#include "SDL_timer.h" |
#include "SDL_timer_c.h" |
#include "SDL_kos.h" |
#if _POSIX_THREAD_SYSCALL_SOFT |
#include <pthread.h> |
89,7 → 87,7 |
void SDL_Delay (Uint32 ms) |
{ |
delay(ms); |
__kos__delay100(ms); |
/* Uint32 start = SDL_GetTicks(); |
do |
__asm__("int $0x40" :: "a"(68),"b"(1)); |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c |
---|
1,5 → 1,5 |
#include <menuet/os.h> |
#include <kos32sys.h> |
#include <SDL_kos.h> |
//#include <kos32sys.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include "SDL.h" |
164,7 → 164,7 |
static int ext_code=0; |
static __u8 old_mode=0; |
for (;;) { |
i=__menuet__check_for_event(); |
i=__kos__check_for_event(); |
switch(i) |
{ |
case 0: |
173,7 → 173,7 |
MenuetOS_SDL_RepaintWnd(); |
break; |
case 2: |
key.scancode = __menuet__getkey(); |
key.scancode = __kos__getkey(); |
if (key.scancode == 0xE0 || key.scancode == 0xE1) |
{ext_code=key.scancode;break;} |
if (ext_code == 0xE1 && (key.scancode & 0x7F) == 0x1D) break; |
200,7 → 200,7 |
SDL_PrivateKeyboard(code,&key); |
break; |
case 3: |
if(get_os_button()==1) exit(0); |
if(__kos__get_button_id()==1) exit(0); |
break; |
case 6: { |
int __tmp,mx,my; |
/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c |
---|
1,7 → 1,6 |
#include <stdlib.h> |
#include <stdio.h> |
#include <menuet/os.h> |
#include <kos32sys.h> |
#include <SDL_kos.h> |
#include "SDL.h" |
#include "SDL_error.h" |
#include "SDL_video.h" |
31,20 → 30,10 |
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) |
{ |
begin_draw(); |
kol_define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4, |
__kos__window_redraw(1); |
__kos__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 |
55,9 → 44,9 |
// __asm__ __volatile__("int3"); |
if(vm_suf && vm_suf->hidden->__video_buffer) |
draw_bitmap(vm_suf->hidden->__video_buffer, 0,0, |
__kos__draw_bitmap(vm_suf->hidden->__video_buffer, 0,0, |
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y); |
end_draw(); |
__kos__window_redraw(2); |
} |
static int MenuetOS_AllocHWSurface(_THIS,SDL_Surface * surface) |
82,7 → 71,7 |
{ |
if(numrects) |
{ |
draw_bitmap(this->hidden->__video_buffer, 0,0, |
__kos__draw_bitmap(this->hidden->__video_buffer, 0,0, |
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y); |
} |
} |
111,6 → 100,17 |
if(was_initialized) __asm__("int $0x40"::"a"(71),"b"(1),"c"(title)); |
} |
void debug_board_write_byte(const char ch){ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(63), "b"(1), "c"(ch)); |
} |
void debug_board_write_str(const char* str){ |
while(*str) |
debug_board_write_byte(*str++); |
} |
SDL_Surface * MenuetOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags) |
{ |
int ly; |
123,19 → 123,6 |
char info[100]; |
sprintf(info, "width = %d, height = %d, pitch = %d, bpp = %d\n", current->w, current->h, current->pitch, bpp); |
void debug_board_write_byte(const char ch){ |
__asm__ __volatile__( |
"int $0x40" |
: |
:"a"(63), "b"(1), "c"(ch)); |
} |
void debug_board_write_str(const char* str){ |
while(*str) |
debug_board_write_byte(*str++); |
} |
debug_board_write_str(info); |
// __asm__ __volatile__("int3"); |
159,7 → 146,7 |
} |
else |
{ |
set_wanted_events_mask(0x27); |
__kos__set_events_mask(0x27); |
was_initialized=1; |
MenuetOS_SDL_RepaintWnd(); |
} |
227,7 → 214,7 |
static int MenuetOS_FlipHWSurface(_THIS,SDL_Surface * surface) |
{ |
draw_bitmap(surface->pixels, 0,0,surface->w,surface->h); |
__kos__draw_bitmap(surface->pixels, 0,0,surface->w,surface->h); |
return 0; |
} |