Welcome, Guest. Please login or register.

Author Topic: We need an iBrowse replacement for 68k!!!  (Read 75345 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #59 from previous page: February 23, 2015, 11:59:16 PM »
Quote from: chris;785267
Yes... just done it (might* have missed some, but we'll find out)

Uploaded a new version from my bitmap fonts branch (as I don't want to merge this yet).

* Actually I know I've missed some, but nothing important for now.


Bingo!!! Most menu items and gadgets work now! It is faster than ever also. Awesome!!!
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #60 on: February 24, 2015, 12:55:21 AM »
Quote from: chris;785274
Cool.  I changed the CPU option to -m68020-60, not sure if that is the cause of the speed boost or something else.


It's still not usable but I can see the potential. I was able to login to amiga.org to try a post but it acted like it didn't keep the cookie as it didn't remember me.

The one 68k build of AWeb with GCC is using:

Code: [Select]

-O2 -fomit-frame-pointer -m68020-60


This should give acceptable results if optimizations could be turned on. GCC seems to think using the normal CISC addressing modes is an optimization though.

Quote from: chris;785274

The text width etc calculations are currently somewhat broken in bitmap mode, I'm aware of that.


There are a lot of adjustments needed yet and I'm sure plenty of bugs remaining but it is mostly working now.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #61 on: February 24, 2015, 10:54:33 PM »
Quote from: chris;785339
So, the same basically :)  Be nice if somebody could give me a fix for that GCC optimisation bug, or tell me which optimisation causes it so I can disable it.

Seeing at least one of the taglist problems occured with NewObjectA(), you might check this:

Quote
Now you need to modify a file: os-include/inline/intuition.h.

Open the above file with a text editor and search the following instructions:

#ifndef NO_INLINE_STDARG
__inline APTR NewObject(struct IClass * classPtr, CONST_STRPTR classID, ULONG tagList, ...)
{
  return NewObjectA(classPtr, classID, (const struct TagItem *) &tagList);
}

Replace them with these:

/*
#ifndef NO_INLINE_STDARG
__inline APTR NewObject(struct IClass * classPtr, CONST_STRPTR classID, ULONG tagList, ...)
{
  return NewObjectA(classPtr, classID, (const struct TagItem *) &tagList);
}
*/

#ifndef NO_INLINE_STDARG
#define NewObject(classPtr, classID, tags...) \
    ({ULONG _tags[] = {tags}; NewObjectA((classPtr), (classID), (const struct TagItem *) _tags);})
#endif

http://guidetoamigacompatibleprogramming.googlecode.com/svn/trunk/english/CAP_2.txt

My GCC 3.4.0 version of os-include/inline/intuition.h is a little bit different if you want to try it too:

http://www.heywheel.com/matthey/Amiga/INTUITION.H
« Last Edit: February 24, 2015, 11:08:22 PM by matthey »
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #62 on: February 25, 2015, 07:57:54 PM »
Quote from: utri007;785414
OK this is what happen with my desktop A1200, 68040, 32mb ram and AGA :


It looks like your PC is lost. It's not executing code in NetSurf anymore and probably not even the OS when you get the guru. This is usually caused by a messed up stack or invalid data on the stack and then a RTS (ReTurn from Subroutine) which uses the last 32 bit value on the stack as an address to jump to. The guru information is rather useless in this case as the problem happened earlier. There may have been a MuForce hit before the guru which could be helpful if we had the right kind of debugging information in the NetSurf executable but we haven't solved that problem yet. I don't know what is wrong with your setup but make sure you downloaded and are using the latest version of NetSurf. The last NetSurf executable I tried is 5845748 bytes. The stack needs to be increased before executing NetSurf if starting from the shell. The icon I use shows a stack size of 65535 bytes but it looks like a stack size of 32kB (and maybe even 16kB but too little will crash) would work unless Chris has some recursive functions hidden somewhere.

@Chris
No comment on the potential compiler fix (Intuition inlines) or are you still looking into it?
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #63 on: February 26, 2015, 03:28:46 AM »
Quote from: chris;785444
Both give me:
Code: [Select]

error: syntax error before ')' token


Where I use a NewObject embedded into an if statement.

It looks very likely to be the fix though, as all the other varargs stubs are #defined like that.  Not sure why this one isn't working.


I wonder if there is a parsing bug in your version of GCC. I believe these are optional inlines instead of using the default stubs so if you can't format the function so GCC will accept it then try commenting it out.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #64 on: February 27, 2015, 10:46:01 PM »
Quote from: chris;785519
I doubt it.  There would be many more problems than this if there was.


GCC used to have minor parsing bugs. My GCC NOTES-3.4.0 has this:

Quote

Another bug exists with explicit regsister arguments and function pointers:

void (*testfunc) (void (*)(int) __asm("a3));

The compiler says:

error: parse error before ')' token

However, if the above is rewritten like this:

void (*testfunc) (void (*dummy)(int) __asm("a3));

then everything works. This bug was found by Fabio Alemagna in the GCC 3.3 port and is still present.


It's interesting as this is the same parse error you get when the brackets appear to match.

Quote from: chris;785519

Just get errors about there being no NewObject function.

I think all that is required is to tell GCC that the varargs are used so it doesn't optimise them away.  I can't figure out how to do that though.


The define is defining a normal function. You could try:

Code: [Select]

#define NewObject(classPtr, classID, tags...) \
({\
ULONG _tags[] = {tags};\
NewObjectA((classPtr), (classID), (const struct TagItem *) _tags);\
})


More lines may help to find what the compiler doesn't like if the line the error is on is given. If this doesn't work, maybe it would be possible to make NewObject into a regular function:

Code: [Select]

NewObject(classPtr, classID, tags...)
{
ULONG _tags[] = {tags};
NewObjectA(classPtr, classID, (const struct TagItem *) _tags);
}


I'm hoping that either the different formatting or an error message with a line number would help pinpoint the problem or, perhaps, the error would go away.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #65 on: February 28, 2015, 12:23:44 AM »
Quote from: chris;785563
I'd tried that already (as an inline function though) and it complained that classPtr, ClassID etc weren't defined, which is an even stranger error.

That is strange. The function arguments shouldn't need defining in the function. The function needs defining which it already is in os-include/clib/inution_protos,h with the argument types given.

You do have to be careful with "inline" functions (especially "extern inline") as C99 requires handling which may be incompatible with earlier versions of C. This is a really excellent article:

http://www.drdobbs.com/the-new-c-inline-functions/184401540

The NetSurf compiler options use -std=c99 so GCC will try to follow the standard instead of it's normal non-strict forgiving C standard mode. I wouldn't think this would be a problem in this case but I have had problems with this before. An easy way to check if this is a problem is to remove the "inline".
« Last Edit: February 28, 2015, 12:26:35 AM by matthey »
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #66 on: February 28, 2015, 04:58:13 PM »
Quote from: chris;785609
I think it's because "ULONG tags..." isn't a valid definition for a proper function.

I'm getting errors even when the #define is just:
Code: [Select]
({ \
})

"syntax error before ')'" and "unterminated argument list".

It's not possible to have all the arguments as varargs. Also, "ULONG tags ..." is not allowed with C99. C99 only allows "..." but the default GCC compile mode may have a GCCism extension which allows for better type checking. The NetSurf makefile sets C99 mode for compiling perhaps turning off the extension which allows "ULONG tags ..." and restricting varargs use to C99 "...". This would also mean that the os-includes are using GCCisms which are not compatible with C99 and possibly the reason for the tag list bugs. At least for your little test, you could try rewriting as C99 compliant varargs functions. There is more info here:

http://en.wikipedia.org/wiki/Variadic_function
http://en.wikipedia.org/wiki/Stdarg.h
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #67 on: March 01, 2015, 07:21:23 PM »
Quote from: chris;785676
I think it's fine for a #define, just not for a function, the two work differently.  If it wasn't then all the other varargs stub inlines would be broken too.

Most of the other inline defines are assigning registers to arguments which is like a more complete function definition. The NewObject() define is defining a complete function. It's confusing because they are both macros and using the pre-processor makes it more difficult to see what the result is. I still believe there is a small chance that the c99 strict mode (-std=c99) may disable some GCC specific functionality to better conform with the C99 spec. It might work with (-std=gnu99) but it would take some time to test.

Quote from: chris;785676
I've uploaded a version with the libraries built for 68020, to see whether that makes any speed difference.

The NetSurf archive I downloaded today is 3104254 bytes which is the same as the one I downloaded on February 23. The executable is also the same size.

Quote from: utri007;785695
This one seems to almost work with my Amigas. It started quite well until it stopped here :

That 1st attempt made it pretty far.

Quote from: utri007;785695
Few seconds more and computer crashes. Are those .otag fonts outlined fonts? Do I need to remove them?

The .otag files in FONTS: have some info but the main font data is in FONTS:_Bullet_Outlines. I have many outline fonts installed and everything is working for me. Since I have a working system, let's start by checking your library versions. I am using:

diskfont.library 45.7 (01/26/02)
bullet.library 44.1 (05/01/99)

If the libraries match, you might try creating a font directory somewhere, copying a subset of the fonts you are using now into it and doing an "ASSIGN FONTS: MYHD:fonts" and then use Sys:System/FixFonts. Rebooting should restore your previous FONTS: assignment. It's possible that some corrupt font data or definitions are causing a problem.
« Last Edit: March 01, 2015, 07:43:56 PM by matthey »
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #68 on: March 01, 2015, 08:58:39 PM »
Quote from: wawrzon;785701
... but maybe too big size may be an issue.


I wonder if the size could be an issue on low memory Amigas. Scalable font sizes have to be created when requested unless a size was created with SYS:System/Intellifont and already exists (creating sizes is an option for users with adequate HD space but not enough memory). I wonder how many scalable fonts are opened still with the mapping to bitmap fonts in Choices?
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #69 on: March 01, 2015, 11:39:32 PM »
Quote from: chris;785720
I've re-uploaded it.  Not sure what happened last time but it should be there now.

It's noticably faster here. NetSurf is done loading from icon in about 5 seconds and amiga.org loads in about 20 seconds. That's pretty good for not having optimizations enabled yet ;).

Edit: There are still some places that are quite slow and some that may get caught in an infinite loop. I am trying to debug what looks like an infinite loop after logging into amiga.org and when being redirected back to the old thread. I see scrollbar_create(), scrollbar_make_pair() and a realloc() that I believe may be in desktop/textarea.c textarea_reflow_multiline()? Did you fix the textarea_scrollbar_callback hook for scrollbar_create()? There are several callback hooks in this vacinity which might be worth looking over. I don't get any hits but I didn't last time there was a hook problem. No hits and no freezes makes for some tough debugging.

Edit2: I strongly believe that the infinite loop is the for loop in textarea_reflow_multiline() which starts with:

Code: [Select]
for (; len > 0; len -= b_off, text += b_off {

I can see the para_end string is "Reply" and no '\n' (newline) is found. I can't see a function name for nsfont.font_split() but there is a JSR. From there:

it looks like x is 0
(x <= h_extent) skip {}
(x <= avail_width) skip {}
(line <= ta-->lines_alloc_size - 2) skip {}
(para_end != text + b_off) skip {}
(len - b_off > 0) { for loop terminates with (space <= text) before first iteration skip {}, (space == text) skip }
(line > scroll_lines) but (ta->bar_y != NULL) skip the break;
back to the top of the for loop and repeat for infinity
« Last Edit: March 02, 2015, 06:25:13 AM by matthey »
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #70 on: August 17, 2015, 09:35:09 PM »
The new version of NetSurf works ok here after making the assign. My RTG results and improvement for friend_bitmap:1 match utri007's results. My system seems stable and my debug setup hasn't caught any MuForce hits or memory problems with loading amiga.org and scrolling around. Visually it looks like the last version with the gfx overwrite and fonts lacking proper spacing. The speed seems similar to the last version.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #71 on: August 18, 2015, 02:44:24 AM »
Quote from: Oldsmobile_Mike;794087
Not sure if this is helpful info or not, but I am using diskfont.library version 45.8 (08/30/2010), my ENVARC: font cache is enabled, and I have both FONTS:CGTriumvirate.otag (205 bytes) and FONTS:CGTriumvirate.font (4 bytes) installed.


You should be using diskfont.library 45.7 (01/26/02) which is 17536 bytes. Version 45.8 was unofficial and had some unresolved problems. Try using diskfont.library 45.7 and see if it fixes your problems.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #72 on: August 18, 2015, 05:04:54 PM »
Quote from: Oldsmobile_Mike;794168

Oh, and I should've mentioned file system!  This is exactly what I was thinking, only I was too busy rambling about other stuff to put it into words.  I'm running the latest version of PFS3-AIO from Aminet, and I would bet good money that NetSurf and PFS3 are not getting along.  That's why it "almost always" runs from RAM:, but crashes immediately when trying to run from disk.  If I were a detective, I'd say I think we found a clue.  ;)


I am also using PFS3 without problems. It doesn't help memory usage as more memory is required for buffers but it makes the font scanning much faster.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #73 on: August 18, 2015, 05:40:54 PM »
@chris
Rather than conditional preprocessor statements for the AISS assign under OS3, how about turning off requestors while accessing the assign?

Code: [Select]

ULONG req_off (void)
{
 /* Turn off AmigaDOS requestors. */

struct Process *myprocess;
APTR oldwindowptr;

myprocess =  (struct Process *)FindTask(NULL);
oldwindowptr = myprocess->pr_WindowPtr;
myprocess->pr_WindowPtr = (APTR) -1;
return (ULONG)oldwindowptr;
}

void req_on (ULONG oldwindowptr)
{
/* Turn AmigaDOS requestors back on. */

((struct Process *)FindTask(NULL))->pr_WindowPtr = (APTR)oldwindowptr;
}

...
ULONG oldwindowptr = req_off ();
if ((filehandle = fopen (filename, &quot;r&quot;)) == 0)
   fprintf (stderr, &quot;Warning: couldn't open %s\n&quot;, filename);
req_on (oldwindowptr);
...


Shouldn't this work under AmigaOS 4 also?
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: We need an iBrowse replacement for 68k!!!
« Reply #74 on: August 18, 2015, 08:11:33 PM »
Quote from: Oldsmobile_Mike;794183
Oh, looks like I spoke too soon about the images.  amiga.org gives them.  Well, sort of.  ;)


That is what most RTG users get without friend_bitmap:1 in Choices which gives an improvement. AGA/ECS seems to have problems with friend_bitmap:1 (interleaved bitmap problem?).

Quote from: Oldsmobile_Mike;794184
Unrelated side-note:  NetSurf does not seem to close cleanly.  After exiting the application, I am unable to delete the following files (screenshot attached).  Says they are still in use.  Obviously not a huge issue, but just FYI.  ;)


You wouldn't be able to delete the directory if this is where you assigned TBImages but you should be able to delete the files inside the directory.