Re: ememcopy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Noah Smith wrote:
> sequence virtualmonitor
> virtualmonitor = {{},{}}
> wt = 1023 ht = 767
> virtualmonitor[1] = {wt, ht}
> virtualmonitor[2] = allocate(wt*ht)
> display_svga_image(1, virtualmonitor[2], {wt,ht}, {0,0})

Try this instead:
------begin code (sorry, untested)

constant Width =1024, Height=768
constant MaxX  =1023, MaxY  =767
constant Origin={0,0}
object VirtScr
       VirtScr =allocate(Width*Height)

--option 1
--(this *should* be the correct one, mapping 0..1023,0..767)
--(but it depends on the coder of disp_svga_img, a matter of style)
display_svga_image(1, VirtScr, {MaxX,MaxY},    Origin)

--option 2
--(but it could be this one... mapping 1024 x 768 'positions')
display_svga_image(1, VirtScr, {Width,Height}, Origin)

------end code
Now, either option1 or option2 should in theory work,
and work correctly.
The documentation for display_svga_image is a little
vague as to that 3rd argument, and reading the function
didn't help much either.
Please humor an old fart and try them both.
The biggest difference between your
version and mine, is the allocate line.
From the descriptions of your errors/screwed
screens, it sounds like your indexing/indices
are defn'ly off by 1, and the result of that
is that in your allocate line you aren't reserving
enough "locations" to store pixel data in.
This would also account for the skewed screens, as
you will get a wrap-around effect.

Hopefully, my analysis and solution are actually correct.
Hopefully, my analysis and solution are actually helpful.
    :)

--Hawke'

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu