Commit 08312415 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Base start on Display using system calls and framebuffer properties.

parent 5e386595
......@@ -11,8 +11,6 @@
package javax.microedition.lcdui;
import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.event.EventTranslate;
import cc.squirreljme.runtime.lcdui.event.KeyNames;
......@@ -615,6 +613,8 @@ public abstract class Canvas
return;
// Depends on the action
throw new todo.TODO();
/*
switch (__type)
{
case NativeDisplayEventCallback.KEY_PRESSED:
......@@ -631,7 +631,7 @@ public abstract class Canvas
default:
break;
}
}*/
}
/**
......
......@@ -12,10 +12,9 @@ package javax.microedition.lcdui;
import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.DeviceFeedbackType;
import cc.squirreljme.jvm.FramebufferProperty;
import cc.squirreljme.jvm.SystemCallError;
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.common.CommonMetrics;
import cc.squirreljme.runtime.lcdui.DisplayOrientation;
......@@ -1311,8 +1310,12 @@ public class Display
Map<Integer, Display> displays = Display._DISPLAYS;
synchronized (displays)
{
// Map all displays
int numdisplays = NativeDisplayAccess.numDisplays();
// Try to obtain the address of the framebuffer
int fbaddr = Assembly.sysCallV(SystemCallIndex.
FRAMEBUFFER_PROPERTY, FramebufferProperty.ADDRESS);
// There is only a single display if a framebuffer is supported
int numdisplays = (fbaddr != 0 ? 1 : 0);
for (int i = 0; i < numdisplays; i++)
rv.add(Display.__mapDisplay(i));
}
......
......@@ -10,7 +10,6 @@
package javax.microedition.lcdui;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.lcdui.phoneui.ExposedDisplayable;
import cc.squirreljme.runtime.lcdui.SerializedEvent;
import cc.squirreljme.runtime.midlet.ActiveMidlet;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment