Skip to content

Commit

Permalink
[GEOS] Text input support
Browse files Browse the repository at this point in the history
  • Loading branch information
mist64 committed Aug 28, 2020
1 parent 0d70c86 commit 9498437
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 71 deletions.
2 changes: 2 additions & 0 deletions basic/x16additions.s
Expand Up @@ -54,12 +54,14 @@ monitor:
jsr bjsrfar
.word $c000
.byte BANK_MONITOR
; does not return

;***************
geos:
jsr bjsrfar
.word $c000 ; entry
.byte BANK_GEOS
; does not return

;***************
color jsr getcol ; fg
Expand Down
94 changes: 45 additions & 49 deletions geos/kernal/conio/conio5.s
Expand Up @@ -8,7 +8,8 @@
.include "geosmac.inc"
.include "config.inc"
.include "gkernal.inc"
.include "c64.inc"

.include "io.inc"

.import _DisablSprite
.import _EnablSprite
Expand Down Expand Up @@ -66,58 +67,53 @@ PrmptOff1:
.endif

_InitTextPrompt:
tay
.if 0
START_IO
MoveB mob0clr, mob1clr
lda moby2
and #%11111101
sta moby2
tay ; height

LoadB alphaFlag, %10000011

; init sprite #1
lda #1 * 8
sta VERA_ADDR_L
lda #>VERA_SPRITES_BASE
sta VERA_ADDR_M
lda #((^VERA_SPRITES_BASE) | $10)
sta VERA_ADDR_H
lda #<((sprite_addr + $1000) >> 5)
sta VERA_DATA0
lda #1 << 7 | >((sprite_addr + $1000) >> 5) ; 8 bpp
sta VERA_DATA0

; set size
lda #1 * 8 + 7
sta VERA_ADDR_L
lda #3 << 6 | 0 << 4 ; 8x64 px
sta VERA_DATA0

; create sprite image
lda #>(sprite_addr + $1000)
sta VERA_ADDR_M
lda #<(sprite_addr + $1000)
sta VERA_ADDR_L
lda #$10 | (sprite_addr >> 16)
sta VERA_ADDR_H
tya
pha
LoadB alphaFlag, %10000011
ldx #64
lda #0
@1: sta spr1pic-1,x
lda #6 ; blue
@1: sta VERA_DATA0
ldx #7
@2: stz VERA_DATA0 ; translucent
dex
bne @1
pla
tay
.ifdef bsw128
cpy #42
bcc @X
ldy #42
@X:
.endif
cpy #21
bcc @2
beq @2
tya
lsr
tay
lda moby2
ora #2
sta moby2
@2:
.ifdef bsw128
tya
ora #$80
sta L8A7F
.endif
lda #%10000000
@3: sta spr1pic,x
inx
inx
inx
bne @2
dey
.ifdef bsw128 ; fix: copied 1 byte too many
bne @1
ply
@3: ldx #8
@4: stz VERA_DATA0 ; translucent
dex
bne @4
iny
cpy #64
bne @3
.else
bpl @3
.endif
END_IO
.else
;XXX TODO X16 cursor sprite
.endif

rts

20 changes: 20 additions & 0 deletions geos/kernal/keyboard/keyboard1.s
Expand Up @@ -9,10 +9,30 @@
.include "config.inc"
.include "gkernal.inc"
.include "c64.inc"
.include "banks.inc"

.global _DoKeyboardScan

.import KbdScanHelp2

.segment "keyboard1"

_DoKeyboardScan:
.import gjsrfar
jsr gjsrfar
.word $FF9F ; kbd_scan
.byte BANK_KERNAL

jsr gjsrfar
.word $FFE4 ; getin
.byte BANK_KERNAL

cmp #0
bne :+
rts

: cmp #20; PETSCII delete
bne :+
lda #8 ; ASCII backspace

: jmp KbdScanHelp2
13 changes: 0 additions & 13 deletions geos/kernal/keyboard/keyboard2.s
Expand Up @@ -3,17 +3,4 @@
;
; C64/C128 keyboard driver

.include "const.inc"
.include "geossym.inc"
.include "geosmac.inc"
.include "config.inc"
.include "gkernal.inc"
.include "c64.inc"

.global KbdDecodeTab1
.global KbdDecodeTab2
.global KbdTab1
.global KbdTab2
.global KbdTestTab

.segment "keyboard2"
10 changes: 2 additions & 8 deletions geos/kernal/load/load1c.s
Expand Up @@ -17,14 +17,8 @@
.segment "load1c"

DeskTopName:
.ifdef bsw128
.byte "128 DESKTOP", 0
.elseif .defined(gateway)
.byte "GATEWAY", 0
.byte 0 ; PADDING
.elseif .defined(wheels)
.byte "DESKTOP", 0
.byte 0 ; PADDING
.if 0
.byte "GEOWRITE", 0
.else
.byte "DESK TOP", 0
.endif
Expand Down
8 changes: 7 additions & 1 deletion geos/kernal/sprites/sprites.s
Expand Up @@ -60,7 +60,13 @@ _EnablSprite:
; Destroyed: a, x, y, r6
;---------------------------------------------------------------
_PosSprite:
lda #<(VERA_SPRITES_BASE + 2)
lda r3L
and #7
asl
asl
asl
clc
adc #<(VERA_SPRITES_BASE + 2)
sta VERA_ADDR_L
lda #>(VERA_SPRITES_BASE + 2)
sta VERA_ADDR_M
Expand Down
5 changes: 5 additions & 0 deletions geos/kernal/start/start64.s
Expand Up @@ -76,6 +76,11 @@ _ResetHandle:
.word __drvcbdos_RUN__
.word __drvcbdos_SIZE__

lda #$0f ; iso mode
jsr gjsrfar
.word bsout
.byte BANK_KERNAL

lda #$80
jsr gjsrfar
.word screen_set_mode
Expand Down

0 comments on commit 9498437

Please sign in to comment.