diff --git a/programs/network/netsurf/dependencies/lib/libcss.a b/programs/network/netsurf/dependencies/lib/libcss.a new file mode 100644 index 0000000000..3ae56146cb Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libcss.a differ diff --git a/programs/network/netsurf/dependencies/lib/libcurl.a b/programs/network/netsurf/dependencies/lib/libcurl.a new file mode 100644 index 0000000000..051bd696da Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libcurl.a differ diff --git a/programs/network/netsurf/dependencies/lib/libdom.a b/programs/network/netsurf/dependencies/lib/libdom.a new file mode 100644 index 0000000000..db8fe22456 Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libdom.a differ diff --git a/programs/network/netsurf/dependencies/lib/libhubbub.a b/programs/network/netsurf/dependencies/lib/libhubbub.a new file mode 100644 index 0000000000..4e9f49d285 Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libhubbub.a differ diff --git a/programs/network/netsurf/dependencies/lib/libnsbmp.a b/programs/network/netsurf/dependencies/lib/libnsbmp.a new file mode 100644 index 0000000000..d6f9e0a0db Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libnsbmp.a differ diff --git a/programs/network/netsurf/dependencies/lib/libnsfb.a b/programs/network/netsurf/dependencies/lib/libnsfb.a new file mode 100644 index 0000000000..d1b4928d6c Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libnsfb.a differ diff --git a/programs/network/netsurf/dependencies/lib/libnsgif.a b/programs/network/netsurf/dependencies/lib/libnsgif.a new file mode 100644 index 0000000000..c371e22122 Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libnsgif.a differ diff --git a/programs/network/netsurf/dependencies/lib/libparserutils.a b/programs/network/netsurf/dependencies/lib/libparserutils.a new file mode 100644 index 0000000000..29cb2d403f Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libparserutils.a differ diff --git a/programs/network/netsurf/dependencies/lib/libwapcaplet.a b/programs/network/netsurf/dependencies/lib/libwapcaplet.a new file mode 100644 index 0000000000..a5e9865851 Binary files /dev/null and b/programs/network/netsurf/dependencies/lib/libwapcaplet.a differ diff --git a/programs/network/netsurf/libdom/bindings/hubbub/Makefile b/programs/network/netsurf/libdom/bindings/hubbub/Makefile index 608cbaf661..b3b8b412b5 100644 --- a/programs/network/netsurf/libdom/bindings/hubbub/Makefile +++ b/programs/network/netsurf/libdom/bindings/hubbub/Makefile @@ -4,5 +4,5 @@ OBJS := parser.o OUTFILE = libo.o -CFLAGS += -I ../../include/ -I ../../include/dom/ -I ../../ -I ../ -I ./ -I /home/sourcerer/kos_src/newenginek/kolibri/include +CFLAGS += -I ./ -I ../../include/ -I ../../src/ -I ../../../libhubbub/include/ -I ../../../libwapcaplet/include/ include $(MENUETDEV)/makefiles/Makefile_for_o_lib diff --git a/programs/network/netsurf/libdom/bindings/hubbub/parser.c b/programs/network/netsurf/libdom/bindings/hubbub/parser.c index 8af697c0c4..9a27a24428 100644 --- a/programs/network/netsurf/libdom/bindings/hubbub/parser.c +++ b/programs/network/netsurf/libdom/bindings/hubbub/parser.c @@ -16,11 +16,14 @@ #include -#include "errors.h" + +//#include "errors.h" #include "parser.h" #include "utils.h" #include "core/document.h" + + #include "core/string.h" #include "core/node.h" @@ -472,15 +475,15 @@ static hubbub_error has_children(void *parser, void *node, bool *result) static hubbub_error form_associate(void *parser, void *form, void *node) { - /* + dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser; dom_html_form_element *form_ele = form; dom_node_internal *ele = node; dom_html_document *doc = (dom_html_document *)ele->owner; - dom_exception err = DOM_NO_ERR;*/ + dom_exception err = DOM_NO_ERR; /* Determine the kind of the node we have here. */ - /*if (dom_string_caseless_isequal(ele->name, + if (dom_string_caseless_isequal(ele->name, doc->memoised[hds_BUTTON])) { err = _dom_html_button_element_set_form( (dom_html_button_element *)node, form_ele); @@ -516,7 +519,7 @@ static hubbub_error form_associate(void *parser, void *form, void *node) "Error in form_associate"); return HUBBUB_UNKNOWN; } - }*/ + } return HUBBUB_OK; } diff --git a/programs/network/netsurf/libnsfb/src/surface/Makefile b/programs/network/netsurf/libnsfb/src/surface/Makefile index 125fe2468f..3179b97ce8 100644 --- a/programs/network/netsurf/libnsfb/src/surface/Makefile +++ b/programs/network/netsurf/libnsfb/src/surface/Makefile @@ -1,6 +1,5 @@ # Sources -OBJS := surface.o able.o ram.o linux.o sdl.o - +OBJS := surface.o able.o ram.o linux.o sdl.o kolibri.o OUTFILE = sup.o diff --git a/programs/network/netsurf/libnsfb/src/surface/kolibri.c b/programs/network/netsurf/libnsfb/src/surface/kolibri.c index 3c52c09d0c..c1d810507c 100644 --- a/programs/network/netsurf/libnsfb/src/surface/kolibri.c +++ b/programs/network/netsurf/libnsfb/src/surface/kolibri.c @@ -40,6 +40,29 @@ asm("popa"); } +unsigned kol_mouse_posw() +{ +unsigned error; +asm volatile ("int $0x40":"=a"(error):"a"(37), "b"(1)); +return error; +} + + +unsigned kol_mouse_btn() +{ +unsigned error; +asm volatile ("int $0x40":"=a"(error):"a"(37), "b"(2)); +return error; +} + +unsigned kol_scancodes() +{ +unsigned error; +asm volatile ("int $0x40":"=a"(error):"a"(66), "b"(1), "c"(1)); +return error; +} + + void kolibri_redraw(nsfb_t *nsfb){ @@ -47,16 +70,35 @@ void kolibri_redraw(nsfb_t *nsfb){ } + +unsigned kol_skin_h() +{ +unsigned error; +asm volatile ("int $0x40":"=a"(error):"a"(48), "b"(4)); +return error; +} + +unsigned kol_area(char *data) +{ +unsigned error; +asm volatile ("int $0x40":"=a"(error):"a"(9), "b"(data), "c"(0xffffffff)); +return error; +} + + void kolibri_window_redraw(nsfb_t *nsfb){ __menuet__window_redraw(1); - __menuet__define_window(100,100,nsfb->width,nsfb->height,0x43000080,0x800000FF,0x000080); - __menuet__write_text(3,3,0xFFFFFF,"Netsurf",7); -__menuet__debug_out("f65 is mighty!\n"); + __menuet__define_window(100,100,nsfb->width+9,nsfb->height+kol_skin_h(),0x34000080,0x800000FF,"Netsurf"); + //__menuet__write_text(3,3,0xFFFFFF,"Netsurf",7); +//__menuet__debug_out("f65 is mighty!\n"); //here put image pixels! it's 32bpp f65(0,0, nsfb->width, nsfb->height, pixels); __menuet__window_redraw(2); + + + } @@ -84,9 +126,9 @@ kolibricopy(nsfb_t *nsfb, nsfb_bbox_t *srcbox, nsfb_bbox_t *dstbox) tw = dstbox->x1 - dstbox->x0; th = dstbox->y1 - dstbox->y0; - char pst[255]; - sprintf (pst, "Src %d,%d %dx%d Dst %d,%d %dx%d \n", x,y,w,h,tx,ty,tw,th); - __menuet__debug_out(pst); + // char pst[255]; + // sprintf (pst, "Src %d,%d %dx%d Dst %d,%d %dx%d \n", x,y,w,h,tx,ty,tw,th); + // __menuet__debug_out(pst); int px, py, pp; @@ -135,6 +177,8 @@ static int kolibri_initialise(nsfb_t *nsfb) { enum nsfb_format_e fmt; + kol_scancodes(); + pz=0; pb=0; @@ -187,30 +231,110 @@ static int kolibri_finalise(nsfb_t *nsfb) } -unsigned kol_mouse_posw() -{ -unsigned error; -asm volatile ("int $0x40":"=a"(error):"a"(37), "b"(1)); -return error; + +int isup(int scan){ + return (scan&0x80)>>7; } - -unsigned kol_mouse_btn() -{ -unsigned error; -asm volatile ("int $0x40":"=a"(error):"a"(37), "b"(2)); -return error; +int scan2key(int scan){ + int keycode=(scan&0x0FF7F); + /* MAIN KB - NUMS */ + if (keycode == 0x02) return NSFB_KEY_1; + if (keycode == 0x03) return NSFB_KEY_2; + if (keycode == 0x04) return NSFB_KEY_3; + if (keycode == 0x05) return NSFB_KEY_4; + if (keycode == 0x06) return NSFB_KEY_5; + if (keycode == 0x07) return NSFB_KEY_6; + if (keycode == 0x08) return NSFB_KEY_7; + if (keycode == 0x09) return NSFB_KEY_8; + if (keycode == 0x0A) return NSFB_KEY_9; + if (keycode == 0x0B) return NSFB_KEY_0; + + if (keycode == 0x10) return NSFB_KEY_q; + if (keycode == 0x11) return NSFB_KEY_w; + if (keycode == 0x12) return NSFB_KEY_e; + if (keycode == 0x13) return NSFB_KEY_r; + if (keycode == 0x14) return NSFB_KEY_t; + if (keycode == 0x15) return NSFB_KEY_y; + if (keycode == 0x16) return NSFB_KEY_u; + if (keycode == 0x17) return NSFB_KEY_i; + if (keycode == 0x18) return NSFB_KEY_o; + if (keycode == 0x19) return NSFB_KEY_p; + if (keycode == 0x1A) return NSFB_KEY_LEFTBRACKET; + if (keycode == 0x1B) return NSFB_KEY_RIGHTBRACKET; + + if (keycode == 0x1E) return NSFB_KEY_a; + if (keycode == 0x1F) return NSFB_KEY_s; + if (keycode == 0x20) return NSFB_KEY_d; + if (keycode == 0x21) return NSFB_KEY_f; + if (keycode == 0x22) return NSFB_KEY_g; + if (keycode == 0x23) return NSFB_KEY_h; + if (keycode == 0x24) return NSFB_KEY_j; + if (keycode == 0x25) return NSFB_KEY_k; + if (keycode == 0x26) return NSFB_KEY_l; + + if (keycode == 0x2C) return NSFB_KEY_z; + if (keycode == 0x2D) return NSFB_KEY_x; + if (keycode == 0x2E) return NSFB_KEY_c; + if (keycode == 0x2F) return NSFB_KEY_v; + if (keycode == 0x30) return NSFB_KEY_b; + if (keycode == 0x31) return NSFB_KEY_n; + if (keycode == 0x32) return NSFB_KEY_m; + + if (keycode == 0x27) return NSFB_KEY_SEMICOLON; + if (keycode == 0x28) return NSFB_KEY_QUOTEDBL; + if (keycode == 0x2B) return NSFB_KEY_BACKSLASH; + if (keycode == 0x33) return NSFB_KEY_COMMA; + if (keycode == 0x34) return NSFB_KEY_PERIOD; + if (keycode == 0x35) return NSFB_KEY_SLASH; + if (keycode == 0x0C) return NSFB_KEY_MINUS; + if (keycode == 0x0D) return NSFB_KEY_EQUALS; + + if (keycode == 0x0E) return NSFB_KEY_BACKSPACE; + if (keycode == 0xE053) return NSFB_KEY_DELETE; + if (keycode == 0x2A) return NSFB_KEY_LSHIFT; + if (keycode == 0x36) return NSFB_KEY_RSHIFT; + + if (keycode == 0x1C) return NSFB_KEY_RETURN; + + if (keycode == 0xE04B) return NSFB_KEY_LEFT; + if (keycode == 0xE04D) return NSFB_KEY_RIGHT; + if (keycode == 0xE048) return NSFB_KEY_UP; + if (keycode == 0xE050) return NSFB_KEY_DOWN; + + if (keycode == 0x3F) return NSFB_KEY_F5; + + if (keycode == 0x39) return NSFB_KEY_SPACE; + if (keycode == 0x01) return NSFB_KEY_ESCAPE; + + if (keycode == 0x38) return NSFB_KEY_LALT; + if (keycode == 0x1D) return NSFB_KEY_LCTRL; + if (keycode == 0xE038) return NSFB_KEY_RALT; + if (keycode == 0xE01D) return NSFB_KEY_RCTRL; + + + if (keycode == 0xE047) return NSFB_KEY_HOME; + if (keycode == 0xE04F) return NSFB_KEY_END; + if (keycode == 0xE049) return NSFB_KEY_PAGEUP; + if (keycode == 0xE051) return NSFB_KEY_PAGEDOWN; + + return NSFB_KEY_UNKNOWN; + } +int ispowerkey(int scan){ + return (scan&0xE000)>>15; +} static bool kolibri_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout) { int got_event; - + static int scanfull=0; nsfb = nsfb; /* unused */ + got_event = __menuet__check_for_event(); if (got_event == 0) { @@ -225,9 +349,39 @@ static bool kolibri_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout) } if (got_event==2) { //key pressed - event->type = NSFB_EVENT_KEY_UP; - event->value.keycode = __menuet__getkey(); + int scanz = __menuet__getkey(); + + //char dbs[64]; + + //__menuet__debug_out("KEY PRESSED\n"); + + // sprintf (dbs, "FULLKEY BEFORE: F:%x\n", scanfull); + //__menuet__debug_out(dbs); + + if (scanz==0xE0) { + scanfull=0xE000; + return true; + } else { + scanfull=scanfull+scanz; + } + + //sprintf (dbs, "FULLKEY AFTER: F:%x\n", scanfull); + //__menuet__debug_out(dbs); + + + if (isup(scanfull)==1) { + event->type = NSFB_EVENT_KEY_UP;} else { + event->type = NSFB_EVENT_KEY_DOWN;} + + event->value.keycode = scan2key(scanfull); + + //sprintf (dbs, "KEY: %x F:%x %d %d\n", scanz, scanfull, isup(scanz), scan2key(scanz)); + //__menuet__debug_out(dbs); + + scanfull=0; + return true; + } if (got_event==3) { //key pressed diff --git a/programs/network/netsurf/netsurf/content/fetchers/curl.c b/programs/network/netsurf/netsurf/content/fetchers/curl.c index 792ea9e0b5..701f6bb476 100644 --- a/programs/network/netsurf/netsurf/content/fetchers/curl.c +++ b/programs/network/netsurf/netsurf/content/fetchers/curl.c @@ -28,6 +28,9 @@ * ::max_cached_fetch_handles in this ring. */ + +#include "http.c" + #include #include #include @@ -155,7 +158,6 @@ lwc_intern_string("http", SLEN("http"), &scheme); bool fetch_curl_initialise(lwc_string *scheme) { - LOG(("curl initi lwc\n")); return true; /* Always succeeds */ } @@ -363,70 +365,76 @@ asm volatile ("int $0x40":"=a"(error):"a"(18), "b"(18), "c"(k)); return error; } + static void fetch_curl_process(struct fetch_curl_context *ctx) { - - int pid=execl ("/sys/network/downloader", ctx->path, 0); - - - -// while (is_pid(pid)) { - kill_pid(pid); -// } - - pid=execl ("/sys/network/downloader", ctx->path, 0); - - char ps[255]; - sprintf(ps, "pid %d", pid); - execl ("/sys/network/@notify", ps, 0); - - - while (is_pid(pid)); - - - sprintf(ps, "Yay! Finished"); - execl ("/sys/network/@notify", ps, 0); - - - /* - char pzz[255]; - sprintf(pzz, "Pid is %d", pid); - execl ("/sys/@notify", pzz, 0); */ - //int status; - //waitpid(pid, &status, 0); - + char ps[96], str[128]; + sprintf(ps, "Yay! Path is %s", ctx->path); + execl ("/sys/@notify", ps, 0); fetch_msg msg; - //const char * buf = "

Hello, file fetcher!

"; - FILE *infile; - infile = fopen("/sys/.download", "rb"); + /* ERSATZ DOWNLOADER */ - if (infile == NULL) { - printf("file does not exist.\n"); - return -1; - } - - fseek(infile, 0, SEEK_END); - size_t file_size = ftell(infile); - rewind(infile); - - char *buffer = (char*)malloc(file_size * sizeof(char)); - if (buffer == NULL) { - fclose(infile); - printf("Error allocating %d bytes.\n", file_size * sizeof(char)); - return -1; - } - size_t bytes_read = fread(buffer, sizeof(char), file_size, infile); - if (bytes_read != file_size) { - printf("Have read only %d bytes of %d.\n", bytes_read, file_size); - free(buffer); - fclose(infile); - return -1; - } - fclose(infile); + /* +char zapzap[]="

HOOLE!

"; +size_t file_size=strlen(zapzap); +char *buffer = (char*)malloc(file_size * sizeof(char)); +memcpy(buffer, zapzap, file_size * sizeof(char)); +*/ + + - - + + + __menuet__debug_out("AHOY!\n"); + struct http_msg *http_ahoy; + + unsigned int wererat = 0; + char * pa=ctx->path; + asm volatile ("pusha"); + wererat = http_get(pa); + asm volatile ("popa"); + __menuet__debug_out("HTTP GOT!\n"); + int result; + + http_ahoy=wererat; + + sprintf (str, "Header %d bytes, content %d bytes, recieved %d bytes\n", http_ahoy->header_length, http_ahoy->content_length, http_ahoy->content_received); + __menuet__debug_out(str); + + asm volatile ("pusha"); + result = http_process(wererat); + asm volatile ("popa"); + while (result == -1) { + asm volatile ("pusha"); + result = http_process(wererat); + asm volatile ("popa"); + } + + http_ahoy=wererat; + + sprintf (str, "Header %d bytes, content %d bytes, recieved %d bytes\n", http_ahoy->header_length, http_ahoy->content_length, http_ahoy->content_received); + __menuet__debug_out(str); + + + __menuet__debug_out("All content is here\n"); + + size_t file_size=http_ahoy->content_received; + char *buffer = (char*)malloc(file_size * sizeof(char)); + memcpy(buffer, &(http_ahoy->data)+http_ahoy->header_length, file_size); + + // http_free(wererat); + __menuet__debug_out("memcopied\n==\n"); + + //__menuet__debug_out(buffer); + //__menuet__debug_out("memcopied\n==\n"); + + +//char zapzap[]="

HOOLE!

"; +//file_size=strlen(zapzap); +//char *buffer = (char*)malloc(file_size * sizeof(char)); +//memcpy(buffer, zapzap, file_size * sizeof(char)); + /* fetch is going to be successful */ fetch_set_http_code(ctx->fetchh, 200); @@ -436,8 +444,6 @@ static void fetch_curl_process(struct fetch_curl_context *ctx) { * fetch_file_send_callback(). */ - __menuet__debug_out(fetch_filetype(ctx->path)); - __menuet__debug_out("\n"); if (fetch_curl_send_header(ctx, "Content-Type: %s", fetch_filetype(ctx->path))) @@ -447,7 +453,7 @@ static void fetch_curl_process(struct fetch_curl_context *ctx) { /* main data loop */ msg.type = FETCH_DATA; - msg.data.header_or_data.buf = (const uint8_t *) buffer; + msg.data.header_or_data.buf = (const uint8_t *) buffer;//&(http_ahoy->data) ; //buffer; msg.data.header_or_data.len = file_size; fetch_curl_send_callback(&msg, ctx); diff --git a/programs/network/netsurf/netsurf/content/fetchers/http.c b/programs/network/netsurf/netsurf/content/fetchers/http.c new file mode 100644 index 0000000000..85446b6c8d --- /dev/null +++ b/programs/network/netsurf/netsurf/content/fetchers/http.c @@ -0,0 +1,86 @@ +#include +#define NULL 0 +#define __stdcall __attribute__((stdcall)) + +extern int dll_load(); +extern int mem_Free(); +extern int mem_Alloc(); +extern int mem_ReAlloc(); + + + +int kol_exit(){ + __menuet__sys_exit(); +} + + + +struct http_msg { +unsigned int socket; +unsigned int flags; +unsigned int write_ptr; +unsigned int buffer_length; +unsigned int chunk_ptr; +unsigned int timestamp; +unsigned int status; +unsigned int header_length; +unsigned int content_length; +unsigned int content_received; +char data; //unknown size +}; + + +int (* __stdcall http_init)(); +unsigned int (* __stdcall http_get) (char * url); //yay, it's NOT uint, but hey, C is stubborn, and I'm dumb +int (* __stdcall http_process) (unsigned int identifier); +void (* __stdcall http_free) (unsigned int identifier); + + +int HTTP_YAY(){ + asm volatile ("pusha\n\ + movl $mem_Alloc, %eax\n\ + movl $mem_Free, %ebx\n\ + movl $mem_ReAlloc, %ecx\n\ + movl $dll_load, %edx\n\ + movl http_init, %esi\n\ + call *%esi\n\ + popa"); +} + +///=========================== + +void HTTP_INIT() +{ +IMP_ENTRY *imp; + +imp = __kolibri__cofflib_load("/sys/lib/http.obj"); +if (imp == NULL) + kol_exit(); + +http_init = ( __stdcall int(*)()) + __kolibri__cofflib_getproc (imp, "lib_init"); +if (http_init == NULL) + kol_exit(); + +http_get = ( __stdcall unsigned int (*)(char*)) + __kolibri__cofflib_getproc (imp, "get"); +if (http_get == NULL) + kol_exit(); + +http_free = ( __stdcall void (*)(unsigned int)) + __kolibri__cofflib_getproc (imp, "free"); +if (http_free == NULL) + kol_exit(); + + +http_process = ( __stdcall int (*)(unsigned int)) + __kolibri__cofflib_getproc (imp, "process"); +if (http_process == NULL) + kol_exit(); + +__menuet__debug_out("HTTP init...\n"); +HTTP_YAY(); + +__menuet__debug_out("ok...\n"); + +} diff --git a/programs/network/netsurf/netsurf/framebuffer/gui.c b/programs/network/netsurf/netsurf/framebuffer/gui.c index 15efa43238..8f3ce7d51f 100644 --- a/programs/network/netsurf/netsurf/framebuffer/gui.c +++ b/programs/network/netsurf/netsurf/framebuffer/gui.c @@ -435,7 +435,7 @@ process_cmdline(int argc, char** argv) fewidth = nsoption_int(window_width); feheight = nsoption_int(window_height); } else { - fewidth = 800; //640; + fewidth = 790; //640; feheight = 560; //400; } @@ -540,6 +540,25 @@ main(int argc, char** argv) freopen( "stderr.log", "w", stderr ); freopen( "stdout.log", "w", stdout ); + + char p[256]; + char **z; + z=0x20; + strcpy(p, *z); + + __menuet__debug_out("PATH1...\n"); + __menuet__debug_out(p); + __menuet__debug_out("PATH1...\n"); + + *(strrchr(p, '/')+1)='\0'; + + strcpy(strrchr(p, '/')+1, "res/"); + + __menuet__debug_out("PATH1...\n"); + __menuet__debug_out(p); + __menuet__debug_out("PATH1...\n"); + + asm volatile ("int $0x40"::"a"(30), "b"(1), "c"(p)); LOG(("Registering surfaces for SDL and RAM..")); @@ -552,14 +571,22 @@ main(int argc, char** argv) _nsfb_register_surface(NSFB_SURFACE_RAM, &ram_rtns, "ram"); _nsfb_register_surface(NSFB_SURFACE_ABLE, &able_rtns, "able"); _nsfb_register_surface(NSFB_SURFACE_KOLIBRI, &kolibri_rtns, "kolibri"); - - respaths = fb_init_resource("/hd0/1/res/:/bd0/1/res/:/tmp9/1/netsurf/res/:res/:fonts/"); + + + //respaths = fb_init_resource("/kolibrios/:/hd0/1/res/:/bd0/1/res/:/tmp9/1/netsurf/res/:res/:fonts/:"); + respaths = fb_init_resource(p); options = filepath_find(respaths, "Choices"); messages = filepath_find(respaths, "messages"); - netsurf_init(&argc, &argv, options, "res/messages"); + __menuet__debug_out("===path to msg\n"); + __menuet__debug_out(messages); + __menuet__debug_out("\n===path to msg\n"); + //netsurf_init(&argc, &argv, options, "res/messages"); + netsurf_init(&argc, &argv, options, messages); + extern HTTP_INIT(); + HTTP_INIT(); LOG(("NS init okay")); free(messages); diff --git a/programs/network/netsurf/netsurf/objs/bitmap.o b/programs/network/netsurf/netsurf/objs/bitmap.o index a4977b6455..787ae8c8f1 100644 Binary files a/programs/network/netsurf/netsurf/objs/bitmap.o and b/programs/network/netsurf/netsurf/objs/bitmap.o differ diff --git a/programs/network/netsurf/netsurf/objs/box.o b/programs/network/netsurf/netsurf/objs/box.o index 1b89ed60ea..fdbbf456ed 100644 Binary files a/programs/network/netsurf/netsurf/objs/box.o and b/programs/network/netsurf/netsurf/objs/box.o differ diff --git a/programs/network/netsurf/netsurf/objs/box_construct.o b/programs/network/netsurf/netsurf/objs/box_construct.o index dc09be56ea..f82cc9a2dd 100644 Binary files a/programs/network/netsurf/netsurf/objs/box_construct.o and b/programs/network/netsurf/netsurf/objs/box_construct.o differ diff --git a/programs/network/netsurf/netsurf/objs/clipboard.o b/programs/network/netsurf/netsurf/objs/clipboard.o index f494343ceb..200cdc3ff2 100644 Binary files a/programs/network/netsurf/netsurf/objs/clipboard.o and b/programs/network/netsurf/netsurf/objs/clipboard.o differ diff --git a/programs/network/netsurf/netsurf/objs/curl.o b/programs/network/netsurf/netsurf/objs/curl.o index 8bca6f0102..5afc955145 100644 Binary files a/programs/network/netsurf/netsurf/objs/curl.o and b/programs/network/netsurf/netsurf/objs/curl.o differ diff --git a/programs/network/netsurf/netsurf/objs/dll.asm b/programs/network/netsurf/netsurf/objs/dll.asm new file mode 100644 index 0000000000..47f67cca46 --- /dev/null +++ b/programs/network/netsurf/netsurf/objs/dll.asm @@ -0,0 +1,179 @@ +include 'proc32.inc' + +macro __mov reg,a,b { ; mike.dld + if (~a eq)&(~b eq) + mpack reg,a,b + else if (~a eq)&(b eq) + mov reg,a + end if +} + +macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls + __mov eax,a + __mov ebx,b + __mov ecx,c + __mov edx,d + __mov esi,e + __mov edi,f + int 0x40 +} + + +format ELF +section '.text' executable + +public dll_load +public mem_Free +public mem_Alloc +public mem_ReAlloc + +;----------------------------------------------------------------------------- +proc dll_load, import_table:dword + mov esi, [import_table] + .next_lib: + mov edx, [esi] + or edx, edx + jz .exit + push esi + mov esi, [esi + 4] + mov edi, s_libdir.fname + @@: + lodsb + stosb + or al, al + jnz @b + mcall 68, 19, s_libdir + or eax, eax + jz .fail + stdcall dll.Link, eax, edx + push eax + mov eax, [eax] + cmp dword[eax], 'lib_' + pop eax + jnz @f + stdcall dll.Init, [eax + 4] + @@: + pop esi + add esi, 8 + jmp .next_lib + .exit: + xor eax, eax + ret + .fail: + add esp, 4 + xor eax, eax + inc eax + ret +endp +;----------------------------------------------------------------------------- +proc dll.Link, exp:dword, imp:dword + push eax + mov esi, [imp] + test esi, esi + jz .done + .next: + lodsd + test eax, eax + jz .done + stdcall dll.GetProcAddress, [exp], eax + or eax, eax + jz @f + mov [esi - 4], eax + jmp .next + @@: + mov dword[esp], 0 + .done: + pop eax + ret +endp +;----------------------------------------------------------------------------- +proc dll.Init, dllentry:dword + pushad + mov eax, mem_Alloc + mov ebx, mem_Free + mov ecx, mem_ReAlloc + mov edx, dll_load + stdcall [dllentry] + popad + ret +endp +;----------------------------------------------------------------------------- +proc dll.GetProcAddress, exp:dword, sz_name:dword + mov edx, [exp] + xor eax, eax + .next: + or edx, edx + jz .end + cmp dword[edx], 0 + jz .end + stdcall strcmp, [edx], [sz_name] + test eax, eax + jz .ok + add edx, 8 + jmp .next + .ok: + mov eax, [edx + 4] + .end: + ret +endp +;----------------------------------------------------------------------------- +proc strcmp, str1:dword, str2:dword + push esi edi + mov esi, [str1] + mov edi, [str2] + xor eax, eax + @@: + lodsb + scasb + jne .fail + or al, al + jnz @b + jmp .ok + .fail: + or eax, -1 + .ok: + pop edi esi + ret +endp +;----------------------------------------------------------------------------- +s_libdir: + db '/sys/lib/' + .fname rb 32 +;----------------------------------------------------------------------------- +proc mem_Alloc, size + push ebx ecx + mov ecx, [size] + mcall 68, 12 + pop ecx ebx + ret +endp +;----------------------------------------------------------------------------- +proc mem_ReAlloc, mptr, size + push ebx ecx edx + mov ecx, [size] + or ecx, ecx + jz @f + @@: + mov edx, [mptr] + or edx, edx + jz @f + @@: + mcall 68, 20 + or eax, eax + jz @f + @@: + pop edx ecx ebx + ret +endp +;----------------------------------------------------------------------------- +proc mem_Free, mptr + push ebx ecx + mov ecx,[mptr] + or ecx,ecx + jz @f + @@: + mcall 68, 13 + pop ecx ebx + ret +endp +;----------------------------------------------------------------------------- diff --git a/programs/network/netsurf/netsurf/objs/dll.o b/programs/network/netsurf/netsurf/objs/dll.o new file mode 100644 index 0000000000..7894575147 Binary files /dev/null and b/programs/network/netsurf/netsurf/objs/dll.o differ diff --git a/programs/network/netsurf/netsurf/objs/filetype.o b/programs/network/netsurf/netsurf/objs/filetype.o index 80393adb42..e467b1dea8 100644 Binary files a/programs/network/netsurf/netsurf/objs/filetype.o and b/programs/network/netsurf/netsurf/objs/filetype.o differ diff --git a/programs/network/netsurf/netsurf/objs/findfile.o b/programs/network/netsurf/netsurf/objs/findfile.o index 71ddf67d56..ab0256e56f 100644 Binary files a/programs/network/netsurf/netsurf/objs/findfile.o and b/programs/network/netsurf/netsurf/objs/findfile.o differ diff --git a/programs/network/netsurf/netsurf/objs/font_freetype.o b/programs/network/netsurf/netsurf/objs/font_freetype.o index a9b8c4eaa0..c48517331f 100644 Binary files a/programs/network/netsurf/netsurf/objs/font_freetype.o and b/programs/network/netsurf/netsurf/objs/font_freetype.o differ diff --git a/programs/network/netsurf/netsurf/objs/form.o b/programs/network/netsurf/netsurf/objs/form.o index 27f67f8d1d..ca6276d052 100644 Binary files a/programs/network/netsurf/netsurf/objs/form.o and b/programs/network/netsurf/netsurf/objs/form.o differ diff --git a/programs/network/netsurf/netsurf/objs/framebuffer.o b/programs/network/netsurf/netsurf/objs/framebuffer.o index 6fdcf271b5..f4af97803e 100644 Binary files a/programs/network/netsurf/netsurf/objs/framebuffer.o and b/programs/network/netsurf/netsurf/objs/framebuffer.o differ diff --git a/programs/network/netsurf/netsurf/objs/gui.o b/programs/network/netsurf/netsurf/objs/gui.o index 68d9c45528..19337d177a 100644 Binary files a/programs/network/netsurf/netsurf/objs/gui.o and b/programs/network/netsurf/netsurf/objs/gui.o differ diff --git a/programs/network/netsurf/netsurf/objs/html.o b/programs/network/netsurf/netsurf/objs/html.o index 1f0b26f828..eab62dfe32 100644 Binary files a/programs/network/netsurf/netsurf/objs/html.o and b/programs/network/netsurf/netsurf/objs/html.o differ diff --git a/programs/network/netsurf/netsurf/objs/html_forms.o b/programs/network/netsurf/netsurf/objs/html_forms.o index ff8843fbc4..8bba4f8ac4 100644 Binary files a/programs/network/netsurf/netsurf/objs/html_forms.o and b/programs/network/netsurf/netsurf/objs/html_forms.o differ diff --git a/programs/network/netsurf/netsurf/objs/html_redraw.o b/programs/network/netsurf/netsurf/objs/html_redraw.o index 7682e58109..449caa5177 100644 Binary files a/programs/network/netsurf/netsurf/objs/html_redraw.o and b/programs/network/netsurf/netsurf/objs/html_redraw.o differ diff --git a/programs/network/netsurf/netsurf/objs/layout.o b/programs/network/netsurf/netsurf/objs/layout.o index 897795271f..f14931e83e 100644 Binary files a/programs/network/netsurf/netsurf/objs/layout.o and b/programs/network/netsurf/netsurf/objs/layout.o differ diff --git a/programs/network/netsurf/netsurf/objs/list.o b/programs/network/netsurf/netsurf/objs/list.o index 6a5d547cfc..b9fd18e9c9 100644 Binary files a/programs/network/netsurf/netsurf/objs/list.o and b/programs/network/netsurf/netsurf/objs/list.o differ diff --git a/programs/network/netsurf/netsurf/objs/localhistory.o b/programs/network/netsurf/netsurf/objs/localhistory.o index 90ce3aa918..a5f6a93a2a 100644 Binary files a/programs/network/netsurf/netsurf/objs/localhistory.o and b/programs/network/netsurf/netsurf/objs/localhistory.o differ diff --git a/programs/network/netsurf/netsurf/objs/login.o b/programs/network/netsurf/netsurf/objs/login.o index 2a98e74905..b1e7c1d7d8 100644 Binary files a/programs/network/netsurf/netsurf/objs/login.o and b/programs/network/netsurf/netsurf/objs/login.o differ diff --git a/programs/network/netsurf/netsurf/objs/misc.o b/programs/network/netsurf/netsurf/objs/misc.o index 6f20d07586..e47de86a1c 100644 Binary files a/programs/network/netsurf/netsurf/objs/misc.o and b/programs/network/netsurf/netsurf/objs/misc.o differ diff --git a/programs/network/netsurf/netsurf/objs/nsfont_bold.o b/programs/network/netsurf/netsurf/objs/nsfont_bold.o index 406139bae4..7075dc88c8 100644 Binary files a/programs/network/netsurf/netsurf/objs/nsfont_bold.o and b/programs/network/netsurf/netsurf/objs/nsfont_bold.o differ diff --git a/programs/network/netsurf/netsurf/objs/nsfont_italic.o b/programs/network/netsurf/netsurf/objs/nsfont_italic.o index 71d6f53824..8a57d0b1d4 100644 Binary files a/programs/network/netsurf/netsurf/objs/nsfont_italic.o and b/programs/network/netsurf/netsurf/objs/nsfont_italic.o differ diff --git a/programs/network/netsurf/netsurf/objs/nsfont_italic_bold.o b/programs/network/netsurf/netsurf/objs/nsfont_italic_bold.o index abed43f2bf..6072f058c7 100644 Binary files a/programs/network/netsurf/netsurf/objs/nsfont_italic_bold.o and b/programs/network/netsurf/netsurf/objs/nsfont_italic_bold.o differ diff --git a/programs/network/netsurf/netsurf/objs/nsfont_regular.o b/programs/network/netsurf/netsurf/objs/nsfont_regular.o index ba814ecf5f..a83f7b0447 100644 Binary files a/programs/network/netsurf/netsurf/objs/nsfont_regular.o and b/programs/network/netsurf/netsurf/objs/nsfont_regular.o differ diff --git a/programs/network/netsurf/netsurf/objs/schedule.o b/programs/network/netsurf/netsurf/objs/schedule.o index eee91bca82..a2488287c1 100644 Binary files a/programs/network/netsurf/netsurf/objs/schedule.o and b/programs/network/netsurf/netsurf/objs/schedule.o differ diff --git a/programs/network/netsurf/netsurf/objs/system_colour.o b/programs/network/netsurf/netsurf/objs/system_colour.o index ac79ff3a2b..d0ffcd642a 100644 Binary files a/programs/network/netsurf/netsurf/objs/system_colour.o and b/programs/network/netsurf/netsurf/objs/system_colour.o differ diff --git a/programs/network/netsurf/netsurf/objs/textplain.o b/programs/network/netsurf/netsurf/objs/textplain.o index a287bf0cc2..834e61a7b4 100644 Binary files a/programs/network/netsurf/netsurf/objs/textplain.o and b/programs/network/netsurf/netsurf/objs/textplain.o differ diff --git a/programs/network/netsurf/netsurf/objs/thumbnail.o b/programs/network/netsurf/netsurf/objs/thumbnail.o index 8ad236a6bb..ff46a4befe 100644 Binary files a/programs/network/netsurf/netsurf/objs/thumbnail.o and b/programs/network/netsurf/netsurf/objs/thumbnail.o differ diff --git a/programs/network/netsurf/netsurf/objs/tree.o b/programs/network/netsurf/netsurf/objs/tree.o index 9ce222a8e1..b7505a1524 100644 Binary files a/programs/network/netsurf/netsurf/objs/tree.o and b/programs/network/netsurf/netsurf/objs/tree.o differ