#include <stdio.h>
#include <stdlib.h>
#include "pmac.h"
Include dependency graph for dinit.c:
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
|
Definition at line 6 of file dinit.c. 00007 { 00008 int t; 00009 unsigned char ic, nc; 00010 unsigned char *c; 00011 00012 /* get DP RAM */ 00013 pmac_init(); 00014 00015 /* test it */ 00016 c = (unsigned char *) pmac; 00017 ic = *c; 00018 nc = ic+1; 00019 *c = nc; 00020 if (*c != nc) 00021 { 00022 printf("bad write test\n"); 00023 pmac_exit(); 00024 exit(1); 00025 } 00026 00027 printf("writing it..."); 00028 for (t = 0; t < 0x4000; t++) 00029 ((char *) pmac)[t] = t%256; 00030 printf("done\n"); 00031 00032 printf("hit CR to read it..."); 00033 getchar(); 00034 00035 printf("reading it..."); 00036 for (t = 0; t < 0x4000; t++) 00037 { 00038 char c = ((char *) pmac)[t]; 00039 printf("%d ", (int) c); 00040 } 00041 00042 pmac_exit(); 00043 00044 exit(0); 00045 } |