Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wulab committed Oct 28, 2022
0 parents commit 0d0a456
Show file tree
Hide file tree
Showing 5 changed files with 1,302 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
__pycache__/
.DS_Store
.tool-versions
build/
disk/
dist/
tmp/
110 changes: 110 additions & 0 deletions LICENSE.md
@@ -0,0 +1,110 @@
CPY64
Copyright (c) 2022 Weera Wu

This work is licensed under [CC BY-NC-ND 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1) <img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1"><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1"><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1"><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nd.svg?ref=chooser-v1">

NumPy
Copyright (c) 2005-2022, NumPy Developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* 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.

* Neither the name of the NumPy Developers nor the names of any
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
OWNER 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.

pytudes
Copyright (c) 2010-2017 Peter Norvig

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

SciPy
Copyright (c) 2001-2002 Enthought, Inc. 2003-2022, SciPy Developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. 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.

3. Neither the name of the copyright holder 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
OWNER 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.

Simpleaudio
Copyright (c) 2015, Joe Hamilton

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
80 changes: 80 additions & 0 deletions README.md
@@ -0,0 +1,80 @@
# CPY64

A Commodore 64 editor written in Python.

## Features

* Direct and program mode
* C64 color palette
* 3 tone and 1 white noise generators
* PETSCII symbols and control characters
* Save and load programs
* C64 memory map with poke and peek
* Python and Scheme languages support

## Getting Started

### Terminal

1. Download and install *C64 TrueType Fonts* from https://style64.org/c64-truetype.
2. Change terminal font to *C64 Pro Mono*.
3. Use blinking block cursor with RGB color (112,109,235).

### Installation

$ mkdir cpy64
$ tar -xvf cpy64-xxx.cpython-yyy.tar.gz -C cpy64

$ cd cpy64
$ asdf install python yyy
$ asdf local python yyy
$ pip install --upgrade -r requirements.txt

### Usage

$ cd cpy64
$ python main.pyc # up to a minute on the first start

## Keyboard Shortcuts

Key | Action
------------------------------------ | --------------------------------------------
<kbd>↑</kbd>, <kbd>↓</kbd> | Move the cursor up or down
<kbd>←</kbd>, <kbd>→</kbd> | Move the cursor left or right
<kbd>HOME</kbd> | Clear the screen and return the cursor to the home position
<kbd>DEL</kbd> | Toggle the insert mode on or off
<kbd>CTRL-C</kbd> | Halt a running program
<kbd>CTRL-D</kbd>, <kbd>CTRL-Q</kbd> | Exit to shell
<kbd>ALT-1</kbd> to <kbd>ALT-8</kbd> | Set color to black, white, red, cyan, purple, green, blue, and yellow correspondingly
<kbd>ALT-9</kbd> | Turn on reversed characters
<kbd>ALT-0</kbd> | Turn off reversed characters

## Commands

Command | Action
--------------------------------------- | --------------------------------------------
CLR | Clear the screen and return the cursor to the home position
LISP | Set the current interpreter to Scheme
LIST [[\<first-line\>]-[\<last-line\>]] | Display all or part of the program in memory
LOAD "$" | List the programs in the *disk* directory
LOAD ["\<file-name\>"] | Load a program in the *disk* directory
NEW | Clear the program and all variables
PYTHON | Set the current interpreter to Python
RUN | Start the program currently in memory
SAVE ["\<file-name\>"] | Save a program to the *disk* directory

## Memory Map

These memory values can be set or fetched with `POKE` and `PEEK`.

Location | Label | Description
--------- | ------ | --------------------------------------
212 | QTSW | Flag: Editor in Quote Mode? 0=No
216 | INSRT | Flag: Insert Mode 0=Off
1024-2023 | | Video Matrix: 25 Lines by 40 Columns
36874 | SPKR1 | Speaker 1 – Music – Bass
36875 | SPKR2 | Speaker 2 – Music – Alto
36876 | SPKR3 | Speaker 3 – Music – Soprano
36877 | SPKR4 | Speaker 4 – Noise
36878 | VOLSET | Volume setting
53281 | BGCOL0 | Background Color 0: default color value is 7 (blue)

0 comments on commit 0d0a456

Please sign in to comment.