Skip to content

Commit

Permalink
Modifying README
Browse files Browse the repository at this point in the history
  • Loading branch information
docmarionum1 committed Feb 19, 2014
1 parent 6f6cdc3 commit 795f8f5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 30 deletions.
6 changes: 0 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,3 @@ Before you submit a pull request, check that it meets these guidelines:
https://travis-ci.org/docmarionum1/py65emu/pull_requests
and make sure that the tests pass for all supported Python versions.

Tips
----

To run a subset of tests::

$ python -m unittest tests.test_py65emu
17 changes: 9 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Copyright (c) 2014, Jeremy Neiman
All rights reserved.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Copyright (C) 2004 Sam Hocevar <[email protected]>

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

* Neither the name of Python 6502 Emulator nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0. You just DO WHAT THE FUCK YOU WANT TO.
43 changes: 32 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,43 @@
Python 6502 Emulator
===============================

.. image:: https://badge.fury.io/py/py65emu.png
:target: http://badge.fury.io/py/py65emu

.. image:: https://travis-ci.org/docmarionum1/py65emu.png?branch=master
:target: https://travis-ci.org/docmarionum1/py65emu

.. image:: https://pypip.in/d/py65emu/badge.png
:target: https://crate.io/packages/py65emu?version=latest

A MOS 6502 Emulator intended to be used from within other programs. All opcodes, included the undocumented illegal opcodes are implemented.

A 6502 Emulator
Example Usage:::

* Free software: BSD license
* Documentation: http://py65emu.rtfd.org.
from py65emu.cpu import CPU
from py65emu.mmu import MMU

Features
--------
f = open("program.rom") #Open your rom

* TODO
#define your blocks of memory. Each tuple is
#(start_address, length, readonly=True, initial_value=None, value_offset=0)
m = MMU([
(0x00, 0x200), #Create RAM with 512 bytes
(0x1000, 0x4000, True, f) #Create ROM starting at 0x1000 with your program.
])

#Create the CPU with the MMU and the starting program counter address
#You can also optionally pass in a value for stack_page, which defaults
#to 1, meaning the stack will be from 0x100-0x1ff. As far as I know this
#is true for all 6502s, but for instance in the 6507 used by the Atari
#2600 it is in the zero page, stack_page=0.
c = CPU(mmu, 0x1000)

#Do this to execute one instruction
c.step()

#You can check the registers and memory values to determine what has changed
print c.r.a # A register
print c.r.x # X register
print c.r.y # Y register
print c.r.s # Stack Pointer
print c.r.pc # Program Counter

print c.r.getFlag('C') #Get the value of a flag from the flag register.

print mmu.read(0xff) #Read a value from memory
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
include_package_data=True,
install_requires=[
],
license="BSD",
license="WTFPL",
zip_safe=False,
keywords='py65emu',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'License :: WTFPL',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
Expand Down
5 changes: 2 additions & 3 deletions tests/test_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ def test_nestest(self):
(0x2000, 0x8), #PPU
(0x4000, 0x18),
(0x8000, 0xc000, True, open(f), 0x3ff0) #ROM
#(0xbff0, 0x6010, True, open(f)) #ROM
])

c = CPU(mmu, 0xc000)

c.r.s = 0xfd
c.r.s = 0xfd #Not sure why the stack starts here.

while c.r.pc != 0xc66e:
try:
Expand All @@ -44,6 +42,7 @@ def test_nestest(self):
print c.r
print traceback.format_exc()
raise e

self.assertEqual(c.mmu.read(0x2), 0x00, hex(c.mmu.read(0x2)))
self.assertEqual(c.mmu.read(0x3), 0x00, hex(c.mmu.read(0x3)))

Expand Down

0 comments on commit 795f8f5

Please sign in to comment.