Kotlin 6502/65C02 microprocessor simulator
Go to file
Irmen de Jong 7522d3cb3b added joystick to C64 emulation (via numpad keys) 2020-03-01 18:38:00 +01:00
.idea updated c64 image 2020-02-16 23:02:56 +01:00
c64testprgs added joystick to C64 emulation (via numpad keys) 2020-03-01 18:38:00 +01:00
free-c64-roms added joystick to C64 emulation (via numpad keys) 2020-03-01 18:38:00 +01:00
gradle/wrapper updated gradlewrapper 2020-02-02 13:41:24 +01:00
src added joystick to C64 emulation (via numpad keys) 2020-03-01 18:38:00 +01:00
.gitignore virtual machine 2019-09-16 01:17:54 +02:00
.travis.yml trigger 2019-09-13 01:43:58 +02:00
LICENSE fix disassembler address display 2019-09-14 17:25:41 +02:00
README.md doc 2020-02-21 02:21:55 +01:00
build.gradle.kts try to gpg sign for bintray 2020-02-06 00:57:53 +01:00
c64.png updated c64 image 2020-02-16 23:02:56 +01:00
ehbasic.png added Commodore-64 emulator 2019-09-19 21:29:33 +02:00
gradle.properties clean up 2020-02-02 19:33:57 +01:00
gradlew updated gradle wrapper to 6.1.1 2020-01-26 18:28:04 +01:00
gradlew.bat initial 2019-09-11 02:17:59 +02:00
settings.gradle.kts initial 2019-09-11 02:17:59 +02:00

README.md

saythanks Build Status JCenter: Download from Jcenter

KSim65 - Kotlin/JVM 6502/65C02 microprocessor simulator

Written by Irmen de Jong (irmen@razorvine.net)

Software license: MIT, see file LICENSE

6502

This is a Kotlin/JVM library that simulates the 8-bit 6502 and 65C02 microprocessors, which became very popular in the the early 1980's.

Properties of this simulator:

  • written in Kotlin. It is low-level code, but hopefully still readable :-)
  • simulates various hardware components (bus, cpu, memory, i/o controllers)
  • IRQ and NMI
  • instruction cycle times are simulated (however the internal cpu behavior is not cycle-exact for simplicity reasons)
  • has all 6502 and 65c02 instructions, including many of the 'illegal' 6502 instructions (goal is 100% eventually)
  • correct BCD mode for adc/sbc instructions on both cpu types
  • passes several extensive unit test suites that verify instruction and cpu flags behavior
  • simple debugging machine monitor, which basic disassembler and assembler functions
  • provide a few virtual example machines, one of which is a fairly capable Commodore-64

Documentation

Still to be written. For now, use the source ;-)

Using it as a library in your own project

Ksim65 is available on the JCenter maven repository.

You can simply add it as a dependency to your project. For Maven:

<dependency>
    <groupId>net.razorvine</groupId>
    <artifactId>ksim65</artifactId>
    <version>1.8</version>
    <type>pom</type>
</dependency>

For Gradle:

implementation 'net.razorvine:ksim65:1.8'

Update the version as required.

Virtual machine examples

Three virtual example machines are included. The default one starts with gradle run or run the ksim64vm command. There's another one ehBasicMain that is configured to run the "enhanced 6502 basic" ROM:

ehBasic

Finally there is a fairly functional C64 emulator running the actual roms (not included, but can be easily found elsewhere for example with the Vice emulator. The emulator supports character mode, bitmap mode (hires and multicolor), hardware sprites and various timers and IRQs. It's not cycle perfect, and the video display is drawn on a per-frame basis, so raster splits/rasterbars are impossible. But many other things work fine.

C64 emulation