commit e7a481027488d4e1e3901aac9b796d02ea60b9c5 Author: shagrath Date: Sat Sep 18 01:13:52 2010 +0200 First commit diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..86a15c9 --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..3cc77b2 --- /dev/null +++ b/.cproject @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..ce51e0c --- /dev/null +++ b/.project @@ -0,0 +1,100 @@ + + + droid48 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 0000000..a42a5e9 --- /dev/null +++ b/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,3 @@ +#Thu Aug 12 23:34:07 CEST 2010 +eclipse.preferences.version=1 +environment/project/0.331530184=\n\n\n\n diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..a744003 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Sun Oct 18 00:21:21 CEST 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..cd60c60 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d7d64f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +all: + ndk-build + +clean: + ndk-build clean diff --git a/assets/hp48 b/assets/hp48 new file mode 100644 index 0000000..6c2b377 Binary files /dev/null and b/assets/hp48 differ diff --git a/assets/ram b/assets/ram new file mode 100644 index 0000000..f3fa23d Binary files /dev/null and b/assets/ram differ diff --git a/assets/rom b/assets/rom new file mode 100644 index 0000000..78b9aca Binary files /dev/null and b/assets/rom differ diff --git a/bin/classes.dex b/bin/classes.dex new file mode 100644 index 0000000..3d213dd Binary files /dev/null and b/bin/classes.dex differ diff --git a/bin/droid48.apk b/bin/droid48.apk new file mode 100644 index 0000000..d7bf0bb Binary files /dev/null and b/bin/droid48.apk differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ new file mode 100644 index 0000000..576ac65 Binary files /dev/null and b/bin/resources.ap_ differ diff --git a/default.properties b/default.properties new file mode 100644 index 0000000..c5d5335 --- /dev/null +++ b/default.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Indicates whether an apk should be generated for each density. +split.density=false +# Project target. +target=android-8 +apk-configurations= diff --git a/jni/Android.mk b/jni/Android.mk new file mode 100644 index 0000000..1241292 --- /dev/null +++ b/jni/Android.mk @@ -0,0 +1,38 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# the purpose of this sample is to demonstrate how one can +# generate two distinct shared libraries and have them both +# uploaded in +# + +LOCAL_PATH:= $(call my-dir) + +# first lib, which will be built statically +# +include $(CLEAR_VARS) + +LOCAL_MODULE := droid48 + + + +LOCAL_LDLIBS := -L${SYSROOT}/usr/lib -llog + +LOCAL_SRC_FILES := config.h actions.c binio.c debugger.c device.c \ + disasm.c emulate.c init.c \ + lcd.c main.c memory.c options.c register.c \ + resources.c romio.c rpl.c serial.c timer.c x48.c + +include $(BUILD_SHARED_LIBRARY) diff --git a/jni/Makefile.am b/jni/Makefile.am new file mode 100644 index 0000000..ae5716a --- /dev/null +++ b/jni/Makefile.am @@ -0,0 +1,65 @@ + +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = x48 dump2rom mkcard checkrom + +BITMAPS = bitmaps/A.h bitmaps/B.h bitmaps/C.h bitmaps/D.h bitmaps/E.h bitmaps/F.h \ + bitmaps/G.h bitmaps/H.h bitmaps/I.h bitmaps/J.h bitmaps/K.h \ + bitmaps/L.h bitmaps/M.h bitmaps/N.h bitmaps/O.h bitmaps/P.h \ + bitmaps/Q.h bitmaps/R.h bitmaps/S.h bitmaps/T.h bitmaps/U.h \ + bitmaps/V.h bitmaps/W.h bitmaps/X.h bitmaps/Y.h bitmaps/Z.h \ + bitmaps/alpha.h bitmaps/angle.h bitmaps/angle_gx.h \ + bitmaps/ann_alpha.h bitmaps/ann_battery.h bitmaps/ann_busy.h \ + bitmaps/ann_io.h bitmaps/ann_left.h bitmaps/ann_right.h \ + bitmaps/arrow.h bitmaps/arrow_gx.h bitmaps/blank.h \ + bitmaps/bracket_gx.h bitmaps/bs.h bitmaps/colon.h \ + bitmaps/colon_gx.h bitmaps/comma.h bitmaps/comma_gx.h \ + bitmaps/curly_gx.h bitmaps/diff.h bitmaps/div.h bitmaps/down.h \ + bitmaps/equal.h bitmaps/equal_gx.h bitmaps/exp.h \ + bitmaps/exp_gx.h bitmaps/gx_128K_ram.h bitmaps/gx_green.h \ + bitmaps/gx_silver.h bitmaps/hash.h bitmaps/hash_gx.h \ + bitmaps/hp.h bitmaps/hp48_blue.h bitmaps/hp48_bottom.h \ + bitmaps/hp48_disp.h bitmaps/hp48_green_gx.h \ + bitmaps/hp48_icon.h bitmaps/hp48_keys.h bitmaps/hp48_logo.h \ + bitmaps/hp48_logo_gx.h bitmaps/hp48_on.h bitmaps/hp48_orange.h \ + bitmaps/hp48_text.h bitmaps/hp48_text_gx.h bitmaps/hp48_top.h \ + bitmaps/hp48_top_gx.h bitmaps/hp48gx.h bitmaps/hp48sx.h \ + bitmaps/integral.h bitmaps/inv.h bitmaps/last.h \ + bitmaps/lbrace.h bitmaps/lbracket.h bitmaps/lcurly.h \ + bitmaps/left.h bitmaps/menu_label.h bitmaps/minus.h \ + bitmaps/mul.h bitmaps/neg.h bitmaps/nl.h bitmaps/nl_gx.h \ + bitmaps/parens_gx.h bitmaps/pi.h bitmaps/pi_gx.h \ + bitmaps/plus.h bitmaps/pow10.h bitmaps/pow10_gx.h \ + bitmaps/power.h bitmaps/prog.h bitmaps/prog_gx.h \ + bitmaps/quote_gx.h bitmaps/rbrace.h bitmaps/rbracket.h \ + bitmaps/rcurly.h bitmaps/right.h bitmaps/root.h \ + bitmaps/root_gx.h bitmaps/science.h bitmaps/shl.h \ + bitmaps/shr.h bitmaps/sigma.h bitmaps/slash.h \ + bitmaps/small_colon.h bitmaps/sqr.h bitmaps/sqr_gx.h \ + bitmaps/sqrt.h bitmaps/string.h bitmaps/three.h bitmaps/two.h \ + bitmaps/under.h bitmaps/under_gx.h bitmaps/up.h + +x48_SOURCES = actions.c debugger.c device.c \ + disasm.c emulate.c errors.c init.c \ + lcd.c main.c memory.c options.c register.c \ + resources.c romio.c rpl.c serial.c timer.c \ + x48_x11.c \ + annunc.h append.h buttons.h constants.h debugger.h \ + device.h disasm.h errors.h global.h hp48char.h hp48_emu.h \ + hp48.h hp.h icon.h mmu.h options.h resources.h romio.h rpl.h \ + small.h timer.h version.h X48.ad.h x48_x11.h \ + $(BITMAPS) + +dump2rom_SOURCES = dump2rom.c + +mkcard_SOURCES = mkcard.c + +checkrom_SOURCES = checkrom.c romio.c + +man1_MANS = x48.man + +EXTRA_DIST = $(man1_MANS) + +INCLUDES = $(X_CFLAGS) + +x48_LDADD = $(X_LIBS) diff --git a/jni/Makefile.in b/jni/Makefile.in new file mode 100644 index 0000000..630cd9a --- /dev/null +++ b/jni/Makefile.in @@ -0,0 +1,583 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = x48$(EXEEXT) dump2rom$(EXEEXT) mkcard$(EXEEXT) \ + checkrom$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/x48.man.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = x48.man +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_checkrom_OBJECTS = checkrom.$(OBJEXT) romio.$(OBJEXT) +checkrom_OBJECTS = $(am_checkrom_OBJECTS) +checkrom_LDADD = $(LDADD) +am_dump2rom_OBJECTS = dump2rom.$(OBJEXT) +dump2rom_OBJECTS = $(am_dump2rom_OBJECTS) +dump2rom_LDADD = $(LDADD) +am_mkcard_OBJECTS = mkcard.$(OBJEXT) +mkcard_OBJECTS = $(am_mkcard_OBJECTS) +mkcard_LDADD = $(LDADD) +am__objects_1 = +am_x48_OBJECTS = actions.$(OBJEXT) debugger.$(OBJEXT) device.$(OBJEXT) \ + disasm.$(OBJEXT) emulate.$(OBJEXT) errors.$(OBJEXT) \ + init.$(OBJEXT) lcd.$(OBJEXT) main.$(OBJEXT) memory.$(OBJEXT) \ + options.$(OBJEXT) register.$(OBJEXT) resources.$(OBJEXT) \ + romio.$(OBJEXT) rpl.$(OBJEXT) serial.$(OBJEXT) timer.$(OBJEXT) \ + x48_x11.$(OBJEXT) $(am__objects_1) +x48_OBJECTS = $(am_x48_OBJECTS) +am__DEPENDENCIES_1 = +x48_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(checkrom_SOURCES) $(dump2rom_SOURCES) $(mkcard_SOURCES) \ + $(x48_SOURCES) +DIST_SOURCES = $(checkrom_SOURCES) $(dump2rom_SOURCES) \ + $(mkcard_SOURCES) $(x48_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man1_MANS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +BITMAPS = bitmaps/A.h bitmaps/B.h bitmaps/C.h bitmaps/D.h bitmaps/E.h bitmaps/F.h \ + bitmaps/G.h bitmaps/H.h bitmaps/I.h bitmaps/J.h bitmaps/K.h \ + bitmaps/L.h bitmaps/M.h bitmaps/N.h bitmaps/O.h bitmaps/P.h \ + bitmaps/Q.h bitmaps/R.h bitmaps/S.h bitmaps/T.h bitmaps/U.h \ + bitmaps/V.h bitmaps/W.h bitmaps/X.h bitmaps/Y.h bitmaps/Z.h \ + bitmaps/alpha.h bitmaps/angle.h bitmaps/angle_gx.h \ + bitmaps/ann_alpha.h bitmaps/ann_battery.h bitmaps/ann_busy.h \ + bitmaps/ann_io.h bitmaps/ann_left.h bitmaps/ann_right.h \ + bitmaps/arrow.h bitmaps/arrow_gx.h bitmaps/blank.h \ + bitmaps/bracket_gx.h bitmaps/bs.h bitmaps/colon.h \ + bitmaps/colon_gx.h bitmaps/comma.h bitmaps/comma_gx.h \ + bitmaps/curly_gx.h bitmaps/diff.h bitmaps/div.h bitmaps/down.h \ + bitmaps/equal.h bitmaps/equal_gx.h bitmaps/exp.h \ + bitmaps/exp_gx.h bitmaps/gx_128K_ram.h bitmaps/gx_green.h \ + bitmaps/gx_silver.h bitmaps/hash.h bitmaps/hash_gx.h \ + bitmaps/hp.h bitmaps/hp48_blue.h bitmaps/hp48_bottom.h \ + bitmaps/hp48_disp.h bitmaps/hp48_green_gx.h \ + bitmaps/hp48_icon.h bitmaps/hp48_keys.h bitmaps/hp48_logo.h \ + bitmaps/hp48_logo_gx.h bitmaps/hp48_on.h bitmaps/hp48_orange.h \ + bitmaps/hp48_text.h bitmaps/hp48_text_gx.h bitmaps/hp48_top.h \ + bitmaps/hp48_top_gx.h bitmaps/hp48gx.h bitmaps/hp48sx.h \ + bitmaps/integral.h bitmaps/inv.h bitmaps/last.h \ + bitmaps/lbrace.h bitmaps/lbracket.h bitmaps/lcurly.h \ + bitmaps/left.h bitmaps/menu_label.h bitmaps/minus.h \ + bitmaps/mul.h bitmaps/neg.h bitmaps/nl.h bitmaps/nl_gx.h \ + bitmaps/parens_gx.h bitmaps/pi.h bitmaps/pi_gx.h \ + bitmaps/plus.h bitmaps/pow10.h bitmaps/pow10_gx.h \ + bitmaps/power.h bitmaps/prog.h bitmaps/prog_gx.h \ + bitmaps/quote_gx.h bitmaps/rbrace.h bitmaps/rbracket.h \ + bitmaps/rcurly.h bitmaps/right.h bitmaps/root.h \ + bitmaps/root_gx.h bitmaps/science.h bitmaps/shl.h \ + bitmaps/shr.h bitmaps/sigma.h bitmaps/slash.h \ + bitmaps/small_colon.h bitmaps/sqr.h bitmaps/sqr_gx.h \ + bitmaps/sqrt.h bitmaps/string.h bitmaps/three.h bitmaps/two.h \ + bitmaps/under.h bitmaps/under_gx.h bitmaps/up.h + +x48_SOURCES = actions.c debugger.c device.c \ + disasm.c emulate.c errors.c init.c \ + lcd.c main.c memory.c options.c register.c \ + resources.c romio.c rpl.c serial.c timer.c \ + x48_x11.c \ + annunc.h append.h buttons.h constants.h debugger.h \ + device.h disasm.h errors.h global.h hp48char.h hp48_emu.h \ + hp48.h hp.h icon.h mmu.h options.h resources.h romio.h rpl.h \ + small.h timer.h version.h X48.ad.h x48_x11.h \ + $(BITMAPS) + +dump2rom_SOURCES = dump2rom.c +mkcard_SOURCES = mkcard.c +checkrom_SOURCES = checkrom.c romio.c +man1_MANS = x48.man +EXTRA_DIST = $(man1_MANS) +INCLUDES = $(X_CFLAGS) +x48_LDADD = $(X_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +x48.man: $(top_builddir)/config.status $(srcdir)/x48.man.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +checkrom$(EXEEXT): $(checkrom_OBJECTS) $(checkrom_DEPENDENCIES) + @rm -f checkrom$(EXEEXT) + $(LINK) $(checkrom_OBJECTS) $(checkrom_LDADD) $(LIBS) +dump2rom$(EXEEXT): $(dump2rom_OBJECTS) $(dump2rom_DEPENDENCIES) + @rm -f dump2rom$(EXEEXT) + $(LINK) $(dump2rom_OBJECTS) $(dump2rom_LDADD) $(LIBS) +mkcard$(EXEEXT): $(mkcard_OBJECTS) $(mkcard_DEPENDENCIES) + @rm -f mkcard$(EXEEXT) + $(LINK) $(mkcard_OBJECTS) $(mkcard_LDADD) $(LIBS) +x48$(EXEEXT): $(x48_OBJECTS) $(x48_DEPENDENCIES) + @rm -f x48$(EXEEXT) + $(LINK) $(x48_OBJECTS) $(x48_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disasm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump2rom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emulate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lcd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkcard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/register.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resources.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x48_x11.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $$i; then file=$$i; \ + else file=$(srcdir)/$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-man uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/jni/X48.ad.h b/jni/X48.ad.h new file mode 100644 index 0000000..f097d94 --- /dev/null +++ b/jni/X48.ad.h @@ -0,0 +1,24 @@ +"*iconic: False", +"*visual: Default", +"*mono: False", +"*gray: False", +"*monoIcon: False", +"*useXShm: True", +"*smallLabelFont: -*-fixed-bold-r-normal-*-14-*-*-*-*-*-iso8859-1", +"*mediumLabelFont: -*-fixed-bold-r-normal-*-15-*-*-*-*-*-iso8859-1", +"*largeLabelFont: -*-fixed-medium-r-normal-*-20-*-*-*-*-*-iso8859-1", +"*connectionFont: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1", +"*verbose: False", +"*quiet: False", +"*printVersion: False", +"*printCopyright: False", +"*printWarranty: False", +"*useTerminal: True", +"*useSerial: False", +"*serialLine: /dev/ttyS0", +"*completeInitialize: False", +"*resetOnStartup: False", +"*romFileName: rom.dump", +"*homeDirectory: .hp48", +"*useDebugger: True", +"*disassemblerMnemonics: class", diff --git a/jni/actions.c b/jni/actions.c new file mode 100644 index 0000000..b483110 --- /dev/null +++ b/jni/actions.c @@ -0,0 +1,1125 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: actions.c,v $ + * Revision 1.15 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.14 1994/12/07 20:20:50 ecd + * changed shutdown again: wake on TIMER1CTRL & XTRA + * + * Revision 1.14 1994/12/07 20:20:50 ecd + * changed shutdown again: wake on TIMER1CTRL & XTRA + * + * Revision 1.13 1994/11/28 02:00:51 ecd + * changed do_configure for internal debugging + * + * Revision 1.12 1994/11/02 14:40:38 ecd + * removed call to debug in do_shutdown() + * + * Revision 1.11 1994/10/09 20:29:47 ecd + * no real change, was just fiddling around with the display. + * + * Revision 1.10 1994/10/06 16:30:05 ecd + * added refresh_display() + * + * Revision 1.9 1994/10/05 08:36:44 ecd + * changed shutdown + * + * Revision 1.8 1994/10/01 10:12:53 ecd + * fixed bug in shutdown + * + * Revision 1.7 1994/09/30 12:37:09 ecd + * changed shutdown instruction + * + * Revision 1.6 1994/09/18 22:47:20 ecd + * fixed bug with overflow in timerdiff + * + * Revision 1.5 1994/09/18 15:29:22 ecd + * added SHUTDN implementation, + * started Real Time support. + * + * Revision 1.4 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.3 1994/08/31 18:23:21 ecd + * changed memory read routines. + * + * Revision 1.2 1994/08/27 11:28:59 ecd + * changed keyboard interrupt handling. + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * + * $Id: actions.c,v 1.15 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +/* #define DEBUG_INTERRUPT 1 */ +/* #define DEBUG_KBD_INT 1 */ +/* #define DEBUG_SHUTDOWN 1 */ +/* #define DEBUG_CONFIG 1 */ +/* #define DEBUG_ID 1 */ + +#include "global.h" + +#include +#include +#include + +#include "hp48.h" +#include "hp48_emu.h" +#include "device.h" +#include "timer.h" +#include "debugger.h" +#include "romio.h" + +static int interrupt_called = 0; +extern long nibble_masks[16]; + +int got_alarm; +int first_press = 1; +int conf_bank1 = 0x00000; +int conf_bank2 = 0x00000; + +void +#ifdef __FunctionProto__ +do_in(void) +#else +do_in() +#endif +{ + int i, in, out; + + out = 0; + for (i = 2; i >= 0; i--) { + out <<= 4; + out |= saturn.OUT[i]; + } + in = 0; + for (i = 0; i < 9; i++) + if (out & (1 << i)) + in |= saturn.keybuf.rows[i]; +#ifdef DEBUG_INOUT + LOGE( "saturn.OUT=%.3x, saturn.IN=%.4x\n", out, in); +#endif + + // PATCH http://svn.berlios.de/wsvn/x48?op=comp&compare[]=/trunk@12&compare[]=/trunk@13 + // PAS TERRIBLE VISIBLEMENT + + if ( saturn.PC == 0x00E31 && !first_press && + ( (out & 0x10 && in & 0x1 ) || /* keys are Backspace */ + (out & 0x40 && in & 0x7 ) || /* right, left & down */ + (out & 0x80 && in & 0x2 ) ) ) /* up arrows */ + { + for (i = 0; i < 9; i++) + if (out & (1 << i)) + saturn.keybuf.rows[i] = 0; + first_press = 1; + } + else + first_press = 0; + + // FIN PATCH + + for (i = 0; i < 4; i++) { + saturn.IN[i] = in & 0xf; + in >>= 4; + } +} + +void +#ifdef __FunctionProto__ +clear_program_stat(int n) +#else +clear_program_stat(n) +int n; +#endif +{ + saturn.PSTAT[n] = 0; +} + +void +#ifdef __FunctionProto__ +set_program_stat(int n) +#else +set_program_stat(n) +int n; +#endif +{ + saturn.PSTAT[n] = 1; +} + +int +#ifdef __FunctionProto__ +get_program_stat(int n) +#else +get_program_stat(n) +int n; +#endif +{ + return saturn.PSTAT[n]; +} + +void +#ifdef __FunctionProto__ +register_to_status(unsigned char *r) +#else +register_to_status(r) +unsigned char *r; +#endif +{ + int i; + + for (i = 0; i < 12; i++) { + saturn.PSTAT[i] = (r[i / 4] >> (i % 4)) & 1; + } +} + +void +#ifdef __FunctionProto__ +status_to_register(unsigned char *r) +#else +status_to_register(r) +unsigned char *r; +#endif +{ + int i; + + for (i = 0; i < 12; i++) { + if (saturn.PSTAT[i]) { + r[i / 4] |= 1 << (i % 4); + } else { + r[i / 4] &= ~(1 << (i % 4)) & 0xf; + } + } +} + +void +#ifdef __FunctionProto__ +swap_register_status(unsigned char *r) +#else +swap_register_status(r) +unsigned char *r; +#endif +{ + int i, tmp; + + for (i = 0; i < 12; i++) { + tmp = saturn.PSTAT[i]; + saturn.PSTAT[i] = (r[i / 4] >> (i % 4)) & 1; + if (tmp) { + r[i / 4] |= 1 << (i % 4); + } else { + r[i / 4] &= ~(1 << (i % 4)) & 0xf; + } + } +} + +void +#ifdef __FunctionProto__ +clear_status(void) +#else +clear_status() +#endif +{ + int i; + + for (i = 0; i < 12; i++) { + saturn.PSTAT[i] = 0; + } +} + +void +#ifdef __FunctionProto__ +set_register_nibble(unsigned char *reg, int n, unsigned char val) +#else +set_register_nibble(reg, n, val) +unsigned char *reg; +int n; +unsigned char val; +#endif +{ + reg[n] = val; +} + +unsigned char +#ifdef __FunctionProto__ +get_register_nibble(unsigned char *reg, int n) +#else +get_register_nibble(reg, n) +unsigned char *reg; +int n; +#endif +{ + return reg[n]; +} + +void +#ifdef __FunctionProto__ +set_register_bit(unsigned char *reg, int n) +#else +set_register_bit(reg, n) +unsigned char *reg; +int n; +#endif +{ + reg[n/4] |= (1 << (n%4)); +} + +void +#ifdef __FunctionProto__ +clear_register_bit(unsigned char *reg, int n) +#else +clear_register_bit(reg, n) +unsigned char *reg; +int n; +#endif +{ + reg[n/4] &= ~(1 << (n%4)); +} + +int +#ifdef __FunctionProto__ +get_register_bit(unsigned char *reg, int n) +#else +get_register_bit(reg, n) +unsigned char *reg; +int n; +#endif +{ + return ((int)(reg[n/4] & (1 << (n%4))) > 0)?1:0; +} + +short conf_tab_sx[] = { 1, 2, 2, 2, 2, 0 }; +short conf_tab_gx[] = { 1, 2, 2, 2, 2, 0 }; + +void +#ifdef __FunctionProto__ +do_reset(void) +#else +do_reset() +#endif +{ + int i; + + for (i = 0; i < 6; i++) + { + if (opt_gx) + saturn.mem_cntl[i].unconfigured = conf_tab_gx[i]; + else + saturn.mem_cntl[i].unconfigured = conf_tab_sx[i]; + saturn.mem_cntl[i].config[0] = 0x0; + saturn.mem_cntl[i].config[1] = 0x0; + } + +#ifdef DEBUG_CONFIG + LOGE( "%.5lx: RESET\n", saturn.PC); + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured) + LOGE( "MEMORY CONTROLLER %d is unconfigured\n", i); + else + LOGE( "MEMORY CONTROLLER %d is configured to %.5lx, %.5lx\n", + i, saturn.mem_cntl[i].config[0], saturn.mem_cntl[i].config[1]); + } +#endif +} + +void +#ifdef __FunctionProto__ +do_inton(void) +#else +do_inton() +#endif +{ + saturn.kbd_ien = 1; +} + +void +#ifdef __FunctionProto__ +do_intoff(void) +#else +do_intoff() +#endif +{ + saturn.kbd_ien = 0; +} + +void +#ifdef __FunctionProto__ +do_return_interupt(void) +#else +do_return_interupt() +#endif +{ + if (saturn.int_pending) { +#ifdef DEBUG_INTERRUPT + LOGE( "PC = %.5lx: RTI SERVICE PENDING INTERRUPT\n", + saturn.PC); +#endif + saturn.int_pending = 0; + saturn.intenable = 0; + saturn.PC = 0xf; + } else { +#ifdef DEBUG_INTERRUPT + LOGE( "PC = %.5lx: RETURN INTERRUPT to ", saturn.PC); +#endif + saturn.PC = pop_return_addr(); +#ifdef DEBUG_INTERRUPT + LOGE( "%.5lx\n", saturn.PC); +#endif + saturn.intenable = 1; + + if (adj_time_pending) { + schedule_event = 0; + sched_adjtime = 0; + } + + } +} + +void +#ifdef __FunctionProto__ +do_interupt(void) +#else +do_interupt() +#endif +{ + interrupt_called = 1; + if (saturn.intenable) { +#ifdef DEBUG_INTERRUPT + LOGE( "PC = %.5lx: INTERRUPT\n", saturn.PC); +#endif + push_return_addr(saturn.PC); + saturn.PC = 0xf; + saturn.intenable = 0; + } +} + +void +#ifdef __FunctionProto__ +do_kbd_int(void) +#else +do_kbd_int() +#endif +{ + interrupt_called = 1; + if (saturn.intenable) { +#ifdef DEBUG_KBD_INT + LOGE( "PC = %.5lx: KBD INT\n", saturn.PC); +#endif + push_return_addr(saturn.PC); + saturn.PC = 0xf; + saturn.intenable = 0; + } else { +#ifdef DEBUG_KBD_INT + LOGE( "PC = %.5lx: KBD INT PENDING\n", saturn.PC); +#endif + saturn.int_pending = 1; + } +} + +void +#ifdef __FunctionProto__ +do_reset_interrupt_system(void) +#else +do_reset_interrupt_system() +#endif +{ + int i, gen_intr; + + saturn.kbd_ien = 1; + gen_intr = 0; + for (i = 0; i < 9; i++) { + if (saturn.keybuf.rows[i] != 0) { + gen_intr = 1; + break; + } + } + if (gen_intr) { + do_kbd_int(); + } +} + +void +#ifdef __FunctionProto__ +do_unconfigure(void) +#else +do_unconfigure() +#endif +{ + int i; + unsigned int conf; + + conf = 0; + for (i = 4; i >= 0; i--) { + conf <<= 4; + conf |= saturn.C[i]; + } + + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].config[0] == conf) + { + if (opt_gx) + saturn.mem_cntl[i].unconfigured = conf_tab_gx[i]; + else + saturn.mem_cntl[i].unconfigured = conf_tab_sx[i]; + saturn.mem_cntl[i].config[0] = 0x0; + saturn.mem_cntl[i].config[1] = 0x0; + break; + } + } + +#ifdef DEBUG_CONFIG + LOGE( "%.5lx: UNCNFG %.5x:\n", saturn.PC, conf); + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured) + LOGE( "MEMORY CONTROLLER %d is unconfigured\n", i); + else + LOGE( "MEMORY CONTROLLER %d is configured to %.5lx, %.5lx\n", + i, saturn.mem_cntl[i].config[0], saturn.mem_cntl[i].config[1]); + } +#endif +} + +void +#ifdef __FunctionProto__ +do_configure(void) +#else +do_configure() +#endif +{ + int i; + unsigned long conf; + + conf = 0; + for (i = 4; i >= 0; i--) { + conf <<= 4; + conf |= saturn.C[i]; + } + + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured) + { + saturn.mem_cntl[i].unconfigured--; + saturn.mem_cntl[i].config[saturn.mem_cntl[i].unconfigured] = conf; + break; + } + } + +#ifdef DEBUG_CONFIG + LOGE( "%.5lx: CONFIG %.5lx:\n", saturn.PC, conf); + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured) + LOGE( "MEMORY CONTROLLER %d is unconfigured\n", i); + else + LOGE( "MEMORY CONTROLLER %d at %.5lx, %.5lx\n", + i, saturn.mem_cntl[i].config[0], saturn.mem_cntl[i].config[1]); + } +#endif +} + +int +#ifdef __FunctionProto__ +get_identification(void) +#else +get_identification() +#endif +{ + int i; + static int chip_id[] + = { 0, 0, 0, 0, 0x05, 0xf6, 0x07, 0xf8, 0x01, 0xf2, 0, 0 }; + int id; + + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured) + break; + } + if (i < 6) + id = chip_id[2 * i + (2 - saturn.mem_cntl[i].unconfigured)]; + else + id = 0; + +#ifdef DEBUG_ID + LOGE( "%.5lx: C=ID, returning: %x\n", saturn.PC, id); + for (i = 0; i < 6; i++) + { + if (saturn.mem_cntl[i].unconfigured == 2) + LOGE( "MEMORY CONTROLLER %d is unconfigured\n", i); + else if (saturn.mem_cntl[i].unconfigured == 1) + { + if (i == 0) + LOGE( "MEMORY CONTROLLER %d unconfigured\n", i); + else + LOGE( "MEMORY CONTROLLER %d configured to ????? %.5lx\n", + i, saturn.mem_cntl[i].config[1]); + } + else + LOGE( "MEMORY CONTROLLER %d configured to %.5lx, %.5lx\n", + i, saturn.mem_cntl[i].config[0], saturn.mem_cntl[i].config[1]); + } +#endif + + for (i = 0; i < 3; i++) + { + saturn.C[i] = id & 0x0f; + id >>= 4; + } + return 0; +} + +void +#ifdef __FunctionProto__ +do_shutdown(void) +#else +do_shutdown() +#endif +{ + int wake, alarms; + t1_t2_ticks ticks; + + if (device.display_touched) { + device.display_touched = 0; + update_display(); +#ifdef HAVE_XSHM + if (disp.display_update) refresh_display(); +#endif + } + + stop_timer(RUN_TIMER); + start_timer(IDLE_TIMER); + + if (is_zero_register(saturn.OUT, OUT_FIELD)) { +#ifdef DEBUG_SHUTDOWN + LOGE( "%.5lx: SHUTDN: PC = 0\n", saturn.PC); +#endif + saturn.intenable = 1; + saturn.int_pending = 0; + } + +#ifdef DEBUG_SHUTDOWN + LOGE( "%.5lx:\tSHUTDN: Timer 1 Control = %x, Timer 1 = %d\n", + saturn.PC, saturn.t1_ctrl, saturn.timer1); + LOGE( "%.5lx:\tSHUTDN: Timer 2 Control = %x, Timer 2 = %ld\n", + saturn.PC, saturn.t2_ctrl, saturn.timer2); +#endif + + /* if (in_debugger) + wake = 1; + else*/ + wake = 0; + + alarms = 0; + + // android_refresh_screen(); + + /* do { +LOGI("---"); + pause(); +LOGI("---"); + if (got_alarm) { + got_alarm = 0; + +#ifdef HAVE_XSHM + if (disp.display_update) refresh_display(); +#endif*/ + +//android_refresh_screen(); +// usleep(50000); + + do { + + /* do { + + (*android_env)->CallVoidMethod(android_env, android_callback, pauseEvent); + + if (got_alarm) { + + got_alarm = 0;*/ + + ticks = get_t1_t2(); + if (saturn.t2_ctrl & 0x01) { + saturn.timer2 = ticks.t2_ticks; + } + saturn.timer1 = set_t1 - ticks.t1_ticks; + set_t1 = ticks.t1_ticks; + + interrupt_called = 0; + + + // android_refresh_screen(); + // usleep(50000); + //LOGI("enter pauseEvent"); + (*android_env)->CallVoidMethod(android_env, android_callback, pauseEvent); + // LOGI("exit pauseEvent"); + + if (GetEvent()) { + if (interrupt_called) + wake = 1; + } + + if (saturn.timer2 <= 0) + { + if (saturn.t2_ctrl & 0x04) + { + wake = 1; + } + if (saturn.t2_ctrl & 0x02) + { + wake = 1; + saturn.t2_ctrl |= 0x08; + do_interupt(); + } + } + + if (saturn.timer1 <= 0) + { + saturn.timer1 &= 0x0f; + if (saturn.t1_ctrl & 0x04) + { + wake = 1; + } + if (saturn.t1_ctrl & 0x03) + { + wake = 1; + saturn.t1_ctrl |= 0x08; + do_interupt(); + } + } + + if (wake == 0) { + interrupt_called = 0; + receive_char(); + if (interrupt_called) + wake = 1; + } + + alarms++; + + //} + + } while (wake == 0 && exit_state); + + + stop_timer(IDLE_TIMER); + start_timer(RUN_TIMER); +} + +void +#ifdef __FunctionProto__ +set_hardware_stat(int op) +#else +set_hardware_stat(op) +int op; +#endif +{ + if (op & 1) saturn.XM = 1; + if (op & 2) saturn.SB = 1; + if (op & 4) saturn.SR = 1; + if (op & 8) saturn.MP = 1; +} + +void +#ifdef __FunctionProto__ +clear_hardware_stat(int op) +#else +clear_hardware_stat(op) +int op; +#endif +{ + if (op & 1) saturn.XM = 0; + if (op & 2) saturn.SB = 0; + if (op & 4) saturn.SR = 0; + if (op & 8) saturn.MP = 0; +} + +int +#ifdef __FunctionProto__ +is_zero_hardware_stat(int op) +#else +is_zero_hardware_stat(op) +int op; +#endif +{ + if (op & 1) if (saturn.XM != 0) return 0; + if (op & 2) if (saturn.SB != 0) return 0; + if (op & 4) if (saturn.SR != 0) return 0; + if (op & 8) if (saturn.MP != 0) return 0; + return 1; +} + +void +#ifdef __FunctionProto__ +push_return_addr(long addr) +#else +push_return_addr(addr) +long addr; +#endif +{ + int i; + + if (++saturn.rstkp >= NR_RSTK) { +#if 0 + LOGE( "%.5lx: RSTK overflow !!!\n", saturn.PC); + for (i = saturn.rstkp - 1; i >= 0; i--) { + LOGE( "\tRSTK[%d] %.5lx\n", i, saturn.rstk[i]); + } +#endif + for (i = 1; i < NR_RSTK; i++) + saturn.rstk[i-1] = saturn.rstk[i]; + saturn.rstkp--; + } + saturn.rstk[saturn.rstkp] = addr; +#ifdef DEBUG_RSTK + LOGE( "PUSH %.5x:\n", addr); + for (i = saturn.rstkp; i >= 0; i--) { + LOGE( "RSTK[%d] %.5x\n", i, saturn.rstk[i]); + } +#endif +} + +long +#ifdef __FunctionProto__ +pop_return_addr(void) +#else +pop_return_addr() +#endif +{ +#ifdef DEBUG_RSTK + int i; + + for (i = saturn.rstkp; i >= 0; i--) { + LOGE( "RSTK[%d] %.5x\n", i, saturn.rstk[i]); + } + LOGE( "POP %.5x:\n", + (saturn.rstkp >= 0) ? saturn.rstk[saturn.rstkp]:0); +#endif + if (saturn.rstkp < 0) + return 0; + return saturn.rstk[saturn.rstkp--]; +} + +char * +#ifdef __FunctionProto__ +make_hexstr(long addr, int n) +#else +make_hexstr(addr, n) +long addr; +int n; +#endif +{ + static char str[44]; + int i, t, trunc; + + trunc = 0; + if (n > 40) { + n = 40; + trunc = 1; + } + for (i = 0; i < n; i++) { + t = read_nibble(addr+i); + if (t <= 9) + str[i] = '0' + t; + else + str[i] = 'a' + (t - 10); + } + str[n] = '\0'; + if (trunc) { + str[n] = '.'; + str[n+1] = '.'; + str[n+2] = '.'; + str[n+3] = '\0'; + } + return str; +} + +void +#ifdef __FunctionProto__ +load_constant(unsigned char *reg, int n, long addr) +#else +load_constant(reg, n, addr) +unsigned char *reg; +int n; +long addr; +#endif +{ + int i, p; + + p = saturn.P; + for (i = 0; i < n; i++) { + reg[p] = read_nibble(addr + i); + p = (p + 1) & 0xf; + } +} + +void +#ifdef __FunctionProto__ +load_addr(word_20 *dat, long addr, int n) +#else +load_addr(dat, addr, n) +word_20 *dat; +long addr; +int n; +#endif +{ + int i; + + for (i = 0; i < n; i++) { + *dat &= ~nibble_masks[i]; + *dat |= read_nibble(addr + i) << (i * 4); + } +} + +void +#ifdef __FunctionProto__ +load_address(unsigned char *reg, long addr, int n) +#else +load_address(reg, addr, n) +unsigned char *reg; +long addr; +int n; +#endif +{ + int i; + + for (i = 0; i < n; i++) { + reg[i] = read_nibble(addr + i); + } +} + +void +#ifdef __FunctionProto__ +register_to_address(unsigned char *reg, word_20 *dat, int s) +#else +register_to_address(reg, dat, s) +unsigned char *reg; +word_20 *dat; +int s; +#endif +{ + int i, n; + + if (s) + n = 4; + else + n = 5; + for (i = 0; i < n; i++) { + *dat &= ~nibble_masks[i]; + *dat |= (reg[i] & 0x0f) << (i * 4); + } +} + +void +#ifdef __FunctionProto__ +address_to_register(word_20 dat, unsigned char *reg, int s) +#else +address_to_register(dat, reg, s) +word_20 dat; +unsigned char *reg; +int s; +#endif +{ + int i, n; + + if (s) + n = 4; + else + n = 5; + for (i = 0; i < n; i++) { + reg[i] = dat & 0x0f; + dat >>= 4; + } +} + +long +#ifdef __FunctionProto__ +dat_to_addr(unsigned char *dat) +#else +dat_to_addr(dat) +unsigned char *dat; +#endif +{ + int i; + long addr; + + addr = 0; + for (i = 4; i >= 0; i--) { + addr <<= 4; + addr |= (dat[i] & 0xf); + } + return addr; +} + +void +#ifdef __FunctionProto__ +addr_to_dat(long addr, unsigned char *dat) +#else +addr_to_dat(addr, dat) +long addr; +unsigned char *dat; +#endif +{ + int i; + + for (i = 0; i < 5; i++) { + dat[i] = (addr & 0xf); + addr >>= 4; + } +} + +void +#ifdef __FunctionProto__ +add_address(word_20 *dat, int add) +#else +add_address(dat, add) +word_20 *dat; +int add; +#endif +{ + *dat += add; + if (*dat & (word_20)0xfff00000) { + saturn.CARRY = 1; + } else { + saturn.CARRY = 0; + } + *dat &= 0xfffff; +} + +static int start_fields[] = { + -1, 0, 2, 0, 15, 3, 0, 0, + -1, 0, 2, 0, 15, 3, 0, 0, + 0, 0, 0 +}; + +static int end_fields[] = { + -1, -1, 2, 2, 15, 14, 1, 15, + -1, -1, 2, 2, 15, 14, 1, 4, + 3, 2, 0 +}; + +static inline int +#ifdef __FunctionProto__ +get_start(int code) +#else +get_start(code) +int code; +#endif +{ + int s; + + if ((s = start_fields[code]) == -1) { + s = saturn.P; + } + return s; +} + +static inline int +#ifdef __FuntionProto__ +get_end(int code) +#else +get_end(code) +int code; +#endif +{ + int e; + + if ((e = end_fields[code]) == -1) { + e = saturn.P; + } + return e; +} + +void +#ifdef __FunctionProto__ +store(word_20 dat, unsigned char *reg, int code) +#else +store(dat, reg, code) +word_20 dat; +unsigned char *reg; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + write_nibble(dat++, reg[i]); + } +} + +void +#ifdef __FunctionProto__ +store_n(word_20 dat, unsigned char *reg, int n) +#else +store_n(dat, reg, n) +word_20 dat; +unsigned char *reg; +int n; +#endif +{ + int i; + + for (i = 0; i < n; i++) { + write_nibble(dat++, reg[i]); + } +} + +void +#ifdef __FunctionProto__ +recall(unsigned char *reg, word_20 dat, int code) +#else +recall(reg, dat, code) +unsigned char *reg; +word_20 dat; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + reg[i] = read_nibble_crc(dat++); + } +} + +void +#ifdef __FunctionProto__ +recall_n(unsigned char *reg, word_20 dat, int n) +#else +recall_n(reg, dat, n) +unsigned char *reg; +word_20 dat; +int n; +#endif +{ + int i; + + for (i = 0; i < n; i++) { + reg[i] = read_nibble_crc(dat++); + } +} + diff --git a/jni/annunc.h b/jni/annunc.h new file mode 100644 index 0000000..bd00d0f --- /dev/null +++ b/jni/annunc.h @@ -0,0 +1,55 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: annunc.h,v $ + * Revision 1.4 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * changed char to unsigned + * + * Revision 1.1 1994/09/07 12:53:20 ecd + * Initial revision + * + * + * $Id: annunc.h,v 1.4 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _ANNUNC_H +#define _ANNUNC_H 1 + +#include "bitmaps/ann_alpha.h" + +#include "bitmaps/ann_battery.h" + +#include "bitmaps/ann_busy.h" + +#include "bitmaps/ann_io.h" + +#include "bitmaps/ann_left.h" + +#include "bitmaps/ann_right.h" + +#endif /* !_ANNUNC_H */ diff --git a/jni/append.h b/jni/append.h new file mode 100644 index 0000000..a871d2c --- /dev/null +++ b/jni/append.h @@ -0,0 +1,45 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: append.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * deleted empty line at top of file + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * deleted empty line at top of file + * + * Revision 1.1 1994/12/07 10:16:15 ecd + * Initial revision + * + * + * $Id: append.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ +#ifndef _APPEND_H +#define _APPEND_H 1 + +#include "global.h" + +extern char * append_str __ProtoType__((char *buf, char *string)); +extern char * append_tab __ProtoType__((char *buf)); +extern char * append_tab_16 __ProtoType__((char *buf)); + +#endif /* !_APPEND_H */ diff --git a/jni/binio.c b/jni/binio.c new file mode 100644 index 0000000..8fd0875 --- /dev/null +++ b/jni/binio.c @@ -0,0 +1,272 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include + +#include "global.h" +#include "binio.h" +#include "rpl.h" +#include "hp48_emu.h" + +typedef word_20 DWORD; +typedef unsigned char BYTE; +typedef unsigned int UINT; + +void +Npeek(BYTE *a, DWORD d, UINT s) +{ + load_address(a, d, s); +} + + +static DWORD +Npack(BYTE *a, UINT s) +{ + DWORD r = 0; + + while (s--) r = (r<<4)|a[s]; + return r; +} + + +DWORD +RPL_ObjectSize(BYTE *o) +{ + DWORD n, l = 0; + + n = Npack(o, 5); // read prolog + switch (n) + { + case DOBINT: l = 10; break; // System Binary + case DOREAL: l = 21; break; // Real + case DOEREAL: l = 26; break; // Long Real + case DOCMP: l = 37; break; // Complex + case DOECMP: l = 47; break; // Long Complex + case DOCHAR: l = 7; break; // Character + case DOEXT1: l = 15; break; // Extended Pointer + case DOROMP: l = 11; break; // XLIB Name + case DOLIST: // List + case DOSYMB: // Algebraic + case DOEXT: // Unit + case DOCOL: // Program + n=5; + do { l+=n; o+=n; n=RPL_ObjectSize(o); } while (n); + l += 5; + break; + case SEMI: l = 0; break; // SEMI + case DOIDNT: // Global Name + case DOLAM: // Local Name + case DOTAG: // Tagged + n = 7 + Npack(o+5,2)*2; + l = n + RPL_ObjectSize(o+n); + break; + case DORRP: // Directory + n = Npack(o+8,5); + if (n==0) // empty dir + { + l=13; + } + else + { + l = 8+n; + n = Npack(o+l,2)*2 + 4; + l += n; + l += RPL_ObjectSize(o+l); + } + break; + case DOARRY: // Array + case DOLNKARRY: // Linked Array + case DOCSTR: // String + case DOHSTR: // Binary Integer + case DOGROB: // Graphic + case DOLIB: // Library + case DOBAK: // Backup + case DOEXT0: // Library Data + case DOEXT2: // Reserved 1, Font (HP49G) + case DOEXT3: // Reserved 2 + case DOEXT4: // Reserved 3 + case DOCODE: // Code + l = 5 + Npack(o+5,5); + break; + default: l=5; + } + return l; +} + +DWORD +Read5(DWORD d) +{ + word_20 p = 0; + load_addr(&p,d,5); + return p; +} + +static void +Nunpack(BYTE *a, DWORD b, UINT s) +{ + UINT i; + for (i=0; i>=4; } +} + +void +Nwrite(BYTE *a, DWORD d, UINT s) +{ + store_n(d,a,s); +} + +void +Write5(DWORD d, DWORD n) +{ + BYTE p[5]; + + Nunpack(p,n,5); + Nwrite(p,d,5); + return; +} + + + + +DWORD +RPL_CreateTemp(DWORD l) +{ + DWORD a, b, c; + BYTE *p; + + l += 6; // memory for link field (5) + marker (1) and end + a = Read5(TEMPTOP); // tail address of top object + b = Read5(RSKTOP); // tail address of rtn stack + c = Read5(DSKTOP); // top of data stack + if ((b+l)>c) return 0; // check if there's enough memory to move DSKTOP + Write5(TEMPTOP, a+l); // adjust new end of top object + Write5(RSKTOP, b+l); // adjust new end of rtn stack + Write5(AVMEM, (c-b-l)/5); // calculate free memory (*5 nibbles) + p = (BYTE *)malloc(b-a); + memset(p,0,b-a); + Npeek(p,a,b-a); + Nwrite(p,a+l,b-a); + free(p); + Write5(a+l-5,l); // set object length field + return (a+1); // return base address of new object +} + +void +RPL_Push(DWORD n) +{ + DWORD stkp, avmem; + + avmem = Read5(AVMEM); // amount of free memory + if (avmem==0) return; // no memory free + avmem--; + // fetch memory + Write5(AVMEM,avmem); // save new amount of free memory + stkp = Read5(DSKTOP); // get pointer to stack level 1 +# if 0 + if (METAKERNEL) // Metakernel running ? + { + + Write5(stkp-5,Read5(stkp)); // copy object pointer of stack level 1 to new stack level 1 entry + Write5(stkp,n); // save pointer to new object on stack level 2 + stkp-=5; // fetch new stack entry + } + else +# else + { + stkp-=5; // fetch new stack entry + Write5(stkp,n); // save pointer to new object on stack level 1 + } +# endif + Write5(DSKTOP,stkp); // save new pointer to stack level 1 + return; +} + +int +read_bin_file(char *filename) +{ + struct stat st; + FILE *fp; + DWORD bin_size = 0; + BYTE *bin_buffer = (BYTE *)0; + int bBinary; + long dwAddress; + long i; +LOGI("Loading filename: %s", filename); + if (NULL == (fp = fopen(filename, "r"))) + { + return 0; + } + + if (stat(filename, &st) < 0) + { + fclose(fp); + return 0; + } + + bin_size = st.st_size; + bin_buffer = (BYTE *)malloc(bin_size * 2); + + if (fread(bin_buffer + bin_size, 1, (size_t)bin_size, fp) != bin_size) + { + free(bin_buffer); + fclose(fp); + return 0; + } + fclose(fp); + + bBinary = ((bin_buffer[bin_size+0]=='H') + && (bin_buffer[bin_size+1]=='P') + && (bin_buffer[bin_size+2]=='H') + && (bin_buffer[bin_size+3]=='P') + && (bin_buffer[bin_size+4]=='4') + && (bin_buffer[bin_size+5]=='8') + && (bin_buffer[bin_size+6]=='-')); + + for (i = 0; i < bin_size; i++) + { + BYTE byTwoNibs = bin_buffer[i+bin_size]; + bin_buffer[i*2 ] = (BYTE)(byTwoNibs&0xF); + bin_buffer[i*2+1] = (BYTE)(byTwoNibs>>4); + } + + if (bBinary) + { // load as binary + bin_size = RPL_ObjectSize(bin_buffer+16); + dwAddress = RPL_CreateTemp(bin_size); + if (dwAddress == 0) return 0; + + Nwrite(bin_buffer+16,dwAddress,bin_size); + } + else + { // load as string + bin_size *= 2; + dwAddress = RPL_CreateTemp(bin_size+10); + if (dwAddress == 0) return 0; + Write5(dwAddress,0x02A2C); // String + Write5(dwAddress+5,bin_size+5); // length of String + Nwrite(bin_buffer,dwAddress+10,bin_size); // data + } + RPL_Push(dwAddress); +LOGI("Done loading filename: %s", filename); + + return 1; +} diff --git a/jni/binio.h b/jni/binio.h new file mode 100644 index 0000000..9e94f1e --- /dev/null +++ b/jni/binio.h @@ -0,0 +1,27 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _BINIO_H +#define _BINIO_H 1 + +#include "global.h" + +extern int read_bin_file(char *filename); + +#endif diff --git a/jni/bitmaps/A.h b/jni/bitmaps/A.h new file mode 100644 index 0000000..0438537 --- /dev/null +++ b/jni/bitmaps/A.h @@ -0,0 +1,5 @@ +#define A_width 5 +#define A_height 7 +static unsigned char A_bits[] = { + 0x0e, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11}; + diff --git a/jni/bitmaps/B.h b/jni/bitmaps/B.h new file mode 100644 index 0000000..9280b66 --- /dev/null +++ b/jni/bitmaps/B.h @@ -0,0 +1,5 @@ +#define B_width 5 +#define B_height 7 +static unsigned char B_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f}; + diff --git a/jni/bitmaps/C.h b/jni/bitmaps/C.h new file mode 100644 index 0000000..59128b6 --- /dev/null +++ b/jni/bitmaps/C.h @@ -0,0 +1,5 @@ +#define C_width 5 +#define C_height 7 +static unsigned char C_bits[] = { + 0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e}; + diff --git a/jni/bitmaps/D.h b/jni/bitmaps/D.h new file mode 100644 index 0000000..6c602d2 --- /dev/null +++ b/jni/bitmaps/D.h @@ -0,0 +1,5 @@ +#define D_width 5 +#define D_height 7 +static unsigned char D_bits[] = { + 0x0f, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0f}; + diff --git a/jni/bitmaps/E.h b/jni/bitmaps/E.h new file mode 100644 index 0000000..dfc2dd0 --- /dev/null +++ b/jni/bitmaps/E.h @@ -0,0 +1,5 @@ +#define E_width 5 +#define E_height 7 +static unsigned char E_bits[] = { + 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f}; + diff --git a/jni/bitmaps/F.h b/jni/bitmaps/F.h new file mode 100644 index 0000000..8eaccfe --- /dev/null +++ b/jni/bitmaps/F.h @@ -0,0 +1,5 @@ +#define F_width 5 +#define F_height 7 +static unsigned char F_bits[] = { + 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01}; + diff --git a/jni/bitmaps/G.h b/jni/bitmaps/G.h new file mode 100644 index 0000000..74e8ef7 --- /dev/null +++ b/jni/bitmaps/G.h @@ -0,0 +1,5 @@ +#define G_width 5 +#define G_height 7 +static unsigned char G_bits[] = { + 0x0e, 0x11, 0x01, 0x01, 0x19, 0x11, 0x0e}; + diff --git a/jni/bitmaps/H.h b/jni/bitmaps/H.h new file mode 100644 index 0000000..33b2903 --- /dev/null +++ b/jni/bitmaps/H.h @@ -0,0 +1,5 @@ +#define H_width 5 +#define H_height 7 +static unsigned char H_bits[] = { + 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11}; + diff --git a/jni/bitmaps/I.h b/jni/bitmaps/I.h new file mode 100644 index 0000000..b979934 --- /dev/null +++ b/jni/bitmaps/I.h @@ -0,0 +1,5 @@ +#define I_width 1 +#define I_height 7 +static unsigned char I_bits[] = { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; + diff --git a/jni/bitmaps/J.h b/jni/bitmaps/J.h new file mode 100644 index 0000000..16aab65 --- /dev/null +++ b/jni/bitmaps/J.h @@ -0,0 +1,5 @@ +#define J_width 4 +#define J_height 7 +static unsigned char J_bits[] = { + 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06}; + diff --git a/jni/bitmaps/K.h b/jni/bitmaps/K.h new file mode 100644 index 0000000..3dc9472 --- /dev/null +++ b/jni/bitmaps/K.h @@ -0,0 +1,5 @@ +#define K_width 5 +#define K_height 7 +static unsigned char K_bits[] = { + 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11}; + diff --git a/jni/bitmaps/L.h b/jni/bitmaps/L.h new file mode 100644 index 0000000..e9a38f1 --- /dev/null +++ b/jni/bitmaps/L.h @@ -0,0 +1,5 @@ +#define L_width 4 +#define L_height 7 +static unsigned char L_bits[] = { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0f}; + diff --git a/jni/bitmaps/M.h b/jni/bitmaps/M.h new file mode 100644 index 0000000..d390971 --- /dev/null +++ b/jni/bitmaps/M.h @@ -0,0 +1,5 @@ +#define M_width 5 +#define M_height 7 +static unsigned char M_bits[] = { + 0x11, 0x1b, 0x15, 0x11, 0x11, 0x11, 0x11}; + diff --git a/jni/bitmaps/N.h b/jni/bitmaps/N.h new file mode 100644 index 0000000..e210790 --- /dev/null +++ b/jni/bitmaps/N.h @@ -0,0 +1,5 @@ +#define N_width 5 +#define N_height 7 +static unsigned char N_bits[] = { + 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11}; + diff --git a/jni/bitmaps/O.h b/jni/bitmaps/O.h new file mode 100644 index 0000000..fd29036 --- /dev/null +++ b/jni/bitmaps/O.h @@ -0,0 +1,5 @@ +#define O_width 5 +#define O_height 7 +static unsigned char O_bits[] = { + 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e}; + diff --git a/jni/bitmaps/P.h b/jni/bitmaps/P.h new file mode 100644 index 0000000..0ec8db1 --- /dev/null +++ b/jni/bitmaps/P.h @@ -0,0 +1,5 @@ +#define P_width 5 +#define P_height 7 +static unsigned char P_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01}; + diff --git a/jni/bitmaps/Q.h b/jni/bitmaps/Q.h new file mode 100644 index 0000000..11f23c1 --- /dev/null +++ b/jni/bitmaps/Q.h @@ -0,0 +1,5 @@ +#define Q_width 5 +#define Q_height 7 +static unsigned char Q_bits[] = { + 0x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16}; + diff --git a/jni/bitmaps/R.h b/jni/bitmaps/R.h new file mode 100644 index 0000000..a36f088 --- /dev/null +++ b/jni/bitmaps/R.h @@ -0,0 +1,5 @@ +#define R_width 5 +#define R_height 7 +static unsigned char R_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11}; + diff --git a/jni/bitmaps/S.h b/jni/bitmaps/S.h new file mode 100644 index 0000000..e75f1b3 --- /dev/null +++ b/jni/bitmaps/S.h @@ -0,0 +1,5 @@ +#define S_width 5 +#define S_height 7 +static unsigned char S_bits[] = { + 0x0e, 0x11, 0x01, 0x0e, 0x10, 0x11, 0x0e}; + diff --git a/jni/bitmaps/T.h b/jni/bitmaps/T.h new file mode 100644 index 0000000..2be3707 --- /dev/null +++ b/jni/bitmaps/T.h @@ -0,0 +1,5 @@ +#define T_width 5 +#define T_height 7 +static unsigned char T_bits[] = { + 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04}; + diff --git a/jni/bitmaps/U.h b/jni/bitmaps/U.h new file mode 100644 index 0000000..0f91bff --- /dev/null +++ b/jni/bitmaps/U.h @@ -0,0 +1,5 @@ +#define U_width 5 +#define U_height 7 +static unsigned char U_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e}; + diff --git a/jni/bitmaps/V.h b/jni/bitmaps/V.h new file mode 100644 index 0000000..8750cf3 --- /dev/null +++ b/jni/bitmaps/V.h @@ -0,0 +1,5 @@ +#define V_width 5 +#define V_height 7 +static unsigned char V_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x0a, 0x0a, 0x04}; + diff --git a/jni/bitmaps/W.h b/jni/bitmaps/W.h new file mode 100644 index 0000000..ef468c0 --- /dev/null +++ b/jni/bitmaps/W.h @@ -0,0 +1,5 @@ +#define W_width 5 +#define W_height 7 +static unsigned char W_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x15, 0x1b, 0x11}; + diff --git a/jni/bitmaps/X.h b/jni/bitmaps/X.h new file mode 100644 index 0000000..791aea0 --- /dev/null +++ b/jni/bitmaps/X.h @@ -0,0 +1,5 @@ +#define X_width 5 +#define X_height 7 +static unsigned char X_bits[] = { + 0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11}; + diff --git a/jni/bitmaps/Y.h b/jni/bitmaps/Y.h new file mode 100644 index 0000000..72cd5ff --- /dev/null +++ b/jni/bitmaps/Y.h @@ -0,0 +1,5 @@ +#define Y_width 5 +#define Y_height 7 +static unsigned char Y_bits[] = { + 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, 0x04}; + diff --git a/jni/bitmaps/Z.h b/jni/bitmaps/Z.h new file mode 100644 index 0000000..fc44dac --- /dev/null +++ b/jni/bitmaps/Z.h @@ -0,0 +1,5 @@ +#define Z_width 5 +#define Z_height 7 +static unsigned char Z_bits[] = { + 0x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f}; + diff --git a/jni/bitmaps/alpha.h b/jni/bitmaps/alpha.h new file mode 100644 index 0000000..362ea67 --- /dev/null +++ b/jni/bitmaps/alpha.h @@ -0,0 +1,6 @@ +#define alpha_width 12 +#define alpha_height 10 +static unsigned char alpha_bits[] = { + 0x78, 0x00, 0x84, 0x08, 0x82, 0x09, 0x83, 0x05, 0x83, 0x05, 0x83, 0x03, + 0x83, 0x01, 0x83, 0x01, 0x46, 0x09, 0x3c, 0x06}; + diff --git a/jni/bitmaps/angle.h b/jni/bitmaps/angle.h new file mode 100644 index 0000000..38323b6 --- /dev/null +++ b/jni/bitmaps/angle.h @@ -0,0 +1,5 @@ +#define angle_width 8 +#define angle_height 7 +static unsigned char angle_bits[] = { + 0x40, 0x20, 0x10, 0x28, 0x44, 0x42, 0xff}; + diff --git a/jni/bitmaps/angle_gx.h b/jni/bitmaps/angle_gx.h new file mode 100644 index 0000000..1e5626a --- /dev/null +++ b/jni/bitmaps/angle_gx.h @@ -0,0 +1,6 @@ +#define angle_gx_width 12 +#define angle_gx_height 12 +static unsigned char angle_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01, + 0xb0, 0x03, 0x18, 0x03, 0x0c, 0x03, 0x06, 0x03, 0xff, 0x0f, 0xff, 0x0f}; + diff --git a/jni/bitmaps/ann_alpha.h b/jni/bitmaps/ann_alpha.h new file mode 100644 index 0000000..3dbff5c --- /dev/null +++ b/jni/bitmaps/ann_alpha.h @@ -0,0 +1,6 @@ +#define ann_alpha_width 15 +#define ann_alpha_height 12 +static unsigned char ann_alpha_bits[] = { + 0xe0, 0x03, 0x18, 0x44, 0x0c, 0x4c, 0x06, 0x2c, 0x07, 0x2c, 0x07, 0x1c, + 0x07, 0x0c, 0x07, 0x0c, 0x07, 0x0e, 0x0e, 0x4d, 0xf8, 0x38, 0x00, 0x00}; + diff --git a/jni/bitmaps/ann_battery.h b/jni/bitmaps/ann_battery.h new file mode 100644 index 0000000..7a906c6 --- /dev/null +++ b/jni/bitmaps/ann_battery.h @@ -0,0 +1,6 @@ +#define ann_battery_width 15 +#define ann_battery_height 12 +static unsigned char ann_battery_bits[] = { + 0x04, 0x10, 0x02, 0x20, 0x12, 0x24, 0x09, 0x48, 0xc9, 0x49, 0xc9, 0x49, + 0xc9, 0x49, 0x09, 0x48, 0x12, 0x24, 0x02, 0x20, 0x04, 0x10, 0x00, 0x00}; + diff --git a/jni/bitmaps/ann_busy.h b/jni/bitmaps/ann_busy.h new file mode 100644 index 0000000..083238b --- /dev/null +++ b/jni/bitmaps/ann_busy.h @@ -0,0 +1,6 @@ +#define ann_busy_width 15 +#define ann_busy_height 12 +static unsigned char ann_busy_bits[] = { + 0xfc, 0x1f, 0x08, 0x08, 0x08, 0x08, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, + 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0xc8, 0x09, 0xe8, 0x0b, 0xfc, 0x1f}; + diff --git a/jni/bitmaps/ann_io.h b/jni/bitmaps/ann_io.h new file mode 100644 index 0000000..0db7383 --- /dev/null +++ b/jni/bitmaps/ann_io.h @@ -0,0 +1,6 @@ +#define ann_io_width 15 +#define ann_io_height 12 +static unsigned char ann_io_bits[] = { + 0x0c, 0x00, 0x1e, 0x00, 0x33, 0x0c, 0x61, 0x18, 0xcc, 0x30, 0xfe, 0x7f, + 0xfe, 0x7f, 0xcc, 0x30, 0x61, 0x18, 0x33, 0x0c, 0x1e, 0x00, 0x0c, 0x00}; + diff --git a/jni/bitmaps/ann_left.h b/jni/bitmaps/ann_left.h new file mode 100644 index 0000000..e0d86c3 --- /dev/null +++ b/jni/bitmaps/ann_left.h @@ -0,0 +1,6 @@ +#define ann_left_width 15 +#define ann_left_height 12 +static unsigned char ann_left_bits[] = { + 0xfe, 0x3f, 0xff, 0x7f, 0x9f, 0x7f, 0xcf, 0x7f, 0xe7, 0x7f, 0x03, 0x78, + 0x03, 0x70, 0xe7, 0x73, 0xcf, 0x73, 0x9f, 0x73, 0xff, 0x73, 0xfe, 0x33}; + diff --git a/jni/bitmaps/ann_right.h b/jni/bitmaps/ann_right.h new file mode 100644 index 0000000..55213df --- /dev/null +++ b/jni/bitmaps/ann_right.h @@ -0,0 +1,6 @@ +#define ann_right_width 15 +#define ann_right_height 12 +static unsigned char ann_right_bits[] = { + 0xfe, 0x3f, 0xff, 0x7f, 0xff, 0x7c, 0xff, 0x79, 0xff, 0x73, 0x0f, 0x60, + 0x07, 0x60, 0xe7, 0x73, 0xe7, 0x79, 0xe7, 0x7c, 0xe7, 0x7f, 0xe6, 0x3f}; + diff --git a/jni/bitmaps/arrow.h b/jni/bitmaps/arrow.h new file mode 100644 index 0000000..25b6f49 --- /dev/null +++ b/jni/bitmaps/arrow.h @@ -0,0 +1,5 @@ +#define arrow_width 7 +#define arrow_height 7 +static unsigned char arrow_bits[] = { + 0x00, 0x08, 0x18, 0x3f, 0x18, 0x08, 0x00}; + diff --git a/jni/bitmaps/arrow_gx.h b/jni/bitmaps/arrow_gx.h new file mode 100644 index 0000000..9e05981 --- /dev/null +++ b/jni/bitmaps/arrow_gx.h @@ -0,0 +1,7 @@ +#define arrow_gx_width 18 +#define arrow_gx_height 12 +static unsigned char arrow_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0xfc, 0x00, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/blank.h b/jni/bitmaps/blank.h new file mode 100644 index 0000000..a506de3 --- /dev/null +++ b/jni/bitmaps/blank.h @@ -0,0 +1,5 @@ +#define blank_width 4 +#define blank_height 7 +static unsigned char blank_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/bracket_gx.h b/jni/bitmaps/bracket_gx.h new file mode 100644 index 0000000..6b07e93 --- /dev/null +++ b/jni/bitmaps/bracket_gx.h @@ -0,0 +1,6 @@ +#define bracket_gx_width 12 +#define bracket_gx_height 12 +static unsigned char bracket_gx_bits[] = { + 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, + 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x0f, 0x0f}; + diff --git a/jni/bitmaps/bs.h b/jni/bitmaps/bs.h new file mode 100644 index 0000000..bdf9838 --- /dev/null +++ b/jni/bitmaps/bs.h @@ -0,0 +1,6 @@ +#define bs_width 11 +#define bs_height 11 +static unsigned char bs_bits[] = { + 0x20, 0x00, 0x30, 0x00, 0x38, 0x00, 0xfc, 0x07, 0xfe, 0x07, 0xff, 0x07, + 0xfe, 0x07, 0xfc, 0x07, 0x38, 0x00, 0x30, 0x00, 0x20, 0x00}; + diff --git a/jni/bitmaps/colon.h b/jni/bitmaps/colon.h new file mode 100644 index 0000000..955c22c --- /dev/null +++ b/jni/bitmaps/colon.h @@ -0,0 +1,5 @@ +#define colon_width 2 +#define colon_height 10 +static unsigned char colon_bits[] = { + 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/colon_gx.h b/jni/bitmaps/colon_gx.h new file mode 100644 index 0000000..67d639e --- /dev/null +++ b/jni/bitmaps/colon_gx.h @@ -0,0 +1,5 @@ +#define colon_gx_width 8 +#define colon_gx_height 12 +static unsigned char colon_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00}; + diff --git a/jni/bitmaps/comma.h b/jni/bitmaps/comma.h new file mode 100644 index 0000000..3886ff7 --- /dev/null +++ b/jni/bitmaps/comma.h @@ -0,0 +1,5 @@ +#define comma_width 3 +#define comma_height 7 +static unsigned char comma_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x03}; + diff --git a/jni/bitmaps/comma_gx.h b/jni/bitmaps/comma_gx.h new file mode 100644 index 0000000..810cca7 --- /dev/null +++ b/jni/bitmaps/comma_gx.h @@ -0,0 +1,5 @@ +#define comma_gx_width 3 +#define comma_gx_height 12 +static unsigned char comma_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02}; + diff --git a/jni/bitmaps/curly_gx.h b/jni/bitmaps/curly_gx.h new file mode 100644 index 0000000..134eda3 --- /dev/null +++ b/jni/bitmaps/curly_gx.h @@ -0,0 +1,6 @@ +#define curly_gx_width 14 +#define curly_gx_height 12 +static unsigned char curly_gx_bits[] = { + 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30, + 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x0c, 0x0c}; + diff --git a/jni/bitmaps/diff.h b/jni/bitmaps/diff.h new file mode 100644 index 0000000..19f8d88 --- /dev/null +++ b/jni/bitmaps/diff.h @@ -0,0 +1,5 @@ +#define diff_width 5 +#define diff_height 7 +static unsigned char diff_bits[] = { + 0x0e, 0x10, 0x10, 0x1e, 0x11, 0x11, 0x0e}; + diff --git a/jni/bitmaps/div.h b/jni/bitmaps/div.h new file mode 100644 index 0000000..be7c0f7 --- /dev/null +++ b/jni/bitmaps/div.h @@ -0,0 +1,6 @@ +#define div_width 10 +#define div_height 10 +static unsigned char div_bits[] = { + 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00}; + diff --git a/jni/bitmaps/down.h b/jni/bitmaps/down.h new file mode 100644 index 0000000..139aeb8 --- /dev/null +++ b/jni/bitmaps/down.h @@ -0,0 +1,6 @@ +#define down_width 11 +#define down_height 11 +static unsigned char down_bits[] = { + 0xff, 0x07, 0xfe, 0x03, 0xfe, 0x03, 0xfc, 0x01, 0xfc, 0x01, 0xf8, 0x00, + 0xf8, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0x20, 0x00}; + diff --git a/jni/bitmaps/equal.h b/jni/bitmaps/equal.h new file mode 100644 index 0000000..d7b9768 --- /dev/null +++ b/jni/bitmaps/equal.h @@ -0,0 +1,5 @@ +#define equal_width 5 +#define equal_height 7 +static unsigned char equal_bits[] = { + 0x00, 0x1f, 0x00, 0x00, 0x1f, 0x00, 0x00}; + diff --git a/jni/bitmaps/equal_gx.h b/jni/bitmaps/equal_gx.h new file mode 100644 index 0000000..cf64a72 --- /dev/null +++ b/jni/bitmaps/equal_gx.h @@ -0,0 +1,5 @@ +#define equal_gx_width 8 +#define equal_gx_height 12 +static unsigned char equal_gx_bits[] = { + 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/exp.h b/jni/bitmaps/exp.h new file mode 100644 index 0000000..06333cd --- /dev/null +++ b/jni/bitmaps/exp.h @@ -0,0 +1,6 @@ +#define exp_width 11 +#define exp_height 9 +static unsigned char exp_bits[] = { + 0x80, 0x04, 0x00, 0x03, 0x00, 0x01, 0x8c, 0x02, 0x52, 0x02, 0x09, 0x00, + 0x07, 0x00, 0x21, 0x00, 0x1e, 0x00}; + diff --git a/jni/bitmaps/exp_gx.h b/jni/bitmaps/exp_gx.h new file mode 100644 index 0000000..7242017 --- /dev/null +++ b/jni/bitmaps/exp_gx.h @@ -0,0 +1,5 @@ +#define exp_gx_width 13 +#define exp_gx_height 12 +static unsigned char exp_gx_bits[] = { + 0x00, 0xfb, 0x00, 0xf6, 0x00, 0xe6, 0x00, 0xf6, 0x80, 0xed, 0x18, 0xe0, + 0x36, 0xe0, 0x36, 0xe0, 0x1f, 0xe0, 0x03, 0xe0, 0x13, 0xe0, 0x0e, 0xe0}; diff --git a/jni/bitmaps/gx_128K_ram.h b/jni/bitmaps/gx_128K_ram.h new file mode 100644 index 0000000..a98cfdf --- /dev/null +++ b/jni/bitmaps/gx_128K_ram.h @@ -0,0 +1,20 @@ +#define gx_128K_ram_width 43 +#define gx_128K_ram_height 31 +static unsigned char gx_128K_ram_bits[] = { + 0xfe, 0xdf, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xdf, 0xff, 0xff, 0x03, 0x00, + 0xfe, 0xdf, 0xff, 0xff, 0x03, 0x00, 0xe2, 0xdf, 0xff, 0xff, 0x03, 0x00, + 0x9c, 0xdf, 0xff, 0xff, 0x03, 0x00, 0x7e, 0xdf, 0xff, 0xff, 0x01, 0x00, + 0x7e, 0xdf, 0xff, 0xff, 0x01, 0x00, 0xfe, 0xde, 0xff, 0xff, 0x02, 0x00, + 0xfe, 0xde, 0xff, 0xff, 0x02, 0x00, 0xfe, 0xdd, 0xff, 0x7f, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xdd, 0xff, 0xbf, 0x03, 0x00, + 0xfe, 0xdb, 0xff, 0xdf, 0x03, 0x00, 0xfe, 0xdb, 0xff, 0xef, 0x03, 0x00, + 0xfe, 0xd7, 0xff, 0xf7, 0x03, 0x00, 0xfe, 0xcf, 0xff, 0xfb, 0x03, 0x00, + 0xfe, 0xcf, 0xff, 0xfc, 0x03, 0x00, 0xfe, 0x1f, 0x3f, 0xff, 0x03, 0x00, + 0xfe, 0xdf, 0xc0, 0xff, 0x03, 0x00, 0xfe, 0xdf, 0xff, 0xff, 0x03, 0x00, + 0xfe, 0xdf, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x30, 0x12, 0x1c, 0x44, 0x04, + 0x27, 0x49, 0x0a, 0x24, 0x46, 0x04, 0x84, 0x39, 0x06, 0x24, 0xc9, 0x06, + 0x62, 0x24, 0x07, 0x9e, 0xaf, 0x06, 0x12, 0x24, 0x09, 0x92, 0xa8, 0x05, + 0xf2, 0x18, 0x11, 0x52, 0x28, 0x05}; + diff --git a/jni/bitmaps/gx_green.h b/jni/bitmaps/gx_green.h new file mode 100644 index 0000000..28e5b01 --- /dev/null +++ b/jni/bitmaps/gx_green.h @@ -0,0 +1,14 @@ +#define gx_green_width 34 +#define gx_green_height 22 +static unsigned char gx_green_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x03, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, + 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, + 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, + 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, + 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, + 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, + 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, + 0xf0, 0x03}; + diff --git a/jni/bitmaps/gx_silver.h b/jni/bitmaps/gx_silver.h new file mode 100644 index 0000000..20879f8 --- /dev/null +++ b/jni/bitmaps/gx_silver.h @@ -0,0 +1,13 @@ +#define gx_silver_width 35 +#define gx_silver_height 21 +static unsigned char gx_silver_bits[] = { + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, 0x00, 0xc4, 0x40, 0x00, 0x00, + 0x00, 0x02, 0x41, 0x00, 0x00, 0x04, 0x02, 0x41, 0x00, 0x00, 0x04, 0x02, + 0x42, 0x00, 0x00, 0x02, 0x01, 0x42, 0x00, 0x00, 0x02, 0x01, 0x44, 0x00, + 0x00, 0x01, 0xfd, 0xff, 0xff, 0xff, 0x07, 0x01, 0x44, 0x00, 0x80, 0x00, + 0x01, 0x48, 0x00, 0x40, 0x00, 0x01, 0x48, 0x00, 0x20, 0x00, 0x00, 0x50, + 0x00, 0x10, 0x00, 0x00, 0x60, 0x00, 0x08, 0x00, 0x00, 0x60, 0x00, 0x06, + 0x00, 0x00, 0xc0, 0x81, 0x01, 0x00, 0x00, 0x40, 0x7e, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/hash.h b/jni/bitmaps/hash.h new file mode 100644 index 0000000..56ce3b8 --- /dev/null +++ b/jni/bitmaps/hash.h @@ -0,0 +1,5 @@ +#define hash_width 5 +#define hash_height 7 +static unsigned char hash_bits[] = { + 0x00, 0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a}; + diff --git a/jni/bitmaps/hash_gx.h b/jni/bitmaps/hash_gx.h new file mode 100644 index 0000000..0481048 --- /dev/null +++ b/jni/bitmaps/hash_gx.h @@ -0,0 +1,5 @@ +#define hash_gx_width 8 +#define hash_gx_height 12 +static unsigned char hash_gx_bits[] = { + 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00}; + diff --git a/jni/bitmaps/hp.h b/jni/bitmaps/hp.h new file mode 100644 index 0000000..4c849d8 --- /dev/null +++ b/jni/bitmaps/hp.h @@ -0,0 +1,28 @@ +#define hp_width 96 +#define hp_height 24 +static unsigned char hp_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf8, 0x9f, 0xfd, 0x3f, 0x60, 0xcc, 0x6f, 0x66, 0x83, 0xdf, 0xff, 0x3f, + 0xfc, 0x9f, 0xf1, 0x7f, 0x60, 0xcc, 0x60, 0x66, 0x83, 0x01, 0x06, 0x06, + 0xfc, 0xc7, 0xc0, 0x7f, 0x60, 0xcc, 0x60, 0x66, 0x83, 0x01, 0x06, 0x06, + 0xfc, 0xc3, 0x80, 0x7f, 0x60, 0xcc, 0x40, 0x26, 0x83, 0x01, 0x06, 0x06, + 0xfc, 0x61, 0x00, 0x7f, 0xe0, 0xcf, 0xcf, 0x36, 0x83, 0x1f, 0x06, 0x06, + 0xfc, 0x60, 0x00, 0x7e, 0x60, 0xcc, 0xc0, 0x36, 0x83, 0x01, 0x06, 0x06, + 0xfc, 0x30, 0x00, 0x7e, 0x60, 0xcc, 0x80, 0x19, 0x83, 0x01, 0x06, 0x06, + 0x7c, 0xb0, 0x68, 0x7c, 0x60, 0xcc, 0x80, 0x19, 0x83, 0x01, 0x06, 0x06, + 0x7c, 0xf8, 0xf9, 0x7c, 0x60, 0xcc, 0x8f, 0x19, 0xbf, 0x1f, 0x06, 0x06, + 0x7c, 0x98, 0xcd, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xcc, 0xcc, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xcc, 0x66, 0x7c, 0xe0, 0x87, 0x81, 0x67, 0x0c, 0xc3, 0xcf, 0x0f, + 0x7c, 0x66, 0x66, 0x7c, 0x60, 0xcc, 0xc3, 0x6c, 0x86, 0xc7, 0xd8, 0x18, + 0x7c, 0x66, 0x3f, 0x7e, 0x60, 0x4c, 0x62, 0x60, 0x83, 0xc4, 0xd8, 0x30, + 0xfc, 0x00, 0x03, 0x7e, 0x60, 0x6c, 0x66, 0xe0, 0xc1, 0xcc, 0xd8, 0x30, + 0xfc, 0x80, 0x01, 0x7f, 0xe0, 0x67, 0x66, 0xe0, 0xc1, 0xcc, 0xcf, 0x30, + 0xfc, 0x81, 0x81, 0x7f, 0x60, 0xe0, 0x67, 0x60, 0xc3, 0xcf, 0xcc, 0x30, + 0xfc, 0xc3, 0xc0, 0x7f, 0x60, 0x30, 0x6c, 0x60, 0x66, 0xd8, 0xd8, 0x30, + 0xfc, 0xcf, 0xf0, 0x7f, 0x60, 0x30, 0xcc, 0x6c, 0x6c, 0xd8, 0xd8, 0x18, + 0xf8, 0x6f, 0xfe, 0x3f, 0x60, 0x30, 0x8c, 0x67, 0x78, 0xd8, 0xd8, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/hp48_blue.h b/jni/bitmaps/hp48_blue.h new file mode 100644 index 0000000..1704f55 --- /dev/null +++ b/jni/bitmaps/hp48_blue.h @@ -0,0 +1,9 @@ +#define hp48_blue_width 5 +#define hp48_blue_height 57 +static unsigned char hp48_blue_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c}; + diff --git a/jni/bitmaps/hp48_bottom.h b/jni/bitmaps/hp48_bottom.h new file mode 100644 index 0000000..f7e970f --- /dev/null +++ b/jni/bitmaps/hp48_bottom.h @@ -0,0 +1,26 @@ +#define hp48_bottom_width 32 +#define hp48_bottom_height 64 +static unsigned char hp48_bottom_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x63, 0x8c, 0x31, 0xc6, + 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x8c, 0x31, 0xc6, 0x03, 0x8c, 0x31, 0xc6, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, + 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe3, 0x30, 0x0c, 0xc3, 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, 0xe3, 0x30, 0x0c, 0xc3, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, + 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; + diff --git a/jni/bitmaps/hp48_disp.h b/jni/bitmaps/hp48_disp.h new file mode 100644 index 0000000..274fa98 --- /dev/null +++ b/jni/bitmaps/hp48_disp.h @@ -0,0 +1,11 @@ +#define hp48_disp_width 29 +#define hp48_disp_height 21 +static unsigned char hp48_disp_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, + 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, + 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, + 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, + 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f}; + diff --git a/jni/bitmaps/hp48_green_gx.h b/jni/bitmaps/hp48_green_gx.h new file mode 100644 index 0000000..1cae195 --- /dev/null +++ b/jni/bitmaps/hp48_green_gx.h @@ -0,0 +1,23 @@ +#define hp48_green_gx_width 29 +#define hp48_green_gx_height 57 +static unsigned char hp48_green_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/hp48_icon.h b/jni/bitmaps/hp48_icon.h new file mode 100644 index 0000000..150bba6 --- /dev/null +++ b/jni/bitmaps/hp48_icon.h @@ -0,0 +1,26 @@ +#define hp48_icon_width 32 +#define hp48_icon_height 64 +static unsigned char hp48_icon_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, + 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x07, 0xff, 0x01, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x63, 0x8c, 0x31, 0xc6, + 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x8c, 0x31, 0xc6, 0x03, 0x8c, 0x31, 0xc6, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, + 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe3, 0x30, 0x0c, 0xc3, 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, 0xe3, 0x30, 0x0c, 0xc3, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x30, 0x0c, 0xc3, + 0xe3, 0x30, 0x0c, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; + diff --git a/jni/bitmaps/hp48_keys.h b/jni/bitmaps/hp48_keys.h new file mode 100644 index 0000000..dc2ae29 --- /dev/null +++ b/jni/bitmaps/hp48_keys.h @@ -0,0 +1,25 @@ +#define hp48_keys_width 30 +#define hp48_keys_height 61 +static unsigned char hp48_keys_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9c, 0x73, 0xce, 0x39, 0x9c, 0x73, 0xce, 0x39, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9c, 0x73, 0xce, 0x39, 0x9c, 0x73, 0xce, 0x39, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x73, 0xce, 0x39, + 0x9c, 0x73, 0xce, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9c, 0x73, 0xce, 0x39, 0x9c, 0x73, 0xce, 0x39, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x73, 0xce, 0x39, 0xfc, 0x73, 0xce, 0x39, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xcf, 0xf3, 0x3c, + 0x1c, 0xcf, 0xf3, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xcf, 0xf3, 0x3c, 0x00, 0xcf, 0xf3, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xf3, 0x3c, 0x00, 0xcf, 0xf3, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xcf, 0xf3, 0x3c, + 0x1c, 0xcf, 0xf3, 0x3c}; + diff --git a/jni/bitmaps/hp48_logo.h b/jni/bitmaps/hp48_logo.h new file mode 100644 index 0000000..8ab9c21 --- /dev/null +++ b/jni/bitmaps/hp48_logo.h @@ -0,0 +1,5 @@ +#define hp48_logo_width 13 +#define hp48_logo_height 4 +static unsigned char hp48_logo_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0xf8, 0x1f}; + diff --git a/jni/bitmaps/hp48_logo_gx.h b/jni/bitmaps/hp48_logo_gx.h new file mode 100644 index 0000000..46a2010 --- /dev/null +++ b/jni/bitmaps/hp48_logo_gx.h @@ -0,0 +1,5 @@ +#define hp48_logo_gx_width 16 +#define hp48_logo_gx_height 4 +static unsigned char hp48_logo_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0xf8, 0xf7}; + diff --git a/jni/bitmaps/hp48_on.h b/jni/bitmaps/hp48_on.h new file mode 100644 index 0000000..226c029 --- /dev/null +++ b/jni/bitmaps/hp48_on.h @@ -0,0 +1,11 @@ +#define hp48_on_width 25 +#define hp48_on_height 19 +static unsigned char hp48_on_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x13, 0x01, + 0x00, 0x80, 0x12, 0x01, 0x80, 0x48, 0x12, 0x01, 0x80, 0xc8, 0xe7, 0x00, + 0x00, 0x05, 0x12, 0x01, 0x00, 0x02, 0x12, 0x01, 0x00, 0x05, 0x12, 0x01, + 0x80, 0x08, 0xe2, 0x00}; + diff --git a/jni/bitmaps/hp48_orange.h b/jni/bitmaps/hp48_orange.h new file mode 100644 index 0000000..c2100dc --- /dev/null +++ b/jni/bitmaps/hp48_orange.h @@ -0,0 +1,9 @@ +#define hp48_orange_width 5 +#define hp48_orange_height 53 +static unsigned char hp48_orange_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1c, 0x1c}; + diff --git a/jni/bitmaps/hp48_text.h b/jni/bitmaps/hp48_text.h new file mode 100644 index 0000000..a375d83 --- /dev/null +++ b/jni/bitmaps/hp48_text.h @@ -0,0 +1,7 @@ +#define hp48_text_width 29 +#define hp48_text_height 7 +static unsigned char hp48_text_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0xfe, 0x1f}; + diff --git a/jni/bitmaps/hp48_text_gx.h b/jni/bitmaps/hp48_text_gx.h new file mode 100644 index 0000000..bcc2a41 --- /dev/null +++ b/jni/bitmaps/hp48_text_gx.h @@ -0,0 +1,7 @@ +#define hp48_text_gx_width 29 +#define hp48_text_gx_height 7 +static unsigned char hp48_text_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f}; + diff --git a/jni/bitmaps/hp48_top.h b/jni/bitmaps/hp48_top.h new file mode 100644 index 0000000..3f7c38e --- /dev/null +++ b/jni/bitmaps/hp48_top.h @@ -0,0 +1,14 @@ +#define hp48_top_width 32 +#define hp48_top_height 30 +static unsigned char hp48_top_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, + 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x07, 0xff, 0x01, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff}; + diff --git a/jni/bitmaps/hp48_top_gx.h b/jni/bitmaps/hp48_top_gx.h new file mode 100644 index 0000000..f2735e8 --- /dev/null +++ b/jni/bitmaps/hp48_top_gx.h @@ -0,0 +1,14 @@ +#define hp48_top_gx_width 32 +#define hp48_top_gx_height 30 +static unsigned char hp48_top_gx_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x08, 0xff, 0xe1, + 0x07, 0x08, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x63, 0x8c, 0x31, 0xc6, 0x63, 0x8c, 0x31, 0xc6, 0xff, 0xff, 0xff, 0xff}; + diff --git a/jni/bitmaps/hp48gx.h b/jni/bitmaps/hp48gx.h new file mode 100644 index 0000000..e1b6aba --- /dev/null +++ b/jni/bitmaps/hp48gx.h @@ -0,0 +1,11 @@ +#define hp48gx_width 44 +#define hp48gx_height 14 +static unsigned char hp48gx_bits[] = { + 0x00, 0xc3, 0x03, 0x7c, 0x0c, 0x0c, 0x80, 0xe3, 0x07, 0xff, 0x0c, 0x0e, + 0xc0, 0x33, 0x86, 0xc3, 0x1c, 0x06, 0xe0, 0x31, 0xc6, 0xc0, 0x18, 0x03, + 0xb0, 0x31, 0xe6, 0x00, 0xb0, 0x01, 0x98, 0x31, 0x63, 0x00, 0xf0, 0x01, + 0x8c, 0xe1, 0x61, 0x00, 0xe0, 0x00, 0xc6, 0xb8, 0x31, 0xfc, 0x70, 0x00, + 0xc7, 0x18, 0x33, 0xfc, 0xf8, 0x00, 0xff, 0x0d, 0x33, 0x60, 0xd8, 0x00, + 0xff, 0x0d, 0x73, 0x60, 0x8c, 0x01, 0x60, 0x8c, 0x63, 0x30, 0x86, 0x03, + 0x60, 0xfc, 0xe1, 0x3f, 0x07, 0x03, 0x60, 0xf8, 0x80, 0x37, 0x03, 0x03}; + diff --git a/jni/bitmaps/hp48sx.h b/jni/bitmaps/hp48sx.h new file mode 100644 index 0000000..f60539e --- /dev/null +++ b/jni/bitmaps/hp48sx.h @@ -0,0 +1,9 @@ +#define hp48sx_width 42 +#define hp48sx_height 10 +static unsigned char hp48sx_bits[] = { + 0xe0, 0xf1, 0xc3, 0x3f, 0x87, 0x03, 0xf0, 0xf9, 0xe7, 0x7f, 0xc7, 0x01, + 0xf8, 0x39, 0xe7, 0x70, 0xee, 0x00, 0xdc, 0x39, 0xe7, 0x00, 0x7e, 0x00, + 0xee, 0xf0, 0xe3, 0x0f, 0x3c, 0x00, 0xe7, 0xf8, 0xc1, 0x1f, 0x1c, 0x00, + 0xff, 0x9d, 0x03, 0x1c, 0x3e, 0x00, 0xff, 0x9d, 0x3b, 0x1c, 0x3f, 0x00, + 0x70, 0xfc, 0xfb, 0x9f, 0x73, 0x00, 0x70, 0xf8, 0xf1, 0xcf, 0x71, 0x00}; + diff --git a/jni/bitmaps/integral.h b/jni/bitmaps/integral.h new file mode 100644 index 0000000..bb82d19 --- /dev/null +++ b/jni/bitmaps/integral.h @@ -0,0 +1,5 @@ +#define integral_width 5 +#define integral_height 8 +static unsigned char integral_bits[] = { + 0x0c, 0x12, 0x02, 0x04, 0x04, 0x08, 0x09, 0x06}; + diff --git a/jni/bitmaps/inv.h b/jni/bitmaps/inv.h new file mode 100644 index 0000000..40e49bc --- /dev/null +++ b/jni/bitmaps/inv.h @@ -0,0 +1,8 @@ +#define inv_width 18 +#define inv_height 13 +static unsigned char inv_bits[] = { + 0x0c, 0x04, 0x00, 0x0f, 0x06, 0x00, 0x0c, 0x02, 0x00, 0x0c, 0x03, 0x00, + 0x0c, 0x01, 0x00, 0x8c, 0x19, 0x03, 0x8c, 0xb0, 0x02, 0xcc, 0x70, 0x00, + 0x40, 0x60, 0x00, 0x60, 0x60, 0x00, 0x20, 0xf0, 0x00, 0x30, 0xd4, 0x02, + 0x10, 0x8c, 0x01}; + diff --git a/jni/bitmaps/last.h b/jni/bitmaps/last.h new file mode 100644 index 0000000..a9e2050 --- /dev/null +++ b/jni/bitmaps/last.h @@ -0,0 +1,12 @@ +#define last_width 120 +#define last_height 6 +static unsigned char last_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xc6, 0x1c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x11, 0x49, 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x8f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29, 0x09, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc9, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}; + diff --git a/jni/bitmaps/lbrace.h b/jni/bitmaps/lbrace.h new file mode 100644 index 0000000..abc6290 --- /dev/null +++ b/jni/bitmaps/lbrace.h @@ -0,0 +1,5 @@ +#define lbrace_width 3 +#define lbrace_height 7 +static unsigned char lbrace_bits[] = { + 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04}; + diff --git a/jni/bitmaps/lbracket.h b/jni/bitmaps/lbracket.h new file mode 100644 index 0000000..c89473c --- /dev/null +++ b/jni/bitmaps/lbracket.h @@ -0,0 +1,5 @@ +#define lbracket_width 3 +#define lbracket_height 7 +static unsigned char lbracket_bits[] = { + 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07}; + diff --git a/jni/bitmaps/lcurly.h b/jni/bitmaps/lcurly.h new file mode 100644 index 0000000..17b19cf --- /dev/null +++ b/jni/bitmaps/lcurly.h @@ -0,0 +1,5 @@ +#define lcurly_width 5 +#define lcurly_height 7 +static unsigned char lcurly_bits[] = { + 0x18, 0x04, 0x04, 0x02, 0x04, 0x04, 0x18}; + diff --git a/jni/bitmaps/left.h b/jni/bitmaps/left.h new file mode 100644 index 0000000..2d213ed --- /dev/null +++ b/jni/bitmaps/left.h @@ -0,0 +1,6 @@ +#define left_width 11 +#define left_height 11 +static unsigned char left_bits[] = { + 0x00, 0x04, 0x00, 0x07, 0xc0, 0x07, 0xf0, 0x07, 0xfc, 0x07, 0xff, 0x07, + 0xfc, 0x07, 0xf0, 0x07, 0xc0, 0x07, 0x00, 0x07, 0x00, 0x04}; + diff --git a/jni/bitmaps/menu_label.h b/jni/bitmaps/menu_label.h new file mode 100644 index 0000000..27abbc9 --- /dev/null +++ b/jni/bitmaps/menu_label.h @@ -0,0 +1,7 @@ +#define menu_label_width 24 +#define menu_label_height 11 +static unsigned char menu_label_bits[] = { + 0xfe, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x7f}; + diff --git a/jni/bitmaps/minus.h b/jni/bitmaps/minus.h new file mode 100644 index 0000000..521f66d --- /dev/null +++ b/jni/bitmaps/minus.h @@ -0,0 +1,6 @@ +#define minus_width 10 +#define minus_height 10 +static unsigned char minus_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/mul.h b/jni/bitmaps/mul.h new file mode 100644 index 0000000..9f3542c --- /dev/null +++ b/jni/bitmaps/mul.h @@ -0,0 +1,6 @@ +#define mul_width 10 +#define mul_height 10 +static unsigned char mul_bits[] = { + 0x03, 0x03, 0x87, 0x03, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x78, 0x00, + 0xfc, 0x00, 0xce, 0x01, 0x87, 0x03, 0x03, 0x03}; + diff --git a/jni/bitmaps/neg.h b/jni/bitmaps/neg.h new file mode 100644 index 0000000..6c49f9b --- /dev/null +++ b/jni/bitmaps/neg.h @@ -0,0 +1,7 @@ +#define neg_width 21 +#define neg_height 11 +static unsigned char neg_bits[] = { + 0x18, 0x00, 0x00, 0x18, 0x30, 0x00, 0x18, 0x30, 0x00, 0xff, 0x18, 0x00, + 0xff, 0x18, 0x00, 0x18, 0x0c, 0x00, 0x18, 0x0c, 0x00, 0x18, 0xc6, 0x1f, + 0x00, 0xc6, 0x1f, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00}; + diff --git a/jni/bitmaps/nl.h b/jni/bitmaps/nl.h new file mode 100644 index 0000000..7b7e1e4 --- /dev/null +++ b/jni/bitmaps/nl.h @@ -0,0 +1,5 @@ +#define nl_width 8 +#define nl_height 7 +static unsigned char nl_bits[] = { + 0x00, 0x84, 0x86, 0xff, 0x06, 0x04, 0x00}; + diff --git a/jni/bitmaps/nl_gx.h b/jni/bitmaps/nl_gx.h new file mode 100644 index 0000000..ced50dd --- /dev/null +++ b/jni/bitmaps/nl_gx.h @@ -0,0 +1,7 @@ +#define nl_gx_width 18 +#define nl_gx_height 12 +static unsigned char nl_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03, + 0xfc, 0x00, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/parens_gx.h b/jni/bitmaps/parens_gx.h new file mode 100644 index 0000000..f1661fa --- /dev/null +++ b/jni/bitmaps/parens_gx.h @@ -0,0 +1,7 @@ +#define parens_gx_width 20 +#define parens_gx_height 12 +static unsigned char parens_gx_bits[] = { + 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c, + 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, + 0x03, 0x00, 0x0c, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x0c, 0x00, 0x03}; + diff --git a/jni/bitmaps/pi.h b/jni/bitmaps/pi.h new file mode 100644 index 0000000..9fcaa44 --- /dev/null +++ b/jni/bitmaps/pi.h @@ -0,0 +1,5 @@ +#define pi_width 6 +#define pi_height 7 +static unsigned char pi_bits[] = { + 0x20, 0x1f, 0x12, 0x12, 0x12, 0x12, 0x12}; + diff --git a/jni/bitmaps/pi_gx.h b/jni/bitmaps/pi_gx.h new file mode 100644 index 0000000..144db5e --- /dev/null +++ b/jni/bitmaps/pi_gx.h @@ -0,0 +1,6 @@ +#define pi_gx_width 10 +#define pi_gx_height 12 +static unsigned char pi_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01, + 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00}; + diff --git a/jni/bitmaps/plus.h b/jni/bitmaps/plus.h new file mode 100644 index 0000000..4c3de62 --- /dev/null +++ b/jni/bitmaps/plus.h @@ -0,0 +1,6 @@ +#define plus_width 10 +#define plus_height 10 +static unsigned char plus_bits[] = { + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xff, 0x03, 0xff, 0x03, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00}; + diff --git a/jni/bitmaps/pow10.h b/jni/bitmaps/pow10.h new file mode 100644 index 0000000..72b6f41 --- /dev/null +++ b/jni/bitmaps/pow10.h @@ -0,0 +1,6 @@ +#define pow10_width 13 +#define pow10_height 9 +static unsigned char pow10_bits[] = { + 0x00, 0x12, 0x00, 0x0c, 0x32, 0x04, 0x4b, 0x0a, 0x4a, 0x09, 0x4a, 0x00, + 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00}; + diff --git a/jni/bitmaps/pow10_gx.h b/jni/bitmaps/pow10_gx.h new file mode 100644 index 0000000..76f20b1 --- /dev/null +++ b/jni/bitmaps/pow10_gx.h @@ -0,0 +1,6 @@ +#define pow10_gx_width 13 +#define pow10_gx_height 12 +static unsigned char pow10_gx_bits[] = { + 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00, + 0x4b, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00}; + diff --git a/jni/bitmaps/power.h b/jni/bitmaps/power.h new file mode 100644 index 0000000..13f4365 --- /dev/null +++ b/jni/bitmaps/power.h @@ -0,0 +1,8 @@ +#define power_width 17 +#define power_height 14 +static unsigned char power_bits[] = { + 0x00, 0x8c, 0x01, 0x00, 0x58, 0x01, 0x00, 0x38, 0x00, 0xc8, 0x30, 0x00, + 0x9c, 0x30, 0x00, 0x98, 0x78, 0x00, 0x58, 0x6a, 0x01, 0x58, 0xc6, 0x00, + 0x38, 0x00, 0x00, 0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x03, 0x00, 0x00}; + diff --git a/jni/bitmaps/prog.h b/jni/bitmaps/prog.h new file mode 100644 index 0000000..3c9d0ee --- /dev/null +++ b/jni/bitmaps/prog.h @@ -0,0 +1,6 @@ +#define prog_width 16 +#define prog_height 7 +static unsigned char prog_bits[] = { + 0x48, 0x12, 0x24, 0x24, 0x12, 0x48, 0x09, 0x90, 0x12, 0x48, 0x24, 0x24, + 0x48, 0x12}; + diff --git a/jni/bitmaps/prog_gx.h b/jni/bitmaps/prog_gx.h new file mode 100644 index 0000000..9653654 --- /dev/null +++ b/jni/bitmaps/prog_gx.h @@ -0,0 +1,7 @@ +#define prog_gx_width 24 +#define prog_gx_height 12 +static unsigned char prog_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18, + 0x8c, 0x81, 0x31, 0xc6, 0x00, 0x63, 0x63, 0x00, 0xc6, 0xc6, 0x00, 0x63, + 0x8c, 0x81, 0x31, 0x18, 0xc3, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/quote_gx.h b/jni/bitmaps/quote_gx.h new file mode 100644 index 0000000..1f1888c --- /dev/null +++ b/jni/bitmaps/quote_gx.h @@ -0,0 +1,6 @@ +#define quote_gx_width 12 +#define quote_gx_height 12 +static unsigned char quote_gx_bits[] = { + 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + diff --git a/jni/bitmaps/rbrace.h b/jni/bitmaps/rbrace.h new file mode 100644 index 0000000..6426067 --- /dev/null +++ b/jni/bitmaps/rbrace.h @@ -0,0 +1,5 @@ +#define rbrace_width 3 +#define rbrace_height 7 +static unsigned char rbrace_bits[] = { + 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01}; + diff --git a/jni/bitmaps/rbracket.h b/jni/bitmaps/rbracket.h new file mode 100644 index 0000000..fb8300e --- /dev/null +++ b/jni/bitmaps/rbracket.h @@ -0,0 +1,5 @@ +#define rbracket_width 3 +#define rbracket_height 7 +static unsigned char rbracket_bits[] = { + 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07}; + diff --git a/jni/bitmaps/rcurly.h b/jni/bitmaps/rcurly.h new file mode 100644 index 0000000..ddfc65f --- /dev/null +++ b/jni/bitmaps/rcurly.h @@ -0,0 +1,5 @@ +#define rcurly_width 5 +#define rcurly_height 7 +static unsigned char rcurly_bits[] = { + 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03}; + diff --git a/jni/bitmaps/right.h b/jni/bitmaps/right.h new file mode 100644 index 0000000..e62057d --- /dev/null +++ b/jni/bitmaps/right.h @@ -0,0 +1,6 @@ +#define right_width 11 +#define right_height 11 +static unsigned char right_bits[] = { + 0x01, 0x00, 0x07, 0x00, 0x1f, 0x00, 0x7f, 0x00, 0xff, 0x01, 0xff, 0x07, + 0xff, 0x01, 0x7f, 0x00, 0x1f, 0x00, 0x07, 0x00, 0x01, 0x00}; + diff --git a/jni/bitmaps/root.h b/jni/bitmaps/root.h new file mode 100644 index 0000000..fc334fd --- /dev/null +++ b/jni/bitmaps/root.h @@ -0,0 +1,8 @@ +#define root_width 18 +#define root_height 13 +static unsigned char root_bits[] = { + 0x26, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0xfe, 0x03, 0x14, 0x02, 0x02, + 0x53, 0x02, 0x00, 0x21, 0x99, 0x00, 0x00, 0x91, 0x00, 0x10, 0x91, 0x00, + 0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, + 0x00, 0x0c, 0x00}; + diff --git a/jni/bitmaps/root_gx.h b/jni/bitmaps/root_gx.h new file mode 100644 index 0000000..e2deba7 --- /dev/null +++ b/jni/bitmaps/root_gx.h @@ -0,0 +1,8 @@ +#define root_gx_width 18 +#define root_gx_height 15 +static unsigned char root_gx_bits[] = { + 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, + 0x53, 0xfe, 0x03, 0x21, 0x02, 0x02, 0x00, 0x02, 0x00, 0x00, 0x99, 0x00, + 0x00, 0x91, 0x00, 0x10, 0x91, 0x00, 0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, + 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x00}; + diff --git a/jni/bitmaps/science.h b/jni/bitmaps/science.h new file mode 100644 index 0000000..20750c2 --- /dev/null +++ b/jni/bitmaps/science.h @@ -0,0 +1,16 @@ +#define science_width 131 +#define science_height 8 +static unsigned char science_bits[] = { + 0x38, 0x1c, 0xf2, 0x09, 0x7d, 0x79, 0xe2, 0x80, 0x2f, 0xe4, 0x41, 0x08, + 0x79, 0x20, 0x3c, 0xc2, 0x07, 0x44, 0x22, 0x12, 0x08, 0x11, 0x09, 0x12, + 0x81, 0x20, 0x22, 0x62, 0x08, 0x89, 0x30, 0x44, 0x42, 0x00, 0x02, 0x01, + 0x09, 0x94, 0x88, 0x04, 0x09, 0x40, 0x40, 0x11, 0x52, 0x94, 0x88, 0x28, + 0x42, 0x21, 0x00, 0x1c, 0x01, 0xf9, 0x94, 0x88, 0x3c, 0x09, 0xc0, 0xc7, + 0xf0, 0x51, 0x94, 0x84, 0x28, 0x3e, 0xe1, 0x03, 0xa0, 0x00, 0x09, 0x94, + 0x88, 0x04, 0x05, 0x40, 0xc0, 0x10, 0x48, 0x94, 0x44, 0x24, 0x22, 0x21, + 0x00, 0xa1, 0xa0, 0x04, 0xa2, 0x44, 0x82, 0x04, 0x21, 0xa0, 0x08, 0xfc, + 0xa2, 0x42, 0x7e, 0xa1, 0x10, 0x00, 0x91, 0x90, 0x04, 0x42, 0x44, 0x82, + 0x84, 0x20, 0x10, 0x09, 0x84, 0x42, 0x22, 0x42, 0xb1, 0x10, 0x00, 0x0e, + 0x8f, 0x7c, 0x42, 0x44, 0x82, 0x78, 0xe0, 0x0b, 0x09, 0x82, 0x42, 0x1e, + 0x41, 0x9f, 0xf7, 0x01}; + diff --git a/jni/bitmaps/shl.h b/jni/bitmaps/shl.h new file mode 100644 index 0000000..7b08ee0 --- /dev/null +++ b/jni/bitmaps/shl.h @@ -0,0 +1,8 @@ +#define shl_width 24 +#define shl_height 14 +static unsigned char shl_bits[] = { + 0xfe, 0xff, 0x7f, 0xff, 0xfc, 0xff, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0xff, + 0x1f, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0x07, 0x00, 0xf8, 0x0f, 0x00, 0xf0, + 0x1f, 0xff, 0xf1, 0x3f, 0xfe, 0xf1, 0x7f, 0xfc, 0xf1, 0xff, 0xfc, 0xf1, + 0xff, 0xff, 0xf1, 0xfe, 0xff, 0x71}; + diff --git a/jni/bitmaps/shr.h b/jni/bitmaps/shr.h new file mode 100644 index 0000000..e67e991 --- /dev/null +++ b/jni/bitmaps/shr.h @@ -0,0 +1,8 @@ +#define shr_width 24 +#define shr_height 14 +static unsigned char shr_bits[] = { + 0xfe, 0xff, 0x7f, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0x7f, 0xfc, + 0xff, 0xff, 0xf8, 0x3f, 0x00, 0xf0, 0x1f, 0x00, 0xe0, 0x0f, 0x00, 0xf0, + 0x8f, 0xff, 0xf8, 0x8f, 0x7f, 0xfc, 0x8f, 0x3f, 0xfe, 0x8f, 0x3f, 0xff, + 0x8f, 0xff, 0xff, 0x8e, 0xff, 0x7f}; + diff --git a/jni/bitmaps/sigma.h b/jni/bitmaps/sigma.h new file mode 100644 index 0000000..4cb47ee --- /dev/null +++ b/jni/bitmaps/sigma.h @@ -0,0 +1,5 @@ +#define sigma_width 6 +#define sigma_height 9 +static unsigned char sigma_bits[] = { + 0x3f, 0x21, 0x02, 0x04, 0x08, 0x04, 0x02, 0x21, 0x3f}; + diff --git a/jni/bitmaps/slash.h b/jni/bitmaps/slash.h new file mode 100644 index 0000000..4c1e502 --- /dev/null +++ b/jni/bitmaps/slash.h @@ -0,0 +1,5 @@ +#define slash_width 3 +#define slash_height 7 +static unsigned char slash_bits[] = { + 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01}; + diff --git a/jni/bitmaps/small_colon.h b/jni/bitmaps/small_colon.h new file mode 100644 index 0000000..12ee42e --- /dev/null +++ b/jni/bitmaps/small_colon.h @@ -0,0 +1,5 @@ +#define small_colon_width 2 +#define small_colon_height 7 +static unsigned char small_colon_bits[] = { + 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x00}; + diff --git a/jni/bitmaps/sqr.h b/jni/bitmaps/sqr.h new file mode 100644 index 0000000..6c0045d --- /dev/null +++ b/jni/bitmaps/sqr.h @@ -0,0 +1,6 @@ +#define sqr_width 11 +#define sqr_height 10 +static unsigned char sqr_bits[] = { + 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x26, 0x01, 0x94, 0x07, + 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, 0x21, 0x00}; + diff --git a/jni/bitmaps/sqr_gx.h b/jni/bitmaps/sqr_gx.h new file mode 100644 index 0000000..02a652e --- /dev/null +++ b/jni/bitmaps/sqr_gx.h @@ -0,0 +1,7 @@ +#define sqr_gx_width 11 +#define sqr_gx_height 13 +static unsigned char sqr_gx_bits[] = { + 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, + 0x00, 0x00, 0x66, 0x00, 0x14, 0x00, 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, + 0x21, 0x00}; + diff --git a/jni/bitmaps/sqrt.h b/jni/bitmaps/sqrt.h new file mode 100644 index 0000000..80e213e --- /dev/null +++ b/jni/bitmaps/sqrt.h @@ -0,0 +1,7 @@ +#define sqrt_width 20 +#define sqrt_height 11 +static unsigned char sqrt_bits[] = { + 0x00, 0xff, 0x0f, 0x00, 0x01, 0x08, 0x00, 0x01, 0x08, 0x80, 0x8c, 0x01, + 0x80, 0x58, 0x01, 0x80, 0x38, 0x00, 0x47, 0x30, 0x00, 0x4c, 0x30, 0x00, + 0x58, 0x78, 0x00, 0x30, 0x6a, 0x01, 0x20, 0xc6, 0x00}; + diff --git a/jni/bitmaps/string.h b/jni/bitmaps/string.h new file mode 100644 index 0000000..ff22901 --- /dev/null +++ b/jni/bitmaps/string.h @@ -0,0 +1,6 @@ +#define string_width 10 +#define string_height 7 +static unsigned char string_bits[] = { + 0x85, 0x02, 0x85, 0x02, 0x85, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00}; + diff --git a/jni/bitmaps/three.h b/jni/bitmaps/three.h new file mode 100644 index 0000000..ca76550 --- /dev/null +++ b/jni/bitmaps/three.h @@ -0,0 +1,5 @@ +#define three_width 5 +#define three_height 7 +static unsigned char three_bits[] = { + 0x0e, 0x11, 0x10, 0x0c, 0x10, 0x11, 0x0e}; + diff --git a/jni/bitmaps/two.h b/jni/bitmaps/two.h new file mode 100644 index 0000000..485e69f --- /dev/null +++ b/jni/bitmaps/two.h @@ -0,0 +1,5 @@ +#define two_width 5 +#define two_height 7 +static unsigned char two_bits[] = { + 0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f}; + diff --git a/jni/bitmaps/under.h b/jni/bitmaps/under.h new file mode 100644 index 0000000..9319334 --- /dev/null +++ b/jni/bitmaps/under.h @@ -0,0 +1,5 @@ +#define under_width 6 +#define under_height 7 +static unsigned char under_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f}; + diff --git a/jni/bitmaps/under_gx.h b/jni/bitmaps/under_gx.h new file mode 100644 index 0000000..0ba4753 --- /dev/null +++ b/jni/bitmaps/under_gx.h @@ -0,0 +1,6 @@ +#define under_gx_width 10 +#define under_gx_height 12 +static unsigned char under_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03}; + diff --git a/jni/bitmaps/up.h b/jni/bitmaps/up.h new file mode 100644 index 0000000..483cc74 --- /dev/null +++ b/jni/bitmaps/up.h @@ -0,0 +1,6 @@ +#define up_width 11 +#define up_height 11 +static unsigned char up_bits[] = { + 0x20, 0x00, 0x20, 0x00, 0x70, 0x00, 0x70, 0x00, 0xf8, 0x00, 0xf8, 0x00, + 0xfc, 0x01, 0xfc, 0x01, 0xfe, 0x03, 0xfe, 0x03, 0xff, 0x07}; + diff --git a/jni/buttons.h b/jni/buttons.h new file mode 100644 index 0000000..7600870 --- /dev/null +++ b/jni/buttons.h @@ -0,0 +1,84 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: buttons.h,v $ + * Revision 1.5 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added some newlines + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added some newlines + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * changed char to unsigned + * + * Revision 1.1 1994/09/13 15:05:11 ecd + * Initial revision + * + * + * $Id: buttons.h,v 1.5 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _BUTTONS_H +#define _BUTTONS_H 1 + +#include "bitmaps/menu_label.h" + +#include "bitmaps/up.h" + +#include "bitmaps/down.h" + +#include "bitmaps/left.h" + +#include "bitmaps/right.h" + +#include "bitmaps/sqrt.h" + +#include "bitmaps/power.h" + +#include "bitmaps/inv.h" + +#include "bitmaps/neg.h" + +#include "bitmaps/bs.h" + +#include "bitmaps/alpha.h" + +#include "bitmaps/div.h" + +#include "bitmaps/shl.h" + +#include "bitmaps/mul.h" + +#include "bitmaps/shr.h" + +#include "bitmaps/minus.h" + +#include "bitmaps/plus.h" + +#include "bitmaps/last.h" + +#include "bitmaps/colon.h" + +#endif /* !_BUTTONS_H */ diff --git a/jni/checkrom.c b/jni/checkrom.c new file mode 100644 index 0000000..6a52c19 --- /dev/null +++ b/jni/checkrom.c @@ -0,0 +1,144 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: checkrom.c,v $ + * Revision 1.4 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.3 1994/11/02 14:40:38 ecd + * support for "compressed" rom files added + * + * Revision 1.3 1994/11/02 14:40:38 ecd + * support for "compressed" rom files added + * + * Revision 1.2 1994/10/06 16:30:05 ecd + * changed char to unsigned + * + * Revision 1.1 1994/10/01 10:12:53 ecd + * Initial revision + * + * + * $Id: checkrom.c,v 1.4 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include +#include +#include +#include + +#include "global.h" +#include "romio.h" + +unsigned char *rom; +unsigned short rom_crc, crc; + +int verbose = 0; +char *progname; + +#define calc_crc(n) (crc = ((crc >> 4) ^ (((crc ^ n) & 0xf) * 0x1081))) + +int +#ifdef __FunctionProto__ +main(int argc, char **argv) +#else +main(argc, argv) +int argc; +char **argv; +#endif +{ + unsigned char version[7]; + long ver_addr; + int i, a, c, d, d0, d1, D0, D1; + int fail; + + if (argc < 2) { + LOGE( "usage: %s rom-file\n", argv[0]); + exit (1); + } + + if (!read_rom_file(argv[1], &rom, &rom_size)) + { + LOGE( "%s: can\'t read ROM from %s\n", argv[0], argv[1]); + exit (1); + } + + if (opt_gx != 0) + ver_addr = 0x7ffbf; + else + ver_addr = 0x7fff0; + + for (i = 0; i < 6; i++) { + version[i] = rom[ver_addr + 2 * i + 1] << 4; + version[i] |= rom[ver_addr + 2 * i]; + } + version[6] = '\0'; + printf("ROM Version is %s\n", version); + + + for (i = 0x100; i < 0x140; i++) { + rom[i] = 0x0; + } + + fail = a = 0; + D0 = 0x00000; + D1 = 0x40000; + for (d = 1; d <= rom_size / 0x80000; d++) { + + crc = 0x0000; + rom_crc = 0; + for (i = 0; i < 4; i++) { + rom_crc <<= 4; + rom_crc |= (rom[0x80000 * d - i - 1] & 0x0f); + } + + if (opt_gx) + printf("ROM CRC %d reads 0x%.4x\n", d, rom_crc); + else + printf("ROM CRC reads 0x%.4x\n", rom_crc); + + d0 = D0; + d1 = D1; + for (c = 0x3fff; c >= 0x0000; c--) { + for (i = 0; i < 16; i++) { + calc_crc(rom[d0 + i]); + } + d0 += 16; + for (i = 0; i < 16; i++) { + calc_crc(rom[d1 + i]); + } + d1 += 16; + } + D0 += 0x80000; + D1 += 0x80000; + a = crc; + a = ((a | 0xf0000) + 1) & 0xfffff; + + if (a != 0x00000) { + fail++; + } + } + + if (fail != 0) + printf("IROM %.4x: ROM CRC test FAILED !!!\n", a & 0xffff); + else + printf("IROM OK: ROM CRC test passed.\n"); + + return 0; +} + diff --git a/jni/config.h b/jni/config.h new file mode 100644 index 0000000..2da32a2 --- /dev/null +++ b/jni/config.h @@ -0,0 +1,181 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Name of person that compiled this program */ +#define COMPILE_BY "G. Allen Morris III" + +/* Date program was compiled */ +#define COMPILE_TIME "Wed Aug 5 17:51:25 EDT 2009" + +/* description */ +#define COMPILE_VERSION 0 + +/* Define to 1 if you have the `bzero' function. */ +#define HAVE_BZERO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `gethostname' function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `GL' library (-lGL). */ +#define HAVE_LIBGL 1 + +/* Define to 1 if you have the `history' library (-lhistory). */ +/* #undef HAVE_LIBHISTORY */ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define if Readline is used. */ +/* #undef HAVE_READLINE */ + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +/* #undef HAVE_STAT_EMPTY_STRING_BUG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the `uname' function. */ +#define HAVE_UNAME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if MIT Shared Memory extension is used. */ +/* #define HAVE_XSHM 1 */ + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 + +/* Name of package */ +#define PACKAGE "x48" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "x48-bugs@gam3.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "x48" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "x48 0.6.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "x48" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.6.1" + +/* The patch level */ +#define PATCHLEVEL 1 + +/* Define to the type of arg 1 for `select'. */ +#define SELECT_TYPE_ARG1 int + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#define SELECT_TYPE_ARG234 (fd_set *) + +/* Define to the type of arg 5 for `select'. */ +#define SELECT_TYPE_ARG5 (struct timeval *) + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Version number of package */ +#define VERSION "0.6.1" + +/* The major version */ +#define VERSION_MAJOR 0 + +/* The minor version */ +#define VERSION_MINOR 6 + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +//#define SYSV_TIME 1 + +/*#define DEBUG_BUTTONS +#define DEBUG_INTERRUPT +#define DEBUG_KBD_INT +#define DEBUG_TIMER +#define DEBUG_SHUTDOWN*/ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/jni/constants.h b/jni/constants.h new file mode 100644 index 0000000..bc84b07 --- /dev/null +++ b/jni/constants.h @@ -0,0 +1,48 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: constants.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/11/28 02:19:22 ecd + * simplified: no more GRAY_16, GRAY_256, etc. + * + * Revision 1.2 1994/11/28 02:19:22 ecd + * simplified: no more GRAY_16, GRAY_256, etc. + * + * Revision 1.1 1994/11/04 03:44:47 ecd + * Initial revision + * + * + * $Id: constants.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _CONSTANTS_H +#define _CONSTANTS_H 1 + +/* + * Color modes this program can cope with + */ +#define COLOR_MODE_MONO 1 +#define COLOR_MODE_GRAY 2 +#define COLOR_MODE_COLOR 3 + +#endif /* !_CONSTANTS_H */ + diff --git a/jni/debugger.c b/jni/debugger.c new file mode 100644 index 0000000..9a8d785 --- /dev/null +++ b/jni/debugger.c @@ -0,0 +1,1906 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: debugger.c,v $ + * Revision 1.8 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.7 1994/12/07 20:20:50 ecd + * more functions + * + * Revision 1.7 1994/12/07 20:20:50 ecd + * more functions + * + * Revision 1.6 1994/11/28 02:00:51 ecd + * new functions: do_ram, do_stack + * + * Revision 1.5 1994/11/02 14:40:38 ecd + * more functions + * + * Revision 1.4 1994/10/09 20:29:47 ecd + * start of disassembler implementation. + * + * Revision 1.3 1994/10/06 16:30:05 ecd + * added refresh_display() + * + * Revision 1.2 1994/10/05 08:36:44 ecd + * more functions + * + * Revision 1.1 1994/10/04 15:12:21 ecd + * Initial revision + * + * + * $Id: debugger.c,v 1.8 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include +#include +#include +#include +#ifdef SUNOS +#include +#endif + +#include "hp48.h" +#include "device.h" +#include "timer.h" +#include "x48.h" +#include "debugger.h" +#include "disasm.h" +#include "rpl.h" +#include "romio.h" +#include "resources.h" + +extern char *readline __ProtoType__ ((const char *)); +extern void add_history __ProtoType__ ((char *)); + +#define MAX_ARGS 16 + +int enter_debugger = 0; +int in_debugger = 0; +int exec_flags = 0; + +static int continue_flag; +static char instr[100]; + +/* + * Pointers in the HP48sx ROM + */ +#define DSKTOP_SX 0x70579 +#define DSKBOT_SX 0x7057e +#define DSKTOP_GX 0x806f8 +#define DSKBOT_GX 0x806fd + +/* + * Breakpoint related stuff + */ +#define BP_EXEC 1 +#define BP_READ 2 +#define BP_WRITE 4 +#define BP_RANGE 8 + +#define MAX_BREAKPOINTS 32 +int num_bkpts; + +struct breakpoint + { + word_20 addr; + word_20 end_addr; + int flags; + } + +bkpt_tbl[MAX_BREAKPOINTS + 1]; + +/* + * command functions + */ +static void do_break __ProtoType__ ((int, char **)); +static void do_continue __ProtoType__ ((int, char **)); +static void do_delete __ProtoType__ ((int, char **)); +static void do_exit __ProtoType__ ((int, char **)); +static void do_go __ProtoType__ ((int, char **)); +static void do_help __ProtoType__ ((int, char **)); +static void do_load __ProtoType__ ((int, char **)); +static void do_mode __ProtoType__ ((int, char **)); +static void do_quit __ProtoType__ ((int, char **)); +static void do_regs __ProtoType__ ((int, char **)); +static void do_save __ProtoType__ ((int, char **)); +static void do_stack __ProtoType__ ((int, char **)); +static void do_stat __ProtoType__ ((int, char **)); +static void do_step __ProtoType__ ((int, char **)); +static void do_ram __ProtoType__ ((int, char **)); +static void do_reset __ProtoType__ ((int, char **)); +static void do_rstk __ProtoType__ ((int, char **)); + +struct cmd + { + char *name; + void (*func) __ProtoType__ ((int, char **)); + char *help; + } + +cmd_tbl[] = +{ + { + "break", do_break, + "break [address] Set breakpoint at `address\' or show breakpoints" + } + , + { + "b", do_break, 0 + } + , + + { + "cont", do_continue, + "cont Continue execution" + } + , + { + "c", do_continue, 0 + } + , + + { + "delete", do_delete, + "delete [all | n] Delete breakpoint or watchpoint number `n\',\n all breakpoints, or current breakpoint" + } + , + { + "d", do_delete, 0 + } + , + + { + "exit", do_exit, + "exit Exit the emulator without saving" + } + , + + { + "go", do_go, + "go address Set PC to `address\'" + } + , + + { + "help", do_help, + "help Display this information" + } + , + { + "h", do_help, 0 + } + , + { + "?", do_help, 0 + } + , + + { + "load", do_load, + "load Load emulator-state from files" + } + , + + { + "mode", do_mode, + "mode [hp | class] Show or set disassembler mode" + } + , + + { + "quit", do_quit, + "quit Exit the emulator after saving its state" + } + , + { + "q", do_quit, 0 + } + , + + { + "ram", do_ram, + "ram Show RAM layout" + } + , + + { + "reg", do_regs, + "reg [register [hexvalue]] Display or set register value" + } + , + { + "r", do_regs, 0 + } + , + + { + "reset", do_reset, + "reset Set the HP48\'s PC to ZERO" + } + , + + { + "save", do_save, + "save Save emulator-state to files" + } + , + + { + "stack", do_stack, + "stack Display RPL stack" + } + , + + { + "stat", do_stat, + "stat Display statistics for the emulator" + } + , + + { + "step", do_step, + "step [n] Step one or n Instruction(s)" + } + , + { + "s", do_step, 0 + } + , + + { + "where", do_rstk, + "where Show ML return stack" + } + , + + { + 0, 0, 0 + } +}; + +void +#ifdef __FunctionProto__ +init_debugger (void) +#else +init_debugger () +#endif +{ + int i; + + num_bkpts = 0; + for (i = 0; i < MAX_BREAKPOINTS; i++) + bkpt_tbl[i].flags = 0; + exec_flags = 0; +} + +int +#ifdef __FunctionProto__ +check_breakpoint (int type, word_20 addr) +#else +check_breakpoint (type, addr) + int type; + word_20 addr; +#endif +{ + struct breakpoint *bp; + int i, n; + + bp = bkpt_tbl; + n = num_bkpts; + i = 0; + for (; n > 0; bp++) + { + i++; + if (bp->flags == 0) + continue; + n--; + if (bp->flags & BP_RANGE && addr >= bp->addr && addr <= bp->end_addr) + { + goto hit_it; + } + if (bp->flags & type && addr == bp->addr) + { + hit_it: + if (type == BP_READ) + { + printf ("%.5lX: Read watchpoint %d hit at %.5lX\n", saturn.PC, + i, addr); + } + else if (type == BP_WRITE) + { + printf ("%.5lX: Write watchpoint %d hit at %.5lX\n", saturn.PC, + i, addr); + } + else + { + printf ("Breakpoint %d hit at %.5lX\n", i, addr); + } + return 1; + } + } + return 0; +} + + +char * +#ifdef __FunctionProto__ +read_str(char *str, int n, int fp) +#else +read_str(str, n, fp) + char *str; + int n; + int fp; +#endif +{ + int cc; + int flags; + + while (1) + { + cc = read(fp, str, n); + if (cc > 0) + return str; + if (cc == 0) + return NULL; + + if (errno == EINTR) + continue; + + if (errno == EAGAIN) + { + flags = fcntl(fp, F_GETFL, 0); + flags &= ~ O_NONBLOCK; + fcntl(fp, F_SETFL, flags); + continue; + } + + return NULL; + } +} + + +static inline void +#ifdef __FunctionProto__ +str_to_upper (char *arg) +#else +str_to_upper (arg) + char *arg; +#endif +{ + int i; + + for (i = 0; i < strlen (arg); i++) + { + if ('a' <= arg[i] && arg[i] <= 'z') + { + arg[i] = (char) ((int) arg[i] - (int) 'a' + (int) 'A'); + } + } +} + +static int +#ifdef __FunctionProto__ +decode_dec (int *num, char *arg) +#else +decode_dec (num, arg) + int *num; + char *arg; +#endif +{ + int i; + + if (arg == (char *) 0) + { + printf ("Command requires an argument.\n"); + return 0; + } + + *num = 0; + for (i = 0; i < strlen (arg); i++) + { + *num *= 10; + if ('0' <= arg[i] && arg[i] <= '9') + { + *num += ((int) arg[i] - (int) '0'); + } + else + { + *num = 0; + printf ("Not a number: %s.\n", arg); + return 0; + } + } + return 1; +} + +static int +#ifdef __FunctionProto__ +decode_20 (word_20 * addr, char *arg) +#else +decode_20 (addr, arg) + word_20 *addr; + char *arg; +#endif +{ + int i; + + if (arg == (char *) 0) + { + printf ("Command requires an argument.\n"); + return 0; + } + + *addr = 0; + for (i = 0; i < strlen (arg); i++) + { + *addr <<= 4; + if ('0' <= arg[i] && arg[i] <= '9') + { + *addr |= ((int) arg[i] - (int) '0'); + } + else if ('A' <= arg[i] && arg[i] <= 'F') + { + *addr |= ((int) arg[i] - (int) 'A' + 10); + } + else + { + *addr = 0; + printf ("Not a number: %s.\n", arg); + return 0; + } + *addr &= 0xfffff; + } + return 1; +} + +static int +#ifdef __FunctionProto__ +decode_32 (word_32 * addr, char *arg) +#else +decode_32 (addr, arg) + word_32 *addr; + char *arg; +#endif +{ + int i; + + if (arg == (char *) 0) + { + printf ("Command requires an argument.\n"); + return 0; + } + + *addr = 0; + for (i = 0; i < strlen (arg); i++) + { + *addr <<= 4; + if ('0' <= arg[i] && arg[i] <= '9') + { + *addr |= ((int) arg[i] - (int) '0'); + } + else if ('A' <= arg[i] && arg[i] <= 'F') + { + *addr |= ((int) arg[i] - (int) 'A' + 10); + } + else + { + *addr = 0; + printf ("Not a number: %s.\n", arg); + return 0; + } + } + return 1; +} + +static int +#ifdef __FunctionProto__ +decode_64 (word_64 * addr, char *arg) +#else +decode_64 (addr, arg) + word_64 *addr; + char *arg; +#endif +{ + int i; + + if (arg == (char *) 0) + { + printf ("Command requires an argument.\n"); + return 0; + } + + addr->lo = addr->hi = 0; + for (i = 0; i < strlen (arg); i++) + { + addr->hi <<= 4; + addr->hi |= ((addr->lo >> 28) & 0x0f); + addr->lo <<= 4; + if ('0' <= arg[i] && arg[i] <= '9') + { + addr->lo |= ((int) arg[i] - (int) '0'); + } + else if ('A' <= arg[i] && arg[i] <= 'F') + { + addr->lo |= ((int) arg[i] - (int) 'A' + 10); + } + else + { + addr->hi = addr->lo = 0; + printf ("Not a number: %s.\n", arg); + return 0; + } + } + return 1; +} + +char * +#ifdef __FunctionProto__ +str_nibbles (word_20 addr, int n) +#else +str_nibbles (addr, n) + word_20 addr; + int n; +#endif +{ + static char str[1025]; + char *cp; + int i; + + if (n > 1024) + { + str[0] = '\0'; + return str; + } + + for (cp = str, i = 0; i < n; i++) + { + sprintf (cp, "%.1X", read_nibble (addr + i)); + cp++; + } + *cp = '\0'; + + return str; +} + +static int +#ifdef __FunctionProto__ +confirm (const char *prompt) +#else +confirm (prompt) + const char *prompt; +#endif +{ + char ans[80]; + + printf ("%s (y or n) ", prompt); + fflush (stdout); + read_str (ans, sizeof (ans), 0); + while (ans[0] != 'y' && ans[0] != 'Y' && ans[0] != 'n' && ans[0] != 'N') + { + printf ("Please answer y or n.\n"); + printf ("%s (y or n) ", prompt); + fflush (stdout); + read_str (ans, sizeof (ans), 0); + } + if (ans[0] == 'y' || ans[0] == 'Y') + { + return 1; + } + else + { + printf ("Not confirmed.\n"); + return 0; + } +} + +static void +#ifdef __FunctionProto__ +do_break (int argc, char **argv) +#else +do_break (argc, argv) + int argc; + char *argv; +#endif +{ + int i; + word_20 addr; + + if (argc == 1) + { + for (i = 0; i < MAX_BREAKPOINTS; i++) + { + if (bkpt_tbl[i].flags == 0) + continue; + if (bkpt_tbl[i].flags == BP_EXEC) + { + printf ("Breakpoint %d at 0x%.5lX\n", i + 1, bkpt_tbl[i].addr); + } + else if (bkpt_tbl[i].flags == BP_RANGE) + { + printf ("Range watchpoint %d at 0x%.5lX - 0x%.5lX\n", i + 1, + bkpt_tbl[i].addr, bkpt_tbl[i].end_addr); + } + else + { + printf ("Watchpoint %d at 0x%.5lX\n", i + 1, bkpt_tbl[i].addr); + } + } + } + else + { + str_to_upper (argv[1]); + if (!decode_20 (&addr, argv[1])) + { + return; + } + for (i = 0; i < MAX_BREAKPOINTS; i++) + { + if (bkpt_tbl[i].flags == 0) + { + bkpt_tbl[i].flags = BP_EXEC; + bkpt_tbl[i].addr = addr; + printf ("Breakpoint %d at 0x%.5lX\n", i + 1, bkpt_tbl[i].addr); + num_bkpts++; + return; + } + } + printf ("Breakpoint table full\n"); + } +} + +static void +#ifdef __FunctionProto__ +do_continue (int argc, char **argv) +#else +do_continue (argc, argv) + int argc; + char *argv; +#endif +{ + continue_flag = 1; +} + +static void +#ifdef __FunctionProto__ +do_delete (int argc, char **argv) +#else +do_delete (argc, argv) + int argc; + char *argv; +#endif +{ + int num; + + if (argc == 1) + { + for (num = 0; num < MAX_BREAKPOINTS; num++) + { + if (bkpt_tbl[num].addr == saturn.PC) + { + if (bkpt_tbl[num].flags == BP_EXEC) + { + printf ("Breakpoint %d at 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr); + } + else if (bkpt_tbl[num].flags == BP_RANGE) + { + printf ("Range watchpoint %d at 0x%.5lX - 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr, bkpt_tbl[num].end_addr); + } + else if (bkpt_tbl[num].flags) + { + printf ("Watchpoint %d at 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr); + } + num_bkpts--; + bkpt_tbl[num].addr = 0; + bkpt_tbl[num].flags = 0; + } + } + } + else + { + str_to_upper (argv[1]); + if (!strcmp ("ALL", argv[1])) + { + for (num = 0; num < MAX_BREAKPOINTS; num++) + { + bkpt_tbl[num].addr = 0; + bkpt_tbl[num].flags = 0; + } + num_bkpts = 0; + printf ("All breakpoints deleted.\n"); + } + else + { + if (decode_dec (&num, argv[1])) + { + if (num < 1 || num > MAX_BREAKPOINTS) + { + printf ("Breakpoint %d out of range.\n", num); + return; + } + num -= 1; + if (bkpt_tbl[num].flags == BP_EXEC) + { + printf ("Breakpoint %d at 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr); + } + else if (bkpt_tbl[num].flags == BP_RANGE) + { + printf ("Range watchpoint %d at 0x%.5lX - 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr, bkpt_tbl[num].end_addr); + } + else if (bkpt_tbl[num].flags) + { + printf ("Watchpoint %d at 0x%.5lX deleted.\n", + num + 1, bkpt_tbl[num].addr); + } + num_bkpts--; + bkpt_tbl[num].addr = 0; + bkpt_tbl[num].flags = 0; + } + } + } +} + +static void +#ifdef __FunctionProto__ +do_exit (int argc, char **argv) +#else +do_exit (argc, argv) + int argc; + char *argv; +#endif +{ + /*if (confirm ("Exit the emulator WITHOUT saving its state?")) + { + printf ("Exit.\n"); + XCloseDisplay(dpy); + exit (0); + }*/ +} + +static void +#ifdef __FunctionProto__ +do_go (int argc, char **argv) +#else +do_go (argc, argv) + int argc; + char *argv; +#endif +{ + word_20 addr; + + str_to_upper (argv[1]); + if (decode_20 (&addr, argv[1])) + { + saturn.PC = addr; + enter_debugger &= ~ILLEGAL_INSTRUCTION; + } +} + +static void +#ifdef __FunctionProto__ +do_help (int argc, char **argv) +#else +do_help (argc, argv) + int argc; + char *argv; +#endif +{ + int i; + + for (i = 0; cmd_tbl[i].name; i++) + { + if (cmd_tbl[i].help) + { + printf ("%s.\n", cmd_tbl[i].help); + } + } +} + +static void +#ifdef __FunctionProto__ +do_load (int argc, char **argv) +#else +do_load (argc, argv) + int argc; + char *argv; +#endif +{ + saturn_t tmp_saturn; + device_t tmp_device; + + if (confirm ("Load emulator-state from files?")) + { + memcpy (&tmp_saturn, &saturn, sizeof (saturn)); + memcpy (&tmp_device, &device, sizeof (device)); + memset (&saturn, 0, sizeof (saturn)); + if (read_files ()) + { + printf ("Loading done.\n"); + enter_debugger &= ~ILLEGAL_INSTRUCTION; + if (tmp_saturn.rom) + { + free (tmp_saturn.rom); + } + if (tmp_saturn.ram) + { + free (tmp_saturn.ram); + } + if (tmp_saturn.port1) + { + free (tmp_saturn.port1); + } + if (tmp_saturn.port2) + { + free (tmp_saturn.port2); + } + init_display (); + update_display (); +#ifdef HAVE_XSHM + if (disp.display_update) + refresh_display (); +#endif + } + else + { + printf ("Loading emulator-state from files failed.\n"); + if (saturn.rom) + { + free (saturn.rom); + } + if (saturn.ram) + { + free (saturn.ram); + } + if (saturn.port1) + { + free (saturn.port1); + } + if (saturn.port2) + { + free (saturn.port2); + } + memcpy (&saturn, &tmp_saturn, sizeof (saturn)); + memcpy (&device, &tmp_device, sizeof (device)); + } + } +} + +static void +#ifdef __FunctionProto__ +do_mode (int argc, char **argv) +#else +do_mode (argc, argv) + int argc; + char *argv; +#endif +{ + if (argc < 2) + { + printf ("Disassembler uses %s mnemonics.\n", mode_name[disassembler_mode]); + } + else + { + str_to_upper (argv[1]); + if (!strcmp ("HP", argv[1])) + { + disassembler_mode = HP_MNEMONICS; + } + else if (!strcmp ("CLASS", argv[1])) + { + disassembler_mode = CLASS_MNEMONICS; + } + else + { + printf ("Unknown disassembler mode %s. Try \"help\".\n", argv[1]); + } + } +} + +static void +#ifdef __FunctionProto__ +do_quit (int argc, char **argv) +#else +do_quit (argc, argv) + int argc; + char *argv; +#endif +{ + /* if (confirm ("Quit the emulator and save its state?")) + { + printf ("Exit.\n"); + exit_emulator (); + XCloseDisplay(dpy); + exit (0); + }*/ +} + +static void +#ifdef __FunctionProto__ +set_reg (word_64 val, int n, unsigned char *r) +#else +set_reg (val, n, r) + word_64 val; + int n; + unsigned char *r; +#endif +{ + int i; + + for (i = 0; i < n; i++) + { + if (i < 8) + r[i] = (unsigned char) ((val.lo & (0xf << (4 * i))) >> (4 * i)); + else + r[i] = (unsigned char) ((val.hi & (0xf << (4 * (i - 8)))) >> (4 * (i - 8))); + } +} + +static void +#ifdef __FunctionProto__ +dump_reg (const char *reg, int n, unsigned char *r) +#else +dump_reg (reg, n, r) + const char *reg; + int n; + unsigned char *r; +#endif +{ + int i; + + printf ("%s:\t", reg); + for (i = n - 1; i >= 0; i--) + { + printf ("%.1X", r[i] & 0xf); + } + printf ("\n"); +} + + +static void +#ifdef __FunctionProto__ +set_st (word_64 val) +#else +set_st (val) + word_64 val; +#endif +{ + int i; + + for (i = 0; i < 16; i++) + saturn.PSTAT[i] = (val.lo & (1 << i)) ? 1 : 0; +} + +static void +#ifdef __FunctionProto__ +dump_st (void) +#else +dump_st () +#endif +{ + int i; + int val; + + val = 0; + for (i = NR_PSTAT - 1; i >= 0; i--) + { + val <<= 1; + val |= saturn.PSTAT[i] ? 1 : 0; + } + printf (" ST:\t%.4X (", val); + for (i = NR_PSTAT - 1; i > 0; i--) + { + if (saturn.PSTAT[i]) + { + printf ("%.1X ", i); + } + else + { + printf ("- "); + } + } + if (saturn.PSTAT[0]) + { + printf ("%.1X)\n", 0); + } + else + { + printf ("-)\n"); + } +} + +static void +#ifdef __FunctionProto__ +set_hst (word_64 val) +#else +set_hst (val) + word_64 val; +#endif +{ + saturn.XM = 0; + saturn.SB = 0; + saturn.SR = 0; + saturn.MP = 0; + if (val.lo & 1) + saturn.XM = 1; + if (val.lo & 2) + saturn.SB = 1; + if (val.lo & 4) + saturn.SR = 1; + if (val.lo & 8) + saturn.MP = 1; +} + +static void +#ifdef __FunctionProto__ +dump_hst (void) +#else +dump_hst () +#endif +{ + short hst = 0; + if (saturn.XM != 0) + hst |= 1; + if (saturn.SB != 0) + hst |= 2; + if (saturn.SR != 0) + hst |= 3; + if (saturn.MP != 0) + hst |= 4; + printf (" HST:\t%.1X (%s%s%s%s)\n", hst, + saturn.MP ? "MP " : "-- ", saturn.SR ? "SR " : "-- ", + saturn.SB ? "SB " : "-- ", saturn.XM ? "XM" : "--"); +} + +static char *mctl_str_gx[] = { + "MMIO ", + "SysRAM ", + "Bank Switch", + "Port 1 ", + "Port 2 ", + "SysROM " +}; + +static char *mctl_str_sx[] = { + "MMIO ", + "SysRAM", + "Port 1", + "Port 2", + "Extra ", + "SysROM" +}; + +static void +#ifdef __FunctionProto__ +do_ram (int argc, char **argv) +#else +do_ram (argc, argv) + int argc; + char *argv; +#endif +{ + int i; + + for (i = 0; i < 5; i++) + { + printf("%s ", opt_gx ? mctl_str_gx[i] : mctl_str_sx[i]); + if (saturn.mem_cntl[i].unconfigured) + printf("unconfigured\n"); + else + if (i == 0) + printf("configured to 0x%.5lx\n", saturn.mem_cntl[i].config[0]); + else + printf("configured to 0x%.5lX - 0x%.5lX\n", + saturn.mem_cntl[i].config[0], + (saturn.mem_cntl[i].config[0] | ~saturn.mem_cntl[i].config[1]) + & 0xfffff); + } + if (opt_gx) + printf("Port 2 switched to bank %d\n", saturn.bank_switch); +} + +static void +#ifdef __FunctionProto__ +do_regs (int argc, char **argv) +#else +do_regs (argc, argv) + int argc; + char *argv; +#endif +{ + int i; + word_64 val; + + if (argc < 2) + { + /* + * dump all registers + */ + printf ("CPU is in %s mode. Registers:\n", + saturn.hexmode == HEX ? "HEX" : "DEC"); + dump_reg (" A", 16, saturn.A); + dump_reg (" B", 16, saturn.B); + dump_reg (" C", 16, saturn.C); + dump_reg (" D", 16, saturn.D); + printf (" D0:\t%.5lX ->", saturn.D0); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D0 + i, 5)); + } + printf ("\n"); + printf (" D1:\t%.5lX ->", saturn.D1); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D1 + i, 5)); + } + printf ("\n"); + printf (" P:\t%.1X\n", saturn.P); + disassemble (saturn.PC, instr); + printf (" PC:\t%.5lX -> %s\n", saturn.PC, instr); + dump_reg (" R0", 16, saturn.R0); + dump_reg (" R1", 16, saturn.R1); + dump_reg (" R2", 16, saturn.R2); + dump_reg (" R3", 16, saturn.R3); + dump_reg (" R4", 16, saturn.R4); + dump_reg (" IN", 4, saturn.IN); + dump_reg (" OUT", 3, saturn.OUT); + printf (" CARRY:\t%.1d\n", saturn.CARRY); + dump_st (); + dump_hst (); + } + else if (argc == 2) + { + /* + * dump specified register + */ + str_to_upper (argv[1]); + if (!strcmp ("A", argv[1])) + { + dump_reg (" A", 16, saturn.A); + } + else if (!strcmp ("B", argv[1])) + { + dump_reg (" B", 16, saturn.B); + } + else if (!strcmp ("C", argv[1])) + { + dump_reg (" C", 16, saturn.C); + } + else if (!strcmp ("D", argv[1])) + { + dump_reg (" D", 16, saturn.D); + } + else if (!strcmp ("D0", argv[1])) + { + printf (" D0:\t%.5lX ->", saturn.D0); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D0 + i, 5)); + } + printf ("\n"); + } + else if (!strcmp ("D1", argv[1])) + { + printf (" D1:\t%.5lX ->", saturn.D1); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D1 + i, 5)); + } + printf ("\n"); + } + else if (!strcmp ("P", argv[1])) + { + printf (" P:\t%.1X\n", saturn.P); + } + else if (!strcmp ("PC", argv[1])) + { + disassemble (saturn.PC, instr); + printf (" PC:\t%.5lX -> %s\n", saturn.PC, instr); + } + else if (!strcmp ("R0", argv[1])) + { + dump_reg (" R0", 16, saturn.R0); + } + else if (!strcmp ("R1", argv[1])) + { + dump_reg (" R1", 16, saturn.R1); + } + else if (!strcmp ("R2", argv[1])) + { + dump_reg (" R2", 16, saturn.R2); + } + else if (!strcmp ("R3", argv[1])) + { + dump_reg (" R3", 16, saturn.R3); + } + else if (!strcmp ("R4", argv[1])) + { + dump_reg (" R4", 16, saturn.R4); + } + else if (!strcmp ("IN", argv[1])) + { + dump_reg (" IN", 4, saturn.IN); + } + else if (!strcmp ("OUT", argv[1])) + { + dump_reg (" OUT", 3, saturn.OUT); + } + else if (!strcmp ("CARRY", argv[1])) + { + printf (" CARRY:\t%.1d\n", saturn.CARRY); + } + else if (!strcmp ("CY", argv[1])) + { + printf (" CARRY:\t%.1d\n", saturn.CARRY); + } + else if (!strcmp ("ST", argv[1])) + { + dump_st (); + } + else if (!strcmp ("HST", argv[1])) + { + dump_hst (); + } + else + { + printf ("No Register %s in CPU.\n", argv[1]); + } + } + else + { + /* + * set specified register + */ + str_to_upper (argv[1]); + str_to_upper (argv[2]); + if (decode_64 (&val, argv[2])) + { + if (!strcmp ("A", argv[1])) + { + set_reg (val, 16, saturn.A); + dump_reg (" A", 16, saturn.A); + } + else if (!strcmp ("B", argv[1])) + { + set_reg (val, 16, saturn.B); + dump_reg (" B", 16, saturn.B); + } + else if (!strcmp ("C", argv[1])) + { + set_reg (val, 16, saturn.C); + dump_reg (" C", 16, saturn.C); + } + else if (!strcmp ("D", argv[1])) + { + set_reg (val, 16, saturn.D); + dump_reg (" D", 16, saturn.D); + } + else if (!strcmp ("D0", argv[1])) + { + saturn.D0 = (word_20)(val.lo & 0xfffff); + printf (" D0:\t%.5lX ->", saturn.D0); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D0 + i, 5)); + } + printf ("\n"); + } + else if (!strcmp ("D1", argv[1])) + { + saturn.D1 = (word_20)(val.lo & 0xfffff); + printf (" D1:\t%.5lX ->", saturn.D1); + for (i = 0; i < 20; i += 5) + { + printf (" %s", str_nibbles (saturn.D1 + i, 5)); + } + printf ("\n"); + } + else if (!strcmp ("P", argv[1])) + { + saturn.P = (word_4)(val.lo & 0xf); + printf (" P:\t%.1X\n", saturn.P); + } + else if (!strcmp ("PC", argv[1])) + { + saturn.PC = (word_20)(val.lo & 0xfffff); + disassemble (saturn.PC, instr); + printf (" PC:\t%.5lX -> %s\n", saturn.PC, instr); + } + else if (!strcmp ("R0", argv[1])) + { + set_reg (val, 16, saturn.R0); + dump_reg (" R0", 16, saturn.R0); + } + else if (!strcmp ("R1", argv[1])) + { + set_reg (val, 16, saturn.R1); + dump_reg (" R1", 16, saturn.R1); + } + else if (!strcmp ("R2", argv[1])) + { + set_reg (val, 16, saturn.R2); + dump_reg (" R2", 16, saturn.R2); + } + else if (!strcmp ("R3", argv[1])) + { + set_reg (val, 16, saturn.R3); + dump_reg (" R3", 16, saturn.R3); + } + else if (!strcmp ("R4", argv[1])) + { + set_reg (val, 16, saturn.R4); + dump_reg (" R4", 16, saturn.R4); + } + else if (!strcmp ("IN", argv[1])) + { + set_reg (val, 4, saturn.IN); + dump_reg (" IN", 4, saturn.IN); + } + else if (!strcmp ("OUT", argv[1])) + { + set_reg (val, 3, saturn.OUT); + dump_reg (" OUT", 3, saturn.OUT); + } + else if (!strcmp ("CARRY", argv[1])) + { + saturn.CARRY = (word_1)(val.lo & 0x1); + printf (" CARRY:\t%.1d\n", saturn.CARRY); + } + else if (!strcmp ("CY", argv[1])) + { + saturn.CARRY = (word_1)(val.lo & 0x1); + printf (" CARRY:\t%.1d\n", saturn.CARRY); + } + else if (!strcmp ("ST", argv[1])) + { + set_st (val); + dump_st (); + } + else if (!strcmp ("HST", argv[1])) + { + set_hst (val); + dump_hst (); + } + else + { + printf ("No Register %s in CPU.\n", argv[1]); + } + } + } +} + +static void +#ifdef __FunctionProto__ +do_save (int argc, char **argv) +#else +do_save (argc, argv) + int argc; + char *argv; +#endif +{ + if (write_files ()) + { + printf ("Saving done.\n"); + } + else + { + printf ("Saving emulator-state failed.\n"); + } +} + +struct se { + int se_n; + word_20 se_p; + struct se *se_next; +}; + +static void +#ifdef __FunctionProto__ +do_stack (int argc, char **argv) +#else +do_stack (argc, argv) + int argc; + char *argv; +#endif +{ + word_20 dsktop, dskbot; + word_20 sp = 0, end = 0, ent = 0; + word_20 ram_base, ram_mask; + char buf[65536]; + struct se *stack, *se; + int n; + + ram_base = saturn.mem_cntl[1].config[0]; + ram_mask = saturn.mem_cntl[1].config[1]; + if (opt_gx) + { + saturn.mem_cntl[1].config[0] = 0x80000; + saturn.mem_cntl[1].config[1] = 0xc0000; + dsktop = DSKTOP_GX; + dskbot = DSKBOT_GX; + } + else + { + saturn.mem_cntl[1].config[0] = 0x70000; + saturn.mem_cntl[1].config[1] = 0xf0000; + dsktop = DSKTOP_SX; + dskbot = DSKBOT_SX; + } + + load_addr(&sp, dsktop, 5); + load_addr(&end, dskbot, 5); + + stack = (struct se *)0; + n = 0; + do + { + load_addr(&ent, sp, 5); + if (ent == 0) + break; + n++; + sp += 5; + se = (struct se *)malloc(sizeof(struct se)); + if (se == 0) + { + fprintf(stderr, "Out off memory.\n"); + break; + } + se->se_n = n; + se->se_p = ent; + se->se_next = stack; + stack = se; + } + while (sp <= end); + + if (n == 0) + printf("Empty stack.\n"); + + se = stack; + while (se) + { + decode_rpl_obj(se->se_p, buf); + if (se->se_n != 1) + if (strlen(buf) > 63) + { + sprintf(&buf[60], "..."); + buf[63] = '\0'; + } + printf("%5d: %.5lX -> %s\n", se->se_n, se->se_p, buf); + se = se->se_next; + } + + se = stack; + while (se) + { + stack = se; + se = se->se_next; + free(stack); + } + + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; +} + +static void +#ifdef __FunctionProto__ +do_stat (int argc, char **argv) +#else +do_stat (argc, argv) + int argc; + char *argv; +#endif +{ + printf ("Instructions/s: %ld\n", saturn.i_per_s); + printf ("Timer 1 I/TICK: %d\n", saturn.t1_tick); + printf ("Timer 2 I/TICK: %d\n", saturn.t2_tick); +} + +static void +#ifdef __FunctionProto__ +do_step (int argc, char **argv) +#else +do_step (argc, argv) + int argc; + char *argv; +#endif +{ + word_20 next_instr; + word_32 n; + int leave; + + if (enter_debugger & ILLEGAL_INSTRUCTION) + { + printf ("Can\'t step into an illegal instruction."); + return; + } + + n = 1; + if (argc > 1) + if (!decode_32 (&n, argv[1])) + return; + + if (n <= 0) + return; + + in_debugger = 1; + step_instruction (); + + if (exec_flags & EXEC_BKPT) + { + if (check_breakpoint (BP_EXEC, saturn.PC)) + { + enter_debugger |= BREAKPOINT_HIT; + return; + } + } + + next_instr = saturn.PC; + + sched_adjtime = 0; + schedule (); + + enter_debugger = 0; + while (1) + { + if (enter_debugger) + break; + + leave = 0; + + if (saturn.PC == next_instr) + { + n--; + leave = 1; + if (n == 0) + break; + } + + step_instruction (); + + if (exec_flags & EXEC_BKPT) + { + if (check_breakpoint (BP_EXEC, saturn.PC)) + { + enter_debugger |= BREAKPOINT_HIT; + break; + } + } + + if (leave) + next_instr = saturn.PC; + + schedule (); + } +} + +static void +#ifdef __FunctionProto__ +do_reset (int argc, char **argv) +#else +do_reset (argc, argv) + int argc; + char *argv; +#endif +{ + if (confirm ("Do a RESET (PC = 00000)?")) + { + saturn.PC = 0; + enter_debugger &= ~ILLEGAL_INSTRUCTION; + } +} + +static void +#ifdef __FunctionProto__ +do_rstk (int argc, char **argv) +#else +do_rstk (argc, argv) + int argc; + char *argv; +#endif +{ + int i, j; + + disassemble (saturn.PC, instr); + printf ("PC: %.5lX: %s\n", saturn.PC, instr); + if (saturn.rstkp < 0) + { + printf ("Empty return stack.\n"); + } + else + { + j = 0; + for (i = saturn.rstkp; i >= 0; i--) + { + disassemble (saturn.rstk[i], instr); + printf ("%2d: %.5lX: %s\n", j, saturn.rstk[i], instr); + j++; + } + } +} + +int +#ifdef __FunctionProto__ +debug (void) +#else +debug () +#endif +{ + t1_t2_ticks ticks; + struct cmd *cmdp; + char *cp; + int argc; + char *argv[MAX_ARGS]; + char *rl = NULL; + static char *cl = (char *) 0; + static char *old_line = (char *) 0; + int i; + + /* + * do we want to debug ??? + */ + if (!useDebugger) + { + if (enter_debugger & ILLEGAL_INSTRUCTION) + { + if (!quiet) + fprintf (stderr, "%s: reset (illegal instruction at 0x%.5lX)\n", + progname, saturn.PC); + saturn.PC = 0; + } + if (enter_debugger & USER_INTERRUPT) + if (verbose) + printf ("%s: user interrupt (SIGINT) ignored\n", progname); + if (enter_debugger & BREAKPOINT_HIT) + if (verbose) + printf ("%s: breakpoint hit at 0x%.5lX ignored\n", + progname, saturn.PC); + if (enter_debugger & TRAP_INSTRUCTION) + if (verbose) + printf ("%s: trap instruction at 0x%.5lX ignored\n", + progname, saturn.PC); + enter_debugger = 0; + return 0; + } + + /* + * update the lcd if necessary + */ + if (device.display_touched) + { + device.display_touched = 0; + update_display (); +#ifdef HAVE_XSHM + if (disp.display_update) + refresh_display (); +#endif + } + + /* + * debugging is counted as idle time + */ + + stop_timer (RUN_TIMER); + start_timer (IDLE_TIMER); + + continue_flag = 0; + + if (enter_debugger & ILLEGAL_INSTRUCTION) + { + printf ("ILLEGAL INSTRUCTION at %.5lX : %s\n", + saturn.PC, str_nibbles (saturn.PC, 16)); + } + + if (enter_debugger & TRAP_INSTRUCTION) + { + printf ("TRAP at %.5lX : %s\n", + saturn.PC - 5, str_nibbles (saturn.PC - 5, 16)); + enter_debugger &= ~TRAP_INSTRUCTION; + } + + do + { + + /* + * print current instruction + */ + disassemble (saturn.PC, instr); + printf ("%.5lX: %s\n", saturn.PC, instr); + + /* + * read a command + */ +#ifdef HAVE_READLINE + rl = readline ("x48-debug> "); +#else + if (rl == (char *) 0) + rl = (char *)malloc((size_t)80); + printf("x48-debug> "); + fflush(stdout); + rl = read_str(rl, 80, 0); +#endif + + if (rl == (char *) 0) + { + continue_flag = 1; + continue; + } + if (*rl == '\0') + { + free (rl); + rl = (char *) 0; + if (cl) + { + free (cl); + cl = (char *) 0; + } + if (old_line) + cl = strcpy ((char *) malloc (strlen (old_line)), old_line); + else + cl = strcpy ((char *) malloc (strlen ("(null)")), "(null)"); + } + else + { +#ifndef HAVE_READLINE + if (rl[strlen(rl) - 1] == '\n') + rl[strlen(rl) - 1] = '\0'; +#endif + if (cl) + { + free (cl); + cl = (char *) 0; + } + if (old_line) + { + free (old_line); + old_line = (char *) 0; + } + cl = strcpy ((char *) malloc (strlen (rl)), rl); + old_line = strcpy ((char *) malloc (strlen (rl)), rl); +#ifdef HAVE_READLINE + add_history (rl); +#endif + free (rl); + rl = (char *) 0; + } + + /* + * decode the commandline + */ + cp = strtok (cl, " \t"); + for (cmdp = cmd_tbl; cmdp->name; cmdp++) + { + if (strcmp (cp, cmdp->name) == 0) + { + break; + } + } + + argc = 0; + argv[argc++] = cp; + while ((cp = strtok ((char *) 0, " \t")) != (char *) 0) + { + argv[argc++] = cp; + if (argc == MAX_ARGS) + break; + } + for (i = argc; i < MAX_ARGS; i++) + argv[i] = (char *) NULL; + + /* + * execute the command, if valid + */ + if (cmdp->func) + { + (*cmdp->func) (argc, argv); + } + else + { + printf ("Undefined command \"%s\". Try \"help\".\n", argv[0]); + } + in_debugger = 0; + + } + while (!continue_flag); + + /* + * adjust the hp48's timers + */ + in_debugger = 1; + ticks = get_t1_t2 (); + in_debugger = 0; + + if (saturn.t2_ctrl & 0x01) + { + saturn.timer2 = ticks.t2_ticks; + } + + saturn.timer1 = (set_t1 - ticks.t1_ticks) & 0xf; + + sched_adjtime = 0; + + /* + * restart timers + */ + stop_timer (IDLE_TIMER); + start_timer (RUN_TIMER); + + set_accesstime(); + + if (enter_debugger & ILLEGAL_INSTRUCTION) + { + printf ("Reset (ILLEGAL INSTRUCTION)\n"); + saturn.PC = 0; + } + else + { + printf ("Continue.\n"); + } + + enter_debugger = 0; + + /* + * Set exec_flags according to breakpoints, etc. + */ + exec_flags = 0; + if (num_bkpts) + exec_flags |= EXEC_BKPT; + + return 0; +} + +int +#ifdef __FunctionProto__ +emulate_debug (void) +#else +emulate_debug () +#endif +{ + do + { + + step_instruction (); + + if (exec_flags & EXEC_BKPT) + { + if (check_breakpoint (BP_EXEC, saturn.PC)) + { + enter_debugger |= BREAKPOINT_HIT; + break; + } + } + + if (schedule_event-- == 0) + { + schedule (); + } + + } + while (!enter_debugger); + + return 0; +} diff --git a/jni/debugger.h b/jni/debugger.h new file mode 100644 index 0000000..1044543 --- /dev/null +++ b/jni/debugger.h @@ -0,0 +1,66 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: debugger.h,v $ + * Revision 1.4 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.3 1994/11/28 02:19:22 ecd + * catch TRAP instructions + * + * Revision 1.3 1994/11/28 02:19:22 ecd + * catch TRAP instructions + * + * Revision 1.2 1994/11/02 14:51:27 ecd + * added breakpoint related stuff + * + * Revision 1.1 1994/10/04 15:12:38 ecd + * Initial revision + * + * + * $Id: debugger.h,v 1.4 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _DEBUGGER_H +#define _DEBUGGER_H 1 + +#include "global.h" +#include "hp48.h" + +#define USER_INTERRUPT 1 +#define ILLEGAL_INSTRUCTION 2 +#define BREAKPOINT_HIT 4 +#define TRAP_INSTRUCTION 8 + +/* + * exec_flags values + */ +#define EXEC_BKPT 1 + +extern int enter_debugger; +extern int in_debugger; +extern int exec_flags; + +extern void init_debugger __ProtoType__((void)); +extern int debug __ProtoType__((void)); +extern int emulate_debug __ProtoType__((void)); + +extern char *str_nibbles __ProtoType__((word_20 addr, int n)); + +#endif /* !_DEBUGGER_H */ diff --git a/jni/device.c b/jni/device.c new file mode 100644 index 0000000..c2d9d5c --- /dev/null +++ b/jni/device.c @@ -0,0 +1,209 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: device.c,v $ + * Revision 1.8 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.7 1994/11/28 02:00:51 ecd + * played around with sound stuff + * + * Revision 1.7 1994/11/28 02:00:51 ecd + * played around with sound stuff + * + * Revision 1.6 1994/11/02 14:40:38 ecd + * adapted to new timer 2 stuff from timer.c + * + * Revision 1.5 1994/10/05 08:36:44 ecd + * removed addr queue + * + * Revision 1.4 1994/09/30 12:37:09 ecd + * new and FASTER display handling + * + * Revision 1.3 1994/09/18 15:29:22 ecd + * started Real Time support + * + * Revision 1.2 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * + * $Id: device.c,v 1.8 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + + +#include + +#include "hp48.h" +#include "hp48_emu.h" +#include "device.h" +#include "timer.h" + +extern int device_check; + +device_t device; + +void +#ifdef __FunctionProto__ +check_devices(void) +#else +check_devices() +#endif +{ + if (device.display_touched > 0 && device.display_touched-- == 1) { + device.display_touched = 0; + update_display(); + } + if (device.display_touched > 0) { + device_check = 1; + } + if (device.contrast_touched) { + device.contrast_touched = 0; + adjust_contrast(display.contrast); + } + if (device.ann_touched) { + device.ann_touched = 0; + draw_annunc(); + } + if (device.baud_touched) { + device.baud_touched = 0; + serial_baud(saturn.baud); + } + if (device.ioc_touched) { + device.ioc_touched = 0; + if ((saturn.io_ctrl & 0x02) && (saturn.rcs & 0x01)) { + do_interupt(); + } + } + if (device.rbr_touched) { + device.rbr_touched = 0; + receive_char(); + } + if (device.tbr_touched) { + device.tbr_touched = 0; + transmit_char(); + } + if (device.t1_touched) { + saturn.t1_instr = 0; + sched_timer1 = saturn.t1_tick; + restart_timer(T1_TIMER); + set_t1 = saturn.timer1; + device.t1_touched = 0; + } + if (device.t2_touched) { + saturn.t2_instr = 0; + sched_timer2 = saturn.t2_tick; + device.t2_touched = 0; + } +#if 0 + if (device.disp_test_touched) { + device.disp_test_touched = 0; + } + if (device.crc_touched) { + device.crc_touched = 0; + } + if (device.power_status_touched) { + device.power_status_touched = 0; + } + if (device.power_ctrl_touched) { + device.power_ctrl_touched = 0; + } + if (device.mode_touched) { + device.mode_touched = 0; + } + if (device.card_ctrl_touched) { + device.card_ctrl_touched = 0; + } + if (device.card_status_touched) { + device.card_status_touched = 0; + } + if (device.tcs_touched) { + device.tcs_touched = 0; + } + if (device.rcs_touched) { + device.rcs_touched = 0; + } + if (device.sreq_touched) { + device.sreq_touched = 0; + } + if (device.ir_ctrl_touched) { + device.ir_ctrl_touched = 0; + } + if (device.base_off_touched) { + device.base_off_touched = 0; + } + if (device.lcr_touched) { + device.lcr_touched = 0; + } + if (device.lbr_touched) { + device.lbr_touched = 0; + } + if (device.scratch_touched) { + device.scratch_touched = 0; + } + if (device.base_nibble_touched) { + device.base_nibble_touched = 0; + } + if (device.unknown_touched) { + device.unknown_touched = 0; + } + if (device.t1_ctrl_touched) { + device.t1_ctrl_touched = 0; + } + if (device.t2_ctrl_touched) { + device.t2_ctrl_touched = 0; + } + if (device.unknown2_touched) { + device.unknown2_touched = 0; + } +#endif +} + +#if 0 + +#include +#include +#include +#include + +void +#ifdef __FunctionProto__ +check_out_register(void) +#else +check_out_register() +#endif +{ + /*static int au = -2; + unsigned char c[] = { 0xff, 0x00 }; + + if (au == -2) + if ((au = open("/dev/audio", O_WRONLY)) < 0) + if (au < 0) + return; + if (saturn.OUT[2] & 0x8) + write(au, c, 1); + else + write(au, &c[1], 1);*/ +} + +#endif diff --git a/jni/device.h b/jni/device.h new file mode 100644 index 0000000..34fa31d --- /dev/null +++ b/jni/device.h @@ -0,0 +1,131 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: device.h,v $ + * Revision 1.7 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.6 1994/11/28 02:19:22 ecd + * played with the out register + * + * Revision 1.6 1994/11/28 02:19:22 ecd + * played with the out register + * + * Revision 1.5 1994/11/02 14:51:27 ecd + * added some function declarations + * + * Revision 1.4 1994/10/05 08:33:22 ecd + * remove addr queue + * + * Revision 1.3 1994/09/30 12:32:49 ecd + * added DISP_INSTR_OFF for faster and better display + * + * Revision 1.2 1994/09/13 16:58:42 ecd + * changed to plain X11 + * + * Revision 1.1 1994/08/26 11:09:18 ecd + * Initial revision + * + * + * + * $Id: device.h,v 1.7 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _DEVICE_H +#define _DEVICE_H 1 + +#include "global.h" + +#define DISP_INSTR_OFF 0x10 + +#define ANN_LEFT 0x81 +#define ANN_RIGHT 0x82 +#define ANN_ALPHA 0x84 +#define ANN_BATTERY 0x88 +#define ANN_BUSY 0x90 +#define ANN_IO 0xa0 + +typedef struct device_t { + + int display_touched; + + char contrast_touched; + + char disp_test_touched; + + char crc_touched; + + char power_status_touched; + char power_ctrl_touched; + + char mode_touched; + + char ann_touched; + + char baud_touched; + + char card_ctrl_touched; + char card_status_touched; + + char ioc_touched; + + char tcs_touched; + char rcs_touched; + + char rbr_touched; + char tbr_touched; + + char sreq_touched; + + char ir_ctrl_touched; + + char base_off_touched; + + char lcr_touched; + char lbr_touched; + + char scratch_touched; + char base_nibble_touched; + + char unknown_touched; + + char t1_ctrl_touched; + char t2_ctrl_touched; + + char unknown2_touched; + + char t1_touched; + char t2_touched; + +} device_t; + +extern device_t device; +extern void check_devices __ProtoType__((void)); +#if 0 +extern void check_out_register __ProtoType__((void)); +#endif + +extern void update_display __ProtoType__((void)); +extern void redraw_display __ProtoType__((void)); +extern void disp_draw_nibble __ProtoType__((word_20 addr, word_4 val)); +extern void menu_draw_nibble __ProtoType__((word_20 addr, word_4 val)); +extern void draw_annunc __ProtoType__((void)); +extern void redraw_annunc __ProtoType__((void)); + +#endif /* !_DEVICE_H */ diff --git a/jni/disasm.c b/jni/disasm.c new file mode 100644 index 0000000..554c155 --- /dev/null +++ b/jni/disasm.c @@ -0,0 +1,1965 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: disasm.c,v $ + * Revision 1.6 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.5 1994/12/07 20:20:50 ecd + * some minor fixes + * + * Revision 1.5 1994/12/07 20:20:50 ecd + * some minor fixes + * + * Revision 1.4 1994/11/28 02:00:51 ecd + * enlarged field_tbl further + * + * Revision 1.3 1994/11/04 03:42:34 ecd + * fixed bug in field_tbl + * + * Revision 1.2 1994/11/02 14:40:38 ecd + * completed disassembler + * + * Revision 1.1 1994/10/09 20:29:47 ecd + * Initial revision + * + * + * $Id: disasm.c,v 1.6 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include + +#include "hp48.h" +#include "disasm.h" + +#define TAB_SKIP 8 + +int disassembler_mode = CLASS_MNEMONICS; + +char *mode_name[] = +{ + "HP", + "class" +}; + +static char *hex[] = +{ + "0123456789ABCDEF", + "0123456789abcdef", +}; + +static char *opcode_0_tbl[32] = +{ +/* + * HP Mnemonics + */ + "RTNSXM", "RTN", "RTNSC", "RTNCC", + "SETHEX", "SETDEC", "RSTK=C", "C=RSTK", + "CLRST", "C=ST", "ST=C", "CSTEX", + "P=P+1", "P=P-1", "(NULL)", "RTI", +/* + * Class Mnemonics + */ + "rtnsxm", "rtn", "rtnsc", "rtncc", + "sethex", "setdec", "push", "pop", + "clr.3 st", "move.3 st, c", "move.3 c, st", "exg.3 c, st", + "inc.1 p", "dec.1 p", "(null)", "rti" +}; + +static char *op_str_0[16] = +{ +/* + * HP Mnemonics + */ + "A=A%cB", "B=B%cC", "C=C%cA", "D=D%cC", + "B=B%cA", "C=C%cB", "A=A%cC", "C=C%cD", +/* + * Class Mnemonics + */ + "b, a", "c, b", "a, c", "c, d", + "a, b", "b, c", "c, a", "d, c" +}; + +static char *op_str_1[16] = +{ +/* + * HP Mnemonics + */ + "DAT0=A", "DAT1=A", "A=DAT0", "A=DAT1", + "DAT0=C", "DAT1=C", "C=DAT0", "C=DAT1", +/* + * Class Mnemonics + */ + "a, (d0)", "a, (d1)", "(d0), a", "(d1), a", + "c, (d0)", "c, (d1)", "(d0), c", "(d1), c" +}; + +static char *in_str_80[32] = +{ +/* + * HP Mnemonics + */ + "OUT=CS", "OUT=C", "A=IN", "C=IN", + "UNCNFG", "CONFIG", "C=ID", "SHUTDN", + NULL, "C+P+1", "RESET", "BUSCC", + NULL, NULL, "SREQ?", NULL, +/* + * Class Mnemonics + */ + "move.s c, out", "move.3 c, out", "move.4 in, a", "move.4 in, c", + "uncnfg", "config", "c=id", "shutdn", + NULL, "add.a p+1, c", "reset", "buscc", + NULL, NULL, "sreq?", NULL +}; + +static char *in_str_808[32] = +{ +/* + * HP Mnemonics + */ + "INTON", NULL, NULL, "BUSCB", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + "PC=(A)", "BUSCD", "PC=(C)", "INTOFF", +/* + * Class Mnemonics + */ + "inton", NULL, NULL, "buscb", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + "jmp (a)", "buscd", "jmp (c)", "intoff" +}; + +static char *op_str_81[8] = +{ +/* + * HP Mnemonics + */ + "A", "B", "C", "D", +/* + * Class Mnemonics + */ + "a", "b", "c", "d", +}; + +static char *in_str_81b[32] = +{ +/* + * HP Mnemonics + */ + NULL, NULL, "PC=A", "PC=C", + "A=PC", "C=PC", "APCEX", "CPCEX", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, +/* + * Class Mnemonics + */ + NULL, NULL, "jmp a", "jmp c", + "move.a pc, a", "move.a pc, c", "exg.a a, pc", "exg.a c, pc", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, +}; + +static char *in_str_9[16] = +{ +/* + * HP Mnemonics + */ + "=", "#", "=", "#", + ">", "<", ">=", "<=", +/* + * Class Mnemonics + */ + "eq", "ne", "eq", "ne", + "gt", "lt", "ge", "le" +}; + +static char *op_str_9[16] = +{ +/* + * HP Mnemonics + */ + "?A%sB", "?B%sC", "?C%sA", "?D%sC", + "?A%s0", "?B%s0", "?C%s0", "?D%s0", +/* + * Class Mnemonics + */ + "a, b", "b, c", "c, a", "d, c", + "a, 0", "b, 0", "c, 0", "d, 0" +}; + +static char *op_str_af[32] = +{ +/* + * HP Mnemonics + */ + "A=A%sB", "B=B%sC", "C=C%sA", "D=D%sC", + "A=A%sA", "B=B%sB", "C=C%sC", "D=D%sD", + "B=B%sA", "C=C%sB", "A=A%sC", "C=C%sD", + "A=B%sA", "B=C%sB", "C=A%sC", "D=C%sD", +/* + * Class Mnemonics + */ + "b, a", "c, b", "a, c", "c, d", + "a, a", "b, b", "c, c", "d, d", + "a, b", "b, c", "c, a", "d, c", + "b, a", "c, b", "a, c", "c, d" +}; + +static char hp_reg_1_af[] = "ABCDABCDBCACABAC"; +static char hp_reg_2_af[] = "0000BCACABCDBCCD"; + +static char *field_tbl[32] = +{ +/* + * HP Mnemonics + */ + "P", "WP", "XS", "X", + "S", "M", "B", "W", + "P", "WP", "XS", "X", + "S", "M", "B", "A", +/* + * Class Mnemonics + */ + ".p", ".wp", ".xs", ".x", + ".s", ".m", ".b", ".w", + ".p", ".wp", ".xs", ".x", + ".s", ".m", ".b", ".a", +}; + +static char *hst_bits[8] = +{ +/* + * HP Mnemonics + */ + "XM", "SB", "SR", "MP", +/* + * Class Mnemonics + */ + "xm", "sb", "sr", "mp", +}; + +int +#ifdef __FunctionProto__ +read_int (word_20 * addr, int n) +#else +read_int (addr, n) + word_20 *addr; + int n; +#endif +{ + int i, t; + + for (i = 0, t = 0; i < n; i++) + t |= read_nibble ((*addr)++) << (i * 4); + return t; +} + +char * +#ifdef __FunctionProto__ +append_str (char *buf, char *str) +#else +append_str (buf, str) + char *buf; + char *str; +#endif +{ + while ((*buf = *str++)) + buf++; + return buf; +} + +char * +#ifdef __FunctionProto__ +append_tab_16 (char *buf) +#else +append_tab_16 (buf) + char *buf; +#endif +{ + int n; + char *p; + + n = 16 - (strlen (buf) % 16); + p = &buf[strlen (buf)]; + while (n--) + *p++ = ' '; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +append_tab (char *buf) +#else +append_tab (buf) + char *buf; +#endif +{ + int n; + char *p; + + n = TAB_SKIP - (strlen (buf) % TAB_SKIP); + p = &buf[strlen (buf)]; + while (n--) + *p++ = ' '; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +append_field (char *buf, word_4 fn) +#else +append_field (buf, fn) + char *buf; + word_4 fn; +#endif +{ + buf = append_str (buf, field_tbl[fn + 16 * disassembler_mode]); + return buf; +} + +char * +#ifdef __FunctionProto__ +append_imm_nibble (char *buf, word_20 * addr, int n) +#else +append_imm_nibble (buf, addr, n) + char *buf; + word_20 *addr; + int n; +#endif +{ + int i; + char t[16]; + + if (disassembler_mode == CLASS_MNEMONICS) + { + *buf++ = '#'; + if (n > 1) + *buf++ = '$'; + } + if (n > 1) + { + for (i = 0; i < n; i++) + t[i] = hex[disassembler_mode][read_nibble ((*addr)++)]; + for (i = n - 1; i >= 0; i--) + { + *buf++ = t[i]; + } + *buf = '\0'; + } + else + { + sprintf (t, "%d", read_nibble ((*addr)++)); + buf = append_str (buf, t); + } + return buf; +} + +char * +#ifdef __FunctionProto__ +append_addr (char *buf, word_20 addr) +#else +append_addr (buf, addr) + char *buf; + word_20 addr; +#endif +{ + int shift; + long mask; + + if (disassembler_mode == CLASS_MNEMONICS) + { + *buf++ = '$'; + } + for (mask = 0xf0000, shift = 16; mask != 0; mask >>= 4, shift -= 4) + *buf++ = hex[disassembler_mode][(addr & mask) >> shift]; + *buf = '\0'; + return buf; +} + +char * +#ifdef __FunctionProto__ +append_r_addr (char *buf, word_20 * pc, long disp, int n, int offset) +#else +append_r_addr (buf, pc, disp, n, offset) + char *buf; + word_20 *pc; + long disp; + int n; + int offset; +#endif +{ + long sign; + + sign = 1 << (n * 4 - 1); + if (disp & sign) + disp |= ~(sign - 1); + *pc += disp; + + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (disp < 0) + { + buf = append_str (buf, "-"); + disp = -disp - offset; + } + else + { + buf = append_str (buf, "+"); + disp += offset; + } + buf = append_addr (buf, disp); + break; + case CLASS_MNEMONICS: + if (disp < 0) + { + buf = append_str (buf, "-"); + disp = -disp - offset; + } + else + { + buf = append_str (buf, "+"); + disp += offset; + } + buf = append_addr (buf, disp); + break; + default: + buf = append_str (buf, "Unknown disassembler mode"); + break; + } + return buf; +} + +char * +#ifdef __FunctionProto__ +append_pc_comment (char *buf, word_20 pc) +#else +append_pc_comment (buf, pc) + char *buf; + word_20 pc; +#endif +{ + char *p = buf; + + while (strlen (buf) < 4 * TAB_SKIP) + p = append_tab (buf); + + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (p, "# Address: "); + p = append_addr (p, pc); + break; + case CLASS_MNEMONICS: + p = append_str (p, "; address: "); + p = append_addr (p, pc); + break; + default: + p = append_str (p, "Unknown disassembler mode"); + break; + } + return p; +} + + +char * +#ifdef __FunctionProto__ +append_hst_bits (char *buf, int n) +#else +append_hst_bits (buf, n) + char *buf; + int n; +#endif +{ + int i; + char *p = buf; + + switch (disassembler_mode) + { + case HP_MNEMONICS: + for (i = 0; i < 4; i++) + if (n & (1 << i)) + { + if (p != buf) + p = append_str (p, "="); + p = append_str (p, hst_bits[i + 4 * disassembler_mode]); + } + break; + + case CLASS_MNEMONICS: + while (strlen (buf) < 4 * TAB_SKIP) + p = append_tab (buf); + p = &buf[strlen (buf)]; + p = append_str (p, "; hst bits: "); + + for (buf = p, i = 0; i < 4; i++) + if (n & (1 << i)) + { + if (p != buf) + p = append_str (p, ", "); + p = append_str (p, hst_bits[i + 4 * disassembler_mode]); + } + break; + + default: + p = append_str (p, "Unknown disassembler mode"); + break; + } + + return p; +} + +char * +#ifdef __FunctionProto__ +disasm_1 (word_20 * addr, char *out) +#else +disasm_1 (addr, out) + word_20 *addr; + char *out; +#endif +{ + word_4 n; + word_4 fn; + char *p; + char buf[20]; + char c; + + p = out; + switch ((n = read_nibble ((*addr)++))) + { + case 0: + case 1: + fn = read_nibble ((*addr)++); + fn = (fn & 7); + if (fn > 4) + fn -= 4; + switch (disassembler_mode) + { + case HP_MNEMONICS: + c = (char) ((fn < 8) ? 'A' : 'C'); + if (n == 0) + sprintf (buf, "R%d=%c", fn, c); + else + sprintf (buf, "%c=R%d", c, fn); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, "move.w"); + p = append_tab (out); + c = (char) ((fn < 8) ? 'a' : 'c'); + if (n == 0) + sprintf (buf, "%c, r%d", c, fn); + else + sprintf (buf, "r%d, %c", fn, c); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 2: + fn = read_nibble ((*addr)++); + fn = (fn & 7); + if (fn > 4) + fn -= 4; + switch (disassembler_mode) + { + case HP_MNEMONICS: + c = (char) ((fn < 8) ? 'A' : 'C'); + sprintf (buf, "%cR%dEX", c, fn); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, "exg.w"); + p = append_tab (out); + c = (char) ((fn < 8) ? 'a' : 'c'); + sprintf (buf, "%c, r%d", c, fn); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 3: + n = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + c = (n & 4) ? 'C' : 'A'; + if (n & 2) + { + if (n < 8) + { + sprintf (buf, "%cD%dEX", c, (n & 1)); + } + else + { + sprintf (buf, "%cD%dXS", c, (n & 1)); + } + } + else + { + if (n < 8) + { + sprintf (buf, "D%d=%c", (n & 1), c); + } + else + { + sprintf (buf, "D%d=%cS", (n & 1), c); + } + } + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, (n & 2) ? "exg." : "move."); + p = append_str (p, (n < 8) ? "a" : "4"); + p = append_tab (out); + c = (n & 4) ? 'c' : 'a'; + sprintf (buf, "%c, d%d", c, (n & 1)); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 4: + case 5: + fn = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, op_str_1[(fn & 7) + 8 * disassembler_mode]); + p = append_tab (out); + if (n == 4) + { + p = append_str (p, (fn < 8) ? "A" : "B"); + } + else + { + n = read_nibble ((*addr)++); + if (fn < 8) + { + p = append_field (p, n); + } + else + { + sprintf (buf, "%d", n + 1); + p = append_str (p, buf); + } + } + break; + case CLASS_MNEMONICS: + p = append_str (out, "move"); + if (n == 4) + { + p = append_str (p, "."); + p = append_str (p, (fn < 8) ? "a" : "b"); + } + else + { + n = read_nibble ((*addr)++); + if (fn < 8) + { + p = append_field (p, n); + } + else + { + sprintf (buf, ".%d", n + 1); + p = append_str (p, buf); + } + } + p = append_tab (out); + p = append_str (p, op_str_1[(fn & 7) + 8 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 6: + case 7: + case 8: + case 0xc: + fn = read_nibble (*addr++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (n == 6 || n == 8) + p = append_str (out, "D0=D0"); + else + p = append_str (out, "D1=D1"); + if (n < 8) + p = append_str (p, "+"); + else + p = append_str (p, "-"); + p = append_tab (out); + sprintf (buf, "%d", fn + 1); + p = append_str (p, buf); + break; + case CLASS_MNEMONICS: + if (n < 8) + p = append_str (out, "add.a"); + else + p = append_str (out, "sub.a"); + p = append_tab (out); + sprintf (buf, "#%d, ", fn + 1); + p = append_str (p, buf); + if (n == 6 || n == 8) + p = append_str (p, "d0"); + else + p = append_str (p, "d1"); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 9: + case 0xa: + case 0xb: + case 0xd: + case 0xe: + case 0xf: + c = (char) ((n < 0xd) ? '0' : '1'); + switch (n & 3) + { + case 1: + n = 2; + break; + case 2: + n = 4; + break; + case 3: + n = 5; + break; + } + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "D%c=(%d)", c, n); + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, n); + break; + case CLASS_MNEMONICS: + if (n == 5) + { + sprintf (buf, "move.a"); + } + else if (n == 4) + { + sprintf (buf, "move.as"); + } + else + { + sprintf (buf, "move.b"); + } + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, n); + sprintf (buf, ", d%c", c); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + break; + } + return p; +} + + +char * +#ifdef __FunctionProto__ +disasm_8 (word_20 * addr, char *out) +#else +disasm_8 (addr, out) + word_20 *addr; + char *out; +#endif +{ + word_4 n; + word_4 fn; + char *p = out; + char c; + char buf[20]; + word_20 disp, pc; + + fn = read_nibble ((*addr)++); + switch (fn) + { + case 0: + n = read_nibble ((*addr)++); + if (NULL != (p = in_str_80[n + 16 * disassembler_mode])) + { + p = append_str (out, p); + return p; + } + switch (n) + { + case 8: + fn = read_nibble ((*addr)++); + if (NULL != (p = in_str_808[fn + 16 * disassembler_mode])) + { + p = append_str (out, p); + return p; + } + switch (fn) + { + case 1: + n = read_nibble ((*addr)++); + if (n == 0) + { + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, "RSI"); + break; + case CLASS_MNEMONICS: + p = append_str (out, "rsi"); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + } + break; + case 2: + n = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (n < 5) + { + sprintf (buf, "LA(%d)", n + 1); + } + else + { + sprintf (buf, "LAHEX"); + } + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, n + 1); + break; + case CLASS_MNEMONICS: + sprintf (buf, "move.%d", n + 1); + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, n + 1); + sprintf (buf, ", a.p"); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 4: + case 5: + case 8: + case 9: + + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%cBIT=%d", (fn & 8) ? 'C' : 'A', + (fn & 1) ? 1 : 0); + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, 1); + break; + case CLASS_MNEMONICS: + p = append_str (out, (fn & 1) ? "bset" : "bclr"); + p = append_tab (out); + p = append_imm_nibble (p, addr, 1); + p = append_str (p, (fn & 8) ? ", c" : ", a"); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 6: + case 7: + case 0xa: + case 0xb: + + n = read_nibble ((*addr)++); + pc = *addr; + disp = read_int (addr, 2); + + switch (disassembler_mode) + { + case HP_MNEMONICS: + c = (char) ((fn < 0xa) ? 'A' : 'C'); + sprintf (buf, "?%cBIT=%d", c, (fn & 1) ? 1 : 0); + p = append_str (out, buf); + p = append_tab (out); + sprintf (buf, "%d", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", GOYES "); + p = append_r_addr (p, &pc, disp, 2, 5); + p = append_pc_comment (out, pc); + } + else + p = append_str (p, ", RTNYES"); + break; + case CLASS_MNEMONICS: + c = (char) ((fn < 0xa) ? 'a' : 'c'); + p = append_str (out, (disp == 0) ? "rt" : "b"); + p = append_str (p, (fn & 1) ? "bs" : "bc"); + p = append_tab (out); + sprintf (buf, "#%d, %c", n, c); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", "); + p = append_r_addr (p, &pc, disp, 2, 5); + p = append_pc_comment (out, pc); + } + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + break; + } + break; + + case 0xc: + case 0xd: + case 0xf: + fn = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, (n == 0xf) ? "%c%cEX" : "%c=%c", + (n == 0xd) ? 'P' : 'C', (n == 0xd) ? 'C' : 'P'); + p = append_str (out, buf); + p = append_tab (out); + sprintf (buf, "%d", fn); + p = append_str (p, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, (n == 0xf) ? "exg.1" : "move.1"); + p = append_tab (out); + sprintf (buf, (n == 0xd) ? "p, c.%d" : "c.%d, p", fn); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + break; + + } + break; + + case 1: + switch (n = read_nibble ((*addr)++)) + { + case 0: + case 1: + case 2: + case 3: + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%sSLC", op_str_81[(n & 3) + 4 * disassembler_mode]); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, "rol.w"); + p = append_tab (out); + p = append_str (p, "#4, "); + p = append_str (p, op_str_81[(n & 3) + 4 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 4: + case 5: + case 6: + case 7: + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%sSRC", op_str_81[(n & 3) + 4 * disassembler_mode]); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, "ror.w"); + p = append_tab (out); + p = append_str (p, "#4, "); + p = append_str (p, op_str_81[(n & 3) + 4 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 8: + fn = read_nibble ((*addr)++); + n = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%s=%s%cCON", + op_str_81[(n & 3) + 4 * disassembler_mode], + op_str_81[(n & 3) + 4 * disassembler_mode], + (n < 8) ? '+' : '-'); + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, fn); + fn = read_nibble ((*addr)++); + sprintf (buf, ", %d", fn + 1); + p = append_str (p, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, (n < 8) ? "add" : "sub"); + p = append_field (p, fn); + p = append_tab (out); + fn = read_nibble ((*addr)++); + sprintf (buf, "#%d, ", fn + 1); + p = append_str (p, buf); + p = append_str (p, op_str_81[(n & 3) + 4 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 9: + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%sSRB.F", + op_str_81[(n & 3) + 4 * disassembler_mode]); + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, read_nibble ((*addr)++)); + break; + case CLASS_MNEMONICS: + p = append_str (out, "lsr"); + p = append_field (p, read_nibble ((*addr)++)); + p = append_tab (out); + p = append_str (p, "#1, "); + p = append_str (p, op_str_81[(n & 3) + 4 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 0xa: + fn = read_nibble ((*addr)++); + n = read_nibble ((*addr)++); + if (n > 2) + break; + c = (char) read_nibble ((*addr)++); + if (((int) c & 7) > 4) + break; + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (n == 2) + { + sprintf (buf, "%cR%dEX.F", ((int) c < 8) ? 'A' : 'C', + (int) c & 7); + } + else if (n == 1) + { + sprintf (buf, "%c=R%d.F", ((int) c < 8) ? 'A' : 'C', + (int) c & 7); + } + else + { + sprintf (buf, "R%d=%c.F", (int) c & 7, + ((int) c < 8) ? 'A' : 'C'); + } + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, fn); + break; + case CLASS_MNEMONICS: + p = append_str (out, (n == 2) ? "exg" : "move"); + p = append_field (p, fn); + p = append_tab (out); + if (n == 1) + { + sprintf (buf, "r%d", (int) c & 7); + p = append_str (p, buf); + } + else + p = append_str (p, ((int) c < 8) ? "a" : "c"); + p = append_str (p, ", "); + if (n == 1) + p = append_str (p, ((int) c < 8) ? "a" : "c"); + else + { + sprintf (buf, "r%d", (int) c & 7); + p = append_str (p, buf); + } + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 0xb: + n = read_nibble ((*addr)++); + if ((n < 2) || (n > 7)) + break; + + p = append_str (out, in_str_81b[n + 16 * disassembler_mode]); + break; + + case 0xc: + case 0xd: + case 0xe: + case 0xf: + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "%sSRB", op_str_81[(n & 3) + 4 * disassembler_mode]); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + p = append_str (out, "lsr.w"); + p = append_tab (out); + p = append_str (p, "#1, "); + p = append_str (p, op_str_81[(n & 3) + 4 * disassembler_mode]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + break; + } + break; + + case 2: + n = read_nibble ((*addr)++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (n == 0xf) + { + p = append_str (out, "CLRHST"); + } + else + { + p = append_hst_bits (out, n); + p = append_str (p, "=0"); + } + break; + case CLASS_MNEMONICS: + p = append_str (out, "clr.1"); + p = append_tab (out); + sprintf (buf, "#%d, hst", n); + p = append_str (p, buf); + p = append_hst_bits (out, n); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 3: + n = read_nibble ((*addr)++); + pc = *addr; + disp = read_int (addr, 2); + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, "?"); + p = append_hst_bits (p, n); + p = append_str (p, "=0"); + p = append_tab (out); + if (disp != 0) + { + p = append_str (p, "GOYES "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + else + p = append_str (p, "RTNYES"); + break; + case CLASS_MNEMONICS: + p = append_str (out, (disp == 0) ? "rt" : "b"); + p = append_str (p, "eq.1"); + p = append_tab (out); + sprintf (buf, "#%d, hst", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + p = append_hst_bits (out, n); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 4: + case 5: + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "ST=%d", (fn == 4) ? 0 : 1); + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, addr, 1); + break; + case CLASS_MNEMONICS: + p = append_str (out, (fn == 4) ? "bclr" : "bset"); + p = append_tab (out); + p = append_imm_nibble (p, addr, 1); + p = append_str (p, ", st"); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 6: + case 7: + n = read_nibble ((*addr)++); + pc = *addr; + disp = read_int (addr, 2); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "?ST=%d", (fn == 6) ? 0 : 1); + p = append_str (out, buf); + p = append_tab (out); + sprintf (buf, "%d", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", GOYES "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + else + p = append_str (p, ", RTNYES"); + break; + case CLASS_MNEMONICS: + p = append_str (out, (disp == 0) ? "rt" : "b"); + p = append_str (p, (fn == 6) ? "bc" : "bs"); + p = append_tab (out); + sprintf (buf, "#%d, st", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 8: + case 9: + n = read_nibble ((*addr)++); + pc = *addr; + disp = read_int (addr, 2); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "?P%c", (fn == 8) ? '#' : '='); + p = append_str (out, buf); + p = append_tab (out); + sprintf (buf, "%d", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", GOYES "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + else + p = append_str (p, ", RTNYES"); + break; + case CLASS_MNEMONICS: + p = append_str (out, (disp == 0) ? "rt" : "b"); + p = append_str (p, (fn == 8) ? "ne.1" : "eq.1"); + p = append_tab (out); + sprintf (buf, "#%d, p", n); + p = append_str (p, buf); + if (disp != 0) + { + p = append_str (p, ", "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 0xc: + case 0xe: + pc = *addr; + if (fn == 0xe) + pc += 4; + disp = read_int (addr, 4); + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, (fn == 0xc) ? "GOLONG" : "GOSUBL"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 4, (fn == 0xc) ? 2 : 6); + p = append_pc_comment (out, pc); + break; + case CLASS_MNEMONICS: + p = append_str (out, (fn == 0xc) ? "bra.4" : "bsr.4"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 4, (fn == 0xc) ? 2 : 6); + p = append_pc_comment (out, pc); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 0xd: + case 0xf: + pc = read_int (addr, 5); + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, (fn == 0xc) ? "GOVLNG" : "GOSBVL"); + p = append_tab (out); + p = append_addr (p, pc); + break; + case CLASS_MNEMONICS: + p = append_str (out, (fn == 0xc) ? "jmp" : "jsr"); + p = append_tab (out); + p = append_addr (p, pc); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + break; + + } + return p; +} + + +word_20 +#ifdef __FunctionProto__ +disassemble (word_20 addr, char *out) +#else +disassemble (addr, out) + word_20 addr; + char *out; +#endif +{ + word_4 n; + word_4 fn; + char *p = out; + char c; + char buf[20]; + word_20 disp, pc; + + switch (n = read_nibble (addr++)) + { + case 0: + if ((n = read_nibble (addr++)) != 0xe) + { + p = append_str (out, opcode_0_tbl[n + 16 * disassembler_mode]); + break; + } + fn = read_nibble (addr++); + n = read_nibble (addr++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, op_str_0[(n & 7) + 8 * HP_MNEMONICS], + (n < 8) ? '&' : '!'); + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, fn); + break; + case CLASS_MNEMONICS: + p = append_str (out, (n < 8) ? "and" : "or"); + p = append_field (p, fn); + p = append_tab (out); + p = append_str (p, op_str_0[(n & 7) + 8 * CLASS_MNEMONICS]); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 1: + p = disasm_1 (&addr, out); + break; + + case 2: + n = read_nibble (addr++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + sprintf (buf, "P=%d", n); + p = append_str (out, buf); + break; + case CLASS_MNEMONICS: + sprintf (buf, "move.1 #%d, p", n); + p = append_str (out, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 3: + fn = read_nibble (addr++); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (fn < 5) + { + sprintf (buf, "LC(%d)", fn + 1); + } + else + { + sprintf (buf, "LCHEX"); + } + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, &addr, fn + 1); + break; + case CLASS_MNEMONICS: + sprintf (buf, "move.%d", fn + 1); + p = append_str (out, buf); + p = append_tab (out); + p = append_imm_nibble (p, &addr, fn + 1); + sprintf (buf, ", c.p"); + p = append_str (p, buf); + break; + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 4: + case 5: + pc = addr; + disp = read_int (&addr, 2); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (disp == 2) + { + p = append_str (out, "NOP3"); + break; + } + sprintf (buf, (disp == 0) ? "RTN%sC" : "GO%sC", (n == 4) ? "" : "N"); + p = append_str (out, buf); + if (disp != 0) + { + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 2, 1); + p = append_pc_comment (out, pc); + } + break; + + case CLASS_MNEMONICS: + if (disp == 2) + { + p = append_str (out, "nop3"); + break; + } + p = append_str (out, (disp == 0) ? "rtc" : "bc"); + p = append_str (p, (n == 4) ? "s" : "c"); + if (disp != 0) + { + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 2, 1); + p = append_pc_comment (out, pc); + } + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 6: + pc = addr; + disp = read_int (&addr, 3); + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (disp == 3) + { + p = append_str (out, "NOP4"); + break; + } + if (disp == 4) + { + p = append_str (out, "NOP5"); + break; + } + p = append_str (out, "GOTO"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 3, 1); + p = append_pc_comment (out, pc); + break; + + case CLASS_MNEMONICS: + if (disp == 3) + { + p = append_str (out, "nop4"); + break; + } + if (disp == 4) + { + p = append_str (out, "nop5"); + break; + } + p = append_str (out, "bra.3"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 3, 1); + p = append_pc_comment (out, pc); + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 7: + pc = addr + 3; + disp = read_int (&addr, 3); + switch (disassembler_mode) + { + case HP_MNEMONICS: + p = append_str (out, "GOSUB"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 3, 4); + p = append_pc_comment (out, pc); + break; + + case CLASS_MNEMONICS: + p = append_str (out, "bsr.3"); + p = append_tab (out); + p = append_r_addr (p, &pc, disp, 3, 4); + p = append_pc_comment (out, pc); + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + case 8: + fn = read_nibble (addr); /* PEEK */ + if (fn != 0xa && fn != 0xb) + { + p = disasm_8 (&addr, out); + break; + } + /* Fall through */ + + case 9: + fn = read_nibble (addr++); + if (n == 8) + { + c = (char) ((fn == 0xa) ? 0 : 1); + fn = 0xf; + } + else + { + c = (char) ((fn < 8) ? 0 : 1); + fn &= 7; + } + + n = read_nibble (addr++); + pc = addr; + disp = read_int (&addr, 2); + + switch (disassembler_mode) + { + case HP_MNEMONICS: + if ((c == 0) && (n >= 8)) + sprintf (buf, op_str_9[(n & 3) + 8 * HP_MNEMONICS + 4], + in_str_9[((n >> 2) & 3) + 4 * c + 8 * HP_MNEMONICS]); + else + sprintf (buf, op_str_9[(n & 3) + 8 * HP_MNEMONICS], + in_str_9[((n >> 2) & 3) + 4 * c + 8 * HP_MNEMONICS]); + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, fn); + p = append_str (p, ", "); + p = append_str (p, (disp == 0) ? "RTNYES" : "GOYES "); + if (disp != 0) + { + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + break; + + case CLASS_MNEMONICS: + p = append_str (out, (disp == 0) ? "rt" : "b"); + p = append_str (p, in_str_9[((n >> 2) & 3) + 4 * c + 8 * CLASS_MNEMONICS]); + p = append_field (p, fn); + p = append_tab (out); + if ((c == 0) && (n >= 8)) + p = append_str (p, op_str_9[(n & 3) + 8 * CLASS_MNEMONICS + 4]); + else + p = append_str (p, op_str_9[(n & 3) + 8 * CLASS_MNEMONICS]); + if (disp != 0) + { + p = append_str (p, ", "); + p = append_r_addr (p, &pc, disp, 2, 3); + p = append_pc_comment (out, pc); + } + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + break; + } + break; + + default: + switch (n) + { + case 0xa: + fn = read_nibble (addr++); + c = (char) ((fn < 8) ? 0 : 1); + fn &= 7; + disp = 0xa; + break; + case 0xb: + fn = read_nibble (addr++); + c = (char) ((fn < 8) ? 0 : 1); + fn &= 7; + disp = 0xb; + break; + case 0xc: + case 0xd: + fn = 0xf; + c = (char) (n & 1); + disp = 0xa; + break; + case 0xe: + case 0xf: + fn = 0xf; + c = (char) (n & 1); + disp = 0xb; + break; + default: + fn = 0; + disp = 0; + c = 0; + break; + } + + n = read_nibble (addr++); + pc = 0; + + switch (disp) + { + case 0xa: + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (c == 0) + { + if (n < 0xc) + { + p = "+"; + } + else + { + p = "%c=%c-1"; + pc = 2; + } + } + else + { + if (n < 4) + { + p = "%c=0"; + pc = 1; + } + else if (n >= 0xc) + { + p = "%c%cEX"; + pc = 3; + } + else + { + p = "%c=%c"; + pc = 3; + } + } + break; + + case CLASS_MNEMONICS: + if (c == 0) + { + if (n < 0xc) + { + p = "add"; + } + else + { + p = "dec"; + pc = 1; + } + } + else + { + if (n < 4) + { + p = "clr"; + pc = 1; + } + else if (n >= 0xc) + { + p = "exg"; + } + else + { + p = "move"; + if (n < 8) + n -= 4; + } + } + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + return addr; + } + break; + + case 0xb: + switch (disassembler_mode) + { + case HP_MNEMONICS: + if (c == 0) + { + if (n >= 0xc) + { + p = "-"; + } + else if ((n >= 4) && (n <= 7)) + { + p = "%c=%c+1"; + pc = 2; + n -= 4; + } + else + { + p = "-"; + } + } + else + { + if (n < 4) + { + p = "%cSL"; + pc = 1; + } + else if (n < 8) + { + p = "%cSR"; + pc = 1; + } + else if (n < 0xc) + { + p = "%c=%c-1"; + pc = 2; + } + else + { + p = "%c=-%c-1"; + pc = 2; + } + } + break; + + case CLASS_MNEMONICS: + if (c == 0) + { + if (n >= 0xc) + { + p = "subr"; + } + else if ((n >= 4) && (n <= 7)) + { + p = "inc"; + pc = 1; + n -= 4; + } + else + { + p = "sub"; + } + } + else + { + pc = 1; + if (n < 4) + { + p = "lsl"; + } + else if (n < 8) + { + p = "lsr"; + } + else if (n < 0xc) + { + p = "neg"; + } + else + { + p = "not"; + } + } + break; + + default: + p = append_str (out, "Unknown disassembler mode"); + return addr; + } + break; + + } + + switch (disassembler_mode) + { + case HP_MNEMONICS: + + if (pc == 0) + { + sprintf (buf, op_str_af[n + 16 * HP_MNEMONICS], p); + } + else if (pc == 1) + { + sprintf (buf, p, (n & 3) + 'A'); + } + else if (pc == 2) + { + sprintf (buf, p, (n & 3) + 'A', (n & 3) + 'A'); + } + else + { + sprintf (buf, p, hp_reg_1_af[n], hp_reg_2_af[n]); + } + p = append_str (out, buf); + p = append_tab (out); + p = append_field (p, fn); + break; + + case CLASS_MNEMONICS: + + p = append_str (out, p); + p = append_field (p, fn); + p = append_tab (out); + if (pc == 1) + { + sprintf (buf, "%c", (n & 3) + 'a'); + p = append_str (p, buf); + } + else + { + p = append_str (p, op_str_af[n + 16 * CLASS_MNEMONICS]); + } + break; + + default: + p = append_str (p, "Unknown disassembler mode"); + break; + } + + break; + } + *p = '\0'; + return addr; +} diff --git a/jni/disasm.h b/jni/disasm.h new file mode 100644 index 0000000..bd0ed4d --- /dev/null +++ b/jni/disasm.h @@ -0,0 +1,51 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: disasm.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/11/02 14:51:27 ecd + * changed ALONZO to CLASS + * + * Revision 1.2 1994/11/02 14:51:27 ecd + * changed ALONZO to CLASS + * + * Revision 1.1 1994/10/09 20:26:35 ecd + * Initial revision + * + * + * $Id: disasm.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _DISASM_H +#define _DISASM_H 1 + +#include "global.h" +#include "hp48.h" + +#define HP_MNEMONICS 0 +#define CLASS_MNEMONICS 1 + +extern int disassembler_mode; +extern char *mode_name[]; + +extern word_20 disassemble __ProtoType__((word_20 addr, char *out)); + +#endif /* !_DISASM_H */ diff --git a/jni/dump2rom.c b/jni/dump2rom.c new file mode 100644 index 0000000..cae86d1 --- /dev/null +++ b/jni/dump2rom.c @@ -0,0 +1,226 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: dump2rom.c,v $ + * Revision 1.7 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.6 1994/12/07 20:20:50 ecd + * minor changes + * + * Revision 1.6 1994/12/07 20:20:50 ecd + * minor changes + * + * Revision 1.5 1994/11/28 02:00:51 ecd + * improved trapping of EOF + * + * Revision 1.4 1994/11/02 14:40:38 ecd + * support for "compressed" rom files added + * + * Revision 1.3 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.2 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.1 1994/09/07 12:57:36 ecd + * Initial revision + * + * $Id: dump2rom.c,v 1.7 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#include +#include +#include +#include +#ifdef SUNOS +#include +#endif +#include + +unsigned char *core; + +#define DEFAULT_ROM_FILE "rom.dump" + +int +#ifdef __FunctionProto__ +write_mem_file(char *name, unsigned char *mem, int size) +#else +write_mem_file(name, mem, size) +char *name; +unsigned char *mem; +int size; +#endif +{ + FILE *fp; + unsigned char *tmp_mem; + unsigned char byte; + int i, j; + + if (NULL == (fp = fopen(name, "w"))) + { + LOGE( "can\'t open %s\n", name); + return 0; + } + + if (NULL == (tmp_mem = (unsigned char *)malloc((size_t)size / 2))) + { + for (i = 0, j = 0; i < size / 2; i++) + { + byte = (mem[j++] & 0x0f); + byte |= (mem[j++] << 4) & 0xf0; + if (1 != fwrite(&byte, 1, 1, fp)) + { + LOGE( "can\'t write %s\n", name); + fclose(fp); + return 0; + } + } + } + else + { + for (i = 0, j = 0; i < size / 2; i++) + { + tmp_mem[i] = (mem[j++] & 0x0f); + tmp_mem[i] |= (mem[j++] << 4) & 0xf0; + } + + if (fwrite(tmp_mem, 1, (size_t)size / 2, fp) != size / 2) + { + LOGE( "can\'t write %s\n", name); + fclose(fp); + free(tmp_mem); + return 0; + } + + free(tmp_mem); + } + + fclose(fp); + return 1; +} + +int +#ifdef __FunctionProto__ +main(int argc, char **argv) +#else +main(argc, argv) +int argc; +char **argv; +#endif +{ + FILE *dump; + long addr, size; + int ch, i, gx, error; + + if (argc < 2) { + LOGE( "usage: %s hp48-dump-file\n", argv[0]); + exit (1); + } + + if ((dump = fopen(argv[1], "r")) == NULL) { + LOGE( "%s: can\'t open %s\n", argv[0], argv[1]); + exit (1); + } + + if ((core = (unsigned char *)malloc(0x100000)) == NULL) { + LOGE( "%s: can\'t malloc %d bytes\n", argv[0], 0x100000); + exit (1); + } + memset(core, 0, 0x100000); + + gx = 0; + error = 0; + while (1) { + addr = 0; + for (i = 0; i < 5; i++) { + addr <<= 4; + if ((ch = fgetc(dump)) < 0) { + error = 1; + break; + } + if (ch >= '0' && ch <= '9') { + addr |= ch - '0'; + } else if (ch >= 'A' && ch <= 'F') { + addr |= ch - 'A' + 10; + } else { + LOGE( "%s: Illegal char %c at %lx\n", argv[0], ch, addr); + error = 1; + break; + } + } + if (error) + break; + if (addr >= 0x80000) + gx = 1; + if ((ch = fgetc(dump)) < 0) { + LOGE( "%s: Unexpected EOF at %lx\n", argv[0], addr); + break; + } + if (ch != ':') { + LOGE( "%s: Illegal char %c, expected \':\' at %lx\n", + argv[0], ch, addr); + break; + } + for (i = 0; i < 16; i++) { + if ((ch = fgetc(dump)) < 0) { + LOGE( "%s: Unexpected EOF at %lx\n", argv[0], addr); + error = 1; + break; + } + if (ch >= '0' && ch <= '9') { + core[addr++] = ch - '0'; + } else if (ch >= 'A' && ch <= 'F') { + core[addr++] = ch - 'A' + 10; + } else { + LOGE( "%s: Illegal char %c at %lx\n", argv[0], ch, addr); + error = 1; + break; + } + } + if (error) + break; + if ((ch = fgetc(dump)) < 0) + break; + if (ch != '\n') { + LOGE( "%s: Illegal char %c, expected \'\\n\' at %lx\n", + argv[0], ch, addr); + break; + } + } + + if (!gx) + if (core[0x29] == 0x0) + gx = 1; + if (gx) + size = 0x100000; + else + size = 0x80000; + if (!write_mem_file(DEFAULT_ROM_FILE, core, size)) + { + LOGE( "%s: can\'t write to %s\n", argv[0], DEFAULT_ROM_FILE); + exit (1); + } + + exit (0); +} + diff --git a/jni/emulate.c b/jni/emulate.c new file mode 100644 index 0000000..3cc9b7d --- /dev/null +++ b/jni/emulate.c @@ -0,0 +1,2489 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * $Log: emulate.c,v $ + * Revision 1.16 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.15 1994/12/07 20:20:50 ecd + * fiddled around with sound + * + * Revision 1.15 1994/12/07 20:20:50 ecd + * fiddled around with sound + * + * Revision 1.14 1994/11/28 02:00:51 ecd + * added TRAP instruction 64001 + * played with output register ... + * removed some unused switch statements + * + * Revision 1.13 1994/11/04 03:42:34 ecd + * changed includes + * + * Revision 1.12 1994/11/02 19:13:04 ecd + * fixed missing log + * + * + * $Id: emulate.c,v 1.16 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#include + +#include "hp48.h" +#include "hp48_emu.h" +#include "device.h" +#include "timer.h" + +#include "debugger.h" + +#if 0 +#define DEBUG_TIMER +#define DEBUG_SCHED +#define DEBUG_DISP_SCHED +#endif + +static long jumpaddr; + +unsigned long instructions = 0; +unsigned long old_instr = 0; + +int rece_instr = 0; +int device_check = 0; + +int adj_time_pending = 0; + +int set_t1; + +long schedule_event = 0; + +#define SrvcIoStart 0x3c0 +#define SrvcIoEnd 0x5ec + +#define SCHED_INSTR_ROLLOVER 0x3fffffff +#define SCHED_RECEIVE 0x7ff +#define SCHED_ADJTIME 0x1ffe +#define SCHED_TIMER1 0x1e00 +#define SCHED_TIMER2 0xf +#define SCHED_STATISTICS 0x7ffff +#define SCHED_NEVER 0x7fffffff + +#define NR_SAMPLES 10 + +long sched_instr_rollover = SCHED_INSTR_ROLLOVER; +long sched_receive = SCHED_RECEIVE; +long sched_adjtime = SCHED_ADJTIME; +long sched_timer1 = SCHED_TIMER1; +long sched_timer2 = SCHED_TIMER2; +long sched_statistics = SCHED_STATISTICS; +long sched_display = SCHED_NEVER; + +unsigned long t1_i_per_tick; +unsigned long t2_i_per_tick; +unsigned long s_1; +unsigned long s_16; +unsigned long old_s_1; +unsigned long old_s_16; +unsigned long delta_t_1; +unsigned long delta_t_16; +unsigned long delta_i; +word_64 run; + +static word_20 jumpmasks[] = { + 0xffffffff, 0xfffffff0, 0xffffff00, 0xfffff000, + 0xffff0000, 0xfff00000, 0xff000000, 0xf0000000 +}; + +int +#ifdef __FunctionProto__ +decode_group_80(void) +#else +decode_group_80() +#endif +{ + int t, op3, op4, op5, op6; + unsigned char *REG; + long addr; + op3 = read_nibble(saturn.PC + 2); +//LOGI("-------%d", op3); + switch (op3) { + case 0: /* OUT=CS */ + saturn.PC += 3; + copy_register(saturn.OUT, saturn.C, OUTS_FIELD); +#if 0 + check_out_register(); +#endif + return 0; + case 1: /* OUT=C */ + saturn.PC += 3; + copy_register(saturn.OUT, saturn.C, OUT_FIELD); +#if 0 + check_out_register(); +#endif + return 0; + case 2: /* A=IN */ + saturn.PC += 3; + do_in(); + copy_register(saturn.A, saturn.IN, IN_FIELD); + return 0; + case 3: /* C=IN */ + saturn.PC += 3; + do_in(); + copy_register(saturn.C, saturn.IN, IN_FIELD); + return 0; + case 4: /* UNCNFG */ + saturn.PC += 3; + do_unconfigure(); + return 0; + case 5: /* CONFIG */ + saturn.PC += 3; + do_configure(); + return 0; + case 6: /* C=ID */ + saturn.PC += 3; + return get_identification(); + case 7: /* SHUTDN */ + saturn.PC += 3; + do_shutdown(); + return 0; + case 8: + op4 = read_nibble(saturn.PC + 3); + switch (op4) { + case 0: /* INTON */ + saturn.PC += 4; + do_inton(); + return 0; + case 1: /* RSI... */ + op5 = read_nibble(saturn.PC + 4); + saturn.PC += 5; + do_reset_interrupt_system(); + return 0; + case 2: /* LA... */ + op5 = read_nibble(saturn.PC + 4); + load_constant(saturn.A, op5 + 1, saturn.PC + 5); + saturn.PC += 6 + op5; + return 0; + case 3: /* BUSCB */ + saturn.PC += 4; + return 0; + case 4: /* ABIT=0 */ + op5 = read_nibble(saturn.PC + 4); + saturn.PC += 5; + clear_register_bit(saturn.A, op5); + return 0; + case 5: /* ABIT=1 */ + op5 = read_nibble(saturn.PC + 4); + saturn.PC += 5; + set_register_bit(saturn.A, op5); + return 0; + case 8: /* CBIT=0 */ + op5 = read_nibble(saturn.PC + 4); + saturn.PC += 5; + clear_register_bit(saturn.C, op5); + return 0; + case 9: /* CBIT=1 */ + op5 = read_nibble(saturn.PC + 4); + saturn.PC += 5; + set_register_bit(saturn.C, op5); + return 0; + case 6: /* ?ABIT=0 */ + case 7: /* ?ABIT=1 */ + case 0xa: /* ?CBIT=0 */ + case 0xb: /* ?CBIT=1 */ + op5 = read_nibble(saturn.PC + 4); + if (op4 < 8) + REG = saturn.A; + else + REG = saturn.C; + if (op4 == 6 || op4 == 0xa) + t = 0; + else + t = 1; + saturn.CARRY = (get_register_bit(REG, op5) == t)?1:0; + if (saturn.CARRY) { + saturn.PC += 5; + op6 = read_nibbles(saturn.PC, 2); + if (op6) { + if (op6 & 0x80) + op6 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op6) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 7; + } + return 0; + case 0xc: /* PC=(A) */ + addr = dat_to_addr(saturn.A); + jumpaddr = read_nibbles(addr, 5); + saturn.PC = jumpaddr; + return 0; + case 0xd: /* BUSCD */ + saturn.PC += 4; + return 0; + case 0xe: /* PC=(C) */ + addr = dat_to_addr(saturn.C); + jumpaddr = read_nibbles(addr, 5); + saturn.PC = jumpaddr; + return 0; + case 0xf: /* INTOFF */ + saturn.PC += 4; + do_intoff(); + return 0; + default: + return 1; + } + case 9: /* C+P+1 */ + saturn.PC += 3; + add_p_plus_one(saturn.C); + return 0; + case 0xa: /* RESET */ + saturn.PC += 3; + do_reset(); + return 0; + case 0xb: /* BUSCC */ + saturn.PC += 3; + return 0; + case 0xc: /* C=P n */ + op4 = read_nibble(saturn.PC + 3); + saturn.PC += 4; + set_register_nibble(saturn.C, op4, saturn.P); + return 0; + case 0xd: /* P=C n */ + op4 = read_nibble(saturn.PC + 3); + saturn.PC += 4; + saturn.P = get_register_nibble(saturn.C, op4); + return 0; + case 0xe: /* SREQ? */ + saturn.PC += 3; + saturn.C[0] = 0; + saturn.SR = 0; + return 0; + case 0xf: /* CPEX n */ + op4 = read_nibble(saturn.PC + 3); + saturn.PC += 4; + t = get_register_nibble(saturn.C, op4); + set_register_nibble(saturn.C, op4, saturn.P); + saturn.P = t; + return 0; + default: + return 1; + } +} + +int +#ifdef __FunctionProto__ +decode_group_1(void) +#else +decode_group_1() +#endif +{ + int op, op2, op3, op4; + + op2 = read_nibble(saturn.PC + 1); + switch (op2) { + case 0: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* saturn.R0=A */ + saturn.PC += 3; + copy_register(saturn.R0, saturn.A, W_FIELD); + return 0; + case 1: /* saturn.R1=A */ + case 5: + saturn.PC += 3; + copy_register(saturn.R1, saturn.A, W_FIELD); + return 0; + case 2: /* saturn.R2=A */ + case 6: + saturn.PC += 3; + copy_register(saturn.R2, saturn.A, W_FIELD); + return 0; + case 3: /* saturn.R3=A */ + case 7: + saturn.PC += 3; + copy_register(saturn.R3, saturn.A, W_FIELD); + return 0; + case 4: /* saturn.R4=A */ + saturn.PC += 3; + copy_register(saturn.R4, saturn.A, W_FIELD); + return 0; + case 8: /* saturn.R0=C */ + saturn.PC += 3; + copy_register(saturn.R0, saturn.C, W_FIELD); + return 0; + case 9: /* saturn.R1=C */ + case 0xd: + saturn.PC += 3; + copy_register(saturn.R1, saturn.C, W_FIELD); + return 0; + case 0xa: /* saturn.R2=C */ + case 0xe: + saturn.PC += 3; + copy_register(saturn.R2, saturn.C, W_FIELD); + return 0; + case 0xb: /* saturn.R3=C */ + case 0xf: + saturn.PC += 3; + copy_register(saturn.R3, saturn.C, W_FIELD); + return 0; + case 0xc: /* saturn.R4=C */ + saturn.PC += 3; + copy_register(saturn.R4, saturn.C, W_FIELD); + return 0; + default: + return 1; + } + case 1: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* A=R0 */ + saturn.PC += 3; + copy_register(saturn.A, saturn.R0, W_FIELD); + return 0; + case 1: /* A=R1 */ + case 5: + saturn.PC += 3; + copy_register(saturn.A, saturn.R1, W_FIELD); + return 0; + case 2: /* A=R2 */ + case 6: + saturn.PC += 3; + copy_register(saturn.A, saturn.R2, W_FIELD); + return 0; + case 3: /* A=R3 */ + case 7: + saturn.PC += 3; + copy_register(saturn.A, saturn.R3, W_FIELD); + return 0; + case 4: /* A=R4 */ + saturn.PC += 3; + copy_register(saturn.A, saturn.R4, W_FIELD); + return 0; + case 8: /* C=R0 */ + saturn.PC += 3; + copy_register(saturn.C, saturn.R0, W_FIELD); + return 0; + case 9: /* C=R1 */ + case 0xd: + saturn.PC += 3; + copy_register(saturn.C, saturn.R1, W_FIELD); + return 0; + case 0xa: /* C=R2 */ + case 0xe: + saturn.PC += 3; + copy_register(saturn.C, saturn.R2, W_FIELD); + return 0; + case 0xb: /* C=R3 */ + case 0xf: + saturn.PC += 3; + copy_register(saturn.C, saturn.R3, W_FIELD); + return 0; + case 0xc: /* C=R4 */ + saturn.PC += 3; + copy_register(saturn.C, saturn.R4, W_FIELD); + return 0; + default: + return 1; + } + case 2: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* AR0EX */ + saturn.PC += 3; + exchange_register(saturn.A, saturn.R0, W_FIELD); + return 0; + case 1: /* AR1EX */ + case 5: + saturn.PC += 3; + exchange_register(saturn.A, saturn.R1, W_FIELD); + return 0; + case 2: /* AR2EX */ + case 6: + saturn.PC += 3; + exchange_register(saturn.A, saturn.R2, W_FIELD); + return 0; + case 3: /* AR3EX */ + case 7: + saturn.PC += 3; + exchange_register(saturn.A, saturn.R3, W_FIELD); + return 0; + case 4: /* AR4EX */ + saturn.PC += 3; + exchange_register(saturn.A, saturn.R4, W_FIELD); + return 0; + case 8: /* CR0EX */ + saturn.PC += 3; + exchange_register(saturn.C, saturn.R0, W_FIELD); + return 0; + case 9: /* CR1EX */ + case 0xd: + saturn.PC += 3; + exchange_register(saturn.C, saturn.R1, W_FIELD); + return 0; + case 0xa: /* CR2EX */ + case 0xe: + saturn.PC += 3; + exchange_register(saturn.C, saturn.R2, W_FIELD); + return 0; + case 0xb: /* CR3EX */ + case 0xf: + saturn.PC += 3; + exchange_register(saturn.C, saturn.R3, W_FIELD); + return 0; + case 0xc: /* CR4EX */ + saturn.PC += 3; + exchange_register(saturn.C, saturn.R4, W_FIELD); + return 0; + default: + return 1; + } + case 3: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* D0=A */ + saturn.PC += 3; + register_to_address(saturn.A, &saturn.D0, 0); + return 0; + case 1: /* D1=A */ + saturn.PC += 3; + register_to_address(saturn.A, &saturn.D1, 0); + return 0; + case 2: /* AD0EX */ + saturn.PC += 3; + exchange_reg(saturn.A, &saturn.D0, A_FIELD); + return 0; + case 3: /* AD1EX */ + saturn.PC += 3; + exchange_reg(saturn.A, &saturn.D1, A_FIELD); + return 0; + case 4: /* D0=C */ + saturn.PC += 3; + register_to_address(saturn.C, &saturn.D0, 0); + return 0; + case 5: /* D1=C */ + saturn.PC += 3; + register_to_address(saturn.C, &saturn.D1, 0); + return 0; + case 6: /* CD0EX */ + saturn.PC += 3; + exchange_reg(saturn.C, &saturn.D0, A_FIELD); + return 0; + case 7: /* CD1EX */ + saturn.PC += 3; + exchange_reg(saturn.C, &saturn.D1, A_FIELD); + return 0; + case 8: /* D0=AS */ + saturn.PC += 3; + register_to_address(saturn.A, &saturn.D0, 1); + return 0; + case 9: /* saturn.D1=AS */ + saturn.PC += 3; + register_to_address(saturn.A, &saturn.D1, 1); + return 0; + case 0xa: /* AD0XS */ + saturn.PC += 3; + exchange_reg(saturn.A, &saturn.D0, IN_FIELD); + return 0; + case 0xb: /* AD1XS */ + saturn.PC += 3; + exchange_reg(saturn.A, &saturn.D1, IN_FIELD); + return 0; + case 0xc: /* D0=CS */ + saturn.PC += 3; + register_to_address(saturn.C, &saturn.D0, 1); + return 0; + case 0xd: /* D1=CS */ + saturn.PC += 3; + register_to_address(saturn.C, &saturn.D1, 1); + return 0; + case 0xe: /* CD0XS */ + saturn.PC += 3; + exchange_reg(saturn.C, &saturn.D0, IN_FIELD); + return 0; + case 0xf: /* CD1XS */ + saturn.PC += 3; + exchange_reg(saturn.C, &saturn.D1, IN_FIELD); + return 0; + default: + return 1; + } + case 4: + op3 = read_nibble(saturn.PC + 2); + op = op3 < 8 ? 0xf : 6; + switch(op3 & 7) { + case 0: /* DAT0=A */ + saturn.PC += 3; + store(saturn.D0, saturn.A, op); + return 0; + case 1: /* DAT1=A */ + saturn.PC += 3; + store(saturn.D1, saturn.A, op); + return 0; + case 2: /* A=DAT0 */ + saturn.PC += 3; + recall(saturn.A, saturn.D0, op); + return 0; + case 3: /* A=DAT1 */ + saturn.PC += 3; + recall(saturn.A, saturn.D1, op); + return 0; + case 4: /* DAT0=C */ + saturn.PC += 3; + store(saturn.D0, saturn.C, op); + return 0; + case 5: /* DAT1=C */ + saturn.PC += 3; + store(saturn.D1, saturn.C, op); + return 0; + case 6: /* C=DAT0 */ + saturn.PC += 3; + recall(saturn.C, saturn.D0, op); + return 0; + case 7: /* C=DAT1 */ + saturn.PC += 3; + recall(saturn.C, saturn.D1, op); + return 0; + default: + return 1; + } + case 5: + op3 = read_nibble(saturn.PC + 2); + op4 = read_nibble(saturn.PC + 3); + if (op3 >= 8) { + switch(op3 & 7) { + case 0: /* DAT0=A */ + saturn.PC += 4; + store_n(saturn.D0, saturn.A, op4+1); + return 0; + case 1: /* DAT1=A */ + saturn.PC += 4; + store_n(saturn.D1, saturn.A, op4+1); + return 0; + case 2: /* A=DAT0 */ + saturn.PC += 4; + recall_n(saturn.A, saturn.D0, op4+1); + return 0; + case 3: /* A=DAT1 */ + saturn.PC += 4; + recall_n(saturn.A, saturn.D1, op4+1); + return 0; + case 4: /* DAT0=C */ + saturn.PC += 4; + store_n(saturn.D0, saturn.C, op4+1); + return 0; + case 5: /* DAT1=C */ + saturn.PC += 4; + store_n(saturn.D1, saturn.C, op4+1); + return 0; + case 6: /* C=DAT0 */ + saturn.PC += 4; + recall_n(saturn.C, saturn.D0, op4+1); + return 0; + case 7: /* C=DAT1 */ + saturn.PC += 4; + recall_n(saturn.C, saturn.D1, op4+1); + return 0; + default: + return 1; + } + } else { + switch(op3) { + case 0: /* DAT0=A */ + saturn.PC += 4; + store(saturn.D0, saturn.A, op4); + return 0; + case 1: /* DAT1=A */ + saturn.PC += 4; + store(saturn.D1, saturn.A, op4); + return 0; + case 2: /* A=DAT0 */ + saturn.PC += 4; + recall(saturn.A, saturn.D0, op4); + return 0; + case 3: /* A=DAT1 */ + saturn.PC += 4; + recall(saturn.A, saturn.D1, op4); + return 0; + case 4: /* DAT0=C */ + saturn.PC += 4; + store(saturn.D0, saturn.C, op4); + return 0; + case 5: /* DAT1=C */ + saturn.PC += 4; + store(saturn.D1, saturn.C, op4); + return 0; + case 6: /* C=DAT0 */ + saturn.PC += 4; + recall(saturn.C, saturn.D0, op4); + return 0; + case 7: /* C=DAT1 */ + saturn.PC += 4; + recall(saturn.C, saturn.D1, op4); + return 0; + default: + return 1; + } + } + case 6: + op3 = read_nibble(saturn.PC + 2); + saturn.PC += 3; + add_address(&saturn.D0, op3+1); + return 0; + case 7: + op3 = read_nibble(saturn.PC + 2); + saturn.PC += 3; + add_address(&saturn.D1, op3+1); + return 0; + case 8: + op3 = read_nibble(saturn.PC + 2); + saturn.PC += 3; + add_address(&saturn.D0, -(op3+1)); + return 0; + case 9: + load_addr(&saturn.D0, saturn.PC+2, 2); + saturn.PC += 4; + return 0; + case 0xa: + load_addr(&saturn.D0, saturn.PC+2, 4); + saturn.PC += 6; + return 0; + case 0xb: + load_addr(&saturn.D0, saturn.PC+2, 5); + saturn.PC += 7; + return 0; + case 0xc: + op3 = read_nibble(saturn.PC + 2); + saturn.PC += 3; + add_address(&saturn.D1, -(op3+1)); + return 0; + case 0xd: + load_addr(&saturn.D1, saturn.PC+2, 2); + saturn.PC += 4; + return 0; + case 0xe: + load_addr(&saturn.D1, saturn.PC+2, 4); + saturn.PC += 6; + return 0; + case 0xf: + load_addr(&saturn.D1, saturn.PC+2, 5); + saturn.PC += 7; + return 0; + default: + return 1; + } +} + +inline int +#ifdef __FunctionProto__ +decode_8_thru_f(int op1) +#else +decode_8_thru_f(op1) +int op1; +#endif +{ + int op2, op3, op4, op5, op6; + + op2 = read_nibble(saturn.PC + 1); + // LOGI("----- %d", op2); + switch (op1) { + case 8: + switch (op2) { + case 0: + return decode_group_80(); + case 1: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* ASLC */ + saturn.PC += 3; + shift_left_circ_register(saturn.A, W_FIELD); + return 0; + case 1: /* BSLC */ + saturn.PC += 3; + shift_left_circ_register(saturn.B, W_FIELD); + return 0; + case 2: /* CSLC */ + saturn.PC += 3; + shift_left_circ_register(saturn.C, W_FIELD); + return 0; + case 3: /* DSLC */ + saturn.PC += 3; + shift_left_circ_register(saturn.D, W_FIELD); + return 0; + case 4: /* ASRC */ + saturn.PC += 3; + shift_right_circ_register(saturn.A, W_FIELD); + return 0; + case 5: /* BSRC */ + saturn.PC += 3; + shift_right_circ_register(saturn.B, W_FIELD); + return 0; + case 6: /* CSRC */ + saturn.PC += 3; + shift_right_circ_register(saturn.C, W_FIELD); + return 0; + case 7: /* DSRC */ + saturn.PC += 3; + shift_right_circ_register(saturn.D, W_FIELD); + return 0; + case 8: /* R = R +/- CON */ + op4 = read_nibble(saturn.PC + 3); + op5 = read_nibble(saturn.PC + 4); + op6 = read_nibble(saturn.PC + 5); + if (op5 < 8) { /* PLUS */ + switch (op5 & 3) { + case 0: /* A=A+CON */ + saturn.PC += 6; + add_register_constant(saturn.A, op4, op6+1); + return 0; + case 1: /* B=B+CON */ + saturn.PC += 6; + add_register_constant(saturn.B, op4, op6+1); + return 0; + case 2: /* C=C+CON */ + saturn.PC += 6; + add_register_constant(saturn.C, op4, op6+1); + return 0; + case 3: /* D=D+CON */ + saturn.PC += 6; + add_register_constant(saturn.D, op4, op6+1); + return 0; + default: + return 1; + } + } else { /* MINUS */ + switch (op5 & 3) { + case 0: /* A=A-CON */ + saturn.PC += 6; + sub_register_constant(saturn.A, op4, op6+1); + return 0; + case 1: /* B=B-CON */ + saturn.PC += 6; + sub_register_constant(saturn.B, op4, op6+1); + return 0; + case 2: /* C=C-CON */ + saturn.PC += 6; + sub_register_constant(saturn.C, op4, op6+1); + return 0; + case 3: /* D=D-CON */ + saturn.PC += 6; + sub_register_constant(saturn.D, op4, op6+1); + return 0; + default: + return 1; + } + } + case 9: /* R SRB FIELD */ + op4 = read_nibble(saturn.PC + 3); + op5 = read_nibble(saturn.PC + 4); + switch (op5 & 3) { + case 0: + saturn.PC += 5; + shift_right_bit_register(saturn.A, op4); + return 0; + case 1: + saturn.PC += 5; + shift_right_bit_register(saturn.B, op4); + return 0; + case 2: + saturn.PC += 5; + shift_right_bit_register(saturn.C, op4); + return 0; + case 3: + saturn.PC += 5; + shift_right_bit_register(saturn.D, op4); + return 0; + default: + return 1; + } + case 0xa: /* R = R FIELD, etc. */ + op4 = read_nibble(saturn.PC + 3); + op5 = read_nibble(saturn.PC + 4); + op6 = read_nibble(saturn.PC + 5); + switch (op5) { + case 0: + switch (op6) { + case 0: /* saturn.R0=A */ + saturn.PC += 6; + copy_register(saturn.R0, saturn.A, op4); + return 0; + case 1: /* saturn.R1=A */ + case 5: + saturn.PC += 6; + copy_register(saturn.R1, saturn.A, op4); + return 0; + case 2: /* saturn.R2=A */ + case 6: + saturn.PC += 6; + copy_register(saturn.R2, saturn.A, op4); + return 0; + case 3: /* saturn.R3=A */ + case 7: + saturn.PC += 6; + copy_register(saturn.R3, saturn.A, op4); + return 0; + case 4: /* saturn.R4=A */ + saturn.PC += 6; + copy_register(saturn.R4, saturn.A, op4); + return 0; + case 8: /* saturn.R0=C */ + saturn.PC += 6; + copy_register(saturn.R0, saturn.C, op4); + return 0; + case 9: /* saturn.R1=C */ + case 0xd: + saturn.PC += 6; + copy_register(saturn.R1, saturn.C, op4); + return 0; + case 0xa: /* saturn.R2=C */ + case 0xe: + saturn.PC += 6; + copy_register(saturn.R2, saturn.C, op4); + return 0; + case 0xb: /* saturn.R3=C */ + case 0xf: + saturn.PC += 6; + copy_register(saturn.R3, saturn.C, op4); + return 0; + case 0xc: /* saturn.R4=C */ + saturn.PC += 6; + copy_register(saturn.R4, saturn.C, op4); + return 0; + default: + return 1; + } + case 1: + switch (op6) { + case 0: /* A=R0 */ + saturn.PC += 6; + copy_register(saturn.A, saturn.R0, op4); + return 0; + case 1: /* A=R1 */ + case 5: + saturn.PC += 6; + copy_register(saturn.A, saturn.R1, op4); + return 0; + case 2: /* A=R2 */ + case 6: + saturn.PC += 6; + copy_register(saturn.A, saturn.R2, op4); + return 0; + case 3: /* A=R3 */ + case 7: + saturn.PC += 6; + copy_register(saturn.A, saturn.R3, op4); + return 0; + case 4: /* A=R4 */ + saturn.PC += 6; + copy_register(saturn.A, saturn.R4, op4); + return 0; + case 8: /* C=R0 */ + saturn.PC += 6; + copy_register(saturn.C, saturn.R0, op4); + return 0; + case 9: /* C=R1 */ + case 0xd: + saturn.PC += 6; + copy_register(saturn.C, saturn.R1, op4); + return 0; + case 0xa: /* C=R2 */ + case 0xe: + saturn.PC += 6; + copy_register(saturn.C, saturn.R2, op4); + return 0; + case 0xb: /* C=R3 */ + case 0xf: + saturn.PC += 6; + copy_register(saturn.C, saturn.R3, op4); + return 0; + case 0xc: /* C=R4 */ + saturn.PC += 6; + copy_register(saturn.C, saturn.R4, op4); + return 0; + default: + return 1; + } + case 2: + switch (op6) { + case 0: /* AR0EX */ + saturn.PC += 6; + exchange_register(saturn.A, saturn.R0, op4); + return 0; + case 1: /* AR1EX */ + case 5: + saturn.PC += 6; + exchange_register(saturn.A, saturn.R1, op4); + return 0; + case 2: /* AR2EX */ + case 6: + saturn.PC += 6; + exchange_register(saturn.A, saturn.R2, op4); + return 0; + case 3: /* AR3EX */ + case 7: + saturn.PC += 6; + exchange_register(saturn.A, saturn.R3, op4); + return 0; + case 4: /* AR4EX */ + saturn.PC += 6; + exchange_register(saturn.A, saturn.R4, op4); + return 0; + case 8: /* CR0EX */ + saturn.PC += 6; + exchange_register(saturn.C, saturn.R0, op4); + return 0; + case 9: /* CR1EX */ + case 0xd: + saturn.PC += 6; + exchange_register(saturn.C, saturn.R1, op4); + return 0; + case 0xa: /* CR2EX */ + case 0xe: + saturn.PC += 6; + exchange_register(saturn.C, saturn.R2, op4); + return 0; + case 0xb: /* CR3EX */ + case 0xf: + saturn.PC += 6; + exchange_register(saturn.C, saturn.R3, op4); + return 0; + case 0xc: /* CR4EX */ + saturn.PC += 6; + exchange_register(saturn.C, saturn.R4, op4); + return 0; + default: + return 1; + } + default: + return 1; + } + case 0xb: + op4 = read_nibble(saturn.PC + 3); + switch(op4) { + case 2: /* PC=A */ + jumpaddr = dat_to_addr(saturn.A); + saturn.PC = jumpaddr; + return 0; + case 3: /* PC=C */ + jumpaddr = dat_to_addr(saturn.C); + saturn.PC = jumpaddr; + return 0; + case 4: /* A=PC */ + saturn.PC += 4; + addr_to_dat(saturn.PC, saturn.A); + return 0; + case 5: /* C=PC */ + saturn.PC += 4; + addr_to_dat(saturn.PC, saturn.C); + return 0; + case 6: /* APCEX */ + saturn.PC += 4; + jumpaddr = dat_to_addr(saturn.A); + addr_to_dat(saturn.PC, saturn.A); + saturn.PC = jumpaddr; + return 0; + case 7: /* CPCEX */ + saturn.PC += 4; + jumpaddr = dat_to_addr(saturn.C); + addr_to_dat(saturn.PC, saturn.C); + saturn.PC = jumpaddr; + return 0; + default: + return 1; + } + case 0xc: /* ASRB */ + saturn.PC += 3; + shift_right_bit_register(saturn.A, W_FIELD); + return 0; + case 0xd: /* BSRB */ + saturn.PC += 3; + shift_right_bit_register(saturn.B, W_FIELD); + return 0; + case 0xe: /* CSRB */ + saturn.PC += 3; + shift_right_bit_register(saturn.C, W_FIELD); + return 0; + case 0xf: /* DSRB */ + saturn.PC += 3; + shift_right_bit_register(saturn.D, W_FIELD); + return 0; + default: + return 1; + } + case 2: + op3 = read_nibble(saturn.PC + 2); + saturn.PC += 3; + clear_hardware_stat(op3); + return 0; + case 3: + op3 = read_nibble(saturn.PC + 2); + saturn.CARRY = is_zero_hardware_stat(op3); + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 4: + case 5: + op3 = read_nibble(saturn.PC + 2); + if (op2 == 4) { + saturn.PC += 3; + clear_program_stat(op3); + } else { + saturn.PC += 3; + set_program_stat(op3); + } + return 0; + case 6: + case 7: + op3 = read_nibble(saturn.PC + 2); + if (op2 == 6) + saturn.CARRY = (get_program_stat(op3) == 0)?1:0; + else + saturn.CARRY = (get_program_stat(op3) != 0)?1:0; + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 8: + case 9: + op3 = read_nibble(saturn.PC + 2); + if (op2 == 8) + saturn.CARRY = (saturn.P != op3)?1:0; + else + saturn.CARRY = (saturn.P == op3)?1:0; + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 0xa: + op3 = read_nibble(saturn.PC + 2); + switch(op3) { + case 0: /* ?A=B */ + saturn.CARRY = is_equal_register(saturn.A, saturn.B, A_FIELD); + break; + case 1: /* ?B=C */ + saturn.CARRY = is_equal_register(saturn.B, saturn.C, A_FIELD); + break; + case 2: /* ?A=C */ + saturn.CARRY = is_equal_register(saturn.A, saturn.C, A_FIELD); + break; + case 3: /* ?C=D */ + saturn.CARRY = is_equal_register(saturn.C, saturn.D, A_FIELD); + break; + case 4: /* ?A#B */ + saturn.CARRY = is_not_equal_register(saturn.A, saturn.B, A_FIELD); + break; + case 5: /* ?B#C */ + saturn.CARRY = is_not_equal_register(saturn.B, saturn.C, A_FIELD); + break; + case 6: /* ?A#C */ + saturn.CARRY = is_not_equal_register(saturn.A, saturn.C, A_FIELD); + break; + case 7: /* ?C#D */ + saturn.CARRY = is_not_equal_register(saturn.C, saturn.D, A_FIELD); + break; + case 8: /* ?A=0 */ + saturn.CARRY = is_zero_register(saturn.A, A_FIELD); + break; + case 9: /* ?B=0 */ + saturn.CARRY = is_zero_register(saturn.B, A_FIELD); + break; + case 0xa: /* ?C=0 */ + saturn.CARRY = is_zero_register(saturn.C, A_FIELD); + break; + case 0xb: /* ?D=0 */ + saturn.CARRY = is_zero_register(saturn.D, A_FIELD); + break; + case 0xc: /* ?A#0 */ + saturn.CARRY = is_not_zero_register(saturn.A, A_FIELD); + break; + case 0xd: /* ?B#0 */ + saturn.CARRY = is_not_zero_register(saturn.B, A_FIELD); + break; + case 0xe: /* ?C#0 */ + saturn.CARRY = is_not_zero_register(saturn.C, A_FIELD); + break; + case 0xf: /* ?D#0 */ + saturn.CARRY = is_not_zero_register(saturn.D, A_FIELD); + break; + default: + return 1; + } + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 0xb: + op3 = read_nibble(saturn.PC + 2); + switch (op3) { + case 0: /* ?A>B */ + saturn.CARRY = is_greater_register(saturn.A, saturn.B, A_FIELD); + break; + case 1: /* ?B>C */ + saturn.CARRY = is_greater_register(saturn.B, saturn.C, A_FIELD); + break; + case 2: /* ?C>A */ + saturn.CARRY = is_greater_register(saturn.C, saturn.A, A_FIELD); + break; + case 3: /* ?D>C */ + saturn.CARRY = is_greater_register(saturn.D, saturn.C, A_FIELD); + break; + case 4: /* ?A=B */ + saturn.CARRY = is_greater_or_equal_register(saturn.A, saturn.B, A_FIELD); + break; + case 9: /* ?B>=C */ + saturn.CARRY = is_greater_or_equal_register(saturn.B, saturn.C, A_FIELD); + break; + case 0xa: /* ?C>=A */ + saturn.CARRY = is_greater_or_equal_register(saturn.C, saturn.A, A_FIELD); + break; + case 0xb: /* ?D>=C */ + saturn.CARRY = is_greater_or_equal_register(saturn.D, saturn.C, A_FIELD); + break; + case 0xc: /* ?A<=B */ + saturn.CARRY = is_less_or_equal_register(saturn.A, saturn.B, A_FIELD); + break; + case 0xd: /* ?B<=C */ + saturn.CARRY = is_less_or_equal_register(saturn.B, saturn.C, A_FIELD); + break; + case 0xe: /* ?C<=A */ + saturn.CARRY = is_less_or_equal_register(saturn.C, saturn.A, A_FIELD); + break; + case 0xf: /* ?D<=C */ + saturn.CARRY = is_less_or_equal_register(saturn.D, saturn.C, A_FIELD); + break; + default: + return 1; + } + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 0xc: + op3 = read_nibbles(saturn.PC + 2, 4); + if (op3 & 0x8000) + op3 |= jumpmasks[4]; + jumpaddr = (saturn.PC + op3 + 2) & 0xfffff; + saturn.PC = jumpaddr; + return 0; + case 0xd: + op3 = read_nibbles(saturn.PC + 2, 5); + jumpaddr = op3; + saturn.PC = jumpaddr; + return 0; + case 0xe: + op3 = read_nibbles(saturn.PC + 2, 4); + if (op3 & 0x8000) + op3 |= jumpmasks[4]; + jumpaddr = (saturn.PC + op3 + 6) & 0xfffff; + push_return_addr(saturn.PC + 6); + saturn.PC = jumpaddr; + return 0; + case 0xf: + op3 = read_nibbles(saturn.PC + 2, 5); + jumpaddr = op3; + push_return_addr(saturn.PC + 7); + saturn.PC = jumpaddr; + return 0; + default: + return 1; + } + case 9: + op3 = read_nibble(saturn.PC + 2); + if (op2 < 8) { + switch(op3) { + case 0: /* ?A=B */ + saturn.CARRY = is_equal_register(saturn.A, saturn.B, op2); + break; + case 1: /* ?B=C */ + saturn.CARRY = is_equal_register(saturn.B, saturn.C, op2); + break; + case 2: /* ?A=C */ + saturn.CARRY = is_equal_register(saturn.A, saturn.C, op2); + break; + case 3: /* ?C=D */ + saturn.CARRY = is_equal_register(saturn.C, saturn.D, op2); + break; + case 4: /* ?A#B */ + saturn.CARRY = is_not_equal_register(saturn.A, saturn.B, op2); + break; + case 5: /* ?B#C */ + saturn.CARRY = is_not_equal_register(saturn.B, saturn.C, op2); + break; + case 6: /* ?A#C */ + saturn.CARRY = is_not_equal_register(saturn.A, saturn.C, op2); + break; + case 7: /* ?C#D */ + saturn.CARRY = is_not_equal_register(saturn.C, saturn.D, op2); + break; + case 8: /* ?A=0 */ + saturn.CARRY = is_zero_register(saturn.A, op2); + break; + case 9: /* ?B=0 */ + saturn.CARRY = is_zero_register(saturn.B, op2); + break; + case 0xa: /* ?C=0 */ + saturn.CARRY = is_zero_register(saturn.C, op2); + break; + case 0xb: /* ?D=0 */ + saturn.CARRY = is_zero_register(saturn.D, op2); + break; + case 0xc: /* ?A#0 */ + saturn.CARRY = is_not_zero_register(saturn.A, op2); + break; + case 0xd: /* ?B#0 */ + saturn.CARRY = is_not_zero_register(saturn.B, op2); + break; + case 0xe: /* ?C#0 */ + saturn.CARRY = is_not_zero_register(saturn.C, op2); + break; + case 0xf: /* ?D#0 */ + saturn.CARRY = is_not_zero_register(saturn.D, op2); + break; + default: + return 1; + } + } else { + op2 &= 7; + switch (op3) { + case 0: /* ?A>B */ + saturn.CARRY = is_greater_register(saturn.A, saturn.B, op2); + break; + case 1: /* ?B>C */ + saturn.CARRY = is_greater_register(saturn.B, saturn.C, op2); + break; + case 2: /* ?C>A */ + saturn.CARRY = is_greater_register(saturn.C, saturn.A, op2); + break; + case 3: /* ?D>C */ + saturn.CARRY = is_greater_register(saturn.D, saturn.C, op2); + break; + case 4: /* ?A=B */ + saturn.CARRY = is_greater_or_equal_register(saturn.A, saturn.B, op2); + break; + case 9: /* ?B>=C */ + saturn.CARRY = is_greater_or_equal_register(saturn.B, saturn.C, op2); + break; + case 0xa: /* ?C>=A */ + saturn.CARRY = is_greater_or_equal_register(saturn.C, saturn.A, op2); + break; + case 0xb: /* ?D>=C */ + saturn.CARRY = is_greater_or_equal_register(saturn.D, saturn.C, op2); + break; + case 0xc: /* ?A<=B */ + saturn.CARRY = is_less_or_equal_register(saturn.A, saturn.B, op2); + break; + case 0xd: /* ?B<=C */ + saturn.CARRY = is_less_or_equal_register(saturn.B, saturn.C, op2); + break; + case 0xe: /* ?C<=A */ + saturn.CARRY = is_less_or_equal_register(saturn.C, saturn.A, op2); + break; + case 0xf: /* ?D<=C */ + saturn.CARRY = is_less_or_equal_register(saturn.D, saturn.C, op2); + break; + default: + return 1; + } + } + if (saturn.CARRY) { + saturn.PC += 3; + op4 = read_nibbles(saturn.PC, 2); + if (op4) { + if (op4 & 0x80) + op4 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op4) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 5; + } + return 0; + case 0xa: + op3 = read_nibble(saturn.PC + 2); + if (op2 < 8) { + switch(op3) { + case 0: /* A=A+B */ + saturn.PC += 3; + add_register(saturn.A, saturn.A, saturn.B, op2); + return 0; + case 1: /* B=B+C */ + saturn.PC += 3; + add_register(saturn.B, saturn.B, saturn.C, op2); + return 0; + case 2: /* C=C+A */ + saturn.PC += 3; + add_register(saturn.C, saturn.C, saturn.A, op2); + return 0; + case 3: /* D=D+C */ + saturn.PC += 3; + add_register(saturn.D, saturn.D, saturn.C, op2); + return 0; + case 4: /* A=A+A */ + saturn.PC += 3; + add_register(saturn.A, saturn.A, saturn.A, op2); + return 0; + case 5: /* B=B+B */ + saturn.PC += 3; + add_register(saturn.B, saturn.B, saturn.B, op2); + return 0; + case 6: /* C=C+C */ + saturn.PC += 3; + add_register(saturn.C, saturn.C, saturn.C, op2); + return 0; + case 7: /* D=D+D */ + saturn.PC += 3; + add_register(saturn.D, saturn.D, saturn.D, op2); + return 0; + case 8: /* B=B+A */ + saturn.PC += 3; + add_register(saturn.B, saturn.B, saturn.A, op2); + return 0; + case 9: /* C=C+B */ + saturn.PC += 3; + add_register(saturn.C, saturn.C, saturn.B, op2); + return 0; + case 0xa: /* A=A+C */ + saturn.PC += 3; + add_register(saturn.A, saturn.A, saturn.C, op2); + return 0; + case 0xb: /* C=C+D */ + saturn.PC += 3; + add_register(saturn.C, saturn.C, saturn.D, op2); + return 0; + case 0xc: /* A=A-1 */ + saturn.PC += 3; + dec_register(saturn.A, op2); + return 0; + case 0xd: /* B=B-1 */ + saturn.PC += 3; + dec_register(saturn.B, op2); + return 0; + case 0xe: /* C=C-1 */ + saturn.PC += 3; + dec_register(saturn.C, op2); + return 0; + case 0xf: /* D=D-1 */ + saturn.PC += 3; + dec_register(saturn.D, op2); + return 0; + default: + return 1; + } + } else { + op2 &= 7; + switch(op3) { + case 0: /* A=0 */ + saturn.PC += 3; + zero_register(saturn.A, op2); + return 0; + case 1: /* B=0 */ + saturn.PC += 3; + zero_register(saturn.B, op2); + return 0; + case 2: /* C=0 */ + saturn.PC += 3; + zero_register(saturn.C, op2); + return 0; + case 3: /* D=0 */ + saturn.PC += 3; + zero_register(saturn.D, op2); + return 0; + case 4: /* A=B */ + saturn.PC += 3; + copy_register(saturn.A, saturn.B, op2); + return 0; + case 5: /* B=C */ + saturn.PC += 3; + copy_register(saturn.B, saturn.C, op2); + return 0; + case 6: /* C=A */ + saturn.PC += 3; + copy_register(saturn.C, saturn.A, op2); + return 0; + case 7: /* D=C */ + saturn.PC += 3; + copy_register(saturn.D, saturn.C, op2); + return 0; + case 8: /* B=A */ + saturn.PC += 3; + copy_register(saturn.B, saturn.A, op2); + return 0; + case 9: /* C=B */ + saturn.PC += 3; + copy_register(saturn.C, saturn.B, op2); + return 0; + case 0xa: /* A=C */ + saturn.PC += 3; + copy_register(saturn.A, saturn.C, op2); + return 0; + case 0xb: /* C=D */ + saturn.PC += 3; + copy_register(saturn.C, saturn.D, op2); + return 0; + case 0xc: /* ABEX */ + saturn.PC += 3; + exchange_register(saturn.A, saturn.B, op2); + return 0; + case 0xd: /* BCEX */ + saturn.PC += 3; + exchange_register(saturn.B, saturn.C, op2); + return 0; + case 0xe: /* ACEX */ + saturn.PC += 3; + exchange_register(saturn.A, saturn.C, op2); + return 0; + case 0xf: /* CDEX */ + saturn.PC += 3; + exchange_register(saturn.C, saturn.D, op2); + return 0; + default: + return 1; + } + } + case 0xb: + op3 = read_nibble(saturn.PC + 2); + if (op2 < 8) { + switch (op3) { + case 0: /* A=A-B */ + saturn.PC += 3; + sub_register(saturn.A, saturn.A, saturn.B, op2); + return 0; + case 1: /* B=B-C */ + saturn.PC += 3; + sub_register(saturn.B, saturn.B, saturn.C, op2); + return 0; + case 2: /* C=C-A */ + saturn.PC += 3; + sub_register(saturn.C, saturn.C, saturn.A, op2); + return 0; + case 3: /* D=D-C */ + saturn.PC += 3; + sub_register(saturn.D, saturn.D, saturn.C, op2); + return 0; + case 4: /* A=A+1 */ + saturn.PC += 3; + inc_register(saturn.A, op2); + return 0; + case 5: /* B=B+1 */ + saturn.PC += 3; + inc_register(saturn.B, op2); + return 0; + case 6: /* C=C+1 */ + saturn.PC += 3; + inc_register(saturn.C, op2); + return 0; + case 7: /* D=D+1 */ + saturn.PC += 3; + inc_register(saturn.D, op2); + return 0; + case 8: /* B=B-A */ + saturn.PC += 3; + sub_register(saturn.B, saturn.B, saturn.A, op2); + return 0; + case 9: /* C=C-B */ + saturn.PC += 3; + sub_register(saturn.C, saturn.C, saturn.B, op2); + return 0; + case 0xa: /* A=A-C */ + saturn.PC += 3; + sub_register(saturn.A, saturn.A, saturn.C, op2); + return 0; + case 0xb: /* C=C-D */ + saturn.PC += 3; + sub_register(saturn.C, saturn.C, saturn.D, op2); + return 0; + case 0xc: /* A=B-A */ + saturn.PC += 3; + sub_register(saturn.A, saturn.B, saturn.A, op2); + return 0; + case 0xd: /* B=C-B */ + saturn.PC += 3; + sub_register(saturn.B, saturn.C, saturn.B, op2); + return 0; + case 0xe: /* C=A-C */ + saturn.PC += 3; + sub_register(saturn.C, saturn.A, saturn.C, op2); + return 0; + case 0xf: /* D=C-D */ + saturn.PC += 3; + sub_register(saturn.D, saturn.C, saturn.D, op2); + return 0; + default: + return 1; + } + } else { + op2 &= 7; + switch (op3) { + case 0: /* ASL */ + saturn.PC += 3; + shift_left_register(saturn.A, op2); + return 0; + case 1: /* BSL */ + saturn.PC += 3; + shift_left_register(saturn.B, op2); + return 0; + case 2: /* CSL */ + saturn.PC += 3; + shift_left_register(saturn.C, op2); + return 0; + case 3: /* DSL */ + saturn.PC += 3; + shift_left_register(saturn.D, op2); + return 0; + case 4: /* ASR */ + saturn.PC += 3; + shift_right_register(saturn.A, op2); + return 0; + case 5: /* BSR */ + saturn.PC += 3; + shift_right_register(saturn.B, op2); + return 0; + case 6: /* CSR */ + saturn.PC += 3; + shift_right_register(saturn.C, op2); + return 0; + case 7: /* DSR */ + saturn.PC += 3; + shift_right_register(saturn.D, op2); + return 0; + case 8: /* A=-A */ + saturn.PC += 3; + complement_2_register(saturn.A, op2); + return 0; + case 9: /* B=-B */ + saturn.PC += 3; + complement_2_register(saturn.B, op2); + return 0; + case 0xa: /* C=-C */ + saturn.PC += 3; + complement_2_register(saturn.C, op2); + return 0; + case 0xb: /* D=-D */ + saturn.PC += 3; + complement_2_register(saturn.D, op2); + return 0; + case 0xc: /* A=-A-1 */ + saturn.PC += 3; + complement_1_register(saturn.A, op2); + return 0; + case 0xd: /* B=-B-1 */ + saturn.PC += 3; + complement_1_register(saturn.B, op2); + return 0; + case 0xe: /* C=-C-1 */ + saturn.PC += 3; + complement_1_register(saturn.C, op2); + return 0; + case 0xf: /* D=-D-1 */ + saturn.PC += 3; + complement_1_register(saturn.D, op2); + return 0; + default: + return 1; + } + } + case 0xc: + switch(op2) { + case 0: /* A=A+B */ + saturn.PC += 2; + add_register(saturn.A, saturn.A, saturn.B, A_FIELD); + return 0; + case 1: /* B=B+C */ + saturn.PC += 2; + add_register(saturn.B, saturn.B, saturn.C, A_FIELD); + return 0; + case 2: /* C=C+A */ + saturn.PC += 2; + add_register(saturn.C, saturn.C, saturn.A, A_FIELD); + return 0; + case 3: /* D=D+C */ + saturn.PC += 2; + add_register(saturn.D, saturn.D, saturn.C, A_FIELD); + return 0; + case 4: /* A=A+A */ + saturn.PC += 2; + add_register(saturn.A, saturn.A, saturn.A, A_FIELD); + return 0; + case 5: /* B=B+B */ + saturn.PC += 2; + add_register(saturn.B, saturn.B, saturn.B, A_FIELD); + return 0; + case 6: /* C=C+C */ + saturn.PC += 2; + add_register(saturn.C, saturn.C, saturn.C, A_FIELD); + return 0; + case 7: /* D=D+D */ + saturn.PC += 2; + add_register(saturn.D, saturn.D, saturn.D, A_FIELD); + return 0; + case 8: /* B=B+A */ + saturn.PC += 2; + add_register(saturn.B, saturn.B, saturn.A, A_FIELD); + return 0; + case 9: /* C=C+B */ + saturn.PC += 2; + add_register(saturn.C, saturn.C, saturn.B, A_FIELD); + return 0; + case 0xa: /* A=A+C */ + saturn.PC += 2; + add_register(saturn.A, saturn.A, saturn.C, A_FIELD); + return 0; + case 0xb: /* C=C+D */ + saturn.PC += 2; + add_register(saturn.C, saturn.C, saturn.D, A_FIELD); + return 0; + case 0xc: /* A=A-1 */ + saturn.PC += 2; + dec_register(saturn.A, A_FIELD); + return 0; + case 0xd: /* B=B-1 */ + saturn.PC += 2; + dec_register(saturn.B, A_FIELD); + return 0; + case 0xe: /* C=C-1 */ + saturn.PC += 2; + dec_register(saturn.C, A_FIELD); + return 0; + case 0xf: /* D=D-1 */ + saturn.PC += 2; + dec_register(saturn.D, A_FIELD); + return 0; + default: + return 1; + } + case 0xd: + switch(op2) { + case 0: /* A=0 */ + saturn.PC += 2; + zero_register(saturn.A, A_FIELD); + return 0; + case 1: /* B=0 */ + saturn.PC += 2; + zero_register(saturn.B, A_FIELD); + return 0; + case 2: /* C=0 */ + saturn.PC += 2; + zero_register(saturn.C, A_FIELD); + return 0; + case 3: /* D=0 */ + saturn.PC += 2; + zero_register(saturn.D, A_FIELD); + return 0; + case 4: /* A=B */ + saturn.PC += 2; + copy_register(saturn.A, saturn.B, A_FIELD); + return 0; + case 5: /* B=C */ + saturn.PC += 2; + copy_register(saturn.B, saturn.C, A_FIELD); + return 0; + case 6: /* C=A */ + saturn.PC += 2; + copy_register(saturn.C, saturn.A, A_FIELD); + return 0; + case 7: /* D=C */ + saturn.PC += 2; + copy_register(saturn.D, saturn.C, A_FIELD); + return 0; + case 8: /* B=A */ + saturn.PC += 2; + copy_register(saturn.B, saturn.A, A_FIELD); + return 0; + case 9: /* C=B */ + saturn.PC += 2; + copy_register(saturn.C, saturn.B, A_FIELD); + return 0; + case 0xa: /* A=C */ + saturn.PC += 2; + copy_register(saturn.A, saturn.C, A_FIELD); + return 0; + case 0xb: /* C=D */ + saturn.PC += 2; + copy_register(saturn.C, saturn.D, A_FIELD); + return 0; + case 0xc: /* ABEX */ + saturn.PC += 2; + exchange_register(saturn.A, saturn.B, A_FIELD); + return 0; + case 0xd: /* BCEX */ + saturn.PC += 2; + exchange_register(saturn.B, saturn.C, A_FIELD); + return 0; + case 0xe: /* ACEX */ + saturn.PC += 2; + exchange_register(saturn.A, saturn.C, A_FIELD); + return 0; + case 0xf: /* CDEX */ + saturn.PC += 2; + exchange_register(saturn.C, saturn.D, A_FIELD); + return 0; + default: + return 1; + } + case 0xe: + switch (op2) { + case 0: /* A=A-B */ + saturn.PC += 2; + sub_register(saturn.A, saturn.A, saturn.B, A_FIELD); + return 0; + case 1: /* B=B-C */ + saturn.PC += 2; + sub_register(saturn.B, saturn.B, saturn.C, A_FIELD); + return 0; + case 2: /* C=C-A */ + saturn.PC += 2; + sub_register(saturn.C, saturn.C, saturn.A, A_FIELD); + return 0; + case 3: /* D=D-C */ + saturn.PC += 2; + sub_register(saturn.D, saturn.D, saturn.C, A_FIELD); + return 0; + case 4: /* A=A+1 */ + saturn.PC += 2; + inc_register(saturn.A, A_FIELD); + return 0; + case 5: /* B=B+1 */ + saturn.PC += 2; + inc_register(saturn.B, A_FIELD); + return 0; + case 6: /* C=C+1 */ + saturn.PC += 2; + inc_register(saturn.C, A_FIELD); + return 0; + case 7: /* D=D+1 */ + saturn.PC += 2; + inc_register(saturn.D, A_FIELD); + return 0; + case 8: /* B=B-A */ + saturn.PC += 2; + sub_register(saturn.B, saturn.B, saturn.A, A_FIELD); + return 0; + case 9: /* C=C-B */ + saturn.PC += 2; + sub_register(saturn.C, saturn.C, saturn.B, A_FIELD); + return 0; + case 0xa: /* A=A-C */ + saturn.PC += 2; + sub_register(saturn.A, saturn.A, saturn.C, A_FIELD); + return 0; + case 0xb: /* C=C-D */ + saturn.PC += 2; + sub_register(saturn.C, saturn.C, saturn.D, A_FIELD); + return 0; + case 0xc: /* A=B-A */ + saturn.PC += 2; + sub_register(saturn.A, saturn.B, saturn.A, A_FIELD); + return 0; + case 0xd: /* B=C-B */ + saturn.PC += 2; + sub_register(saturn.B, saturn.C, saturn.B, A_FIELD); + return 0; + case 0xe: /* C=A-C */ + saturn.PC += 2; + sub_register(saturn.C, saturn.A, saturn.C, A_FIELD); + return 0; + case 0xf: /* D=C-D */ + saturn.PC += 2; + sub_register(saturn.D, saturn.C, saturn.D, A_FIELD); + return 0; + default: + return 1; + } + case 0xf: + switch (op2) { + case 0: /* ASL */ + saturn.PC += 2; + shift_left_register(saturn.A, A_FIELD); + return 0; + case 1: /* BSL */ + saturn.PC += 2; + shift_left_register(saturn.B, A_FIELD); + return 0; + case 2: /* CSL */ + saturn.PC += 2; + shift_left_register(saturn.C, A_FIELD); + return 0; + case 3: /* DSL */ + saturn.PC += 2; + shift_left_register(saturn.D, A_FIELD); + return 0; + case 4: /* ASR */ + saturn.PC += 2; + shift_right_register(saturn.A, A_FIELD); + return 0; + case 5: /* BSR */ + saturn.PC += 2; + shift_right_register(saturn.B, A_FIELD); + return 0; + case 6: /* CSR */ + saturn.PC += 2; + shift_right_register(saturn.C, A_FIELD); + return 0; + case 7: /* DSR */ + saturn.PC += 2; + shift_right_register(saturn.D, A_FIELD); + return 0; + case 8: /* A=-A */ + saturn.PC += 2; + complement_2_register(saturn.A, A_FIELD); + return 0; + case 9: /* B=-B */ + saturn.PC += 2; + complement_2_register(saturn.B, A_FIELD); + return 0; + case 0xa: /* C=-C */ + saturn.PC += 2; + complement_2_register(saturn.C, A_FIELD); + return 0; + case 0xb: /* D=-D */ + saturn.PC += 2; + complement_2_register(saturn.D, A_FIELD); + return 0; + case 0xc: /* A=-A-1 */ + saturn.PC += 2; + complement_1_register(saturn.A, A_FIELD); + return 0; + case 0xd: /* B=-B-1 */ + saturn.PC += 2; + complement_1_register(saturn.B, A_FIELD); + return 0; + case 0xe: /* C=-C-1 */ + saturn.PC += 2; + complement_1_register(saturn.C, A_FIELD); + return 0; + case 0xf: /* D=-D-1 */ + saturn.PC += 2; + complement_1_register(saturn.D, A_FIELD); + return 0; + default: + return 1; + } + default: + return 1; + } +} + +inline int +#ifdef __FunctionProto__ +step_instruction(void) +#else +step_instruction() +#endif +{ + int op0, op1, op2, op3; + int stop = 0; + + jumpaddr = 0; + + op0 = read_nibble(saturn.PC); + // LOGI("----- %d", op0); + switch (op0) { + case 0: + op1 = read_nibble(saturn.PC + 1); + switch (op1) { + case 0: /* RTNSXM */ + saturn.XM = 1; + saturn.PC = pop_return_addr(); + break; + case 1: /* RTN */ + saturn.PC = pop_return_addr(); + break; + case 2: /* RTNSC */ + saturn.CARRY = 1; + saturn.PC = pop_return_addr(); + break; + case 3: /* RTNCC */ + saturn.CARRY = 0; + saturn.PC = pop_return_addr(); + break; + case 4: /* SETHEX */ + saturn.PC += 2; + saturn.hexmode = HEX; + break; + case 5: /* SETDEC */ + saturn.PC += 2; + saturn.hexmode = DEC; + break; + case 6: /* RSTK=C */ + jumpaddr = dat_to_addr(saturn.C); + push_return_addr(jumpaddr); + saturn.PC += 2; + break; + case 7: /* C=RSTK */ + saturn.PC += 2; + jumpaddr = pop_return_addr(); + addr_to_dat(jumpaddr, saturn.C); + break; + case 8: /* CLRST */ + saturn.PC += 2; + clear_status(); + break; + case 9: /* C=ST */ + saturn.PC += 2; + status_to_register(saturn.C); + break; + case 0xa: /* ST=C */ + saturn.PC += 2; + register_to_status(saturn.C); + break; + case 0xb: /* CSTEX */ + saturn.PC += 2; + swap_register_status(saturn.C); + break; + case 0xc: /* P=P+1 */ + saturn.PC += 2; + if (saturn.P == 0xf) { + saturn.P = 0; + saturn.CARRY = 1; + } else { + saturn.P += 1; + saturn.CARRY = 0; + } + break; + case 0xd: /* P=P-1 */ + saturn.PC += 2; + if (saturn.P == 0) { + saturn.P = 0xf; + saturn.CARRY = 1; + } else { + saturn.P -= 1; + saturn.CARRY = 0; + } + break; + case 0xe: + op2 = read_nibble(saturn.PC + 2); + op3 = read_nibble(saturn.PC + 3); + switch(op3) { + case 0: /* A=A&B */ + saturn.PC += 4; + and_register(saturn.A, saturn.A, saturn.B, op2); + break; + case 1: /* B=B&C */ + saturn.PC += 4; + and_register(saturn.B, saturn.B, saturn.C, op2); + break; + case 2: /* C=C&A */ + saturn.PC += 4; + and_register(saturn.C, saturn.C, saturn.A, op2); + break; + case 3: /* D=D&C */ + saturn.PC += 4; + and_register(saturn.D, saturn.D, saturn.C, op2); + break; + case 4: /* B=B&A */ + saturn.PC += 4; + and_register(saturn.B, saturn.B, saturn.A, op2); + break; + case 5: /* C=C&B */ + saturn.PC += 4; + and_register(saturn.C, saturn.C, saturn.B, op2); + break; + case 6: /* A=A&C */ + saturn.PC += 4; + and_register(saturn.A, saturn.A, saturn.C, op2); + break; + case 7: /* C=C&D */ + saturn.PC += 4; + and_register(saturn.C, saturn.C, saturn.D, op2); + break; + case 8: /* A=A!B */ + saturn.PC += 4; + or_register(saturn.A, saturn.A, saturn.B, op2); + break; + case 9: /* B=B!C */ + saturn.PC += 4; + or_register(saturn.B, saturn.B, saturn.C, op2); + break; + case 0xa: /* C=C!A */ + saturn.PC += 4; + or_register(saturn.C, saturn.C, saturn.A, op2); + break; + case 0xb: /* D=D!C */ + saturn.PC += 4; + or_register(saturn.D, saturn.D, saturn.C, op2); + break; + case 0xc: /* B=B!A */ + saturn.PC += 4; + or_register(saturn.B, saturn.B, saturn.A, op2); + break; + case 0xd: /* C=C!B */ + saturn.PC += 4; + or_register(saturn.C, saturn.C, saturn.B, op2); + break; + case 0xe: /* A=A!C */ + saturn.PC += 4; + or_register(saturn.A, saturn.A, saturn.C, op2); + break; + case 0xf: /* C=C!D */ + saturn.PC += 4; + or_register(saturn.C, saturn.C, saturn.D, op2); + break; + default: + stop = 1; + break; + } + break; + case 0xf: /* RTI */ + do_return_interupt(); + break; + default: + stop = 1; + break; + } + break; + case 1: + stop = decode_group_1(); + break; + case 2: + op2 = read_nibble(saturn.PC + 1); + saturn.PC += 2; + saturn.P = op2; + break; + case 3: + op2 = read_nibble(saturn.PC + 1); + load_constant(saturn.C, op2 + 1, saturn.PC + 2); + saturn.PC += 3 + op2; + break; + case 4: + op2 = read_nibbles(saturn.PC + 1, 2); + if (op2 == 0x02) { + saturn.PC += 3; + } else if (saturn.CARRY != 0) { + if (op2) { + if (op2 & 0x80) + op2 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op2 + 1) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 3; + } + break; + case 5: + if (saturn.CARRY == 0) { + op2 = read_nibbles(saturn.PC + 1, 2); + if (op2) { + if (op2 & 0x80) + op2 |= jumpmasks[2]; + jumpaddr = (saturn.PC + op2 + 1) & 0xfffff; + saturn.PC = jumpaddr; + } else { + saturn.PC = pop_return_addr(); + } + } else { + saturn.PC += 3; + } + break; + case 6: + op2 = read_nibbles(saturn.PC + 1, 3); + if (op2 == 0x003) { + saturn.PC += 4; + } else if(op2 == 0x004) { + op3 = read_nibbles(saturn.PC + 4, 1); + saturn.PC += 5; + if (op3 != 0) { + enter_debugger |= TRAP_INSTRUCTION; + return 1; + } + } else { + if (op2 & 0x800) + op2 |= jumpmasks[3]; + jumpaddr = (op2 + saturn.PC + 1) & 0xfffff; + saturn.PC = jumpaddr; + } + break; + case 7: + op2 = read_nibbles(saturn.PC + 1, 3); + if (op2 & 0x800) + op2 |= jumpmasks[3]; + jumpaddr = (op2 + saturn.PC + 4) & 0xfffff; + push_return_addr(saturn.PC+4); + saturn.PC = jumpaddr; + break; + default: + stop = decode_8_thru_f(op0); + break; + } +// LOGI("-----2"); + instructions++; + if (stop) { + enter_debugger |= ILLEGAL_INSTRUCTION; + } + return stop; +} + +inline void +#ifdef __FunctionProto__ +schedule(void) +#else +schedule() +#endif +{ + t1_t2_ticks ticks; + unsigned long steps; + static unsigned long old_stat_instr; + static unsigned long old_sched_instr; + + steps = instructions - old_sched_instr; + old_sched_instr = instructions; + +#ifdef DEBUG_SCHED + fprintf(stderr, "schedule called after %ld instructions\n", steps); +#endif + + if ((sched_timer2 -= steps) <= 0) { + if (!saturn.intenable) { + sched_timer2 = SCHED_TIMER2; + } else { + sched_timer2 = saturn.t2_tick; + } + saturn.t2_instr += steps; + if (saturn.t2_ctrl & 0x01) { + saturn.timer2--; + } + if (saturn.timer2 == 0 && (saturn.t2_ctrl & 0x02)) { + saturn.t2_ctrl |= 0x08; + do_interupt(); + } + } + schedule_event = sched_timer2; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next timer 2 step: %ld, event: %ld\n", + sched_timer2, schedule_event); +#endif + + if (device_check) { + device_check = 0; + if ((sched_display -= steps) <= 0) { + if (device.display_touched) device.display_touched -= steps; + if (device.display_touched < 0) device.display_touched = 1; +#ifdef DEBUG_DISP_SCHED + fprintf(stderr, "check_device: disp_when %d, disp_touched %d\n", + sched_display, device.display_touched); +#endif + } + check_devices(); + sched_display = SCHED_NEVER; + if (device.display_touched) { + if (device.display_touched < sched_display) + sched_display = device.display_touched - 1; + if (sched_display < schedule_event) schedule_event = sched_display; + } + } + + if ((sched_receive -= steps) <= 0) { + sched_receive = SCHED_RECEIVE; + if ((saturn.rcs & 0x01) == 0) { + receive_char(); + } + } + if (sched_receive < schedule_event) schedule_event = sched_receive; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next receive: %ld, event: %ld\n", + sched_receive, schedule_event); +#endif + + if ((sched_adjtime -= steps) <= 0) { + + sched_adjtime = SCHED_ADJTIME; + + if (saturn.PC < SrvcIoStart || saturn.PC > SrvcIoEnd) { + + ticks = get_t1_t2(); + if (saturn.t2_ctrl & 0x01) { + saturn.timer2 = ticks.t2_ticks; + } + + if ((saturn.t2_ctrl & 0x08) == 0 && saturn.timer2 <= 0) { + if (saturn.t2_ctrl & 0x02) { + saturn.t2_ctrl |= 0x08; + do_interupt(); + } + } + + adj_time_pending = 0; + + saturn.timer1 = set_t1 - ticks.t1_ticks; + if ((saturn.t1_ctrl & 0x08) == 0 && saturn.timer1 <= 0) { + if (saturn.t1_ctrl & 0x02) { + saturn.t1_ctrl |= 0x08; + do_interupt(); + } + } + saturn.timer1 &= 0x0f; + + } else { + + adj_time_pending = 1; + + } + } + if (sched_adjtime < schedule_event) schedule_event = sched_adjtime; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next adjtime: %ld, event: %ld\n", + sched_adjtime, schedule_event); +#endif + + if ((sched_timer1 -= steps) <= 0) { + if (!saturn.intenable) { + sched_timer1 = SCHED_TIMER1; + } else { + sched_timer1 = saturn.t1_tick; + } + saturn.t1_instr += steps; + saturn.timer1 = (saturn.timer1 - 1) & 0xf; + if (saturn.timer1 == 0 && (saturn.t1_ctrl & 0x02)) { + saturn.t1_ctrl |= 0x08; + do_interupt(); + } + } + if (sched_timer1 < schedule_event) schedule_event = sched_timer1; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next timer 1 step: %ld, event: %ld\n", + sched_timer1, schedule_event); +#endif + + if ((sched_statistics -= steps) <= 0) { + sched_statistics = SCHED_STATISTICS; + run = get_timer(RUN_TIMER); + s_1 = (run.hi << 19) | (run.lo >> 13); + s_16 = (run.hi << 23) | (run.lo >> 9); + delta_t_1 = s_1 - old_s_1; + delta_t_16 = s_16 - old_s_16; + old_s_1 = s_1; + old_s_16 = s_16; + delta_i = instructions - old_stat_instr; + old_stat_instr = instructions; + if (delta_t_1 > 0) { + t1_i_per_tick = ((NR_SAMPLES - 1) * t1_i_per_tick + + (delta_i / delta_t_16)) / NR_SAMPLES; + t2_i_per_tick = t1_i_per_tick / 512; + saturn.i_per_s = ((NR_SAMPLES - 1) * saturn.i_per_s + + (delta_i / delta_t_1)) / NR_SAMPLES; + } else { + t1_i_per_tick = 8192; + t2_i_per_tick = 16; + } + saturn.t1_tick = t1_i_per_tick; + saturn.t2_tick = t2_i_per_tick; + +#ifdef DEBUG_TIMER + if (delta_t_1 > 0) { +#if 0 + fprintf(stderr, "I/s = %ld, T1 I/TICK = %d (%ld), T2 I/TICK = %d (%ld)\n", + saturn.i_per_s, saturn.t1_tick, t1_i_per_tick, + saturn.t2_tick, t2_i_per_tick); +#else + fprintf(stderr, "I/s = %ld, T1 I/TICK = %d, T2 I/TICK = %d (%ld)\n", + saturn.i_per_s, saturn.t1_tick, saturn.t2_tick, t2_i_per_tick); +#endif + } +#endif + } + if (sched_statistics < schedule_event) + schedule_event = sched_statistics; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next statistics: %ld, event: %ld\n", + sched_statistics, schedule_event); +#endif + + if ((sched_instr_rollover -= steps) <= 0) { + sched_instr_rollover = SCHED_INSTR_ROLLOVER; + instructions = 1; + old_sched_instr = 1; + reset_timer(RUN_TIMER); + reset_timer(IDLE_TIMER); + start_timer(RUN_TIMER); + } + if (sched_instr_rollover < schedule_event) + schedule_event = sched_instr_rollover; + +#ifdef DEBUG_SCHED + fprintf(stderr, "next instruction rollover: %ld, event: %ld\n", + sched_instr_rollover, schedule_event); +#endif + + schedule_event--; + + if (got_alarm) { + got_alarm = 0; +#ifdef HAVE_XSHM + if (disp.display_update) refresh_display(); +#endif + GetEvent(); + //usleep(500); + } + + + // GetEvent(); +} + +int +#ifdef __FunctionProto__ +emulate(void) +#else +emulate() +#endif +{ + struct timeval tv; + struct timeval tv2; +#ifndef SOLARIS + struct timezone tz; +#endif + + reset_timer(T1_TIMER); + reset_timer(RUN_TIMER); + reset_timer(IDLE_TIMER); + + start_timer(T1_TIMER); + set_accesstime(); + + start_timer(RUN_TIMER); + + sched_timer1 = t1_i_per_tick = saturn.t1_tick; + sched_timer2 = t2_i_per_tick = saturn.t2_tick; + + set_t1 = saturn.timer1; + +/* + + do { + step_instruction(); + + if (--schedule_event <= 0) { + schedule(); + } + } while (exit_state); +*/ + + do { + + step_instruction(); + + + /* gettimeofday(&tv, &tz); + while ((tv.tv_sec == tv2.tv_sec) && ((tv.tv_usec - tv2.tv_usec) < 2)) { + gettimeofday(&tv, &tz); + } + tv2.tv_usec = tv.tv_usec; + tv2.tv_sec = tv.tv_sec; + + usleep(3); +*/ + if (schedule_event-- == 0) + { + schedule(); + } + } while (!enter_debugger); + + return 0; +} diff --git a/jni/errors.c b/jni/errors.c new file mode 100644 index 0000000..5757e9d --- /dev/null +++ b/jni/errors.c @@ -0,0 +1,63 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: errors.c,v $ + * Revision 1.1 1994/12/07 10:15:47 ecd + * Initial revision + * + * + * $Id: errors.c,v 1.1 1994/12/07 10:15:47 ecd Exp ecd $ + */ + +#include + +#include "global.h" +#include "resources.h" + +#include +#include "x48.h" + +char errbuf[1024] = { 0, }; +char fixbuf[1024] = { 0, }; + +void +#ifdef __FunctionProto__ +fatal_exit(void) +#else +fatal_exit() +#endif +{ + /* if (quiet) + exit (1); + + if (errbuf[0] == '\0') + { + LOGE( "%s: FATAL ERROR, exit.\n", progname); + exit (1); + } + + LOGE( "%s: FATAL ERROR, exit.\n - %s\n", progname, errbuf); + + if (fixbuf[0] != '\0') + LOGE( " - %s\n", fixbuf); + + exit (1);*/ +} + + diff --git a/jni/errors.h b/jni/errors.h new file mode 100644 index 0000000..77770ce --- /dev/null +++ b/jni/errors.h @@ -0,0 +1,37 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: errors.h,v $ + * Revision 1.1 1994/12/07 10:16:15 ecd + * Initial revision + * + * + * $Id: errors.h,v 1.1 1994/12/07 10:16:15 ecd Exp ecd $ + */ +#ifndef _ERRORS_H +#define _ERRORS_H + +#include "global.h" + +extern char errbuf[1024]; +extern char fixbuf[1024]; + +extern void fatal_exit __ProtoType__ ((void)); + +#endif /* !_ERRORS_H */ diff --git a/jni/g.sh b/jni/g.sh new file mode 100644 index 0000000..774b703 --- /dev/null +++ b/jni/g.sh @@ -0,0 +1 @@ +gcc main.c actions.c debugger.c device.c disasm.c emulate.c errors.c init.c lcd.c memory.c options.c register.c resources.c romio.c rpl.c serial.c timer.c x48.c \ No newline at end of file diff --git a/jni/global.h b/jni/global.h new file mode 100644 index 0000000..badf88d --- /dev/null +++ b/jni/global.h @@ -0,0 +1,154 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: global.h,v $ + * Revision 1.5 1994/12/08 22:28:39 ecd + * added generic define for SYSV_TIME if SYSV is defined + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added more functions missing in SunOS includes + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added more functions missing in SunOS includes + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * new define for SYSV_TIME + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * added #define USE_SHM + * + * Revision 1.1 1994/09/07 12:53:20 ecd + * Initial revision + * + * + * $Id: global.h,v 1.5 1994/12/08 22:28:39 ecd Exp ecd $ + */ + +#ifndef _GLOBAL_H +#define _GLOBAL_H 1 + +#include "config.h" + +#ifdef __ProtoType__ +#undef __ProtoType__ +#endif + +#ifdef __FunctionProto__ +#undef __FunctionProto__ +#endif + +#if defined(__STDC__) || defined(__cplusplus) +#define __ProtoType__(x) x +#define __FunctionProto__ 1 +#else +#define __ProtoType__(x) () +#undef __FunctionProto__ +#endif + +#if !defined(__GNUC__) || defined(__STRICT_ANSI__) +#define inline +#if !defined(__STDC__) +#define const +#endif +#endif + +/* + * If we are running Linux, `linux' will be defined by gcc. + */ +#if defined(linux) + +#ifndef LINUX +#define LINUX 1 +#endif + +#define SYSV_TIME 1 + +#else /* Not Linux */ + +#if defined(sun) && defined(unix) + +#if defined(__svr4__) || defined(SVR4) || defined(SYSV) + +#ifndef SOLARIS +#define SOLARIS 1 +#endif + +#define SYSV_TIME 1 + +#else /* Not Solaris */ + +#if defined(hpux) + +#ifndef HPUX +#define HPUX 1 +#endif + +#else /* Not HP-UX */ + +#ifndef SUNOS +#define SUNOS 1 +#endif + +#endif /* Not HP-UX */ +#endif /* Not Solaris */ +#endif /* Sun && Unix */ +#endif /* Not Linux */ + +#ifdef SYSV +#ifndef SYSV_TIME +#define SYSV_TIME 1 +#endif +#endif + +#ifdef SUNOS +#undef HAVE_STDIO +#else +#define HAVE_STDIO 1 +#endif + +#ifndef HAVE_STDIO +#include +#include +#include +extern int printf __ProtoType__((char *, ...)); +extern int fprintf __ProtoType__((FILE *, char *, ...)); +extern int sscanf __ProtoType__((char *, char *, ...)); +extern void fflush __ProtoType__((FILE *)); +extern int fseek __ProtoType__((FILE *, long, int)); +extern int fread __ProtoType__((void *, int, int, FILE*)); +extern int fwrite __ProtoType__((void *, int, int, FILE*)); +extern void fclose __ProtoType__((FILE *)); +extern int fgetc __ProtoType__((FILE *)); +extern void bzero __ProtoType__((void *, int)); +extern time_t time __ProtoType__((time_t *)); +extern int select __ProtoType__((int, fd_set *, fd_set *, + fd_set *, struct timeval *)); +extern int setitimer __ProtoType__((int, struct itimerval *, + struct itimerval *)); +extern int gethostname __ProtoType__((char *, int)); +#ifdef HAVE_XSHM +#include +#include +extern int shmget __ProtoType__((key_t, int, int)); +extern int shmat __ProtoType__((int, void *, int)); +extern int shmctl __ProtoType__((int, int, struct shmid_ds *)); +#endif +#endif + +#endif /* !_GLOBAL_H */ diff --git a/jni/hp.h b/jni/hp.h new file mode 100644 index 0000000..40139e5 --- /dev/null +++ b/jni/hp.h @@ -0,0 +1,63 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: hp.h,v $ + * Revision 1.4 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * changed char to unsigned + * + * Revision 1.1 1994/09/13 15:05:11 ecd + * Initial revision + * + * + * $Id: hp.h,v 1.4 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _HP_H +#define _HP_H 1 + +#include "bitmaps/hp.h" + +#include "bitmaps/hp48sx.h" + +#include "bitmaps/hp48gx.h" + +#include "bitmaps/science.h" + +#define gx_128K_ram_x_hot 1 +#define gx_128K_ram_y_hot 8 +#include "bitmaps/gx_128K_ram.h" + +#define gx_silver_x_hot 0 +#define gx_silver_y_hot 8 +#include "bitmaps/gx_silver.h" + +#define gx_green_x_hot 11 +#define gx_green_y_hot 0 +#include "bitmaps/gx_green.h" + +#endif /* !_HP_H */ diff --git a/jni/hp48 b/jni/hp48 new file mode 100644 index 0000000..6c2b377 Binary files /dev/null and b/jni/hp48 differ diff --git a/jni/hp48.h b/jni/hp48.h new file mode 100644 index 0000000..da3897c --- /dev/null +++ b/jni/hp48.h @@ -0,0 +1,286 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: hp48.h,v $ + * Revision 1.11 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.10 1994/11/28 02:19:22 ecd + * added function serial_baud() + * + * Revision 1.10 1994/11/28 02:19:22 ecd + * added function serial_baud() + * + * Revision 1.9 1994/11/02 14:51:27 ecd + * minor changes + * + * Revision 1.8 1994/10/09 20:26:35 ecd + * changed display_t: display.skip --> display.nibs_per_line + * + * Revision 1.7 1994/10/05 08:33:22 ecd + * added do_interupt definition + * + * Revision 1.6 1994/09/30 12:32:49 ecd + * added some fields for REALTIME support, + * added Scheduler stuff + * + * Revision 1.5 1994/09/18 15:31:58 ecd + * started Real Time support + * + * Revision 1.4 1994/09/13 16:58:42 ecd + * changed to plain X11 + * + * Revision 1.3 1994/08/31 18:25:23 ecd + * added read_nibble_crc + * + * Revision 1.2 1994/08/27 11:29:48 ecd + * changed keyboard interrupt handling. + * + * Revision 1.1 1994/08/26 11:09:18 ecd + * Initial revision + * + * + * + * $Id: hp48.h,v 1.11 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _HP48_H +#define _HP48_H 1 + +#include "global.h" + + + +#include + +#include "mmu.h" + +#define RAM_SIZE_SX 0x10000 +#define RAM_SIZE_GX 0x40000 + +#define P_FIELD 0 +#define WP_FIELD 1 +#define XS_FIELD 2 +#define X_FIELD 3 +#define S_FIELD 4 +#define M_FIELD 5 +#define B_FIELD 6 +#define W_FIELD 7 +#define A_FIELD 15 +#define IN_FIELD 16 +#define OUT_FIELD 17 +#define OUTS_FIELD 18 + +#define DEC 10 +#define HEX 16 + +#define NR_RSTK 8 +#define NR_PSTAT 16 + +typedef unsigned char word_1; +typedef unsigned char word_4; +typedef unsigned char word_8; +typedef unsigned short word_12; +typedef unsigned short word_16; +typedef long word_20; +typedef long word_32; +typedef struct word_64 { + unsigned long hi, lo; +} word_64; + +typedef struct keystate_t { + short rows[9]; +} keystate_t; + +typedef struct display_t { + + int on; + + long disp_start; + long disp_end; + + int offset; + int lines; + int nibs_per_line; + + int contrast; + + long menu_start; + long menu_end; + + int annunc; + +} display_t; + +typedef struct mem_cntl_t { + short unconfigured; + word_20 config[2]; +} mem_cntl_t; + +typedef struct saturn_t { + + unsigned long magic; + char version[4]; + + unsigned char A[16], B[16], C[16], D[16]; + + word_20 d[2]; + +#define D0 d[0] +#define D1 d[1] + + word_4 P; + word_20 PC; + + unsigned char R0[16], R1[16], R2[16], R3[16], R4[16]; + unsigned char IN[4]; + unsigned char OUT[3]; + + word_1 CARRY; + + unsigned char PSTAT[NR_PSTAT]; + unsigned char XM, SB, SR, MP; + + word_4 hexmode; + + word_20 rstk[NR_RSTK]; + short rstkp; + + keystate_t keybuf; + + unsigned char intenable; + unsigned char int_pending; + unsigned char kbd_ien; + + word_4 disp_io; + + word_4 contrast_ctrl; + word_8 disp_test; + + word_16 crc; + + word_4 power_status; + word_4 power_ctrl; + + word_4 mode; + + word_8 annunc; + + word_4 baud; + + word_4 card_ctrl; + word_4 card_status; + + word_4 io_ctrl; + word_4 rcs; + word_4 tcs; + + word_8 rbr; + word_8 tbr; + + word_8 sreq; + + word_4 ir_ctrl; + + word_4 base_off; + + word_4 lcr; + word_4 lbr; + + word_4 scratch; + + word_4 base_nibble; + + word_20 disp_addr; + word_12 line_offset; + word_8 line_count; + + word_16 unknown; + + word_4 t1_ctrl; + word_4 t2_ctrl; + + word_20 menu_addr; + + word_8 unknown2; + + char timer1; /* may NOT be unsigned !!! */ + word_32 timer2; + + long t1_instr; + long t2_instr; + + short t1_tick; + short t2_tick; + long i_per_s; + + short bank_switch; + mem_cntl_t mem_cntl[NR_MCTL]; + + unsigned char *rom; + unsigned char *ram; + unsigned char *port1; + unsigned char *port2; + +} saturn_t; + +#define NIBBLES_PER_ROW 0x22 + +extern int got_alarm; + +extern int set_t1; +extern long sched_timer1; +extern long sched_timer2; + +extern int adj_time_pending; +extern long sched_adjtime; +extern long schedule_event; + +extern display_t display; +extern void init_display __ProtoType__((void)); + +extern saturn_t saturn; + +extern int exit_emulator __ProtoType__((void)); +extern int init_emulator __ProtoType__((void)); +extern void init_active_stuff __ProtoType__((void)); + +extern int serial_init __ProtoType__((void)); +extern void serial_baud __ProtoType__((int baud)); +extern void transmit_char __ProtoType__((void)); +extern void receive_char __ProtoType__((void)); + +extern void do_kbd_int __ProtoType__((void)); +extern void do_interupt __ProtoType__((void)); + +extern void (*write_nibble) __ProtoType__((long addr, int val)); +extern int (*read_nibble) __ProtoType__((long addr)); +extern int (*read_nibble_crc) __ProtoType__((long addr)); + +extern int emulate __ProtoType__((void)); +extern int step_instruction __ProtoType__((void)); +extern void schedule __ProtoType__((void)); + +extern int read_rom __ProtoType__((const char *fname)); +extern int read_files __ProtoType__((void)); +extern int write_files __ProtoType__((void)); + +extern void load_addr __ProtoType__((word_20 *dat, long addr, + int n)); +#endif /* !_HP48_H */ diff --git a/jni/hp48_emu.h b/jni/hp48_emu.h new file mode 100644 index 0000000..52c7b42 --- /dev/null +++ b/jni/hp48_emu.h @@ -0,0 +1,202 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: hp48_emu.h,v $ + * Revision 1.10 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.9 1994/11/28 02:19:22 ecd + * removed progname declaration + * + * Revision 1.9 1994/11/28 02:19:22 ecd + * removed progname declaration + * + * Revision 1.8 1994/11/04 03:44:47 ecd + * wrxl + * + * Revision 1.7 1994/11/02 14:51:27 ecd + * minor changes + * + * Revision 1.6 1994/10/05 08:33:22 ecd + * deleted do_interupt definition + * + * Revision 1.5 1994/10/01 10:12:24 ecd + * deleted get_start and get_end functions + * + * Revision 1.4 1994/09/30 12:32:49 ecd + * changed display* routines + * + * Revision 1.3 1994/09/13 16:58:42 ecd + * changed to plain X11 + * + * Revision 1.2 1994/08/31 18:25:23 ecd + * some cleanup + * + * Revision 1.1 1994/08/26 11:09:18 ecd + * Initial revision + * + * + * + * $Id: hp48_emu.h,v 1.10 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _HP48_EMU_H +#define _HP48_EMU_H 1 + +#include "global.h" +#include "x48.h" +#include "hp48.h" + + +extern Display *dpy; +extern Window dispW; +extern GC gc; + +extern void push_return_addr __ProtoType__((long addr)); +extern long pop_return_addr __ProtoType__((void)); + +extern void init_annunc __ProtoType__((void)); + +extern void init_saturn __ProtoType__((void)); + +extern void check_timer __ProtoType__((void)); + +extern void register_to_status __ProtoType__((unsigned char *r)); +extern void status_to_register __ProtoType__((unsigned char *r)); +extern void swap_register_status __ProtoType__((unsigned char *r)); +extern void clear_status __ProtoType__((void)); + +extern long read_nibbles __ProtoType__((long addr, int len)); +extern void write_nibbles __ProtoType__((long addr, long val, int len)); +extern void dev_memory_init __ProtoType__((void)); + +extern void set_program_stat __ProtoType__((int n)); +extern void clear_program_stat __ProtoType__((int n)); +extern int get_program_stat __ProtoType__((int n)); + +extern void set_hardware_stat __ProtoType__((int op)); +extern void clear_hardware_stat __ProtoType__((int op)); +extern int is_zero_hardware_stat __ProtoType__((int op)); + +extern void set_register_bit __ProtoType__((unsigned char *reg, int n)); +extern void clear_register_bit __ProtoType__((unsigned char *reg, int n)); +extern int get_register_bit __ProtoType__((unsigned char *reg, int n)); + +extern void set_register_nibble __ProtoType__((unsigned char *reg, int n, + unsigned char val)); +extern unsigned char get_register_nibble __ProtoType__((unsigned char *reg, int n)); + + +extern void register_to_address __ProtoType__((unsigned char *reg, + word_20 *dat, int s)); +extern void address_to_register __ProtoType__((word_20 dat, + unsigned char *reg, int s)); +extern void add_address __ProtoType__((word_20 *dat, int add)); + +extern char * make_hexstr __ProtoType__((long addr, int n)); +extern void load_constant __ProtoType__((unsigned char *reg, int n, + long addr)); +extern void load_address __ProtoType__((unsigned char *reg, long addr, + int n)); + +extern void store __ProtoType__((word_20 dat, unsigned char *reg, + int code)); +extern void store_n __ProtoType__((word_20 dat, unsigned char *reg, + int n)); +extern void recall __ProtoType__((unsigned char *reg, word_20 dat, + int code)); +extern void recall_n __ProtoType__((unsigned char *reg, word_20 dat, + int n)); + +extern long dat_to_addr __ProtoType__((unsigned char *dat)); +extern void addr_to_dat __ProtoType__((long addr, unsigned char *dat)); + +extern void do_in __ProtoType__((void)); +extern void do_reset __ProtoType__((void)); +extern void do_configure __ProtoType__((void)); +extern void do_unconfigure __ProtoType__((void)); +extern void do_inton __ProtoType__((void)); +extern void do_intoff __ProtoType__((void)); +extern void do_return_interupt __ProtoType__((void)); +extern void do_reset_interrupt_system __ProtoType__((void)); +extern void do_shutdown __ProtoType__((void)); +extern int get_identification __ProtoType__((void)); + +extern void add_p_plus_one __ProtoType__((unsigned char *r)); +extern void add_register_constant __ProtoType__((unsigned char *res, + int code, int val)); +extern void sub_register_constant __ProtoType__((unsigned char *res, + int code, int val)); +extern void add_register __ProtoType__((unsigned char *res, unsigned char *r1, + unsigned char *r2, int code)); +extern void sub_register __ProtoType__((unsigned char *res, unsigned char *r1, + unsigned char *r2, int code)); +extern void complement_2_register __ProtoType__((unsigned char *r, int code)); +extern void complement_1_register __ProtoType__((unsigned char *r, int code)); +extern void inc_register __ProtoType__((unsigned char *r, int code)); +extern void dec_register __ProtoType__((unsigned char *r, int code)); +extern void zero_register __ProtoType__((unsigned char *r, int code)); +extern void or_register __ProtoType__((unsigned char *res, unsigned char *r1, + unsigned char *r2, int code)); +extern void and_register __ProtoType__((unsigned char *res, unsigned char *r1, + unsigned char *r2, int code)); +extern void copy_register __ProtoType__((unsigned char *to, unsigned char *from, + int code)); +extern void exchange_register __ProtoType__((unsigned char *r1, unsigned char *r2, + int code)); + +extern void exchange_reg __ProtoType__((unsigned char *r, word_20 *d, int code)); + +extern void shift_left_register __ProtoType__((unsigned char *r, int code)); +extern void shift_left_circ_register __ProtoType__((unsigned char *r, int code)); +extern void shift_right_register __ProtoType__((unsigned char *r, int code)); +extern void shift_right_circ_register __ProtoType__((unsigned char *r, int code)); +extern void shift_right_bit_register __ProtoType__((unsigned char *r, int code)); +extern int is_zero_register __ProtoType__(( + unsigned char *r, + int code)); +extern int is_not_zero_register __ProtoType__(( + unsigned char *r, + int code)); +extern int is_equal_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); +extern int is_not_equal_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); +extern int is_less_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); +extern int is_less_or_equal_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); +extern int is_greater_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); +extern int is_greater_or_equal_register __ProtoType__(( + unsigned char *r1, + unsigned char *r2, + int code)); + +#endif /* !_HP48_EMU_H */ diff --git a/jni/hp48char.h b/jni/hp48char.h new file mode 100644 index 0000000..b3b5efb --- /dev/null +++ b/jni/hp48char.h @@ -0,0 +1,308 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: hp48char.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * added comment at top of file + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * added comment at top of file + * + * Revision 1.1 1994/12/07 10:16:15 ecd + * Initial revision + * + * + * $Id: hp48char.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ +#ifndef _HP48CHAR_H +#define _HP48CHAR_H 1 + +typedef struct trans_tbl_t { + unsigned char hp48_char; + char *trans; +} trans_tbl_t; + +#ifndef DEFINE_TRANS_TABLE +extern trans_tbl_t hp48_trans_tbl[256]; +#else +trans_tbl_t hp48_trans_tbl[256] = +{ + { 0, "\\0" }, + { 1, "\\001" }, + { 2, "\\002" }, + { 3, "\\003" }, + { 4, "\\004" }, + { 5, "\\005" }, + { 6, "\\006" }, + { 7, "\\007" }, + { 8, "\\b" }, + { 9, "\\t" }, + { 10, "\\n" }, + { 11, "\\011" }, + { 12, "\\f" }, + { 13, "\\r" }, + { 14, "\\014" }, + { 15, "\\015" }, + { 16, "\\016" }, + { 17, "\\017" }, + { 18, "\\018" }, + { 19, "\\019" }, + { 20, "\\020" }, + { 21, "\\021" }, + { 22, "\\022" }, + { 23, "\\023" }, + { 24, "\\024" }, + { 25, "\\025" }, + { 26, "\\026" }, + { 27, "\\027" }, + { 28, "\\028" }, + { 29, "\\029" }, + { 30, "\\030" }, + { 31, "\\031" }, + { ' ', 0 }, + { '!', 0 }, + { '"', 0 }, + { '#', 0 }, + { '$', 0 }, + { '%', 0 }, + { '&', 0 }, + { '\'', 0 }, + { '(', 0 }, + { ')', 0 }, + { '*', 0 }, + { '+', 0 }, + { ',', 0 }, + { '-', 0 }, + { '.', 0 }, + { '/', 0 }, + { '0', 0 }, + { '1', 0 }, + { '2', 0 }, + { '3', 0 }, + { '4', 0 }, + { '5', 0 }, + { '6', 0 }, + { '7', 0 }, + { '8', 0 }, + { '9', 0 }, + { ':', 0 }, + { ';', 0 }, + { '<', 0 }, + { '=', 0 }, + { '>', 0 }, + { '?', 0 }, + { '@', 0 }, + { 'A', 0 }, + { 'B', 0 }, + { 'C', 0 }, + { 'D', 0 }, + { 'E', 0 }, + { 'F', 0 }, + { 'G', 0 }, + { 'H', 0 }, + { 'I', 0 }, + { 'J', 0 }, + { 'K', 0 }, + { 'L', 0 }, + { 'M', 0 }, + { 'N', 0 }, + { 'O', 0 }, + { 'P', 0 }, + { 'Q', 0 }, + { 'R', 0 }, + { 'S', 0 }, + { 'T', 0 }, + { 'U', 0 }, + { 'V', 0 }, + { 'W', 0 }, + { 'X', 0 }, + { 'Y', 0 }, + { 'Z', 0 }, + { '[', 0 }, + { '\\', 0 }, + { ']', 0 }, + { '^', 0 }, + { '_', 0 }, + { '`', 0 }, + { 'a', 0 }, + { 'b', 0 }, + { 'c', 0 }, + { 'd', 0 }, + { 'e', 0 }, + { 'f', 0 }, + { 'g', 0 }, + { 'h', 0 }, + { 'i', 0 }, + { 'j', 0 }, + { 'k', 0 }, + { 'l', 0 }, + { 'm', 0 }, + { 'n', 0 }, + { 'o', 0 }, + { 'p', 0 }, + { 'q', 0 }, + { 'r', 0 }, + { 's', 0 }, + { 't', 0 }, + { 'u', 0 }, + { 'v', 0 }, + { 'w', 0 }, + { 'x', 0 }, + { 'y', 0 }, + { 'z', 0 }, + { '{', 0 }, + { '|', 0 }, + { '}', 0 }, + { '~', 0 }, + { 127, "\\127" }, + { 128, "\\<)" }, + { 129, "\\x-" }, + { 130, "\\.V" }, + { 131, "\\v/" }, + { 132, "\\.S" }, + { 133, "\\GS" }, + { 134, "\\|>" }, + { 135, "\\pi" }, + { 136, "\\.d" }, + { 137, "\\<=" }, + { 138, "\\>=" }, + { 139, "\\=/" }, + { 140, "\\Ga" }, + { 141, "\\->" }, + { 142, "\\<-" }, + { 143, "\\|v" }, + { 144, "\\|^" }, + { 145, "\\Gg" }, + { 146, "\\Gd" }, + { 147, "\\Ge" }, + { 148, "\\Gn" }, + { 149, "\\Gh" }, + { 150, "\\Gl" }, + { 151, "\\Gr" }, + { 152, "\\Gs" }, + { 153, "\\Gt" }, + { 154, "\\Gw" }, + { 155, "\\GD" }, + { 156, "\\PI" }, + { 157, "\\GW" }, + { 158, "\\[]" }, + { 159, "\\oo" }, + { 160, "\\160" }, + { 161, "\\161" }, + { 162, "\\162" }, + { 163, "\\163" }, + { 164, "\\164" }, + { 165, "\\165" }, + { 166, "\\166" }, + { 167, "\\167" }, + { 168, "\\168" }, + { 169, "\\169" }, + { 170, "\\170" }, + { 171, "\\<<" }, + { 172, "\\172" }, + { 173, "\\173" }, + { 174, "\\174" }, + { 175, "\\175" }, + { 176, "\\^o" }, + { 177, "\\177" }, + { 178, "\\178" }, + { 179, "\\179" }, + { 180, "\\180" }, + { 181, "\\Gm" }, + { 182, "\\182" }, + { 183, "\\183" }, + { 184, "\\184" }, + { 185, "\\185" }, + { 186, "\\186" }, + { 187, "\\>>" }, + { 188, "\\188" }, + { 189, "\\189" }, + { 190, "\\190" }, + { 191, "\\191" }, + { 192, "\\192" }, + { 193, "\\193" }, + { 194, "\\194" }, + { 195, "\\195" }, + { 196, "\\196" }, + { 197, "\\197" }, + { 198, "\\198" }, + { 199, "\\199" }, + { 200, "\\200" }, + { 201, "\\201" }, + { 202, "\\202" }, + { 203, "\\203" }, + { 204, "\\204" }, + { 205, "\\205" }, + { 206, "\\206" }, + { 207, "\\207" }, + { 208, "\\208" }, + { 209, "\\209" }, + { 210, "\\210" }, + { 211, "\\211" }, + { 212, "\\212" }, + { 213, "\\213" }, + { 214, "\\214" }, + { 215, "\\.x" }, + { 216, "\\O/" }, + { 217, "\\217" }, + { 218, "\\218" }, + { 219, "\\219" }, + { 220, "\\220" }, + { 221, "\\221" }, + { 222, "\\222" }, + { 223, "\\223" }, + { 224, "\\224" }, + { 225, "\\225" }, + { 226, "\\226" }, + { 227, "\\227" }, + { 228, "\\228" }, + { 229, "\\229" }, + { 230, "\\230" }, + { 231, "\\231" }, + { 232, "\\232" }, + { 233, "\\233" }, + { 234, "\\234" }, + { 235, "\\235" }, + { 236, "\\236" }, + { 237, "\\237" }, + { 238, "\\238" }, + { 239, "\\239" }, + { 240, "\\240" }, + { 241, "\\241" }, + { 242, "\\242" }, + { 243, "\\243" }, + { 244, "\\244" }, + { 245, "\\245" }, + { 246, "\\246" }, + { 247, "\\:-" }, + { 248, "\\248" }, + { 249, "\\249" }, + { 250, "\\250" }, + { 251, "\\251" }, + { 252, "\\252" }, + { 253, "\\253" }, + { 254, "\\254" }, + { 255, "\\255" } +}; +#endif /* DEFINE_TRANS_TABLE */ + +#endif /* !_HP48CHAR_H */ diff --git a/jni/icon.h b/jni/icon.h new file mode 100644 index 0000000..426f869 --- /dev/null +++ b/jni/icon.h @@ -0,0 +1,74 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: icon.h,v $ + * Revision 1.5 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.4 1994/11/28 02:19:22 ecd + * added stuff for color icon + * + * Revision 1.4 1994/11/28 02:19:22 ecd + * added stuff for color icon + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor changes + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * changed char to unsigned + * + * Revision 1.1 1994/09/07 12:53:20 ecd + * Initial revision + * + * + * $Id: icon.h,v 1.5 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _ICON_H +#define _ICON_H 1 + +#include "bitmaps/hp48_icon.h" + +#include "bitmaps/hp48_top.h" + +#include "bitmaps/hp48_bottom.h" + +#include "bitmaps/hp48_logo.h" + +#include "bitmaps/hp48_text.h" + +#include "bitmaps/hp48_disp.h" + +#include "bitmaps/hp48_keys.h" + +#include "bitmaps/hp48_orange.h" + +#include "bitmaps/hp48_blue.h" + +#include "bitmaps/hp48_on.h" + +#include "bitmaps/hp48_top_gx.h" + +#include "bitmaps/hp48_logo_gx.h" + +#include "bitmaps/hp48_text_gx.h" + +#include "bitmaps/hp48_green_gx.h" + +#endif /* !_ICON_H */ diff --git a/jni/init.c b/jni/init.c new file mode 100644 index 0000000..012de6e --- /dev/null +++ b/jni/init.c @@ -0,0 +1,1842 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: init.c,v $ + * Revision 1.13 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.12 1994/12/07 20:20:50 ecd + * minor fixes + * + * Revision 1.12 1994/12/07 20:20:50 ecd + * minor fixes + * + * Revision 1.11 1994/11/28 02:00:51 ecd + * deleted serial_init() from init_emulator + * changed handling of version numbers + * + * Revision 1.10 1994/11/04 03:42:34 ecd + * changed includes, doesn't depend on FILE_VERSION anymore + * + * Revision 1.9 1994/11/02 14:44:28 ecd + * support for "compressed" files added. + * + * Revision 1.8 1994/10/09 20:32:02 ecd + * deleted extern char lcd_buffer reference. + * + * Revision 1.7 1994/10/06 16:30:05 ecd + * changed char to unsigned + * + * Revision 1.6 1994/10/05 08:36:44 ecd + * changed saturn_config_init() + * + * Revision 1.5 1994/09/30 12:37:09 ecd + * the file ~/.hp48/hp48 now contains a MAGIC and version info, so + * backward compatibility can be achived + * + * Revision 1.4 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.3 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.2 1994/08/31 18:23:21 ecd + * changed display initialization. + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * $Id: init.c,v 1.13 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SUNOS +#include +#endif + +#include "hp48.h" +#include "hp48_emu.h" +#include "device.h" +#include "resources.h" +#include "romio.h" + +#define X48_MAGIC 0x48503438 +#define NR_CONFIG 8 + +short rom_is_new = 1; +long ram_size; +long port1_size; +long port1_mask; +short port1_is_ram; +long port2_size; +long port2_mask; +short port2_is_ram; + +typedef struct old_keystate_t { + int rows[9]; +} old_keystate_t; + +typedef struct old_saturn_t { + unsigned char A[16], B[16], C[16], D[16]; + long d[2]; + int P; + long PC; + unsigned char R0[16], R1[16], R2[16], R3[16], R4[16]; + unsigned char IN[4]; + unsigned char OUT[3]; + int CARRY; + unsigned char PSTAT[NR_PSTAT]; + unsigned char XM, SB, SR, MP; + unsigned char hexmode; + long rstk[NR_RSTK]; + short rstkp; + old_keystate_t keybuf; + unsigned char intenable; + unsigned char int_pending; + unsigned char kbd_ien; + long configs[NR_CONFIG]; + short daisy_state; + long ram32k; + long devices; + unsigned char disp_io; + unsigned char contrast_ctrl; + unsigned char disp_test; + unsigned int crc; + unsigned char power_status; + unsigned char power_ctrl; + unsigned char mode; + unsigned char annunc; + unsigned char baud; + unsigned char card_ctrl; + unsigned char card_status; + unsigned char io_ctrl; + unsigned char rcs; + unsigned char tcs; + unsigned char rbr; + unsigned char tbr; + unsigned char sreq; + unsigned char ir_ctrl; + unsigned char base_off; + unsigned char lcr; + unsigned char lbr; + unsigned char scratch; + unsigned char base_nibble; + long disp_addr; + long line_offset; + long line_count; + long unknown; + unsigned char t1_ctrl; + unsigned char t2_ctrl; + long menu_addr; + long unknown2; + int timer1; + long timer2; + long t1_instr; + long t2_instr; + unsigned char *rom; + unsigned char *ram; + unsigned char *port1; + unsigned char *port2; +} old_saturn_t; + +old_saturn_t old_saturn; + +typedef struct saturn_0_3_0_t { + unsigned long magic; + char version[4]; + unsigned char A[16], B[16], C[16], D[16]; + word_20 d[2]; + word_4 P; + word_20 PC; + unsigned char R0[16], R1[16], R2[16], R3[16], R4[16]; + unsigned char IN[4]; + unsigned char OUT[3]; + word_1 CARRY; + unsigned char PSTAT[NR_PSTAT]; + unsigned char XM, SB, SR, MP; + word_4 hexmode; + word_20 rstk[NR_RSTK]; + short rstkp; + keystate_t keybuf; + unsigned char intenable; + unsigned char int_pending; + unsigned char kbd_ien; + word_20 configs[NR_CONFIG]; + word_16 daisy_state; + word_20 ram32k; + word_20 devices; + word_4 disp_io; + word_4 contrast_ctrl; + word_8 disp_test; + word_16 crc; + word_4 power_status; + word_4 power_ctrl; + word_4 mode; + word_8 annunc; + word_4 baud; + word_4 card_ctrl; + word_4 card_status; + word_4 io_ctrl; + word_4 rcs; + word_4 tcs; + word_8 rbr; + word_8 tbr; + word_8 sreq; + word_4 ir_ctrl; + word_4 base_off; + word_4 lcr; + word_4 lbr; + word_4 scratch; + word_4 base_nibble; + word_20 disp_addr; + word_12 line_offset; + word_8 line_count; + word_16 unknown; + word_4 t1_ctrl; + word_4 t2_ctrl; + word_20 menu_addr; + word_8 unknown2; + char timer1; + word_32 timer2; + long t1_instr; + long t2_instr; + short t1_tick; + short t2_tick; + long i_per_s; + unsigned char *rom; + unsigned char *ram; + unsigned char *port1; + unsigned char *port2; +} saturn_0_3_0_t; + +saturn_0_3_0_t saturn_0_3_0; + +#include "config.h" + +void +#ifdef __FunctionProto__ +saturn_config_init(void) +#else +saturn_config_init() +#endif +{ + saturn.version[0] = VERSION_MAJOR; + saturn.version[1] = VERSION_MINOR; + saturn.version[2] = PATCHLEVEL; + saturn.version[3] = COMPILE_VERSION; + memset(&device, 0, sizeof(device)); + device.display_touched = 1; + device.contrast_touched = 1; + device.baud_touched = 1; + device.ann_touched = 1; + saturn.rcs = 0x0; + saturn.tcs = 0x0; + saturn.lbr = 0x0; +} + +void +#ifdef __FunctionProto__ +init_saturn(void) +#else +init_saturn() +#endif +{ + int i; + + memset(&saturn, 0, sizeof(saturn) - 4 * sizeof(unsigned char *)); + saturn.PC = 0x00000; + saturn.magic = X48_MAGIC; + saturn.t1_tick = 8192; + saturn.t2_tick = 16; + saturn.i_per_s = 0; + saturn.version[0] = VERSION_MAJOR; + saturn.version[1] = VERSION_MINOR; + saturn.version[2] = PATCHLEVEL; + saturn.version[3] = COMPILE_VERSION; + saturn.hexmode = HEX; + saturn.rstkp = -1; + saturn.intenable = 1; + saturn.int_pending = 0; + saturn.kbd_ien = 1; + saturn.timer1 = 0; + saturn.timer2 = 0x2000; + saturn.bank_switch = 0; + for (i = 0; i < NR_MCTL; i++) + { + if (i == 0) + saturn.mem_cntl[i].unconfigured = 1; + else if (i == 5) + saturn.mem_cntl[i].unconfigured = 0; + else + saturn.mem_cntl[i].unconfigured = 2; + saturn.mem_cntl[i].config[0] = 0; + saturn.mem_cntl[i].config[1] = 0; + } + dev_memory_init(); +} + +void +#ifdef __FunctionProto__ +copy_old_saturn(old_saturn_t *old, saturn_t *new) +#else +copy_old_saturn(old, new) +old_saturn_t *old; +saturn_t *new; +#endif +{ + int i; + + memcpy(&(new->A[0]), &(old->A[0]), 16); + memcpy(&(new->B[0]), &(old->B[0]), 16); + memcpy(&(new->C[0]), &(old->C[0]), 16); + memcpy(&(new->D[0]), &(old->D[0]), 16); + new->d[0] = old->d[0]; + new->d[1] = old->d[1]; + new->P = old->P; + new->PC = old->PC; + memcpy(&(new->R0[0]), &(old->R0[0]), 16); + memcpy(&(new->R1[0]), &(old->R1[0]), 16); + memcpy(&(new->R2[0]), &(old->R2[0]), 16); + memcpy(&(new->R3[0]), &(old->R3[0]), 16); + memcpy(&(new->R4[0]), &(old->R4[0]), 16); + memcpy(&(new->IN[0]), &(old->IN[0]), 4); + memcpy(&(new->OUT[0]), &(old->OUT[0]), 3); + new->CARRY = old->CARRY; + memcpy(&(new->PSTAT[0]), &(old->PSTAT[0]), NR_PSTAT); + new->XM = old->XM; + new->SB = old->SB; + new->SR = old->SR; + new->MP = old->MP; + new->hexmode = old->hexmode; + memcpy(&(new->rstk[0]), &(old->rstk[0]), NR_RSTK * sizeof(word_20)); + new->rstkp = old->rstkp; + for (i = 0; i < 9; i++) { + new->keybuf.rows[i] = old->keybuf.rows[i]; + } + new->intenable = old->intenable; + new->int_pending = old->int_pending; + new->kbd_ien = old->kbd_ien; + new->disp_io = old->disp_io; + new->contrast_ctrl = old->contrast_ctrl; + new->disp_test = old->disp_test; + new->crc = old->crc; + new->power_status = old->power_status; + new->power_ctrl = old->power_ctrl; + new->mode = old->mode; + new->annunc = old->annunc; + new->baud = old->baud; + new->card_ctrl = old->card_ctrl; + new->card_status = old->card_status; + new->io_ctrl = old->io_ctrl; + new->rcs = old->rcs; + new->tcs = old->tcs; + new->rbr = old->rbr; + new->tbr = old->tbr; + new->sreq = old->sreq; + new->ir_ctrl = old->ir_ctrl; + new->base_off = old->base_off; + new->lcr = old->lcr; + new->lbr = old->lbr; + new->scratch = old->scratch; + new->base_nibble = old->base_nibble; + new->disp_addr = old->disp_addr; + new->line_offset = old->line_offset; + new->line_count = old->line_count; + new->unknown = old->unknown; + new->t1_ctrl = old->t1_ctrl; + new->t2_ctrl = old->t2_ctrl; + new->menu_addr = old->menu_addr; + new->unknown2 = old->unknown2; + new->timer1 = old->timer1; + new->timer2 = old->timer2; + new->t1_instr = old->t1_instr; + new->t2_instr = old->t2_instr; + new->bank_switch = 0; + if (opt_gx) + { + new->mem_cntl[0].unconfigured = 0; + new->mem_cntl[0].config[0] = 0x00100; + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x80000; + new->mem_cntl[1].config[1] = 0xc0000; + new->mem_cntl[2].unconfigured = 0; + new->mem_cntl[2].config[0] = 0x7f000; + new->mem_cntl[2].config[1] = 0xff000; + new->mem_cntl[3].unconfigured = 0; + new->mem_cntl[3].config[0] = 0xc0000; + new->mem_cntl[3].config[1] = 0xc0000; + new->mem_cntl[4].unconfigured = 0; + new->mem_cntl[4].config[0] = 0xc0000; + new->mem_cntl[4].config[1] = 0xc0000; + new->mem_cntl[5].unconfigured = 0; + new->mem_cntl[5].config[0] = 0x00000; + new->mem_cntl[5].config[1] = 0x00000; + } + else + { + if (old->devices == 0x100) + { + new->mem_cntl[0].unconfigured = 0; + new->mem_cntl[0].config[0] = old->devices; + } + else + { + new->mem_cntl[0].unconfigured = 1; + new->mem_cntl[0].config[0] = 0x00000; + } + if (old->ram32k == 0x70000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xf0000; + } + else if (old->ram32k == 0xf0000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0xf0000; + new->mem_cntl[1].config[1] = 0xf0000; + } + else if (old->ram32k == 0xfc000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xfc000; + } + else if (old->ram32k == 0xfe000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xfe000; + } + else + { + new->mem_cntl[1].unconfigured = 2; + new->mem_cntl[1].config[0] = 0x00000; + new->mem_cntl[1].config[1] = 0x00000; + } + new->mem_cntl[2].unconfigured = 0; + new->mem_cntl[2].config[0] = 0x80000; + new->mem_cntl[2].config[1] = 0xc0000; + new->mem_cntl[3].unconfigured = 0; + new->mem_cntl[3].config[0] = 0xc0000; + new->mem_cntl[3].config[1] = 0xc0000; + new->mem_cntl[4].unconfigured = 0; + new->mem_cntl[4].config[0] = 0xd0000; + new->mem_cntl[4].config[1] = 0xff000; + new->mem_cntl[5].unconfigured = 0; + new->mem_cntl[5].config[0] = 0x00000; + new->mem_cntl[5].config[1] = 0x80000; + } +} + +void +#ifdef __FunctionProto__ +copy_0_3_0_saturn(saturn_0_3_0_t *old, saturn_t *new) +#else +copy_0_3_0_saturn(old, new) +saturn_0_3_0_t *old; +saturn_t *new; +#endif +{ + int i; + + memcpy(&(new->A[0]), &(old->A[0]), 16); + memcpy(&(new->B[0]), &(old->B[0]), 16); + memcpy(&(new->C[0]), &(old->C[0]), 16); + memcpy(&(new->D[0]), &(old->D[0]), 16); + new->d[0] = old->d[0]; + new->d[1] = old->d[1]; + new->P = old->P; + new->PC = old->PC; + memcpy(&(new->R0[0]), &(old->R0[0]), 16); + memcpy(&(new->R1[0]), &(old->R1[0]), 16); + memcpy(&(new->R2[0]), &(old->R2[0]), 16); + memcpy(&(new->R3[0]), &(old->R3[0]), 16); + memcpy(&(new->R4[0]), &(old->R4[0]), 16); + memcpy(&(new->IN[0]), &(old->IN[0]), 4); + memcpy(&(new->OUT[0]), &(old->OUT[0]), 3); + new->CARRY = old->CARRY; + memcpy(&(new->PSTAT[0]), &(old->PSTAT[0]), NR_PSTAT); + new->XM = old->XM; + new->SB = old->SB; + new->SR = old->SR; + new->MP = old->MP; + new->hexmode = old->hexmode; + memcpy(&(new->rstk[0]), &(old->rstk[0]), NR_RSTK * sizeof(word_20)); + new->rstkp = old->rstkp; + for (i = 0; i < 9; i++) { + new->keybuf.rows[i] = old->keybuf.rows[i]; + } + new->intenable = old->intenable; + new->int_pending = old->int_pending; + new->kbd_ien = old->kbd_ien; + new->disp_io = old->disp_io; + new->contrast_ctrl = old->contrast_ctrl; + new->disp_test = old->disp_test; + new->crc = old->crc; + new->power_status = old->power_status; + new->power_ctrl = old->power_ctrl; + new->mode = old->mode; + new->annunc = old->annunc; + new->baud = old->baud; + new->card_ctrl = old->card_ctrl; + new->card_status = old->card_status; + new->io_ctrl = old->io_ctrl; + new->rcs = old->rcs; + new->tcs = old->tcs; + new->rbr = old->rbr; + new->tbr = old->tbr; + new->sreq = old->sreq; + new->ir_ctrl = old->ir_ctrl; + new->base_off = old->base_off; + new->lcr = old->lcr; + new->lbr = old->lbr; + new->scratch = old->scratch; + new->base_nibble = old->base_nibble; + new->disp_addr = old->disp_addr; + new->line_offset = old->line_offset; + new->line_count = old->line_count; + new->unknown = old->unknown; + new->t1_ctrl = old->t1_ctrl; + new->t2_ctrl = old->t2_ctrl; + new->menu_addr = old->menu_addr; + new->unknown2 = old->unknown2; + new->timer1 = old->timer1; + new->timer2 = old->timer2; + new->t1_instr = old->t1_instr; + new->t2_instr = old->t2_instr; + new->t1_tick = old->t1_tick; + new->t2_tick = old->t2_tick; + new->i_per_s = old->i_per_s; + new->bank_switch = 0; + if (opt_gx) + { + new->mem_cntl[0].unconfigured = 0; + new->mem_cntl[0].config[0] = 0x00100; + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x80000; + new->mem_cntl[1].config[1] = 0xc0000; + new->mem_cntl[2].unconfigured = 0; + new->mem_cntl[2].config[0] = 0x7f000; + new->mem_cntl[2].config[1] = 0xff000; + new->mem_cntl[3].unconfigured = 0; + new->mem_cntl[3].config[0] = 0xc0000; + new->mem_cntl[3].config[1] = 0xc0000; + new->mem_cntl[4].unconfigured = 0; + new->mem_cntl[4].config[0] = 0xc0000; + new->mem_cntl[4].config[1] = 0xc0000; + new->mem_cntl[5].unconfigured = 0; + new->mem_cntl[5].config[0] = 0x00000; + new->mem_cntl[5].config[1] = 0x00000; + } + else + { + if (old->devices == 0x100) + { + new->mem_cntl[0].unconfigured = 0; + new->mem_cntl[0].config[0] = old->devices; + } + else + { + new->mem_cntl[0].unconfigured = 1; + new->mem_cntl[0].config[0] = 0x00000; + } + if (old->ram32k == 0x70000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xf0000; + } + else if (old->ram32k == 0xf0000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0xf0000; + new->mem_cntl[1].config[1] = 0xf0000; + } + else if (old->ram32k == 0xfc000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xfc000; + } + else if (old->ram32k == 0xfe000) + { + new->mem_cntl[1].unconfigured = 0; + new->mem_cntl[1].config[0] = 0x70000; + new->mem_cntl[1].config[1] = 0xfe000; + } + else + { + new->mem_cntl[1].unconfigured = 2; + new->mem_cntl[1].config[0] = 0x00000; + new->mem_cntl[1].config[1] = 0x00000; + } + new->mem_cntl[2].unconfigured = 0; + new->mem_cntl[2].config[0] = 0x80000; + new->mem_cntl[2].config[1] = 0xc0000; + new->mem_cntl[3].unconfigured = 0; + new->mem_cntl[3].config[0] = 0xc0000; + new->mem_cntl[3].config[1] = 0xc0000; + new->mem_cntl[4].unconfigured = 0; + new->mem_cntl[4].config[0] = 0xd0000; + new->mem_cntl[4].config[1] = 0xff000; + new->mem_cntl[5].unconfigured = 0; + new->mem_cntl[5].config[0] = 0x00000; + new->mem_cntl[5].config[1] = 0x80000; + } +} + +int +#ifdef __FunctionProto__ +read_8(FILE *fp, word_8 *var) +#else +read_8(fp, var) +FILE *fp; +word_8 *var; +#endif +{ + unsigned char tmp; + + if (fread(&tmp, 1, 1, fp) != 1) { + if (!quiet) + LOGE( "%s: can\'t read word_8\n", progname); + return 0; + } + *var = tmp; + return 1; +} + +int +#ifdef __FunctionProto__ +read_char(FILE *fp, char *var) +#else +read_char(fp, var) +FILE *fp; +char *var; +#endif +{ + char tmp; + + if (fread(&tmp, 1, 1, fp) != 1) { + if (!quiet) + LOGE( "%s: can\'t read char\n", progname); + return 0; + } + *var = tmp; + return 1; +} + +int +#ifdef __FunctionProto__ +read_16(FILE *fp, word_16 *var) +#else +read_16(fp, var) +FILE *fp; +word_16 *var; +#endif +{ + unsigned char tmp[2]; + + if (fread(&tmp[0], 1, 2, fp) != 2) { + if (!quiet) + LOGE( "%s: can\'t read word_16\n", progname); + return 0; + } + *var = tmp[0] << 8; + *var |= tmp[1]; + return 1; +} + +int +#ifdef __FunctionProto__ +read_32(FILE *fp, word_32 *var) +#else +read_32(fp, var) +FILE *fp; +word_32 *var; +#endif +{ + unsigned char tmp[4]; + + if (fread(&tmp[0], 1, 4, fp) != 4) { + if (!quiet) + LOGE( "%s: can\'t read word_32\n", progname); + return 0; + } + *var = tmp[0] << 24; + *var |= tmp[1] << 16; + *var |= tmp[2] << 8; + *var |= tmp[3]; + return 1; +} + +int +#ifdef __FunctionProto__ +read_u_long(FILE *fp, unsigned long *var) +#else +read_u_long(fp, var) +FILE *fp; +unsigned long*var; +#endif +{ + unsigned char tmp[4]; + + if (fread(&tmp[0], 1, 4, fp) != 4) { + if (!quiet) + LOGE( "%s: can\'t read unsigned long\n", progname); + return 0; + } + *var = tmp[0] << 24; + *var |= tmp[1] << 16; + *var |= tmp[2] << 8; + *var |= tmp[3]; + return 1; +} + +int +#ifdef __FunctionProto__ +read_version_0_3_0_file(FILE *fp) +#else +read_version_0_3_0_file(fp) +FILE *fp; +#endif +{ + int i; + + /* + * version 0.3.x, read in the saturn_0_3_0_t struct + */ + for (i = 0; i < 16; i++) + if(!read_8(fp, &saturn_0_3_0.A[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.B[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.C[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.D[i])) + return 0; + if (!read_32(fp, &saturn_0_3_0.d[0])) return 0; + if (!read_32(fp, &saturn_0_3_0.d[1])) return 0; + if (!read_8(fp, &saturn_0_3_0.P)) return 0; + if (!read_32(fp, &saturn_0_3_0.PC)) return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.R0[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.R1[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.R2[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.R3[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn_0_3_0.R4[i])) + return 0; + for (i = 0; i < 4; i++) + if (!read_8(fp, &saturn_0_3_0.IN[i])) + return 0; + for (i = 0; i < 3; i++) + if (!read_8(fp, &saturn_0_3_0.OUT[i])) + return 0; + if (!read_8(fp, &saturn_0_3_0.CARRY)) + return 0; + for (i = 0; i < NR_PSTAT; i++) + if (!read_8(fp, &saturn_0_3_0.PSTAT[i])) + return 0; + if (!read_8(fp, &saturn_0_3_0.XM)) return 0; + if (!read_8(fp, &saturn_0_3_0.SB)) return 0; + if (!read_8(fp, &saturn_0_3_0.SR)) return 0; + if (!read_8(fp, &saturn_0_3_0.MP)) return 0; + if (!read_8(fp, &saturn_0_3_0.hexmode)) return 0; + for (i = 0; i < NR_RSTK; i++) + if (!read_32(fp, &saturn_0_3_0.rstk[i])) + return 0; + if (!read_16(fp, (word_16 *)&saturn_0_3_0.rstkp)) return 0; + for (i = 0; i < 9; i++) + if (!read_16(fp, (word_16 *)&saturn_0_3_0.keybuf.rows[i])) + return 0; + if (!read_8(fp, &saturn_0_3_0.intenable)) return 0; + if (!read_8(fp, &saturn_0_3_0.int_pending)) return 0; + if (!read_8(fp, &saturn_0_3_0.kbd_ien)) return 0; + for (i = 0; i < NR_CONFIG; i++) + if (!read_32(fp, &saturn_0_3_0.configs[i])) + return 0; + if (!read_16(fp, (word_16 *)&saturn_0_3_0.daisy_state)) return 0; + if (!read_32(fp, &saturn_0_3_0.ram32k)) return 0; + if (!read_32(fp, &saturn_0_3_0.devices)) return 0; + if (!read_8(fp, &saturn_0_3_0.disp_io)) return 0; + if (!read_8(fp, &saturn_0_3_0.contrast_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.disp_test)) return 0; + if (!read_16(fp, &saturn_0_3_0.crc)) return 0; + if (!read_8(fp, &saturn_0_3_0.power_status)) return 0; + if (!read_8(fp, &saturn_0_3_0.power_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.mode)) return 0; + if (!read_8(fp, &saturn_0_3_0.annunc)) return 0; + if (!read_8(fp, &saturn_0_3_0.baud)) return 0; + if (!read_8(fp, &saturn_0_3_0.card_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.card_status)) return 0; + if (!read_8(fp, &saturn_0_3_0.io_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.rcs)) return 0; + if (!read_8(fp, &saturn_0_3_0.tcs)) return 0; + if (!read_8(fp, &saturn_0_3_0.rbr)) return 0; + if (!read_8(fp, &saturn_0_3_0.tbr)) return 0; + if (!read_8(fp, &saturn_0_3_0.sreq)) return 0; + if (!read_8(fp, &saturn_0_3_0.ir_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.base_off)) return 0; + if (!read_8(fp, &saturn_0_3_0.lcr)) return 0; + if (!read_8(fp, &saturn_0_3_0.lbr)) return 0; + if (!read_8(fp, &saturn_0_3_0.scratch)) return 0; + if (!read_8(fp, &saturn_0_3_0.base_nibble)) return 0; + if (!read_32(fp, &saturn_0_3_0.disp_addr)) return 0; + if (!read_16(fp, &saturn_0_3_0.line_offset)) return 0; + if (!read_8(fp, &saturn_0_3_0.line_count)) return 0; + if (!read_16(fp, &saturn_0_3_0.unknown)) return 0; + if (!read_8(fp, &saturn_0_3_0.t1_ctrl)) return 0; + if (!read_8(fp, &saturn_0_3_0.t2_ctrl)) return 0; + if (!read_32(fp, &saturn_0_3_0.menu_addr)) return 0; + if (!read_8(fp, &saturn_0_3_0.unknown2)) return 0; + if (!read_char(fp, &saturn_0_3_0.timer1)) return 0; + if (!read_32(fp, &saturn_0_3_0.timer2)) return 0; + if (!read_32(fp, &saturn_0_3_0.t1_instr)) return 0; + if (!read_32(fp, &saturn_0_3_0.t2_instr)) return 0; + if (!read_16(fp, (word_16 *)&saturn_0_3_0.t1_tick)) return 0; + if (!read_16(fp, (word_16 *)&saturn_0_3_0.t2_tick)) return 0; + if (!read_32(fp, &saturn_0_3_0.i_per_s)) return 0; + return 1; +} + +int +#ifdef __FunctionProto__ +read_version_0_4_0_file(FILE *fp) +#else +read_version_0_4_0_file(fp) +FILE *fp; +#endif +{ + int i; + + /* + * version 0.4.x, read in the saturn_t struct + */ + for (i = 0; i < 16; i++) + if(!read_8(fp, &saturn.A[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.B[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.C[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.D[i])) + return 0; + if (!read_32(fp, &saturn.d[0])) return 0; + if (!read_32(fp, &saturn.d[1])) return 0; + if (!read_8(fp, &saturn.P)) return 0; + if (!read_32(fp, &saturn.PC)) return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.R0[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.R1[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.R2[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.R3[i])) + return 0; + for (i = 0; i < 16; i++) + if (!read_8(fp, &saturn.R4[i])) + return 0; + for (i = 0; i < 4; i++) + if (!read_8(fp, &saturn.IN[i])) + return 0; + for (i = 0; i < 3; i++) + if (!read_8(fp, &saturn.OUT[i])) + return 0; + if (!read_8(fp, &saturn.CARRY)) + return 0; + for (i = 0; i < NR_PSTAT; i++) + if (!read_8(fp, &saturn.PSTAT[i])) + return 0; + if (!read_8(fp, &saturn.XM)) return 0; + if (!read_8(fp, &saturn.SB)) return 0; + if (!read_8(fp, &saturn.SR)) return 0; + if (!read_8(fp, &saturn.MP)) return 0; + if (!read_8(fp, &saturn.hexmode)) return 0; + for (i = 0; i < NR_RSTK; i++) + if (!read_32(fp, &saturn.rstk[i])) + return 0; + if (!read_16(fp, (word_16 *)&saturn.rstkp)) return 0; + for (i = 0; i < 9; i++) + if (!read_16(fp, (word_16 *)&saturn.keybuf.rows[i])) + return 0; + if (!read_8(fp, &saturn.intenable)) return 0; + if (!read_8(fp, &saturn.int_pending)) return 0; + if (!read_8(fp, &saturn.kbd_ien)) return 0; + if (!read_8(fp, &saturn.disp_io)) return 0; + if (!read_8(fp, &saturn.contrast_ctrl)) return 0; + if (!read_8(fp, &saturn.disp_test)) return 0; + if (!read_16(fp, &saturn.crc)) return 0; + if (!read_8(fp, &saturn.power_status)) return 0; + if (!read_8(fp, &saturn.power_ctrl)) return 0; + if (!read_8(fp, &saturn.mode)) return 0; + if (!read_8(fp, &saturn.annunc)) return 0; + if (!read_8(fp, &saturn.baud)) return 0; + if (!read_8(fp, &saturn.card_ctrl)) return 0; + if (!read_8(fp, &saturn.card_status)) return 0; + if (!read_8(fp, &saturn.io_ctrl)) return 0; + if (!read_8(fp, &saturn.rcs)) return 0; + if (!read_8(fp, &saturn.tcs)) return 0; + if (!read_8(fp, &saturn.rbr)) return 0; + if (!read_8(fp, &saturn.tbr)) return 0; + if (!read_8(fp, &saturn.sreq)) return 0; + if (!read_8(fp, &saturn.ir_ctrl)) return 0; + if (!read_8(fp, &saturn.base_off)) return 0; + if (!read_8(fp, &saturn.lcr)) return 0; + if (!read_8(fp, &saturn.lbr)) return 0; + if (!read_8(fp, &saturn.scratch)) return 0; + if (!read_8(fp, &saturn.base_nibble)) return 0; + if (!read_32(fp, &saturn.disp_addr)) return 0; + if (!read_16(fp, &saturn.line_offset)) return 0; + if (!read_8(fp, &saturn.line_count)) return 0; + if (!read_16(fp, &saturn.unknown)) return 0; + if (!read_8(fp, &saturn.t1_ctrl)) return 0; + if (!read_8(fp, &saturn.t2_ctrl)) return 0; + if (!read_32(fp, &saturn.menu_addr)) return 0; + if (!read_8(fp, &saturn.unknown2)) return 0; + if (!read_char(fp, &saturn.timer1)) return 0; + if (!read_32(fp, &saturn.timer2)) return 0; + if (!read_32(fp, &saturn.t1_instr)) return 0; + if (!read_32(fp, &saturn.t2_instr)) return 0; + if (!read_16(fp, (word_16 *)&saturn.t1_tick)) return 0; + if (!read_16(fp, (word_16 *)&saturn.t2_tick)) return 0; + if (!read_32(fp, &saturn.i_per_s)) return 0; + if (!read_16(fp, (word_16 *)&saturn.bank_switch)) return 0; + for (i = 0; i < NR_MCTL; i++) + { + if (!read_16(fp, &saturn.mem_cntl[i].unconfigured)) return 0; + if (!read_32(fp, &saturn.mem_cntl[i].config[0])) return 0; + if (!read_32(fp, &saturn.mem_cntl[i].config[1])) return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +read_mem_file(char *name, word_4 *mem, int size) +#else +read_mem_file(name, mem, size) +char *name; +word_4 *mem; +int size; +#endif +{ + struct stat st; + FILE *fp; + word_8 *tmp_mem; + word_8 byte; + int i, j; + + if (NULL == (fp = fopen(name, "r"))) + { + if (!quiet) + LOGE( "%s: can\'t open %s\n", progname, name); + return 0; + } + + if (stat(name, &st) < 0) + { + if (!quiet) + LOGE( "%s: can\'t stat %s\n", progname, name); + return 0; + } + + if (st.st_size == size) + { + /* + * size is same as memory size, old version file + */ + if (fread(mem, 1, (size_t)size, fp) != size) + { + if (!quiet) + LOGE( "%s: can\'t read %s\n", progname, name); + fclose(fp); + return 0; + } + } + else + { + /* + * size is different, check size and decompress memory + */ + + if (st.st_size != size / 2) + { + if (!quiet) + LOGE( "%s: strange size %s, expected %d, found %ld\n", + progname, name, size / 2, st.st_size); + fclose(fp); + return 0; + } + + if (NULL == (tmp_mem = (word_8 *)malloc((size_t)st.st_size))) + { + for (i = 0, j = 0; i < size / 2; i++) + { + if (1 != fread(&byte, 1, 1, fp)) + { + if (!quiet) + LOGE( "%s: can\'t read %s\n", progname, name); + fclose(fp); + return 0; + } + mem[j++] = (word_4)((int)byte & 0xf); + mem[j++] = (word_4)(((int)byte >> 4) & 0xf); + } + } + else + { + if (fread(tmp_mem, 1, (size_t)size / 2, fp) != size / 2) + { + if (!quiet) + LOGE( "%s: can\'t read %s\n", progname, name); + fclose(fp); + free(tmp_mem); + return 0; + } + + for (i = 0, j = 0; i < size / 2; i++) + { + mem[j++] = (word_4)((int)tmp_mem[i] & 0xf); + mem[j++] = (word_4)(((int)tmp_mem[i] >> 4) & 0xf); + } + + free(tmp_mem); + } + } + + fclose(fp); + + if (verbose) + printf("%s: read %s\n", progname, name); + + return 1; +} + +int +#ifdef __FunctionProto__ +read_rom(const char *fname) +#else +read_rom(fname) +const char *fname; +#endif +{ + int ram_size; + + if (!read_rom_file(romFileName, &saturn.rom, &rom_size)) + return 0; + dev_memory_init(); + + if (opt_gx) + ram_size = RAM_SIZE_GX; + else + ram_size = RAM_SIZE_SX; + + if (NULL == (saturn.ram = (word_4 *)malloc(ram_size))) + { + if (!quiet) + LOGE( "%s: can\'t malloc RAM\n", progname); + return 0; + } + + memset(saturn.ram, 0, ram_size); + + port1_size = 0; + port1_mask = 0; + port1_is_ram = 0; + saturn.port1 = (unsigned char *)0; + + port2_size = 0; + port2_mask = 0; + port2_is_ram = 0; + saturn.port2 = (unsigned char *)0; + + saturn.card_status = 0; + + return 1; +} + +void +#ifdef __FunctionProto__ +get_home_directory(char *path) +#else +get_home_directory(path) +char *path; +#endif +{ + char *p; + struct passwd *pwd; + + if (homeDirectory[0] == '/') + { + strcpy(path, homeDirectory); + } + else + { + p = getenv("HOME"); + if (p) + { + strcpy(path, p); + strcat(path, "/"); + } + else + { + pwd = getpwuid(getuid()); + if (pwd) + { + strcpy(path, pwd->pw_dir); + strcat(path, "/"); + } + else + { + if (!quiet) + LOGE( + "%s: can\'t figure out your home directory, trying /tmp\n", + progname); + strcpy(path, "/tmp"); + } + } + strcat(path, homeDirectory); + } +} + +int +#ifdef __FunctionProto__ +read_files(void) +#else +read_files() +#endif +{ + char path[1024]; + char fnam[1024]; + unsigned long v1, v2; + int i, read_version; + int ram_size; + struct stat st; + FILE *fp; + + + FILE *sd; + if (NULL == (sd = fopen("/sdcard/.hp48/", "rw"))) { + strcpy(path, "/data/data/org.ab.x48/"); + + } + else + strcpy(path, "/sdcard/.hp48/"); + + //get_home_directory(path); + LOGI("path: %s", path); + + saturn.rom = (word_4 *)NULL; + + strcpy(fnam, path); + + strcat(fnam, "rom"); + + + if (!read_rom_file(fnam, &saturn.rom, &rom_size)) + return 0; + + rom_is_new = 0; + + strcpy(fnam, path); + strcat(fnam, "hp48"); + if (NULL == (fp = fopen(fnam, "r"))) + { + if (!quiet) + LOGE("%s: can\'t open %s\n", progname, fnam); + return 0; + } + + /* + * ok, file is open, try to read the MAGIC number + */ + read_u_long(fp, &saturn.magic); + + if (X48_MAGIC != saturn.magic) + { + /* + * no MAGIC number, try to read old format file + */ + fseek(fp, 0, SEEK_SET); + if (fread((char *)&old_saturn, 1, sizeof(old_saturn), fp) + == sizeof(old_saturn)) { + /* + * seems to work + */ + copy_old_saturn(&old_saturn, &saturn); + if (!quiet) + LOGE("%s: %s seems to be an old version file\n", + progname, fnam); + saturn.magic = X48_MAGIC; + saturn.t1_tick = 8192; + saturn.t2_tick = 16; + saturn.i_per_s = 0; + saturn.version[0] = VERSION_MAJOR; + saturn.version[1] = VERSION_MINOR; + saturn.version[2] = PATCHLEVEL; + saturn.version[3] = COMPILE_VERSION; + } else { + /* + * no, initialize + */ + if (!quiet) + LOGE( "%s: can\'t handle %s\n", progname, fnam); + init_saturn(); + } + } else { + /* + * MAGIC ok, read and compare the version + */ + read_version = 1; + for (i = 0; i < 4; i++) { + if (!read_char(fp, &saturn.version[i])) { + if (!quiet) + LOGE( "%s: can\'t read version\n", progname); + read_version = 0; + } + } + + if (read_version) { + v1 = ((int)saturn.version[0] & 0xff) << 24; + v1 |= ((int)saturn.version[1] & 0xff) << 16; + v1 |= ((int)saturn.version[2] & 0xff) << 8; + v1 |= ((int)saturn.version[3] & 0xff); + v2 = ((int)VERSION_MAJOR & 0xff) << 24; + v2 |= ((int)VERSION_MINOR & 0xff) << 16; + v2 |= ((int)PATCHLEVEL & 0xff) << 8; + v2 |= ((int)COMPILE_VERSION & 0xff); + + if ((v1 & 0xffffff00) < (v2 & 0xffffff00)) { + if (!quiet) + LOGE( "%s: %s is a version %d.%d.%d file, converting\n", + progname, fnam, + saturn.version[0], saturn.version[1], saturn.version[2]); + } else if ((v2 & 0xffffff00) < (v1 & 0xffffff00)) { + if (!quiet) + LOGE( "%s: %s is a version %d.%d.%d file, trying ...\n", + progname, fnam, + saturn.version[0], saturn.version[1], saturn.version[2]); + } + + if (v1 < 0x00040000) + { + /* + * read version < 0.4 file + */ + if (!read_version_0_3_0_file(fp)) + { + if (!quiet) + LOGE( "%s: can\'t handle %s\n", progname, fnam); + init_saturn(); + } + else + { + copy_0_3_0_saturn(&saturn_0_3_0, &saturn); + if (verbose) + LOGI("%s: read %s\n", progname, fnam); + } + } + else if (v1 <= v2) { + /* + * read latest version file + */ + if (!read_version_0_4_0_file(fp)) + { + if (!quiet) + LOGE( "%s: can\'t handle %s\n", progname, fnam); + init_saturn(); + } + else if (verbose) + { + LOGI("%s: read %s\n", progname, fnam); + } + } else { + /* + * try to read latest version file + */ + if (!read_version_0_4_0_file(fp)) + { + if (!quiet) + LOGE( "%s: can\'t handle %s\n", progname, fnam); + init_saturn(); + } + else if (verbose) + { + LOGI("%s: read %s\n", progname, fnam); + } + } + } + } + fclose(fp); + + dev_memory_init(); + + saturn_config_init(); + + if (opt_gx) + ram_size = RAM_SIZE_GX; + else + ram_size = RAM_SIZE_SX; + + saturn.ram = (word_4 *)NULL; + if (NULL == (saturn.ram = (word_4 *)malloc(ram_size))) + { + if (!quiet) + LOGE( "%s: can\'t malloc RAM[%d]\n", + progname, ram_size); + exit (1); + } + + strcpy(fnam, path); + strcat(fnam, "ram"); + if ((fp = fopen(fnam, "r")) == NULL) { + if (!quiet) + LOGE( "%s: can\'t open %s\n", progname, fnam); + return 0; + } + if (!read_mem_file(fnam, saturn.ram, ram_size)) + return 0; + + saturn.card_status = 0; + + port1_size = 0; + port1_mask = 0; + port1_is_ram = 0; + saturn.port1 = (unsigned char *)0; + + strcpy(fnam, path); + strcat(fnam, "port1"); + if (stat(fnam, &st) >= 0) + { + port1_size = 2 * st.st_size; + if ((port1_size == 0x10000) || (port1_size == 0x40000)) + { + if (NULL == (saturn.port1 = (word_4 *)malloc(port1_size))) + { + if (!quiet) + LOGE( "%s: can\'t malloc PORT1[%ld]\n", + progname, port1_size); + } + else if (!read_mem_file(fnam, saturn.port1, port1_size)) + { + port1_size = 0; + port1_is_ram = 0; + } + else + { + port1_is_ram = (st.st_mode & S_IWGRP) ? 1 : 0; + port1_mask = port1_size - 1; + } + } + } + + if (opt_gx) + { + saturn.card_status |= (port1_size > 0) ? 2 : 0; + saturn.card_status |= port1_is_ram ? 8 : 0; + } + else + { + saturn.card_status |= (port1_size > 0) ? 1 : 0; + saturn.card_status |= port1_is_ram ? 4 : 0; + } + + port2_size = 0; + port2_mask = 0; + port2_is_ram = 0; + saturn.port2 = (unsigned char *)0; + + strcpy(fnam, path); + strcat(fnam, "port2"); + if (stat(fnam, &st) >= 0) + { + port2_size = 2 * st.st_size; + if ((opt_gx && ((port2_size % 0x40000) == 0)) || + (!opt_gx && ((port2_size == 0x10000) || (port2_size == 0x40000)))) + { + if (NULL == (saturn.port2 = (word_4 *)malloc(port2_size))) + { + if (!quiet) + LOGE( "%s: can\'t malloc PORT2[%ld]\n", + progname, port2_size); + } + else if (!read_mem_file(fnam, saturn.port2, port2_size)) + { + port2_size = 0; + port2_is_ram = 0; + } + else + { + port2_is_ram = (st.st_mode & S_IWGRP) ? 1 : 0; + port2_mask = port2_size - 1; + + } + } + } + + if (opt_gx) + { + saturn.card_status |= (port2_size > 0) ? 1 : 0; + saturn.card_status |= port2_is_ram ? 4 : 0; + } + else + { + saturn.card_status |= (port2_size > 0) ? 2 : 0; + saturn.card_status |= port2_is_ram ? 8 : 0; + } + + return 1; +} + +int +#ifdef __FunctionProto__ +write_8(FILE *fp, word_8 *var) +#else +write_8(fp, var) +FILE *fp; +word_8 *var; +#endif +{ + unsigned char tmp; + + tmp = *var; + if (fwrite(&tmp, 1, 1, fp) != 1) { + if (!quiet) + LOGE( "%s: can\'t write word_8\n", progname); + return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +write_char(FILE *fp, char *var) +#else +write_char(fp, var) +FILE *fp; +char *var; +#endif +{ + char tmp; + + tmp = *var; + if (fwrite(&tmp, 1, 1, fp) != 1) { + if (!quiet) + LOGE( "%s: can\'t write char\n", progname); + return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +write_16(FILE *fp, word_16 *var) +#else +write_16(fp, var) +FILE *fp; +word_16 *var; +#endif +{ + unsigned char tmp[2]; + + tmp[0] = (*var >> 8) & 0xff; + tmp[1] = *var & 0xff; + if (fwrite(&tmp[0], 1, 2, fp) != 2) { + if (!quiet) + LOGE( "%s: can\'t write word_16\n", progname); + return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +write_32(FILE *fp, word_32 *var) +#else +write_32(fp, var) +FILE *fp; +word_32 *var; +#endif +{ + unsigned char tmp[4]; + + tmp[0] = (*var >> 24) & 0xff; + tmp[1] = (*var >> 16) & 0xff; + tmp[2] = (*var >> 8) & 0xff; + tmp[3] = *var & 0xff; + if (fwrite(&tmp[0], 1, 4, fp) != 4) { + if (!quiet) + LOGE( "%s: can\'t write word_32\n", progname); + return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +write_u_long(FILE *fp, unsigned long *var) +#else +write_u_long(fp, var) +FILE *fp; +unsigned long*var; +#endif +{ + unsigned char tmp[4]; + + tmp[0] = (*var >> 24) & 0xff; + tmp[1] = (*var >> 16) & 0xff; + tmp[2] = (*var >> 8) & 0xff; + tmp[3] = *var & 0xff; + if (fwrite(&tmp[0], 1, 4, fp) != 4) { + if (!quiet) + LOGE( "%s: can\'t write unsigned long\n", progname); + return 0; + } + return 1; +} + +int +#ifdef __FunctionProto__ +write_mem_file(char *name, word_4 *mem, int size) +#else +write_mem_file(name, mem, size) +char *name; +word_4 *mem; +int size; +#endif +{ + FILE *fp; + word_8 *tmp_mem; + word_8 byte; + int i, j; + + if (NULL == (fp = fopen(name, "w"))) + { + if (!quiet) + LOGE( "%s: can\'t open %s\n", progname, name); + return 0; + } + + if (NULL == (tmp_mem = (word_8 *)malloc((size_t)size / 2))) + { + for (i = 0, j = 0; i < size / 2; i++) + { + byte = (mem[j++] & 0x0f); + byte |= (mem[j++] << 4) & 0xf0; + if (1 != fwrite(&byte, 1, 1, fp)) + { + if (!quiet) + LOGE( "%s: can\'t write %s\n", progname, name); + fclose(fp); + return 0; + } + } + } + else + { + for (i = 0, j = 0; i < size / 2; i++) + { + tmp_mem[i] = (mem[j++] & 0x0f); + tmp_mem[i] |= (mem[j++] << 4) & 0xf0; + } + + if (fwrite(tmp_mem, 1, (size_t)size / 2, fp) != size / 2) + { + if (!quiet) + LOGE( "%s: can\'t write %s\n", progname, name); + fclose(fp); + free(tmp_mem); + return 0; + } + + free(tmp_mem); + } + + fclose(fp); + + if (verbose) + printf("%s: wrote %s\n", progname, name); + + return 1; +} + + +int +#ifdef __FunctionProto__ +write_files(void) +#else +write_files() +#endif +{ + char path[1024]; + char fnam[1024]; + struct stat st; + int i, make_dir; + int ram_size; + FILE *fp; + + make_dir = 0; + //get_home_directory(path); + FILE *sd; + if (NULL == (sd = fopen("/sdcard/.hp48/", "rw"))) { + strcpy(path, "/data/data/org.ab.x48/"); + //fclose(sd); + } + else + strcpy(path, "/sdcard/.hp48/"); + + if (stat(path, &st) == -1) + { + if (errno == ENOENT) + { + make_dir = 1; + } + else + { + if (!quiet) + LOGE( "%s: can\'t stat %s, saving to /tmp\n", + progname, path); + strcpy(path, "/tmp"); + } + } + else + { + if (!S_ISDIR(st.st_mode)) + { + if (!quiet) + LOGE( "%s: %s is no directory, saving to /tmp\n", + progname, path); + strcpy(path, "/tmp"); + } + } + + if (make_dir) + { + if (mkdir(path, 0777) == -1) + { + if (!quiet) + LOGE( "%s: can\'t mkdir %s, saving to /tmp\n", + progname, path); + strcpy(path, "/tmp"); + } + } + + //strcat(path, "/"); + + strcpy(fnam, path); + strcat(fnam, "hp48"); + +LOGI("trying to save: %s", fnam); + + if ((fp = fopen(fnam, "w")) == NULL) { + if (!quiet) + LOGE( "%s: can\'t open %s, no saving done\n", + progname, fnam); + return 0; + } + + /* + * write the hp48 config file + */ + write_32(fp, (word_32 *)&saturn.magic); + for (i = 0; i < 4; i++) write_char(fp, &saturn.version[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.A[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.B[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.C[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.D[i]); + write_32(fp, &saturn.d[0]); + write_32(fp, &saturn.d[1]); + write_8(fp, &saturn.P); + write_32(fp, &saturn.PC); + for (i = 0; i < 16; i++) write_8(fp, &saturn.R0[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.R1[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.R2[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.R3[i]); + for (i = 0; i < 16; i++) write_8(fp, &saturn.R4[i]); + for (i = 0; i < 4; i++) write_8(fp, &saturn.IN[i]); + for (i = 0; i < 3; i++) write_8(fp, &saturn.OUT[i]); + write_8(fp, &saturn.CARRY); + for (i = 0; i < NR_PSTAT; i++) write_8(fp, &saturn.PSTAT[i]); + write_8(fp, &saturn.XM); + write_8(fp, &saturn.SB); + write_8(fp, &saturn.SR); + write_8(fp, &saturn.MP); + write_8(fp, &saturn.hexmode); + for (i = 0; i < NR_RSTK; i++) write_32(fp, &saturn.rstk[i]); + write_16(fp, (word_16 *)&saturn.rstkp); + for (i = 0; i < 9; i++) write_16(fp, (word_16 *)&saturn.keybuf.rows[i]); + write_8(fp, &saturn.intenable); + write_8(fp, &saturn.int_pending); + write_8(fp, &saturn.kbd_ien); + write_8(fp, &saturn.disp_io); + write_8(fp, &saturn.contrast_ctrl); + write_8(fp, &saturn.disp_test); + write_16(fp, &saturn.crc); + write_8(fp, &saturn.power_status); + write_8(fp, &saturn.power_ctrl); + write_8(fp, &saturn.mode); + write_8(fp, &saturn.annunc); + write_8(fp, &saturn.baud); + write_8(fp, &saturn.card_ctrl); + write_8(fp, &saturn.card_status); + write_8(fp, &saturn.io_ctrl); + write_8(fp, &saturn.rcs); + write_8(fp, &saturn.tcs); + write_8(fp, &saturn.rbr); + write_8(fp, &saturn.tbr); + write_8(fp, &saturn.sreq); + write_8(fp, &saturn.ir_ctrl); + write_8(fp, &saturn.base_off); + write_8(fp, &saturn.lcr); + write_8(fp, &saturn.lbr); + write_8(fp, &saturn.scratch); + write_8(fp, &saturn.base_nibble); + write_32(fp, &saturn.disp_addr); + write_16(fp, &saturn.line_offset); + write_8(fp, &saturn.line_count); + write_16(fp, &saturn.unknown); + write_8(fp, &saturn.t1_ctrl); + write_8(fp, &saturn.t2_ctrl); + write_32(fp, &saturn.menu_addr); + write_8(fp, &saturn.unknown2); + write_char(fp, &saturn.timer1); + write_32(fp, &saturn.timer2); + write_32(fp, &saturn.t1_instr); + write_32(fp, &saturn.t2_instr); + write_16(fp, (word_16 *)&saturn.t1_tick); + write_16(fp, (word_16 *)&saturn.t2_tick); + write_32(fp, &saturn.i_per_s); + write_16(fp, &saturn.bank_switch); + for (i = 0; i < NR_MCTL; i++) + { + write_16(fp, &saturn.mem_cntl[i].unconfigured); + write_32(fp, &saturn.mem_cntl[i].config[0]); + write_32(fp, &saturn.mem_cntl[i].config[1]); + } + fclose(fp); + if (verbose) + printf("%s: wrote %s\n", progname, fnam); + + if (rom_is_new) + { + strcpy(fnam, path); + strcat(fnam, "rom"); + if (!write_mem_file(fnam, saturn.rom, rom_size)) + return 0; + } + + if (opt_gx) + ram_size = RAM_SIZE_GX; + else + ram_size = RAM_SIZE_SX; + + strcpy(fnam, path); + strcat(fnam, "ram"); + if (!write_mem_file(fnam, saturn.ram, ram_size)) + return 0; + + if ((port1_size > 0) && port1_is_ram) + { + strcpy(fnam, path); + strcat(fnam, "port1"); + if (!write_mem_file(fnam, saturn.port1, port1_size)) + return 0; + } + + if ((port2_size > 0) && port2_is_ram) + { + strcpy(fnam, path); + strcat(fnam, "port2"); + if (!write_mem_file(fnam, saturn.port2, port2_size)) + return 0; + } + + return 1; +} + +int +#ifdef __FunctionProto__ +init_emulator(void) +#else +init_emulator() +#endif +{ + if (!initialize) + if (read_files()) + { + if (resetOnStartup) + saturn.PC = 0x00000; + return 0; + } + + init_saturn(); + if (!read_rom(romFileName)) + exit(1); + + return 0; +} + +void +#ifdef __FunctionProto__ +init_active_stuff(void) +#else +init_active_stuff() +#endif +{ + serial_init(); + init_annunc(); + init_display(); +} + +int +#ifdef __FunctionProto__ +exit_emulator(void) +#else +exit_emulator() +#endif +{ + write_files(); + return 1; +} + diff --git a/jni/lcd.c b/jni/lcd.c new file mode 100644 index 0000000..f069898 --- /dev/null +++ b/jni/lcd.c @@ -0,0 +1,660 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: lcd.c,v $ + * Revision 1.13 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.12 1994/12/08 22:14:50 ecd + * fixed bug with XShmPutImage causing errors in init_display + * + * Revision 1.11 1994/12/07 20:20:50 ecd + * added support for icon colors + * + * Revision 1.10 1994/11/28 02:00:51 ecd + * added support for colors on icon + * + * Revision 1.9 1994/11/02 14:44:28 ecd + * minor fixes + * + * Revision 1.8 1994/10/09 20:32:02 ecd + * implemented bit offset stuff. + * + * Revision 1.7 1994/10/06 16:30:05 ecd + * added Shared Memory stuff + * + * Revision 1.6 1994/10/05 08:36:44 ecd + * pixmaps for nibble updates + * + * Revision 1.5 1994/09/30 12:37:09 ecd + * new display code makes x48 a lot faster + * + * Revision 1.4 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.3 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.2 1994/08/31 18:23:21 ecd + * changed display initialization. + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * $Id: lcd.c,v 1.13 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#include +#include +#include +#ifdef SUNOS +#include +#endif + + +#include "hp48.h" +#include "hp48_emu.h" +#include "annunc.h" +#include "device.h" + +static int last_annunc_state = -1; + +display_t display; + +#define DISP_ROWS 64 + +#define NIBS_PER_BUFFER_ROW (NIBBLES_PER_ROW + 2) + +#define DISP_ROWS_AS_SHORT (DISP_ROWS*2) + +#define NIBS_PER_BUFFER_ROW_AS_SHORT 262 // (NIBBLES_PER_ROW * 8 ) + +#define BLANK_COLOR 0x842d + +#define ANDROID_BUF_LENGTH (DISP_ROWS_AS_SHORT * NIBS_PER_BUFFER_ROW_AS_SHORT) + +#define ANDROID_BUF_HEADER_LENGTH (14 * NIBS_PER_BUFFER_ROW_AS_SHORT) + +unsigned char disp_buf[DISP_ROWS][NIBS_PER_BUFFER_ROW]; +unsigned char lcd_buffer[DISP_ROWS][NIBS_PER_BUFFER_ROW]; +unsigned short disp_buf_short [ANDROID_BUF_LENGTH]; // 64 * 2 * 262 +unsigned short disp_buf_header_short [ANDROID_BUF_HEADER_LENGTH]; +uint8_t ann_boolean [6]; + +Pixmap nibble_maps[16]; + +unsigned char nibbles[16][2] = +{ + { 0x00, 0x00 }, /* ---- */ + { 0x03, 0x03 }, /* *--- */ + { 0x0c, 0x0c }, /* -*-- */ + { 0x0f, 0x0f }, /* **-- */ + { 0x30, 0x30 }, /* --*- */ + { 0x33, 0x33 }, /* *-*- */ + { 0x3c, 0x3c }, /* -**- */ + { 0x3f, 0x3f }, /* ***- */ + { 0xc0, 0xc0 }, /* ---* */ + { 0xc3, 0xc3 }, /* *--* */ + { 0xcc, 0xcc }, /* -*-* */ + { 0xcf, 0xcf }, /* **-* */ + { 0xf0, 0xf0 }, /* --** */ + { 0xf3, 0xf3 }, /* *-** */ + { 0xfc, 0xfc }, /* -*** */ + { 0xff, 0xff } /* **** */ +}; + +/*{ 0xffff, 0xffff, 0xffff, 0xffff }, + { 0x0000, 0xffff, 0xffff, 0xffff }, + { 0xffff, 0x0000, 0xffff, 0xffff }, + { 0x0000, 0x0000, 0xffff, 0xffff }, + { 0xffff, 0xffff, 0x0000, 0xffff }, + { 0x0000, 0xffff, 0x0000, 0xffff }, + { 0xffff, 0x0000, 0x0000, 0xffff }, + { 0x0000, 0x0000, 0x0000, 0xffff }, + { 0xffff, 0xffff, 0xffff, 0x0000 }, + { 0x0000, 0xffff, 0xffff, 0x0000 }, + { 0xffff, 0x0000, 0xffff, 0x0000 }, + { 0x0000, 0x0000, 0xffff, 0x0000 }, + { 0xffff, 0xffff, 0x0000, 0x0000 }, + { 0x0000, 0xffff, 0x0000, 0x0000 }, + { 0xffff, 0x0000, 0x0000, 0x0000 }, + { 0x0000, 0x0000, 0x0000, 0x0000 } + */ +unsigned short nibbles_short [16][8] = +{ + { BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR }, /* ---- */ + { 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR }, /* *--- */ + { BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR }, /* -*-- */ + { 0x0000, 0x0000, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR }, /* **-- */ + { BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR }, /* --*- */ + { 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR }, /* *-*- */ + { BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR }, /* -**- */ + { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR }, /* ***- */ + { BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000 }, /* ---* */ + { 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000 }, /* *--* */ + { BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000 }, /* -*-* */ + { 0x0000, 0x0000, 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000 }, /* **-* */ + { BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, 0x0000, 0x0000 }, /* --** */ + { 0x0000, 0x0000, BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, 0x0000, 0x0000 }, /* *-** */ + { BLANK_COLOR, BLANK_COLOR, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, /* -*** */ + { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 } /* **** */ +}; + +static unsigned char nibble_bits[16]; + +jshortArray array; +jbooleanArray ann_array; + +int flipable = 0; + +void +Java_org_ab_x48_X48_setBlankColor( JNIEnv* env, + jobject this, jshort color) { + int i, j; + for(i=0;i 0) + { + nibbles_short[i][j] = color; + } + for(i=0;i 0) + { + disp_buf_short[i] = color; + } + + + flipable = 1; +} + +void +Java_org_ab_x48_X48_flipScreen( JNIEnv* env, + jobject this) { + + flipable = 1; +} + + + +jint +Java_org_ab_x48_X48_fillScreenData( JNIEnv* env, + jobject this, jshortArray array) { + + if (flipable == 1) + { + + (*env)->SetShortArrayRegion(env, array, 0, ANDROID_BUF_HEADER_LENGTH, disp_buf_header_short); + (*env)->SetShortArrayRegion(env, array, ANDROID_BUF_HEADER_LENGTH, ANDROID_BUF_LENGTH, disp_buf_short); + flipable = 0; + return 1; + } + return 0; +} + +void +#ifdef __FunctionProto__ +android_refresh_screen(void) +#else +android_refresh_screen() +#endif +{ + return; + if (flipable == 1 && android_env) + { + + if (!array) + { + array = (*android_env)->NewShortArray(android_env, ANDROID_BUF_LENGTH); + } + if(array) { + (*android_env)->SetShortArrayRegion(android_env, array, 0, ANDROID_BUF_LENGTH, disp_buf_short); + } + (*android_env)->CallVoidMethod(android_env, android_callback, refreshMainScreen, array); + flipable = 0; + } + return; +} + +void +#ifdef __FunctionProto__ +fill_disp_buf_short(int x, int y, int v) +#else +fill_disp_buf_short(x, y, v) +int x; +int y; +int v; +#endif +{ + int xx = x*8; + int yy = y*2; + if (xx >= NIBS_PER_BUFFER_ROW_AS_SHORT || yy >= DISP_ROWS_AS_SHORT) + { + //LOGE("error in location: %d:%d", x, y); + return; + } + if (xx == NIBS_PER_BUFFER_ROW_AS_SHORT -6) + { + memcpy(&disp_buf_short[NIBS_PER_BUFFER_ROW_AS_SHORT * yy + xx], &nibbles_short[v][0], 12); + memcpy(&disp_buf_short[NIBS_PER_BUFFER_ROW_AS_SHORT * (yy + 1) + xx], &nibbles_short[v][0], 12); + } else { + memcpy(&disp_buf_short[NIBS_PER_BUFFER_ROW_AS_SHORT * yy + xx], &nibbles_short[v][0], 16); + memcpy(&disp_buf_short[NIBS_PER_BUFFER_ROW_AS_SHORT * (yy + 1) + xx], &nibbles_short[v][0], 16); + } + flipable = 1; +} + +void +#ifdef __FunctionProto__ +init_nibble_maps(void) +#else +init_nibble_maps() +#endif +{ + int i; + + for (i = 0; i < 16; i++) { + nibble_maps[i] = XCreateBitmapFromData(dpy, disp.win, + (char *)nibbles[i], 8, 2); + } +#ifdef HAVE_XSHM + if (0) { + + } +#endif +} + +void +#ifdef __FunctionProto__ +init_display(void) +#else +init_display() +#endif +{ + disp.mapped = 1; + display.on = (int)(saturn.disp_io & 0x8) >> 3; + + display.disp_start = (saturn.disp_addr & 0xffffe); + display.offset = (saturn.disp_io & 0x7); + disp.offset = 2 * display.offset; + + display.lines = (saturn.line_count & 0x3f); + if (display.lines == 0) + display.lines = 63; + disp.lines = 2 * display.lines; + if (disp.lines < 110) + disp.lines = 110; + + if (display.offset > 3) + display.nibs_per_line = (NIBBLES_PER_ROW+saturn.line_offset+2) & 0xfff; + else + display.nibs_per_line = (NIBBLES_PER_ROW+saturn.line_offset) & 0xfff; + + display.disp_end = display.disp_start + + (display.nibs_per_line * (display.lines + 1)); + + display.menu_start = saturn.menu_addr; + display.menu_end = saturn.menu_addr + 0x110; + + display.contrast = saturn.contrast_ctrl; + display.contrast |= ((saturn.disp_test & 0x1) << 4); + + display.annunc = saturn.annunc; + + memset(disp_buf, 0xf0, sizeof(disp_buf)); + memset(lcd_buffer, 0xf0, sizeof(lcd_buffer)); + + + init_nibble_maps(); +} + +static inline void +#ifdef __FunctionProto__ +draw_nibble(int c, int r, int val) +#else +draw_nibble(c, r, val) +int c; +int r; +int val; +#endif +{ + int x, y; + + x = (c * 8) + 5; + if (r <= display.lines) + x -= disp.offset; + y = (r * 2) + 20; + val &= 0x0f; + if (val != lcd_buffer[r][c]) { + //XCopyPlane(dpy, nibble_maps[val], disp.win, disp.gc, 0, 0, 8, 2, x, y, 1); + lcd_buffer[r][c] = val; + fill_disp_buf_short(c, r, val); + + } +} + +static inline void +#ifdef __FunctionProto__ +draw_row(long addr, int row) +#else +draw_row(addr, row) +long addr; +int row; +#endif +{ + int i, v; + int line_length; + + line_length = NIBBLES_PER_ROW; + if ((display.offset > 3) && (row <= display.lines)) + line_length += 2; + for (i = 0; i < line_length; i++) { + v = read_nibble(addr + i); + if (v != disp_buf[row][i]) { + disp_buf[row][i] = v; + draw_nibble(i, row, v); + } + } +} + +void +#ifdef __FunctionProto__ +update_display(void) +#else +update_display() +#endif +{ + int i, j; + long addr; + static int old_offset = -1; + static int old_lines = -1; +#ifdef HAVE_XSHM + int addr_pad; + int val, line_pad, line_length; + word_20 data_addr, data_addr_2; +#endif + + /* if (!disp.mapped) + { + refresh_icon(); + return; + }*/ + if (display.on) { + addr = display.disp_start; +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + if (display.offset != old_offset) { + memset(disp_buf, 0xf0, + (size_t)((display.lines+1) * NIBS_PER_BUFFER_ROW)); + memset(lcd_buffer, 0xf0, + (size_t)((display.lines+1) * NIBS_PER_BUFFER_ROW)); + old_offset = display.offset; + } + if (display.lines != old_lines) { + memset(&disp_buf[56][0], 0xf0, (size_t)(8 * NIBS_PER_BUFFER_ROW)); + memset(&lcd_buffer[56][0], 0xf0, (size_t)(8 * NIBS_PER_BUFFER_ROW)); + old_lines = display.lines; + } + for (i = 0; i <= display.lines; i++) { + draw_row(addr, i); + addr += display.nibs_per_line; + } +#ifdef HAVE_XSHM + } +#endif + if (i < DISP_ROWS) { + addr = display.menu_start; +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + for (; i < DISP_ROWS; i++) { + draw_row(addr, i); + addr += NIBBLES_PER_ROW; + } +#ifdef HAVE_XSHM + } +#endif + } + } else { +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + memset(disp_buf, 0xf0, sizeof(disp_buf)); + for (i = 0; i < 64; i++) { + for (j = 0; j < NIBBLES_PER_ROW; j++) { + draw_nibble(j, i, 0x00); + } + } +#ifdef HAVE_XSHM + } +#endif + } +//android_refresh_screen(); +} + +void +#ifdef __FunctionProto__ +redraw_display(void) +#else +redraw_display() +#endif +{ + XClearWindow(dpy, disp.win); + memset(disp_buf, 0, sizeof(disp_buf)); + memset(lcd_buffer, 0, sizeof(lcd_buffer)); + update_display(); +} + +void +#ifdef __FunctionProto__ +disp_draw_nibble(word_20 addr, word_4 val) +#else +disp_draw_nibble(addr, val) +word_20 addr; +word_4 val; +#endif +{ + long offset; +#ifdef HAVE_XSHM + int shm_addr; +#endif + int x, y; +int ok = 0; + + offset = (addr - display.disp_start); + x = offset % display.nibs_per_line; + if (x < 0 || x > 35) + return; + if (display.nibs_per_line != 0) { + y = offset / display.nibs_per_line; + if (y < 0 || y > 63) + return; +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + if (val != disp_buf[y][x]) { + ok = 1; + disp_buf[y][x] = val; + draw_nibble(x, y, val); + } +#ifdef HAVE_XSHM + } +#endif + } else { +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + for (y = 0; y < display.lines; y++) { + if (val != disp_buf[y][x]) { + ok = 1; + disp_buf[y][x] = val; + draw_nibble(x, y, val); + } + } +#ifdef HAVE_XSHM + } +#endif + } + + +} + +void +#ifdef __FunctionProto__ +menu_draw_nibble(word_20 addr, word_4 val) +#else +menu_draw_nibble(addr, val) +word_20 addr; +word_4 val; +#endif +{ + long offset; +#ifdef HAVE_XSHM + int shm_addr; +#endif + int x, y; + + offset = (addr - display.menu_start); +#ifdef HAVE_XSHM + if (0) { + + } else { +#endif + x = offset % NIBBLES_PER_ROW; + y = display.lines + (offset / NIBBLES_PER_ROW) + 1; + if (val != disp_buf[y][x]) { + disp_buf[y][x] = val; + draw_nibble(x, y, val); + } +#ifdef HAVE_XSHM + } +#endif + +} + + +struct ann_struct { + int bit; + int x; + int y; + unsigned int width; + unsigned int height; + unsigned char *bits; + Pixmap pixmap; +} ann_tbl[] = { + { ANN_LEFT, 16, 4, ann_left_width, ann_left_height, ann_left_bits }, + { ANN_RIGHT, 61, 4, ann_right_width, ann_right_height, ann_right_bits }, + { ANN_ALPHA, 106, 4, ann_alpha_width, ann_alpha_height, ann_alpha_bits }, + { ANN_BATTERY, 151, 4, ann_battery_width, ann_battery_height, + ann_battery_bits }, + { ANN_BUSY, 196, 4, ann_busy_width, ann_busy_height, ann_busy_bits }, + { ANN_IO, 241, 4, ann_io_width, ann_io_height, ann_io_bits }, + { 0 } +}; + +void +#ifdef __FunctionProto__ +draw_annunc(void) +#else +draw_annunc() +#endif +{ + int val; + int i; + + val = display.annunc; + + if (val == last_annunc_state) + return; + last_annunc_state = val; + /*for (i = 0; ann_tbl[i].bit; i++) + { + if ((ann_tbl[i].bit & val) == ann_tbl[i].bit) + { + XCopyPlane(dpy, ann_tbl[i].pixmap, disp.win, disp.gc, 0, 0, + ann_tbl[i].width, ann_tbl[i].height, + ann_tbl[i].x, ann_tbl[i].y, 1); + } + else + { + XClearArea(dpy, disp.win, ann_tbl[i].x, ann_tbl[i].y, + ann_tbl[i].width, ann_tbl[i].height, 0); + } + } + refresh_icon();*/ + + + if (!ann_array) + { + ann_array = (*android_env)->NewBooleanArray(android_env, 6); + } + if(ann_array) { + for (i = 0; ann_tbl[i].bit; i++) { + ann_boolean[i] = ((ann_tbl[i].bit & val) == ann_tbl[i].bit); + } + (*android_env)->SetBooleanArrayRegion(android_env, ann_array, 0, 6, ann_boolean); + (*android_env)->CallVoidMethod(android_env, android_callback, refreshIcons, ann_array); + } + flipable = 1; + +} + +void +#ifdef __FunctionProto__ +redraw_annunc(void) +#else +redraw_annunc() +#endif +{ + last_annunc_state = -1; + draw_annunc(); +} + +void +#ifdef __FunctionProto__ +init_annunc(void) +#else +init_annunc() +#endif +{ + int i; + + for (i = 0; ann_tbl[i].bit; i++) { + ann_tbl[i].pixmap = XCreateBitmapFromData(dpy, disp.win, + (char *)ann_tbl[i].bits, + ann_tbl[i].width, + ann_tbl[i].height); + } +} + diff --git a/jni/main.c b/jni/main.c new file mode 100644 index 0000000..841f7dc --- /dev/null +++ b/jni/main.c @@ -0,0 +1,424 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: main.c,v $ + * Revision 1.11 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.10 1994/12/07 20:20:50 ecd + * changed initialization + * + * Revision 1.10 1994/12/07 20:20:50 ecd + * changed initialization + * + * Revision 1.9 1994/11/28 02:00:51 ecd + * reordered initialization. serial_init() is called after x11 init. + * + * Revision 1.8 1994/11/04 03:42:34 ecd + * added call to parse_options() + * + * Revision 1.7 1994/11/02 14:44:28 ecd + * call to emulate_debug() added + * + * Revision 1.6 1994/10/05 08:36:44 ecd + * new function call to init_nibble_maps() + * + * Revision 1.5 1994/09/30 12:37:09 ecd + * deleted saturn.intenable = 1; statement + * + * Revision 1.4 1994/09/18 22:47:20 ecd + * fixed typo + * + * Revision 1.3 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.2 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.1 1994/09/13 15:05:05 ecd + * Initial revision + * + * $Id: main.c,v 1.11 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x48.h" +#include "hp48.h" +#include "debugger.h" + +#include + +char *progname; +char *res_name; +char *res_class; + +int saved_argc; +char **saved_argv; + +saturn_t saturn; +int nb; +int exit_state = 1; + +void +#ifdef __FunctionProto__ +signal_handler(int sig) +#else +signal_handler(sig) +int sig; +#endif +{ + switch (sig) { + case SIGINT: + enter_debugger |= USER_INTERRUPT; + //LOGI("-sigint handler-"); + break; + case SIGALRM: + got_alarm = 1; + break; + case SIGPIPE: + exit_x48(0); + exit (0); + default: + break; + } +} + +void +#ifdef __FunctionProto__ +save_options(int argc, char **argv) +#else +save_options(argc, argv) +int argc; +char **argv; +#endif +{ + int l; + + saved_argc = argc; + saved_argv = (char **)malloc((argc + 2) * sizeof(char *)); + if (saved_argv == (char **)0) + { + LOGE( "%s: malloc failed in save_options(), exit\n", progname); + exit (1); + } + saved_argv[argc] = (char *)0; + while (argc--) + { + l = strlen(argv[argc]) + 1; + saved_argv[argc] = (char *)malloc(l); + if (saved_argv[argc] == (char *)0) + { + LOGE( "%s: malloc failed in save_options(), exit\n", + progname); + exit (1); + } + memcpy(saved_argv[argc], argv[argc], l); + } +} + +int +#ifdef __FunctionProto__ +main(int argc, char **argv) +#else +main(argc, argv) +int argc; +char **argv; +#endif +{ + char *name; + sigset_t set; + struct sigaction sa; + long flags; + struct itimerval it; + +/*setlocale(LC_CTYPE, ""); +printf("%s\n", setlocale(LC_ALL, NULL)); +printf("%s\n", setlocale(LC_ALL, "en_US.utf8")); +printf("%s\n", nl_langinfo(CODESET));*/ + + name = (char *)0; + /* + * Get the name we are called. + */ + /* progname = strrchr(argv[0], '/'); + if (progname == NULL) + progname = argv[0]; + else + progname++;*/ + + /* + * save command line options + */ + //save_options(argc, argv); + + /* + * Open up the display + */ + /* if (InitDisplay(argc, argv) < 0) { + exit (1); + } +*/ + /* + * initialize emulator stuff + */ + printf("0001\n"); + init_emulator(); + printf("0010\n"); + + /* + * Create the HP-48 window + */ + /*if (CreateWindows(saved_argc, saved_argv) < 0) { + LOGE( "%s: can\'t create window\n", progname); + exit (1); + } +*/ + /* + * can't be done before windows exist + */ + init_active_stuff(); + + printf("0020\n"); + + /* + * install a handler for SIGALRM + */ + sigemptyset(&set); + sigaddset(&set, SIGALRM); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGALRM, &sa, (struct sigaction *)0); + + /* + * install a handler for SIGINT + */ + sigemptyset(&set); + sigaddset(&set, SIGINT); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGINT, &sa, (struct sigaction *)0); + + /* + * install a handler for SIGPIPE + */ + sigemptyset(&set); + sigaddset(&set, SIGPIPE); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGPIPE, &sa, (struct sigaction *)0); + + /* + * set the real time interval timer + */ + it.it_interval.tv_sec = 0; + it.it_interval.tv_usec = 20000; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 20000; + setitimer(ITIMER_REAL, &it, (struct itimerval *)0); + + /* + * Set stdin flags to not include O_NDELAY and O_NONBLOCK + */ + flags = fcntl(STDIN_FILENO, F_GETFL, 0); + flags &= ~O_NDELAY; + flags &= ~O_NONBLOCK; + fcntl(STDIN_FILENO, F_SETFL, flags); + + + + + do { + + if (!exec_flags) + emulate (); + else + emulate_debug (); + + debug(); + + } while (1); + + return 0; +} + + +void +Java_org_ab_x48_X48_registerClass( JNIEnv* env, jobject caller, jobject callback ) +{ + LOGI("--registerClass--"); + android_env = env; + android_callback = callback; + jclass x48 = (*android_env)->GetObjectClass(env, android_callback); + LOGI("--x48 registered--"); + refreshMainScreen = (*android_env)->GetMethodID(android_env, x48, "refreshMainScreen", "([S)V"); + waitEvent = (*android_env)->GetMethodID(android_env, x48, "waitEvent", "()I"); + refreshIcons = (*android_env)->GetMethodID(android_env, x48, "refreshIcons", "([Z)V"); + emulatorReady = (*android_env)->GetMethodID(android_env, x48, "emulatorReady", "()V"); + pauseEvent = (*android_env)->GetMethodID(android_env, x48, "pauseEvent", "()V"); + LOGI("--methods registered--"); +} + +jstring +Java_org_ab_x48_X48_stopHPEmulator( JNIEnv* env, jobject thiz ) +{ + exit (0); + //exit_state = 0; +} + +jstring +Java_org_ab_x48_X48_saveState( JNIEnv* env, jobject thiz ) +{ + LOGI("save_state"); + write_files(); +} + +jstring +Java_org_ab_x48_X48_resetHPEmulator( JNIEnv* env, jobject thiz ) +{ + do_reset(); +} + + +jstring +Java_org_ab_x48_X48_startHPEmulator( JNIEnv* env, jobject thiz ) +{ + + LOGI("init_emulator"); +exit_state = 1; +sigset_t set; + struct sigaction sa; + long flags; + struct itimerval it; + + init_emulator(); + LOGI("init_active_stuff"); + + init_active_stuff(); + + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGALRM, &sa, (struct sigaction *)0); + + + sigemptyset(&set); + sigaddset(&set, SIGINT); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGINT, &sa, (struct sigaction *)0); + + + sigemptyset(&set); + sigaddset(&set, SIGPIPE); + sa.sa_handler = signal_handler; + sa.sa_mask = set; +#ifdef SA_RESTART + sa.sa_flags = SA_RESTART; +#endif + sigaction(SIGPIPE, &sa, (struct sigaction *)0); + + + + it.it_interval.tv_sec = 0; + it.it_interval.tv_usec = 20000; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 20000; + setitimer(ITIMER_REAL, &it, (struct itimerval *)0); + + + flags = fcntl(STDIN_FILENO, F_GETFL, 0); + flags &= ~O_NDELAY; + flags &= ~O_NONBLOCK; + fcntl(STDIN_FILENO, F_SETFL, flags); + + LOGI("emulate loop"); + +(*android_env)->CallVoidMethod(android_env, android_callback, emulatorReady); + + do { + + if (!exec_flags) + emulate (); + else + emulate_debug (); + + debug(); + + } while (exit_state); + LOGI("exit loop"); + + return (*env)->NewStringUTF(env, "Hello from JNI !"); +} + +jint +Java_org_ab_x48_X48_buttonPressed( JNIEnv* env, + jobject this, + jint x) { + button_pressed(x); + +} + + +jint +Java_org_ab_x48_X48_buttonReleased( JNIEnv* env, + jobject this, + jint x) { + button_released(x); + +} + + +jint +Java_org_ab_x48_X48_loadProg( JNIEnv* env, + jobject this, + jstring desc) { + const char* cDesc = (*env)->GetStringUTFChars(env, desc, 0); + int c = read_bin_file(cDesc); + (*env)->ReleaseStringUTFChars(env, desc, cDesc); + return c; +} diff --git a/jni/memory.c b/jni/memory.c new file mode 100644 index 0000000..0970f1c --- /dev/null +++ b/jni/memory.c @@ -0,0 +1,1535 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: memory.c,v $ + * Revision 1.15 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.14 1994/12/08 22:14:50 ecd + * corrected setting of display.lines + * + * Revision 1.13 1994/12/07 20:20:50 ecd + * minor fixes + * + * Revision 1.12 1994/11/28 02:00:51 ecd + * corrected setting of display.contrast + * + * Revision 1.11 1994/11/02 15:07:54 ecd + * deleted trailing NULL characters + * + * Revision 1.10 1994/11/02 14:44:28 ecd + * minor changes + * + * Revision 1.9 1994/10/09 20:32:02 ecd + * added support for bit offset, changed handling of display_t + * variables. + * + * Revision 1.8 1994/10/06 16:30:05 ecd + * changed char to unsigned + * + * Revision 1.7 1994/10/05 08:36:44 ecd + * removed display addr queue + * + * Revision 1.6 1994/10/01 10:12:53 ecd + * added schedule_event = 0 for any display touch + * + * Revision 1.5 1994/09/30 12:37:09 ecd + * support for faster display and scheduler + * + * Revision 1.4 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.3 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.2 1994/08/31 18:23:21 ecd + * changed memory access routines. + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * $Id: memory.c,v 1.15 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include +#include +#include +#ifdef SUNOS +#include +#endif + +#include "hp48.h" +#include "device.h" +#include "hp48_emu.h" +#include "romio.h" +#include "resources.h" +#include "mmu.h" + +extern int device_check; +extern short port1_is_ram; +extern long port1_mask; +extern short port2_is_ram; +extern long port2_mask; + +#define DEBUG_UNKNOWN 1 +/* #define DEBUG_SERIAL 1 */ +/* #define DEBUG_SERIALb 1 */ +/* #define DEBUG_DISPLAY 1 */ +/* #define DEBUG_IR 1 */ +/* #define DEBUG_CONTRAST 1 */ +/* #define DEBUG_CARDS 1 */ +/* #define DEBUG_BAD_MEM 1 */ +/* #define DEBUG_BASE_NIBBLE 1 */ +/* #define DEBUG_BANK_SWITCH 1 */ + +long nibble_masks[16] = { + 0x0000000f, + 0x000000f0, + 0x00000f00, + 0x0000f000, + 0x000f0000, + 0x00f00000, + 0x0f000000, + 0xf0000000, + 0x0000000f, + 0x000000f0, + 0x00000f00, + 0x0000f000, + 0x000f0000, + 0x00f00000, + 0x0f000000, + 0xf0000000 +}; + +void (*write_nibble) __ProtoType__((long addr, int val)); +int (*read_nibble) __ProtoType__((long addr)); +int (*read_nibble_crc) __ProtoType__((long addr)); + +static int line_counter = -1; + +static inline int +#ifdef __FunctionProto__ +calc_crc(int nib) +#else +calc_crc(nib) +int nib; +#endif +{ + saturn.crc = (saturn.crc >> 4) ^ (((saturn.crc ^ nib) & 0xf) * 0x1081); + return nib; +} + +void +#ifdef __FunctionProto__ +write_dev_mem(long addr, int val) +#else +write_dev_mem(addr, val) +long addr; +int val; +#endif +{ + static int old_line_offset = -1; + + device_check = 1; + schedule_event = 0; + switch ((int)addr) { + case 0x100: /* DISPIO */ + if (val != saturn.disp_io) { + saturn.disp_io = val; + display.on = (val & 0x8) >> 3; + display.offset = val & 0x7; + disp.offset = 2 * display.offset; + if (display.offset > 3) + display.nibs_per_line = + (NIBBLES_PER_ROW+saturn.line_offset+2) & 0xfff; + else + display.nibs_per_line = + (NIBBLES_PER_ROW+saturn.line_offset) & 0xfff; + display.disp_end = display.disp_start + + (display.nibs_per_line * (display.lines + 1)); + device.display_touched = DISP_INSTR_OFF; + } +#ifdef DEBUG_DISPLAY + LOGE( "%.5lx: DISP ON: %x\n", saturn.PC, display.on); +#endif + return; + case 0x101: /* CONTRAST CONTROL */ + saturn.contrast_ctrl = val; + display.contrast &= ~0x0f; + display.contrast |= val; +#ifdef DEBUG_CONTRAST + LOGE( "%.5lx: Contrast: 0x%x\n", saturn.PC, display.contrast); +#endif + device.contrast_touched = 1; + return; + case 0x102: /* DISPLAY TEST */ + display.contrast &= ~0xf0; + display.contrast |= ((val & 0x1) << 4); +#ifdef DEBUG_CONTRAST + LOGE( "%.5lx: Contrast: 0x%x\n", saturn.PC, display.contrast); +#endif + device.contrast_touched = 1; + /* Fall through */ + case 0x103: /* DISPLAY TEST */ + saturn.disp_test &= ~nibble_masks[addr - 0x102]; + saturn.disp_test |= val << ((addr - 0x102) * 4); +#ifdef DEBUG_DISPLAY + LOGE( "%.5lx: DISP TEST: %x\n", saturn.PC, saturn.disp_test); +#endif + device.disp_test_touched = 1; + return; + case 0x104: case 0x105: case 0x106: case 0x107: /* CRC */ + saturn.crc &= ~nibble_masks[addr - 0x104]; + saturn.crc |= val << ((addr - 0x104) * 4); + return; + case 0x108: /* POWER STATUS */ + saturn.power_status = val; + device.power_status_touched = 1; + return; + case 0x109: /* POWER CONTROL */ + saturn.power_ctrl = val; + device.power_ctrl_touched = 1; + return; + case 0x10a: /* MODE */ + saturn.mode = val; + device.mode_touched = 1; + return; + case 0x10b: case 0x10c: /* ANNUNC */ + saturn.annunc &= ~nibble_masks[addr - 0x10b]; + saturn.annunc |= val << ((addr - 0x10b) * 4); + display.annunc = saturn.annunc; + device.ann_touched = 1; + return; + case 0x10d: /* BAUD */ + saturn.baud = val; + device.baud_touched = 1; +#ifdef DEBUG_SERIALb + LOGE( "%.5lx: BAUD write: %x\n", saturn.PC, saturn.baud); +#endif + return; + case 0x10e: /* CARD CONTROL */ + saturn.card_ctrl = val; + if (saturn.card_ctrl & 0x02) + saturn.MP = 1; + if (saturn.card_ctrl & 0x01) + do_interupt(); + device.card_ctrl_touched = 1; +#ifdef DEBUG_CARDS + LOGE( "%.5lx: CardControl write: %x\n", + saturn.PC, saturn.card_ctrl); +#endif + return; + case 0x10f: /* CARD STATUS */ +#ifdef DEBUG_CARDS + LOGE( "%.5lx: CardStatus write: %x\n", + saturn.PC, saturn.card_status); +#endif + return; + case 0x110: /* IO CONTROL */ + saturn.io_ctrl = val; + device.ioc_touched = 1; +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: IOC write: %x\n", saturn.PC, saturn.io_ctrl); +#endif + return; + case 0x111: /* RCS */ + saturn.rcs = val; +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: RCS: %x\n", saturn.PC, saturn.rcs); +#endif + return; + case 0x112: /* TCS */ + saturn.tcs = val; +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: TCS: %x\n", saturn.PC, saturn.tcs); +#endif + return; + case 0x113: /* CRER */ + saturn.rcs &= 0x0b; +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: CRER, RCS: %x\n", saturn.PC, saturn.rcs); +#endif + return; + case 0x114: case 0x115: /* RBR */ + return; + case 0x116: case 0x117: /* TBR */ + saturn.tbr &= ~nibble_masks[addr - 0x116]; + saturn.tbr |= val << ((addr - 0x116) * 4); + saturn.tcs |= 0x01; + device.tbr_touched = 1; + return; + case 0x118: case 0x119: /* SERVICE REQ */ + saturn.sreq &= ~nibble_masks[addr - 0x118]; + saturn.sreq |= val << ((addr - 0x118) * 4); + device.sreq_touched = 1; +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: SREQ? write: %x\n", saturn.PC, saturn.sreq); +#endif + return; + case 0x11a: /* IR CONTROL */ + saturn.ir_ctrl = val; + device.ir_ctrl_touched = 1; +#ifdef DEBUG_IR + LOGE( "%.5lx: IRC write: %x\n", saturn.PC, saturn.ir_ctrl); +#endif + return; + case 0x11b: /* BASE NIB OFFSET */ + saturn.base_off = val; + device.base_off_touched = 1; + return; + case 0x11c: /* LED CONTROL */ + saturn.lcr = val; + device.lcr_touched = 1; +#ifdef DEBUG_IR + LOGE( "%.5lx: LCR write: %x\n", saturn.PC, saturn.lcr); +#endif + return; + case 0x11d: /* LED BUFFER */ + saturn.lbr = val; + device.lbr_touched = 1; +#ifdef DEBUG_IR + LOGE( "%.5lx: LBR write: %x\n", saturn.PC, saturn.lbr); +#endif + return; + case 0x11e: /* SCRATCH PAD */ + saturn.scratch = val; + device.scratch_touched = 1; + return; + case 0x11f: /* BASENIBBLE */ + saturn.base_nibble = val; + device.base_nibble_touched = 1; +#ifdef DEBUG_BASE_NIBBLE + if (opt_gx) + LOGE( "%.5lx: BASENIB: %x\n", saturn.PC, saturn.base_nibble); +#endif + return; + case 0x120: case 0x121: case 0x122: case 0x123: /* DISP_ADDR */ + case 0x124: + saturn.disp_addr &= ~nibble_masks[addr - 0x120]; + saturn.disp_addr |= val << ((addr - 0x120) * 4); + if (display.disp_start != (saturn.disp_addr & 0xffffe)) { + display.disp_start = saturn.disp_addr & 0xffffe; + display.disp_end = display.disp_start + + (display.nibs_per_line * (display.lines + 1)); + device.display_touched = DISP_INSTR_OFF; + } +#ifdef DEBUG_DISPLAY + LOGE( "%.5lx: DISPLAY: %lx\n", saturn.PC, display.disp_start); + LOGE( "%.5lx: DISP END: %lx\n", saturn.PC, display.disp_end); +#endif + return; + case 0x125: case 0x126: case 0x127: /* LINE_OFFSET */ + saturn.line_offset &= ~nibble_masks[addr - 0x125]; + saturn.line_offset |= val << ((addr - 0x125) * 4); + if (saturn.line_offset != old_line_offset) { + old_line_offset = saturn.line_offset; + if (display.offset > 3) + display.nibs_per_line = + (NIBBLES_PER_ROW+saturn.line_offset+2) & 0xfff; + else + display.nibs_per_line = + (NIBBLES_PER_ROW+saturn.line_offset) & 0xfff; + display.disp_end = display.disp_start + + (display.nibs_per_line * (display.lines + 1)); + device.display_touched = DISP_INSTR_OFF; + } +#ifdef DEBUG_DISPLAY + LOGE( "%.5lx: DISP LINE SIZE: %x\n", + saturn.PC, display.nibs_per_line); + LOGE( "%.5lx: DISP END: %lx\n", saturn.PC, display.disp_end); +#endif + return; + case 0x128: case 0x129: /* LINE_COUNT */ + saturn.line_count &= ~nibble_masks[addr - 0x128]; + saturn.line_count |= val << ((addr - 0x128) * 4); + line_counter = -1; + if (display.lines != (saturn.line_count & 0x3f)) { + display.lines = saturn.line_count & 0x3f; + if (display.lines == 0) + display.lines = 63; + disp.lines = 2 * display.lines; + display.disp_end = display.disp_start + + (display.nibs_per_line * (display.lines + 1)); + device.display_touched = DISP_INSTR_OFF; + } +#ifdef DEBUG_DISPLAY + LOGE( "%.5lx: DISP LINES: %x\n", saturn.PC, display.lines); + LOGE( "%.5lx: DISP END: %lx\n", saturn.PC, display.disp_end); +#endif + return; + case 0x12a: case 0x12b: case 0x12c: case 0x12d: /* Dont know yet */ + saturn.unknown &= ~nibble_masks[addr - 0x12a]; + saturn.unknown |= val << ((addr - 0x12a) * 4); +#ifdef DEBUG_UNKNOWN + LOGE( "Unknown device @0x%ld: %.4x\n", addr, saturn.unknown); +#endif + device.unknown_touched = 1; + return; + case 0x12e: /* TIMER 1 CONTROL */ + saturn.t1_ctrl = val; + device.t1_ctrl_touched = 1; + return; + case 0x12f: /* TIMER 2 CONTROL */ + saturn.t2_ctrl = val; + device.t2_ctrl_touched = 1; + return; + case 0x130: case 0x131: case 0x132: case 0x133: /* MENU_ADDR */ + case 0x134: + saturn.menu_addr &= ~nibble_masks[addr - 0x130]; + saturn.menu_addr |= val << ((addr - 0x130) * 4); + if (display.menu_start != saturn.menu_addr) { + display.menu_start = saturn.menu_addr; + display.menu_end = display.menu_start + 0x110; + device.display_touched = DISP_INSTR_OFF; + } + return; + case 0x135: case 0x136: /* Dont know yet 2 */ + saturn.unknown2 &= ~nibble_masks[addr - 0x135]; + saturn.unknown2 |= val << ((addr - 0x135) * 4); +#ifdef DEBUG_UNKNOWN + LOGE( "Unknown device @0x%ld: %.2x\n", addr, saturn.unknown2); +#endif + device.unknown2_touched = 1; + return; + case 0x137: /* TIMER1 */ + saturn.timer1 = val; + device.t1_touched = 1; + return; + case 0x138: case 0x139: case 0x13a: case 0x13b: + case 0x13c: case 0x13d: case 0x13e: case 0x13f: /* TIMER2 */ + saturn.timer2 &= ~nibble_masks[addr - 0x138]; + saturn.timer2 |= val << ((addr - 0x138) * 4); + device.t2_touched = 1; + return; + default: + if (!quiet) + LOGE( "%.5lx: UNKNOWN DEVICE WRITE AT 0x%lx !!!\n", + saturn.PC, addr); + return; + } +} + +int +#ifdef __FunctionProto__ +read_dev_mem(long addr) +#else +read_dev_mem(addr) +long addr; +#endif +{ + switch ((int)addr) { + case 0x100: /* DISPLAY IO */ + return saturn.disp_io & 0x0f; + case 0x101: /* CONTRAST CONTROL */ + return saturn.contrast_ctrl & 0x0f; + case 0x102: case 0x103: /* DISPLAY TEST */ + return (saturn.disp_test >> ((addr - 0x102) * 4)) & 0x0f; + case 0x104: case 0x105: case 0x106: case 0x107: /* CRC */ + return (saturn.crc >> ((addr - 0x104) * 4)) & 0x0f; + case 0x108: /* POWER STATUS */ + return saturn.power_status & 0x0f; + case 0x109: /* POWER CONTROL */ + return saturn.power_ctrl & 0x0f; + case 0x10a: /* MODE */ + return saturn.mode & 0x0f; + case 0x10b: case 0x10c: /* ANNUNC */ + return (saturn.annunc >> ((addr - 0x10b) * 4)) & 0x0f; + case 0x10d: /* BAUD */ +#ifdef DEBUG_SERIALb + LOGE( "%.5lx: BAUD read: %x\n", saturn.PC, saturn.baud); +#endif + return saturn.baud & 0x0f; + case 0x10e: /* CARD CONTROL */ + return saturn.card_ctrl & 0x0f; + case 0x10f: /* CARD STATUS */ + return saturn.card_status & 0x0f; + case 0x110: /* IO CONTROL */ +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: IOC read: %x\n", saturn.PC, saturn.io_ctrl); +#endif + return saturn.io_ctrl & 0x0f; + case 0x111: /* RCS */ +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: RCS read: %x\n", saturn.PC, saturn.rcs); +#endif + return saturn.rcs & 0x0f; + case 0x112: /* TCS */ +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: TCS read: %x\n", saturn.PC, saturn.tcs); +#endif + return saturn.tcs & 0x0f; + case 0x113: /* CRER */ + return 0x00; + case 0x114: case 0x115: /* RBR */ + saturn.rcs &= 0x0e; + device.rbr_touched = 1; + device_check = 1; + schedule_event = 0; + return (saturn.rbr >> ((addr - 0x114) * 4)) & 0x0f; + case 0x116: case 0x117: /* TBR */ + return 0x00; + case 0x118: case 0x119: /* SERVICE REQ */ +#ifdef DEBUG_SERIAL + LOGE( "%.5lx: SREQ? read: %x\n", saturn.PC, saturn.sreq); +#endif + return (saturn.sreq >> ((addr - 0x118) * 4)) & 0x0f; + case 0x11a: /* IR CONTROL */ +#ifdef DEBUG_IR + LOGE( "%.5lx: IRC read: %x\n", saturn.PC, saturn.ir_ctrl); +#endif + return saturn.ir_ctrl & 0x0f; + case 0x11b: /* BASE NIB OFFSET */ + return saturn.base_off & 0x0f; + case 0x11c: /* LED CONTROL */ +#if 0 +#ifdef DEBUG_IR + LOGE( "%.5lx: LCR read: %x\n", saturn.PC, saturn.lcr); +#endif +#endif + return saturn.lcr & 0x0f; + case 0x11d: /* LED BUFFER */ +#if 0 +#ifdef DEBUG_IR + LOGE( "%.5lx: LBR read: %x\n", saturn.PC, saturn.lbr); +#endif +#endif + return saturn.lbr & 0x0f; + case 0x11e: /* SCRATCH PAD */ + return saturn.scratch & 0x0f; + case 0x11f: /* BASENIBBLE */ + return saturn.base_nibble & 0x0f; + case 0x120: case 0x121: case 0x122: case 0x123: /* DISP_ADDR */ + case 0x124: + return (saturn.disp_addr >> ((addr - 0x120) * 4)) & 0x0f; + case 0x125: case 0x126: case 0x127: /* LINE_OFFSET */ + return (saturn.line_offset >> ((addr - 0x125) * 4)) & 0x0f; + case 0x128: case 0x129: /* LINE_COUNT */ + line_counter++; + if (line_counter > 0x3f) + line_counter = -1; + return (((saturn.line_count & 0xc0) | (line_counter & 0x3f)) >> + ((addr - 0x128) * 4)) & 0x0f; + case 0x12a: case 0x12b: case 0x12c: case 0x12d: /* Dont know yet */ + return (saturn.unknown >> ((addr - 0x12a) * 4)) & 0x0f; + case 0x12e: /* TIMER 1 CONTROL */ + return saturn.t1_ctrl & 0x0f; + case 0x12f: /* TIMER 2 CONTROL */ + return saturn.t2_ctrl & 0x0f; + case 0x130: case 0x131: case 0x132: case 0x133: /* MENU_ADDR */ + case 0x134: + return (saturn.menu_addr >> ((addr - 0x130) * 4)) & 0x0f; + case 0x135: case 0x136: /* Dont know yet 2 */ + return (saturn.unknown2 >> ((addr - 0x135) * 4)) & 0x0f; + case 0x137: + return saturn.timer1 & 0xf; + case 0x138: case 0x139: case 0x13a: case 0x13b: + case 0x13c: case 0x13d: case 0x13e: case 0x13f: + return (saturn.timer2 >> ((addr - 0x138) * 4)) & 0xf; + default: + if (!quiet) + LOGE( "%.5lx: UNKNOWN DEVICE READ AT 0x%lx !!!\n", + saturn.PC, addr); + return 0x00; + } +} + +void +#ifdef __FunctionProto__ +write_nibble_sx(long addr, int val) +#else +write_nibble_sx(addr, val) +long addr; +int val; +#endif +{ + addr &= 0xfffff; + val &= 0x0f; + switch ((int)(addr >> 16) & 0x0f) { + case 0: + if (addr < 0x140 && addr >= 0x100 && + saturn.mem_cntl[MCTL_MMIO_SX].config[0] == 0x100) + { + write_dev_mem(addr, val); + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 1: case 2: case 3: case 4: case 5: case 6: +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 7: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0x70000) + { + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfc000 + && addr < 0x74000) + { + saturn.ram[addr - 0x70000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfe000 + && addr < 0x72000) + { + saturn.ram[addr - 0x70000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xf0000) + { + saturn.ram[addr - 0x70000] = val; + break; + } + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 8: case 9: case 0xa: case 0xb: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0x80000) + { + if (port1_is_ram) + saturn.port1[(addr - 0x80000) & port1_mask] = val; + return; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0x80000) + { + if (port2_is_ram) + saturn.port2[(addr - 0x80000) & port2_mask] = val; + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to NULL at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xc: case 0xd: case 0xe: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + if (port1_is_ram) + saturn.port1[(addr - 0xc0000) & port1_mask] = val; + return; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + if (port2_is_ram) + saturn.port2[(addr - 0xc0000) & port2_mask] = val; + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to NULL at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0xf0000) + { + saturn.ram[addr - 0xf0000] = val; + break; + } + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + if (port1_is_ram) + saturn.port1[(addr - 0xc0000) & port1_mask] = val; + return; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + if (port2_is_ram) + saturn.port2[(addr - 0xc0000) & port2_mask] = val; + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to NULL at %.5lx\n", + saturn.PC, addr); +#endif + return; + } + if (device.display_touched || !disp.mapped) + return; + if (addr >= display.disp_start && addr < display.disp_end) + { + disp_draw_nibble(addr, val); + } + if (display.lines == 63) + return; + if (addr >= display.menu_start && addr < display.menu_end) + { + menu_draw_nibble(addr, val); + } +} + +void +#ifdef __FunctionProto__ +write_nibble_gx(long addr, int val) +#else +write_nibble_gx(addr, val) +long addr; +int val; +#endif +{ + addr &= 0xfffff; + val &= 0x0f; + switch ((int)(addr >> 16) & 0x0f) + { + case 0: + if (addr < 0x140 && addr >= 0x100 && + saturn.mem_cntl[MCTL_MMIO_GX].config[0] == 0x100) + { + write_dev_mem(addr, val); + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 1: case 2: case 3: case 5: case 6: +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: BAD WRITE TO ROM AT ADDRESS %.5lx\n", + saturn.PC, addr); +#endif + return; + case 4: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x40000) + { + saturn.ram[addr - 0x40000] = val; + break; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: BAD WRITE TO ROM AT ADDRESS %.5lx\n", + saturn.PC, addr); +#endif + return; + case 7: + if (addr >= 0x7f000 && + saturn.mem_cntl[MCTL_BANK_GX].config[0] == 0x7f000) + { +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: write to bank switch at %.5lx\n", + saturn.PC, addr); +#endif + return; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: write to port 1 at %.5lx\n", + saturn.PC, addr); +#endif + return; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: write to port 2 at %.5lx\n", + saturn.PC, addr); +#endif + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 8: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0x84000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0x82000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xf0000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 9: + if (saturn.mem_cntl[MCTL_BANK_GX].config[0] == 0x90000) + { + if (addr < 0x91000) + { +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: write to bank switch at %.5lx\n", + saturn.PC, addr); +#endif + return; + } + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + { + saturn.ram[addr - 0x80000] = val; + break; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xa: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xa0000) + { + if (port1_is_ram) + saturn.port1[(addr - 0xa0000) & port1_mask] = val; + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xb: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + { + saturn.ram[addr - 0x80000] = val; + break; + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xb0000) + { + if (port2_is_ram) + saturn.port2[((saturn.bank_switch << 18) + (addr - 0xb0000)) + & port2_mask] = val; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + if (port2_is_ram) + saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xb0000)] = val; + } +*/ + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xc: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0xc4000) + { + saturn.ram[addr - 0xc0000] = val; + break; + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0xc2000) + { + saturn.ram[addr - 0xc0000] = val; + break; + } + saturn.ram[addr - 0xc0000] = val; + break; + } + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + { + if (port1_is_ram) + saturn.port1[(addr - 0xc0000) & port1_mask] = val; + return; + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + { + if (port2_is_ram) + saturn.port2[((saturn.bank_switch << 18) + (addr - 0xc0000)) + & port2_mask] = val; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + if (port2_is_ram) + saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)] = val; + } +*/ + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + case 0xd: case 0xe: case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + { + saturn.ram[addr - 0xc0000] = val; + break; + } + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT1_GX].config[1] == 0xc0000) + { + if (port1_is_ram) + saturn.port1[(addr - 0xc0000) & port1_mask] = val; + return; + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT2_GX].config[1] == 0xc0000) + { + if (port2_is_ram) + saturn.port2[((saturn.bank_switch << 18) + (addr - 0xc0000)) + & port2_mask] = val; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + if (port2_is_ram) + saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)] = val; + } +*/ + return; + } +#ifdef DEBUG_BAD_MEM + LOGE( "%.5lx: write to ROM at %.5lx\n", + saturn.PC, addr); +#endif + return; + } + if (device.display_touched || !disp.mapped) + return; + if (addr >= display.disp_start && addr < display.disp_end) + { + disp_draw_nibble(addr, val); + } + if (display.lines == 63) { + return; + } + if (addr >= display.menu_start && addr < display.menu_end) + { + menu_draw_nibble(addr, val); + } + return; +} + +int +#ifdef __FunctionProto__ +read_nibble_sx(long addr) +#else +read_nibble_sx(addr) +long addr; +#endif +{ + addr &= 0xfffff; + switch ((int)(addr >> 16) & 0x0f) { + case 0: + if (addr < 0x140 && addr >= 0x100) + { + if (saturn.mem_cntl[MCTL_MMIO_SX].config[0] == 0x100) + return read_dev_mem(addr); + else + return 0x00; + } + return saturn.rom[addr]; + case 1: case 2: case 3: case 4: case 5: case 6: + return saturn.rom[addr]; + case 7: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0x70000) + { + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfc000 + && addr < 0x74000) + return saturn.ram[addr - 0x70000]; + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfe000 + && addr < 0x72000) + return saturn.ram[addr - 0x70000]; + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xf0000) + return saturn.ram[addr - 0x70000]; + } + return saturn.rom[addr]; + case 8: case 9: case 0xa: case 0xb: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0x80000) + { + return saturn.port1[(addr - 0x80000) & port1_mask]; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0x80000) + { + return saturn.port2[(addr - 0x80000) & port2_mask]; + } + return 0x00; + case 0xc: case 0xd: case 0xe: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + return saturn.port1[(addr - 0xc0000) & port1_mask]; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + return saturn.port2[(addr - 0xc0000) & port2_mask]; + } + return 0x00; + case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0xf0000) + return saturn.ram[addr - 0xf0000]; + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + return saturn.port1[(addr - 0xc0000) & port1_mask]; + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + return saturn.port2[(addr - 0xc0000) & port2_mask]; + } + return 0x00; + } + return 0x00; +} + +int +#ifdef __FunctionProto__ +read_nibble_gx(long addr) +#else +read_nibble_gx(addr) +long addr; +#endif +{ + addr &= 0xfffff; + switch ((int)(addr >> 16) & 0x0f) + { + case 0: + if (addr < 0x140 && addr >= 0x100) + { + if (saturn.mem_cntl[0].config[0] == 0x100) + return read_dev_mem(addr); + else + return 0x00; + } + return saturn.rom[addr]; + case 1: case 2: case 3: case 5: case 6: + return saturn.rom[addr]; + case 4: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x40000) + return saturn.ram[addr - 0x40000]; + return saturn.rom[addr]; + case 7: + if (addr >= 0x7f000 && + saturn.mem_cntl[MCTL_BANK_GX].config[0] == 0x7f000) + { + if (addr == 0x7f000) + { + saturn.bank_switch = 0; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: disable bank switch\n", saturn.PC); +#endif + } + if (addr >= 0x7f040 && addr < 0x7f080) + { + saturn.bank_switch = (addr - 0x7f040) / 2; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: switch to bank %d\n", + saturn.PC, saturn.bank_switch); +#endif + } + return 0x7; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: read from port 1 at %.5lx\n", + saturn.PC, addr); +#endif + return 0x7; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: read from port 2 at %.5lx\n", + saturn.PC, addr); +#endif + return 0x7; + } + return saturn.rom[addr]; + case 8: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0x84000) + return saturn.ram[addr - 0x80000]; + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0x82000) + return saturn.ram[addr - 0x80000]; + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xf0000) + return saturn.ram[addr - 0x80000]; + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return saturn.ram[addr - 0x80000]; + } + return saturn.rom[addr]; + case 9: + if (saturn.mem_cntl[0].config[0] == 0x90000) + { + if (addr < 0x91000) + { + if (addr == 0x90000) + { + saturn.bank_switch = 0; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: disable bank switch\n", saturn.PC); +#endif + } + if (addr >= 0x90040 && addr < 0x90080) + { + saturn.bank_switch = (addr - 0x90040) / 2; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: switch to bank %d\n", + saturn.PC, saturn.bank_switch); +#endif + } + return 0x7; + } + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return saturn.ram[addr - 0x80000]; + return saturn.rom[addr]; + case 0xa: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return saturn.ram[addr - 0x80000]; + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xa0000) + { + return saturn.port1[(addr - 0xa0000) & port1_mask]; + } + return saturn.rom[addr]; + case 0xb: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return saturn.ram[addr - 0x80000]; + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xb0000) + { + return saturn.port2[((saturn.bank_switch << 18) + (addr - 0xb0000)) + & port2_mask]; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xb0000)]; + } + return 0x00; +*/ + } + return saturn.rom[addr]; + case 0xc: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0xc4000) + return saturn.ram[addr - 0xc0000]; + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0xc2000) + return saturn.ram[addr - 0xc0000]; + return saturn.ram[addr - 0xc0000]; + } + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + { + return saturn.port1[(addr - 0xc0000) & port1_mask]; + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + { + return saturn.port2[((saturn.bank_switch << 18) + (addr - 0xc0000)) + & port2_mask]; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)]; + } + return 0x00; +*/ + } + return saturn.rom[addr]; + case 0xd: case 0xe: case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return saturn.ram[addr - 0xc0000]; + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT1_GX].config[1] == 0xc0000) + { + return saturn.port1[(addr - 0xc0000) & port1_mask]; + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT2_GX].config[1] == 0xc0000) + { + return saturn.port2[((saturn.bank_switch << 18) + + (addr - 0xc0000)) & port2_mask]; +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)]; + } + return 0x00; +*/ + } + return saturn.rom[addr]; + } + return 0x00; +} + +int +#ifdef __FunctionProto__ +read_nibble_crc_sx(long addr) +#else +read_nibble_crc_sx(addr) +long addr; +#endif +{ + addr &= 0xfffff; + switch ((int)(addr >> 16) & 0x0f) { + case 0: + if (addr < 0x140 && addr >= 0x100) + { + if (saturn.mem_cntl[MCTL_MMIO_SX].config[0] == 0x100) + return read_dev_mem(addr); + else + return calc_crc(0x00); + } + return calc_crc(saturn.rom[addr]); + case 1: case 2: case 3: case 4: case 5: case 6: + return calc_crc(saturn.rom[addr]); + case 7: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0x70000) + { + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfc000 + && addr < 0x74000) + return calc_crc(saturn.ram[addr - 0x70000]); + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xfe000 + && addr < 0x72000) + return calc_crc(saturn.ram[addr - 0x70000]); + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[1] == 0xf0000) + return calc_crc(saturn.ram[addr - 0x70000]); + } + return calc_crc(saturn.rom[addr]); + case 8: case 9: case 0xa: case 0xb: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0x80000) + { + return calc_crc(saturn.port1[(addr - 0x80000) & port1_mask]); + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0x80000) + { + return calc_crc(saturn.port2[(addr - 0x80000) & port2_mask]); + } + return 0x00; + case 0xc: case 0xd: case 0xe: + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + return calc_crc(saturn.port1[(addr - 0xc0000) & port1_mask]); + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + return calc_crc(saturn.port2[(addr - 0xc0000) & port2_mask]); + } + return 0x00; + case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_SX].config[0] == 0xf0000) + return calc_crc(saturn.ram[addr - 0xf0000]); + if (saturn.mem_cntl[MCTL_PORT1_SX].config[0] == 0xc0000) + { + return calc_crc(saturn.port1[(addr - 0xc0000) & port1_mask]); + } + if (saturn.mem_cntl[MCTL_PORT2_SX].config[0] == 0xc0000) + { + return calc_crc(saturn.port2[(addr - 0xc0000) & port2_mask]); + } + return 0x00; + } + return 0x00; +} + +int +#ifdef __FunctionProto__ +read_nibble_crc_gx(long addr) +#else +read_nibble_crc_gx(addr) +long addr; +#endif +{ + addr &= 0xfffff; + switch ((int)(addr >> 16) & 0x0f) + { + case 0: + if (addr < 0x140 && addr >= 0x100) + { + if (saturn.mem_cntl[MCTL_MMIO_GX].config[0] == 0x100) + return read_dev_mem(addr); + else + return calc_crc(0x00); + } + return calc_crc(saturn.rom[addr]); + case 1: case 2: case 3: case 5: case 6: + return calc_crc(saturn.rom[addr]); + case 4: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x40000) + return calc_crc(saturn.ram[addr - 0x40000]); + return calc_crc(saturn.rom[addr]); + case 7: + if (addr >= 0x7f000 && + saturn.mem_cntl[MCTL_BANK_GX].config[0] == 0x7f000) + { + if (addr == 0x7f000) + { + saturn.bank_switch = 0; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: disable bank switch\n", saturn.PC); +#endif + } + if (addr >= 0x7f040 && addr < 0x7f080) + { + saturn.bank_switch = (addr - 0x7f040) / 2; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: switch to bank %d\n", + saturn.PC, saturn.bank_switch); +#endif + } + return 0x7; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: read from port 1 at %.5lx\n", + saturn.PC, addr); +#endif + return 0x7; + } + if (addr >= 0x7e000 && addr < 0x7f000 && + saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0x7e000) + { +#ifdef DEBUG_PORTS + LOGE( "%.5lx: read from port 2 at %.5lx\n", + saturn.PC, addr); +#endif + return 0x7; + } + return calc_crc(saturn.rom[addr]); + case 8: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0x84000) + return calc_crc(saturn.ram[addr - 0x80000]); + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0x82000) + return calc_crc(saturn.ram[addr - 0x80000]); + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xf0000) + return calc_crc(saturn.ram[addr - 0x80000]); + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return calc_crc(saturn.ram[addr - 0x80000]); + } + return calc_crc(saturn.rom[addr]); + case 9: + if (saturn.mem_cntl[0].config[0] == 0x90000) + { + if (addr < 0x91000) + { + if (addr == 0x90000) + { + saturn.bank_switch = 0; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: disable bank switch\n", saturn.PC); +#endif + } + if (addr >= 0x90040 && addr < 0x90080) + { + saturn.bank_switch = (addr - 0x90040) / 2; +#ifdef DEBUG_BANK_SWITCH + LOGE( "%.5lx: switch to bank %d\n", + saturn.PC, saturn.bank_switch); +#endif + } + return 0x7; + } + } + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return calc_crc(saturn.ram[addr - 0x80000]); + return calc_crc(saturn.rom[addr]); + case 0xa: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return calc_crc(saturn.ram[addr - 0x80000]); + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xa0000) + { + return calc_crc(saturn.port1[(addr - 0xa0000) & port1_mask]); + } + return calc_crc(saturn.rom[addr]); + case 0xb: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0x80000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return calc_crc(saturn.ram[addr - 0x80000]); + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xb0000) + { + return calc_crc(saturn.port2[((saturn.bank_switch << 18) + + (addr - 0xb0000)) & port2_mask]); +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return calc_crc(saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xb0000)]); + } + return 0x00; +*/ + } + return calc_crc(saturn.rom[addr]); + case 0xc: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + { + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfc000 + && addr < 0xc4000) + return calc_crc(saturn.ram[addr - 0xc0000]); + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xfe000 + && addr < 0xc2000) + return calc_crc(saturn.ram[addr - 0xc0000]); + return calc_crc(saturn.ram[addr - 0xc0000]); + } + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + { + return calc_crc(saturn.port1[(addr - 0xc0000) & port1_mask]); + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + { + return calc_crc(saturn.port2[((saturn.bank_switch << 18) + + (addr - 0xc0000)) & port2_mask]); +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return calc_crc(saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)]); + } + return 0x00; +*/ + } + return calc_crc(saturn.rom[addr]); + case 0xd: case 0xe: case 0xf: + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_SysRAM_GX].config[1] == 0xc0000) + return calc_crc(saturn.ram[addr - 0xc0000]); + if (saturn.mem_cntl[MCTL_PORT1_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT1_GX].config[1] == 0xc0000) + { + return calc_crc(saturn.port1[(addr - 0xc0000) & port1_mask]); + } + if (saturn.mem_cntl[MCTL_PORT2_GX].config[0] == 0xc0000) + if (saturn.mem_cntl[MCTL_PORT2_GX].config[1] == 0xc0000) + { + return calc_crc(saturn.port2[((saturn.bank_switch << 18) + + (addr - 0xc0000)) & port2_mask]); +/* + if (port2_size > (saturn.bank_switch << 18)) + { + return calc_crc(saturn.port2[(saturn.bank_switch << 18) + + (addr - 0xc0000)]); + } + return 0x00; +*/ + } + return calc_crc(saturn.rom[addr]); + } + return 0x00; +} + +long +#ifdef __FunctionProto__ +read_nibbles(long addr, int len) +#else +read_nibbles(addr, len) +long addr; +int len; +#endif +{ + long val = 0; + + addr += len; + while (len-- > 0) { + val = (val << 4) | read_nibble(--addr); + } + return val; +} + +void +#ifdef __FunctionProto__ +write_nibbles(long addr, long val, int len) +#else +write_nibbles(addr, val, len) +long addr; +long val; +int len; +#endif +{ + while (len-- > 0) { + write_nibble(addr++, val); + val >>= 4; + } +} + +void +#ifdef __FunctionProto__ +dev_memory_init(void) +#else +dev_memory_init() +#endif +{ + if (opt_gx) + { + read_nibble = read_nibble_gx; + read_nibble_crc = read_nibble_crc_gx; + write_nibble = write_nibble_gx; + } + else + { + read_nibble = read_nibble_sx; + read_nibble_crc = read_nibble_crc_sx; + write_nibble = write_nibble_sx; + } + memset(&device, 0, sizeof(device)); +} + diff --git a/jni/mkcard.c b/jni/mkcard.c new file mode 100644 index 0000000..b0ef3cd --- /dev/null +++ b/jni/mkcard.c @@ -0,0 +1,130 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: mkcard.c,v $ + * Revision 1.1 1995/01/11 18:11:25 ecd + * Initial revision + * + * + * $Id: mkcard.c,v 1.1 1995/01/11 18:11:25 ecd Exp ecd $ + */ + + +#include "global.h" + +#include +#include +#include +#include +#ifdef SUNOS +#include +#endif +#include + +unsigned char *mem; + +int +#ifdef __FunctionProto__ +write_mem_file(char *name, unsigned char *mem, int size) +#else +write_mem_file(name, mem, size) +char *name; +unsigned char *mem; +int size; +#endif +{ + FILE *fp; + + if (NULL == (fp = fopen(name, "w"))) + { + printf( "can\'t open %s\n", name); + return 0; + } + + if (fwrite(mem, 1, (size_t)size, fp) != size) + { + printf( "can\'t write %s\n", name); + fclose(fp); + return 0; + } + + fclose(fp); + return 1; +} + +int +#ifdef __FunctionProto__ +main(int argc, char **argv) +#else +main(argc, argv) +int argc; +char **argv; +#endif +{ + long size; + char *name; + char *asize; + unsigned char *core; + + if (argc < 2) + { + printf( "usage: %s [32K | 128K | 1M | 2M | 4M] file-name\n", + argv[0]); + exit (1); + } + + name = argv[2]; + asize = argv[1]; + if (!strcmp(asize, "32K")) + size = 0x8000; + else if (!strcmp(asize, "128K")) + size = 0x20000; + else if (!strcmp(asize, "256K")) + size = 0x40000; + else if (!strcmp(asize, "512K")) + size = 0x80000; + else if (!strcmp(asize, "1M")) + size = 0x100000; + else if (!strcmp(asize, "2M")) + size = 0x200000; + else if (!strcmp(asize, "4M")) + size = 0x400000; + else + { + printf( + "%s: size must be one of 32K, 128K, 256K, 512K, 1M, 2M, or 4M\n", + argv[0]); + exit (1); + } + + if ((core = (unsigned char *)malloc(size)) == NULL) { + printf( "%s: can\'t malloc %ld bytes\n", argv[0], size); + exit (1); + } + memset(core, 0, size); + + if (!write_mem_file(name, core, size)) + { + printf( "%s: can\'t write to %s\n", argv[0], name); + exit (1); + } + + exit (0); +} + diff --git a/jni/mmu.h b/jni/mmu.h new file mode 100644 index 0000000..6d54564 --- /dev/null +++ b/jni/mmu.h @@ -0,0 +1,53 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: mmu.h,v $ + * Revision 1.1 1995/01/11 18:11:25 ecd + * Initial revision + * + * + * $Id: mmu.h,v 1.1 1995/01/11 18:11:25 ecd Exp ecd $ + */ +#ifndef _MMU_H +#define _MMU_H 1 + + +#define NR_MCTL 6 + +#define MCTL_MMIO_SX 0 +#define MCTL_SysRAM_SX 1 +#define MCTL_PORT1_SX 2 +#define MCTL_PORT2_SX 3 +#define MCTL_EXTRA_SX 4 +#define MCTL_SysROM_SX 5 + +#define MCTL_MMIO_GX 0 +#define MCTL_SysRAM_GX 1 +#define MCTL_BANK_GX 2 +#define MCTL_PORT1_GX 3 +#define MCTL_PORT2_GX 4 +#define MCTL_SysROM_GX 5 + + +#if 0 +extern void init_mmu __ProtoType__((void)); +extern void reset_mmu __ProtoType__((void)); +#endif + +#endif /* !_MMU_H */ diff --git a/jni/options.c b/jni/options.c new file mode 100644 index 0000000..3264134 --- /dev/null +++ b/jni/options.c @@ -0,0 +1,176 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: options.c,v $ + * Revision 1.5 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.4 1994/12/07 20:20:50 ecd + * more options + * + * Revision 1.4 1994/12/07 20:20:50 ecd + * more options + * + * Revision 1.3 1994/11/28 02:00:51 ecd + * complete rewrite + * + * Revision 1.2 1994/11/04 03:42:34 ecd + * finally implemented the first options + * + * Revision 1.1 1994/11/02 14:44:28 ecd + * Initial revision + * + * + * $Id: options.c,v 1.5 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include +#include + +#include "constants.h" +#include "resources.h" + +void +#ifdef __FunctionProto__ +usage(void) +#else +usage() +#endif +{ + fprintf(stdout, "\n\ +x48 Version %d.%d.%d, Copyright (c) 1994-2005 by Eddie C. Dost .\n\ +\n\ +usage:\n\t%s [-options ...]\n\ +\n\ +where options include:\n\ + -help print out this message\n\ + -display X server to contact\n\ + -name set application name to \n\ + -title set window title to \n\ + -geometry position of window\n\ + -iconGeom position of icon window\n\ + -iconic start iconic\n\ + -visual use visual \n\ + -mono force monochrome\n\ + -gray force grayscale\n\ + -monoIcon force monochrome icon\n\ + -smallFont to draw small labels (MTH - DEL)\n\ + -mediumFont to draw medium label (ENTER)\n\ + -largeFont to draw large labels (Numbers)\n\ + -connFont to display wire & IR connections\n\ + -/+xshm turn on/off XShm extension\n\ + -version print out version information\n\ + -copyright print out copyright information\n\ + -warranty print out warranty information\n\ + -verbose run verbosive\n\ + -quiet run quietly\n\ + -/+terminal turn on/off pseudo terminal interface\n\ + -/+serial turn on/off serial interface\n\ + -line use serial line for IR connection\n\ + -/+debug turn on/off debugger\n\ + -disasm use (\'HP\' or \'class\') mnemonics\n\ + -reset perform a reset (PC = 0) on startup\n\ + -initialize force initialization x48 from ROM-dump\n\ + -rom if initializing, read ROM from \n\ + -home use directory ~/ to save x48 files\n\ + -xrm set Xresource \n\ +\n", VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, progname); + + fflush(stdout); + exit (1); +} + +void +#ifdef __FunctionProto__ +show_version(void) +#else +show_version() +#endif +{ + fprintf(stdout, "\n\ +%s Version %d.%d.%d, x48 is Copyright (c) 1994-2005 by Eddie C. Dost .\n\ +Compiled on %s by <%s> #%d\n\n", + progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, + COMPILE_TIME, COMPILE_BY, COMPILE_VERSION); +} + +void +#ifdef __FunctionProto__ +show_copyright(void) +#else +show_copyright() +#endif +{ + fprintf(stdout, "\n\ + COPYRIGHT\n\ +\n\ +X48 is an Emulator/Debugger for the HP-48 Handheld Calculator.\n\ +Copyright (C) 1994 by Eddie C. Dost .\n\ +\n\ +This program is free software; you can redistribute it and/or modify\n\ +it under the terms of the GNU General Public License as published by\n\ +the Free Software Foundation; either version 2 of the License, or\n\ +(at your option) any later version.\n\ +\n\ +This program is distributed in the hope that it will be useful,\n\ +but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ +GNU General Public License for more details.\n\ +\n\ +You should have received a copy of the GNU General Public License\n\ +along with this program; if not, write to the Free Software\n\ +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"); +} + +void +#ifdef __FunctionProto__ +show_warranty(void) +#else +show_warranty() +#endif +{ + fprintf(stdout, "\n\ + NO WARRANTY\n\ +\n\ + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n\ +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n\ +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n\ +PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n\ +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\ +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n\ +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n\ +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n\ +REPAIR OR CORRECTION.\n\ +\n\ + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n\ +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n\ +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n\ +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n\ +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n\ +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n\ +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n\ +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n\ +POSSIBILITY OF SUCH DAMAGES.\n\n"); +} + + diff --git a/jni/options.h b/jni/options.h new file mode 100644 index 0000000..2648e81 --- /dev/null +++ b/jni/options.h @@ -0,0 +1,50 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: options.h,v $ + * Revision 1.5 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added more options + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * added more options + * + * Revision 1.3 1994/11/28 02:19:22 ecd + * complete rewrite + * + * Revision 1.2 1994/11/04 03:44:47 ecd + * added first options + * + * Revision 1.1 1994/11/02 14:51:27 ecd + * Initial revision + * + * + * $Id: options.h,v 1.5 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _OPTIONS_H +#define _OPTIONS_H 1 + +#include "global.h" + + + +#endif /* _OPTIONS_H */ diff --git a/jni/ram b/jni/ram new file mode 100644 index 0000000..f3fa23d Binary files /dev/null and b/jni/ram differ diff --git a/jni/register.c b/jni/register.c new file mode 100644 index 0000000..d83948b --- /dev/null +++ b/jni/register.c @@ -0,0 +1,799 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: register.c,v $ + * Revision 1.6 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.5 1994/10/06 16:30:05 ecd + * changed char to unsigned + * + * Revision 1.5 1994/10/06 16:30:05 ecd + * changed char to unsigned + * + * Revision 1.4 1994/10/01 10:12:53 ecd + * changed get_start and get_end to be inline functions + * + * Revision 1.3 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.2 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * $Id: register.c,v 1.6 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#include +#include + +#include "hp48.h" +#include "hp48_emu.h" + +extern long nibble_masks[16]; + +static int start_fields[] = { + -1, 0, 2, 0, 15, 3, 0, 0, + -1, 0, 2, 0, 15, 3, 0, 0, + 0, 0, 0 +}; + +static int end_fields[] = { + -1, -1, 2, 2, 15, 14, 1, 15, + -1, -1, 2, 2, 15, 14, 1, 4, + 3, 2, 0 +}; + +static inline int +#ifdef __FunctionProto__ +get_start(int code) +#else +get_start(code) +int code; +#endif +{ + int s; + + if ((s = start_fields[code]) == -1) { + s = saturn.P; + } + return s; +} + +static inline int +#ifdef __FuntionProto__ +get_end(int code) +#else +get_end(code) +int code; +#endif +{ + int e; + + if ((e = end_fields[code]) == -1) { + e = saturn.P; + } + return e; +} + +void +#ifdef __FunctionProto__ +add_register(unsigned char *res, unsigned char *r1, + unsigned char *r2, int code) +#else +add_register(res, r1, r2, code) +unsigned char *res; +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = 0; + for (i = s; i <= e; i++) { + t = r1[i] + r2[i] + c; + if (t < (int)saturn.hexmode) { + res[i] = t & 0xf; + c = 0; + } else { + res[i] = (t - saturn.hexmode) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +add_p_plus_one(unsigned char *r) +#else +add_p_plus_one(r) +unsigned char *r; +#endif +{ + int t, c, i, s, e; + + s = 0; + e = 4; + c = saturn.P + 1; + for (i = s; i <= e; i++) { + t = r[i] + c; + if (t < 16) { + r[i] = t & 0xf; + c = 0; + } else { + r[i] = (t - 16) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +sub_register(unsigned char *res, unsigned char *r1, + unsigned char *r2, int code) +#else +sub_register(res, r1, r2, code) +unsigned char *res; +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = 0; + for (i = s; i <= e; i++) { + t = r1[i] - r2[i] - c; + if (t >= 0) { + res[i] = t & 0xf; + c = 0; + } else { + res[i] = (t + saturn.hexmode) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +complement_2_register(unsigned char *r, int code) +#else +complement_2_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, c, carry, i, s, e; + + s = get_start(code); + e = get_end(code); + c = 1; + carry = 0; + for (i = s; i <= e; i++) { + t = (saturn.hexmode - 1) - r[i] + c; + if (t < (int)saturn.hexmode) { + r[i] = t & 0xf; + c = 0; + } else { + r[i] = (t - saturn.hexmode) & 0xf; + c = 1; + } + carry += r[i]; + } + if (carry) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +complement_1_register(unsigned char *r, int code) +#else +complement_1_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + t = (saturn.hexmode - 1) - r[i]; + r[i] = t & 0xf; + } + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +inc_register(unsigned char *r, int code) +#else +inc_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = 1; + for (i = s; i <= e; i++) { + t = r[i] + c; + if (t < (int)saturn.hexmode) { + r[i] = t & 0xf; + c = 0; + break; + } else { + r[i] = (t - saturn.hexmode) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +add_register_constant(unsigned char *r, int code, int val) +#else +add_register_constant(r, code, val) +unsigned char *r; +int code; +int val; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = val; + for (i = s; i <= e; i++) { + t = r[i] + c; + if (t < 16) { + r[i] = t & 0xf; + c = 0; + break; + } else { + r[i] = (t - 16) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +dec_register(unsigned char *r, int code) +#else +dec_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = 1; + for (i = s; i <= e; i++) { + t = r[i] - c; + if (t >= 0) { + r[i] = t & 0xf; + c = 0; + break; + } else { + r[i] = (t + saturn.hexmode) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +sub_register_constant(unsigned char *r, int code, int val) +#else +sub_register_constant(r, code, val) +unsigned char *r; +int code; +int val; +#endif +{ + int t, c, i, s, e; + + s = get_start(code); + e = get_end(code); + c = val; + for (i = s; i <= e; i++) { + t = r[i] - c; + if (t >= 0) { + r[i] = t & 0xf; + c = 0; + break; + } else { + r[i] = (t + 16) & 0xf; + c = 1; + } + } + if (c) + saturn.CARRY = 1; + else + saturn.CARRY = 0; +} + +void +#ifdef __FunctionProto__ +zero_register(unsigned char *r, int code) +#else +zero_register(r, code) +unsigned char *r; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) + r[i] = 0; +} + +void +#ifdef __FunctionProto__ +or_register(unsigned char *res, unsigned char *r1, + unsigned char *r2, int code) +#else +or_register(res, r1, r2, code) +unsigned char *res; +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + res[i] = (r1[i] | r2[i]) & 0xf; + } +} + +void +#ifdef __FunctionProto__ +and_register(unsigned char *res, unsigned char *r1, + unsigned char *r2, int code) +#else +and_register(res, r1, r2, code) +unsigned char *res; +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + res[i] = (r1[i] & r2[i]) & 0xf; + } +} + +void +#ifdef __FunctionProto__ +copy_register(unsigned char *to, unsigned char *from, int code) +#else +copy_register(to, from, code) +unsigned char *to; +unsigned char *from; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) + to[i] = from[i]; +} + +void +#ifdef __FunctionProto__ +exchange_register(unsigned char *r1, unsigned char *r2, int code) +#else +exchange_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int t, i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + t = r1[i]; + r1[i] = r2[i]; + r2[i] = t; + } +} + +void +#ifdef __FunctionProto__ +exchange_reg(unsigned char *r, word_20 *d, int code) +#else +exchange_reg(r, d, code) +unsigned char *r; +word_20 *d; +int code; +#endif +{ + int t, i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = s; i <= e; i++) { + t = r[i]; + r[i] = (*d >> (i * 4)) & 0x0f; + *d &= ~nibble_masks[i]; + *d |= t << (i * 4); + } +} + +void +#ifdef __FunctionProto__ +shift_left_register(unsigned char *r, int code) +#else +shift_left_register(r, code) +unsigned char *r; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + for (i = e; i > s; i--) { + r[i] = r[i-1] & 0x0f; + } + r[s] = 0; +} + +void +#ifdef __FunctionProto__ +shift_left_circ_register(unsigned char *r, int code) +#else +shift_left_circ_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, i, s, e; + + s = get_start(code); + e = get_end(code); + t = r[e] & 0x0f; + for (i = e; i > s; i--) { + r[i] = r[i-1] & 0x0f; + } + r[s] = t; +} + +void +#ifdef __FunctionProto__ +shift_right_register(unsigned char *r, int code) +#else +shift_right_register(r, code) +unsigned char *r; +int code; +#endif +{ + int i, s, e; + + s = get_start(code); + e = get_end(code); + if (r[s] & 0x0f) + saturn.SB = 1; + for (i = s; i < e; i++) { + r[i] = r[i+1] & 0x0f; + } + r[e] = 0; +} + +void +#ifdef __FunctionProto__ +shift_right_circ_register(unsigned char *r, int code) +#else +shift_right_circ_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, i, s, e; + + s = get_start(code); + e = get_end(code); + t = r[s] & 0x0f; + for (i = s; i < e; i++) { + r[i] = r[i+1] & 0x0f; + } + r[e] = t; + if (t) + saturn.SB = 1; +} + +void +#ifdef __FunctionProto__ +shift_right_bit_register(unsigned char *r, int code) +#else +shift_right_bit_register(r, code) +unsigned char *r; +int code; +#endif +{ + int t, i, s, e, sb; + + s = get_start(code); + e = get_end(code); + sb = 0; + for (i = e; i >= s; i--) { + t = (((r[i] >> 1) & 7) | (sb << 3)) & 0x0f; + sb = r[i] & 1; + r[i] = t; + } + if (sb) + saturn.SB = 1; +} + +int +#ifdef __FunctionProto__ +is_zero_register(unsigned char *r, int code) +#else +is_zero_register(r, code) +unsigned char *r; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 1; + for (i = s; i <= e; i++) + if ((r[i] & 0xf) != 0) { + z = 0; + break; + } + return z; +} + +int +#ifdef __FunctionProto__ +is_not_zero_register(unsigned char *r, int code) +#else +is_not_zero_register(r, code) +unsigned char *r; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 0; + for (i = s; i <= e; i++) + if ((r[i] & 0xf) != 0) { + z = 1; + break; + } + return z; +} + +int +#ifdef __FunctionProto__ +is_equal_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_equal_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 1; + for (i = s; i <= e; i++) + if ((r1[i] & 0xf) != (r2[i] & 0xf)) { + z = 0; + break; + } + return z; +} + +int +#ifdef __FunctionProto__ +is_not_equal_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_not_equal_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 0; + for (i = s; i <= e; i++) + if ((r1[i] & 0xf) != (r2[i] & 0xf)) { + z = 1; + break; + } + return z; +} + +int +#ifdef __FunctionProto__ +is_less_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_less_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 0; + for (i = e; i >= s; i--) { + if ((int)(r1[i] & 0xf) < (int)(r2[i] & 0xf)) { + z = 1; + break; + } + if ((int)(r1[i] & 0xf) > (int)(r2[i] & 0xf)) { + z = 0; + break; + } + } + return z; +} + +int +#ifdef __FunctionProto__ +is_less_or_equal_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_less_or_equal_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 1; + for (i = e; i >= s; i--) { + if ((int)(r1[i] & 0xf) < (int)(r2[i] & 0xf)) { + z = 1; + break; + } + if ((int)(r1[i] & 0xf) > (int)(r2[i] & 0xf)) { + z = 0; + break; + } + } + return z; +} + +int +#ifdef __FunctionProto__ +is_greater_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_greater_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 0; + for (i = e; i >= s; i--) { + if ((int)(r1[i] & 0xf) > (int)(r2[i] & 0xf)) { + z = 1; + break; + } + if ((int)(r1[i] & 0xf) < (int)(r2[i] & 0xf)) { + z = 0; + break; + } + } + return z; +} + +int +#ifdef __FunctionProto__ +is_greater_or_equal_register(unsigned char *r1, unsigned char *r2, int code) +#else +is_greater_or_equal_register(r1, r2, code) +unsigned char *r1; +unsigned char *r2; +int code; +#endif +{ + int z, i, s, e; + + s = get_start(code); + e = get_end(code); + z = 1; + for (i = e; i >= s; i--) { + if ((int)(r1[i] & 0xf) < (int)(r2[i] & 0xf)) { + z = 0; + break; + } + if ((int)(r1[i] & 0xf) > (int)(r2[i] & 0xf)) { + z = 1; + break; + } + } + return z; +} + diff --git a/jni/resources.c b/jni/resources.c new file mode 100644 index 0000000..42279ba --- /dev/null +++ b/jni/resources.c @@ -0,0 +1,96 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: resources.c,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:20:50 ecd + * more resource get functions + * + * Revision 1.2 1994/12/07 20:20:50 ecd + * more resource get functions + * + * Revision 1.1 1994/12/07 10:15:47 ecd + * Initial revision + * + * + * $Id: resources.c,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +/* xscreensaver, Copyright (c) 1992 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#include "global.h" + +#include +#include + +#include + +#include "resources.h" +#include "disasm.h" +#include "errors.h" + + +int verbose; +int quiet; +int useTerminal; +int useSerial; +char *serialLine; +int useXShm; +int useDebugger; +int initialize; +int resetOnStartup; +char *romFileName; +char *homeDirectory; + +void +#ifdef __FunctionProto__ +get_resources(void) +#else +get_resources() +#endif +{ + verbose = 0; + quiet = 0; + + useXShm = 0; + + useTerminal = 0; + useSerial = 0; + serialLine = 0; + + initialize = 1; + resetOnStartup = 0; + romFileName = "rom"; + //homeDirectory = get_string_resource("homeDirectory", "HomeDirectory"); + + useDebugger = 0; + disassembler_mode =0; +} + diff --git a/jni/resources.h b/jni/resources.h new file mode 100644 index 0000000..a6023d0 --- /dev/null +++ b/jni/resources.h @@ -0,0 +1,78 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: resources.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * added more resource get functions + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * added more resource get functions + * + * Revision 1.1 1994/12/07 10:16:15 ecd + * Initial revision + * + * + * $Id: resources.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ +#ifndef _RESOURCES_H +#define _RESOURCES_H 1 + +#include "global.h" + + +extern int verbose; +extern int quiet; +extern int useTerminal; +extern int useSerial; +extern int useXShm; +extern int useDebugger; +extern char *serialLine; +extern int initialize; +extern int resetOnStartup; +extern char *romFileName; +extern char *homeDirectory; + +extern char *progname; +extern char *res_name; +extern char *res_class; + +extern void usage __ProtoType__ ((void)); +extern void show_version __ProtoType__ ((void)); +extern void show_copyright __ProtoType__ ((void)); +extern void show_warranty __ProtoType__ ((void)); +extern void get_resources __ProtoType__ ((void)); + + +#ifndef isupper +# define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#endif +#ifndef islower +# define islower(c) ((c) >= 'a' && (c) <= 'z') +#endif +#ifndef _tolower +# define _tolower(c) ((c) - 'A' + 'a') +#endif +#ifndef _toupper +# define _toupper(c) ((c) - 'a' + 'A') +#endif + +#endif /* !_RESOURCES_H */ diff --git a/jni/rom b/jni/rom new file mode 100644 index 0000000..78b9aca Binary files /dev/null and b/jni/rom differ diff --git a/jni/romio.c b/jni/romio.c new file mode 100644 index 0000000..31397fe --- /dev/null +++ b/jni/romio.c @@ -0,0 +1,244 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: romio.c,v $ + * Revision 1.1 1995/01/11 18:11:25 ecd + * Initial revision + * + * + * $Id: romio.c,v 1.1 1995/01/11 18:11:25 ecd Exp ecd $ + */ + +#include +#include +#include +#include +#include + +#include "global.h" +#include "resources.h" +#include "romio.h" +#include "x48.h" + +unsigned int opt_gx = 0; +unsigned int rom_size = 0; + +int +#ifdef __FunctionProto__ +read_rom_file(char *name, unsigned char **mem, int *size) +#else +read_rom_file(name, mem, size) +char *name; +unsigned char **mem; +int *size; +#endif +{ + struct stat st; + FILE *fp; + unsigned char *tmp_mem; + unsigned char byte; + unsigned char four[4]; + int i, j; + + *mem = NULL; + *size = 0; + if (NULL == (fp = fopen(name, "r"))) + { + LOGE( "can\'t open %s\n", name); + return 0; + } + + if (stat(name, &st) < 0) + { + LOGE( "can\'t stat %s\n", name); + fclose(fp); + return 0; + } + + if (fread(four, 1, 4, fp) != 4) + { + LOGE("can\'t read first 4 bytes of %s\n", name); + fclose(fp); + return 0; + } + + if (four[0] == 0x02 && four[1] == 0x03 && + four[2] == 0x06 && four[3] == 0x09) + { + *size = st.st_size; + } + else if (four[0] == 0x32 && four[1] == 0x96 && + four[2] == 0x1b && four[3] == 0x80) + { + *size = 2 * st.st_size; + } + else if (four[1] = 0x49) + { + LOGE( "%s is an HP49 ROM\n", name); + *size = 2 * st.st_size; + } + else if (four[0]) + { + LOGI("%d\n", st.st_size); + *size = st.st_size; + } + else + { + LOGE( "%s is not a HP48 ROM\n", name); + fclose(fp); + return 0; + } + + if (fseek(fp, 0, 0) < 0) + { + LOGE( "can\'t fseek to position 0 in %s\n", name); + *size = 0; + fclose(fp); + return 0; + } + + *mem = (unsigned char *)malloc(*size); + + if (st.st_size == *size) + { + /* + * size is same as memory size, old version file + */ + if (fread(*mem, 1, (size_t)*size, fp) != *size) + { + LOGE( "can\'t read %s\n", name); + free(*mem); + *mem = NULL; + *size = 0; + fclose(fp); + return 0; + } + } + else + { + /* + * size is different, check size and decompress memory + */ + + if (st.st_size != *size / 2) + { + LOGE( "strange size %s, expected %d, found %ld\n", + name, *size / 2, st.st_size); + free(*mem); + *mem = NULL; + *size = 0; + fclose(fp); + return 0; + } + + if (NULL == (tmp_mem = (unsigned char *)malloc((size_t)st.st_size))) + { + for (i = 0, j = 0; i < *size / 2; i++) + { + if (1 != fread(&byte, 1, 1, fp)) + { + LOGE( "can\'t read %s\n", name); + free(*mem); + *mem = NULL; + *size = 0; + fclose(fp); + return 0; + } + (*mem)[j++] = byte & 0xf; + (*mem)[j++] = (byte >> 4) & 0xf; + } + } + else + { + if (fread(tmp_mem, 1, (size_t)*size / 2, fp) != *size / 2) + { + LOGE( "can\'t read %s\n", name); + free(*mem); + *mem = NULL; + *size = 0; + fclose(fp); + free(tmp_mem); + return 0; + } + + for (i = 0, j = 0; i < *size / 2; i++) + { + (*mem)[j++] = tmp_mem[i] & 0xf; + (*mem)[j++] = (tmp_mem[i] >> 4) & 0xf; + } + + free(tmp_mem); + } + } + + fclose(fp); + + if ((*mem)[0x29] == 0x00) + { + if (*size == ROM_SIZE_GX) + { + opt_gx = 1; + } + else + if (*size == 4 * ROM_SIZE_GX) + { + LOGE( "%s seems to be HP49 ROM, but size is 0x%x\n", + name, *size); + opt_gx = 2; + } + else + if (*size == 8 * ROM_SIZE_GX) + { + LOGE( "%s seems to be HP49 ROM, but size is 0x%x\n", + name, *size); + opt_gx = 2; + } + else + { + LOGE( "%s seems to be G/GX ROM, but size is 0x%x\n", + name, *size); + free(*mem); + *mem = NULL; + *size = 0; + return 0; + } + } + else + { + if (*size == ROM_SIZE_SX) + { + opt_gx = 0; + } + else + { + LOGE( "%s seems to be S/SX ROM, but size is 0x%x\n", + name, *size); + free(*mem); + *mem = NULL; + *size = 0; + return 0; + } + } + + if (verbose) + LOGI("%s: read %s\n", progname, name); + + return 1; +} + diff --git a/jni/romio.h b/jni/romio.h new file mode 100644 index 0000000..3e1421d --- /dev/null +++ b/jni/romio.h @@ -0,0 +1,43 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: romio.h,v $ + * Revision 1.1 1995/01/11 18:11:25 ecd + * Initial revision + * + * + * $Id: romio.h,v 1.1 1995/01/11 18:11:25 ecd Exp ecd $ + */ + +#ifndef _ROMIO_H +#define _ROMIO_H 1 + +#include "global.h" + +#define ROM_SIZE_SX 0x080000 +#define ROM_SIZE_GX 0x100000 + +extern unsigned int opt_gx; +extern unsigned int rom_size; + +extern int read_rom_file __ProtoType__((char *name, + unsigned char **mem, + int *size)); + +#endif /* !_ROMIO_H */ diff --git a/jni/rpl.c b/jni/rpl.c new file mode 100644 index 0000000..35158a9 --- /dev/null +++ b/jni/rpl.c @@ -0,0 +1,1556 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: rpl.c,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:20:50 ecd + * lots of more functions + * + * Revision 1.2 1994/12/07 20:20:50 ecd + * lots of more functions + * + * Revision 1.1 1994/12/07 10:15:47 ecd + * Initial revision + * + * + * $Id: rpl.c,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include +#include + +#include "hp48.h" +#include "hp48_emu.h" +#include "rpl.h" +#include "debugger.h" +#include "append.h" +#include "disasm.h" +#include "romio.h" +#define DEFINE_TRANS_TABLE 1 +#include "hp48char.h" +#undef DEFINE_TRANS_TABLE + +struct objfunc { + char *name; + short length; + word_20 prolog; + char *(*func) __ProtoType__((word_20 *addr, char *string)); +} objects[] = { + { "System Binary", 0, DOBINT, dec_bin_int }, + { "Real", 0, DOREAL, dec_real }, + { "Long Real", 0, DOEREL, dec_long_real }, + { "Complex", 0, DOCMP, dec_complex }, + { "Long Complex", 0, DOECMP, dec_long_complex }, + { "Character", 0, DOCHAR, dec_char }, + { "Array", 0, DOARRY, dec_array }, + { "Linked Array", 0, DOLNKARRY, dec_lnk_array }, + { "String", 2, DOCSTR, dec_string }, + { "Hex String", 1, DOHSTR, dec_hex_string }, + { "List", 0, DOLIST, dec_list }, + { "Directory", 0, DORRP, skip_ob }, + { "Symbolic", 0, DOSYMB, dec_symb }, + { "Unit", 0, DOEXT, dec_unit }, + { "Tagged", 0, DOTAG, skip_ob }, + { "Graphic", 0, DOGROB, skip_ob }, + { "Library", 0, DOLIB, dec_library }, + { "Backup", 0, DOBAK, skip_ob }, + { "Library Data", 0, DOEXT0, dec_library_data }, + { "ACPTR", 0, DOACPTR, dec_acptr }, + { "External 2", 0, DOEXT2, skip_ob }, + { "External 3", 0, DOEXT3, skip_ob }, + { "External 4", 0, DOEXT4, skip_ob }, + { "Program", 0, DOCOL, dec_prog }, + { "Code", 1, DOCODE, dec_code }, + { "Global Ident", 0, DOIDNT, dec_global_ident }, + { "Local Ident", 0, DOLAM, dec_local_ident }, + { "XLib Name", 0, DOROMP, dec_xlib_name }, + { "*", 0, UM_MUL, dec_unit_op }, + { "/", 0, UM_DIV, dec_unit_op }, + { "^", 0, UM_POW, dec_unit_op }, + { " ", 0, UM_PRE, dec_unit_op }, + { "_", 0, UM_END, dec_unit_op }, + { 0, 0, 0 } +}; + +char * +#ifdef __FunctionProto__ +skip_ob(word_20 *addr, char *string) +#else +skip_ob(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 size, type; + char *p = string; + struct objfunc *op; + + type = read_nibbles(*addr - 5, 5); + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == type) + break; + } + + if (op->prolog) + { + sprintf(p, "%s", op->name); + p += strlen(p); + } + + size = read_nibbles(*addr, 5); + *addr += size; + + *p = '\0'; + return p; +} + +long +#ifdef __FunctionProto__ +hxs2real(long hxs) +#else +hxs2real(hxs) +long hxs; +#endif +{ + int n = 0, c = 1; + + while (hxs) + { + n += (hxs & 0xf) * c; + c *= 10; + hxs >>= 4; + } + return n; +} + +char * +#ifdef __FunctionProto__ +dec_bin_int(word_20 *addr, char *string) +#else +dec_bin_int(addr, string) +word_20 *addr; +char *string; +#endif +{ + char *p = string; + word_20 n = 0; + + n = read_nibbles(*addr, 5); + *addr += 5; + sprintf(p, "<%lXh>", (long)n); + p += strlen(p); + return p; +} + +char * +#ifdef __FunctionProto__ +real_number(word_20 *addr, char *string, int ml, int xl) +#else +real_number(addr, string, ml, xl) +word_20 *addr; +char *string; +int ml; +int xl; +#endif +{ + hp_real r; + long re, xs; + int i; + char fmt[20]; + char m[16]; + char *p = string; + + /* + * Read the number + */ + r.x = read_nibbles(*addr, xl); + *addr += xl; + r.ml = read_nibbles(*addr, ml - 8); + *addr += ml - 8; + r.mh = read_nibbles(*addr, 8); + *addr += 8; + r.m = read_nibbles(*addr, 1); + (*addr)++; + r.s = read_nibbles(*addr, 1); + (*addr)++; + + /* + * Figure out the exponent + */ + xs = 5; + while (--xl) xs *= 10; + re = hxs2real(r.x); + if (re >= xs) + re = re - 2 * xs; + + + if ((re >= 0) && (re < ml + 1)) + { + if (r.s >= 5) + *p++ = '-'; + + sprintf(fmt, "%%.1X%%.8lX%%.%dlX", ml - 8); + sprintf(m, fmt, r.m, r.mh, r.ml); + + for (i = 0; i <= re; i++) + *p++ = m[i]; + *p++ = '.'; + for ( ; i < ml + 1; i++) + *p++ = m[i]; + p--; + while(*p == '0') p--; + if (*p == '.') p--; + *++p = '\0'; + + return p; + } + + if ((re < 0) && (re >= -ml - 1)) + { + sprintf(fmt, "%%.1X%%.8lX%%.%dlX", ml - 8); + sprintf(m, fmt, r.m, r.mh, r.ml); + + for (i = ml; m[i] == '0'; i--) ; + + if (-re <= ml - i + 1) + { + if (r.s >= 5) + *p++ = '-'; + + *p++ = '.'; + + for (i = 1; i < -re; i++) + *p++ = '0'; + + for (i = 0; i < ml + 1; i++) + *p++ = m[i]; + p--; + while(*p == '0') p--; + *++p = '\0'; + + return p; + } + } + + sprintf(fmt, "%%s%%X.%%.8lX%%.%dlX", ml - 8); + sprintf(p, fmt, (r.s >= 5) ? "-" : "", r.m, r.mh, r.ml); + + p += strlen(p) - 1; + + while(*p == '0') p--; + *++p = '\0'; + + if (re) + { + sprintf(p, "E%ld", re); + p += strlen(p); + *p = '\0'; + } + + return p; +} + +char * +#ifdef __FunctionProto__ +dec_real(word_20 *addr, char *string) +#else +dec_real(addr, string) +word_20 *addr; +char *string; +#endif +{ + return real_number(addr, string, 11, 3); +} + +char * +#ifdef __FunctionProto__ +dec_long_real(word_20 *addr, char *string) +#else +dec_long_real(addr, string) +word_20 *addr; +char *string; +#endif +{ + return real_number(addr, string, 14, 5); +} + +char * +#ifdef __FunctionProto__ +dec_complex(word_20 *addr, char *string) +#else +dec_complex(addr, string) +word_20 *addr; +char *string; +#endif +{ + char *p = string; + + *p++ = '('; + p = real_number(addr, p, 11, 3); + *p++ = ','; + p = real_number(addr, p, 11, 3); + *p++ = ')'; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_long_complex(word_20 *addr, char *string) +#else +dec_long_complex(addr, string) +word_20 *addr; +char *string; +#endif +{ + char *p = string; + + *p++ = '('; + p = real_number(addr, p, 14, 5); + *p++ = ','; + p = real_number(addr, p, 14, 5); + *p++ = ')'; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_string(word_20 *addr, char *string) +#else +dec_string(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 len; + unsigned char c; + char *p = string; + int i, n; + + len = read_nibbles(*addr, 5); + *addr += 5; + len -= 5; + len /= 2; + + n = len; + if (len > 1000) + n = 1000; + + *p++ = '\"'; + for (i = 0; i < n; i++) + { + c = read_nibbles(*addr, 2); + *addr += 2; + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + } + + if (n != len) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } + + *p++ = '\"'; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_hex_string(word_20 *addr, char *string) +#else +dec_hex_string(addr, string) +word_20 *addr; +char *string; +#endif +{ + int len, lead, i, n; + static char hex[] = "0123456789ABCDEF"; + char *p = string; + + len = read_nibbles(*addr, 5); + *addr += 5; + len -= 5; + + if (len <= 16) + { + *p++ = '#'; + *p++ = ' '; + lead = 1; + for (i = len - 1; i >= 0; i--) + { + *p = hex[read_nibble(*addr + i)]; + if (lead) + if ((i != 0) && (*p == '0')) + p--; + else + lead = 0; + p++; + } + + *p++ = 'h'; + } + else + { + *p++ = 'C'; + *p++ = '#'; + *p++ = ' '; + + sprintf(p, "%d", len); + p += strlen(p); + + *p++ = ' '; + + n = len; + if (len > 1000) + n = 1000; + + for (i = 0; i < n; i++) + *p++ = hex[read_nibble(*addr + i)]; + + if (n != len) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } + } + + *addr += len; + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_list(word_20 *addr, char *string) +#else +dec_list(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 semi; + char *p = string; + + *p++ = '{'; + *p++ = ' '; + semi = read_nibbles(*addr, 5); + while (semi != SEMI) + { + p = dec_rpl_obj(addr, p); + semi = read_nibbles(*addr, 5); + if (semi != SEMI) + { + *p++ = ' '; + *p = '\0'; + } + } + *p++ = ' '; + *p++ = '}'; + *p = '\0'; + + *addr += 5; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_symb(word_20 *addr, char *string) +#else +dec_symb(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 semi; + char *p = string; + + semi = read_nibbles(*addr, 5); + *p++ = '\''; + while (semi != SEMI) + { + p = dec_rpl_obj(addr, p); + semi = read_nibbles(*addr, 5); + if (semi != SEMI) + { + *p++ = ' '; + *p = '\0'; + } + } + *addr += 5; + + *p++ = '\''; + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_unit(word_20 *addr, char *string) +#else +dec_unit(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 semi; + char *p = string; + + semi = read_nibbles(*addr, 5); + while (semi != SEMI) + { + p = dec_rpl_obj(addr, p); + semi = read_nibbles(*addr, 5); + if (semi != SEMI) + { + *p++ = ' '; + *p = '\0'; + } + } + *addr += 5; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_unit_op(word_20 *addr, char *string) +#else +dec_unit_op(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 op; + char *p = string; + + op = read_nibbles(*addr - 5, 5); + switch (op) + { + case UM_MUL: + *p++ = '*'; + break; + case UM_DIV: + *p++ = '/'; + break; + case UM_POW: + *p++ = '^'; + break; + case UM_END: + *p++ = '_'; + break; + case UM_PRE: + p--; + break; + default: + break; + } + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_library(word_20 *addr, char *string) +#else +dec_library(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 libsize, libidsize; +/* + word_20 hashoff, mesgoff, linkoff, cfgoff; + word_20 mesgloc, cfgloc; +*/ + int i, libnum; + unsigned char c; + char *p = string; + + libsize = read_nibbles(*addr, 5); + libidsize = read_nibbles(*addr + 5, 2); + libnum = read_nibbles(*addr + 2 * libidsize + 9, 3); + + sprintf(p, "Library %d: ", libnum); + p += strlen(p); + + for (i = 0; i < libidsize; i++) + { + c = read_nibbles(*addr + 2 * i + 7, 2); + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + } + + *addr += libsize; + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_library_data(word_20 *addr, char *string) +#else +dec_library_data(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 size; + char *p = string; + + size = read_nibbles(*addr, 5); + + sprintf(p, "Library Data"); + p += strlen(p); + + *addr += size; + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_acptr(word_20 *addr, char *string) +#else +dec_acptr(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 size; + char *p = string; + int i; + static char hex[] = "0123456789ABCDEF"; + + if (opt_gx) + { + size = 10; + sprintf(p, "ACPTR "); + p += strlen(p); + for (i = 0; i < 5; i++) + *p++ = hex[read_nibble(*addr + i)]; + *p++ = ' '; + for (i = 5; i < 10; i++) + *p++ = hex[read_nibble(*addr + i)]; + } + else + { + size = read_nibbles(*addr, 5); + sprintf(p, "Ext 1"); + p += strlen(p); + } + + *addr += size; + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_prog(word_20 *addr, char *string) +#else +dec_prog(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 semi; + char *p = string; + + semi = read_nibbles(*addr, 5); + while (semi != SEMI) + { + p = dec_rpl_obj(addr, p); + semi = read_nibbles(*addr, 5); + if (semi != SEMI) + { + *p++ = ' '; + *p = '\0'; + } + } + *addr += 5; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_code(word_20 *addr, char *string) +#else +dec_code(addr, string) +word_20 *addr; +char *string; +#endif +{ + char *p = string; + word_20 n, len; + + len = read_nibbles(*addr, 5); + sprintf(p, "Code"); + p += strlen(p); + + n = 0; + while (n < len) + { +/* + *addr = disassemble(*addr, p); +*/ + n += len; + } + + *addr += len; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_local_ident(word_20 *addr, char *string) +#else +dec_local_ident(addr, string) +word_20 *addr; +char *string; +#endif +{ + int len, i, n; + char *p = string; + unsigned char c; + + len = read_nibbles(*addr, 2); + *addr += 2; + + n = len; + if (len > 1000) + n = 1000; + + for (i = 0; i < n; i++) + { + c = read_nibbles(*addr, 2); + *addr += 2; + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + } + + if (n != len) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_global_ident(word_20 *addr, char *string) +#else +dec_global_ident(addr, string) +word_20 *addr; +char *string; +#endif +{ + int len, i, n; + char *p = string; + unsigned char c; + + len = read_nibbles(*addr, 2); + *addr += 2; + + n = len; + if (len > 1000) + n = 1000; + + for (i = 0; i < n; i++) + { + c = read_nibbles(*addr, 2); + *addr += 2; + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + } + + if (n != len) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +xlib_name(int lib, int command, char *string) +#else +xlib_name(lib, command, string) +int lib; +int command; +char *string; +#endif +{ + int n, len; + int i, lib_n = 0; + unsigned char c; + word_20 romptab, acptr; + word_20 offset, hash_end; + word_20 lib_addr, name_addr; + word_20 type, ram_base, ram_mask; + short present = 0; + char *p = string; + + /* + * Configure RAM to address 0x70000 + */ + ram_base = saturn.mem_cntl[1].config[0]; + ram_mask = saturn.mem_cntl[1].config[1]; + if (opt_gx) + { + saturn.mem_cntl[1].config[0] = 0x80000; + saturn.mem_cntl[1].config[1] = 0xc0000; + romptab = ROMPTAB_GX; + } + else + { + saturn.mem_cntl[1].config[0] = 0x70000; + saturn.mem_cntl[1].config[1] = 0xf0000; + romptab = ROMPTAB_SX; + } + + /* + * look up number of installed libs in romptab + */ + n = read_nibbles(romptab, 3); + romptab += 3; + + if (n > 0) + { + /* + * look up lib number in romptab + */ + while (n--) + { + lib_n = read_nibbles(romptab, 3); + romptab += 3; + if (lib_n == lib) + break; + romptab += 5; + if (opt_gx) + romptab += 8; + } + if (lib_n == lib) + { + /* + * look at hash table pointer + */ + lib_addr = read_nibbles(romptab, 5); + if (opt_gx) + { + romptab += 5; + acptr = read_nibbles(romptab, 5); + if (acptr != 0x00000) + { + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; + sprintf(p, "XLIB %d %d", lib, command); + p += strlen(p); + return p; + } + } + lib_addr += 3; + offset = read_nibbles(lib_addr, 5); + if (offset > 0) + { + /* + * look at the hash table + */ + lib_addr += offset; + + /* + * check if library is in ROM + */ + if (!opt_gx) + if (lib_addr < 0x70000) + saturn.mem_cntl[1].config[0] = 0xf0000; + + /* + * check pointer type + */ + type = read_nibbles(lib_addr, 5); + if (type == DOBINT) + { + /* + * follow pointer to real address + */ + lib_addr += 5; + lib_addr = read_nibbles(lib_addr, 5); + } + else if (type == DOACPTR) + { + /* + * follow pointer to real address + */ + lib_addr += 5; + acptr = lib_addr + 5; + lib_addr = read_nibbles(lib_addr, 5); + acptr = read_nibbles(acptr, 5); + if (acptr != 0x00000) + { + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; + sprintf(p, "XLIB %d %d", lib, command); + p += strlen(p); + return p; + } + } + + /* + * get length of hash table + */ + lib_addr += 5; + hash_end = read_nibbles(lib_addr, 5); + hash_end += lib_addr; + + /* + * go into real name table + */ + lib_addr += 85; + offset = read_nibbles(lib_addr, 5); + lib_addr += offset; + + /* + * look at library name number 'command' + */ + offset = 5 * command; + lib_addr += offset; + if (lib_addr < hash_end) + { + offset = read_nibbles(lib_addr, 5); + if (offset > 0) + { + name_addr = lib_addr - offset; + len = read_nibbles(name_addr, 2); + name_addr += 2; + present = 1; + for (i = 0; i < len; i++) + { + c = read_nibbles(name_addr, 2); + name_addr += 2; + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + } + *p = '\0'; + } + } + } + } + } + + /* + * Reconfigure RAM + */ + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; + + if (!present) + { + sprintf(p, "XLIB %d %d", lib, command); + p += strlen(p); + } + return p; +} + +char * +#ifdef __FunctionProto__ +dec_xlib_name(word_20 *addr, char *string) +#else +dec_xlib_name(addr, string) +word_20 *addr; +char *string; +#endif +{ + int lib, command; + + lib = read_nibbles(*addr, 3); + *addr += 3; + command = read_nibbles(*addr, 3); + *addr += 3; + + return xlib_name(lib, command, string); +} + +char * +#ifdef __FunctionProto__ +any_array(word_20 *addr, char *string, short lnk_flag) +#else +any_array(addr, string, lnk_flag) +word_20 *addr; +char *string; +short lnk_flag; +#endif +{ + word_20 len, type, dim; + word_20 *dim_lens, *dims; + word_20 array_addr, elem_addr; + long elems; + int d, i; + char *p = string; + struct objfunc *op; + + array_addr = *addr; + len = read_nibbles(*addr, 5); + *addr += 5; + type = read_nibbles(*addr, 5); + *addr += 5; + dim = read_nibbles(*addr, 5); + *addr += 5; + + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == type) + break; + } + + dim_lens = (word_20 *)malloc(dim * sizeof(word_20)); + dims = (word_20 *)malloc(dim * sizeof(word_20)); + elems = 1; + for (i = 0; i < dim; i++) + { + dim_lens[i] = read_nibbles(*addr, 5); + dims[i] = dim_lens[i]; + elems *= dim_lens[i]; + *addr += 5; + } + + if (op->prolog == 0) + { + sprintf(p, "of Type %.5lX, Dim %ld, Size ", type, (long)dim); + p += strlen(p); + for (i = 0; i < dim; i++) + { + sprintf(p, "%ld", (long)dim_lens[i]); + p += strlen(p); + if (i < dim - 1) + { + sprintf(p, " x "); + p += strlen(p); + } + } + *p = '\0'; + *addr = array_addr + len; + free(dim_lens); + free(dims); + return p; + } + + d = -1; + while (elems--) + { + if (d < dim - 1) + { + for ( ; d < dim - 1; d++) + { + *p++ = '['; + } + d = dim - 1; + } + if (lnk_flag) + { + elem_addr = read_nibbles(*addr, 5); + elem_addr += *addr; + *addr += 5; + p = (*op->func)(&elem_addr, p); + } + else + p = (*op->func)(addr, p); + *p = '\0'; + dims[d]--; + if (dims[d]) + *p++ = ' '; + while (dims[d] == 0) + { + dims[d] = dim_lens[d]; + d--; + dims[d]--; + *p++ = ']'; + } + } + + free(dim_lens); + free(dims); + *addr = array_addr + len; + + *p = '\0'; + return p; +} + +char * +#ifdef __FunctionProto__ +dec_array(word_20 *addr, char *string) +#else +dec_array(addr, string) +word_20 *addr; +char *string; +#endif +{ + return any_array(addr, string, 0); +} + +char * +#ifdef __FunctionProto__ +dec_lnk_array(word_20 *addr, char *string) +#else +dec_lnk_array(addr, string) +word_20 *addr; +char *string; +#endif +{ + return any_array(addr, string, 1); +} + +char * +#ifdef __FunctionProto__ +dec_char(word_20 *addr, char *string) +#else +dec_char(addr, string) +word_20 *addr; +char *string; +#endif +{ + char *p = string; + unsigned char c; + + c = read_nibbles(*addr, 2); + *addr += 2; + + *p++ = '\''; + if (hp48_trans_tbl[c].trans) + { + sprintf(p, hp48_trans_tbl[c].trans); + p += strlen(p); + } + else + *p++ = c; + *p++ = '\''; + + *p = 0; + return p; +} + +short +#ifdef __FunctionProto__ +check_xlib(word_20 addr, char *string) +#else +check_xlib(addr, string) +word_20 addr; +char *string; +#endif +{ + int n, lib, command; + word_20 romptab; + word_20 offset, link_end; + word_20 acptr; + word_20 lib_addr; + word_20 type, ram_base, ram_mask; + char *p = string; + + /* + * Configure RAM to address 0x70000 + */ + ram_base = saturn.mem_cntl[1].config[0]; + ram_mask = saturn.mem_cntl[1].config[1]; + if (opt_gx) + { + saturn.mem_cntl[1].config[0] = 0x80000; + saturn.mem_cntl[1].config[1] = 0xc0000; + romptab = ROMPTAB_GX; + } + else + { + saturn.mem_cntl[1].config[0] = 0x70000; + saturn.mem_cntl[1].config[1] = 0xf0000; + romptab = ROMPTAB_SX; + } + + /* + * look up number of installed libs in romptab + */ + n = read_nibbles(romptab, 3); + romptab += 3; + +/* +LOGE( "Number of Libraries = %d\n", n); +fflush(stderr); +*/ + + if (n > 0) + { + /* + * look up lib number in romptab + */ + while (n--) + { + lib = read_nibbles(romptab, 3); + romptab += 3; +/* +LOGE( "Library num = %d\n", lib); +fflush(stderr); +*/ + /* + * look at link table pointer + */ + lib_addr = read_nibbles(romptab, 5); +/* +LOGE( "Library addr = %.5lx\n", lib_addr); +fflush(stderr); +*/ + romptab += 5; + + if (opt_gx) + { + acptr = read_nibbles(romptab, 5); + romptab += 8; + if (acptr != 0x00000) + continue; + } + + lib_addr += 13; + offset = read_nibbles(lib_addr, 5); + if (offset > 0) + { + /* + * look at the link table + */ + lib_addr += offset; +/* +LOGE( "Link table addr = %.5lx\n", lib_addr); +fflush(stderr); +*/ + /* + * check if library is in ROM + */ + if (!opt_gx) + if (lib_addr < 0x70000) + saturn.mem_cntl[1].config[0] = 0xf0000; + + /* + * check pointer type + */ + type = read_nibbles(lib_addr, 5); + if (type == DOBINT) + { + /* + * follow pointer to real address + */ + lib_addr += 5; + lib_addr = read_nibbles(lib_addr, 5); + } +/* +LOGE( "Link table addr (2) = %.5lx\n", lib_addr); +fflush(stderr); +*/ + /* + * get length of link table + */ + lib_addr += 5; + link_end = read_nibbles(lib_addr, 5); + link_end += lib_addr; +/* +LOGE( "Link table end = %.5lx\n", link_end); +fflush(stderr); +*/ + /* + * look at library commands + */ + lib_addr += 5; + command = 0; + while (lib_addr < link_end) + { + offset = read_nibbles(lib_addr, 5); + if (offset > 0) + { + if (addr == ((lib_addr + offset) & 0xfffff)) + { + p = xlib_name(lib, command, p); + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; + return 1; + } + } + lib_addr += 5; + command++; + } + if (opt_gx) + saturn.mem_cntl[1].config[0] = 0x80000; + else + saturn.mem_cntl[1].config[0] = 0x70000; + } + } + } + + /* + * Reconfigure RAM + */ + saturn.mem_cntl[1].config[0] = ram_base; + saturn.mem_cntl[1].config[1] = ram_mask; + + return 0; +} + + +char * +#ifdef __FunctionProto__ +dec_rpl_obj(word_20 *addr, char *string) +#else +dec_rpl_obj(addr, string) +word_20 *addr; +char *string; +#endif +{ + word_20 prolog = 0; + word_20 prolog_2; + char *p = string; + char tmp_str[80]; + struct objfunc *op; + + prolog = read_nibbles(*addr, 5); + + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == prolog) + break; + } + + if (op->prolog == 0) + { + if (check_xlib(prolog, tmp_str)) + { + p = append_str(p, tmp_str); + } + else + { + prolog_2 = read_nibbles(prolog, 5); + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == prolog_2) + break; + } + if (op->prolog) + p = dec_rpl_obj(&prolog, p); + else + p = append_str(p, "External"); + } + *addr += 5; + return p; + } + + *addr += 5; + p = (*op->func)(addr, p); + + return p; +} + +void +#ifdef __FunctionProto__ +decode_rpl_obj_2(word_20 addr, char *typ, char *dat) +#else +decode_rpl_obj_2(addr, typ, dat) +word_20 addr; +char *typ; +char *dat; +#endif +{ + word_20 prolog = 0; + int len; + char tmp_str[80]; + struct objfunc *op; + + typ[0] = '\0'; + dat[0] = '\0'; + + prolog = read_nibbles(addr, 5); + + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == prolog) + break; + } + + if (op->prolog == 0) + { + if (addr == SEMI) + { + append_str(typ, "Primitive Code"); + append_str(dat, "SEMI"); + } + else if (addr + 5 == prolog) + { + append_str(typ, "Primitive Code"); + sprintf(dat, "at %.5lX", prolog); + } + else + { + append_str(typ, "PTR"); + sprintf(dat, "%.5lX", prolog); + } + return; + } + + if (op->prolog == DOCOL) + { + if (check_xlib(addr, tmp_str)) + { + append_str(typ, "XLib Call"); + append_str(dat, tmp_str); + return; + } + } + + if (op->length) + { + len = (read_nibbles(addr + 5, 5) - 5) / op->length; + sprintf(typ, "%s %d", op->name, len); + } + else + { + append_str(typ, op->name); + } + + addr += 5; + (*op->func)(&addr, dat); + + return; +} + +char * +#ifdef __FunctionProto__ +decode_rpl_obj(word_20 addr, char *buf) +#else +decode_rpl_obj(addr, buf) +word_20 addr; +char *buf; +#endif +{ + word_20 prolog = 0; + int len; + char *p = buf; + char tmp_str[80]; + struct objfunc *op; + + prolog = read_nibbles(addr, 5); + + for (op = objects; op->prolog != 0; op++) + { + if (op->prolog == prolog) + break; + } + + if (op->prolog == 0) + { + if (addr == SEMI) + { + p = append_str(buf, "Primitive Code"); + p = append_tab_16(buf); + p = append_str(p, "SEMI"); + } + else if (addr + 5 == prolog) + { + p = append_str(buf, "Primitive Code"); + p = append_tab_16(buf); + sprintf(p, "at %.5lX", prolog); + p += strlen(p); + *p = '\0'; + } + else + { + p = append_str(buf, "PTR"); + p = append_tab_16(buf); + sprintf(p, "%.5lX", prolog); + p += strlen(p); + *p = '\0'; + } + return p; + } + + if (op->prolog == DOCOL) + { + if (check_xlib(addr, tmp_str)) + { + p = append_str(buf, "XLib Call"); + p = append_tab_16(buf); + p = append_str(p, tmp_str); + return p; + } + } + + p = append_str(buf, op->name); + + if (op->length) + { + len = (read_nibbles(addr + 5, 5) - 5) / op->length; + sprintf(p, " %d", len); + p += strlen(p); + } + + p = append_tab_16(buf); + addr += 5; + p = (*op->func)(&addr, p); + + return p; +} + diff --git a/jni/rpl.h b/jni/rpl.h new file mode 100644 index 0000000..74ab3b2 --- /dev/null +++ b/jni/rpl.h @@ -0,0 +1,140 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: rpl.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * more functions added + * + * Revision 1.2 1994/12/07 20:16:41 ecd + * more functions added + * + * Revision 1.1 1994/12/07 10:16:15 ecd + * Initial revision + * + * + * $Id: rpl.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _RPL_H +#define _RPL_H 1 + +#include "global.h" +#include "hp48.h" + +/* + * Addresses in SX ROM + */ +#define ROMPTAB_SX 0x707d9 +#define ROMPTAB_GX 0x809a3 + +#define TEMPOB 0x806E9 +#define TEMPTOP 0x806EE +#define RSKTOP 0x806F3 +#define DSKTOP 0x806F8 +#define AVMEM 0x807ED +#define INTRPPTR 0x8072F +#define SYSTEMFLAGS 0x80843 +/* + * Object Prologs + */ +#define DOBINT 0x02911 /* System Binary */ +#define DOREAL 0x02933 /* Real */ +#define DOEREL 0x02955 /* Extended Real */ +#define DOEREAL 0x02955 /* Extended Real */ +#define DOCMP 0x02977 /* Complex */ +#define DOECMP 0x0299d /* Extended Complex */ +#define DOCHAR 0x029bf /* Character */ +#define DOARRY 0x029e8 /* Array */ +#define DOLNKARRY 0x02a0a /* Linked Array */ +#define DOCSTR 0x02a2c /* String */ +#define DOHSTR 0x02a4e /* Binary Integer */ +#define DOLIST 0x02a74 /* List */ +#define DORRP 0x02a96 /* Directory */ +#define DOSYMB 0x02ab8 /* Algebraic */ +#define DOEXT 0x02ada /* Unit */ +#define DOTAG 0x02afc /* Tagged */ +#define DOGROB 0x02b1e /* Graphic Object */ +#define DOLIB 0x02b40 /* Library */ +#define DOBAK 0x02b62 /* Backup */ +#define DOEXT0 0x02b88 /* Library Data */ +#define DOACPTR 0x02baa /* */ +#define DOEXT1 0x02BAA /* Extended Pointer */ +#define DOEXT2 0x02bcc /* */ +#define DOEXT3 0x02bee /* */ +#define DOEXT4 0x02c10 /* */ +#define DOCOL 0x02d9d /* Program */ +#define DOCODE 0x02dcc /* Code */ +#define DOIDNT 0x02e48 /* Global Name */ +#define DOLAM 0x02e6d /* Local Name */ +#define DOROMP 0x02e92 /* XLib Name */ + +/* + * Terminates composite objects + */ +#define SEMI 0x0312b /* Semi */ + +/* + * Unit Operators + */ +#define UM_MUL 0x10b5e /* Unit Operator * */ +#define UM_DIV 0x10b68 /* Unit Operator / */ +#define UM_POW 0x10b72 /* Unit Operator ^ */ +#define UM_PRE 0x10b7c /* Unit Operator prefix */ +#define UM_END 0x10b86 /* Unit Operator _ */ + +typedef struct hp_real { + word_20 x; + word_32 ml; + word_32 mh; + word_4 m; + word_1 s; +} hp_real; + +extern char *decode_rpl_obj __ProtoType__((word_20 addr, char *buf)); +extern void decode_rpl_obj_2 __ProtoType__((word_20 addr, char *typ, char *dat)); + +extern char *skip_ob __ProtoType__((word_20 *addr, char *string)); +extern char *dec_rpl_obj __ProtoType__((word_20 *addr, char *string)); +extern char *dec_bin_int __ProtoType__((word_20 *addr, char *string)); +extern char *dec_real __ProtoType__((word_20 *addr, char *string)); +extern char *dec_long_real __ProtoType__((word_20 *addr, char *string)); +extern char *dec_complex __ProtoType__((word_20 *addr, char *string)); +extern char *dec_long_complex __ProtoType__((word_20 *addr, char *string)); +extern char *dec_char __ProtoType__((word_20 *addr, char *string)); +extern char *dec_array __ProtoType__((word_20 *addr, char *string)); +extern char *dec_lnk_array __ProtoType__((word_20 *addr, char *string)); +extern char *dec_string __ProtoType__((word_20 *addr, char *string)); +extern char *dec_hex_string __ProtoType__((word_20 *addr, char *string)); +extern char *dec_list __ProtoType__((word_20 *addr, char *string)); +extern char *dec_symb __ProtoType__((word_20 *addr, char *string)); +extern char *dec_unit __ProtoType__((word_20 *addr, char *string)); +extern char *dec_library __ProtoType__((word_20 *addr, char *string)); +extern char *dec_library_data __ProtoType__((word_20 *addr, char *string)); +extern char *dec_acptr __ProtoType__((word_20 *addr, char *string)); +extern char *dec_prog __ProtoType__((word_20 *addr, char *string)); +extern char *dec_code __ProtoType__((word_20 *addr, char *string)); +extern char *dec_global_ident __ProtoType__((word_20 *addr, char *string)); +extern char *dec_local_ident __ProtoType__((word_20 *addr, char *string)); +extern char *dec_xlib_name __ProtoType__((word_20 *addr, char *string)); +extern char *dec_unit_op __ProtoType__((word_20 *addr, char *string)); + +#endif /* !_RPL_H */ diff --git a/jni/serial.c b/jni/serial.c new file mode 100644 index 0000000..cca9d54 --- /dev/null +++ b/jni/serial.c @@ -0,0 +1,726 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: serial.c,v $ + * Revision 1.11 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.10 1994/12/07 20:20:50 ecd + * complete change in handling of serial line, + * lines can be turned off now + * + * Revision 1.10 1994/12/07 20:20:50 ecd + * complete change in handling of serial line, + * lines can be turned off now + * + * Revision 1.9 1994/11/28 02:00:51 ecd + * added support for drawing the connections in the window title + * + * Revision 1.8 1994/11/02 14:44:28 ecd + * support for HPUX added + * + * Revision 1.7 1994/10/06 16:30:05 ecd + * new init for IRIX + * added CREAD for serial line + * + * Revision 1.6 1994/10/05 08:49:59 ecd + * changed printf() to print the correct /dev/ttyp? + * + * Revision 1.5 1994/09/30 12:37:09 ecd + * check if serial device is opened by OPENIO + * + * Revision 1.4 1994/09/18 15:29:22 ecd + * turned off unused rcsid message + * + * Revision 1.3 1994/09/13 16:57:00 ecd + * changed to plain X11 + * + * Revision 1.2 1994/08/31 18:23:21 ecd + * changed IR and wire definitions. + * + * Revision 1.1 1994/08/26 11:09:02 ecd + * Initial revision + * + * $Id: serial.c,v 1.11 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#include +#include +#include +#include +#include +#include +#if defined(HPUX) || defined(CSRG_BASED) +# include +#endif +#include +#include +#ifdef SOLARIS +# include +# include +# include +#endif + +#include "hp48.h" +#include "device.h" +#include "hp48_emu.h" +#include "resources.h" + +static int wire_fd; +static int ir_fd; +static int ttyp; + +extern int rece_instr; + +static char *wire_name = (char *)0; +static char *ir_name = (char *)0; + +/* #define DEBUG_SERIAL */ + +void +#ifdef __FunctionProto__ +update_connection_display(void) +#else +update_connection_display() +#endif +{ + if (wire_fd == -1) + { + if (wire_name) free(wire_name); + wire_name = (char *)0; + } + if (ir_fd == -1) + { + if (ir_name) free(ir_name); + ir_name = (char *)0; + } + ShowConnections(wire_name, ir_name); +} + +int +#ifdef __FunctionProto__ +serial_init(void) +#else +serial_init() +#endif +{ + char *p; + int c; + int n; + char tty_dev_name[128]; + struct termios ttybuf; + + wire_fd = -1; + ttyp = -1; + if (useTerminal) + { +#if defined(IRIX) + if ((p = _getpty(&wire_fd, O_RDWR | O_EXCL | O_NDELAY, 0666, 0)) == NULL) + { + wire_fd = -1; + ttyp = -1; + } + else + { + if ((ttyp = open(p, O_RDWR | O_NDELAY, 0666)) < 0) + { + close(wire_fd); + wire_fd = -1; + ttyp = -1; + } + else + { + if (verbose) + printf("%s: wire connection on %s\n", progname, p); + wire_name = strdup(p); + } + } +#elif defined(SOLARIS) + if ((wire_fd = open("/dev/ptmx", O_RDWR | O_NONBLOCK, 0666)) >= 0) + { + grantpt(wire_fd); + unlockpt(wire_fd); + p = ptsname(wire_fd); + strcpy(tty_dev_name, p); + if ((ttyp = open(tty_dev_name, O_RDWR | O_NDELAY, 0666)) >= 0) + { + ioctl(ttyp, I_PUSH, "ptem"); + ioctl(ttyp, I_PUSH, "ldterm"); + if (verbose) + printf("%s: wire connection on %s\n", progname, + tty_dev_name); + wire_name = strdup(tty_dev_name); + } + } +#elif defined(LINUX) + /* Unix98 PTY (Preferred) */ + if ((wire_fd = open("/dev/ptmx", O_RDWR | O_NONBLOCK, 0666)) >= 0) + { + grantpt(wire_fd); + unlockpt(wire_fd); + if (ptsname_r(wire_fd, tty_dev_name, 128)) { + perror("Could not get the name of the wire device."); + exit(-1); + } + if ((ttyp = open(tty_dev_name, O_RDWR | O_NDELAY, 0666)) >= 0) + { + if (verbose) + printf("%s: wire connection on %s\n", progname, + tty_dev_name); + wire_name = strdup(tty_dev_name); + } + } + /* BSD PTY (Legacy) */ + else + { + c = 'p'; + do + { + for (n = 0; n < 16; n++) + { + sprintf(tty_dev_name, "/dev/pty%c%x", c, n); + if ((wire_fd = open(tty_dev_name, + O_RDWR | O_EXCL | O_NDELAY, 0666)) >= 0) + { + ttyp = wire_fd; + sprintf(tty_dev_name, "/dev/tty%c%x", c, n); + if (verbose) + printf("%s: wire connection on %s\n", progname, + tty_dev_name); + wire_name = strdup(tty_dev_name); + break; + } + } + c++; + } + while ((wire_fd < 0) && (errno != ENOENT)); + } +#else + /* + * Here we go for SUNOS, HPUX + */ + c = 'p'; + do + { + for (n = 0; n < 16; n++) + { + sprintf(tty_dev_name, "/dev/ptyp%x", n); + if ((wire_fd = open(tty_dev_name, + O_RDWR | O_EXCL | O_NDELAY, 0666)) >= 0) + { + sprintf(tty_dev_name, "/dev/tty%c%x", c, n); + if ((ttyp = open(tty_dev_name, O_RDWR | O_NDELAY, 0666)) < 0) + { + wire_fd = -1; + ttyp = -1; + } + else + { + if (verbose) + printf("%s: wire connection on %s\n", progname, + tty_dev_name); + wire_name = strdup(tty_dev_name); + break; + } + } + } + c++; + } + while ((wire_fd < 0) && (errno != ENOENT)); +#endif + } + + if (ttyp >= 0) + { +#if defined(TCSANOW) + if (tcgetattr(ttyp, &ttybuf) < 0) +#else + if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(wire, TCGETS) failed, errno = %d\n", + progname, errno); + wire_fd = -1; + ttyp = -1; + } + } + + ttybuf.c_lflag = 0; + ttybuf.c_iflag = 0; + ttybuf.c_oflag = 0; + ttybuf.c_cflag = B9600 | CS8 | CLOCAL | CREAD; + for (n = 0; n < NCCS; n++) + ttybuf.c_cc[n] = 0; + ttybuf.c_cc[VTIME] = 0; + ttybuf.c_cc[VMIN] = 1; + + if (ttyp >= 0) + { +#if defined(TCSANOW) + if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0) +#else + if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(wire, TCSETS) failed, errno = %d\n", + progname, errno); + wire_fd = -1; + ttyp = -1; + } + } + + ir_fd = -1; + if (useSerial) + { + sprintf(tty_dev_name, serialLine); + if ((ir_fd = open(tty_dev_name, O_RDWR | O_NDELAY)) >= 0) + { + if (verbose) + printf("%s: IR connection on %s\n", progname, tty_dev_name); + ir_name = strdup(tty_dev_name); + } + } + + if (ir_fd >= 0) + { +#if defined(TCSANOW) + if (tcgetattr(ir_fd, &ttybuf) < 0) +#else + if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(IR, TCGETS) failed, errno = %d\n", + progname, errno); + ir_fd = -1; + } + } + + ttybuf.c_lflag = 0; + ttybuf.c_iflag = 0; + ttybuf.c_oflag = 0; + ttybuf.c_cflag = B9600 | CS8 | CLOCAL | CREAD; + for (n = 0; n < NCCS; n++) + ttybuf.c_cc[n] = 0; + ttybuf.c_cc[VTIME] = 0; + ttybuf.c_cc[VMIN] = 1; + + if (ir_fd >= 0) + { +#if defined(TCSANOW) + if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0) +#else + if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(IR, TCSETS) failed, errno = %d\n", + progname, errno); + ir_fd = -1; + } + } + update_connection_display(); + return 1; +} + +void +#ifdef __FunctionProto__ +serial_baud(int baud) +#else +serial_baud(baud) +int baud; +#endif +{ + int error = 0; + struct termios ttybuf; + + if (ir_fd >= 0) + { +#if defined(TCSANOW) + if (tcgetattr(ir_fd, &ttybuf) < 0) +#else + if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(IR, TCGETS) failed, errno = %d\n", + progname, errno); + ir_fd = -1; + error = 1; + } + } + +#if defined(__APPLE__) + baud &= 0x7; + switch (baud) + { + case 0: /* 1200 */ + ttybuf.c_cflag |= B1200; + break; + case 1: /* 1920 */ +# ifdef B1920 + ttybuf.c_cflag |= B1920; +# endif + break; + case 2: /* 2400 */ + ttybuf.c_cflag |= B2400; + break; + case 3: /* 3840 */ +# ifdef B3840 + ttybuf.c_cflag |= B3840; +# endif + break; + case 4: /* 4800 */ + ttybuf.c_cflag |= B4800; + break; + case 5: /* 7680 */ +# ifdef B7680 + ttybuf.c_cflag |= B7680; +# endif + break; + case 6: /* 9600 */ + ttybuf.c_cflag |= B9600; + break; + case 7: /* 15360 */ +# ifdef B15360 + ttybuf.c_cflag |= B15360; +# endif + break; + } + + if ((ir_fd >= 0) && ((ttybuf.c_ospeed) == 0)) + { + if (!quiet) + LOGE( "%s: can\'t set baud rate, using 9600\n", progname); + ttybuf.c_cflag |= B9600; + } +#else + ttybuf.c_cflag &= ~CBAUD; + + baud &= 0x7; + switch (baud) + { + case 0: /* 1200 */ + ttybuf.c_cflag |= B1200; + break; + case 1: /* 1920 */ +# ifdef B1920 + ttybuf.c_cflag |= B1920; +# endif + break; + case 2: /* 2400 */ + ttybuf.c_cflag |= B2400; + break; + case 3: /* 3840 */ +# ifdef B3840 + ttybuf.c_cflag |= B3840; +# endif + break; + case 4: /* 4800 */ + ttybuf.c_cflag |= B4800; + break; + case 5: /* 7680 */ +# ifdef B7680 + ttybuf.c_cflag |= B7680; +# endif + break; + case 6: /* 9600 */ + ttybuf.c_cflag |= B9600; + break; + case 7: /* 15360 */ +# ifdef B15360 + ttybuf.c_cflag |= B15360; +# endif + break; + } + + if ((ir_fd >= 0) && ((ttybuf.c_cflag & CBAUD) == 0)) + { + if (!quiet) + LOGE( "%s: can\'t set baud rate, using 9600\n", progname); + ttybuf.c_cflag |= B9600; + } +#endif + if (ir_fd >= 0) + { +#if defined(TCSANOW) + if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0) +#else + if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(IR, TCSETS) failed, errno = %d\n", + progname, errno); + ir_fd = -1; + error = 1; + } + } + + if (ttyp >= 0) + { +#if defined(TCSANOW) + if (tcgetattr(ttyp, &ttybuf) < 0) +#else + if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(wire, TCGETS) failed, errno = %d\n", + progname, errno); + wire_fd = -1; + ttyp = -1; + error = 1; + } + } + +#if defined(__APPLE__) +#else + ttybuf.c_cflag &= ~CBAUD; + + baud &= 0x7; + switch (baud) + { + case 0: /* 1200 */ + ttybuf.c_cflag |= B1200; + break; + case 1: /* 1920 */ +# ifdef B1920 + ttybuf.c_cflag |= B1920; +# endif + break; + case 2: /* 2400 */ + ttybuf.c_cflag |= B2400; + break; + case 3: /* 3840 */ +# ifdef B3840 + ttybuf.c_cflag |= B3840; +# endif + break; + case 4: /* 4800 */ + ttybuf.c_cflag |= B4800; + break; + case 5: /* 7680 */ +# ifdef B7680 + ttybuf.c_cflag |= B7680; +# endif + break; + case 6: /* 9600 */ + ttybuf.c_cflag |= B9600; + break; + case 7: /* 15360 */ +# ifdef B15360 + ttybuf.c_cflag |= B15360; +# endif + break; + } + + if ((ttyp >= 0) && ((ttybuf.c_cflag & CBAUD) == 0)) + { + if (!quiet) + LOGE( "%s: can\'t set baud rate, using 9600\n", progname); + ttybuf.c_cflag |= B9600; + } +#endif + if (ttyp >= 0) + { +#if defined(TCSANOW) + if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0) +#else + if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0) +#endif + { + if (!quiet) + LOGE( "%s: ioctl(wire, TCSETS) failed, errno = %d\n", + progname, errno); + wire_fd = -1; + ttyp = -1; + error = 1; + } + } + if (error) + update_connection_display(); +} + + +void +#ifdef __FunctionProto__ +transmit_char(void) +#else +transmit_char() +#endif +{ +#ifdef DEBUG_SERIALx + LOGE( "XMT %s\n", (saturn.ir_ctrl & 0x04) ? "IR" : "wire"); +#endif + + if (saturn.ir_ctrl & 0x04) { + if (ir_fd == -1) { + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + return; + } + } else { + if (wire_fd == -1) { + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + return; + } + } + +#ifdef DEBUG_SERIAL + if (isprint(saturn.tbr)) { + LOGE( "-> \'%c\'\n", saturn.tbr); + } else { + LOGE( "-> %x\n", saturn.tbr); + } +#endif + if (saturn.ir_ctrl & 0x04) { + if (write(ir_fd, &saturn.tbr, 1) == 1) { + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + } else { + if (errno != EAGAIN) { + LOGE( "%s: serial write error: %d\n", progname, errno); + } + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + } + } else { + if (write(wire_fd, &saturn.tbr, 1) == 1) { + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + } else { + if (errno != EAGAIN) { + if (!quiet) + LOGE( "%s: serial write error: %d\n", progname, errno); + } + saturn.tcs &= 0x0e; + if (saturn.io_ctrl & 0x04) { + do_interupt(); + } + } + } +} + +#define NR_BUFFER 256 + +void +#ifdef __FunctionProto__ +receive_char() +#else +receive_char() +#endif +{ + struct timeval tout; + fd_set rfds; + int nfd; + static unsigned char buf[NR_BUFFER + 1]; + static int nrd = 0, bp = 0; + +#ifdef DEBUG_SERIALx + LOGE( "RCV %s\n", (saturn.ir_ctrl & 0x04) ? "IR" : "wire"); +#endif + + rece_instr = 0; + + if (saturn.ir_ctrl & 0x04) { + if (ir_fd == -1) + return; + } else { + if (wire_fd == -1) + return; + } + + if (saturn.rcs & 0x01) { + return; + } + + if (nrd == 0) { + tout.tv_sec = 0; + tout.tv_usec = 0; + FD_ZERO(&rfds); + if (saturn.ir_ctrl & 0x04) { + FD_SET(ir_fd, &rfds); + nfd = ir_fd + 1; + } else { + FD_SET(wire_fd, &rfds); + nfd = wire_fd + 1; + } + if ((nfd = select(nfd, &rfds, (fd_set *)0, (fd_set *)0, &tout)) > 0) { +#ifdef DEBUG_SERIAL + LOGE( "select = %d\n", nfd); +#endif + if (saturn.ir_ctrl & 0x04) { + if (FD_ISSET(ir_fd, &rfds)) { + nrd = read(ir_fd, buf, NR_BUFFER); + if (nrd < 0) { + nrd = 0; + return; + } + bp = 0; + } else { + return; + } + } else { + if (FD_ISSET(wire_fd, &rfds)) { + nrd = read(wire_fd, buf, NR_BUFFER); + if (nrd < 0) { + nrd = 0; + return; + } + bp = 0; + } else { + return; + } + } + } else { + return; + } + } + if (nrd == 0) { + return; + } + if (!(saturn.io_ctrl & 0x08)) { + nrd = 0; + return; + } + saturn.rbr = buf[bp++]; + nrd--; + saturn.rcs |= 0x01; + if (saturn.io_ctrl & 0x02) { + do_interupt(); + } +} + diff --git a/jni/small.h b/jni/small.h new file mode 100644 index 0000000..d1868cb --- /dev/null +++ b/jni/small.h @@ -0,0 +1,574 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: small.h,v $ + * Revision 1.5 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * completed small font + * + * Revision 1.4 1994/12/07 20:16:41 ecd + * completed small font + * + * Revision 1.3 1994/11/02 14:51:27 ecd + * minor changes + * + * Revision 1.2 1994/10/06 16:28:03 ecd + * changed char to unsigned + * + * Revision 1.1 1994/09/13 15:05:11 ecd + * Initial revision + * + * + * $Id: small.h,v 1.5 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _SMALL_H +#define _SMALL_H 1 + +#define small_ascent 8 +#define small_descent 4 + +#define blank_width 4 +#define blank_height 7 +static unsigned char blank_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define hash_width 5 +#define hash_height 7 +static unsigned char hash_bits[] = { + 0x00, 0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a}; + +#define lbrace_width 3 +#define lbrace_height 7 +static unsigned char lbrace_bits[] = { + 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04}; + +#define rbrace_width 3 +#define rbrace_height 7 +static unsigned char rbrace_bits[] = { + 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01}; + +#define comma_width 3 +#define comma_height 7 +static unsigned char comma_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x03}; + +#define slash_width 3 +#define slash_height 7 +static unsigned char slash_bits[] = { + 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01}; + +#define two_width 5 +#define two_height 7 +static unsigned char two_bits[] = { + 0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f}; + +#define three_width 5 +#define three_height 7 +static unsigned char three_bits[] = { + 0x0e, 0x11, 0x10, 0x0c, 0x10, 0x11, 0x0e}; + +#define small_colon_width 2 +#define small_colon_height 7 +static unsigned char small_colon_bits[] = { + 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x00}; + +#define A_width 5 +#define A_height 7 +static unsigned char A_bits[] = { + 0x0e, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11}; + +#define B_width 5 +#define B_height 7 +static unsigned char B_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f}; + +#define C_width 5 +#define C_height 7 +static unsigned char C_bits[] = { + 0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e}; + +#define D_width 5 +#define D_height 7 +static unsigned char D_bits[] = { + 0x0f, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0f}; + +#define E_width 5 +#define E_height 7 +static unsigned char E_bits[] = { + 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f}; + +#define F_width 5 +#define F_height 7 +static unsigned char F_bits[] = { + 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01}; + +#define G_width 5 +#define G_height 7 +static unsigned char G_bits[] = { + 0x0e, 0x11, 0x01, 0x01, 0x19, 0x11, 0x0e}; + +#define H_width 5 +#define H_height 7 +static unsigned char H_bits[] = { + 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11}; + +#define I_width 1 +#define I_height 7 +static unsigned char I_bits[] = { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; + +#define J_width 4 +#define J_height 7 +static unsigned char J_bits[] = { + 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06}; + +#define K_width 5 +#define K_height 7 +static unsigned char K_bits[] = { + 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11}; + +#define L_width 4 +#define L_height 7 +static unsigned char L_bits[] = { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0f}; + +#define M_width 5 +#define M_height 7 +static unsigned char M_bits[] = { + 0x11, 0x1b, 0x15, 0x11, 0x11, 0x11, 0x11}; + +#define N_width 5 +#define N_height 7 +static unsigned char N_bits[] = { + 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11}; + +#define O_width 5 +#define O_height 7 +static unsigned char O_bits[] = { + 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e}; + +#define P_width 5 +#define P_height 7 +static unsigned char P_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01}; + +#define Q_width 5 +#define Q_height 7 +static unsigned char Q_bits[] = { + 0x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16}; + +#define R_width 5 +#define R_height 7 +static unsigned char R_bits[] = { + 0x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11}; + +#define S_width 5 +#define S_height 7 +static unsigned char S_bits[] = { + 0x0e, 0x11, 0x01, 0x0e, 0x10, 0x11, 0x0e}; + +#define T_width 5 +#define T_height 7 +static unsigned char T_bits[] = { + 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04}; + +#define U_width 5 +#define U_height 7 +static unsigned char U_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e}; + +#define V_width 5 +#define V_height 7 +static unsigned char V_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x0a, 0x0a, 0x04}; + +#define W_width 5 +#define W_height 7 +static unsigned char W_bits[] = { + 0x11, 0x11, 0x11, 0x11, 0x15, 0x1b, 0x11}; + +#define X_width 5 +#define X_height 7 +static unsigned char X_bits[] = { + 0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11}; + +#define Y_width 5 +#define Y_height 7 +static unsigned char Y_bits[] = { + 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, 0x04}; + +#define Z_width 5 +#define Z_height 7 +static unsigned char Z_bits[] = { + 0x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f}; + +#define lbracket_width 3 +#define lbracket_height 7 +static unsigned char lbracket_bits[] = { + 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07}; + +#define rbracket_width 3 +#define rbracket_height 7 +static unsigned char rbracket_bits[] = { + 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07}; + +#define arrow_width 7 +#define arrow_height 7 +static unsigned char arrow_bits[] = { + 0x00, 0x08, 0x18, 0x3f, 0x18, 0x08, 0x00}; + +#define diff_width 5 +#define diff_height 7 +static unsigned char diff_bits[] = { + 0x0e, 0x10, 0x10, 0x1e, 0x11, 0x11, 0x0e}; + +#define integral_width 5 +#define integral_height 8 +static unsigned char integral_bits[] = { + 0x0c, 0x12, 0x02, 0x04, 0x04, 0x08, 0x09, 0x06}; + +#define sigma_width 6 +#define sigma_height 9 +static unsigned char sigma_bits[] = { + 0x3f, 0x21, 0x02, 0x04, 0x08, 0x04, 0x02, 0x21, 0x3f}; + +#define sqr_width 11 +#define sqr_height 10 +static unsigned char sqr_bits[] = { + 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x26, 0x01, 0x94, 0x07, + 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, 0x21, 0x00}; + +#define root_width 18 +#define root_height 13 +static unsigned char root_bits[] = { + 0x26, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0xfe, 0x03, 0x14, 0x02, 0x02, + 0x53, 0x02, 0x00, 0x21, 0x99, 0x00, 0x00, 0x91, 0x00, 0x10, 0x91, 0x00, + 0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, + 0x00, 0x0c, 0x00}; + +#define pow10_width 13 +#define pow10_height 9 +static unsigned char pow10_bits[] = { + 0x00, 0x12, 0x00, 0x0c, 0x32, 0x04, 0x4b, 0x0a, 0x4a, 0x09, 0x4a, 0x00, + 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00}; + +#define exp_width 11 +#define exp_height 9 +static unsigned char exp_bits[] = { + 0x80, 0x04, 0x00, 0x03, 0x00, 0x01, 0x8c, 0x02, 0x52, 0x02, 0x09, 0x00, + 0x07, 0x00, 0x21, 0x00, 0x1e, 0x00}; + +#define under_width 6 +#define under_height 7 +static unsigned char under_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f}; + +#define prog_width 16 +#define prog_height 7 +static unsigned char prog_bits[] = { + 0x48, 0x12, 0x24, 0x24, 0x12, 0x48, 0x09, 0x90, 0x12, 0x48, 0x24, 0x24, + 0x48, 0x12}; + +#define string_width 10 +#define string_height 7 +static unsigned char string_bits[] = { + 0x85, 0x02, 0x85, 0x02, 0x85, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00}; + +#define equal_width 5 +#define equal_height 7 +static unsigned char equal_bits[] = { + 0x00, 0x1f, 0x00, 0x00, 0x1f, 0x00, 0x00}; + +#define nl_width 8 +#define nl_height 7 +static unsigned char nl_bits[] = { + 0x00, 0x84, 0x86, 0xff, 0x06, 0x04, 0x00}; + +#define pi_width 6 +#define pi_height 7 +static unsigned char pi_bits[] = { + 0x20, 0x1f, 0x12, 0x12, 0x12, 0x12, 0x12}; + +#define angle_width 8 +#define angle_height 7 +static unsigned char angle_bits[] = { + 0x40, 0x20, 0x10, 0x28, 0x44, 0x42, 0xff}; + +#define lcurly_width 5 +#define lcurly_height 7 +static unsigned char lcurly_bits[] = { + 0x18, 0x04, 0x04, 0x02, 0x04, 0x04, 0x18}; + +#define rcurly_width 5 +#define rcurly_height 7 +static unsigned char rcurly_bits[] = { + 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03}; + +#define sqr_gx_width 11 +#define sqr_gx_height 13 +static unsigned char sqr_gx_bits[] = { + 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, + 0x00, 0x00, 0x66, 0x00, 0x14, 0x00, 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, + 0x21, 0x00}; + +#define root_gx_width 18 +#define root_gx_height 15 +static unsigned char root_gx_bits[] = { + 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, + 0x53, 0xfe, 0x03, 0x21, 0x02, 0x02, 0x00, 0x02, 0x00, 0x00, 0x99, 0x00, + 0x00, 0x91, 0x00, 0x10, 0x91, 0x00, 0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, + 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x00}; + +#define pow10_gx_width 13 +#define pow10_gx_height 12 +static unsigned char pow10_gx_bits[] = { + 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00, + 0x4b, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00}; + +#define exp_gx_width 11 +#define exp_gx_height 11 +static unsigned char exp_gx_bits[] = { + 0x80, 0x04, 0x00, 0x03, 0x00, 0x01, 0x80, 0x02, 0x40, 0x02, 0x0c, 0x00, + 0x12, 0x00, 0x09, 0x00, 0x07, 0x00, 0x21, 0x00, 0x1e, 0x00}; + +#define parens_gx_width 20 +#define parens_gx_height 12 +static unsigned char parens_gx_bits[] = { + 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c, + 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, + 0x03, 0x00, 0x0c, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x0c, 0x00, 0x03}; + +#define hash_gx_width 8 +#define hash_gx_height 12 +static unsigned char hash_gx_bits[] = { + 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00}; + +#define bracket_gx_width 12 +#define bracket_gx_height 12 +static unsigned char bracket_gx_bits[] = { + 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, + 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x0f, 0x0f}; + +#define under_gx_width 10 +#define under_gx_height 12 +static unsigned char under_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03}; + +#define prog_gx_width 24 +#define prog_gx_height 12 +static unsigned char prog_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18, + 0x8c, 0x81, 0x31, 0xc6, 0x00, 0x63, 0x63, 0x00, 0xc6, 0xc6, 0x00, 0x63, + 0x8c, 0x81, 0x31, 0x18, 0xc3, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define quote_gx_width 12 +#define quote_gx_height 12 +static unsigned char quote_gx_bits[] = { + 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define curly_gx_width 14 +#define curly_gx_height 12 +static unsigned char curly_gx_bits[] = { + 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30, + 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x0c, 0x0c}; + +#define colon_gx_width 8 +#define colon_gx_height 12 +static unsigned char colon_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00}; + +#define angle_gx_width 12 +#define angle_gx_height 12 +static unsigned char angle_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01, + 0xb0, 0x03, 0x18, 0x03, 0x0c, 0x03, 0x06, 0x03, 0xff, 0x0f, 0xff, 0x0f}; + +#define pi_gx_width 10 +#define pi_gx_height 12 +static unsigned char pi_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01, + 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00}; + +#define nl_gx_width 18 +#define nl_gx_height 12 +static unsigned char nl_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03, + 0xfc, 0x00, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define comma_gx_width 3 +#define comma_gx_height 12 +static unsigned char comma_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02}; + +#define arrow_gx_width 18 +#define arrow_gx_height 12 +static unsigned char arrow_gx_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0xfc, 0x00, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define equal_gx_width 8 +#define equal_gx_height 12 +static unsigned char equal_gx_bits[] = { + 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00}; + +typedef struct letter_t { + unsigned int w, h; + unsigned char *bits; +} letter_t; + +letter_t small_font[] = { + { 0, 0, 0 }, + { nl_gx_width, nl_gx_height, nl_gx_bits }, /* \001 == \n gx */ + { comma_gx_width, comma_gx_height, comma_gx_bits }, /* \002 == comma gx */ + { arrow_gx_width, arrow_gx_height, arrow_gx_bits }, /* \003 == \-> gx */ + { equal_gx_width, equal_gx_height, equal_gx_bits }, /* \004 == equal gx */ + { pi_gx_width, pi_gx_height, pi_gx_bits }, /* \005 == pi gx */ + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, /* # 16 */ + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { blank_width, blank_height, blank_bits }, /* # 32 */ + { 0, 0, 0 }, + { 0, 0, 0 }, + { hash_width, hash_height, hash_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { lbrace_width, lbrace_height, lbrace_bits }, + { rbrace_width, rbrace_height, rbrace_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { comma_width, comma_height, comma_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { slash_width, slash_height, slash_bits }, + { 0, 0, 0 }, /* # 48 */ + { 0, 0, 0 }, + { two_width, two_height, two_bits }, + { three_width, three_height, three_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { small_colon_width, small_colon_height, small_colon_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { equal_width, equal_height, equal_bits }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, /* # 64 */ + { A_width, A_height, A_bits }, + { B_width, B_height, B_bits }, + { C_width, C_height, C_bits }, + { D_width, D_height, D_bits }, + { E_width, E_height, E_bits }, + { F_width, F_height, F_bits }, + { G_width, G_height, G_bits }, + { H_width, H_height, H_bits }, + { I_width, I_height, I_bits }, + { J_width, J_height, J_bits }, + { K_width, K_height, K_bits }, + { L_width, L_height, L_bits }, + { M_width, M_height, M_bits }, + { N_width, N_height, N_bits }, + { O_width, O_height, O_bits }, + { P_width, P_height, P_bits }, /* # 80 */ + { Q_width, Q_height, Q_bits }, + { R_width, R_height, R_bits }, + { S_width, S_height, S_bits }, + { T_width, T_height, T_bits }, + { U_width, U_height, U_bits }, + { V_width, V_height, V_bits }, + { W_width, W_height, W_bits }, + { X_width, X_height, X_bits }, + { Y_width, Y_height, Y_bits }, + { Z_width, Z_height, Z_bits }, + { lbracket_width, lbracket_height, lbracket_bits }, + { 0, 0, 0 }, + { rbracket_width, rbracket_height, rbracket_bits }, + { 0, 0, 0 }, + { under_width, under_height, under_bits }, + { 0, 0, 0 }, /* # 96 */ + { arrow_width, arrow_height, arrow_bits }, /* a == left arrow */ + { diff_width, diff_height, diff_bits }, /* b == differential */ + { integral_width, integral_height, integral_bits }, /* c == integral */ + { sigma_width, sigma_height, sigma_bits }, /* d == sigma */ + { sqr_width, sqr_height, sqr_bits }, /* e == sqr */ + { root_width, root_height, root_bits }, /* f == root */ + { pow10_width, pow10_height, pow10_bits }, /* g == pow10 */ + { exp_width, exp_height, exp_bits }, /* h == exp */ + { prog_width, prog_height, prog_bits }, /* i == << >> */ + { string_width, string_height, string_bits }, /* j == " " */ + { nl_width, nl_height, nl_bits }, /* k == New Line */ + { pi_width, pi_height, pi_bits }, /* l == pi */ + { angle_width, angle_height, angle_bits }, /* m == angle */ + { sqr_gx_width, sqr_gx_height, sqr_gx_bits }, /* n == sqr gx */ + { root_gx_width, root_gx_height, root_gx_bits }, /* o == root gx */ + { pow10_gx_width, pow10_gx_height, pow10_gx_bits }, /* p == pow10 gx */ + { exp_gx_width, exp_gx_height, exp_gx_bits }, /* q == exp gx */ + { parens_gx_width, parens_gx_height, parens_gx_bits },/* r == ( ) gx */ + { hash_gx_width, hash_gx_height, hash_gx_bits }, /* s == # gx */ + { bracket_gx_width, bracket_gx_height, bracket_gx_bits }, /* t == [] gx */ + { under_gx_width, under_gx_height, under_gx_bits }, /* u == _ gx */ + { prog_gx_width, prog_gx_height, prog_gx_bits }, /* v == << >> gx */ + { quote_gx_width, quote_gx_height, quote_gx_bits }, /* w == " " gx */ + { curly_gx_width, curly_gx_height, curly_gx_bits }, /* x == {} gx */ + { colon_gx_width, colon_gx_height, colon_gx_bits }, /* y == :: gx */ + { angle_gx_width, angle_gx_height, angle_gx_bits }, /* z == angle gx */ + { lcurly_width, lcurly_height, lcurly_bits }, + { 0, 0, 0 }, + { rcurly_width, rcurly_height, rcurly_bits }, + { 0, 0, 0 }, + { 0, 0, 0 } +}; + +#endif /* !_SMALL_H */ diff --git a/jni/timer.c b/jni/timer.c new file mode 100644 index 0000000..8958a38 --- /dev/null +++ b/jni/timer.c @@ -0,0 +1,722 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: timer.c,v $ + * Revision 1.7 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.6 1994/12/07 20:20:50 ecd + * minor fix + * + * Revision 1.6 1994/12/07 20:20:50 ecd + * minor fix + * + * Revision 1.5 1994/11/28 02:00:51 ecd + * removed stupid bug that caused negative time on call + * to adjtime() + * + * Revision 1.4 1994/11/02 14:44:28 ecd + * real time support completed + * + * + * $Id: timer.c,v 1.7 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#include "global.h" + +#include +#include +#include +#include + +#include "timer.h" +#include "debugger.h" +#include "romio.h" + +/* #define DEBUG_TIMER 1 */ +/* #define DEBUG_TIMER_ADJUST 1 */ + +#ifdef SOLARIS +extern int gettimeofday __ProtoType__((struct timeval *tp)); +#endif +#ifdef SUNOS +extern int gettimeofday __ProtoType__((struct timeval *, struct timezone *)); +#endif + +typedef struct x48_timer_t { + word_1 run; + word_64 start; + word_64 stop; + word_64 value; +} x48_timer_t; + +static x48_timer_t timers[NR_TIMERS]; + +static long systime_offset = 0; + +/* + * Ticks for THU 01.01.1970 00:00:00 + */ +word_64 unix_0_time = { 0x0001cf2e, 0x8f800000 }; +word_64 ticks_10_min = { 0x0, 0x00b40000 }; + +/* + * Will be in saturn_t in the future + */ +word_64 set_0_time = { 0x0, 0x0 }; + +/* + * Calculated as (unix_0_time + set_0_time) + */ +word_64 time_offset = { 0x0, 0x0 }; + +#define RAM_BASE_SX 0x70000 +#define ACCESSTIME_SX (0x70052 - RAM_BASE_SX) +#define ACCESSCRC_SX (0x7005F - RAM_BASE_SX) +#define TIMEOUT_SX (0x70063 - RAM_BASE_SX) +#define TIMEOUTCLK_SX (0x70070 - RAM_BASE_SX) + +#define RAM_BASE_GX 0x80000 +#define ACCESSTIME_GX (0x80058 - RAM_BASE_GX) +#define ACCESSCRC_GX (0x80065 - RAM_BASE_GX) +#define TIMEOUT_GX (0x80069 - RAM_BASE_GX) +#define TIMEOUTCLK_GX (0x80076 - RAM_BASE_GX) + +#define calc_crc(nib) (crc = (crc >> 4) ^ (((crc ^ (nib)) & 0xf) * 0x1081)) + +static inline void +#ifdef __FunctionProto__ +add_64(word_64 r1, word_64 *r2) +#else +add_64(r1, r2) +word_64 r1; +word_64 *r2; +#endif +{ + unsigned short s1[4], s2[4]; + unsigned long r[4]; + + s1[0] = (unsigned short)(r1.lo & 0xffff); + s1[1] = (unsigned short)((r1.lo >> 16) & 0xffff); + s1[2] = (unsigned short)(r1.hi & 0xffff); + s1[3] = (unsigned short)((r1.hi >> 16) & 0xffff); + + s2[0] = (unsigned short)(r2->lo & 0xffff); + s2[1] = (unsigned short)((r2->lo >> 16) & 0xffff); + s2[2] = (unsigned short)(r2->hi & 0xffff); + s2[3] = (unsigned short)((r2->hi >> 16) & 0xffff); + + r[0] = (unsigned long)s1[0] + (unsigned long)s2[0]; + r[1] = (unsigned long)s1[1] + (unsigned long)s2[1]; + r[2] = (unsigned long)s1[2] + (unsigned long)s2[2]; + r[3] = (unsigned long)s1[3] + (unsigned long)s2[3]; + + if (r[0] >> 16) r[1]++; + if (r[1] >> 16) r[2]++; + if (r[2] >> 16) r[3]++; + + r2->lo = ((r[1] << 16) | (r[0] & 0xffff)); + r2->hi = ((r[3] << 16) | (r[2] & 0xffff)); +} + +static inline void +#ifdef __FunctionProto__ +sub_64(word_64 r1, word_64 *r2) +#else +sub_64(r1, r2) +word_64 r1; +word_64 *r2; +#endif +{ + unsigned short s1[4], s2[4]; + unsigned long r[4]; + + s1[0] = (unsigned short)(r1.lo & 0xffff); + s1[1] = (unsigned short)((r1.lo >> 16) & 0xffff); + s1[2] = (unsigned short)(r1.hi & 0xffff); + s1[3] = (unsigned short)((r1.hi >> 16) & 0xffff); + + s2[0] = (unsigned short)(r2->lo & 0xffff); + s2[1] = (unsigned short)((r2->lo >> 16) & 0xffff); + s2[2] = (unsigned short)(r2->hi & 0xffff); + s2[3] = (unsigned short)((r2->hi >> 16) & 0xffff); + + r[0] = (unsigned long)s2[0] - (unsigned long)s1[0]; + r[1] = (unsigned long)s2[1] - (unsigned long)s1[1]; + r[2] = (unsigned long)s2[2] - (unsigned long)s1[2]; + r[3] = (unsigned long)s2[3] - (unsigned long)s1[3]; + + if (r[0] >> 16) r[1]--; + if (r[1] >> 16) r[2]--; + if (r[2] >> 16) r[3]--; + + r2->lo = ((r[1] << 16) | (r[0] & 0xffff)); + r2->hi = ((r[3] << 16) | (r[2] & 0xffff)); +} + + +/* + * Set ACCESSTIME: (on startup) + * + * 1. TICKS = 8192 * gettimeofday() (UNIX System Time) + * 2. TICKS += unix_0_time (TICKS for 1.1.1970, 0:00) + * 3. TICKS += set_0_time (Time adjustment from User) + * 4. TICKS += saturn.timer2 (Timer 2 from last run) + * 5. Write this into ACCESSTIME + * 6. Calculate CRC for 13 Nibbles + * 7. Write this into ACCESSCRC + * 8. Prevent AutoOff by setting TIMEOUT + * + */ +void +#ifdef __FunctionProto__ +set_accesstime(void) +#else +set_accesstime() +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + word_64 ticks, timeout, timer2; + word_20 accesstime_loc, timeout_loc; + word_20 accesscrc_loc, timeoutclk_loc; + word_16 crc; + word_4 val; + int i; + time_t gmt; + struct tm *ltm; + + /* + * This is done to set the variable 'timezone' on SYSV systems + */ + (void)time(&gmt); + ltm = localtime(&gmt); +#ifdef SYSV_TIME + if( ltm->tm_isdst ) + systime_offset = -3600; + //systime_offset += timezone; +#else + systime_offset = -ltm->tm_gmtoff; +#endif + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + ticks.hi = (tv.tv_sec >> 19); + ticks.lo = (tv.tv_sec << 13); + ticks.lo |= (tv.tv_usec << 7) / 15625; + + time_offset.lo = unix_0_time.lo; + time_offset.hi = unix_0_time.hi; + + add_64(set_0_time, &time_offset); + + add_64(time_offset, &ticks); + + timer2.lo = saturn.timer2; + if (saturn.timer2 & 0x80000000) + timer2.hi = 0xffffffff; + else + timer2.hi = 0x0; + + add_64(timer2, &ticks); + + timeout.lo = ticks.lo; + timeout.hi = ticks.hi; + + crc = 0x0; + + if (opt_gx) + { + accesstime_loc = ACCESSTIME_GX; + accesscrc_loc = ACCESSCRC_GX; + timeout_loc = TIMEOUT_GX; + timeoutclk_loc = TIMEOUTCLK_GX; + } + else + { + accesstime_loc = ACCESSTIME_SX; + accesscrc_loc = ACCESSCRC_SX; + timeout_loc = TIMEOUT_SX; + timeoutclk_loc = TIMEOUTCLK_SX; + } + + for (i = 0; i < 13; i++) + { + val = ticks.lo & 0xf; + calc_crc(val); + saturn.ram[accesstime_loc + i] = val; + ticks.lo >>= 4; + ticks.lo |= (ticks.hi & 0xf) << 28; + ticks.hi >>= 4; + } + + for (i = 0; i < 4; i++) + { + saturn.ram[accesscrc_loc + i] = crc & 0xf; + crc >>= 4; + } + + add_64(ticks_10_min, &timeout); + + for (i = 0; i < 13; i++) + { + val = timeout.lo & 0xf; + calc_crc(val); + saturn.ram[timeout_loc + i] = val; + timeout.lo >>= 4; + timeout.lo |= (timeout.hi & 0xf) << 28; + timeout.hi >>= 4; + } + + saturn.ram[timeoutclk_loc] = 0xf; +} + +long +#ifdef __FunctionProto__ +diff_timer(word_64 *t1, word_64 *t2) +#else +diff_timer(t1, t2) +word_64 *t1; +word_64 *t2; +#endif +{ + return (t1->lo - t2->lo); +} + +static inline void +#ifdef __FunctionProto__ +add_sub_64(word_64 *t1, word_64 *t2, word_64 *diff) +#else +add_sub_64(t1, t2, diff) +word_64 *t1; +word_64 *t2; +word_64 *diff; +#endif +{ + unsigned short s1[4], s2[4]; + unsigned long r[4]; + + s1[0] = (unsigned short)(t1->lo & 0xffff); + s1[1] = (unsigned short)((t1->lo >> 16) & 0xffff); + s1[2] = (unsigned short)(t1->hi & 0xffff); + s1[3] = (unsigned short)((t1->hi >> 16) & 0xffff); + + s2[0] = (unsigned short)(t2->lo & 0xffff); + s2[1] = (unsigned short)((t2->lo >> 16) & 0xffff); + s2[2] = (unsigned short)(t2->hi & 0xffff); + s2[3] = (unsigned short)((t2->hi >> 16) & 0xffff); + + r[0] = (unsigned long)s1[0] - (unsigned long)s2[0]; + r[1] = (unsigned long)s1[1] - (unsigned long)s2[1]; + r[2] = (unsigned long)s1[2] - (unsigned long)s2[2]; + r[3] = (unsigned long)s1[3] - (unsigned long)s2[3]; + + if (r[0] >> 16) r[1]--; + if (r[1] >> 16) r[2]--; + if (r[2] >> 16) r[3]--; + + s1[0] = (unsigned short)(diff->lo & 0xffff); + s1[1] = (unsigned short)((diff->lo >> 16) & 0xffff); + s1[2] = (unsigned short)(diff->hi & 0xffff); + s1[3] = (unsigned short)((diff->hi >> 16) & 0xffff); + + s2[0] = (unsigned short)r[0]; + s2[1] = (unsigned short)r[1]; + s2[2] = (unsigned short)r[2]; + s2[3] = (unsigned short)r[3]; + + r[0] = (unsigned long)s1[0] + (unsigned long)s2[0]; + r[1] = (unsigned long)s1[1] + (unsigned long)s2[1]; + r[2] = (unsigned long)s1[2] + (unsigned long)s2[2]; + r[3] = (unsigned long)s1[3] + (unsigned long)s2[3]; + + if (r[0] >> 16) r[1]++; + if (r[1] >> 16) r[2]++; + if (r[2] >> 16) r[3]++; + + t2->lo = t1->lo; + t2->hi = t1->hi; + + diff->lo = ((r[1] << 16) | (r[0] & 0xffff)); + diff->hi = ((r[3] << 16) | (r[2] & 0xffff)); +} + +void +#ifdef __FunctionProto__ +start_timer(int timer) +#else +start_timer(timer) +int timer; +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + + if (timer > NR_TIMERS) + return; + + if (timers[timer].run == 1) + return; + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + timers[timer].run = 1; + if (timer == T1_TIMER) { + timers[timer].start.hi = (tv.tv_sec >> 23); + timers[timer].start.lo = (tv.tv_sec << 9); + timers[timer].start.lo |= tv.tv_usec / 62500; + } else { + timers[timer].start.hi = (tv.tv_sec >> 19); + timers[timer].start.lo = (tv.tv_sec << 13); + timers[timer].start.lo |= (tv.tv_usec << 7) / 15625; + } +#ifdef DEBUG_TIMER + fprintf(stderr, "Timer[%d] start at 0x%.8lx%.8lx\n", timer, + timers[timer].start.hi, timers[timer].start.lo); +#endif +} + +void +#ifdef __FunctionProto__ +restart_timer(int timer) +#else +restart_timer(timer) +int timer; +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + + if (timer > NR_TIMERS) + return; + + timers[timer].start.lo = timers[timer].start.hi = 0; + timers[timer].stop.lo = timers[timer].stop.hi = 0; + timers[timer].value.lo = timers[timer].value.hi = 0; + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + timers[timer].run = 1; + if (timer == T1_TIMER) { + timers[timer].start.hi = (tv.tv_sec >> 23); + timers[timer].start.lo = (tv.tv_sec << 9); + timers[timer].start.lo |= tv.tv_usec / 62500; + } else { + timers[timer].start.hi = (tv.tv_sec >> 19); + timers[timer].start.lo = (tv.tv_sec << 13); + timers[timer].start.lo |= (tv.tv_usec << 7) / 15625; + } +#ifdef DEBUG_TIMER + fprintf(stderr, "Timer[%d] restart at 0x%.8lx%.8lx\n", timer, + timers[timer].start.hi, timers[timer].start.lo); +#endif +} + +void +#ifdef __FunctionProto__ +stop_timer(int timer) +#else +stop_timer(timer) +int timer; +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + + if (timer > NR_TIMERS) + return; + + if (timers[timer].run == 0) + return; + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + timers[timer].run = 0; + if (timer == T1_TIMER) { + timers[timer].stop.hi = (tv.tv_sec >> 23); + timers[timer].stop.lo = (tv.tv_sec << 9); + timers[timer].stop.lo |= tv.tv_usec / 62500; + } else { + timers[timer].stop.hi = (tv.tv_sec >> 19); + timers[timer].stop.lo = (tv.tv_sec << 13); + timers[timer].stop.lo |= (tv.tv_usec << 7) / 15625; + } + add_sub_64(&timers[timer].stop, &timers[timer].start, &timers[timer].value); +#ifdef DEBUG_TIMER + fprintf(stderr, "Timer[%d] stop at 0x%.8lx%.8lx, value 0x%.8lx%.8lx\n", + timer, timers[timer].stop.hi, timers[timer].stop.lo, + timers[timer].value.hi, timers[timer].value.lo); +#endif +} + +void +#ifdef __FunctionProto__ +reset_timer(int timer) +#else +reset_timer(timer) +int timer; +#endif +{ + if (timer > NR_TIMERS) + return; + + timers[timer].run = 0; + timers[timer].start.lo = timers[timer].start.hi = 0; + timers[timer].stop.lo = timers[timer].stop.hi = 0; + timers[timer].value.lo = timers[timer].value.hi = 0; +#ifdef DEBUG_TIMER + fprintf(stderr, "Timer[%d] reset\n", timer); +#endif +} + +static word_64 zero = { 0, 0 }; + +word_64 +#ifdef __FunctionProto__ +get_timer(int timer) +#else +get_timer(timer) +int timer; +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + word_64 stop; + + if (timer > NR_TIMERS) + return zero; + + if (timers[timer].run) { + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + if (timer == T1_TIMER) { + stop.hi = (tv.tv_sec >> 23); + stop.lo = (tv.tv_sec << 9); + stop.lo |= tv.tv_usec / 62500; + } else { + stop.hi = (tv.tv_sec >> 19); + stop.lo = (tv.tv_sec << 13); + stop.lo |= (tv.tv_usec << 7) / 15625; + } + add_sub_64(&stop, &timers[timer].start, &timers[timer].value); + } + return timers[timer].value; +} + +/* + * Calculate TIMER 2 Ticks: + * + * 1. TICKS = 8192 * gettimeofday() (UNIX System Time) + * 2. TICKS += unix_0_time (TICKS for 1.1.1970, 0:00) + * 3. TICKS += set_0_time (Time adjustment from User) + * 4. Get value of ACCESSTIME + * 5. Return (ACCESSTIME - TICKS) + * + */ + +t1_t2_ticks +#ifdef __FunctionProto__ +get_t1_t2(void) +#else +get_t1_t2() +#endif +{ + struct timeval tv; +#ifndef SOLARIS + struct timezone tz; +#endif + word_64 stop; + t1_t2_ticks ticks; + word_64 access_time; + word_64 adj_time; + word_64 diff_time; + word_64 delta; + word_20 accesstime_loc; + int i; + +#ifdef SOLARIS + gettimeofday(&tv); +#else + gettimeofday(&tv, &tz); +#endif + tv.tv_sec -= systime_offset; + + if (timers[T1_TIMER].run) + { + stop.hi = (tv.tv_sec >> 23); + stop.lo = (tv.tv_sec << 9); + stop.lo |= tv.tv_usec / 62500; + add_sub_64(&stop, &timers[T1_TIMER].start, &timers[T1_TIMER].value); + } + ticks.t1_ticks = timers[T1_TIMER].value.lo; + + stop.hi = (tv.tv_sec >> 19); + stop.lo = (tv.tv_sec << 13); + stop.lo |= (tv.tv_usec << 7) / 15625; + + add_64(time_offset, &stop); + + if (opt_gx) + accesstime_loc = ACCESSTIME_GX; + else + accesstime_loc = ACCESSTIME_SX; + + access_time.lo = 0x0; + access_time.hi = 0x0; + for (i = 13 - 1; i >= 0; i--) + { + access_time.hi <<= 4; + access_time.hi |= ((access_time.lo >> 28) & 0xf); + access_time.lo <<= 4; + access_time.lo |= ((int)saturn.ram[accesstime_loc + i] & 0xf); + } + + sub_64(stop, &access_time); + + if (adj_time_pending || in_debugger) + { + /* + * We have been inside an interrupt for very long, maybe + * or we are sleeping in the debugger. + * Don't adjust the time, can't come from user, anyhow. + */ + + if ((saturn.timer2 >= 0 && (access_time.lo & 0x80000000)) + || ((unsigned long)saturn.timer2 > access_time.lo)) + { + /* + * check OK, return calculated time + */ + ticks.t2_ticks = access_time.lo; + } + else + { + /* + * Don't increment timer2, return old value and + * slow down timer2. + */ + ticks.t2_ticks = saturn.timer2; + saturn.t2_tick++; + } + + return ticks; + } + + diff_time.lo = saturn.timer2; + if (saturn.timer2 & 0x80000000) + diff_time.hi = 0xffffffff; + else + diff_time.hi = 0x0; + + adj_time.lo = access_time.lo; + adj_time.hi = access_time.hi; + + sub_64(diff_time, &adj_time); + + if (adj_time.hi & 0x8000000) + { + delta.lo = 0x0; + delta.hi = 0x0; + sub_64(adj_time, &delta); + } + else + { + delta.lo = adj_time.lo; + delta.hi = adj_time.hi; + } + + if (delta.hi != 0 || (delta.lo > 0x3c000)) /* Half a minute */ + { + add_64(adj_time, &set_0_time); + add_64(adj_time, &time_offset); + + sub_64(adj_time, &access_time); + +#ifdef DEBUG_TIMER_ADJUST + fprintf(stderr, "Time adjusted by "); + if (adj_time.hi) + fprintf(stderr, "%lX%.8lX", adj_time.hi, adj_time.lo); + else + fprintf(stderr, "%lX", adj_time.lo); + fprintf(stderr, " TICKS, Total offset "); + if (set_0_time.hi) + fprintf(stderr, "%lX%.8lX", set_0_time.hi, set_0_time.lo); + else + fprintf(stderr, "%lX", set_0_time.lo); + fprintf(stderr, " TICKS\n"); +#endif + } + + if ((saturn.timer2 >= 0 && (access_time.lo & 0x80000000)) + || ((unsigned long)saturn.timer2 > access_time.lo)) + { + /* + * check OK, return calculated time + */ + ticks.t2_ticks = access_time.lo; + } + else + { + /* + * Don't increment timer2, return old value and + * slow down timer2. + */ + ticks.t2_ticks = saturn.timer2; + saturn.t2_tick++; + } + + return ticks; +} + diff --git a/jni/timer.h b/jni/timer.h new file mode 100644 index 0000000..b487daa --- /dev/null +++ b/jni/timer.h @@ -0,0 +1,62 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: timer.h,v $ + * Revision 1.3 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.2 1994/11/02 14:51:27 ecd + * new functions: set_accesstime() + * + * Revision 1.2 1994/11/02 14:51:27 ecd + * new functions: set_accesstime() + * + * + * $Id: timer.h,v 1.3 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _TIMER_H +#define _TIMER_H 1 + +#include "global.h" +#include "hp48.h" + +#define NR_TIMERS 4 + +#define T1_TIMER 0 +#define T2_TIMER 1 +#define RUN_TIMER 2 +#define IDLE_TIMER 3 + +typedef struct t1_t2_ticks { + unsigned long t1_ticks; + unsigned long t2_ticks; +} t1_t2_ticks; + +extern void reset_timer __ProtoType__((int timer)); +extern void start_timer __ProtoType__((int timer)); +extern void restart_timer __ProtoType__((int timer)); +extern void stop_timer __ProtoType__((int timer)); +extern word_64 get_timer __ProtoType__((int timer)); +extern long diff_timer __ProtoType__((word_64 *t1, word_64 *t2)); + +extern t1_t2_ticks get_t1_t2 __ProtoType__((void)); +extern void set_accesstime __ProtoType__((void)); + +#endif /* !_TIMER_H */ diff --git a/jni/version.h b/jni/version.h new file mode 100644 index 0000000..db6d47f --- /dev/null +++ b/jni/version.h @@ -0,0 +1,44 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: version.h,v $ + * Revision 1.2 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.1 1994/11/28 02:27:59 ecd + * Initial revision + * + * Revision 1.1 1994/11/28 02:27:59 ecd + * Initial revision + * + * + * $Id: version.h,v 1.2 1995/01/11 18:20:01 ecd Exp ecd $ + */ + +#ifndef _VERSION_H +#define _VERSION_H 1 + +extern int VERSION_MAJOR; +extern int VERSION_MINOR; +extern int PATCHLEVEL; +extern int COMPILE_VERSION; +extern char *COMPILE_TIME; +extern char *COMPILE_BY; + +#endif /* !_VERSION_H */ diff --git a/jni/x48.c b/jni/x48.c new file mode 100644 index 0000000..1f9b320 --- /dev/null +++ b/jni/x48.c @@ -0,0 +1,703 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: x48_x11.c,v $ + * Revision 1.13 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.12 1994/12/08 22:17:24 ecd + * display and menu images now correctly drawn according to disp.lines + * + * Revision 1.11 1994/12/07 20:20:50 ecd + * better handling of resources + * + * Revision 1.10 1994/11/28 02:00:51 ecd + * implemented WM_SAVE_YOURSELF protocol. + * added support for mono and gray in color_t. + * added support for all possible Visualclasses. + * changed handling of KeyPress and KeyRelease. + * added color icon stuff. + * added support for contrast changes (ON_-, ON_+) + * read in all those Xresources before running off. + * use own icon window, no name-decor on icon. + * show state of x48 in the icon's display + * added support for setting the window title with the connections. + * + * Revision 1.9 1994/11/04 03:42:34 ecd + * changed includes + * + * Revision 1.8 1994/11/02 14:44:28 ecd + * works on machines that don't support backing store + * + * Revision 1.7 1994/10/09 20:32:02 ecd + * changed refresh_display to support bit offset. + * + * Revision 1.6 1994/10/06 16:30:05 ecd + * added XShm - Extension stuff + * + * Revision 1.5 1994/10/05 08:36:44 ecd + * added backing_store = Always for subwindows + * + * Revision 1.4 1994/09/30 12:37:09 ecd + * added support for interrupt detection in GetEvent, + * faster display updates, + * update display window only when mapped. + * + * Revision 1.3 1994/09/18 22:47:20 ecd + * added version information + * + * Revision 1.2 1994/09/18 15:29:22 ecd + * started Real Time support + * + * Revision 1.1 1994/09/13 15:05:05 ecd + * Initial revision + * + * $Id: x48_x11.c,v 1.13 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SYSV +#include +#endif +#ifdef SUNOS +#include +#endif + + +#include "x48.h" +#include "icon.h" +#include "small.h" +#include "buttons.h" + +#include "hp48.h" +#include "device.h" +#include "constants.h" +#include "romio.h" + + +extern int saved_argc; +extern char **saved_argv; + +Display *dpy; +int screen; +unsigned int depth; +Colormap cmap; +GC gc; +Window mainW; +Window iconW; +disp_t disp; +Atom wm_delete_window, wm_save_yourself, wm_protocols; +Atom ol_decor_del, ol_decor_icon_name; +Atom atom_type; +Visual *visual; +Pixmap icon_pix; +Pixmap icon_text_pix; +Pixmap icon_disp_pix; +static int last_icon_state = -1; + +JNIEnv *android_env; +jobject android_callback; +jmethodID refreshMainScreen; +jmethodID waitEvent; +jmethodID refreshIcons; +jmethodID emulatorReady; +jmethodID pauseEvent; +int dynamic_color; +int direct_color; +int does_backing_store; +int color_mode; +int icon_color_mode; + +#if 0 +# define DEBUG_XEVENT 1 +# define DEBUG_BUTTONS 1 +# define DEBUG_FOCUS 1 +# define DEBUG_BACKING_STORE 1 +# define DEBUG_SHM 1 +#endif + + + +typedef struct button_t { + + char *name; + short pressed; + short extra; + + int code; + int x, y; + unsigned int w, h; + + int lc; + char *label; + short font_size; + unsigned int lw, lh; + unsigned char *lb; + + char *letter; + + char *left; + short is_menu; + char *right; + char *sub; + + Pixmap map; + Pixmap down; + Window xwin; + +} button_t; + +#define BUTTON_A 0 +#define BUTTON_B 1 +#define BUTTON_C 2 +#define BUTTON_D 3 +#define BUTTON_E 4 +#define BUTTON_F 5 + +#define BUTTON_MTH 6 +#define BUTTON_PRG 7 +#define BUTTON_CST 8 +#define BUTTON_VAR 9 +#define BUTTON_UP 10 +#define BUTTON_NXT 11 + +#define BUTTON_COLON 12 +#define BUTTON_STO 13 +#define BUTTON_EVAL 14 +#define BUTTON_LEFT 15 +#define BUTTON_DOWN 16 +#define BUTTON_RIGHT 17 + +#define BUTTON_SIN 18 +#define BUTTON_COS 19 +#define BUTTON_TAN 20 +#define BUTTON_SQRT 21 +#define BUTTON_POWER 22 +#define BUTTON_INV 23 + +#define BUTTON_ENTER 24 +#define BUTTON_NEG 25 +#define BUTTON_EEX 26 +#define BUTTON_DEL 27 +#define BUTTON_BS 28 + +#define BUTTON_ALPHA 29 +#define BUTTON_7 30 +#define BUTTON_8 31 +#define BUTTON_9 32 +#define BUTTON_DIV 33 + +#define BUTTON_SHL 34 +#define BUTTON_4 35 +#define BUTTON_5 36 +#define BUTTON_6 37 +#define BUTTON_MUL 38 + +#define BUTTON_SHR 39 +#define BUTTON_1 40 +#define BUTTON_2 41 +#define BUTTON_3 42 +#define BUTTON_MINUS 43 + +#define BUTTON_ON 44 +#define BUTTON_0 45 +#define BUTTON_PERIOD 46 +#define BUTTON_SPC 47 +#define BUTTON_PLUS 48 + +#define LAST_BUTTON 48 + +button_t buttons[] = { + { "A", 0, 0, 0x14, 0, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "A", 0, 0, 0, 0, 0 }, + { "B", 0, 0, 0x84, 50, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "B", 0, 0, 0, 0, 0 }, + { "C", 0, 0, 0x83, 100, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "C", 0, 0, 0, 0, 0 }, + { "D", 0, 0, 0x82, 150, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "D", 0, 0, 0, 0, 0 }, + { "E", 0, 0, 0x81, 200, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "E", 0, 0, 0, 0, 0 }, + { "F", 0, 0, 0x80, 250, 0, 36, 23, WHITE, + 0, 0, menu_label_width, menu_label_height, menu_label_bits, + "F", 0, 0, 0, 0, 0 }, + + { "MTH", 0, 0, 0x24, 0, 50, 36, 26, WHITE, "MTH", 0, 0, 0, 0, + "G", "RAD", 0, "POLAR", 0, 0 }, + { "PRG", 0, 0, 0x74, 50, 50, 36, 26, WHITE, "PRG", 0, 0, 0, 0, + "H", 0, 0, "CHARS", 0, 0 }, + { "CST", 0, 0, 0x73, 100, 50, 36, 26, WHITE, "CST", 0, 0, 0, 0, + "I", 0, 0, "MODES", 0, 0 }, + { "VAR", 0, 0, 0x72, 150, 50, 36, 26, WHITE, "VAR", 0, 0, 0, 0, + "J", 0, 0, "MEMORY", 0, 0 }, + { "UP", 0, 0, 0x71, 200, 50, 36, 26, WHITE, + 0, 0, up_width, up_height, up_bits, + "K", 0, 0, "STACK", 0, 0 }, + { "NXT", 0, 0, 0x70, 250, 50, 36, 26, WHITE, "NXT", 0, 0, 0, 0, + "L", "PREV", 0, "MENU", 0, 0 }, + + { "COLON", 0, 0, 0x04, 0, 100, 36, 26, WHITE, + 0, 0, colon_width, colon_height, colon_bits, + "M", "UP", 0, "HOME", 0, 0 }, + { "STO", 0, 0, 0x64, 50, 100, 36, 26, WHITE, "STO", 0, 0, 0, 0, + "N", "DEF", 0, "RCL", 0, 0 }, + { "EVAL", 0, 0, 0x63, 100, 100, 36, 26, WHITE, "EVAL", 0, 0, 0, 0, + "O", "aNUM", 0, "UNDO", 0, 0 }, + { "LEFT", 0, 0, 0x62, 150, 100, 36, 26, WHITE, + 0, 0, left_width, left_height, left_bits, + "P", "PICTURE", 0, 0, 0, 0 }, + { "DOWN", 0, 0, 0x61, 200, 100, 36, 26, WHITE, + 0, 0, down_width, down_height, down_bits, + "Q", "VIEW", 0, 0, 0, 0 }, + { "RIGHT", 0, 0, 0x60, 250, 100, 36, 26, WHITE, + 0, 0, right_width, right_height, right_bits, + "R", "SWAP", 0, 0, 0, 0 }, + + { "SIN", 0, 0, 0x34, 0, 150, 36, 26, WHITE, "SIN", 0, 0, 0, 0, + "S", "ASIN", 0, "b", 0, 0 }, + { "COS", 0, 0, 0x54, 50, 150, 36, 26, WHITE, "COS", 0, 0, 0, 0, + "T", "ACOS", 0, "c", 0, 0 }, + { "TAN", 0, 0, 0x53, 100, 150, 36, 26, WHITE, "TAN", 0, 0, 0, 0, + "U", "ATAN", 0, "d", 0, 0 }, + { "SQRT", 0, 0, 0x52, 150, 150, 36, 26, WHITE, + 0, 0, sqrt_width, sqrt_height, sqrt_bits, + "V", "n", 0, "o", 0, 0 }, + { "POWER", 0, 0, 0x51, 200, 150, 36, 26, WHITE, + 0, 0, power_width, power_height, power_bits, + "W", "p", 0, "LOG", 0, 0 }, + { "INV", 0, 0, 0x50, 250, 150, 36, 26, WHITE, + 0, 0, inv_width, inv_height, inv_bits, + "X", "q", 0, "LN", 0, 0 }, + + { "ENTER", 0, 0, 0x44, 0, 200, 86, 26, WHITE, "ENTER", 2, 0, 0, 0, + 0, "EQUATION", 0, "MATRIX", 0, 0 }, + { "NEG", 0, 0, 0x43, 100, 200, 36, 26, WHITE, + 0, 0, neg_width, neg_height, neg_bits, + "Y", "EDIT", 0, "CMD", 0, 0 }, + { "EEX", 0, 0, 0x42, 150, 200, 36, 26, WHITE, "EEX", 0, 0, 0, 0, + "Z", "PURG", 0, "ARG", 0, 0 }, + { "DEL", 0, 0, 0x41, 200, 200, 36, 26, WHITE, "DEL", 0, 0, 0, 0, + 0, "CLEAR", 0, 0, 0, 0 }, + { "BS", 0, 0, 0x40, 250, 200, 36, 26, WHITE, + 0, 0, bs_width, bs_height, bs_bits, + 0, "DROP", 0, 0, 0, 0 }, + + { "ALPHA", 0, 0, 0x35, 0, 250, 36, 26, WHITE, + 0, 0, alpha_width, alpha_height, alpha_bits, + 0, "USER", 0, "ENTRY", 0, 0 }, + { "7", 0, 0, 0x33, 60, 250, 46, 26, WHITE, "7", 1, 0, 0, 0, + 0, 0, 1, "SOLVE", 0, 0 }, + { "8", 0, 0, 0x32, 120, 250, 46, 26, WHITE, "8", 1, 0, 0, 0, + 0, 0, 1, "PLOT", 0, 0 }, + { "9", 0, 0, 0x31, 180, 250, 46, 26, WHITE, "9", 1, 0, 0, 0, + 0, 0, 1, "SYMBOLIC", 0, 0 }, + { "DIV", 0, 0, 0x30, 240, 250, 46, 26, WHITE, + 0, 0, div_width, div_height, div_bits, + 0, "r ", 0, "s", 0, 0 }, + + { "SHL", 0, 0, 0x25, 0, 300, 36, 26, LEFT, + 0, 0, shl_width, shl_height, shl_bits, + 0, 0, 0, 0, 0, 0 }, + { "4", 0, 0, 0x23, 60, 300, 46, 26, WHITE, "4", 1, 0, 0, 0, + 0, 0, 1, "TIME", 0, 0 }, + { "5", 0, 0, 0x22, 120, 300, 46, 26, WHITE, "5", 1, 0, 0, 0, + 0, 0, 1, "STAT", 0, 0 }, + { "6", 0, 0, 0x21, 180, 300, 46, 26, WHITE, "6", 1, 0, 0, 0, + 0, 0, 1, "UNITS", 0, 0 }, + { "MUL", 0, 0, 0x20, 240, 300, 46, 26, WHITE, + 0, 0, mul_width, mul_height, mul_bits, + 0, "t ", 0, "u", 0, 0 }, + + { "SHR", 0, 0, 0x15, 0, 350, 36, 26, RIGHT, + 0, 0, shr_width, shr_height, shr_bits, + 0, 0, 1, " ", 0, 0 }, + { "1", 0, 0, 0x13, 60, 350, 46, 26, WHITE, "1", 1, 0, 0, 0, + 0, 0, 1, "I/O", 0, 0 }, + { "2", 0, 0, 0x12, 120, 350, 46, 26, WHITE, "2", 1, 0, 0, 0, + 0, 0, 1, "LIBRARY", 0, 0 }, + { "3", 0, 0, 0x11, 180, 350, 46, 26, WHITE, "3", 1, 0, 0, 0, + 0, 0, 1, "EQ LIB", 0, 0 }, + { "MINUS", 0, 0, 0x10, 240, 350, 46, 26, WHITE, + 0, 0, minus_width, minus_height, minus_bits, + 0, "v ", 0, "w", 0, 0 }, + + { "ON", 0, 0, 0x8000, 0, 400, 36, 26, WHITE, "ON", 0, 0, 0, 0, + 0, "CONT", 0, "OFF", "CANCEL", 0 }, + { "0", 0, 0, 0x03, 60, 400, 46, 26, WHITE, "0", 1, 0, 0, 0, + 0, "\004 ", 0, "\003", 0, 0 }, + { "PERIOD", 0, 0, 0x02, 120, 400, 46, 26, WHITE, ".", 1, 0, 0, 0, + 0, "\002 ", 0, "\001", 0, 0 }, + { "SPC", 0, 0, 0x01, 180, 400, 46, 26, WHITE, "SPC", 0, 0, 0, 0, + 0, "\005 ", 0, "z", 0, 0 }, + { "PLUS", 0, 0, 0x00, 240, 400, 46, 26, WHITE, + 0, 0, plus_width, plus_height, plus_bits, + 0, "x ", 0, "y", 0, 0 }, + + { 0 } +}; + + +int +#ifdef __FunctionProto__ +button_pressed(int b) +#else +button_pressed(b) +int b; +#endif +{ + int code; + int i, r, c; + + code = buttons[b].code; + buttons[b].pressed = 1; + if (code == 0x8000) { + for (i = 0; i < 9; i++) + saturn.keybuf.rows[i] |= 0x8000; + do_kbd_int(); + } else { + r = code >> 4; + c = 1 << (code & 0xf); + if ((saturn.keybuf.rows[r] & c) == 0) { + if (saturn.kbd_ien) { + do_kbd_int(); + } + if ((saturn.keybuf.rows[r] & c)) { +LOGE( "bug\n"); + } + saturn.keybuf.rows[r] |= c; + } + } +#ifdef DEBUG_BUTTONS + LOGE( "Button pressed %d (%s)\n", + buttons[b].code, buttons[b].name); +#endif + return 0; +} + +int +#ifdef __FunctionProto__ +button_released(int b) +#else +button_released(b) +int b; +#endif +{ + int code; + + code = buttons[b].code; + buttons[b].pressed = 0; + if (code == 0x8000) { + int i; + for (i = 0; i < 9; i++) + saturn.keybuf.rows[i] &= ~0x8000; + } else { + int r, c; + r = code >> 4; + c = 1 << (code & 0xf); + saturn.keybuf.rows[r] &= ~c; + } +#ifdef DEBUG_BUTTONS + LOGE( "Button released %d (%s)\n", + buttons[b].code, buttons[b].name); +#endif + return 0; +} + +static +int +#ifdef __FunctionProto__ +button_release_all(void) +#else +button_release_all() +#endif +{ + int code; + int b; + +#ifdef DEBUG_BUTTONS + LOGE( "Buttons released "); +#endif + for (b = BUTTON_A; b <= LAST_BUTTON; b++) + { + if (buttons[b].pressed) + { +#ifdef DEBUG_BUTTONS + LOGE( "%d (%s) ", + buttons[b].code, buttons[b].name); +#endif + code = buttons[b].code; + if (code == 0x8000) { + int i; + for (i = 0; i < 9; i++) + saturn.keybuf.rows[i] &= ~0x8000; + } else { + int r, c; + r = code >> 4; + c = 1 << (code & 0xf); + saturn.keybuf.rows[r] &= ~c; + } + buttons[b].pressed = 0; + // DrawButton(b); + } + } +#ifdef DEBUG_BUTTONS + LOGE( "\n"); +#endif + return 0; +} + +int +#ifdef __FunctionProto__ +key_event(int b, int keypressed) +#else +key_event(b, keypressed) +int b; +int keypressed; +#endif +{ + int code; + int i, r, c; + int all_up; + + code = buttons[b].code; + if (keypressed == 1) { + buttons[b].pressed = 1; + // DrawButton(b); + if (code == 0x8000) { + for (i = 0; i < 9; i++) + saturn.keybuf.rows[i] |= 0x8000; + do_kbd_int(); + } else { + r = code >> 4; + c = 1 << (code & 0xf); + if ((saturn.keybuf.rows[r] & c) == 0) { + if (saturn.kbd_ien) { + do_kbd_int(); + } + saturn.keybuf.rows[r] |= c; + } + } +#ifdef DEBUG_BUTTONS + LOGE( "Key pressed %d (%s) %x\n", + buttons[b].code, buttons[b].name), c; +#endif + } else { + if (code == 0x8000) { + for (i = 0; i < 9; i++) + saturn.keybuf.rows[i] &= ~0x8000; + memset (&saturn.keybuf, 0, sizeof (saturn.keybuf)); + } else { + r = code >> 4; + c = 1 << (code & 0xf); + saturn.keybuf.rows[r] &= ~c; + } + buttons[b].pressed = 0; + // DrawButton(b); +#ifdef DEBUG_BUTTONS + LOGE( "Key released %d (%s)\n", + buttons[b].code, buttons[b].name); +#endif + } + return 0; +} + + +/* TODO */ + + +Pixmap +#ifdef __FunctionProto__ +XCreateBitmapFromData(Display *dpy, Window win, char* data, int width, int height) +#else +XCreateBitmapFromData(dpy, win, data, width, height) +Display *dpy; +Window win; +char* data; +int width; +int height; +#endif +{ + Pixmap p = { data, width, height }; + return p; +} + +void +#ifdef __FunctionProto__ +XClearArea(Display *dpy, Window win, int x, int y, int width, int height, int boo) +#else +XClearArea(dpy, win, x, y, width, height, boo) +Display *dpy; +Window win; +int x; +int y; +int width; +int height; +int boo; +#endif +{ + //LOGI("ClearArea: %d %d %d %d\n", x, y, width, height); + return; +} + +void +#ifdef __FunctionProto__ +XCopyPlane(Display *dpy, Pixmap map, Window win, GC gc, int a, int b, int width, int height, int x, int y, int boo) +#else +XCopyPlane(dpy, map, win, gc, a, b, width, height, x, y,boo) +Display *dpy; +Pixmap map; +Window win; +GC gc; +int a; +int b; +int width; +int height; +int x; +int y; +int boo; +#endif +{ + //LOGI("CopyArea: %d %d %d %d %s\n", x, y, width, height, map.data); + return; +} + +void +#ifdef __FunctionProto__ +XClearWindow(Display *dpy, Window win) +#else +XClearWindow(dpy, win) +Display *dpy; +Window win; +#endif +{ + LOGI("XClearWindow"); + return; +} + +void +#ifdef __FunctionProto__ +refresh_display(void) +#else +refresh_display() +#endif +{ + LOGI("refresh_display"); + return; +} + + +int +#ifdef __FunctionProto__ +GetEvent(void) +#else +GetEvent() +#endif +{ + + int wake = 0; + /*wake = (*android_env)->CallIntMethod(android_env, android_callback, waitEvent); + return wake; + */ + + int code = (*android_env)->CallIntMethod(android_env, android_callback, waitEvent); + +//LOGI("code: %d", code); + if (code < 0) + { + code = -code; + wake = 0; + } else if (code > 0) + { + wake = 1; + } + + if (code >= 100) + { + key_event(code - 100, 0); + } else if (code > 0) + { + key_event(code - 1, 1); + } + +// LOGI("wake: %d", wake); + + return wake; +} + +int +exit_x48(int tell_x11) + +{ + + return 0; + +} + +void +#ifdef __FunctionProto__ +refresh_icon(void) +#else +refresh_icon() +#endif +{ + return; + +} + +void +#ifdef __FunctionProto__ +adjust_contrast(int contrast) +#else +adjust_contrast(contrast) +int contrast; +#endif +{ + + return; + +} + +void +#ifdef __FunctionProto__ +ShowConnections(char *wire, char *ir) +#else +ShowConnections(wire, ir) +char *wire; +char *ir; +#endif +{ + + return; + +} diff --git a/jni/x48.h b/jni/x48.h new file mode 100644 index 0000000..af113a7 --- /dev/null +++ b/jni/x48.h @@ -0,0 +1,178 @@ +/* + * This file is part of x48, an emulator of the HP-48sx Calculator. + * Copyright (C) 1994 Eddie C. Dost (ecd@dressler.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* $Log: x48_x11.h,v $ + * Revision 1.11 1995/01/11 18:20:01 ecd + * major update to support HP48 G/GX + * + * Revision 1.10 1994/12/07 20:16:41 ecd + * added "refresh_icon" + * + * Revision 1.10 1994/12/07 20:16:41 ecd + * added "refresh_icon" + * + * Revision 1.9 1994/11/28 02:19:22 ecd + * added support for contrast adjustment + * + * Revision 1.8 1994/11/04 03:44:47 ecd + * added support for mono and gray displays + * + * Revision 1.7 1994/11/02 14:51:27 ecd + * minor fix + * + * Revision 1.6 1994/10/09 20:26:35 ecd + * changed disp_t + * + * Revision 1.5 1994/10/06 16:29:28 ecd + * added XShm - Extension stuff + * + * Revision 1.4 1994/10/05 08:33:22 ecd + * changed disp_t: removed Pixmap + * + * Revision 1.3 1994/09/30 12:32:49 ecd + * changed display stuff, added detection of interrupts in GetEvent + * + * Revision 1.2 1994/09/18 15:31:58 ecd + * started Real Time support + * + * Revision 1.1 1994/09/13 15:05:11 ecd + * Initial revision + * + * + * $Id: x48_x11.h,v 1.11 1995/01/11 18:20:01 ecd Exp ecd $ + */ + + +#include "global.h" + +#define WHITE 0 +#define LEFT 1 +#define RIGHT 2 +#define BUT_TOP 3 +#define BUTTON 4 +#define BUT_BOT 5 +#define LCD 6 +#define PIXEL 7 +#define PAD_TOP 8 +#define PAD 9 +#define PAD_BOT 10 +#define DISP_PAD_TOP 11 +#define DISP_PAD 12 +#define DISP_PAD_BOT 13 +#define LOGO 14 +#define LOGO_BACK 15 +#define LABEL 16 +#define FRAME 17 +#define UNDERLAY 18 +#define BLACK 19 + +#include +#include +#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "x48", __VA_ARGS__) +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG , "x48", __VA_ARGS__) +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO , "x48", __VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN , "x48", __VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR , "x48", __VA_ARGS__) + +/* TODO */ +typedef struct XColor { + int dummy; +} XColor; +typedef struct Window { + int dummy; +} Window; +typedef struct GC { + int dummy; +} GC; +typedef struct Display { + int dummy; +} Display; +typedef struct Pixmap { + char * data; + int width; + int height; +} Pixmap; +typedef struct Colormap { + int dummy; +} Colormap; +typedef struct Atom { + int dummy; +} Atom; +typedef struct Visual { + int dummy; +} Visual; +/* */ + +typedef struct color_t { + char *name; + int r, g, b; + int mono_rgb; + int gray_rgb; + XColor xcolor; +} color_t; + +extern color_t *colors; + +#define COLOR(c) (colors[(c)].xcolor.pixel) + +#define UPDATE_MENU 1 +#define UPDATE_DISP 2 + +typedef struct disp_t { + unsigned int w, h; + Window win; + GC gc; + short mapped; + int offset; + int lines; + int display_update; +} disp_t; + +extern disp_t disp; + +extern JNIEnv *android_env; +extern jobject android_callback; +extern jmethodID refreshMainScreen; +extern jmethodID waitEvent; +extern jmethodID refreshIcons; +extern jmethodID emulatorReady; +extern jmethodID pauseEvent; + +extern Display *dpy; +extern int screen; +extern int exit_state; + +extern int InitDisplay __ProtoType__((int argc, char **argv)); +extern int CreateWindows __ProtoType__((int argc, char **argv)); +extern int GetEvent __ProtoType__((void)); + +extern void adjust_contrast __ProtoType__((int contrast)); +extern void refresh_icon __ProtoType__((void)); + +extern void ShowConnections __ProtoType__((char *w, char *i)); + +// extern void exit_x48 __ProtoType__((int tell_x11)); + +extern Pixmap XCreateBitmapFromData __ProtoType__((Display *dpy, Window win, char* data, int a, int b)); + +extern void XClearArea __ProtoType__((Display *dpy, Window win, int x, int y, int width, int height, int boo)); + +extern void XCopyPlane __ProtoType__((Display *dpy, Pixmap map, Window win, GC gc, int a, int b, int x, int y, int width, int height, int boo)); + +extern void XClearWindow __ProtoType__((Display *dpy, Window win)); diff --git a/libs/armeabi/libdroid48.so b/libs/armeabi/libdroid48.so new file mode 100644 index 0000000..d1afeea Binary files /dev/null and b/libs/armeabi/libdroid48.so differ diff --git a/obj/local/armeabi/libdroid48.so b/obj/local/armeabi/libdroid48.so new file mode 100644 index 0000000..077b079 Binary files /dev/null and b/obj/local/armeabi/libdroid48.so differ diff --git a/obj/local/armeabi/objs/droid48/actions.o.d b/obj/local/armeabi/objs/droid48/actions.o.d new file mode 100644 index 0000000..d9f2a24 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/actions.o.d @@ -0,0 +1,125 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/actions.o: \ + /home/shagrath/DEV/workspace/droid48/jni/actions.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/timer.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/timer.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: diff --git a/obj/local/armeabi/objs/droid48/binio.o.d b/obj/local/armeabi/objs/droid48/binio.o.d new file mode 100644 index 0000000..3d5f1e9 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/binio.o.d @@ -0,0 +1,131 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/binio.o: \ + /home/shagrath/DEV/workspace/droid48/jni/binio.c \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/workspace/droid48/jni/binio.h \ + /home/shagrath/DEV/workspace/droid48/jni/rpl.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h: + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/workspace/droid48/jni/binio.h: + +/home/shagrath/DEV/workspace/droid48/jni/rpl.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: diff --git a/obj/local/armeabi/objs/droid48/debugger.o.d b/obj/local/armeabi/objs/droid48/debugger.o.d new file mode 100644 index 0000000..3f9baf2 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/debugger.o.d @@ -0,0 +1,158 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/debugger.o: \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/timer.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h \ + /home/shagrath/DEV/workspace/droid48/jni/disasm.h \ + /home/shagrath/DEV/workspace/droid48/jni/rpl.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/timer.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: + +/home/shagrath/DEV/workspace/droid48/jni/disasm.h: + +/home/shagrath/DEV/workspace/droid48/jni/rpl.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: diff --git a/obj/local/armeabi/objs/droid48/device.o.d b/obj/local/armeabi/objs/droid48/device.o.d new file mode 100644 index 0000000..caf6422 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/device.o.d @@ -0,0 +1,101 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/device.o: \ + /home/shagrath/DEV/workspace/droid48/jni/device.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/timer.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/timer.h: diff --git a/obj/local/armeabi/objs/droid48/disasm.o.d b/obj/local/armeabi/objs/droid48/disasm.o.d new file mode 100644 index 0000000..8f515f2 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/disasm.o.d @@ -0,0 +1,86 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/disasm.o: \ + /home/shagrath/DEV/workspace/droid48/jni/disasm.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/disasm.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/disasm.h: diff --git a/obj/local/armeabi/objs/droid48/emulate.o.d b/obj/local/armeabi/objs/droid48/emulate.o.d new file mode 100644 index 0000000..0adb620 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/emulate.o.d @@ -0,0 +1,89 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/emulate.o: \ + /home/shagrath/DEV/workspace/droid48/jni/emulate.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/timer.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/timer.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: diff --git a/obj/local/armeabi/objs/droid48/init.o.d b/obj/local/armeabi/objs/droid48/init.o.d new file mode 100644 index 0000000..db10dba --- /dev/null +++ b/obj/local/armeabi/objs/droid48/init.o.d @@ -0,0 +1,152 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/init.o: \ + /home/shagrath/DEV/workspace/droid48/jni/init.c \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pwd.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pwd.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: diff --git a/obj/local/armeabi/objs/droid48/lcd.o.d b/obj/local/armeabi/objs/droid48/lcd.o.d new file mode 100644 index 0000000..375a28e --- /dev/null +++ b/obj/local/armeabi/objs/droid48/lcd.o.d @@ -0,0 +1,125 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/lcd.o: \ + /home/shagrath/DEV/workspace/droid48/jni/lcd.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/annunc.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_alpha.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_battery.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_busy.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_io.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_left.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_right.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/annunc.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_alpha.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_battery.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_busy.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_io.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_left.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/ann_right.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: diff --git a/obj/local/armeabi/objs/droid48/main.o.d b/obj/local/armeabi/objs/droid48/main.o.d new file mode 100644 index 0000000..9394766 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/main.o.d @@ -0,0 +1,170 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/main.o: \ + /home/shagrath/DEV/workspace/droid48/jni/main.c \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/signal.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/limits.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/limits.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/limits.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/internal_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/limits.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/signal.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/signal.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/siginfo.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/siginfo.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/locale.h + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/signal.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/limits.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/limits.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/limits.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/internal_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/limits.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/signal.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/signal.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/siginfo.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/siginfo.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/locale.h: diff --git a/obj/local/armeabi/objs/droid48/memory.o.d b/obj/local/armeabi/objs/droid48/memory.o.d new file mode 100644 index 0000000..4ced0c0 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/memory.o.d @@ -0,0 +1,122 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/memory.o: \ + /home/shagrath/DEV/workspace/droid48/jni/memory.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: diff --git a/obj/local/armeabi/objs/droid48/options.o.d b/obj/local/armeabi/objs/droid48/options.o.d new file mode 100644 index 0000000..aeee925 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/options.o.d @@ -0,0 +1,98 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/options.o: \ + /home/shagrath/DEV/workspace/droid48/jni/options.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/workspace/droid48/jni/constants.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/workspace/droid48/jni/constants.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: diff --git a/obj/local/armeabi/objs/droid48/register.o.d b/obj/local/armeabi/objs/droid48/register.o.d new file mode 100644 index 0000000..69f2603 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/register.o.d @@ -0,0 +1,98 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/register.o: \ + /home/shagrath/DEV/workspace/droid48/jni/register.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: diff --git a/obj/local/armeabi/objs/droid48/resources.o.d b/obj/local/armeabi/objs/droid48/resources.o.d new file mode 100644 index 0000000..4fa754f --- /dev/null +++ b/obj/local/armeabi/objs/droid48/resources.o.d @@ -0,0 +1,92 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/resources.o: \ + /home/shagrath/DEV/workspace/droid48/jni/resources.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h \ + /home/shagrath/DEV/workspace/droid48/jni/disasm.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/errors.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: + +/home/shagrath/DEV/workspace/droid48/jni/disasm.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/errors.h: diff --git a/obj/local/armeabi/objs/droid48/romio.o.d b/obj/local/armeabi/objs/droid48/romio.o.d new file mode 100644 index 0000000..7ce48b9 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/romio.o.d @@ -0,0 +1,122 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/romio.o: \ + /home/shagrath/DEV/workspace/droid48/jni/romio.c \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: diff --git a/obj/local/armeabi/objs/droid48/rpl.o.d b/obj/local/armeabi/objs/droid48/rpl.o.d new file mode 100644 index 0000000..6019001 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/rpl.o.d @@ -0,0 +1,131 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/rpl.o: \ + /home/shagrath/DEV/workspace/droid48/jni/rpl.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/rpl.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h \ + /home/shagrath/DEV/workspace/droid48/jni/append.h \ + /home/shagrath/DEV/workspace/droid48/jni/disasm.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48char.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/rpl.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: + +/home/shagrath/DEV/workspace/droid48/jni/append.h: + +/home/shagrath/DEV/workspace/droid48/jni/disasm.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48char.h: diff --git a/obj/local/armeabi/objs/droid48/serial.o.d b/obj/local/armeabi/objs/droid48/serial.o.d new file mode 100644 index 0000000..98c8702 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/serial.o.d @@ -0,0 +1,176 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/serial.o: \ + /home/shagrath/DEV/workspace/droid48/jni/serial.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/termios.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/ioctl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/ioctl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/ioctl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/ioctl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/ioctls.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/termbits.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/ioctl_compat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/termios.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/termios.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/workspace/droid48/jni/resources.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/errno-base.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/termios.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/ioctl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/ioctl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/ioctl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/ioctl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/ioctls.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/termbits.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/ioctl_compat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/termios.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/termios.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48_emu.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/workspace/droid48/jni/resources.h: diff --git a/obj/local/armeabi/objs/droid48/timer.o.d b/obj/local/armeabi/objs/droid48/timer.o.d new file mode 100644 index 0000000..a47387d --- /dev/null +++ b/obj/local/armeabi/objs/droid48/timer.o.d @@ -0,0 +1,116 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/timer.o: \ + /home/shagrath/DEV/workspace/droid48/jni/timer.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/siginfo.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/siginfo.h \ + /home/shagrath/DEV/workspace/droid48/jni/timer.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/debugger.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/siginfo.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/siginfo.h: + +/home/shagrath/DEV/workspace/droid48/jni/timer.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/debugger.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: diff --git a/obj/local/armeabi/objs/droid48/x48.o.d b/obj/local/armeabi/objs/droid48/x48.o.d new file mode 100644 index 0000000..b6a1de9 --- /dev/null +++ b/obj/local/armeabi/objs/droid48/x48.o.d @@ -0,0 +1,254 @@ +/home/shagrath/DEV/workspace/droid48/obj/local/armeabi/objs/droid48/x48.o: \ + /home/shagrath/DEV/workspace/droid48/jni/x48.c \ + /home/shagrath/DEV/workspace/droid48/jni/global.h \ + /home/shagrath/DEV/workspace/droid48/jni/config.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pwd.h \ + /home/shagrath/DEV/workspace/droid48/jni/x48.h \ + /home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h \ + /home/shagrath/DEV/workspace/droid48/jni/icon.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_icon.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_top.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_bottom.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_logo.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_text.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_disp.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_keys.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_orange.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_blue.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_on.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_top_gx.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_logo_gx.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_text_gx.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_green_gx.h \ + /home/shagrath/DEV/workspace/droid48/jni/small.h \ + /home/shagrath/DEV/workspace/droid48/jni/buttons.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/menu_label.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/up.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/down.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/left.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/right.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/sqrt.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/power.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/inv.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/neg.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/bs.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/alpha.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/div.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/shl.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/mul.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/shr.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/minus.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/plus.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/last.h \ + /home/shagrath/DEV/workspace/droid48/jni/bitmaps/colon.h \ + /home/shagrath/DEV/workspace/droid48/jni/hp48.h \ + /home/shagrath/DEV/workspace/droid48/jni/mmu.h \ + /home/shagrath/DEV/workspace/droid48/jni/device.h \ + /home/shagrath/DEV/workspace/droid48/jni/constants.h \ + /home/shagrath/DEV/workspace/droid48/jni/romio.h + +/home/shagrath/DEV/workspace/droid48/jni/global.h: + +/home/shagrath/DEV/workspace/droid48/jni/config.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/jni.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/inttypes.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdint.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdio.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/types.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/stdlib.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/string.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/malloc.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/alloca.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/strings.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/memory.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/unistd.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/select.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/time.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/sysconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/capability.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pathconf.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/stat.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/endian.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/linux/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/asm-generic/fcntl.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/pwd.h: + +/home/shagrath/DEV/workspace/droid48/jni/x48.h: + +/home/shagrath/DEV/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/android/log.h: + +/home/shagrath/DEV/workspace/droid48/jni/icon.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_icon.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_top.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_bottom.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_logo.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_text.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_disp.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_keys.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_orange.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_blue.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_on.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_top_gx.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_logo_gx.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_text_gx.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/hp48_green_gx.h: + +/home/shagrath/DEV/workspace/droid48/jni/small.h: + +/home/shagrath/DEV/workspace/droid48/jni/buttons.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/menu_label.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/up.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/down.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/left.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/right.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/sqrt.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/power.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/inv.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/neg.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/bs.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/alpha.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/div.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/shl.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/mul.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/shr.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/minus.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/plus.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/last.h: + +/home/shagrath/DEV/workspace/droid48/jni/bitmaps/colon.h: + +/home/shagrath/DEV/workspace/droid48/jni/hp48.h: + +/home/shagrath/DEV/workspace/droid48/jni/mmu.h: + +/home/shagrath/DEV/workspace/droid48/jni/device.h: + +/home/shagrath/DEV/workspace/droid48/jni/constants.h: + +/home/shagrath/DEV/workspace/droid48/jni/romio.h: diff --git a/res/Thumbs.db b/res/Thumbs.db new file mode 100644 index 0000000..6889eb6 Binary files /dev/null and b/res/Thumbs.db differ diff --git a/res/drawable-hdpi/icon.png b/res/drawable-hdpi/icon.png new file mode 100644 index 0000000..349d390 Binary files /dev/null and b/res/drawable-hdpi/icon.png differ diff --git a/res/drawable-hdpi/k01.png b/res/drawable-hdpi/k01.png new file mode 100644 index 0000000..83a1fbb Binary files /dev/null and b/res/drawable-hdpi/k01.png differ diff --git a/res/drawable-hdpi/k02.png b/res/drawable-hdpi/k02.png new file mode 100644 index 0000000..276daa7 Binary files /dev/null and b/res/drawable-hdpi/k02.png differ diff --git a/res/drawable-hdpi/k03.png b/res/drawable-hdpi/k03.png new file mode 100644 index 0000000..1f70144 Binary files /dev/null and b/res/drawable-hdpi/k03.png differ diff --git a/res/drawable-hdpi/k04.png b/res/drawable-hdpi/k04.png new file mode 100644 index 0000000..96aa257 Binary files /dev/null and b/res/drawable-hdpi/k04.png differ diff --git a/res/drawable-hdpi/k05.png b/res/drawable-hdpi/k05.png new file mode 100644 index 0000000..44a1685 Binary files /dev/null and b/res/drawable-hdpi/k05.png differ diff --git a/res/drawable-hdpi/k06.png b/res/drawable-hdpi/k06.png new file mode 100644 index 0000000..60446ad Binary files /dev/null and b/res/drawable-hdpi/k06.png differ diff --git a/res/drawable-hdpi/k07.png b/res/drawable-hdpi/k07.png new file mode 100644 index 0000000..d4b7ce2 Binary files /dev/null and b/res/drawable-hdpi/k07.png differ diff --git a/res/drawable-hdpi/k08.png b/res/drawable-hdpi/k08.png new file mode 100644 index 0000000..11d7d97 Binary files /dev/null and b/res/drawable-hdpi/k08.png differ diff --git a/res/drawable-hdpi/k09.png b/res/drawable-hdpi/k09.png new file mode 100644 index 0000000..817e7e4 Binary files /dev/null and b/res/drawable-hdpi/k09.png differ diff --git a/res/drawable-hdpi/k10.png b/res/drawable-hdpi/k10.png new file mode 100644 index 0000000..bd0bde9 Binary files /dev/null and b/res/drawable-hdpi/k10.png differ diff --git a/res/drawable-hdpi/k11.png b/res/drawable-hdpi/k11.png new file mode 100644 index 0000000..c33a184 Binary files /dev/null and b/res/drawable-hdpi/k11.png differ diff --git a/res/drawable-hdpi/k12.png b/res/drawable-hdpi/k12.png new file mode 100644 index 0000000..41e531a Binary files /dev/null and b/res/drawable-hdpi/k12.png differ diff --git a/res/drawable-hdpi/k13.png b/res/drawable-hdpi/k13.png new file mode 100644 index 0000000..9899e68 Binary files /dev/null and b/res/drawable-hdpi/k13.png differ diff --git a/res/drawable-hdpi/k14.png b/res/drawable-hdpi/k14.png new file mode 100644 index 0000000..bf6d4ba Binary files /dev/null and b/res/drawable-hdpi/k14.png differ diff --git a/res/drawable-hdpi/k15.png b/res/drawable-hdpi/k15.png new file mode 100644 index 0000000..1209673 Binary files /dev/null and b/res/drawable-hdpi/k15.png differ diff --git a/res/drawable-hdpi/k16.png b/res/drawable-hdpi/k16.png new file mode 100644 index 0000000..f21c67f Binary files /dev/null and b/res/drawable-hdpi/k16.png differ diff --git a/res/drawable-hdpi/k17.png b/res/drawable-hdpi/k17.png new file mode 100644 index 0000000..2214c57 Binary files /dev/null and b/res/drawable-hdpi/k17.png differ diff --git a/res/drawable-hdpi/k18.png b/res/drawable-hdpi/k18.png new file mode 100644 index 0000000..65f8f6d Binary files /dev/null and b/res/drawable-hdpi/k18.png differ diff --git a/res/drawable-hdpi/k19.png b/res/drawable-hdpi/k19.png new file mode 100644 index 0000000..b0f3ca6 Binary files /dev/null and b/res/drawable-hdpi/k19.png differ diff --git a/res/drawable-hdpi/k20.png b/res/drawable-hdpi/k20.png new file mode 100644 index 0000000..2aec56c Binary files /dev/null and b/res/drawable-hdpi/k20.png differ diff --git a/res/drawable-hdpi/k21.png b/res/drawable-hdpi/k21.png new file mode 100644 index 0000000..68a70eb Binary files /dev/null and b/res/drawable-hdpi/k21.png differ diff --git a/res/drawable-hdpi/k22.png b/res/drawable-hdpi/k22.png new file mode 100644 index 0000000..0a5efb4 Binary files /dev/null and b/res/drawable-hdpi/k22.png differ diff --git a/res/drawable-hdpi/k23.png b/res/drawable-hdpi/k23.png new file mode 100644 index 0000000..20edd5b Binary files /dev/null and b/res/drawable-hdpi/k23.png differ diff --git a/res/drawable-hdpi/k24.png b/res/drawable-hdpi/k24.png new file mode 100644 index 0000000..17585d7 Binary files /dev/null and b/res/drawable-hdpi/k24.png differ diff --git a/res/drawable-hdpi/k25.png b/res/drawable-hdpi/k25.png new file mode 100644 index 0000000..9015e78 Binary files /dev/null and b/res/drawable-hdpi/k25.png differ diff --git a/res/drawable-hdpi/k26.png b/res/drawable-hdpi/k26.png new file mode 100644 index 0000000..66ebcfe Binary files /dev/null and b/res/drawable-hdpi/k26.png differ diff --git a/res/drawable-hdpi/k27.png b/res/drawable-hdpi/k27.png new file mode 100644 index 0000000..9f348ce Binary files /dev/null and b/res/drawable-hdpi/k27.png differ diff --git a/res/drawable-hdpi/k28.png b/res/drawable-hdpi/k28.png new file mode 100644 index 0000000..049d89f Binary files /dev/null and b/res/drawable-hdpi/k28.png differ diff --git a/res/drawable-hdpi/k29.png b/res/drawable-hdpi/k29.png new file mode 100644 index 0000000..579122d Binary files /dev/null and b/res/drawable-hdpi/k29.png differ diff --git a/res/drawable-hdpi/k30.png b/res/drawable-hdpi/k30.png new file mode 100644 index 0000000..d8718ea Binary files /dev/null and b/res/drawable-hdpi/k30.png differ diff --git a/res/drawable-hdpi/k31.png b/res/drawable-hdpi/k31.png new file mode 100644 index 0000000..d28117d Binary files /dev/null and b/res/drawable-hdpi/k31.png differ diff --git a/res/drawable-hdpi/k32.png b/res/drawable-hdpi/k32.png new file mode 100644 index 0000000..aeb449e Binary files /dev/null and b/res/drawable-hdpi/k32.png differ diff --git a/res/drawable-hdpi/k33.png b/res/drawable-hdpi/k33.png new file mode 100644 index 0000000..829f8c9 Binary files /dev/null and b/res/drawable-hdpi/k33.png differ diff --git a/res/drawable-hdpi/k34.png b/res/drawable-hdpi/k34.png new file mode 100644 index 0000000..24932a1 Binary files /dev/null and b/res/drawable-hdpi/k34.png differ diff --git a/res/drawable-hdpi/k35.png b/res/drawable-hdpi/k35.png new file mode 100644 index 0000000..7223fb6 Binary files /dev/null and b/res/drawable-hdpi/k35.png differ diff --git a/res/drawable-hdpi/k36.png b/res/drawable-hdpi/k36.png new file mode 100644 index 0000000..4a859f8 Binary files /dev/null and b/res/drawable-hdpi/k36.png differ diff --git a/res/drawable-hdpi/k37.png b/res/drawable-hdpi/k37.png new file mode 100644 index 0000000..af2a992 Binary files /dev/null and b/res/drawable-hdpi/k37.png differ diff --git a/res/drawable-hdpi/k38.png b/res/drawable-hdpi/k38.png new file mode 100644 index 0000000..4260d22 Binary files /dev/null and b/res/drawable-hdpi/k38.png differ diff --git a/res/drawable-hdpi/k39.png b/res/drawable-hdpi/k39.png new file mode 100644 index 0000000..0e78388 Binary files /dev/null and b/res/drawable-hdpi/k39.png differ diff --git a/res/drawable-hdpi/k40.png b/res/drawable-hdpi/k40.png new file mode 100644 index 0000000..a4d6e1b Binary files /dev/null and b/res/drawable-hdpi/k40.png differ diff --git a/res/drawable-hdpi/k41.png b/res/drawable-hdpi/k41.png new file mode 100644 index 0000000..b1b7885 Binary files /dev/null and b/res/drawable-hdpi/k41.png differ diff --git a/res/drawable-hdpi/k42.png b/res/drawable-hdpi/k42.png new file mode 100644 index 0000000..5295987 Binary files /dev/null and b/res/drawable-hdpi/k42.png differ diff --git a/res/drawable-hdpi/k43.png b/res/drawable-hdpi/k43.png new file mode 100644 index 0000000..17ea26e Binary files /dev/null and b/res/drawable-hdpi/k43.png differ diff --git a/res/drawable-hdpi/k44.png b/res/drawable-hdpi/k44.png new file mode 100644 index 0000000..878a5b6 Binary files /dev/null and b/res/drawable-hdpi/k44.png differ diff --git a/res/drawable-hdpi/k45.png b/res/drawable-hdpi/k45.png new file mode 100644 index 0000000..9075811 Binary files /dev/null and b/res/drawable-hdpi/k45.png differ diff --git a/res/drawable-hdpi/k46.png b/res/drawable-hdpi/k46.png new file mode 100644 index 0000000..1d1932f Binary files /dev/null and b/res/drawable-hdpi/k46.png differ diff --git a/res/drawable-hdpi/k47.png b/res/drawable-hdpi/k47.png new file mode 100644 index 0000000..225621f Binary files /dev/null and b/res/drawable-hdpi/k47.png differ diff --git a/res/drawable-hdpi/k48.png b/res/drawable-hdpi/k48.png new file mode 100644 index 0000000..7fcf19c Binary files /dev/null and b/res/drawable-hdpi/k48.png differ diff --git a/res/drawable-hdpi/k49.png b/res/drawable-hdpi/k49.png new file mode 100644 index 0000000..cefea7a Binary files /dev/null and b/res/drawable-hdpi/k49.png differ diff --git a/res/drawable-large/icon.png b/res/drawable-large/icon.png new file mode 100644 index 0000000..349d390 Binary files /dev/null and b/res/drawable-large/icon.png differ diff --git a/res/drawable-large/k01.png b/res/drawable-large/k01.png new file mode 100644 index 0000000..83a1fbb Binary files /dev/null and b/res/drawable-large/k01.png differ diff --git a/res/drawable-large/k02.png b/res/drawable-large/k02.png new file mode 100644 index 0000000..276daa7 Binary files /dev/null and b/res/drawable-large/k02.png differ diff --git a/res/drawable-large/k03.png b/res/drawable-large/k03.png new file mode 100644 index 0000000..1f70144 Binary files /dev/null and b/res/drawable-large/k03.png differ diff --git a/res/drawable-large/k04.png b/res/drawable-large/k04.png new file mode 100644 index 0000000..96aa257 Binary files /dev/null and b/res/drawable-large/k04.png differ diff --git a/res/drawable-large/k05.png b/res/drawable-large/k05.png new file mode 100644 index 0000000..44a1685 Binary files /dev/null and b/res/drawable-large/k05.png differ diff --git a/res/drawable-large/k06.png b/res/drawable-large/k06.png new file mode 100644 index 0000000..60446ad Binary files /dev/null and b/res/drawable-large/k06.png differ diff --git a/res/drawable-large/k07.png b/res/drawable-large/k07.png new file mode 100644 index 0000000..d4b7ce2 Binary files /dev/null and b/res/drawable-large/k07.png differ diff --git a/res/drawable-large/k08.png b/res/drawable-large/k08.png new file mode 100644 index 0000000..11d7d97 Binary files /dev/null and b/res/drawable-large/k08.png differ diff --git a/res/drawable-large/k09.png b/res/drawable-large/k09.png new file mode 100644 index 0000000..817e7e4 Binary files /dev/null and b/res/drawable-large/k09.png differ diff --git a/res/drawable-large/k10.png b/res/drawable-large/k10.png new file mode 100644 index 0000000..bd0bde9 Binary files /dev/null and b/res/drawable-large/k10.png differ diff --git a/res/drawable-large/k11.png b/res/drawable-large/k11.png new file mode 100644 index 0000000..c33a184 Binary files /dev/null and b/res/drawable-large/k11.png differ diff --git a/res/drawable-large/k12.png b/res/drawable-large/k12.png new file mode 100644 index 0000000..41e531a Binary files /dev/null and b/res/drawable-large/k12.png differ diff --git a/res/drawable-large/k13.png b/res/drawable-large/k13.png new file mode 100644 index 0000000..9899e68 Binary files /dev/null and b/res/drawable-large/k13.png differ diff --git a/res/drawable-large/k14.png b/res/drawable-large/k14.png new file mode 100644 index 0000000..bf6d4ba Binary files /dev/null and b/res/drawable-large/k14.png differ diff --git a/res/drawable-large/k15.png b/res/drawable-large/k15.png new file mode 100644 index 0000000..1209673 Binary files /dev/null and b/res/drawable-large/k15.png differ diff --git a/res/drawable-large/k16.png b/res/drawable-large/k16.png new file mode 100644 index 0000000..f21c67f Binary files /dev/null and b/res/drawable-large/k16.png differ diff --git a/res/drawable-large/k17.png b/res/drawable-large/k17.png new file mode 100644 index 0000000..2214c57 Binary files /dev/null and b/res/drawable-large/k17.png differ diff --git a/res/drawable-large/k18.png b/res/drawable-large/k18.png new file mode 100644 index 0000000..65f8f6d Binary files /dev/null and b/res/drawable-large/k18.png differ diff --git a/res/drawable-large/k19.png b/res/drawable-large/k19.png new file mode 100644 index 0000000..b0f3ca6 Binary files /dev/null and b/res/drawable-large/k19.png differ diff --git a/res/drawable-large/k20.png b/res/drawable-large/k20.png new file mode 100644 index 0000000..2aec56c Binary files /dev/null and b/res/drawable-large/k20.png differ diff --git a/res/drawable-large/k21.png b/res/drawable-large/k21.png new file mode 100644 index 0000000..68a70eb Binary files /dev/null and b/res/drawable-large/k21.png differ diff --git a/res/drawable-large/k22.png b/res/drawable-large/k22.png new file mode 100644 index 0000000..0a5efb4 Binary files /dev/null and b/res/drawable-large/k22.png differ diff --git a/res/drawable-large/k23.png b/res/drawable-large/k23.png new file mode 100644 index 0000000..20edd5b Binary files /dev/null and b/res/drawable-large/k23.png differ diff --git a/res/drawable-large/k24.png b/res/drawable-large/k24.png new file mode 100644 index 0000000..17585d7 Binary files /dev/null and b/res/drawable-large/k24.png differ diff --git a/res/drawable-large/k25.png b/res/drawable-large/k25.png new file mode 100644 index 0000000..9015e78 Binary files /dev/null and b/res/drawable-large/k25.png differ diff --git a/res/drawable-large/k26.png b/res/drawable-large/k26.png new file mode 100644 index 0000000..66ebcfe Binary files /dev/null and b/res/drawable-large/k26.png differ diff --git a/res/drawable-large/k27.png b/res/drawable-large/k27.png new file mode 100644 index 0000000..9f348ce Binary files /dev/null and b/res/drawable-large/k27.png differ diff --git a/res/drawable-large/k28.png b/res/drawable-large/k28.png new file mode 100644 index 0000000..049d89f Binary files /dev/null and b/res/drawable-large/k28.png differ diff --git a/res/drawable-large/k29.png b/res/drawable-large/k29.png new file mode 100644 index 0000000..579122d Binary files /dev/null and b/res/drawable-large/k29.png differ diff --git a/res/drawable-large/k30.png b/res/drawable-large/k30.png new file mode 100644 index 0000000..d8718ea Binary files /dev/null and b/res/drawable-large/k30.png differ diff --git a/res/drawable-large/k31.png b/res/drawable-large/k31.png new file mode 100644 index 0000000..d28117d Binary files /dev/null and b/res/drawable-large/k31.png differ diff --git a/res/drawable-large/k32.png b/res/drawable-large/k32.png new file mode 100644 index 0000000..aeb449e Binary files /dev/null and b/res/drawable-large/k32.png differ diff --git a/res/drawable-large/k33.png b/res/drawable-large/k33.png new file mode 100644 index 0000000..829f8c9 Binary files /dev/null and b/res/drawable-large/k33.png differ diff --git a/res/drawable-large/k34.png b/res/drawable-large/k34.png new file mode 100644 index 0000000..24932a1 Binary files /dev/null and b/res/drawable-large/k34.png differ diff --git a/res/drawable-large/k35.png b/res/drawable-large/k35.png new file mode 100644 index 0000000..7223fb6 Binary files /dev/null and b/res/drawable-large/k35.png differ diff --git a/res/drawable-large/k36.png b/res/drawable-large/k36.png new file mode 100644 index 0000000..4a859f8 Binary files /dev/null and b/res/drawable-large/k36.png differ diff --git a/res/drawable-large/k37.png b/res/drawable-large/k37.png new file mode 100644 index 0000000..af2a992 Binary files /dev/null and b/res/drawable-large/k37.png differ diff --git a/res/drawable-large/k38.png b/res/drawable-large/k38.png new file mode 100644 index 0000000..4260d22 Binary files /dev/null and b/res/drawable-large/k38.png differ diff --git a/res/drawable-large/k39.png b/res/drawable-large/k39.png new file mode 100644 index 0000000..0e78388 Binary files /dev/null and b/res/drawable-large/k39.png differ diff --git a/res/drawable-large/k40.png b/res/drawable-large/k40.png new file mode 100644 index 0000000..a4d6e1b Binary files /dev/null and b/res/drawable-large/k40.png differ diff --git a/res/drawable-large/k41.png b/res/drawable-large/k41.png new file mode 100644 index 0000000..b1b7885 Binary files /dev/null and b/res/drawable-large/k41.png differ diff --git a/res/drawable-large/k42.png b/res/drawable-large/k42.png new file mode 100644 index 0000000..5295987 Binary files /dev/null and b/res/drawable-large/k42.png differ diff --git a/res/drawable-large/k43.png b/res/drawable-large/k43.png new file mode 100644 index 0000000..17ea26e Binary files /dev/null and b/res/drawable-large/k43.png differ diff --git a/res/drawable-large/k44.png b/res/drawable-large/k44.png new file mode 100644 index 0000000..878a5b6 Binary files /dev/null and b/res/drawable-large/k44.png differ diff --git a/res/drawable-large/k45.png b/res/drawable-large/k45.png new file mode 100644 index 0000000..9075811 Binary files /dev/null and b/res/drawable-large/k45.png differ diff --git a/res/drawable-large/k46.png b/res/drawable-large/k46.png new file mode 100644 index 0000000..1d1932f Binary files /dev/null and b/res/drawable-large/k46.png differ diff --git a/res/drawable-large/k47.png b/res/drawable-large/k47.png new file mode 100644 index 0000000..225621f Binary files /dev/null and b/res/drawable-large/k47.png differ diff --git a/res/drawable-large/k48.png b/res/drawable-large/k48.png new file mode 100644 index 0000000..7fcf19c Binary files /dev/null and b/res/drawable-large/k48.png differ diff --git a/res/drawable-large/k49.png b/res/drawable-large/k49.png new file mode 100644 index 0000000..cefea7a Binary files /dev/null and b/res/drawable-large/k49.png differ diff --git a/res/drawable/alert_dialog_icon.png b/res/drawable/alert_dialog_icon.png new file mode 100644 index 0000000..0a7de04 Binary files /dev/null and b/res/drawable/alert_dialog_icon.png differ diff --git a/res/drawable/ann01.png b/res/drawable/ann01.png new file mode 100644 index 0000000..db34c70 Binary files /dev/null and b/res/drawable/ann01.png differ diff --git a/res/drawable/ann02.png b/res/drawable/ann02.png new file mode 100644 index 0000000..dfffb74 Binary files /dev/null and b/res/drawable/ann02.png differ diff --git a/res/drawable/ann03.png b/res/drawable/ann03.png new file mode 100644 index 0000000..64391b9 Binary files /dev/null and b/res/drawable/ann03.png differ diff --git a/res/drawable/ann04.png b/res/drawable/ann04.png new file mode 100644 index 0000000..5714737 Binary files /dev/null and b/res/drawable/ann04.png differ diff --git a/res/drawable/ann05.png b/res/drawable/ann05.png new file mode 100644 index 0000000..2bbdd8f Binary files /dev/null and b/res/drawable/ann05.png differ diff --git a/res/drawable/ann06.png b/res/drawable/ann06.png new file mode 100644 index 0000000..5f5e071 Binary files /dev/null and b/res/drawable/ann06.png differ diff --git a/res/drawable/file.png b/res/drawable/file.png new file mode 100644 index 0000000..35d0e0d Binary files /dev/null and b/res/drawable/file.png differ diff --git a/res/drawable/folder.png b/res/drawable/folder.png new file mode 100644 index 0000000..0a1a038 Binary files /dev/null and b/res/drawable/folder.png differ diff --git a/res/drawable/icon.png b/res/drawable/icon.png new file mode 100644 index 0000000..9099e2a Binary files /dev/null and b/res/drawable/icon.png differ diff --git a/res/drawable/k01.png b/res/drawable/k01.png new file mode 100644 index 0000000..187a247 Binary files /dev/null and b/res/drawable/k01.png differ diff --git a/res/drawable/k02.png b/res/drawable/k02.png new file mode 100644 index 0000000..cdb499d Binary files /dev/null and b/res/drawable/k02.png differ diff --git a/res/drawable/k03.png b/res/drawable/k03.png new file mode 100644 index 0000000..5c075be Binary files /dev/null and b/res/drawable/k03.png differ diff --git a/res/drawable/k04.png b/res/drawable/k04.png new file mode 100644 index 0000000..3fa914b Binary files /dev/null and b/res/drawable/k04.png differ diff --git a/res/drawable/k05.png b/res/drawable/k05.png new file mode 100644 index 0000000..53c0fae Binary files /dev/null and b/res/drawable/k05.png differ diff --git a/res/drawable/k06.png b/res/drawable/k06.png new file mode 100644 index 0000000..f426608 Binary files /dev/null and b/res/drawable/k06.png differ diff --git a/res/drawable/k07.png b/res/drawable/k07.png new file mode 100644 index 0000000..fd8d5ff Binary files /dev/null and b/res/drawable/k07.png differ diff --git a/res/drawable/k08.png b/res/drawable/k08.png new file mode 100644 index 0000000..ada7b6e Binary files /dev/null and b/res/drawable/k08.png differ diff --git a/res/drawable/k09.png b/res/drawable/k09.png new file mode 100644 index 0000000..92faa3a Binary files /dev/null and b/res/drawable/k09.png differ diff --git a/res/drawable/k10.png b/res/drawable/k10.png new file mode 100644 index 0000000..7c0a2ad Binary files /dev/null and b/res/drawable/k10.png differ diff --git a/res/drawable/k11.png b/res/drawable/k11.png new file mode 100644 index 0000000..5b16de9 Binary files /dev/null and b/res/drawable/k11.png differ diff --git a/res/drawable/k12.png b/res/drawable/k12.png new file mode 100644 index 0000000..ea5d103 Binary files /dev/null and b/res/drawable/k12.png differ diff --git a/res/drawable/k13.png b/res/drawable/k13.png new file mode 100644 index 0000000..d3fa43d Binary files /dev/null and b/res/drawable/k13.png differ diff --git a/res/drawable/k14.png b/res/drawable/k14.png new file mode 100644 index 0000000..c8d6fc2 Binary files /dev/null and b/res/drawable/k14.png differ diff --git a/res/drawable/k15.png b/res/drawable/k15.png new file mode 100644 index 0000000..d990a65 Binary files /dev/null and b/res/drawable/k15.png differ diff --git a/res/drawable/k16.png b/res/drawable/k16.png new file mode 100644 index 0000000..ac8341f Binary files /dev/null and b/res/drawable/k16.png differ diff --git a/res/drawable/k17.png b/res/drawable/k17.png new file mode 100644 index 0000000..6920831 Binary files /dev/null and b/res/drawable/k17.png differ diff --git a/res/drawable/k18.png b/res/drawable/k18.png new file mode 100644 index 0000000..465150a Binary files /dev/null and b/res/drawable/k18.png differ diff --git a/res/drawable/k19.png b/res/drawable/k19.png new file mode 100644 index 0000000..278da27 Binary files /dev/null and b/res/drawable/k19.png differ diff --git a/res/drawable/k20.png b/res/drawable/k20.png new file mode 100644 index 0000000..9c3e6ae Binary files /dev/null and b/res/drawable/k20.png differ diff --git a/res/drawable/k21.png b/res/drawable/k21.png new file mode 100644 index 0000000..41e3e90 Binary files /dev/null and b/res/drawable/k21.png differ diff --git a/res/drawable/k22.png b/res/drawable/k22.png new file mode 100644 index 0000000..7e70834 Binary files /dev/null and b/res/drawable/k22.png differ diff --git a/res/drawable/k23.png b/res/drawable/k23.png new file mode 100644 index 0000000..99a1d5f Binary files /dev/null and b/res/drawable/k23.png differ diff --git a/res/drawable/k24.png b/res/drawable/k24.png new file mode 100644 index 0000000..c84fee7 Binary files /dev/null and b/res/drawable/k24.png differ diff --git a/res/drawable/k25.png b/res/drawable/k25.png new file mode 100644 index 0000000..7108b81 Binary files /dev/null and b/res/drawable/k25.png differ diff --git a/res/drawable/k26.png b/res/drawable/k26.png new file mode 100644 index 0000000..aa9fa44 Binary files /dev/null and b/res/drawable/k26.png differ diff --git a/res/drawable/k27.png b/res/drawable/k27.png new file mode 100644 index 0000000..685ee4d Binary files /dev/null and b/res/drawable/k27.png differ diff --git a/res/drawable/k28.png b/res/drawable/k28.png new file mode 100644 index 0000000..5d80a23 Binary files /dev/null and b/res/drawable/k28.png differ diff --git a/res/drawable/k29.png b/res/drawable/k29.png new file mode 100644 index 0000000..ce67786 Binary files /dev/null and b/res/drawable/k29.png differ diff --git a/res/drawable/k30.png b/res/drawable/k30.png new file mode 100644 index 0000000..330ae92 Binary files /dev/null and b/res/drawable/k30.png differ diff --git a/res/drawable/k31.png b/res/drawable/k31.png new file mode 100644 index 0000000..58833e7 Binary files /dev/null and b/res/drawable/k31.png differ diff --git a/res/drawable/k32.png b/res/drawable/k32.png new file mode 100644 index 0000000..19c18a0 Binary files /dev/null and b/res/drawable/k32.png differ diff --git a/res/drawable/k33.png b/res/drawable/k33.png new file mode 100644 index 0000000..cbb9b44 Binary files /dev/null and b/res/drawable/k33.png differ diff --git a/res/drawable/k34.png b/res/drawable/k34.png new file mode 100644 index 0000000..b0f92e3 Binary files /dev/null and b/res/drawable/k34.png differ diff --git a/res/drawable/k35.png b/res/drawable/k35.png new file mode 100644 index 0000000..b514f55 Binary files /dev/null and b/res/drawable/k35.png differ diff --git a/res/drawable/k36.png b/res/drawable/k36.png new file mode 100644 index 0000000..d2058b4 Binary files /dev/null and b/res/drawable/k36.png differ diff --git a/res/drawable/k37.png b/res/drawable/k37.png new file mode 100644 index 0000000..0f0a623 Binary files /dev/null and b/res/drawable/k37.png differ diff --git a/res/drawable/k38.png b/res/drawable/k38.png new file mode 100644 index 0000000..732a98e Binary files /dev/null and b/res/drawable/k38.png differ diff --git a/res/drawable/k39.png b/res/drawable/k39.png new file mode 100644 index 0000000..036676d Binary files /dev/null and b/res/drawable/k39.png differ diff --git a/res/drawable/k40.png b/res/drawable/k40.png new file mode 100644 index 0000000..716add1 Binary files /dev/null and b/res/drawable/k40.png differ diff --git a/res/drawable/k41.png b/res/drawable/k41.png new file mode 100644 index 0000000..b639a62 Binary files /dev/null and b/res/drawable/k41.png differ diff --git a/res/drawable/k42.png b/res/drawable/k42.png new file mode 100644 index 0000000..9c0461c Binary files /dev/null and b/res/drawable/k42.png differ diff --git a/res/drawable/k43.png b/res/drawable/k43.png new file mode 100644 index 0000000..4ab0d3f Binary files /dev/null and b/res/drawable/k43.png differ diff --git a/res/drawable/k44.png b/res/drawable/k44.png new file mode 100644 index 0000000..d85381e Binary files /dev/null and b/res/drawable/k44.png differ diff --git a/res/drawable/k45.png b/res/drawable/k45.png new file mode 100644 index 0000000..c7d04bb Binary files /dev/null and b/res/drawable/k45.png differ diff --git a/res/drawable/k46.png b/res/drawable/k46.png new file mode 100644 index 0000000..45e0e82 Binary files /dev/null and b/res/drawable/k46.png differ diff --git a/res/drawable/k47.png b/res/drawable/k47.png new file mode 100644 index 0000000..702402f Binary files /dev/null and b/res/drawable/k47.png differ diff --git a/res/drawable/k48.png b/res/drawable/k48.png new file mode 100644 index 0000000..e7c12e2 Binary files /dev/null and b/res/drawable/k48.png differ diff --git a/res/drawable/k49.png b/res/drawable/k49.png new file mode 100644 index 0000000..3e2d5d1 Binary files /dev/null and b/res/drawable/k49.png differ diff --git a/res/drawable/parent.png b/res/drawable/parent.png new file mode 100644 index 0000000..d83a257 Binary files /dev/null and b/res/drawable/parent.png differ diff --git a/res/drawable/sym_keyboard_delete.png b/res/drawable/sym_keyboard_delete.png new file mode 100644 index 0000000..6cee596 Binary files /dev/null and b/res/drawable/sym_keyboard_delete.png differ diff --git a/res/drawable/sym_keyboard_done.png b/res/drawable/sym_keyboard_done.png new file mode 100644 index 0000000..c0d6d13 Binary files /dev/null and b/res/drawable/sym_keyboard_done.png differ diff --git a/res/drawable/sym_keyboard_return.png b/res/drawable/sym_keyboard_return.png new file mode 100644 index 0000000..cbe2b15 Binary files /dev/null and b/res/drawable/sym_keyboard_return.png differ diff --git a/res/drawable/sym_keyboard_search.png b/res/drawable/sym_keyboard_search.png new file mode 100644 index 0000000..127755d Binary files /dev/null and b/res/drawable/sym_keyboard_search.png differ diff --git a/res/drawable/sym_keyboard_shift.png b/res/drawable/sym_keyboard_shift.png new file mode 100644 index 0000000..d059628 Binary files /dev/null and b/res/drawable/sym_keyboard_shift.png differ diff --git a/res/drawable/sym_keyboard_space.png b/res/drawable/sym_keyboard_space.png new file mode 100644 index 0000000..09b94d9 Binary files /dev/null and b/res/drawable/sym_keyboard_space.png differ diff --git a/res/drawable/touch.png b/res/drawable/touch.png new file mode 100644 index 0000000..84fdc9c Binary files /dev/null and b/res/drawable/touch.png differ diff --git a/res/layout/file_row.xml b/res/layout/file_row.xml new file mode 100644 index 0000000..4effaff --- /dev/null +++ b/res/layout/file_row.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/res/layout/main.xml b/res/layout/main.xml new file mode 100644 index 0000000..93c04c8 --- /dev/null +++ b/res/layout/main.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/res/values/colors.xml b/res/values/colors.xml new file mode 100644 index 0000000..74d103a --- /dev/null +++ b/res/values/colors.xml @@ -0,0 +1,25 @@ + + + + #FF000000 + #FFE35900 + #ff808080 + #bbffffff + \ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml new file mode 100644 index 0000000..88eefdd --- /dev/null +++ b/res/values/dimens.xml @@ -0,0 +1,25 @@ + + + + + 61dip + 16sp + 6sp + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000..23d9a9a --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,43 @@ + + +Droid48 +Put program on stack +Save memory/state +This emulator need a ROM to run. HP-ROM files are copyrighted by Hewlett Packard. But since fall 2000 HP ACO allowed the non commercial use of the HP48 ROM\'s even if you\'re not an owner of this calculator type. This download button will download and install the rom from the hpcalc.org site. +Download and install ROM from HPcalc.org +Quit +Reset memory and quit +Help +Ok +The program/object has been put on the stack.\nNow, some HP knowledge is necessary:\n\n- if this is a library, push 0, then STO and shut down (right shift + on) / restart (on) the calculator: the program will be available in the Library (shift right + 2) menu.\n\n- If this is a regular object (dir, external, etc.), push a name between quotes on the stack (for example, \'prog\'), then push STO: the prog will be available in the VAR menu +This program cannot be loaded.\nMake sure it\'s a valid one and you have enough memory to load it +Rom files not found! This shouldn\'t happen :\\. Quitting now... +General settings +Contrast +Select the contrast +Back key behavior +Choose the action when back is pressed +No program popup +No message box after loading +Settings +For advanced users: Ports settings +Port1 setting +Port2 setting +Choose an installation option +The ram cards cannot be install on internal memory +You need to quit this program to enable your ram cards.\nWARNING: you will experience an HP shutdown on the first restart ! Don\'t panic, it\'s normal, just press the "ON" button on the HP interface.\nYou might want to save the memory after this. +0128 +None/Delete128kB +012825651210244096 +None/Delete128kB256kB512kB1MB4MB +012 +Original HPDefaultLighter +012 +Quit programDrop buttonON button (cancel) +Save on exit +Show/hide numpad + +You can also tap the LCD screen, more convenient ! +Save memory and stack on exit +Enable Haptic Feedback + diff --git a/res/xml/state0.xml b/res/xml/state0.xml new file mode 100644 index 0000000..f9cb943 --- /dev/null +++ b/res/xml/state0.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/xml/state1.xml b/res/xml/state1.xml new file mode 100644 index 0000000..6e9e34d --- /dev/null +++ b/res/xml/state1.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/org/ab/x48/AssetUtil.java b/src/org/ab/x48/AssetUtil.java new file mode 100644 index 0000000..d6686de --- /dev/null +++ b/src/org/ab/x48/AssetUtil.java @@ -0,0 +1,78 @@ +package org.ab.x48; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; + +import android.content.res.AssetManager; +import android.util.Log; + +public class AssetUtil { + + public static void copyAsset(AssetManager am, boolean force) { + File sd = new File("/sdcard"); + if (sd.exists() && sd.isDirectory()) { + File hpDir = new File("/sdcard/.hp48"); + copyAsset(am, hpDir.exists() || hpDir.mkdir(), force); + } else { + copyAsset(am, false, force); + } + } + + public static File getSDDir() { + File hpDir = new File("/sdcard/.hp48"); + if (hpDir.exists()) + return hpDir; + return null; + } + + public static void copyAsset(AssetManager am, boolean sd, boolean force) { + try { + String assets[] = am.list( "" ); + for( int i = 0 ; i < assets.length ; i++ ) { + boolean hp48 = assets[i].equals("hp48"); + boolean ram = assets[i].equals("ram"); + boolean rom = assets[i].equals("rom"); + int required = 0; + if (ram) + required = 131072; + else if (rom) + required = 524288; + //boolean SKUNK = assets[i].equals("SKUNK"); + if (hp48 || rom || ram) { + String rep = sd?"/sdcard/.hp48/":"/data/data/org.ab.x48/"; + File fout = new File(rep + assets[i]); + if (!fout.exists() || fout.length() == 0 || (required > 0 && fout.length() != required) || force) { + Log.i("x48", "Overwriting " + assets[i]); + FileOutputStream out = new FileOutputStream(fout); + InputStream in = am.open(assets[i]); + byte buffer [] = new byte [8192]; + int n = -1; + while ((n=in.read(buffer)) > -1) { + out.write(buffer, 0, n); + } + out.close(); + in.close(); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static boolean isFilesReady() { + File hpDir = new File("/sdcard/.hp48"); + if (!hpDir.exists() || !hpDir.isDirectory()) { + hpDir = new File("/data/data/org.ab.x48/"); + if (!hpDir.exists() || !hpDir.isDirectory()) + return false; + } + File hp = new File(hpDir, "hp48"); + File rom = new File(hpDir, "rom"); + File ram = new File(hpDir, "ram"); + return hp.exists() && hp.length() > 0 && rom.exists() && rom.length() > 0 && ram.exists() && ram.length() > 0; + } + +} diff --git a/src/org/ab/x48/EmulatorThread.java b/src/org/ab/x48/EmulatorThread.java new file mode 100644 index 0000000..2f42537 --- /dev/null +++ b/src/org/ab/x48/EmulatorThread.java @@ -0,0 +1,18 @@ +package org.ab.x48; + +import android.content.Context; + +public class EmulatorThread extends Thread { + + private X48 x48; + + public EmulatorThread(Context x48) { + this.x48 = (X48) x48; + } + + public void run() { + x48.registerClass(x48); + x48.startHPEmulator(); + } + +} diff --git a/src/org/ab/x48/HPView.java b/src/org/ab/x48/HPView.java new file mode 100644 index 0000000..e4caca8 --- /dev/null +++ b/src/org/ab/x48/HPView.java @@ -0,0 +1,1061 @@ +package org.ab.x48; + +import java.nio.ShortBuffer; +import java.util.List; +import java.util.Vector; + +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Paint.Style; +import android.preference.PreferenceManager; +import android.util.AttributeSet; +import android.util.Log; +import android.view.HapticFeedbackConstants; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.SurfaceHolder; +import android.view.SurfaceView; + +public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runnable { + + private static final int MAX_TOUCHES = 49; + private static EmulatorThread thread; + private Thread drawThread; + private X48 x48; + private Bitmap mainScreen; + private SurfaceHolder mSurfaceHolder; + //private Bitmap mBackgroundImage; + //private Bitmap mBackgroundImageLand; + //private Bitmap mTouchImage; + private Bitmap annImages []; + boolean ann []; + int ann_pos [] = { 62, 105, 152, 197, 244, 287 }; + private List queuedCodes; + private boolean touches [] = new boolean [MAX_TOUCHES]; + //private int touches_x [] = new int [MAX_TOUCHES]; + //private int touches_y [] = new int [MAX_TOUCHES]; + + private short buf []; + private int currentOrientation; + + //private float scaleX = 1.0f; + //private float scaleY = 1.0f; + + int buttons_coords [][] = new int [MAX_TOUCHES][4]; + int icons_coords [][] = new int [6][2]; + /*int screen_coord [] = new int[2]; + float screen_factor_x = 1; + float back_factor_x = 1; + + float screen_factor_y = 1; + float back_factor_y = 1; + + int buttons_coords_land [][] = new int [MAX_TOUCHES][4]; + int icons_coords_land [][] = new int [6][2]; + int screen_coord_land [] = new int[2]; + float screen_factor_land_x = 1; + float back_factor_land_x = 1; + + float screen_factor_land_y = 1; + float back_factor_land_y = 1;*/ + + Matrix matrixScreen; + Matrix matrixBack; + Paint paint; + + public HPView(Context context, AttributeSet attrs) { + super(context, attrs); + setFocusable(true); + setFocusableInTouchMode(true); + x48 = ((X48) context); + mSurfaceHolder = getHolder(); + mSurfaceHolder.addCallback(this); + mainScreen = Bitmap.createBitmap(262, 14+128, Bitmap.Config.RGB_565); + queuedCodes = new Vector(); + ann = new boolean [6]; + buf = new short [(14+128)*262]; + annImages = new Bitmap [6]; + updateContrast(); + matrixScreen = new Matrix(); + matrixBack= new Matrix(); + annImages [0] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann01); + annImages [1] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann02); + annImages [2] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann03); + annImages [3] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann04); + annImages [4] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann05); + annImages [5] = BitmapFactory.decodeResource(x48.getResources(), R.drawable.ann06); + // mBackgroundImageLand = BitmapFactory.decodeResource(x48.getResources(), R.drawable.skin_landscape); + //mBackgroundImage = BitmapFactory.decodeResource(x48.getResources(), R.drawable.skin); + + for(int i=0;i 750 || height > 750) && mBackgroundImage.getWidth() == 480) //hdpi mode + { + screen_factor_x = 1.5f; + screen_factor_y = 1.5f; + screen_factor_land_x = 1.5f; + screen_factor_land_y = 1.5f; + + ratio_x = (float) width / 480; + if (height < width) // land + ratio_x = (float) width / 800; + + ratio_y = ratio_x; + + + back_factor_x = ratio_x; + back_factor_y = ratio_y; + back_factor_land_x = ratio_x; + back_factor_land_y = ratio_y; + + screen_factor_land_x = screen_factor_land_x * ratio_x; + screen_factor_land_y = screen_factor_land_y * ratio_y; + buttons_coords = new int [][] { + {0, 215, 80, 274}, + {80, 215, 160, 274}, + {160, 215, 240, 274}, + {240, 215, 320, 274}, + {320, 215, 400, 274}, + {400, 215, 480, 274}, + {0, 274, 80, 336}, + {80, 274, 160, 336}, + {160, 274, 240, 336}, + {240, 274, 320, 336}, + {320, 274, 400, 336}, + {400, 274, 480, 336}, + {0, 336, 80, 396}, + {80, 336, 160, 396}, + {160, 336, 240, 396}, + {240, 336, 320, 396}, + {320, 336, 400, 396}, + {400, 336, 480, 396}, + {0, 396, 80, 454}, + {80, 396, 160, 454}, + {160, 396, 240, 454}, + {240, 396, 320, 454}, + {320, 396, 400, 454}, + {400, 396, 480, 454}, + {0, 454, 160, 514}, // enter + {160, 454, 240, 514}, + {240, 454, 320, 514}, + {320, 454, 400, 514}, + {400, 454, 480, 514}, + {0, 514, 96, 576}, + {96, 514, 192, 576}, + {192, 514, 288, 576}, + {288, 514, 384, 576}, + {384, 514, 480, 576}, + {0, 576, 96, 638}, + {96, 576, 192, 638}, + {192, 576, 288, 638}, + {288, 576, 384, 638}, + {384, 576, 480, 638}, + {0, 638, 96, 698}, + {96, 638, 192, 698}, + {192, 638, 288, 698}, + {288, 638, 384, 698}, + {384, 638, 480, 698}, + {0, 698, 96, 1000}, + {96, 698, 192, 1000}, + {192, 698, 288, 1000}, + {288, 698, 384, 1000}, + {384, 698, 480, 1000} + }; + } else { + for(int i=0;i 2) + c = 2; + setContrast(0.5 * c); + //x48.flipScreen(); + } + + private void setContrast(double contrast_factor) { + x48.setBlankColor( (short) (((int)(15*contrast_factor+16) << 11) + ((int)(30*contrast_factor+33) << 5) + (int)(15*contrast_factor+13))); + } + + //private short data []; + private Bitmap keys [] = new Bitmap[MAX_TOUCHES]; + private Bitmap backBuffer; + private boolean newBuffer = true; + + public void refreshMainScreen(short data []) { + Canvas c = null; + try { + c = mSurfaceHolder.lockCanvas(null); + synchronized (mSurfaceHolder) { + boolean land = currentOrientation == Configuration.ORIENTATION_LANDSCAPE; + + if (c != null) { + + if (land) { + keybLite = false; + } + + if (newBuffer) { + if (backBuffer == null) { + Log.i("x48", "init backBuffer !: " + keybLite); + backBuffer = Bitmap.createBitmap(c.getWidth(), c.getHeight(), Bitmap.Config.ARGB_8888); + Canvas backCanvas = new Canvas(backBuffer); + + int w = backBuffer.getWidth(); + int h = backBuffer.getHeight(); + Paint p = new Paint(); + int srcColor = Color.rgb(48, 56, 72); + p.setColor(srcColor); + backCanvas.drawRect(0, 0, w, h, p); + float lcd_ratio = (land?h:w) / 131; + int start_w = (int) (131*lcd_ratio); + int start_h = (int) (71*lcd_ratio); + float usable_w = w; + float remaning_w = 0; + float usable_h = h - start_h; + if (land) { + usable_w = ((float)w) * 5f / 9f; + remaning_w = w - usable_w; + } + int lcd_pos_x = land?(((int)usable_w-start_w)/2):((w - start_w)/2); + int lcd_pos_y = 0; + int lcd_pos_x_end = lcd_pos_x+start_w; + int lcd_pos_y_end = lcd_pos_y+start_h; + float regular_key_height = usable_h / (8f + 11f/18f); + float regular_key_height_right = h / 7f; + float menu_key_height = regular_key_height*11/18; + if (land) { + regular_key_height = usable_h / (3f + 11f/18f); + menu_key_height = regular_key_height*11/18; + } + + icons_coords = new int [][] { { lcd_pos_x, 0 }, {(int)(lcd_pos_x+21*lcd_ratio), 0}, {(int)(lcd_pos_x+45*lcd_ratio), 0}, + {(int)(lcd_pos_x+67*lcd_ratio), 0}, {(int)(lcd_pos_x+91*lcd_ratio), 0}, {(int)(lcd_pos_x+112*lcd_ratio), 0} }; + int green = Color.rgb(80, 96, 104); + p.setColor(green); + if (!keybLite) + backCanvas.drawRect(0, 0, usable_w, start_h+menu_key_height, p); + + matrixScreen = new Matrix(); + + matrixScreen.preScale(lcd_ratio/2, lcd_ratio/2); + matrixScreen.postTranslate(lcd_pos_x, lcd_pos_y); + p.setColor(Color.WHITE); + backCanvas.drawRect(lcd_pos_x, lcd_pos_y, lcd_pos_x_end, lcd_pos_y_end, p); + Paint keyPaint = new Paint(); + keyPaint.setFilterBitmap(true); + + for(int k=0;k 24 && k < 29) { + key_width = usable_w / 6; + key_height = regular_key_height; + key_x = key_width*((k+1) % 6); + int rank = ((k+1) / 6); + key_y = start_h + menu_key_height + regular_key_height*(rank-1); + } else if (k >= 29) { + key_width = usable_w / 5; + key_height = regular_key_height; + key_x = key_width*((k+1) % 5); + key_y = start_h + menu_key_height + regular_key_height*(((k+1) / 5)-2); + } + } else if (land) { + if (k == 24) { + key_width = remaning_w / 2; + key_height = regular_key_height_right; + key_x = w-key_width; + int rank = 7; + key_y = regular_key_height_right*(rank-1); + } else if (k == 29 || k == 34 || k == 39 || k == 44) { + key_width = remaning_w / 4; + key_height = regular_key_height_right; + int xrank = 4; + if (k == 34) + xrank = 3; + else if (k == 39) + xrank = 2; + else if (k == 44) + xrank = 1; + key_x = w-key_width*xrank; + key_y = 0; + } else { + key_width = remaning_w / 4; + key_height = regular_key_height_right; + int xrank = 0; + int yrank = 0; + if (k == 25) { + xrank = 4; + yrank = 0; + } else if (k == 26) { + xrank = 3; + yrank = 0; + } else if (k == 27) { + xrank = 2; + yrank = 0; + } else if (k == 28) { + xrank = 1; + yrank = 0; + } else if (k == 30) { + xrank = 4; + yrank = 1; + } else if (k == 31) { + xrank = 3; + yrank = 1; + } else if (k == 32) { + xrank = 2; + yrank = 1; + } else if (k == 33) { + xrank = 1; + yrank = 1; + } else if (k == 35) { + xrank = 4; + yrank = 2; + } else if (k == 36) { + xrank = 3; + yrank = 2; + } else if (k == 37) { + xrank = 2; + yrank = 2; + } else if (k == 38) { + xrank = 1; + yrank = 2; + } else if (k == 40) { + xrank = 4; + yrank = 3; + } else if (k == 41) { + xrank = 3; + yrank = 3; + } else if (k == 42) { + xrank = 2; + yrank = 3; + } else if (k == 43) { + xrank = 1; + yrank = 3; + } else if (k == 45) { + xrank = 4; + yrank = 4; + } else if (k == 46) { + xrank = 3; + yrank = 4; + } else if (k == 47) { + xrank = 2; + yrank = 4; + } else if (k == 48) { + xrank = 1; + yrank = 4; + } + key_x = w-key_width*xrank; + key_y = regular_key_height_right*(2+yrank-1); + } + } + } else { + if (k == 24) { + key_width = w / 2; + key_height = usable_h/5f; + key_x = 0; + key_y = start_h; + } else if (k == 27) { + key_width = w / 4; + key_height = usable_h/5f; + key_x = 2*key_width; + key_y = start_h; + } else if (k == 28) { + key_width = w / 4; + key_height = usable_h/5f; + key_x = 3*key_width; + key_y = start_h; + } else if (k >= 30 && k <= 48 && k !=34 && k != 39 && k !=44) { + key_width = w / 4; + key_height = usable_h/5f; + int xrank = 0; + int yrank = 0; + if (k == 30) { + xrank = 4; + yrank = 1; + } else if (k == 31) { + xrank = 3; + yrank = 1; + } else if (k == 32) { + xrank = 2; + yrank = 1; + } else if (k == 33) { + xrank = 1; + yrank = 1; + } else if (k == 35) { + xrank = 4; + yrank = 2; + } else if (k == 36) { + xrank = 3; + yrank = 2; + } else if (k == 37) { + xrank = 2; + yrank = 2; + } else if (k == 38) { + xrank = 1; + yrank = 2; + } else if (k == 40) { + xrank = 4; + yrank = 3; + } else if (k == 41) { + xrank = 3; + yrank = 3; + } else if (k == 42) { + xrank = 2; + yrank = 3; + } else if (k == 43) { + xrank = 1; + yrank = 3; + } else if (k == 45) { + xrank = 4; + yrank = 4; + } else if (k == 46) { + xrank = 3; + yrank = 4; + } else if (k == 47) { + xrank = 2; + yrank = 4; + } else if (k == 48) { + xrank = 1; + yrank = 4; + } + key_x = key_width*(4-xrank); + key_y = start_h + regular_key_height_right*(yrank); + } else + key_width = 0; + } + if (key_width == 0) { + buttons_coords[k][0] = buttons_coords[k][1] = buttons_coords[k][2] = buttons_coords[k][3] = 0; + continue; + } + buttons_coords[k][0] = (int) key_x; + buttons_coords[k][1] = (int) key_y; + buttons_coords[k][2] = (int) (key_x+key_width); + buttons_coords[k][3] = (int) (key_y+key_height); + int bw = keys[k].getWidth(); + int bh = keys[k].getHeight(); + int delta_x = 0; + int delta_y = 0; + float ratio_kx = 0.0f; + float ratio_ky = 0.0f; + if (bw < (int) key_width) { + delta_x = ((int)key_width-bw)/2; + } else if (bw > (int) key_width) { + //ratio_kx = key_width / (float) bw; + delta_x = ((int)key_width-bw)/2; + } + if (bh < (int) key_height) { + delta_y = ((int)key_height-bh)/2; + } else if (bh > (int) key_height) { + //ratio_ky = key_height / (float) bh; + delta_y = ((int)key_height-bh)/2; + } + if (!keybLite && !land && (k == 30 || k == 31 || k == 32 || + k == 35 || k == 36 || k == 37 || + k == 40 || k == 41 || k == 42 || k == 39)) { + Paint p2 = new Paint(); + p2.setColor(green); + backCanvas.drawRect(buttons_coords[k][0], buttons_coords[k][1], buttons_coords[k][2], buttons_coords[k][3], p2); + } + // slight off: + buttons_coords[k][1] += bh*5/36; + buttons_coords[k][3] += bh*5/36; + Matrix matrixKey = new Matrix(); + if (ratio_kx != 0 && ratio_ky != 0) { + matrixKey.preScale(ratio_kx, ratio_ky); + } + matrixKey.postTranslate(key_x + delta_x, key_y + delta_y); + backCanvas.drawBitmap(keys[k], matrixKey, keyPaint); + + } + } + + c.drawBitmap(backBuffer, 0, 0, null); + if (data != null) + mainScreen.copyPixelsFromBuffer(ShortBuffer.wrap(data)); + c.drawBitmap(mainScreen, matrixScreen, null); + for(int i=0;i= buttons_coords[i][0] && x < buttons_coords[i][2] && y >= buttons_coords[i][1] && y < buttons_coords[i][3]) + { + code = i; + break; + } + } + if (code == -1 && action == MotionEvent.ACTION_DOWN && currentOrientation != Configuration.ORIENTATION_LANDSCAPE ) { + //x48.flipkeyboard(); + keybLite = !keybLite; + backBuffer = null; + refreshMainScreen(null); + return true; + } + } else { + + /*for(int i=0;i= buttons_coords_land[i][0] && x < buttons_coords_land[i][2] && y >= buttons_coords_land[i][1] && y < buttons_coords_land[i][3]) + { + code = i; + break; + } + } + */ + } + + //Log.i("x48", "action: " + action + " code: " + code); + if (code > -1) { + key(code, action == MotionEvent.ACTION_DOWN); + return action == MotionEvent.ACTION_DOWN; + } + } + + return false; + } + + private boolean keybLite = false; + + public synchronized void key(int code, boolean down) { + //Log.i("x48", "code: " + code + " / " + down); + if (code < MAX_TOUCHES) { + if (down) { + for(int i=0;i 0) + refreshMainScreen(data);*/ + if (x48.fillScreenData(buf) == 1) + refreshMainScreen(buf); + } + Log.i("x48", "drawing thread stopped"); + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + //Log.i("x48", "-->"+keyCode); + return actionKey(true, keyCode); + } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + //Log.i("x48", "--<"+keyCode); + return actionKey(false, keyCode); + + } + + private boolean actionKey(boolean d, int code) { + switch (code) { + case KeyEvent.KEYCODE_BACK: { + SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(x48); + String bString = mPrefs.getString("backkey", "0"); + if (bString.equals("0")) + return false; + else if (bString.equals("1")) { + if (d) key(28, true); else key(28, false); return true; + } else if (bString.equals("2")) { + if (d) key(44, true); else key(44, false); return true; + } + } + + case KeyEvent.KEYCODE_0: if (d) key(45, true); else key(45, false); return true; + case KeyEvent.KEYCODE_1: if (d) key(40, true); else key(40, false); return true; + case KeyEvent.KEYCODE_2: if (d) key(41, true); else key(41, false); return true; + case KeyEvent.KEYCODE_3: if (d) key(42, true); else key(42, false); return true; + case KeyEvent.KEYCODE_4: if (d) key(35, true); else key(35, false); return true; + case KeyEvent.KEYCODE_5: if (d) key(36, true); else key(36, false); return true; + case KeyEvent.KEYCODE_6: if (d) key(37, true); else key(37, false); return true; + case KeyEvent.KEYCODE_7: if (d) key(30, true); else key(30, false); return true; + case KeyEvent.KEYCODE_8: if (d) key(31, true); else key(31, false); return true; + case KeyEvent.KEYCODE_9: if (d) key(32, true); else key(32, false); return true; + case KeyEvent.KEYCODE_ENTER: if (d) key(24, true); else key(24, false); return true; + case KeyEvent.KEYCODE_DEL: if (d) key(28, true); else key(28, false); return true; + case KeyEvent.KEYCODE_PERIOD: if (d) key(46, true); else key(46, false); return true; + case KeyEvent.KEYCODE_AT: if (d) key(29, true); else key(29, false); return true; + + case KeyEvent.KEYCODE_A: if (d) key(0, true); else key(0, false); return true; + case KeyEvent.KEYCODE_B: if (d) key(1, true); else key(1, false); return true; + case KeyEvent.KEYCODE_C: if (d) key(2, true); else key(2, false); return true; + case KeyEvent.KEYCODE_D: if (d) key(3, true); else key(3, false); return true; + case KeyEvent.KEYCODE_E: if (d) key(4, true); else key(4, false); return true; + case KeyEvent.KEYCODE_F: if (d) key(5, true); else key(5, false); return true; + case KeyEvent.KEYCODE_G: if (d) key(6, true); else key(6, false); return true; + case KeyEvent.KEYCODE_H: if (d) key(7, true); else key(7, false); return true; + case KeyEvent.KEYCODE_I: if (d) key(8, true); else key(8, false); return true; + case KeyEvent.KEYCODE_J: if (d) key(9, true); else key(9, false); return true; + case KeyEvent.KEYCODE_K: if (d) key(10, true); else key(10, false); return true; + case KeyEvent.KEYCODE_L: if (d) key(11, true); else key(11, false); return true; + case KeyEvent.KEYCODE_M: if (d) key(12, true); else key(12, false); return true; + case KeyEvent.KEYCODE_N: if (d) key(13, true); else key(13, false); return true; + case KeyEvent.KEYCODE_O: if (d) key(14, true); else key(14, false); return true; + case KeyEvent.KEYCODE_P: if (d) key(15, true); else key(15, false); return true; + case KeyEvent.KEYCODE_Q: if (d) key(16, true); else key(16, false); return true; + case KeyEvent.KEYCODE_R: if (d) key(17, true); else key(17, false); return true; + case KeyEvent.KEYCODE_S: if (d) key(18, true); else key(18, false); return true; + case KeyEvent.KEYCODE_T: if (d) key(19, true); else key(19, false); return true; + case KeyEvent.KEYCODE_U: if (d) key(20, true); else key(20, false); return true; + case KeyEvent.KEYCODE_V: if (d) key(21, true); else key(21, false); return true; + case KeyEvent.KEYCODE_W: if (d) key(22, true); else key(22, false); return true; + case KeyEvent.KEYCODE_X: if (d) key(23, true); else key(23, false); return true; + case KeyEvent.KEYCODE_Y: if (d) key(25, true); else key(26, false); return true; + case KeyEvent.KEYCODE_Z: if (d) key(26, true); else key(25, false); return true; + case KeyEvent.KEYCODE_SPACE: if (d) key(47, true); else key(47, false); return true; + + + //case KeyEvent.KEYCODE_SHIFT_LEFT: if (d) key(34, true); else key(34, false); return true; + //case KeyEvent.KEYCODE_SHIFT_RIGHT: if (d) key(39, true); else key(39, false); return true; + + case KeyEvent.KEYCODE_DPAD_UP: if (d) key(10, true); else key(10, false); return true; + case KeyEvent.KEYCODE_DPAD_DOWN: if (d) key(16, true); else key(16, false); return true; + case KeyEvent.KEYCODE_DPAD_LEFT: if (d) key(15, true); else key(15, false); return true; + case KeyEvent.KEYCODE_DPAD_RIGHT: if (d) key(17, true); else key(17, false); return true; + case KeyEvent.KEYCODE_DPAD_CENTER: if (d) key(24, true); else key(24, false); return true; + + default: return false; + } + } + + @Override + public boolean onTrackballEvent(MotionEvent event) { + /*float x = event.getX(); + float y = event.getY(); + int hs = event.getHistorySize(); + Log.i("x48", "tevent: " + hs + " x: " + x + " - " + y); + return true;*/ + return super.onTrackballEvent(event); + } + + +} diff --git a/src/org/ab/x48/ProgListView.java b/src/org/ab/x48/ProgListView.java new file mode 100644 index 0000000..78e87ed --- /dev/null +++ b/src/org/ab/x48/ProgListView.java @@ -0,0 +1,150 @@ +package org.ab.x48; + +import android.app.ListActivity; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +public class ProgListView extends ListActivity { + + /** + * text we use for the parent directory + */ + private final static String PARENT_DIR = ".."; + /** + * Currently displayed files + */ + private final List currentFiles = new ArrayList(); + /** + * Currently displayed directory + */ + private File currentDir = null; + + @Override + public void onCreate(final Bundle icicle) { + super.onCreate(icicle); + + // go to the root directory + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); + String last_dir = sp.getString("last_dir", "/sdcard"); + showDirectory(last_dir); + } + + @Override + protected void onListItemClick(final ListView l, final View v, final int position, final long id) { + if (position == 0 && PARENT_DIR.equals(this.currentFiles.get(0))) { + showDirectory(this.currentDir.getParent()); + } else { + final File file = new File(this.currentFiles.get(position)); + + if (file.isDirectory()) { + showDirectory(file.getAbsolutePath()); + } else { + final Intent extras = new Intent(); + extras.putExtra("currentFile", this.currentFiles.get(position)); + setResult(RESULT_OK, extras); + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); + Editor e = sp.edit(); + e.putString("last_dir", file.getParent()); + e.commit(); + finish(); + } + } + } + + + /** + * Show the contents of a given directory as a selectable list + * + * @param path the directory to display + */ + private void showDirectory(final String path) { + // we clear any old content and add an entry to get up one level + this.currentFiles.clear(); + this.currentDir = new File(path); + if (this.currentDir.getParentFile() != null) { + this.currentFiles.add(PARENT_DIR); + } + + // get all directories and C64 files in the given path + final File[] files = this.currentDir.listFiles(); + final Set sorted = new TreeSet(); + + if (files != null) { + for (final File file : files) { + final String name = file.getAbsolutePath(); + + if (file.isDirectory()) { + sorted.add(name); + } else { + sorted.add(name); + } + } + } + this.currentFiles.addAll(sorted); + + // display these images + final Context context = this; + + ArrayAdapter filenamesAdapter = new ArrayAdapter(this, R.layout.file_row, this.currentFiles) { + + @Override + public View getView(final int position, final View convertView, final ViewGroup parent) { + return new IconifiedTextLayout(context, getItem(position), position); + } + }; + + setListAdapter(filenamesAdapter); + } + + // new layout displaying a text and an associated image + class IconifiedTextLayout extends LinearLayout { + + public IconifiedTextLayout(final Context context, final String path, final int position) { + super(context); + + setOrientation(HORIZONTAL); + + // determine icon to display + final ImageView imageView = new ImageView(context); + final File file = new File(path); + + if (position == 0 && PARENT_DIR.equals(path)) { + imageView.setImageResource(R.drawable.folder); + } else { + if (file.isDirectory()) { + imageView.setImageResource(R.drawable.folder); + } else { + imageView.setImageResource(R.drawable.file); + } + } + imageView.setPadding(0, 1, 5, 0); + + // create view for the directory name + final TextView textView = new TextView(context); + + textView.setText(file.getName()); + + addView(imageView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + addView(textView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + } + } + + + +} diff --git a/src/org/ab/x48/Settings.java b/src/org/ab/x48/Settings.java new file mode 100644 index 0000000..057b277 --- /dev/null +++ b/src/org/ab/x48/Settings.java @@ -0,0 +1,92 @@ +package org.ab.x48; + +import android.os.Bundle; +import android.preference.CheckBoxPreference; +import android.preference.ListPreference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; +import android.preference.PreferenceScreen; + +public class Settings extends PreferenceActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setPreferenceScreen(createPreferenceHierarchy()); + } + + private PreferenceScreen createPreferenceHierarchy() { + // Root + PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this); + root.setTitle(R.string.settings); + PreferenceCategory inlinePrefCat = new PreferenceCategory(this); + inlinePrefCat.setTitle(R.string.general_preferences); + root.addPreference(inlinePrefCat); + + CheckBoxPreference savePref = new CheckBoxPreference(this); + savePref.setKey("saveOnExit"); + savePref.setTitle(R.string.saveonexit_msgbox); + savePref.setSummary(R.string.saveonexit_msgbox_value); + inlinePrefCat.addPreference(savePref); + + CheckBoxPreference hapticPref = new CheckBoxPreference(this); + hapticPref.setKey("haptic"); + hapticPref.setTitle(R.string.haptic_feedback); + hapticPref.setDefaultValue(true); + inlinePrefCat.addPreference(hapticPref); + + ListPreference listPref = new ListPreference(this); + listPref.setEntries(R.array.contrast_entries); + listPref.setEntryValues(R.array.contrast_values); + listPref.setDefaultValue("1"); + listPref.setDialogTitle(R.string.choose_contrast_value); + listPref.setKey("contrast"); + listPref.setTitle(R.string.choose_contrast); + listPref.setSummary(R.string.choose_contrast_value); + inlinePrefCat.addPreference(listPref); + + ListPreference backKeyPref = new ListPreference(this); + backKeyPref.setEntries(R.array.backkey_entries); + backKeyPref.setEntryValues(R.array.backkey_values); + backKeyPref.setDefaultValue("0"); + backKeyPref.setDialogTitle(R.string.choose_backkey_value); + backKeyPref.setKey("backkey"); + backKeyPref.setTitle(R.string.choose_backkey); + backKeyPref.setSummary(R.string.choose_backkey_value); + inlinePrefCat.addPreference(backKeyPref); + + CheckBoxPreference togglePref = new CheckBoxPreference(this); + togglePref.setKey("no_loadprog_msgbox"); + togglePref.setTitle(R.string.choose_msgbox); + togglePref.setSummary(R.string.choose_msgbox_value); + inlinePrefCat.addPreference(togglePref); + + PreferenceCategory portPrefCat = new PreferenceCategory(this); + portPrefCat.setTitle(R.string.ramcards_preferences); + root.addPreference(portPrefCat); + + ListPreference port1Pref = new ListPreference(this); + port1Pref.setEntries(R.array.port_1_entries); + port1Pref.setEntryValues(R.array.port_1_values); + port1Pref.setDefaultValue("0"); + port1Pref.setDialogTitle(R.string.ram_install); + port1Pref.setKey("port1"); + port1Pref.setTitle(R.string.port1_install); + portPrefCat.addPreference(port1Pref); + + ListPreference port2Pref = new ListPreference(this); + port2Pref.setEntries(R.array.port_2_entries); + port2Pref.setEntryValues(R.array.port_2_values); + port2Pref.setDefaultValue("0"); + port2Pref.setDialogTitle(R.string.ram_install); + port2Pref.setKey("port2"); + port2Pref.setTitle(R.string.port2_install); + portPrefCat.addPreference(port2Pref); + + setResult(RESULT_OK); + + return root; + } + +} diff --git a/src/org/ab/x48/X48.java b/src/org/ab/x48/X48.java new file mode 100644 index 0000000..a1200d1 --- /dev/null +++ b/src/org/ab/x48/X48.java @@ -0,0 +1,489 @@ +package org.ab.x48; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.inputmethodservice.Keyboard; +import android.inputmethodservice.KeyboardView; +import android.inputmethodservice.KeyboardView.OnKeyboardActionListener; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.Window; + +public class X48 extends Activity { + + private KeyboardView theKeyboard = null; + private Keyboard currentKeyboardLayout = null; + private Keyboard theKeyboardLayout0 = null; + private Keyboard theKeyboardLayout1 = null; + + private HPView mainView; + static final private int LOAD_ID = Menu.FIRST +1; + static final private int SAVE_ID = Menu.FIRST +2; + static final private int SETTINGS_ID = Menu.FIRST +5 ; + static final private int QUIT_ID = Menu.FIRST +3 ; + static final private int RESET_ID = Menu.FIRST +4 ; + + static final private int ROM_ID = 123; + + public class theKeyboardActionListener implements OnKeyboardActionListener{ + + @Override + public void onKey(int primaryCode, int[] keyCodes) { + + } + + @Override + public void onPress(int primaryCode) { + if (mainView != null) + mainView.key(primaryCode, true); + } + + @Override + public void onRelease(int primaryCode) { + + + if (mainView != null) + mainView.key(primaryCode, false); + + if (primaryCode == 39) { + if (currentKeyboardLayout.equals(theKeyboardLayout0)) { + currentKeyboardLayout = theKeyboardLayout1; + theKeyboard.setKeyboard(currentKeyboardLayout); + } else { + if (currentKeyboardLayout.equals(theKeyboardLayout1)) { + currentKeyboardLayout = theKeyboardLayout0; + theKeyboard.setKeyboard(currentKeyboardLayout); + } + } + } + + + } + + @Override + public void onText(CharSequence text) { + // TODO Auto-generated method stub + + } + + @Override + public void swipeDown() { + + } + + @Override + public void swipeLeft() { + + } + + @Override + public void swipeRight() { + // TODO Auto-generated method stub + + } + + @Override + public void swipeUp() { + // TODO Auto-generated method stub + + }}; + + // http://www.hpcalc.org/hp48/pc/emulators/gxrom-r.zip + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + //if (savedInstanceState == null) { + Log.i("x48", "starting activity"); + /*if (!isRomReady()) { + // need to download the rom + Log.i("x48", "Need to download the rom..."); + + Intent intent = new Intent(this, ROMDownloadActivity.class); + startActivityForResult(intent, 1); + } else {*/ + AssetUtil.copyAsset(getResources().getAssets(), false); + readyToGo() ; + //} + if (!AssetUtil.isFilesReady()) { + showDialog(DIALOG_ROM_KO); + } + // } + + + } + + + /* + private boolean isRomReady() { + SharedPreferences mPrefs = getSharedPreferences("x48", 0); + String romLocation = mPrefs.getString("rom_location", null); + return (romLocation != null && new File(romLocation).exists() && new File(romLocation).length() == 524288); + } + */ + + public void readyToGo() { + requestWindowFeature(Window.FEATURE_NO_TITLE); + requestWindowFeature(Window.FEATURE_PROGRESS); + setContentView(R.layout.main); + mainView = (HPView) findViewById(R.id.hpview); + + theKeyboard = (KeyboardView) findViewById(R.id.EditKeyboard01); + currentKeyboardLayout = theKeyboardLayout0 = new Keyboard(this, R.xml.state0); + theKeyboardLayout1 = new Keyboard(this, R.xml.state1); + theKeyboard.setKeyboard(currentKeyboardLayout); + theKeyboard.setOnKeyboardActionListener(new theKeyboardActionListener()); + theKeyboard.setVisibility(View.INVISIBLE); + theKeyboard.setPreviewEnabled(false); + + SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this); + saveonExit = mPrefs.getBoolean("saveOnExit", false); + haptic = mPrefs.getBoolean("haptic", true); + if (mainView != null) + mainView.setHapticFeedbackEnabled(haptic); + currentOrientation = getResources().getConfiguration().orientation; + } + + public void refreshMainScreen(short data []) { + mainView.refreshMainScreen(data); + } + + public int waitEvent() { + return mainView.waitEvent(); + } + + public void refreshIcons(boolean i []) { + mainView.refreshIcons(i); + } + + public native String startHPEmulator(); + public native String resetHPEmulator(); + public native String saveState(); + public native String stopHPEmulator(); + public native int buttonPressed(int code); + public native int buttonReleased(int code); + public native void registerClass(X48 instance); + public native int fillScreenData(short data []); + public native void flipScreen(); + public native int loadProg(String filename); + public native void setBlankColor(short s); + + public void emulatorReady() { + mainView.emulatorReady(); + } + + public void pauseEvent() { + mainView.pauseEvent(); + } + + static { + System.loadLibrary("droid48"); + } + @Override + protected void onResume() { + super.onResume(); + Log.i("x48", "resuming"); + if (mainView != null) + mainView.resume(); + } + + /** + * Called when your activity's options menu needs to be created. + */ + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + + // We are going to create two menus. Note that we assign them + // unique integer IDs, labels from our string resources, and + // given them shortcuts. + //menu.add(0, RESET_ID, 0, R.string.reset); + + menu.add(0, SAVE_ID, 0, R.string.save_state); + menu.add(0, LOAD_ID, 0, R.string.load_prog); + menu.add(0, SETTINGS_ID, 0, R.string.settings); + menu.add(0, RESET_ID, 0, R.string.reset_memory); + menu.add(0, QUIT_ID, 0, R.string.button_quit); + + return true; + } + + + + /** + * Called when a menu item is selected. + */ + @Override + public boolean onMenuItemSelected(int featureId, MenuItem item) { + switch (item.getItemId()) { + case RESET_ID: + AssetUtil.copyAsset(getResources().getAssets(), true); + stopHPEmulator(); + mainView.stop(); + finish(); + return true; + case SAVE_ID: + saveState(); + return true; + case LOAD_ID: + //loadProg("/data/data/org.ab.x48/SKUNK"); + Intent loadFileIntent = new Intent(); + loadFileIntent.setClass(this, ProgListView.class); + startActivityForResult(loadFileIntent, LOAD_ID); + //flipScreen(); + break; + case SETTINGS_ID: + Intent settingsIntent = new Intent(); + settingsIntent.setClass(this, Settings.class); + startActivityForResult(settingsIntent, SETTINGS_ID); + + break; + case QUIT_ID: + stopHPEmulator(); + mainView.stop(); + finish(); + return true; + } + + return super.onMenuItemSelected(featureId, item); + } + + private static final int DIALOG_PROG_OK = 1; + private static final int DIALOG_PROG_KO = 2; + private static final int DIALOG_ROM_KO = 3; + private static final int DIALOG_RAM_KO = 4; + private static final int DIALOG_RAM_OK = 5; + + @Override + protected Dialog onCreateDialog(int id) { + switch (id) { + case DIALOG_PROG_OK: return new AlertDialog.Builder(X48.this) + .setIcon(R.drawable.alert_dialog_icon) + .setTitle(R.string.help) + .setMessage(R.string.prog_ok) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + } + }) + .create(); + case DIALOG_PROG_KO: return new AlertDialog.Builder(X48.this) + .setIcon(R.drawable.alert_dialog_icon) + .setTitle(R.string.help) + .setMessage(R.string.prog_ko) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + /* User clicked OK so do some stuff */ + } + }) + .create(); + case DIALOG_ROM_KO: return new AlertDialog.Builder(X48.this) + .setIcon(R.drawable.alert_dialog_icon) + .setTitle(R.string.help) + .setMessage(R.string.rom_ko) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + onDestroy(); + } + }) + .create(); + case DIALOG_RAM_KO: return new AlertDialog.Builder(X48.this) + .setIcon(R.drawable.alert_dialog_icon) + .setTitle(R.string.help) + .setMessage(R.string.ram_install_error) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + + } + }) + .create(); + case DIALOG_RAM_OK: return new AlertDialog.Builder(X48.this) + .setIcon(R.drawable.alert_dialog_icon) + .setTitle(R.string.help) + .setMessage(R.string.ram_install_warning) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + + } + }) + .create(); + } + return null; + } + + @Override + protected void onActivityResult(final int requestCode, final int resultCode, final Intent extras) { + Log.i("x48", "requestCode: " + requestCode + " / " + resultCode); + super.onActivityResult(requestCode, resultCode, extras); + if (resultCode == RESULT_OK) { + switch (requestCode) { + case ROM_ID : { + /*if (true || isRomReady()) { + Log.i("x48", "Rom Ready... starting emulator"); + readyToGo(); + } else { + Log.i("x48", "Rom not Ready... quitting"); + onDestroy(); + finish(); + }*/ + break; + } + case LOAD_ID: { + final String filename = extras.getStringExtra("currentFile"); + if (filename != null) { + int retCode = loadProg(filename); + if (retCode == 1) { + flipScreen(); + SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this); + boolean msgbox = mPrefs.getBoolean("no_loadprog_msgbox", false); + if (!msgbox) + showDialog(DIALOG_PROG_OK); + } else { + showDialog(DIALOG_PROG_KO); + } + } + break; + } + case SETTINGS_ID: { + if (mainView != null) + mainView.updateContrast(); + + SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this); + String port1 = mPrefs.getString("port1", "0"); + managePort(1, port1); + String port2 = mPrefs.getString("port2", "0"); + managePort(2, port2); + saveonExit = mPrefs.getBoolean("saveOnExit", false); + haptic = mPrefs.getBoolean("haptic", true); + if (mainView != null) + mainView.setHapticFeedbackEnabled(haptic); + + } + } + } + } + + private boolean saveonExit; + private boolean haptic; + + private void managePort(int number, String value) { + int size = Integer.parseInt(value); + File f = AssetUtil.getSDDir(); + if (f != null) { + boolean change = false; + File port = new File(f, "port" + number); + /*if (port.exists()) { + port.renameTo(new File(f, "bkp.port" + number)); + }*/ + if (size == 0) { + if (port.exists()) { + port.delete(); + change = true; + } + } else { + if (port.exists() && port.length() == 1024 * size) { + + } else { + byte data [] = new byte [1024]; + for(int i=0;i