summaryrefslogtreecommitdiff
path: root/hardware.c
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2013-11-15 19:59:19 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2013-11-15 19:59:19 +0100
commit5d4a70f81d1896ede119e0dfe42392c4506a2a34 (patch)
tree3107dfb277c97421d91b5b94f397c93f1a2f359e /hardware.c
parent677385ffdd1e330cfba4dd712ca58595feeea41d (diff)
downloadfx-maze-5d4a70f81d1896ede119e0dfe42392c4506a2a34.tar.gz
fx-maze-5d4a70f81d1896ede119e0dfe42392c4506a2a34.zip
added comments
Diffstat (limited to 'hardware.c')
-rw-r--r--hardware.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hardware.c b/hardware.c
index 846a390..9f56847 100644
--- a/hardware.c
+++ b/hardware.c
@@ -1,8 +1,15 @@
+// Thanks to SimonLothar, cfxm and all the other hackers!
+
#include "global.h"
#include "hardware.h"
+// here are some functions for direct hardware access
+// they are splitted to support different calculators
+
char *vram, *vram2;
+// backlight funcions: on, off, switch, check
+// if it's unknown hardware we should do nothing
void BacklightOn()
{
if(!IsEmulator)
@@ -59,6 +66,7 @@ int BacklightIsOn()
}
}
+// change contrast only for known calcs
void set_contrast(int contrast)
{
if(!getCalc() == UNKNOWN && !IsEmulator)
@@ -69,6 +77,7 @@ void set_contrast(int contrast)
}
}
+// update the display, if secure; otherwise use syscalls (sloooow!)
void display_vram()
{
if(getCalc() == UNKNOWN && !IsEmulator)
@@ -92,6 +101,7 @@ void display_vram()
}
}
+// clear video ram
void clear_vram()
{
int i, end;
@@ -108,6 +118,7 @@ void clear_vram()
for(i=0 ; i<end ; i++) pointer_byte[i] = 0;
}
+// if possible, let it restart after going to the main menu
short*APP_EnableRestart()
{
if(getCalc() != UNKNOWN && !IsEmulator)
@@ -135,6 +146,7 @@ short*APP_EnableRestart()
return NULL;
}
+// return the model
int getCalc(void)
{
static int hardware = UNKNOWN;