That does in fact work. What's still puzzling is I'm doing "almost"
exactly the same thing in my own code and that doesn't work. :).
Thanks once again for the help, time to pick my code apart line by
line and figure out my mistake.
--- In "PeterElliot" <> wrote:
>
> --- In "gamehoser" <james.singer1@> wrote:
> >
> > Alright, using this I whipped a quick test and I'm still having
> > trouble making it behave in a predictable fashion. The bus page
> > select bits seem to control what page is visible as I would expect
> > when the raster page bits are all 0, but when I set any of the
> raster
> > bits, it seems to ALSO affect what page is visible and I end up
> seeing
> > noise. Is there anywhere I can get a quick look at a double
> buffering
> > sample that works properly?
> >
>
> I use a macro define:
>
> #define SetDispBufNums(x,y) (0x300 |(x<<3) | y)
>
> Then I use:
>
> VGAregs[_vVIDCTRL] = SetDispBufNums(1,2);
>
> This selects screen 1 to view and 2 to edit (or was it the other way
> round;)
>
> Swapping the 1 and 2 will toggle displays. The values are 0..7.
>
> main(){
> int i;
> volatile unsigned short *VGAregs; // VGA Registers 16 Bit
> volatile unsigned short *fb; // Screen buffer 16 Bit
>
> /*--Map VGAregs-----------*/
> VGAregs = (unsigned short *)mmap(0, 4096, PROT_READ|PROT_WRITE,
> MAP_SHARED, mem_fd, 0x72000000);
> if (VGAregs == MAP_FAILED) { perror("mmap1:"); return 0; }
> VGAregs += (0x30/sizeof(unsigned short));
>
> /*--Map Framebuffer-----------*/
> fb = (unsigned short *)mmap(0, _scrW*_scrH*2, PROT_READ|PROT_WRITE,
> MAP_SHARED, mem_fd, 0x72200000);
> if (fb == MAP_FAILED) { perror("mmap2:"); return 0; }
>
> VGAregs[_vVIDCTRL] = SetDispBufNums(1,2);
> for (i=0; i<(640*480); i++) fb[i]=0xF800; // Fill Red
> sleep(1);
> VGAregs[_vVIDCTRL] = SetDispBufNums(2,1); // Display Red
> for (i=0; i<(640*480); i++) fb[i]=0x07C0; // Fill Green
> sleep(1);
> VGAregs[_vVIDCTRL] = SetDispBufNums(1,2); // Display Green
> sleep(1);
> VGAregs[_vVIDCTRL] = SetDispBufNums(2,1); // Display Red
> sleep(1);
> VGAregs[_vVIDCTRL] = SetDispBufNums(1,2); // Display Green
> }
>
> I don't have my TS-7300 with me to test it...
>
> Hope this helps.
>
> PJE
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|