Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
6e97feb5
Commit
6e97feb5
authored
Feb 28, 2022
by
Stephanie Gawroriski
Browse files
Implement getColorOfName(); Add base entry for StarApplication.
parent
81a16943
Pipeline
#90168
passed with stages
in 6 minutes and 45 seconds
Changes
11
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/launch/IModeApplication.java
View file @
6e97feb5
...
...
@@ -42,6 +42,10 @@ public class IModeApplication
public
static
final
String
VENDOR_PROPERTY
=
"cc.squirreljme.imode.vendor"
;
/** The prefix for ADF properties. */
public
static
final
String
ADF_PROPERTY_PREFIX
=
"cc.squirrlejme.imode.adf"
;
/** Boot class. */
private
static
final
String
_BOOT_CLASS
=
"com.nttdocomo.ui.__AppLaunch__"
;
...
...
@@ -78,6 +82,10 @@ public class IModeApplication
private
static
final
String
_SP_SIZE
=
"SPsize"
;
/** Draw area. */
private
static
final
String
_DRAW_AREA
=
"DrawArea"
;
/** ADF Properties. */
private
final
Map
<
String
,
String
>
_adfProps
;
...
...
@@ -156,11 +164,19 @@ public class IModeApplication
adfProps
.
get
(
IModeApplication
.
_KVM_VER
));
String
profile
=
adfProps
.
get
(
IModeApplication
.
_PROFILE_VER
);
// Default to old stuff
// Used as heuristic for versioning
String
drawArea
=
adfProps
.
get
(
IModeApplication
.
_DRAW_AREA
);
// Try to guess a reasonable version to use
if
(
config
==
null
||
config
.
isEmpty
())
config
=
"CLDC-1.
0
"
;
config
=
"CLDC-1.
1
"
;
if
(
profile
==
null
||
profile
.
isEmpty
())
profile
=
"DoJa-1.0"
;
{
if
(
drawArea
!=
null
)
profile
=
"DoJa-2.0"
;
else
profile
=
"DoJa-1.0"
;
}
return
new
DependencyInfo
(
new
Configuration
(
config
),
new
Profile
(
profile
));
...
...
@@ -209,6 +225,12 @@ public class IModeApplication
rv
.
put
(
"microedition.platform"
,
SquirrelJME
.
platform
(
PhoneModelType
.
NTT_DOCOMO_D503I
));
// Copy all ADF properties to system properties, it can be used in
// the future to access specific properties accordingly
for
(
Map
.
Entry
<
String
,
String
>
property
:
adfProps
.
entrySet
())
rv
.
put
(
IModeApplication
.
ADF_PROPERTY_PREFIX
+
"."
+
property
.
getKey
(),
property
.
getValue
());
return
rv
;
}
...
...
modules/cldc-compact/src/main/java/cc/squirreljme/runtime/cldc/debug/UndeterminedArgumentType.java
0 → 100644
View file @
6e97feb5
// ---------------------------------------------------------------------------
// SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.runtime.cldc.debug
;
/**
* This is used when an argument is not truly known.
*
* @since 2022/02/27
*/
public
final
class
UndeterminedArgumentType
extends
Error
{
/**
* Cannot be initialized.
*
* @since 2022/02/27
*/
private
UndeterminedArgumentType
()
{
}
}
modules/cldc-compact/src/main/java/cc/squirreljme/runtime/cldc/debug/UndeterminedReturnType.java
0 → 100644
View file @
6e97feb5
// ---------------------------------------------------------------------------
// SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.runtime.cldc.debug
;
/**
* This represents a type which is not really known.
*
* @since 2022/02/27
*/
public
final
class
UndeterminedReturnType
extends
Error
{
/**
* Cannot be initialized.
*
* @since 2022/02/27
*/
private
UndeterminedReturnType
()
{
}
}
modules/nttdocomo-api/build.gradle
View file @
6e97feb5
...
...
@@ -20,6 +20,8 @@ squirreljme
definedProfiles
+=
new
JavaMEProfile
(
"DoJa-4.1"
)
definedProfiles
+=
new
JavaMEProfile
(
"DoJa-5.0"
)
definedProfiles
+=
new
JavaMEProfile
(
"DoJa-5.1"
)
definedProfiles
+=
new
JavaMEProfile
(
"Star-1.0"
)
definedProfiles
+=
new
JavaMEProfile
(
"Star-2.0"
)
tags
+=
"nttdocomo"
tags
+=
"imode"
tags
+=
"doja"
...
...
modules/nttdocomo-api/src/main/java/cc/squirreljme/runtime/nttdocomo/CommonDoJaApplication.java
0 → 100644
View file @
6e97feb5
// ---------------------------------------------------------------------------
// SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.runtime.nttdocomo
;
/**
* Common interface for DoJa and Star applications.
*
* @since 2022/02/27
*/
public
interface
CommonDoJaApplication
{
void
terminate
();
}
modules/nttdocomo-api/src/main/java/com/docomostar/StarApplication.java
0 → 100644
View file @
6e97feb5
// ---------------------------------------------------------------------------
// SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
com.docomostar
;
import
cc.squirreljme.runtime.cldc.debug.Debugging
;
import
cc.squirreljme.runtime.cldc.debug.UndeterminedArgumentType
;
import
cc.squirreljme.runtime.cldc.debug.UndeterminedReturnType
;
import
cc.squirreljme.runtime.nttdocomo.CommonDoJaApplication
;
public
abstract
class
StarApplication
implements
CommonDoJaApplication
{
public
static
final
UndeterminedReturnType
LAUNCHED_AFTER_DOWNLOAD
=
Debugging
.<
UndeterminedReturnType
>
todoObject
();
public
static
final
UndeterminedReturnType
LAUNCHED_FROM_EXT
=
Debugging
.<
UndeterminedReturnType
>
todoObject
();
public
static
final
UndeterminedReturnType
LAUNCHED_FROM_TIMER
=
Debugging
.<
UndeterminedReturnType
>
todoObject
();
public
abstract
void
started
(
int
__unknownInt
);
public
UndeterminedReturnType
activated
(
UndeterminedArgumentType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
addApplicationListener
(
UndeterminedReturnType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
addEventListener
(
UndeterminedReturnType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
changeAppType
(
UndeterminedArgumentType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
getAppState
(
UndeterminedArgumentType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
stateChanged
(
UndeterminedArgumentType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
UndeterminedReturnType
suspend
(
UndeterminedArgumentType
__unknown
)
{
throw
Debugging
.
todo
();
}
public
void
terminate
()
{
throw
Debugging
.
todo
();
}
}
modules/nttdocomo-api/src/main/java/com/docomostar/package-info.java
0 → 100644
View file @
6e97feb5
// ---------------------------------------------------------------------------
// SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
/**
* NTT Docomo Doja Star API.
*
* @since 2022/02/27
*/
package
com.docomostar
;
modules/nttdocomo-api/src/main/java/com/nttdocomo/ui/Graphics.java
View file @
6e97feb5
...
...
@@ -266,9 +266,32 @@ public class Graphics
// Has no effect on SquirrelJME
}
@SuppressWarnings
(
"MagicNumber"
)
public
static
int
getColorOfName
(
int
__name
)
throws
IllegalArgumentException
{
throw
Debugging
.
todo
();
switch
(
__name
)
{
case
Graphics
.
AQUA
:
return
0x00FF00
;
case
Graphics
.
BLACK
:
return
0x000000
;
case
Graphics
.
BLUE
:
return
0x0000FF
;
case
Graphics
.
FUCHSIA
:
return
0xFF0000
;
case
Graphics
.
GRAY
:
return
0xFFFFFF
;
case
Graphics
.
GREEN
:
return
0x000080
;
case
Graphics
.
LIME
:
return
0x0000FF
;
case
Graphics
.
MAROON
:
return
0x008080
;
case
Graphics
.
NAVY
:
return
0x808080
;
case
Graphics
.
OLIVE
:
return
0x808000
;
case
Graphics
.
PURPLE
:
return
0x800080
;
case
Graphics
.
RED
:
return
0x00FFFF
;
case
Graphics
.
SILVER
:
return
0xC0C0C0
;
case
Graphics
.
TEAL
:
return
0x008000
;
case
Graphics
.
WHITE
:
return
0xFFFF00
;
case
Graphics
.
YELLOW
:
return
0xFF00FF
;
}
// {@squirreljme.error AH0r Invalid color. (The color)}
throw
new
IllegalArgumentException
(
"AH0r "
+
__name
);
}
public
static
int
getColorOfRGB
(
int
__r
,
int
__g
,
int
__b
)
...
...
modules/nttdocomo-api/src/main/java/com/nttdocomo/ui/IApplication.java
View file @
6e97feb5
...
...
@@ -10,9 +10,10 @@
package
com.nttdocomo.ui
;
import
cc.squirreljme.runtime.cldc.debug.Debugging
;
import
cc.squirreljme.runtime.
lcdui.mle.StaticDisplayState
;
import
cc.squirreljme.runtime.
nttdocomo.CommonDoJaApplication
;
public
abstract
class
IApplication
implements
CommonDoJaApplication
{
/** The last application created. */
static
volatile
IApplication
_lastApp
;
...
...
modules/nttdocomo-api/src/main/java/com/nttdocomo/ui/__AppLaunch__.java
View file @
6e97feb5
...
...
@@ -11,9 +11,11 @@ package com.nttdocomo.ui;
import
cc.squirreljme.runtime.cldc.Poking
;
import
cc.squirreljme.runtime.midlet.ApplicationHandler
;
import
com.docomostar.StarApplication
;
/**
* This class takes care of launching {@link IApplication}s.
* This class takes care of launching {@link IApplication} and
* {@link StarApplication}.
*
* @since 2021/06/13
*/
...
...
modules/nttdocomo-api/src/main/java/com/nttdocomo/ui/__IAppliInterface__.java
View file @
6e97feb5
...
...
@@ -9,9 +9,12 @@
package
com.nttdocomo.ui
;
import
cc.squirreljme.jvm.launch.IModeApplication
;
import
cc.squirreljme.runtime.cldc.debug.Debugging
;
import
cc.squirreljme.runtime.midlet.ApplicationHandler
;
import
cc.squirreljme.runtime.midlet.ApplicationInterface
;
import
cc.squirreljme.runtime.midlet.CleanupHandler
;
import
cc.squirreljme.runtime.nttdocomo.CommonDoJaApplication
;
import
com.docomostar.StarApplication
;
import
java.util.Objects
;
/**
...
...
@@ -20,7 +23,7 @@ import java.util.Objects;
* @since 2021/11/30
*/
final
class
__IAppliInterface__
implements
ApplicationInterface
<
I
Application
>
implements
ApplicationInterface
<
CommonDoJa
Application
>
{
/** Main application class. */
protected
final
String
mainClass
;
...
...
@@ -51,7 +54,7 @@ final class __IAppliInterface__
* @since 2021/11/30
*/
@Override
public
void
destroy
(
I
Application
__instance
,
Throwable
__thrown
)
public
void
destroy
(
CommonDoJa
Application
__instance
,
Throwable
__thrown
)
throws
NullPointerException
,
Throwable
{
if
(
__instance
==
null
)
...
...
@@ -72,13 +75,13 @@ final class __IAppliInterface__
* @since 2021/11/30
*/
@Override
public
I
Application
newInstance
()
public
CommonDoJa
Application
newInstance
()
throws
Throwable
{
// Load application details
synchronized
(
IApplication
.
class
)
{
IApplication
.
_appArgs
=
this
.
_args
;
;
IApplication
.
_appArgs
=
this
.
_args
;
}
// Main class for entry
...
...
@@ -115,6 +118,8 @@ final class __IAppliInterface__
// instance is being created it will not be erroneously caught
try
{
if
(
rawInstance
instanceof
StarApplication
)
return
(
StarApplication
)
rawInstance
;
return
(
IApplication
)
rawInstance
;
}
catch
(
ClassCastException
e
)
...
...
@@ -135,13 +140,17 @@ final class __IAppliInterface__
* @since 2021/11/30
*/
@Override
public
void
startApp
(
I
Application
__instance
)
public
void
startApp
(
CommonDoJa
Application
__instance
)
throws
NullPointerException
,
Throwable
{
if
(
__instance
==
null
)
throw
new
NullPointerException
(
"NARG"
);
// Start the application
__instance
.
start
();
if
(
__instance
instanceof
StarApplication
)
((
StarApplication
)
__instance
).
started
(
(
int
)
Debugging
.
todoObject
());
else
((
IApplication
)
__instance
).
start
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment