18 October 2013, 01:40 | #61 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Quote:
Since HAM8 is an 8 bit mode, SDL AGA shouldn't know the difference, except that there are fewer palette colors available. After that, you simply use HAM8 render code to render images and what not, and blit that to the screen as normal. The only thing the browser needs to know is to only use the first 64 colors for the GUI instead of 256. Hypothetically Yes. The problem is that the moment you don't optimize the fixed palette rendering routine with tables, that you're going to get HAM8 rendering speeds, so that you may as well use that instead (even though that also uses a table). |
||
18 October 2013, 02:15 | #62 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
|
Arti once sent me his entire workspace but I still couldn't build it because he has his machine configured in a very strange way.
NetSurf is a massive project with lots of dependencies, it's really hard to get it to compile for 68k. |
18 October 2013, 02:37 | #63 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
And I thought Dopus 5.82 was hard to build (still can't) |
|
18 October 2013, 07:56 | #64 | |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
Quote:
|
|
18 October 2013, 09:16 | #65 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
|
|
18 October 2013, 09:52 | #66 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
|
18 October 2013, 10:00 | #67 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
|
18 October 2013, 10:33 | #68 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
Care to show any examples?
EDIT: And with examples I mean different colored texts on different colored backgrounds, without using the colors from 64 color palette. Last edited by britelite; 18 October 2013 at 10:38. |
18 October 2013, 11:05 | #69 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Perhaps, I'll see what I can do.
That's a little hard to control, because the HAM renderer I use (part of an open source viewer called V, by meynaf) will choose between palette colors and HAM colors automatically. |
18 October 2013, 11:11 | #70 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
Well, you could set the palette to all black, that way it won't use the palette in most cases. Another, more realistic, idea would be to set the palette to 64 shades of grey. I mainly want to see how well it handles different color combinations in HAM8.
|
18 October 2013, 12:03 | #71 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Anyway, you can try the algorithm with meynaf's picture viewer: http://meynaf.free.fr/pr/mv.lzx. Needs a 68020+ and AOS3. Supports JPG, PNG, BMP, IFF, GIF and some other formats. |
|
18 October 2013, 16:09 | #72 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
That pretty much was my point. Considering the web isn't black text on a white background anymore, you need to be able to map both text AND background to the fixed 64 color palette, or the text will get ugly pretty quick.
|
18 October 2013, 18:56 | #73 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Why don't you try the viewer with a bunch of screen grabs of web pages which you think the algorithm will screw up? Or, you could link to a few pages which you think will look crappy. |
|
18 October 2013, 23:06 | #74 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
To PeterK:
If you're interested, here's the 676 version of my render program: render24bit676.s. You can make the image brighter or darker by increasing or decreasing a2 before the outer loop in the code below. I managed to optimize the render loop further (discovered displacements are free): Code:
; ; render loop ; move.l #512-1,d7 ; image height .loopy move.l #640-1,d6 ; image width .loopx move.b (a0)+,d0 move.b (a2,d0.w,256*6.w),d1 move.b (a0)+,d0 add.b (a2,d0.w,256*3.w),d1 move.b (a0)+,d0 add.b (a2,d0.w),d1 sub.l d2,a2 move.b d1,(a1)+ ; dithering subq.l #1,d3 bge .l1 moveq #2,d3 add.l d4,a2 .l1 dbra d6,.loopx sub.l #640*6,a0 dbra d7,.loopy Last edited by Thorham; 18 October 2013 at 23:15. |
19 October 2013, 16:11 | #75 |
Registered User
Join Date: Jul 2008
Location: Poland
Posts: 662
|
Sorry I'm not posting anything but I don't have time atm. Maybe tommorrow.
|
20 October 2013, 07:50 | #76 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,374
|
Hello arti,
how far could you get with my C coding efforts? Please, ask me to explain anything that looks confusing. I've already found some small bugs and tried to optimize the code a bit by commenting out some lines which may not be required for Netsurf. The most important changes are here: Code:
nsfb_palette_generate_cube_676(struct nsfb_palette_s *palette); /* this call has to be used in the function set_palette(nsfb_t *nsfb) in sdl.c */ /* I'm not sure how this has to be handled to avoid the NetSurf dithering for my palette */ Code:
case NSFB_PALETTE_CUBE_676: // unused *r_error = 0; // unused *g_error = 0; // unused *b_error = 0; // optional if (c < 0x46000000) return 0; /* alpha < 70 gets pen 0 */ // optional if (!(c & 0xF8F8F8)) return 1; /*this color is black */ if (pushRGBlevel = ~pushRGBlevel) { /* push up every 2. pixel = primitive dithering */ if (((c & 0xFF) + 0x16) < 0x100) c += 0x16; if (((c & 0xFF00) + 0x1600) < 0x10000) c+= 0x1600; if (((c & 0xFF0000) + 0x160000) < 0x1000000) c+= 0x160000; } /* the following code can be replaced with Thorham's table later */ best_col = 4; dr = (c & 0xFF) - 0x35; while (dr >= 0) { best_col +=0x2A; dr -= 0x2B; } dg = ((c >> 8) & 0xFF) - 0x29; while (dg >= 0) { best_col +=6; dg -= 0x25; } db = ((c >> 16) & 0xFF) - 0x35; while (db >= 0) { best_col ++; db -= 0x2B; } /* Thorham's end will come here ;) */ if (best_col == 255) if (!(~(c | 0xFF070707))) return 2; /* this color is pure white */ break; It should be possible to merge my RGB level pushing code into the table by simply adding $16 extra entries for the color component saturation to each of the 3 subtables. So, this should result in a combined table (256 + 22) * 3 = 834 bytes. Last edited by PeterK; 20 October 2013 at 09:20. |
20 October 2013, 16:25 | #77 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
That's certainly possible. My routine already does that The tables are larger than they need to be for testing (fiddling with the dithering value).
|
20 October 2013, 17:11 | #78 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,374
|
Since my C coding knowledge is very poor, I just ask if somebody could port this simple table generating ASM code to C ?
Code:
/* DataConstantBlock.Byte count, data */ DCB.B 53, 4 DCB.B 43, 5 DCB.B 43, 6 DCB.B 43, 7 DCB.B 43, 8 DCB.B 53, 9 DCB.B 41, 0 DCB.B 37, 6 DCB.B 37, 12 DCB.B 37, 18 DCB.B 37, 24 DCB.B 37, 30 DCB.B 52, 36 DCB.B 53, 0 DCB.B 43, 42 DCB.B 43, 84 DCB.B 43, 126 DCB.B 43, 168 DCB.B 53, 210 generate_table_for_cube_676() { ???? } Last edited by PeterK; 20 October 2013 at 19:21. |
20 October 2013, 17:42 | #79 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
|
20 October 2013, 18:20 | #80 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
instead of
Code:
sub.l #640*6,a0 Code:
lea -640*6(A0),A0 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
NetSurf for AGA | arti | News | 92 | 14 March 2016 21:44 |
Optimizing question: instruction order | TheDarkCoder | Coders. Asm / Hardware | 9 | 29 October 2011 17:07 |
Layered tile engine optimizing. | Thorham | Coders. General | 0 | 30 September 2011 20:43 |
Benching and optimizing CF-IDE speed | Photon | support.Hardware | 12 | 15 July 2009 01:48 |
For people who like optimizing 680x0 code. | Thorham | Coders. General | 5 | 28 May 2008 11:48 |
|
|