1
0
mirror of https://github.com/mgcaret/of816.git synced 2024-05-28 14:41:27 +00:00

Neon816: hardware equates include file

This commit is contained in:
mgcaret 2019-12-01 00:41:06 -08:00
parent bce8d70975
commit e73066a53f
3 changed files with 90 additions and 16 deletions

View File

@ -0,0 +1,79 @@
cpu_clk = 14000000
; *****************
; MMU
; *****************
NeonMMU = $080000
; *****************
; I/O Ports
;
; Generally for the status ports, unless otherwise stated
; b3 = transmit buffer full (output is busy)
; b0 = receive buffer full (input is ready)
; *****************
SERio = $100008
SERstat = $100009
; Presumably baud and line setup
SERctrlA = $10000A ; NeonForth sets this to $8D
SERctrlB = $10000B ; ditto $06
SERctrlC = $10000C ; ditto $00
; MIDI ports
MIDIio = $100020
MIDIstat = $100021
; PS/2 Keyboard Port
PS2Kio = $100022
PS2Kstat = $100023
; PS/2 Mouse Port
PS2Mio = $100024
PS2Mstat = $100025
; *****************
; RTC
; *****************
RTCus = $100100 ; 2 bytes
RTCms = $100102 ; 2 bytes
RTCsec = $100104 ; 1 byte
RTCmin = $100105 ; 1 byte
RTChour = $100106 ; 1 byte
RTCday = $100108 ; 2 bytes
; *****************
; I2C
; *****************
I2C2io = $100014
I2C2ctrl = $100015 ; read: b3 = busy; write: $01 = start, $02 = stop, $04 = receive, $08 = send, $44 = receive/ack
; *****************
; SPI
; *****************
SPI2io = $10001C
SPI2ctrl = $10001D ; read: b3 = tx busy, b2 = rx full; write: $01 = start, $00 = stop; init = $00
SPI2ctrl2 = $10001E ; init = $00
SPI2ctrl3 = $10001F ; init = $05
; *****************
; VDC
; *****************
VDCio = $100120 ; read: 1 byte, write: 1 or 2 bytes
; *****************
; FDC
; *****************
FDCio = $090004
FDCstat = $090005 ; b7=0 = tx busy

View File

@ -2,6 +2,7 @@
.a16 .a16
.i16 .i16
.include "macros.inc" .include "macros.inc"
.include "./Neon816-hw.inc"
.import _Forth_initialize .import _Forth_initialize
.import _Forth_ui .import _Forth_ui
.import _system_interface .import _system_interface
@ -34,7 +35,7 @@
; MMU setup, maybe. Found at page $FF in Neon bank 0 ; MMU setup, maybe. Found at page $FF in Neon bank 0
ldx #$001C ldx #$001C
lda #$8000 lda #$8000
: sta f:$080000,x : sta f:NeonMMU,x
dex dex
dex dex
bpl :- bpl :-
@ -42,11 +43,11 @@
sep #SHORT_A ; not necessary unless we were already native & long sep #SHORT_A ; not necessary unless we were already native & long
.a8 .a8
lda #$8D lda #$8D
sta f:$10000A sta f:SERctrlA
lda #$06 lda #$06
sta f:$10000B sta f:SERctrlB
lda #$00 lda #$00
sta f:$10000C sta f:SERctrlC
rep #SHORT_A|SHORT_I rep #SHORT_A|SHORT_I
.a16 .a16
.i16 .i16

View File

@ -1,12 +1,6 @@
; Platform support library for Neon816 ; Platform support library for Neon816
; ;
.include "./Neon816-hw.inc"
cpu_clk = 14000000
; Serial Port Hardware
ser_stat = $100009 ; read: b0 set if data waiting, b3 set if still sending data
ser_io = $100008 ; read: receive data. write: send data
.proc _system_interface .proc _system_interface
;wdm 3 ;wdm 3
@ -56,8 +50,8 @@ table: .addr _sf_pre_init
sep #SHORT_A sep #SHORT_A
.a8 .a8
tya tya
sta f:ser_io sta f:SERio
: lda f:ser_stat : lda f:SERstat
bit #$08 bit #$08
bne :- bne :-
rep #SHORT_A rep #SHORT_A
@ -70,7 +64,7 @@ table: .addr _sf_pre_init
ldy #$0000 ; anticipate false ldy #$0000 ; anticipate false
sep #SHORT_A sep #SHORT_A
.a8 .a8
lda f:ser_stat ; b0=1 if data ready lda f:SERstat ; b0=1 if data ready
ror ror
bcc :+ bcc :+
iny iny
@ -85,10 +79,10 @@ table: .addr _sf_pre_init
.proc _sf_key .proc _sf_key
sep #SHORT_A sep #SHORT_A
.a8 .a8
: lda f:ser_stat : lda f:SERstat
ror ror
bcc :- bcc :-
lda f:ser_io lda f:SERio
rep #SHORT_A rep #SHORT_A
.a16 .a16
and #$00FF and #$00FF