Menu

Tree [556af0] v0.11 /
 History

HTTPS access


File Date Author Commit
 .settings 2014-01-13 Arno Puder Arno Puder [f4b608] Begin to migrate to sdltrs
 assets 2013-04-15 Arno Puder Arno Puder [9bc150] Remove defense.cmd
 doc 2013-06-25 Arno Puder Arno Puder [55da99] Updated screenshots.
 jni 2014-05-26 Arno Puder Arno Puder [556af0] Hot fix for ?CHR$\(23\)
 libs 2013-12-29 Arno Puder Arno Puder [d7bcaa] Update to new Android support library
 res 2014-05-25 Arno Puder Arno Puder [e8a015] Remove hard-coded strings in configuration_item...
 src 2014-05-25 Arno Puder Arno Puder [c52739] Fix problem with shift key not properly unshifted
 var 2013-05-04 Sascha Sascha [92f8db] Play Store graphics.
 .classpath 2014-01-13 Arno Puder Arno Puder [f4b608] Begin to migrate to sdltrs
 .cproject 2013-06-30 Arno Puder Arno Puder [4a45ce] XTRS.outCassette() callback
 .gitignore 2014-01-27 Arno Puder Arno Puder [55ab35] Add /gen to .gitignore
 .project 2013-02-28 Arno Puder Arno Puder [68736f] Initial version
 AndroidManifest.xml 2014-05-24 Arno Puder Arno Puder [d32d55] Version 0.11
 LICENSE 2013-04-11 Arno Puder Arno Puder [458f51] Add Apache 2 License
 README 2014-01-18 Arno Puder Arno Puder [5ef136] Update README
 proguard-project.txt 2013-02-28 Arno Puder Arno Puder [68736f] Initial version
 project.properties 2013-06-13 Arno Puder Arno Puder [fe5af0] Reference ActionBarSherlock as library project

Read Me

TRS-80 Emulator for Android
---------------------------

This is the first version of a TRS-80 Emulator for Android. It is
based on a popular emulator originally written for X-Windows called
xtrs [1]. This port adds a layer for Android.


Compiling from Source
---------------------

It is recommended to use Eclipse for compiling the sources. You will
need to install the Android SDK and NDK. You should also install the
accompanying ADT plugin for Eclipse (be sure to check "NDK" when
installing the ADT for Android in Eclipse).

The TRS-80 emulator depends on a project called ActionBarSherlock
[2]. Note that the way ActionBarSherlock is designed, it cannot be
integrated with the emulator. You need to import ActioBarSherlock as a
separate Eclipse project into your workspace. Next download an import
the sources of TRS-80 into Eclipse. Since your directory structure
will be different, you need to edit the location of
ActionBarSherlock. In Eclipse, right-click on TRS-80 > Preferences >
Android. In the bottom edit the path to ActioBarSherlock.

At this point you should be able to compile the sources. Note that
running the TRS-80 emulator inside the Android emulator is very
slow. It is recommended to use a real device for testing and
debugging.


Quick Overview
--------------

The original C sources of xtrs reside in the 'jni' folder. The Android
layer uses JNI (Java Native Interface) to access the C sources from
Java. Whenever I made a change to the original xtrs sources, I used
#ifdef ANDROID to annotate my changes. This should make it easy to see
what was changed.

Some of the key files:

- MainFragment.java: main entry point of the Android app
- ConfigurationsFragment.java: the "Configurations" tab
- EmulatorStatusFragment.java: the "Emulator" tab
- EmulatorActivity.java: this is the Android activity that
  runs the emulator
- XTRS: this class is the gateway to the C sources of xtrs.
  All down-calls and up-calls to the C code will go through
  this class. The native methods declared in XTRS are implemented
  in jni/native.c
- Hardware: defines the hardware characteristics of the TRS machine
  (e.g., TRS Model, disks to be mounted, etc). An instance of class
  Hardware is passed to XTRS.init() to initialize the native layer.
- keyboard_original.xml: Android XML layout that defines the
  original Model 3 keyboard layout.
- Key.java: the accompanying Android custom widget that implements
  the behavior of one key of the keyboard.


Details of the keyboard
-----------------------

The emulator features different keyboard layouts (original, compact, etc).
The XML layout resources can be found in res/layout/keyboard_*.xml. Class Key
implements the behavior of one key of the keyboard. Class Key is a custom
Android widget that is referenced from the aforementioned XML layout files.
Whenever the user 'clicks' on a key, class Key uses the KeyboardManager to
add a key event which will eventually be delivered to xtrs via SDL_PollEvent.
File res/values/attrs.xml defines an enum for all the keys available on a TRS
machine. The TK_* constants in class Key mirror the definitions in attrs.xml.
When a user presses a key, the TK_* ID needs to be mapped to a
SDL_KeyboardEvent. Specifically, the SDL virtual key code and the unicode
character are needed to populate SDL_KeyboardEvent. This mapping is achieved
with file res/xml/keymap_us.xml. Once the virtual key code and unicode
character are determined, KeyboardManager uses XTRS.addKeyEvent() to fill a
key buffer in the native layer.


External Resources
------------------

The following resources have been used for this project:

[1] http://www.tim-mann.org/xtrs.html
[2] http://actionbarsherlock.com/
[3] http://www.fontsquirrel.com/fonts/DejaVu-Sans-Mono
[4] http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Mimetypes-inode-directory-icon.html
[5] http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Mimetypes-mime-2-icon.html
[6] ACRA: http://acra.ch/
[7] ACRA Mailer: https://github.com/d-a-n/acra-mailer
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.