This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string = "wELCOME tO cOMMODOREsERVER" # PETSCII has case reversed compared to ASCII | |
print("PETSCII: ", (string)) | |
print(" ASCII: ", string.swapcase()) # "translate" PETSCII to ASCII | |
print("") # blank line | |
# '/roominfo' csip command displays verbose info about room | |
# '/rooms' csip command lists "'room_name' ['user_count']" | |
room_names = {'lOBBY', 'C64', 'C128', 'vIC-20', 'aMIGA', 'TED', 'PET', 'SANDBOX'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orig $c000 | |
; save as "remote.prg" (or "++ remote"?) | |
; sets usable RAM to $0a01-$4000? | |
LINNUM = $14 ; Integer Line Number Value | |
INDEX = $22 ; $22-$25: Misc Temporary Pointers and Save Area | |
TXTTAB = $2b ; Pointer to the Start of BASIC Program Text | |
VARTAB = $2d ; start of BASIC variables | |
ARYTAB = $2f ; Pointer to the Start of the BASIC Array Storage Area |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{step:2} | |
{crunch:on} | |
{alpha:alt} | |
{number:3000} | |
rem "+.test dumpm" | |
rem output arrays to disk/screen | |
' sa=save .a, sx=save .x, sy=save .y | |
&"Array Output to Device{f6}":sa=780:sx=781:sy=782 | |
{:device} | |
&"Q=Quit, [S=Screen], 1-6=Image drive{f6}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; https://www.lemon64.com/forum/viewtopic.php?t=73957 | |
; https://www.c64-wiki.com/wiki/Interrupt | |
; been trying to follow application notes for the SwiftLink | |
; terminal code @ $c0b7 (waiting for Shift+C=) | |
; &,49 getmod $b915 | |
; &,4 getmdm $aab3 | |
; There are a few problems/things I want to improve with with this version of the SwiftLink driver: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ascii:alt} | |
{number:10} | |
goto {:screen} | |
' init: | |
' TODO: ask from directory or specific track/sector | |
' TODO: output log: screen, printer, disk | |
' input any init: | |
a$="":i%=. | |
' max file entries on a 1541 disk: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{number:1} | |
{crunch:on} | |
for t8=1 to 5 | |
sys{sym:bell}:for d=1 to 400:next | |
next t8 | |
{asm} | |
bell: | |
ldx #$0f | |
stx $d418 ; volume | |
ldx #9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from "Python 101" pg. 351 | |
import sqlite3 | |
def get_cursor(): | |
conn = sqlite3.connect("library.db") | |
return conn.cursor() | |
def select_all_records_by_author(cursor, author): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
def get_cursor(): | |
conn = sqlite3.connect("library.db") | |
return conn.cursor() | |
def select_all_records_by_author(cur, author): | |
sql = "SELECT * FROM books WHERE author=?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap | |
# https://docs.python.org/3/library/textwrap.html#textwrap.TextWrapper.wrap | |
# https://inventwithpython.com/blog/2014/12/02/why-is-object-oriented-programming-useful-with-a-role-playing-game-example/ | |
# https://python-prompt-toolkit.readthedocs.io/en/master/ | |
class Terminal: | |
# TODO: make baud_rate and output_count be default arguments, not specified in the call for the function to work: | |
# TODO: outputCount should be a member of Terminal, I think: | |
def __init__(self, translation_type, screen_height, screen_width, more_prompt, output_count): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tada_parser(last_command=None): | |
logging.info("tada_parser() called") | |
if last_command is None: | |
last_command = "help" | |
print(f"Return: {last_command}") | |
command_line = input("Command: ") | |
if not command_line: | |
logging.info("Empty command line, setting to '{last_command}") | |
command_line = last_command |