game of life
This commit is contained in:
parent
82a2c992d9
commit
4fcb9e842f
3
Makefile
3
Makefile
|
@ -27,6 +27,9 @@ clean:
|
|||
rm *.APM *elf *txt
|
||||
run:
|
||||
$(QEMU) -hda *.APM -g $(RES) -machine $(MACHINE)
|
||||
beige:
|
||||
$(QEMU) -hda *.APM -g $(RES) -machine g3beige
|
||||
|
||||
debug:
|
||||
$(QEMU) -hda *.APM -d in_asm -g $(RES) -machine $(MACHINE)
|
||||
all:
|
||||
|
|
22
entry/boot.c
22
entry/boot.c
|
@ -42,20 +42,32 @@ void main(void)
|
|||
unsigned int random;
|
||||
unsigned char universe[N][N];
|
||||
unsigned char universe2[N][N];
|
||||
unsigned char* junk_beige = 0x81040000;
|
||||
for (i = 0; i < N; i++) for (j = 0; j < N; j++)
|
||||
{
|
||||
random = (*p_timer );
|
||||
if (!(random%3)) universe[i][j] = 1;
|
||||
else universe[i][j] = 0;
|
||||
p_bios++;
|
||||
if (IO_TYPE == mac99)
|
||||
{
|
||||
random = (*p_bios );
|
||||
if (!(random%3)) universe[i][j] = 1;
|
||||
else universe[i][j] = 0;
|
||||
p_bios++;
|
||||
}
|
||||
else if (IO_TYPE == beige)
|
||||
{
|
||||
random = (*junk_beige);
|
||||
if (!(random%3)) universe[i][j] = 1;
|
||||
else universe[i][j] = 0;
|
||||
junk_beige++;
|
||||
}
|
||||
}
|
||||
for(;;)
|
||||
{
|
||||
init();
|
||||
p_vram += 100000*4;
|
||||
for (i = 0; i < N; i++) for (j = 0; j < N; j++)
|
||||
{
|
||||
if (universe[i][j]) fillscreen(p_vram, 255,255,255,1);
|
||||
else fillscreen(p_vram,200 ,110,50,1);
|
||||
else fillscreen(p_vram,200 ,210,5,1);
|
||||
p_vram+=4;
|
||||
}
|
||||
for (i = 0; i < N; i++) for (j = 0; j < N; j++) universe2[i][j] = universe[i][j];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#define __VRAM__BEIGE 0x80000000
|
||||
#define __BIOS__BEIGE 0xFFC00000
|
||||
#define __TIMR__BEIGE 0x1badc0de //later
|
||||
#define __TIMR__BEIGE 0x81080038
|
||||
#define __VRAM__MAC99 0x81000000
|
||||
#define __BIOS__MAC99 0xFFF00000
|
||||
#define __TIMR__MAC99 0x80080038
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
fba beige-vram = if ." Beige hardware detected" cr 0BE beige-vram c! then
|
||||
fba mac99-vram = if ." mac99 hardware detected" cr 05A mac99-vram c! then
|
||||
|
||||
." Running Game of Life: " cr
|
||||
|
||||
|
||||
fba beige-vram = if screen-width 4 beige-vram + l! then
|
||||
fba beige-vram = if screen-height 8 beige-vram + l! then
|
||||
|
||||
|
|
Loading…
Reference in New Issue