Skip to content

Commit 65cd6c4

Browse files
authored
[intellivision] add current pico code. (#990)
* [intellivision] add current pico code. * remove list file. * Add the intv bring-up lab.
1 parent a3763e5 commit 65cd6c4

File tree

16 files changed

+18839
-0
lines changed

16 files changed

+18839
-0
lines changed

pico/intellivision/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
!.vscode/*

pico/intellivision/CMakeLists.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Generated Cmake Pico project file
2+
3+
cmake_minimum_required(VERSION 3.13)
4+
5+
set(CMAKE_C_STANDARD 11)
6+
set(CMAKE_CXX_STANDARD 17)
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8+
9+
# Initialise pico_sdk from installed location
10+
# (note this can come from environment, CMake cache etc)
11+
12+
# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==
13+
if(WIN32)
14+
set(USERHOME $ENV{USERPROFILE})
15+
else()
16+
set(USERHOME $ENV{HOME})
17+
endif()
18+
set(sdkVersion 2.1.1)
19+
set(toolchainVersion 14_2_Rel1)
20+
set(picotoolVersion 2.1.1)
21+
set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)
22+
if (EXISTS ${picoVscode})
23+
include(${picoVscode})
24+
endif()
25+
# ====================================================================================
26+
set(PICO_BOARD pico CACHE STRING "Board type")
27+
28+
# Pull in Raspberry Pi Pico SDK (must be before project)
29+
include(pico_sdk_import.cmake)
30+
31+
project(fuji-intv C CXX ASM)
32+
33+
# Initialise the Raspberry Pi Pico SDK
34+
pico_sdk_init()
35+
36+
# Add executable. Default name is the project name, version 0.1
37+
38+
add_executable(fuji-intv fuji-intv.c )
39+
40+
pico_set_program_name(fuji-intv "fuji-intv")
41+
pico_set_program_version(fuji-intv "0.1")
42+
43+
# no_flash means the target is to run from RAM
44+
pico_set_binary_type(fuji-intv no_flash)
45+
46+
# Generate PIO header
47+
pico_generate_pio_header(fuji-intv ${CMAKE_CURRENT_LIST_DIR}/bus_decode.pio)
48+
49+
# Modify the below lines to enable/disable output over UART/USB
50+
pico_enable_stdio_uart(fuji-intv 0)
51+
pico_enable_stdio_usb(fuji-intv 1)
52+
53+
# Add the standard library to the build
54+
target_link_libraries(fuji-intv
55+
pico_stdlib)
56+
57+
# Add the standard include files to the build
58+
target_include_directories(fuji-intv PRIVATE
59+
${CMAKE_CURRENT_LIST_DIR}
60+
)
61+
62+
# Add any user requested libraries
63+
target_link_libraries(fuji-intv
64+
hardware_pio
65+
)
66+
67+
pico_add_extra_outputs(fuji-intv)
68+

pico/intellivision/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# fuji-intv-bring-up-lab
2+
3+
This repo contains RP2040 code used for the bring-up of the Intellivision FujiNet using a PiRTO II cart.
4+
5+
There are two goals:
6+
7+
(1) Emulate a ROM properly on the CP-1610 bus.
8+
(2) Communicate a command frame to FujiNet, and back.
9+
10+
This firmware will be supplanted by the real thing, soon enough. But for now, it's here so others can jump in and help.
11+
12+
-Thom

pico/intellivision/bus_decode.pio

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Receives 19 bits: DB0–DB15 + BDIR + BC2 + BC1
2+
.program cp1600_bus_rx
3+
.define PINS_TO_SAMPLE 19 ; # of pins to sample.
4+
.wrap_target
5+
wait 1 pin 16 ; Wait for BDIR == 1 (CPU driving bus)
6+
nop [31] ; 279.3ns valid delay
7+
nop [31] ; at 250MHz.
8+
nop [5]
9+
in pins, PINS_TO_SAMPLE ; Read pins
10+
in null, 13
11+
push block
12+
wait 0 pin 16 ; Wait for BDIR == 0 (CPU released bus)
13+
.wrap
14+
15+
// Transmits 16 bits onto DB0–15 during DTB
16+
.program cp1600_bus_tx
17+
.wrap_target
18+
wait 0 pin 16 ; BDIR == 0
19+
wait 1 pin 17 ; BC2 == 1
20+
wait 1 pin 18 ; BC1 == 1 => DTB
21+
out pins, 16 ; Output data onto DB0–15
22+
.wrap

pico/intellivision/cart.h

Lines changed: 8194 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)