home .. forth .. colorforth mail list archive ..

Re: [colorforth] Setting a pixel on the screen


...And that's not right because ! stores a double word and I only want a word (16 bit colour).

Block 34 (icons) has !w which stores a 16 bit word to a byte address. That's what I need instead of 2/ 2/ !

Also, on http://www.colorforth.com/forth.html it is stated "Data are addressed as 32-bit words, not bytes." I'm not fully clear on how this works so I need to look harder.

Jason Kemp said the following on 28/05/2008 11:27:
Hi Ray,

Thanks for all the encouragement. I cracked it on Friday and was intending to reply, but I'm trying not to touch the computer over the weekends now and Monday was a bank holiday too!

: pixel show black screen ffff 400 400 1024 * + 2* 1e80000 + 2/ 2/ ! keyboard ;

It needs a 2/ 2/ because ! multiplies the address it is given by 4. This must be something to do with addressing doublewords as opposed to bytes--I'm sure it's something quite obvious to most but it's taking me a long time to build up a picture of what's going on here. Are addresses in colorforth stored as the count of doublewords rather than a true address?

Jason




Ray St. Marie said the following on 27/05/2008 20:23:
rethinking my previous post to this question...
Hi Jason,
Ray here

On Tue, May 20, 2008 at 4:41 PM, Jason Kemp <jason.kemp@xxxxxxxxxxxxxxxx> wrote:
Good evening all,

I have been attempting to set a pixel on the screen to white. Please show
me what I am doing wrong:

: ohno show black screen ffff 400 400 1024 * + 2* 1e80000 + ! keyboard ;> Only the ffff and the 1e80000 are in hex. The screen is 1024x768, 16-bit,
VESA 117h.

Thanks,
Jason


Jason, have you tried the word color after ffff, to set the color, as in...

: ohno show black screen ffff COLOR 400 400 1024 * + 2* 1e80000 + ! keyboard ;

I happened to be looking in an old source and reading the word SWITCH.
In the top of the word we see an example of writeing to AGP before
switching to keyboard.

Karig has a nice look at it :

http://www.karig.net/os/cf/g.htm

Halfway down the page. All of the rest of that page are examples of
'emit'ing pixels to the page.

Good luck with this, Jason. Please keep me in the loop, your
experiments, as I'd like to try them out as well. :-)

All the best,
Ray



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com





---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com