mirror of
https://github.com/thamugadi/powerpc-ofw-boot.git
synced 2024-06-14 13:29:56 +00:00
gol function
This commit is contained in:
parent
83cd3382d7
commit
ec096b36f3
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
*.elf
|
*.elf
|
||||||
|
*.bin
|
||||||
DISK.APM
|
DISK.APM
|
||||||
*.txt
|
*.txt
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
MACHINE=mac99
|
MACHINE=mac99
|
||||||
PPC=powerpc-linux-gnu
|
PPC=powerpc-eabi
|
||||||
QEMU=qemu-system-ppc
|
QEMU=qemu-system-ppc
|
||||||
RES=1600x900x32
|
RES=1600x900x32
|
||||||
DISK.APM: kernel.elf bootinfo.txt scripts/kpartx.sh
|
DISK.APM: kernel.elf bootinfo.txt scripts/kpartx.sh
|
||||||
|
|
63
entry/boot.c
63
entry/boot.c
|
@ -1,5 +1,6 @@
|
||||||
#include "boot.h"
|
#include "boot.h"
|
||||||
void __stack_chk_fail_local(void){}
|
void __stack_chk_fail_local(void){}
|
||||||
|
void __eabi(void){}
|
||||||
void get_io_type(void)
|
void get_io_type(void)
|
||||||
{
|
{
|
||||||
if (*(unsigned char*)__VRAM__BEIGE == beige) IO_TYPE = beige;
|
if (*(unsigned char*)__VRAM__BEIGE == beige) IO_TYPE = beige;
|
||||||
|
@ -36,6 +37,39 @@ void main(void)
|
||||||
{
|
{
|
||||||
get_io_type();
|
get_io_type();
|
||||||
init();
|
init();
|
||||||
|
game_of_life();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fillscreen(unsigned int* addr, unsigned char a, unsigned char b, unsigned char c, int n)
|
||||||
|
{
|
||||||
|
unsigned char* ptr = addr;
|
||||||
|
for (unsigned int i = 0; i<n; i++)
|
||||||
|
{
|
||||||
|
//24-bit VGA
|
||||||
|
*ptr = a;
|
||||||
|
ptr++;
|
||||||
|
*ptr = b;
|
||||||
|
ptr++;
|
||||||
|
*ptr = c;
|
||||||
|
ptr++;
|
||||||
|
*ptr = 0;
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void memcpy(unsigned char* dest, unsigned char* src, int n)
|
||||||
|
{
|
||||||
|
unsigned char* destination = dest;
|
||||||
|
unsigned char* source = src;
|
||||||
|
for (int i = 0; i<n; i++)
|
||||||
|
{
|
||||||
|
*destination = *source;
|
||||||
|
destination++; source++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void game_of_life(void)
|
||||||
|
{
|
||||||
int N = screen_width;
|
int N = screen_width;
|
||||||
int i,j,ip1,jp1,nei;
|
int i,j,ip1,jp1,nei;
|
||||||
unsigned int random;
|
unsigned int random;
|
||||||
|
@ -105,32 +139,3 @@ void main(void)
|
||||||
for (i = 0; i < N; i++) for (j = 0; j < N; j++) universe[i][j] = universe2[i][j];
|
for (i = 0; i < N; i++) for (j = 0; j < N; j++) universe[i][j] = universe2[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fillscreen(unsigned int* addr, unsigned char a, unsigned char b, unsigned char c, int n)
|
|
||||||
{
|
|
||||||
unsigned char* ptr = addr;
|
|
||||||
for (unsigned int i = 0; i<n; i++)
|
|
||||||
{
|
|
||||||
//24-bit VGA
|
|
||||||
*ptr = a;
|
|
||||||
ptr++;
|
|
||||||
*ptr = b;
|
|
||||||
ptr++;
|
|
||||||
*ptr = c;
|
|
||||||
ptr++;
|
|
||||||
*ptr = 0;
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void memcpy(unsigned char* dest, unsigned char* src, int n)
|
|
||||||
{
|
|
||||||
unsigned char* destination = dest;
|
|
||||||
unsigned char* source = src;
|
|
||||||
for (int i = 0; i<n; i++)
|
|
||||||
{
|
|
||||||
*destination = *source;
|
|
||||||
destination++; source++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user