Re: Euphoria is 3 to 30 times faster than DJGPP! (warning! C code
- Posted by Euman <euman at BELLSOUTH.NET> Jan 09, 2001
- 530 views
Mode 13 is so outdated, who still uses this for games or graphics? I tried to use some old stuff that Pete Eberlein wrote to get faster graphics. maybe this only works well with Euphoria 1.5 prior, I'm not sure. modified for 1024x768 </snip> global integer bank_start sequence regs, dummy integer bytes_per_line, bank_granularity bytes_per_line = 1024 bank_granularity = 65536 regs = repeat(0, 10) regs[REG_AX] = #4F05 regs[REG_BX] = #0000 global procedure pixel(object data, sequence p) integer offset, len len = length(data) offset = p[2] * bytes_per_line + p[1] if offset < bank_start or offset + len > bank_start + 65536 then regs[REG_DX] = floor(offset / bank_granularity) dummy = dos_interrupt(#10, regs) bank_start = regs[REG_DX] * bank_granularity end if poke(#A0000 + offset - bank_start, data) end procedure global function get_pixel(sequence p) integer offset offset = p[2] * bytes_per_line + p[1] if offset < bank_start or offset + p[3] > bank_start + 65536 then regs[REG_DX] = floor(offset / bank_granularity) dummy = dos_interrupt(#10, regs) bank_start = regs[REG_DX] * bank_granularity end if return peek({#A0000 + offset - bank_start, p[3]}) end function <snip\> I couldnt figure out why the top half of the screen when useing mouse routines\ made the mouse do strange things. Even Mighty with it's redefined pixel / getpixel had the same effects. NEIL (ha) Only one of the examples will run on either of my machines because I like the rest of the potential customers in the world dont run a supercharged \ system i.e Fancy Graphics Card. I also found VESA.E that (ha) doesnt like certain modes either so, I gave up on that too. I wish I had a dime for every scratch of my head that I tried to get fast graphics in Dos under Euphoria and am delighted now that the DJGPP translator uses Allegro and can achieve by a factor of 6 (per Robert) faster screen writes than the Watcom graphics lib. I'm finally happy. eum