foo
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 3 Sep 2019 19:55:23 +0000 (22:55 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 3 Sep 2019 19:55:23 +0000 (22:55 +0300)
src/census/3dgfx.h
src/census/census.c
src/config.h
src/kmain.c
src/libc/unistd.c
src/libc/unistd.h

index 89b28d8..0ae58c9 100644 (file)
@@ -26,7 +26,7 @@ enum {
        G3D_LIGHT1              = 0x000010,
        G3D_LIGHT2              = 0x000020,
        G3D_LIGHT3              = 0x000040,
-       G3D_TEXTURE_2D  = 0x000080,     /* XXX doesn't affect anything, use g3d_polygon_mode */
+       G3D_TEXTURE_2D  = 0x000080,
        G3D_BLEND               = 0x000100,
        G3D_TEXTURE_GEN = 0x000200,
        G3D_CLIP_FRUSTUM = 0x000800,/* when disabled, don't clip against the frustum */
index 724ab2a..7eea8d3 100644 (file)
@@ -45,7 +45,7 @@ void draw_census(void)
        float a[2], b[2], dt;
        float anim, alpha, center_alpha;
 
-       memset(fb_pixels, 0, fb_width * fb_height * 4);
+       memset(fb_pixels, 0x11, fb_width * fb_height * 4);
 
        anim = fmod(t / 6.0f, LOOPTIME);
        alpha = 1.0f - ((anim - (LOOPTIME - 0.075)) / 0.06f);
index 58a6147..f444b95 100644 (file)
@@ -24,4 +24,9 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #define CON_TEXTMODE
 #define CON_SERIAL
 
+#define MOVE_STACK_RAMTOP
+/* allocate 64k for stack */
+#define STACK_PAGES            16
+
+
 #endif /* PCBOOT_CONFIG_H_ */
index 99104a2..bcd8a91 100644 (file)
@@ -18,6 +18,7 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#include <unistd.h>
 #include "segm.h"
 #include "intr.h"
 #include "mem.h"
@@ -119,10 +120,11 @@ static int video_init(void)
                qsort(vmodes, nmodes, sizeof *vmodes, modecmp);
 
                for(i=0; i<nmodes; i++) {
+                       printf("trying video mode: %x (%dx%d %dbpp)\n", vmodes[i].mode, vmodes[i].width,
+                                       vmodes[i].height, vmodes[i].bpp);
+                       usleep(5000000);
                        if((fbptr = set_video_mode(vmodes[i].mode))) {
                                vmode = vmodes[i];
-                               printf("video mode: %x (%dx%d %dbpp)\n", vmode.mode, vmode.width,
-                                               vmode.height, vmode.bpp);
                                break;
                        }
                }
index 1fc0542..7da132f 100644 (file)
@@ -19,6 +19,8 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #include <errno.h>
 #include "unistd.h"
 #include "fs.h"
+#include "timer.h"
+#include "asmops.h"
 
 int chdir(const char *path)
 {
@@ -59,3 +61,13 @@ int rmdir(const char *path)
        fs_close(fsn);
        return 0;
 }
+
+int usleep(unsigned long usec)
+{
+       unsigned long wait_ticks = MSEC_TO_TICKS(usec / 1000ul);
+       unsigned long start_ticks = nticks;
+       while(nticks - start_ticks < wait_ticks) {
+               halt_cpu();
+       }
+       return 0;
+}
index 1ed4cf2..63651c3 100644 (file)
@@ -24,4 +24,6 @@ char *getcwd(char *buf, int sz);
 int mkdir(const char *path, int mode);
 int rmdir(const char *path);
 
+int usleep(unsigned long usec);
+
 #endif /* UNISTD_H_ */