On 7/15/06, Patrick McNamara <[EMAIL PROTECTED]> wrote:
binary code, or uploads it. Below is a small example snippit that
represents the scanline routine from the code I posted earlier.
program[offset++]=asm_wait((hfp/4)-1, NULL);
program[offset++]=asm_inc(fb_offset, HSYNC);
program[offset++]=asm_wait(hsync-1, HSYNC | XRESET);
program[offset++]=asm_wait((hfp/4)-1, NULL);
program[offset++]=asm_fetch(vp_width, NULL);
program[offset++]=asm_send(vp_width, DATA_VALID | RETURN);
Where asm_wait(), wait for example looked something like this:
unsigned int asm_wait(unsigned int delay, unsigned char flags) {
unsigned int opcode=0;
opcode|=flags << 24;
opcode|=0x00E00000 & (ASM_WAIT_OP << 21);
opcode|=((2049 - delay) & 7FF) << 9;
return(opcode);
}
That looks good, although we would traditionally do that with macros.
In this case, I think it's better because there are lots of repeated
opcodes, so that would cause lots of repeated macros, so the functons
(only 7 of them) are better.
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)