Archived

This topic is now archived and is closed to further replies.

Asia

old mode13h , mmx, ...

Recommended Posts

Hi, I have readed that with mmx you can put 4 pixels at the same time in a mode with byte colors, I ask you how I can do this in mode13h, some ideas, and/or in another linear framebuffer mode like ddraw ... Mi another question is, when you are in mode13h, if you dont use a putpixel function, only vga[offset] = color (offset [0,64000]), how you can know if you are writing outside the screen?, because when I write out, the program hangs up or do strange things.

Share this post


Link to post
Share on other sites
It''s simple, you dont You just have to be careful and not draw outside the buffer. On another note, you might want to consider not using putpixel as it''s ver slow ^_^.

Share this post


Link to post
Share on other sites
Actually, the MMX registers are 64 bits, meaning that you can place 8 mode13h pixels into a register, as mode 13h uses 8-bit palettized pixels. Clipping must be done somewhere in software as mode 13h only provides a frame-buffer and pallete. just reject pixels (x < 0:x > 319 | y < 0:y > 199).

Always good to hear a post about programming "to the metal" as they say. I loved hacking around with 13h, good luck to you.

Ravyne, NYN Interactive Entertainment
[My Site][My School][My Group]

Share this post


Link to post
Share on other sites
Thanks for the answers.

Now, I have get successfull put 8 pixels at the same time with mmx, clear the screen in very fast, too much, althougt I wait vertical retrace, it is still too fast.

I check if offset is < 0 or > 64000 as you said, but if you are doing a smooth of all screen, doing the average of the eight pixels around the current pixel, how you avoid reading pixels out of screen, for example when you smooth pixel 0,0 or 100,0 ...

Share this post


Link to post
Share on other sites