1 /***
2 * Created by IntelliJ IDEA.
3 * User: gareth
4 * Date: Sep 11, 2003
5 * Time: 6:43:19 PM
6 */
7 package com.tapina.robe.swi;
8
9 import com.tapina.robe.runtime.Environment;
10
11 import java.lang.reflect.Method;
12
13 public final class TaskWindow extends SWIHandler {
14 private static TaskWindow ourInstance;
15
16 public synchronized static TaskWindow getInstance() {
17 if (ourInstance == null) {
18 ourInstance = new TaskWindow();
19 }
20 return ourInstance;
21 }
22
23 private TaskWindow() {
24 }
25
26 public static int getBase() {
27 return 0x43380;
28 }
29
30 private static final String[] methodNames = new String[] {
31 "TaskInfo", "", "", "", "", "", "", "",
32 "", "", "", "", "", "", "", "",
33 "", "", "", "", "", "", "", "",
34 "", "", "", "", "", "", "", "",
35 "", "", "", "", "", "", "", "",
36 "", "", "", "", "", "", "", "",
37 "", "", "", "", "", "", "", "",
38 "", "", "", "", "", "", "", ""
39 };
40
41 public static Method getMethod(Integer offset) throws NoSuchMethodException {
42 return getMethod(methodNames[offset.intValue()]);
43 }
44
45 private static final Method getMethod(String name) throws NoSuchMethodException {
46 return TaskWindow.class.getMethod(name, METHOD_PARAMETERS);
47 }
48
49 /***
50 * This SWI is used to check if the program is currently running inside a TaskWindow.
51 * @param env IN: R0 = 0 (other reason codes are reserved), OUT: R0 = 0 if not in TaskWindow, otherwise in a TaskWindow.
52 */
53 public void TaskInfo(Environment env) {
54 env.getCpu().R[0] = 0;
55 }
56
57 }
58