Commit 726921e0 authored by Ada Gottensträter's avatar Ada Gottensträter

Remove old jank

parent 8e49b874
cd source
rm ../eepbins/PropCMD.eeprom
bstc -Ocgru -e -o ../eepbins/PropCMD PropCMD.spin
cd ..
\ No newline at end of file
# Read in a binary file and flip the bit ordering of all the bytes (while keeping the byte order the same)
import sys
def int2bin(n, count=24):
"""Returns the binary of integer n as a string, using count number of digits"""
return "".join([str((n >> y) & 1) for y in range(count-1, -1, -1)])
fin = open(sys.argv[1],'rb')
fout = open(sys.argv[2],'wb')
while True:
byte = fin.read(1)
# Quit at end of file
if len(byte) == 0:
break
# Convert to binary string representation
bits = int2bin(ord(byte),8)
# Flip bits
flipped = bits[::-1]
# Write flipped string as byte to output file
fout.write((int(flipped,2)).to_bytes(1,'little'))
fin.close()
fout.close()
PropCMD COMMANDS:
-----------------
MOUNT
Mount the SD.
This is done automatically at startup
if possible.
UNMOUNT
Unmount the SD.
The SD can then safely be changed.
DIR [*.ext] [/w] [/h] [/c] [|more]
Show the root directory of the SD.
*.ext -- show only files with the
indicated extension
/w -- wide format
/h -- show hidden files
/c -- show starting clusters
|more -- pause between screens,
ESC to quit, ctrl-C cancels.
TYPE filename [|more]
Echo the file to the console.
|more -- pause between screens,
ESC to quit, ctrl-C cancels.
DEL filename
Delete the file.
Does not ask for confirmation.
COPY CON filename
Echo lines of user input to the file
until CTRL-Z pressed. ESC cancels the
current line without ending input.
SPIN filename
Load the binary file and run it.
Forces .BIN extension whether it or
any other is specified.
DUMP filename [|more]
Display the file in hex format.
|more -- pause between screens,
ESC to quit, ctrl-C cancels.
SD sectornum [|more]
Sector Dump = display contents of the
given SD sector in DUMP format
ROOTDIR
Display the SD sector where the root
directory begins
CHAIN filename [|more]
Display the file's FAT cluster chain.
|more -- pause between screens,
ESC to quit, ctrl-C cancels.
CLUST2SD clusternum
Display the SD sector where
the specified DOS cluster begins
VER
display the version
COLOR colornum
Sets the display text color 0-7.
NUM number
Display the hex and decimal
representations of number.
If number has no prefix or $,
it is hexadecimal
# prefix means decimal, e.g.
B == $B == #11
This format is used for all numeric
arguments.
INA pin
Display the INA value for the pin.
\ No newline at end of file
Binary files a/system/propcmd/source/23lc1024.spin and /dev/null differ
'' Font can be indicated in the OBJ section of "AIGeneric_Driver_002" CON TV_MODE = TV_MODE_NTSC + TV_MODE_FONT_0 OBJ tv_SmallFont : "AiGeneric_Driver_002" CON TV_MODE_NTSC = %0000_0000 TV_MODE_PAL = %0000_0001 TV_MODE_FAST_UPDATE = %0000_0000 TV_MODE_FLICKER_FREE = %0000_0100 TV_MODE_COLOR = %0000_0000 TV_MODE_COLOUR = %0000_0000 TV_MODE_MONOCHROME = %0000_1000 TV_MODE_INTERLACED = %0000_0000 TV_MODE_NON_INTERLACED = %0001_0000 TV_MODE_COMPOSITE = %0000_0000 TV_MODE_BASEBAND = %0000_0000 TV_MODE_BROADCAST = %0010_0000 TV_MODE_FONT_0 = %0000_0000 TV_MODE_RUNNING = %1000_0000 RGB_BLACK = $02 RGB_GREY = $03 RGB_WHITE = $06 RGB_BRIGHT_WHITE = $07 RGB_CYAN = $3D RGB_LIGHT_CYAN = $3E RGB_LIGHT_GREEN = $5E RGB_LIGHT_YELLOW = $8E RGB_LIGHT_RED = $CE RGB_LIGHT_MAGENTA = $FE RGB_RED = $BC RGB_YELLOW = $8D RGB_GREEN = $5C RGB_BLUE = $1C RGB_MAGENTA = $FC RGB_LIGHT_BLUE = $1E CR = $0D LF = $0A TAB = $09 BKS = $08 VAR byte rows byte columns byte row byte column byte colour byte mode ' ******************************************************************************************************* ' * * ' * Demonstration Routine * ' * * ' ******************************************************************************************************* PUB Start(TV_PIN) result := Open (TV_PIN, TV_MODE) Cls PUB out( b ) case b $08 : if column > 0 column-- else column := 39 if row > 0 row-- $0D : TxCrLf $00 : Cls other : TxRawByte( b ) PUB str( txtPtr ) repeat strsize( txtPtr ) out( byte[ txtPtr++ ] ) PUB dec(value) | i '' Print a decimal number if value < 0 -value out("-") i := 1_000_000_000 repeat 10 if value => i out(value / i + "0") value //= i result~~ elseif result or i == 1 out("0") i /= 10 PUB hex(value, digits) '' Print a hexadecimal number value <<= (8 - digits) << 2 repeat digits out(lookupz((value <-= 4) & $F : "0".."9", "A".."F")) PUB bin(value, digits) '' Print a binary number value <<= 32 - digits repeat digits out((value <-= 1) & 1 + "0") ' ******************************************************************************************************* ' * * ' * Device Handling Routines * ' * * ' ******************************************************************************************************* PUB Open( setBasePin, setMode ) setMode |= TV_MODE_RUNNING if mode <> setMode Close mode := tv_SmallFont.Open( setBasePin, setMode, @PALETTE ) rows := tv_SmallFont.GetRowCount columns := tv_SmallFont.GetColumnCount Cls return mode PUB Close if mode tv_SmallFont.Close mode := 0 ' ******************************************************************************************************* ' * * ' * Text Handling Routines * ' * * ' ******************************************************************************************************* PUB TxRawByte( b ) if column => columns TxCrLf if row => rows Scroll tv_SmallFont.PokeChar( row, column, colour, b ) column++ PUB TxCrLf column := 0 if row++ > rows Scroll PUB Cls tv_SmallFont.Cls colour := 0 Home PUB Home column := row := 0 PRI Scroll repeat while row => rows tv_SmallFont.Scroll row-- PUB Color( useColour ) colour := useColour DAT ' ******************************************************************************************************* ' * * ' * Colour Palette for Video Drivers * ' * * ' ******************************************************************************************************* ' Basic QB-style colours ' ' 0 White 8 Grey ' 1 Blue 9 Light Blue ' 2 Green 10 Light Green ' 3 Cyan 11 Light Cyan ' 4 Red 12 Light Red ' 5 Magenta 13 Light Magenta ' 6 Yellow 14 Light Yellow ' 7 Bright White 15 White on Red PALETTE byte RGB_BLACK ' Background byte RGB_WHITE ' 0 byte RGB_BLUE ' 1 byte RGB_GREEN ' 2 byte RGB_CYAN ' 3 byte RGB_RED ' 4 byte RGB_MAGENTA ' 5 byte RGB_YELLOW ' 6 byte RGB_BRIGHT_WHITE ' 7 byte RGB_GREY ' 8 byte RGB_LIGHT_BLUE ' 9 byte RGB_LIGHT_GREEN ' 10 byte RGB_LIGHT_CYAN ' 11 byte RGB_LIGHT_RED ' 12 byte RGB_LIGHT_MAGENTA ' 13 byte RGB_LIGHT_YELLOW ' 14 byte RGB_RED ' 15 - Background with foreground colour 0 ' ******************************************************************************************************* ' * * ' * End of AiChip_SmallFont_Demo_001.spin * ' * * ' *******************************************************************************************************
\ No newline at end of file
''
'' Change the "Font_ATARI" to your perfered selection
''
OBJ
tv_SmallFont_Driver : "AiGeneric_Driver_TV"
tv_SmallFont_Font_0 : "Font_FUNSCII"
CON
' .-----------------------------------------------------------------------------------------------------.
' | |
' | Driver Attributes |
' | |
' `-----------------------------------------------------------------------------------------------------'
COLUMNS = tv_SmallFont_Driver#COLUMNS
ROWS_PAL = tv_SmallFont_Driver#ROWS_PAL
ROWS_NTSC = tv_SmallFont_Driver#ROWS_NTSC
COLOURS = 16
FONT_CHARS = tv_SmallFont_Font_0#FONT_CHARS
ROWS_MAX = ROWS_NTSC #> ROWS_PAL
SCREEN_SIZE_CHARS = COLUMNS * ROWS_MAX
' .-----------------------------------------------------------------------------------------------------.
' | |
' | Characters for drawing boxes |
' | |
' `-----------------------------------------------------------------------------------------------------'
CHR_TOP_LEFT = $15
CHR_TOP_MID = $16
CHR_TOP_RIGHT = $17
CHR_LFT_BAR = $7C
CHR_BOT_LEFT = $18
CHR_BOT_RIGHT = $19
' .-----------------------------------------------------------------------------------------------------.
' | |
' | Characters for drawing logic analyser traces |
' | |
' `-----------------------------------------------------------------------------------------------------'
CHR_BIT_0_TO_0 = $13
CHR_BIT_0_TO_1 = $10
CHR_BIT_1_TO_0 = $12
CHR_BIT_1_TO_1 = $11
' .-----------------------------------------------------------------------------------------------------.
' | |
' | Mode bit settings - Must be the same as AiChip_TvText_001.spin |
' | |
' `-----------------------------------------------------------------------------------------------------'
TV_MODE_NTSC = %0000_0000
TV_MODE_PAL = %0000_0001
TV_MODE_LARGE_FONT = %0000_0000
TV_MODE_SMALL_FONT = %0000_0010
TV_MODE_FAST_UPDATE = %0000_0000
TV_MODE_FLICKER_FREE = %0000_0100
TV_MODE_COLOR = %0000_0000
TV_MODE_COLOUR = %0000_0000
TV_MODE_MONOCHROME = %0000_1000
TV_MODE_INTERLACED = %0000_0000
TV_MODE_NON_INTERLACED = %0001_0000
TV_MODE_COMPOSITE = %0000_0000
TV_MODE_BASEBAND = %0000_0000
TV_MODE_BROADCAST = %0010_0000
TV_MODE_FONT_0 = %0000_0000
TV_MODE_FONT_1 = %0100_0000
TV_MODE_RUNNING = %1000_0000
VAR
word screenBuffer[SCREEN_SIZE_CHARS]
word colorPalette[COLOURS]
long params[5] ' [0] pointer to screen memory
' [1] pointer to font table
' [2] base pin number = 12 for Demo Board / 24 for Hydra
' [3] background and border colour
' [4] PAL=non-zero, NTSC=zero
byte mode
byte rows
word lastRow
' *******************************************************************************************************
' * *
' * Device Handling Routines *
' * *
' *******************************************************************************************************
PUB Open( setBasePin, setMode, ptrToPalette )
if mode <> setMode
Close
mode := setMode
mode &= ! TV_MODE_PAL ' Driver does not support PAL at present
mode &= ! TV_MODE_FLICKER_FREE ' Driver does not support Flicker Free
mode &= ! TV_MODE_MONOCHROME ' Driver does not support Monochrome
mode &= ! TV_MODE_BROADCAST ' Driver does not support Broadcast
if mode & TV_MODE_PAL
rows := ROWS_PAL
else
rows := ROWS_NTSC
lastRow := (rows-1) * COLUMNS
SetPalette(ptrToPalette)
params[0] := @screenBuffer
params[1] := GetPtrToFontTable( setMode & TV_MODE_FONT_1 )
params[2] := setBasePin
params[3] := byte[ ptrToPalette ]
params[4] := mode & TV_MODE_PAL
Cls
tv_SmallFont_Driver.Open(@params)
return mode
PUB Close
if mode
tv_SmallFont_Driver.Close
mode := 0
' *******************************************************************************************************
' * *
' * Font Handling Routines *
' * *
' *******************************************************************************************************
PRI GetPtrToFontTable( fontNumber ) | ptr
result := tv_SmallFont_Font_0.GetPtrToFontTable
ptr := result
if byte[ ptr+constant(" "*8) ]~
repeat constant(FONT_CHARS * 8)
byte[ ptr++ ] ><= 8
' *******************************************************************************************************
' * *
' * Text Handling Routines *
' * *
' *******************************************************************************************************
PUB Scroll
wordmove(@screenBuffer, @screenBuffer+(COLUMNS<<1), lastrow)
wordfill(@screenBuffer+(lastrow<<1), " ", COLUMNS)
PUB Cls
wordfill(@screenBuffer, " ", SCREEN_SIZE_CHARS)
PUB PokeChar( row, col, colour, c )
screenBuffer[row * COLUMNS + col] := ( colorPalette[ colour // COLOURS ] & $FF00 ) | ( c // FONT_CHARS )
' *******************************************************************************************************
' * *
' * Logic Analyser Trace Handling Routines *
' * *
' *******************************************************************************************************
PUB GetLogicAnalyserBit(thisBit,nextBit)
result := LookUpZ ( ( ( thisBit >> 30 ) & 2 ) | ( nextBit >> 31 ) : CHR_BIT_0_TO_0, CHR_BIT_0_TO_1, CHR_BIT_1_TO_0, CHR_BIT_1_TO_1 )
' *******************************************************************************************************
' * *
' * Attribute Handling for Video Drivers *
' * *
' *******************************************************************************************************
PUB GetColourCount
result := COLOURS
PUB GetColumnCount
result := COLUMNS
PUB GetRowCount
result := rows
' *******************************************************************************************************
' * *
' * Colour Palette Handling for Video Drivers *
' * *
' *******************************************************************************************************
PUB SetPalette( ptrToPalette ) | i, back
back := byte[ptrToPalette]
repeat i from 0 to COLOURS-2
SetPaletteColour(i,byte[ptrToPalette+i+1],back)
SetPaletteColour(COLOURS-1,byte[ptrToPalette+1],byte[ptrToPalette+COLOURS])
PUB SetPaletteColour( colorIdx, fore, back )
colorPalette[colorIdx] := fore << 8 | back
\ No newline at end of file
This diff is collapsed.
'' *******************************************************************************************************
CON
AS_VIEWED = true
FONT_CHARS = 256
PUB GetPtrToFontTable
result := @fonttab
DAT
fonttab file "font2.bin"
\ No newline at end of file
Binary files a/system/propcmd/source/PropCMD.spin and /dev/null differ
Binary files a/system/propcmd/source/_README_.txt and /dev/null differ
This diff is collapsed.
Binary files a/system/propcmd/source/germanKeyboard.spin and /dev/null differ
{{
Super-naive SPI RAM Driver.
}}
CON
addr_mask = $00FFFFFF
write_cmd = $02<<24
read_cmd = $03<<24
VAR
byte DOpin, CLKpin, DIpin, CSpin
pub init(DO,CLK,DI,CS)
DOpin := DO
CLKpin := CLK
DIpin := DI
CSpin := CS
prepare
outa[CSpin]~
dira[DOpin]~~
outa[DOpin]~~
writeval($ff,8) 'reset to SPI mode
dira[DOpin]~
outa[DOpin]~
outa[CSpin]~~
outa[CSpin]~
writeval($0140,16) 'set sequential mode
end
pub write(buffer,address,length)
prepare
outa[CSpin]~
writeval((address&addr_mask)|write_cmd,32)
repeat length
writeval(byte[buffer++],8)
end
pub read(buffer,address,length)
prepare
outa[CSpin]~
writeval((address&addr_mask)|read_cmd,32)
repeat length
byte[buffer++] := readval(8)
end
pub getmr
prepare
outa[CSpin]~
writeval($05,8)
result:=readval(8)
end
pri readval(bits) | val
val~ ' clear input
repeat Bits
!outa[CLKpin]
val := (val << 1) | ina[DOpin]
!outa[CLKpin]
return val
pri writeval(val,bits)
val <<= (32 - bits) ' pre-align
repeat bits
!outa[CLKpin]
outa[DIpin] := (val <-= 1) & 1
!outa[CLKpin]
pri prepare
outa[DIpin]~~
dira[DIpin]~~
outa[CLKpin]~~
dira[CLKpin]~~
outa[CSpin]~~
dira[CSpin]~~
pri end
outa[CSpin]~~
dira[DIpin]~
dira[CLKpin]~
dira[CSpin]~
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment