Skip to content

Commit

Permalink
Fixed a keyboard handling bug. Added multiple screenmode support to m…
Browse files Browse the repository at this point in the history
…ain demo. (No attempt to adjust what's displayed, however.)
  • Loading branch information
Alastair M. Robinson committed May 3, 2014
1 parent b98265f commit 5423629
Show file tree
Hide file tree
Showing 14 changed files with 3,510 additions and 3,696 deletions.
38 changes: 37 additions & 1 deletion Apps/Demo/main.c
Expand Up @@ -294,7 +294,7 @@ int main(int argc,char *argv)
AddMemory();

PS2Init();
SetSprite();
VGA_SetSprite();

FrameBuffer=(short *)malloc(sizeof(short)*640*960+15);
FrameBuffer=(short *)(((int)FrameBuffer+15)&~15); // Align to nearest 16 byte boundary.
Expand Down Expand Up @@ -329,21 +329,57 @@ int main(int argc,char *argv)
{
mainstate=MAIN_LOAD;
puts("Switching to image mode\n");
while(TestKey(KEY_F1))
;
}
if(TestKey(KEY_F2))
{
mainstate=MAIN_MEMCHECK;
puts("Switching to Memcheck mode\n");
while(TestKey(KEY_F2))
;
}
if(TestKey(KEY_F3))
{
mainstate=MAIN_RECTANGLES;
puts("Switching to Rectangles mode\n");
while(TestKey(KEY_F3))
;
}
if(TestKey(KEY_F4))
{
mainstate=MAIN_DHRYSTONE;
puts("Switching to image mode\n");
while(TestKey(KEY_F4))
;
}
if(TestKey(KEY_F5))
{
puts("640 x 480\n");
VGA_SetScreenMode(MODE_640_480);
while(TestKey(KEY_F5))
;
}
if(TestKey(KEY_F6))
{
puts("320 x 480\n");
VGA_SetScreenMode(MODE_320_480);
while(TestKey(KEY_F6))
;
}
if(TestKey(KEY_F7))
{
puts("800 x 600\n");
VGA_SetScreenMode(MODE_800_600);
while(TestKey(KEY_F7))
;
}
if(TestKey(KEY_F8))
{
puts("768 x 576\n");
VGA_SetScreenMode(MODE_768_576);
while(TestKey(KEY_F8))
;
}

// Main loop iteration.
Expand Down

0 comments on commit 5423629

Please sign in to comment.