/programs/emulator/kwine/bin/lib/msvcrt.dll |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/programs/emulator/kwine/bin/samples.zip |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/programs/emulator/kwine/bin/kwine |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/programs/emulator/kwine/lib/stdlib.h |
---|
File deleted |
\ No newline at end of file |
/programs/emulator/kwine/lib/stdio.h |
---|
File deleted |
\ No newline at end of file |
/programs/emulator/kwine/lib/string.h |
---|
File deleted |
\ No newline at end of file |
/programs/emulator/kwine/lib/conio.h |
---|
File deleted |
\ No newline at end of file |
/programs/emulator/kwine/lib/msvcrt.dll.c |
---|
6,19 → 6,15 |
#include <stdarg.h> |
#include "msvcrt.dll.h" |
#include "string.h" |
#include "conio.h" |
#include "stdio.h" |
#include "stdlib.h" |
#include "time.h" |
#include "string.c" |
//#include "dlfcn.c" |
#include "conio.c" |
#include "stdio.c" |
#include "stdlib.c" |
#include "time.h" |
#include "time.c" |
// note: by default all function in c are cdecl :D |
typedef struct |
{ |
34,23 → 30,13 |
const char sz_printf[] = "printf"; |
const char sz_puts[] = "puts"; |
const char sz_gets[] = "gets"; |
const char sz_putchar[] = "putchar"; |
//string |
const char sz_strlen[] = "strlen"; |
const char sz_strcmp[] = "strcmp"; |
const char sz_strcat[] = "strcat"; |
const char sz_strchr[] = "strchr"; |
const char sz_strrchr[] = "strrchr"; |
const char sz_strcpy[] = "strcpy"; |
const char sz_strncpy[] = "strncpy"; |
const char sz_memset[] = "memset"; |
const char sz_memcpy[] = "memcpy"; |
const char sz_memcmp[] = "memcmp"; |
// stdlib |
const char sz_srand[] = "srand"; |
const char sz_rand[] = "rand"; |
const char sz_malloc[] = "malloc"; |
const char sz_free[] = "free"; |
const char sz_realloc[] = "realloc"; |
58,9 → 44,6 |
// time |
const char sz_time[] = "time"; |
const char sz_mktime[] = "mktime"; |
const char sz_localtime[] = "localtime"; |
const char sz_difftime[] = "difftime"; |
//uint32_t EXPORTS[] __asm__("EXPORTS") = |
72,31 → 55,17 |
{sz_printf, (void*)printf}, |
{sz_puts, (void*)puts}, |
{sz_gets, (void*)gets}, |
{sz_putchar, (void*)putchar}, |
{sz_strlen, (void*)strlen}, |
{sz_strcmp, (void*)strcmp}, |
{sz_strcat, (void*)strcat}, |
{sz_strchr, (void*)strchr}, |
{sz_strrchr, (void*)strrchr}, |
{sz_strcpy, (void*)strcpy}, |
{sz_strncpy, (void*)strncpy}, |
{sz_memset, (void*)memset}, |
{sz_memcpy, (void*)memcpy}, |
{sz_memcmp, (void*)memcmp}, |
{sz_srand, (void*)srand}, |
{sz_rand, (void*)rand}, |
{sz_malloc, (void*)malloc}, |
{sz_free, (void*)free}, |
{sz_realloc, (void*)realloc}, |
{sz_time, (void*)time}, |
{sz_mktime, (void*)mktime}, |
{sz_localtime, (void*)localtime}, |
{sz_difftime, (void*)difftime}, |
{NULL, NULL}, |
}; |
/programs/emulator/kwine/lib/conio.c |
---|
42,12 → 42,12 |
void *getprocaddress(void *exports, char *name) |
{ |
if (exports == NULL) { return 0; } |
while (*(uint32_t*)exports != 0) |
while (*(uint32_t*)exports != NULL) |
{ |
char *str1 = (char*)(*(uint32_t*)exports); |
if (strcmp(str1, name) == 0) |
{ |
void *ptr = (void*)*(uint32_t*)(exports + 4); |
void *ptr = *(uint32_t*)(exports + 4); |
// important for debug |
/*debug_board_write_string(name); |
146,13 → 146,13 |
// -------------------------------------------------------------------- |
int _getch() |
int cdecl _getch() |
{ |
con_init_console_dll(); |
return con_getch(); |
} |
int _kbhit() |
int cdecl _kbhit() |
{ |
con_init_console_dll(); |
return con_kbhit(); |
/programs/emulator/kwine/lib/stdio.c |
---|
10,13 → 10,13 |
return ch; |
} |
void puts(const char *str) |
void cdecl puts(const char *str) |
{ |
con_init_console_dll(); |
con_write_asciiz(str); |
} |
char* gets(char* str) |
char* cdecl gets(char* str) |
{ |
con_init_console_dll(); |
return con_gets(str, 256); |
/programs/emulator/kwine/lib/stdlib.c |
---|
1,18 → 1,4 |
unsigned long int __rnd_next = 1; |
int rand(void) // RAND_MAX assumed to be 32767 |
{ |
__rnd_next = __rnd_next * 1103515245 + 12345; |
return (unsigned int)(__rnd_next/65536) % 32768; |
} |
void srand(unsigned int seed) |
{ |
__rnd_next = seed; |
} |
void *malloc(size_t size) |
{ |
void *val; |
/programs/emulator/kwine/kwine.asm |
---|
117,7 → 117,7 |
func dd 0 |
func_name dd 0 |
; ------------------------------------------------------------- ; |
sz_pe_load db "KWINE",0 |
sz_pe_load db "PELoad",0 |
; ------------------------------------------------------------- ; |
con_init dd 0 |
con_write_asciiz dd 0 |