From 9adba48b4500c397ec8f34aae7a5273e15ab1521 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Fri, 6 Nov 2009 21:21:02 +0000 Subject: [PATCH] - changes due to libsys changes Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@625 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/CPUs/MIPS/bsp/examples/life.c | 4 ++-- lib/CPUs/MIPS/bsp/examples/phrasen.c | 2 +- lib/CPUs/MIPS/bsp/examples/r3.c | 15 ++++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/CPUs/MIPS/bsp/examples/life.c b/lib/CPUs/MIPS/bsp/examples/life.c index 4da1708..a9ebd8f 100644 --- a/lib/CPUs/MIPS/bsp/examples/life.c +++ b/lib/CPUs/MIPS/bsp/examples/life.c @@ -188,7 +188,7 @@ void nextGeneration( int* matrix, int* future ) { void gx_init(void) { - volatile UINT32 *pVGA_mctrl = (UINT32*)sys_vga_mctrl; + volatile UINT32 *pVGA_ctrl = (UINT32*)sys_vga_ctrl; volatile UINT32 *pVGA_moffs = (UINT32*)sys_vga_moffs; sleep(500); @@ -197,7 +197,7 @@ void gx_init(void) memset(g_gx_buff, 0, SCREEN_X*SCREEN_Y*sizeof(UINT32)); printf("g_gx_buff : %8.8X\n", (UINT32)g_gx_buff); - *pVGA_mctrl = 1; + *pVGA_ctrl |= sys_vga_bit_msten; *pVGA_moffs = (UINT32)g_gx_buff; } diff --git a/lib/CPUs/MIPS/bsp/examples/phrasen.c b/lib/CPUs/MIPS/bsp/examples/phrasen.c index 8066ebd..08abf97 100644 --- a/lib/CPUs/MIPS/bsp/examples/phrasen.c +++ b/lib/CPUs/MIPS/bsp/examples/phrasen.c @@ -24,7 +24,7 @@ struct adjektive char getch(void) { - return readchar(); + return _getchar(); } void randomize(void) diff --git a/lib/CPUs/MIPS/bsp/examples/r3.c b/lib/CPUs/MIPS/bsp/examples/r3.c index 77eb757..81eadcc 100644 --- a/lib/CPUs/MIPS/bsp/examples/r3.c +++ b/lib/CPUs/MIPS/bsp/examples/r3.c @@ -419,7 +419,7 @@ do_pixels_in_line(x, y) #ifndef JMIPS_VGA printf("%c%c%c", R/An/An, G/An/An, B/An/An), #else - pP[x+800*y] = (R/An/An & 0xFF) | ((G/An/An & 0xFF) << 8) | ((B/An/An & 0xFF) << 16), + pP[x+xsize*y] = (R/An/An & 0xFF) | ((G/An/An & 0xFF) << 8) | ((B/An/An & 0xFF) << 16), #endif /* and then do the next pixel in this line: */ do_pixels_in_line(x+1, y) @@ -441,18 +441,23 @@ do_line(y) main() { #ifdef JMIPS_VGA - volatile UINT32 *pVGA_mctrl = (UINT32*)sys_vga_mctrl; + volatile UINT32 *pVGA_ctrl = (UINT32*)sys_vga_ctrl; volatile UINT32 *pVGA_moffs = (UINT32*)sys_vga_moffs; + volatile UINT32 *pVGA_resx = (UINT32*)sys_vga_resx; + volatile UINT32 *pVGA_resy = (UINT32*)sys_vga_resy; UINT64 *pPixelBuf; - pPixelBuf = (UINT64*)malloc(800*600*sizeof(UINT32)); + xsize = *pVGA_resx; + ysize = *pVGA_resy; + + pPixelBuf = (UINT64*)malloc(xsize*ysize*sizeof(UINT32)); pP = (UINT32*)pPixelBuf; printf("pPixelBuf : %8.8X\n", (UINT32)pPixelBuf); *pVGA_moffs = (UINT32)pPixelBuf; - *pVGA_mctrl = 1; + *pVGA_ctrl |= sys_vga_bit_msten; - memset(pPixelBuf, 0, 800*600*sizeof(UINT32)); + memset(pPixelBuf, 0, xsize*ysize*sizeof(UINT32)); #else /* Output PPM file header ... */