Pull to fix extra changes in PR #863
This commit is contained in:
Bas Wassink
2019-03-24 20:49:53 +01:00
313 changed files with 10597 additions and 7389 deletions

View File

@@ -10,6 +10,7 @@
.import cursor
.include "cbm_kernal.inc"
.include "c128.inc"
;--------------------------------------------------------------------------
@@ -17,8 +18,8 @@
_cgetc: lda KEY_COUNT ; Get number of characters
bne L2 ; Jump if there are already chars waiting
; Switch on the cursor if needed. We MUST always switch the cursor on,
; before switching it off, because switching it off will restore the
; Switch on the cursor if needed. We MUST always switch the cursor on,
; before switching it off, because switching it off will restore the
; character attribute remembered when it was switched on. So just switching
; it off will restore the wrong character attribute.

View File

@@ -6,9 +6,6 @@
.export _clrscr
.include "c128.inc"
.include "cbm_kernal.inc"
_clrscr = CLRSCR

View File

@@ -9,8 +9,8 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import gotoxy
.import PLOT
.include "cbm_kernal.inc"
.include "c128.inc"
newline = NEWLINE
@@ -85,4 +85,3 @@ plot: ldy CURS_X
; position in Y
putchar = $CC2F

View File

@@ -25,6 +25,7 @@
.constructor initmainargs, 24
.import __argc, __argv
.include "cbm_kernal.inc"
.include "c128.inc"

View File

@@ -45,15 +45,15 @@
; Jump table
.word INSTALL
.word UNINSTALL
.word OPEN
.word CLOSE
.word GET
.word PUT
.word STATUS
.word IOCTL
.word IRQ
.word SER_INSTALL
.word SER_UNINSTALL
.word SER_OPEN
.word SER_CLOSE
.word SER_GET
.word SER_PUT
.word SER_STATUS
.word SER_IOCTL
.word SER_IRQ
;----------------------------------------------------------------------------
; I/O definitions
@@ -155,11 +155,11 @@ Vector := *+1
.reloc
;----------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. If
; SER_INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present.
; Must return an SER_ERR_xx code in a/x.
INSTALL:
SER_INSTALL:
; Deactivate DTR and disable 6551 interrupts
@@ -192,10 +192,10 @@ SetNMI: sta NMIVec
rts
;----------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
; SER_UNINSTALL routine. Is called before the driver is removed from memory.
; Must return an SER_ERR_xx code in a/x.
UNINSTALL:
SER_UNINSTALL:
; Stop interrupts, drop DTR
@@ -212,7 +212,7 @@ UNINSTALL:
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
@@ -283,11 +283,11 @@ InvBaud:
rts
;----------------------------------------------------------------------------
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
; SER_CLOSE: Close the port, disable interrupts and flush the buffer. Called
; without parameters. Must return an error code in a/x.
;
CLOSE:
SER_CLOSE:
; Stop interrupts, drop DTR
@@ -305,12 +305,13 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
; return.
;
GET: ldx SendFreeCnt ; Send data if necessary
SER_GET:
ldx SendFreeCnt ; Send data if necessary
inx ; X == $FF?
beq @L1
lda #$00
@@ -349,11 +350,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an error code in a/x.
;
PUT:
SER_PUT:
; Try to send
@@ -383,23 +384,25 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an error code in a/x.
;
STATUS: lda ACIA_STATUS
SER_STATUS:
lda ACIA_STATUS
ldx #0
sta (ptr1,x)
txa ; SER_ERR_OK
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an error code in a/x.
;
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>SER_ERR_INV_IOCTL
rts
@@ -407,7 +410,7 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
; IRQ: Not used on the C128
;
IRQ = $0000
SER_IRQ = $0000
;----------------------------------------------------------------------------
;
@@ -500,5 +503,3 @@ InitBuffers:
stx RecvFreeCnt
stx SendFreeCnt
rts