Skip to content

Commit

Permalink
Rewrote standard bios to use the standard library headers
Browse files Browse the repository at this point in the history
  • Loading branch information
vircon32 committed Aug 1, 2022
1 parent 6354d61 commit 866127f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 507 deletions.
36 changes: 23 additions & 13 deletions Bios/StandardBios/StandardBios.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// include local headers
#include "headers/bios-audio.h"
#include "headers/bios-video.h"
#include "headers/bios-time.h"
#include "headers/bios-string.h"
#include "headers/bios-misc.h"
// include Vircon libraries
#include "audio.h"
#include "video.h"
#include "time.h"
#include "string.h"
#include "misc.h"

// main regions
#define first_region_font 0
Expand Down Expand Up @@ -39,7 +39,7 @@ void draw_message_screen( int* title, int* message )

// write title
set_multiply_color( error_colors_title );
print( 49, 37, title );
print_at( 49, 37, title );

// draw horizontal line
select_region( region_white_square );
Expand All @@ -49,7 +49,7 @@ void draw_message_screen( int* title, int* message )

// write message
set_multiply_color( error_colors_message );
print( 49, 95, message );
print_at( 49, 95, message );
}

// ---------------------------------------------------------
Expand All @@ -58,7 +58,7 @@ void print_hex_value( int x, int y, int* name, int value )
{
// convert the number to hex
int[ 10 ] hex_string;
itoa16( value, hex_string );
itoa( value, hex_string, 16 );

// join all text parts
int[ 60 ] text;
Expand All @@ -67,7 +67,17 @@ void print_hex_value( int x, int y, int* name, int value )
strcat( text, hex_string );

// print the text
print( x, y, text );
print_at( x, y, text );
}

// ---------------------------------------------------------

bool cartridge_connected()
{
asm
{
"in R0, CAR_Connected"
}
}

// ---------------------------------------------------------
Expand Down Expand Up @@ -276,7 +286,7 @@ void main( void )
select_texture( -1 );

// all characters of the text font
define_region_matrix( first_region_font, 1,22, 10,20, 32,8, 0 );
define_region_matrix( first_region_font, 1,22, 10,41, 1,22, 32,8, 0 );

// logo letters
select_region( region_logo_letters );
Expand Down Expand Up @@ -453,9 +463,9 @@ void main( void )
exit();
}

// restore any parameters we used to default
// ensure that any video parameters we might have used
// are restored to their expected defaults at startup
set_multiply_color( color_white );
clear_screen( color_black );
select_region( 0 );

// jump to first position in cartridge program rom
Expand Down
26 changes: 0 additions & 26 deletions Bios/StandardBios/headers/bios-audio.h

This file was deleted.

28 changes: 0 additions & 28 deletions Bios/StandardBios/headers/bios-misc.h

This file was deleted.

164 changes: 0 additions & 164 deletions Bios/StandardBios/headers/bios-string.h

This file was deleted.

40 changes: 0 additions & 40 deletions Bios/StandardBios/headers/bios-time.h

This file was deleted.

Loading

0 comments on commit 866127f

Please sign in to comment.