cleaned code

This commit is contained in:
aramya 2022-01-01 21:23:00 +01:00
parent 60480adc08
commit 077daf4ea3
4 changed files with 18 additions and 15 deletions

View File

@ -134,11 +134,3 @@ void memcpy(unsigned char* dest, unsigned char* src, int n)
}
}
unsigned char u8_extract_bit(unsigned char n, unsigned char bit)
{
return (n & (0b10000000 >> bit)) >> (7 - bit);
}
unsigned char u32_extract_bit(unsigned int n, unsigned char bit)
{
return (n & (0x80000000 >> bit)) >> (31 - bit);
}

View File

@ -3,7 +3,7 @@
#define __VRAM__BEIGE 0x80000000
#define __BIOS__BEIGE 0xFFC00000
#define __TIMR__BEIGE 0x81080038
#define __TIMR__BEIGE 0 //
#define __VRAM__MAC99 0x81000000
#define __BIOS__MAC99 0xFFF00000
#define __TIMR__MAC99 0x80080038

View File

@ -1,3 +1,5 @@
.globl _start
_start:
stwu 1, -0x7fff(1)
b main

View File

@ -1,4 +1,5 @@
." powerpc-ofw-boot : Booting through OpenFirmware..." cr
\ storing 0xBE for beige, 0x5A for mac99
\ cannot use superior, inferior, different symbols (bootinfo.txt)
: sup - dup abs = ;
@ -6,12 +7,17 @@
: diff = if 0 else -1 then ;
: fba frame-buffer-adr ;
: beige-vram 80000000 ; : mac99-vram 81000000 ;
: hardware-error ." Hardware not supported." ;
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
: hardware-error ." Hardware not supported." cr ;
: beige-message ." Beige hardware detected" cr ;
: mac99-message ." mac99 hardware detected" cr ;
: beige-magic-number 0BE ;
: mac99-magic-number 05A ;
: magic-number-offset 0 ;
: width-offset 4 ;
: height-offset 8 ;
fba beige-vram = if beige-message beige-magic-number beige-vram c! then
fba mac99-vram = if mac99-message mac99-magic-number mac99-vram c! then
fba beige-vram = if screen-width 4 beige-vram + l! then
fba beige-vram = if screen-height 8 beige-vram + l! then
@ -19,9 +25,12 @@ fba beige-vram = if screen-height 8 beige-vram + l! then
fba mac99-vram = if screen-width 4 mac99-vram + l! then
fba mac99-vram = if screen-height 8 mac99-vram + l! then
." informations stored :" cr
fba a dump
variable run
-1 run !
fba beige-vram diff fba mac99-vram diff and if hardware-error cr 0 run ! then
fba beige-vram diff fba mac99-vram diff and if hardware-error 0 run ! then
run @ 0 = if 1 0 do 0 +loop then
." Running Game of Life: " cr
boot hd:,\boot\kernel.elf