Skip to content

sticksoft/ADCPU-16Emu

Repository files navigation

ADCPU16Emu
==========
Android implementation of Notch's DCPU-16 (v1.1 and v1.7) (http://0x10c.com)
Version 0.33
By Andrew "Stick" Boothroyd (@sticksoft)
Latest stable version: https://play.google.com/store/apps/details?id=uk.co.sticksoft.adce
Don't forget you can post issues / feature requests on GitHub :)

LICENSE
=======
You may do whatever you want with this software, at your own risk. (http://en.wikipedia.org/wiki/WTFPL)
If you use it in a project, letting me know and putting a link to https://github.com/sticksoft/ADCPU-16Emu in would be appreciated.
If I ever meet you in person, a beer would be even more appreciated!


README
======

Overview
--------
This version assembles and runs DCPU 1.1 and 1.7 programs.
Supported features include emulator, assembler, RAM viewer, minimal debugger, some hardware, and virtual ship (2D).
Hardware includes LEM1802, Generic Keyboard, Generic Timer, and M35FD.

Installation
------------
Easiest method: Download from Google Play - https://play.google.com/store/apps/details?id=uk.co.sticksoft.adce
Harder method: Download the .APK file from GitHub in your phone's browser.  Open the file, and you should be prompted to install it.
Note: You will need to allow applications from unknown sources on your phone.  Simply go to Settings -> Applications and check the "Unknown sources" box.

Usage
-----
The first tab shown on app startup is the Control tab, containing the RAM viewer (box at the top) and controls for starting / resetting the emulator.
This won't do much until you assemble a program!

The ASM tab is the Assembly view.  Here, you can load / save an assembly file from disk (press the Menu key for options) and assemble a program.
Pressing "Assemble" will reset the emulator, assemble your program, output the assembled binary and an assembly -> binary view for debugging, and load the binary data into the emulator's memory.
Return to the first tab to start it and view changes to the memory.

The Console tab displays the text console.  With the app in its default (DCPU 1.7) mode, this is the LEM1802.
In this screen, phone-keyboard input is routed to the Generic Keyboard device.

The Ship tab displays a virtual ship!  Control it by writing to 0xAD00 (throttle) and 0xAD02 (yaw starboard / port); sample code is included that does this (move.dasm).
Values for these registers are interpreted as signed 2's complement integers; e.g. 0x7FFF = all ahead full, 0x8000 = full reverse, 0x0000 = all stop.
For current rotation speed, read from 0xAD05 - positive (< 0x8000) values are clockwise (starboard) and negative values are anticlockwise.

Harcoded memory addresses
-------------------------
These will be replaced with a hardware device soon.
0xAD00 - Throttle control
0xAD01 - (reserved for pitch)
0xAD02 - Yaw
0xAD03 - (reserved for roll)
0xAD04 - (reserved for pitch gyro) 
0xAD05 - Yaw gyro
0xAD06 - (reserved for roll gyro)

0xAD10 - Radar control. Set to 0xFFFF to get count, set to index number (starting at 1) for that contact's info.
0xAD11 - Radar contact count
0xAD12 - Current contact X
0xAD13 - (reserved for contact Y)
0xAD14 - Current contact Z
0xAD15 - (reserved for contact type)
0xAD16 - (reserved for contact size)
0xAD17 - (reserved for contact IFF code)

Upcoming features
-----------------
Resuming previous CPU state
Visual editor supporting comments
Debugging from the visual editor

Development
-----------
Compilation:
* Using eclipse IDE:
    1) Import project into Eclipse IDE with Android plugin installed and SDK setup
    2) Cross your fingers
    3) Compile

* Using Ant builder:
    1) Make sure that the SDK is setup and the tools, platform-tools directories from the SDK are in your PATH environment variable
    2) Run following commands in project directory:
        // following command will generate local.properties file for you
        android update project --path .
        // following command will build debug apk and install it on default emulator/device
        ant debug install
    3) Please refer to http://developer.android.com/tools/projects/projects-cmdline.html in case of trouble

CHANGELOG
=========
v0.33
-----
Fixed a bug with PC arithmetic
Improved visual editor UI
Fixed divide-by-zero bug (thanks notabotanist!)

v0.32
-----
Changed to fixed-width, pinch-to-scale fonts for assembly editor
Fixed [SP], [SP+n] and PICK n (thanks thedarkfreak!)
Added some new examples 

v0.31
-----
Added fix for EX being set too early (thanks thedarkfreak!)
Added support for M35FD (disk drive)

v0.30
-----
Major upgrade to DCPU v1.7
Added LEM1802, Generic Clock and Generic Keyboard

v0.24
-----
Fixed a bug with JSR (thanks Alexei!)

v0.23
-----
Fixed loading not working (caused by overzealous autosave/autoload!)
Prepared CPU for splitting into DCPU 1.1 and 1.7

v0.22
-----
Added option to toggle keyboard (let me know if this fixes it for you, drew!)
Added web-based chat and email links to help menu

v0.21
-----
Added keyboard.dasm (just for you, Don!)
It outputs to console and moves ship with w,a,s,d.

v0.20
-----
Added keyboard input (ask and you shall receive, William! :))

v0.19
-----
Added rudimentary help files and useful links.

v0.18
-----
Redone the CPU threading (should run about 5x faster now!)

v0.17
-----
Added the file overwrite check.
 
v0.16
-----
Added a sample radar assembly file

v0.15
-----
Added asteroids
Altered yaw to use angular velocity and a gyro (Thanks, icarroll!)

v0.14
-----
Added virtual ship tab!

v0.13
-----
Fixed a crash issue with ICS (Thanks, Jareb!)

v0.12
-----
Added an icon
Released on Google Play (Android Market)

v0.11
-----
Changed to tabbed layout
Added console display

v0.10
-----
Added DAT support to assembler

v0.09
-----
Included binary APK
Included a sample pong-like program
Fixed label bug in assembler

v0.08
-----
Added Load and Save commands for SD storage

v0.07
-----
Added loading and saving of the ASM buffer

v0.06
-----
Added text entry

v0.05
-----
Added an assembler

v0.03, v0.04
------------
Minor bugfixes

v0.02
-----
Fixed a bug with the PC, first working version

About

Android implementation of the DCPU-16 from 0x10c

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages