Skip to content

Commit

Permalink
Small changes to Apple 1 SRAM project
Browse files Browse the repository at this point in the history
- Added "lock" parameter to 1-pin keyboard driver to allow initialization of (virtual) numlock/capslock/scrollock (the lights on the keyboard don't work with 1-pin communication)
- Changed the SerKbd1TV initialization so it starts with numlock/capslock enabled
- Changed the startup messages slightly
  • Loading branch information
jacgoudsmit committed Nov 1, 2016
1 parent 1da96d4 commit 1535df4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Binary file modified Software/Apple1SRAM/1pinKBD.spin
Binary file not shown.
15 changes: 10 additions & 5 deletions Software/Apple1SRAM/Apple1.spin
@@ -1,6 +1,6 @@
''***************************************************************************
''* L-STAR, Apple-1 replica with minimal hardware
''* Copyright (C) 2014 Jac Goudsmit
''* Copyright (C) 2014-2016 Jac Goudsmit
''*
''* Some of the code in this project was based on the following projects,
''* all under MIT license unless otherwise mentioned:
Expand Down Expand Up @@ -46,11 +46,14 @@ PUB main | i
'waitcnt(clkfreq + cnt)

' Init serial, keyboard and TV
term.Start(hw#pin_RX, hw#pin_TX, -1 {hw#pin_KBDATA}, hw#pin_TV, BAUDRATE)
term.str(string("L-STAR (C) 2014-2016 JAC GOUDSMIT",13))
term.str(string("SIM.ROM BYTES: "))
'
' TIP: If you don't use a PS/2 keyboard (only serial port),
' change the third parameter to -1
term.Start(hw#pin_RX, hw#pin_TX, hw#pin_KBDATA, hw#pin_TV, BAUDRATE)
term.str(string("L-STAR (C) 2014-2016 Jac Goudsmit", 13))
term.str(string("Simulated ROM bytes: "))
term.dec(@RomEnd-@RomFile)
term.str(string(13,13))
term.tx(13)

' Initialize the clock before starting any cogs that wait for it
clock1.Init(1_000_000)
Expand All @@ -66,6 +69,8 @@ PUB main | i
sram.Init(RAMSIZE)
sram.Start

term.str(string("Reset the 6502 to start.", 13, 13))

' Start the clock
clock1.Activate

Expand Down
5 changes: 3 additions & 2 deletions Software/Apple1SRAM/SerKbd1TV.spin
Expand Up @@ -24,8 +24,9 @@ PUB Start(rxpin, txpin, kbdatapin, tvpin, baudrate) | t
if (kbdatapin => 0)
str(string("Hit SPACE on the PS/2 keyboard..."))
t := kb.calckbdtime(kbdatapin)
kb.start(kbdatapin, t & $FFFF, t >> 16)
havekb := 1
kb.start(kbdatapin, t & $FFFF, t >> 16, 6) ' 6=Numlock on, Capslock on, Scrollock off
havekb := 1
tx(13)

PUB str(s)

Expand Down

0 comments on commit 1535df4

Please sign in to comment.