Skip to content

Commit

Permalink
housekeeping for next release
Browse files Browse the repository at this point in the history
- port of Microsoft OSI BASIC now more compatible to the original
  - changed text input to kernel routine
  - USR() now uses original addresses
  - A,X,Y are now passed to and from SYS using memory $0D,$0E,$0F
  - DIR now is LOAD"$"
  - updated basic files, since token order was changed
- write to $DF04 for timestamping
- fixed bug in upstream TaliForth2
- link to the review of Hans Otten
- fixed some minor typos

Signed-off-by: Sven Oliver Moll <svolli@svolli.de>
  • Loading branch information
Sven Oliver Moll committed Oct 9, 2024
1 parent 587c9df commit 69be525
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 94 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ setup-dev: setup-apt
sudo gpasswd -a $(USER) plugdev

setup-external:
sudo apt-get install 64tass libreadline-dev libfmt-dev moreutils fp-compiler ninja-build zip unzip
sudo apt install 64tass libreadline-dev libfmt-dev moreutils fp-compiler ninja-build zip unzip

$(RELEASE_ARCHIVE): $(CC65_SDK_DIR) all
for i in $$(ls -1 $(BUILD_DIR)/rp2040/*.uf2|grep -v _test.uf2$$); do cp -v $${i} sorbus-computer-$$(basename $${i});done
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ The project is fully open source, licensend under GPL v3:
[An addtional page](https://xayax.net/sorbus/) has been setup to explain more
about the ideas of the system, as well as some usecases.

Also there is now an
[independent review](http://retro.hansotten.nl/the-sorbus-computer/)
available at the wonderful
[Retro Computing pages](http://retro.hansotten.nl/) of Hans Otten.

To access the RP2040 without super user rights, make sure that your user is
in the groups "plugdev" and "dialout". You also need to add a udev rule. This
is available as part of picotool in the `udev` folder.
Expand Down
2 changes: 1 addition & 1 deletion cc65-sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ endif
sx4: $(targets)

clean:
$(RM) lib/*.o $(SORBUS_LIB) $(targets)
$(RM) */*.o $(SORBUS_LIB) $(targets)
8 changes: 7 additions & 1 deletion doc/cpu_detect.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ using the first executed instruction as our example.
```
10:001e r a2 :LDX #$00
```
The `10` is just a linenumber that starts when the interrupt register
The `10` is just a line number that starts when the interrupt register
is pulled high, so the CPU leaves reset state.

This is followed by an overview of the bus state at that time. `001e` is
Expand All @@ -238,6 +238,7 @@ environment.
The disassemblies were created with the command `cold debug` of the MCP
core. They have been slightly modified for a better readability.


Disassembly as seen on a 6502
-----------------------------
```
Expand Down Expand Up @@ -286,6 +287,7 @@ and early 1980s. The $5c used to detect the 65816 and 65CE02 is skipped
and the `INC`-test for any CMOS variant does also not succeed. The third
and final test for a working `ROR` instruction does succeed, though.


Disassembly as seen on a 6502 Rev.A
-----------------------------------

Expand Down Expand Up @@ -540,6 +542,10 @@ three bytes each reset. So during the retries, the stackpointer gets
moved to a position, where the writes go to a part of memory that was
not used during the test.

Interestingly, this is described as an enhancement to the original NMOS
6502 CPU according to the CMD G65SC02 datasheet. However, even later
CPUs do not have this "feature".

How was it fixed? The writes happen in a very early stage, even before
the reset vector is being read to determine where in memory to start
executing code. So writes are now discared, if they were done before
Expand Down
1 change: 1 addition & 0 deletions doc/native.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Miscellaneous ($DF00-$DF0F)
upper two bits mode: $40 -> store, $80 -> read, $c0 -> swap
- $DF04: (R) CPU: $01=6502, $06=65C02, $12=65816, $0e=65CE02, $02=65SC02
(bit set indicate CPU features:NMOS,CMOS,BIT (RE)SET,Z reg,16 bit)
- $DF04: (S) for benchmarking, show time since last triggered (or startup)
- $DF05-$DF0A: reserved for future use
- $DF0B: UART config: bit 0=enable crlf conversion
- $DF0C: (R) UART in queue read
Expand Down
2 changes: 1 addition & 1 deletion doc/opcodes6502.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MX;Jump
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MXE;Jump
$00;BRK;#IM;;2;7;;;1
$10;BPL;REL;;2;2;2;;2
$20;JSR;ABS;;3;6;;;1
Expand Down
2 changes: 1 addition & 1 deletion doc/opcodes65c02.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MX;Jump
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MXE;Jump
$00;BRK;#IM;;2;7;;;1
$10;BPL;REL;;2;2;2;;2
$20;JSR;ABS;;3;6;;;1
Expand Down
2 changes: 1 addition & 1 deletion doc/opcodes65ce02.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MX;Jump
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MXE;Jump
$00;BRK;#IM;;2;7;;;1
$10;BPL;REL;;2;2;;;2
$20;JSR;ABS;;3;5;;;1
Expand Down
2 changes: 1 addition & 1 deletion doc/opcodes65sc02.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MX;Jump
;Name;Mode;Reserved;Bytes;Cycles;ExtraCycles;MXE;Jump
$00;BRK;#IM;;2;7;;;1
$10;BPL;REL;;2;2;2;;2
$20;JSR;ABS;;3;6;;;1
Expand Down
3 changes: 2 additions & 1 deletion doc/opcodes_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Columns
- Bytes: bytes used for command (8 bit mode for 65816)
- Cycles: cycles taken (without extra for e.g. page crossing)
- ExtraCycles: extra cycles taken when crossing a page(1) and/or taking a branch(2)
- MX: will this instruction add an extra byte for 16 bit A(1) or X,Y(2)?
- MXE: (65816 only) add an extra byte for 16 bit A(1) or X,Y(2)?
Or is there any other specific behaviour bound to "E"-flag(4)?
- Jump: no jump(0), will jump(1), might jump(2)

Those columns will be mapped onto a 32 bit config bit array, see
Expand Down
24 changes: 18 additions & 6 deletions doc/other_licenses.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
This project uses software that was developed under non=free licenses.
This project uses software that was developed under non-free licenses.

src/65c02/native_osi_basic.s:
src/65c02/native_rom/osi_basic.s:
This is OSI BASIC V1.0 REV 3.2
Written by Richard W. Weiland
Copyright 1977 Microsoft Co.
It has been used with computers manufactured by Ohio Scientific Inc.
Reverse engineering was started by Michael Steil
Source code is based on version by Grant Searle for his simple 6502 computer.

src/65c02/native_tim.s:
src/65c02/native_rom/tim.s:
This is the Terminal Interface Monitor (TIM) of the MOS 6530-004.
Copyright 1976 MOS Technology

src/65c02/native_woz.s:
This is WozMon of the Apple 1 Computer.
src/65c02/native_rom/woz.s:
This is WozMon of the Apple 1 Computer
Written by Steve Wozniak
Copyright 1976 Apple Computer Company

src/65c02/native_sx4/inst-ass.s:
This is Instant 6502 Assembler for KIM-1
Written by Alan Cashin
Released as public domain


However, all of this code has been modified to some degree to fit this
project, the Sorbus Computer.
project, the Sorbus Computer. The focus is always on make things work good on
the hardware and not on keeping code as original as possible.

7 changes: 4 additions & 3 deletions src/65c02/native.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ TMP16 = $04
; UART and miscellaneous stuff
BANK = $DF00 ; ROM bank
SBCID = $DF01 ; (R) version information
TRAP = $DF01 ; (S) output debug messages and reboot
TRAP = $DF01 ; (S) output debug messages and drop to meta mode
RANDOM = $DF02 ; (R) get a random value
XRAMSW = $DF03 ; (W) save/restore/swap pages $00-$03
; bits 0-3 -> pages 0-3 affected
; $40 RAM -> buffer, $80 RAM <- buffer, $c0 RAM <-> buffer
CPUID = $DF04 ; CPU features:
CPUID = $DF04 ; (R) CPU features:
; $01 NMOS, $02 CMOS, $04 BIT (RE)SET, $08 Z reg, $10 16 bit
; known CPUs:
; $01 6502, $02 65SC02, $06 65C02, $0E 65CE02, $12 65816

; $21 6502 Rev.A (no ROR)
TMSTMP = $DF04 ; (S) debug/benchmark: print out time/cycles since last trigger
UARTCF = $DF0B ; config: bit 0: turn on/off crlf conversion
UARTRD = $DF0C ; (R) read from serial input queue (read only)
UARTRS = $DF0D ; (R) get serial input queue size (read only, up to 127, >127: error)
Expand Down
Loading

0 comments on commit 69be525

Please sign in to comment.