Pico RomWBW – Emulation Details

A work in progress…

Z80 Ports (defaults)

0xA0-0xA7 acia
0x80 – 0x87) sio2
0x10 – 0x17 ide
0xA0 0xA7 uart
0x00 PIO (front panel switches and LED’s
0x28 SPO256Port
0x2a SPO256FreqPort
0x29 BeepPort
0x40 NeoPixelPort

Front panel Switches / LED

Writing to Port Zero sets the bits/leds on the front-panel.

Reading from port Zero gives the position of the switches.

Please note that as the 8 lines are shared between the LEDs and switches reading the port will briefly disconnect the drive to the Led’s

5 REM Front Panel LEDs to do CYLON chase 
10 FOR F=0 TO 7
20 OUT 0,2^F
30 GOSUB 100
40 NEXT F
50 FOR F=7 TO 0 STEP -1
60 OUT 0,2^F
70 GOSUB 100
80 NEXT F
90 GOTO 10
100 FOR X = 1 TO 50 : NEXT X : RETURN

SPO256-al2 Speech

Writing bytes from 0-64 to port 0x28 will trigger the appropriate phonym to be played, reading port 0x28 will give a non zero output whilst a phonym is being played.

A tool to compute the phonyms for text speech is here https://extkits.co.uk/sp0256-al2/

5 REM Speak 'RC2040' using allophone data beep port 40 (0x28)
10 FOR A=1 TO 22
20 READ X
30 OUT 40,X
40 WHILE(INP(40)>0)
50 WEND
60 NEXT A
100 DATA 59,2,55,55,19,2,13,48,7,7,11,1,2,13,19,4,40,58,2,13,19,4

Sending a value from 0-127 will change the frequency of the speech roughly clocking the speech from the midi note value frequency .

Beep

Sending a value of 1-127 to 0x29 will send a tone to the speaker, roughly the same frequency as the note values in the midi specification.

10 REM output middle C (256 Hz) Base Port 41 (0x29)
20 REM and turn off afterwards
30 OUT 41,60
40 FOR B=1 TO 200
50 NEXT B
60 OUT 41,0

NeoPixel Port

Currently untested with the WBW board.

But you could connect a string of neo-pixels WS2812 to GPIO 28 on the Pico. and take a look here.

Sample code

100 rem neopixel repeat test
110 OUT 64,3
120 OUT 65,3
130 c=c+1
140 for p=0 to 2
150 c=c+1
160 gosub 2000
170 next p
180 goto 130
200 end



2000 if c=1 then goto 2100
2010 if c=2 then goto 2200
2030 if c=3 then goto 2300
2040 c=c-3 
2050 goto 2000

2100 r=32:g=0:b=0
2110 goto 3000

2200 r=0:g=32:b=0
2210 goto 3000

2300 r=0:g=0:b=32
2310 goto 3000

3000 out 69,r
3010 out 70,g
3020 out 71,b
3030 out 67,p
3040 return