Skip to content

Commit

Permalink
osi: Add tty630/screen630 driver for the Ohio Scientific Model 630
Browse files Browse the repository at this point in the history
graphics card.
  • Loading branch information
ivop committed Nov 16, 2024
1 parent e5b6d0d commit 05a68f7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/arch/osi/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
size=128 * 640,
items={
"0:tty540b.com": "src/arch/osi/utils+tty540b",
"0:tty630.com": "src/arch/osi/utils+tty630",
}
| SCREEN_APPS
| SCREEN_APPS_SRCS
Expand Down Expand Up @@ -225,12 +226,16 @@
items={
"0:ccp.sys@sr": "src+ccp",
"0:bdos.sys@sr": "src/bdos",
"0:tty630.com": "src/arch/osi/utils+tty630",
}
| MINIMAL_APPS
| BIG_APPS
| PASCAL_APPS
| MINIMAL_APPS_SRCS
| BIG_APPS_SRCS
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS
)

mkcpmfs(
Expand Down
1 change: 1 addition & 0 deletions src/arch/osi/utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

llvmprogram( name="tty540b", srcs=["./tty540b.S"], deps=[ "include", ],)
llvmprogram( name="scrvt100", srcs=["./scrvt100.S"], deps=[ "include", ],)
llvmprogram( name="tty630", srcs=["./tty540b.S"], deps=[ "include", ], cflags=["-DOSI630"],)
45 changes: 43 additions & 2 deletions src/arch/osi/utils/tty540b.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,35 @@ cury: .fill 1

drv_zp_end:

#if OSI630

SCREEN_WIDTH = 64
SCREEN_HEIGHT = 16

CONTROL = $d800

ENABLE_64 = 0x01
ENABLE_COLOR = 0x02

NORMAL = $00
INVERSE = $01
CURSORXOR = (NORMAL ^ INVERSE)

SCREENMEM = $d000
SECLASTLINE = $d380
LASTLINE = $d3c0

COLORMEM = $d400
COLORXOR = ((SCREENMEM ^ COLORMEM) / 256)

#else

SCREEN_WIDTH = 64
SCREEN_HEIGHT = 32

CONTROL = $de00

ENABLE_64X32 = 0x01
ENABLE_64 = 0x01
ENABLE_COLOR = 0x04

NORMAL = $0e
Expand All @@ -46,6 +69,8 @@ LASTLINE = $d7c0
COLORMEM = $e000
COLORXOR = ((SCREENMEM ^ COLORMEM) / 256)

#endif

; -------------------------------------------------------------------------

zproc main
Expand All @@ -60,7 +85,11 @@ drv_screen540b:
.word DRVID_SCREEN
.word drv_screen540b_strat
.word 0
#if OSI630
.ascii "SCREEN630"
#else
.ascii "SCREEN540B"
#endif
.byte 0

zproc drv_screen540b_strat
Expand Down Expand Up @@ -105,7 +134,11 @@ drv_tty540b:
.word DRVID_TTY
.word drv_tty540b_strat
.word 0
#if OSI630
.ascii "TTY630"
#else
.ascii "TTY540B"
#endif
.byte 0

zproc drv_tty540b_strat
Expand Down Expand Up @@ -173,7 +206,7 @@ zproc init

jsr screen540b_clear

lda #(ENABLE_64X32 | ENABLE_COLOR)
lda #(ENABLE_64 | ENABLE_COLOR)
sta CONTROL

lda #<banner
Expand Down Expand Up @@ -207,19 +240,23 @@ clearscrn:
sta SCREENMEM+1*256,y
sta SCREENMEM+2*256,y
sta SCREENMEM+3*256,y
#ifndef OSI630
sta SCREENMEM+4*256,y
sta SCREENMEM+5*256,y
sta SCREENMEM+6*256,y
sta SCREENMEM+7*256,y
#endif
lda #NORMAL
sta COLORMEM+0*256,y
sta COLORMEM+1*256,y
sta COLORMEM+2*256,y
sta COLORMEM+3*256,y
#ifndef OSI630
sta COLORMEM+4*256,y
sta COLORMEM+5*256,y
sta COLORMEM+6*256,y
sta COLORMEM+7*256,y
#endif
dey
bne clearscrn

Expand Down Expand Up @@ -591,7 +628,11 @@ zendproc
.data

banner:
#if OSI630
.ascii "tty630/screen630 driver loaded."
#else
.ascii "tty540b/screen540b driver loaded."
#endif
.byte 13, 10, 0

; -------------------------------------------------------------------------
Expand Down

0 comments on commit 05a68f7

Please sign in to comment.