Merge branch 'master' into kbrepeat

This commit is contained in:
Bob Andrews
2017-08-06 20:22:52 +02:00
committed by GitHub
602 changed files with 20833 additions and 8109 deletions

View File

@@ -59,7 +59,7 @@ L2: sta ENABLE_ROM ; Bank in the ROM
.constructor initkbd
.destructor donekbd
.segment "INIT" ; Special init code segment may get overwritten
.segment "ONCE" ; Special init code segment may get overwritten
.proc initkbd
@@ -72,6 +72,9 @@ L2: sta ENABLE_ROM ; Bank in the ROM
.endproc
fnkeys: .byte $01, $01, $01, $01, $01, $01, $01, $01
.byte 133, 137, 134, 138, 135, 139, 136, 140
.segment "LOWCODE" ; Accesses the ROM - must go into low mem
@@ -87,11 +90,3 @@ L2: sta ENABLE_ROM ; Bank in the ROM
rts
.endproc
; Function key table, readonly
.rodata
fnkeys: .byte $01, $01, $01, $01, $01, $01, $01, $01
.byte 133, 137, 134, 138, 135, 139, 136, 140

View File

@@ -7,7 +7,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
.import gotoxy
.import PLOT
.include "plus4.inc"
@@ -15,8 +15,7 @@
_cputcxy:
pha ; Save C
jsr popa ; Get Y
jsr _gotoxy ; Set cursor, drop x
jsr gotoxy ; Set cursor, drop x and y
pla ; Restore C
; Plot a character - also used as internal function

View File

@@ -9,7 +9,7 @@
.import callirq_y, initlib, donelib
.import callmain, zerobss
.import __INTERRUPTOR_COUNT__
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.importzp ST
@@ -50,12 +50,12 @@ L1: lda sp,x
; of the usable RAM.
tsx
stx spsave ; save system stk ptr
stx spsave ; Save system stk ptr
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
lda #<(__MAIN_START__ + __MAIN_SIZE__ + __STACKSIZE__)
ldx #>(__MAIN_START__ + __MAIN_SIZE__ + __STACKSIZE__)
sta sp
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
sta sp+1
stx sp+1
; Set up the IRQ vector in the banked RAM; and, switch off the ROM.
@@ -195,7 +195,7 @@ spsave: .res 1
irqcount: .byte 0
.segment "INITBSS"
.segment "INIT"
zpsave: .res zpspace

View File

@@ -1,17 +1,15 @@
;
; Standard joystick driver for the Plus/4. May be used multiple times when linked
; to the statically application.
; Standard joystick driver for the Plus/4 and C16.
; May be used multiple times when linked statically to an application.
;
; Ullrich von Bassewitz, 2002-12-21
; 2002-12-21, Ullrich von Bassewitz
; 2016-06-18, Greg King
;
.include "zeropage.inc"
.include "joy-kernel.inc"
.include "joy-error.inc"
.include "plus4.inc"
.macpack generic
.macpack module
@@ -26,7 +24,7 @@
; Driver signature
.byte $6A, $6F, $79 ; "joy"
.byte $6A, $6F, $79 ; ASCII "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
@@ -39,7 +37,7 @@
.byte $02 ; JOY_DOWN
.byte $04 ; JOY_LEFT
.byte $08 ; JOY_RIGHT
.byte $10 ; JOY_FIRE
.byte $80 ; JOY_FIRE
.byte $00 ; JOY_FIRE2 unavailable
.byte $00 ; Future expansion
.byte $00 ; Future expansion
@@ -98,16 +96,20 @@ COUNT:
; READ: Read a particular joystick passed in A.
;
READ: ldy #$FA ; Load index for joystick #1
READ: ldy #%11111011 ; Load index for joystick #1
tax ; Test joystick number
beq @L1
ldy #$FB ; Load index for joystick #2
ldy #%11111101 ; Load index for joystick #2
ldx #>$0000 ; (Return unsigned int)
@L1: sei
sty TED_KBD
lda TED_KBD
sty TED_KBD ; Read a joystick ...
lda TED_KBD ; ... and some keys -- it's unavoidable
cli
ldx #$00 ; Clear high byte
and #$1F
eor #$1F
rts
eor #%11111111
; The fire buttons are in bits 6 and 7. Both of them cannot be %1 together.
; Therefore, bit 6 can be merged with bit 7.
clc
adc #%01000000
rts

19
libsrc/plus4/kscnkey.s Normal file
View File

@@ -0,0 +1,19 @@
;
; 2002-11-22, Ullrich von Bassewitz
; 2016-08-07, Greg King
;
; SCNKEY replacement function
;
.export SCNKEY
.include "plus4.inc"
.segment "LOWCODE" ; Must go into low memory
.proc SCNKEY
sta ENABLE_ROM ; Enable the ROM
jsr $FF9F ; Call the ROM routine
sta ENABLE_RAM ; Switch back to RAM
rts ; Return to caller
.endproc

19
libsrc/plus4/kudtim.s Normal file
View File

@@ -0,0 +1,19 @@
;
; 2002-11-22, Ullrich von Bassewitz
; 2016-08-07, Greg King
;
; UDTIM replacement function
;
.export UDTIM
.include "plus4.inc"
.segment "LOWCODE" ; Must go into low memory
.proc UDTIM
sta ENABLE_ROM ; Enable the ROM
jsr $FFEA ; Call the ROM routine
sta ENABLE_RAM ; Switch back to RAM
rts ; Return to caller
.endproc

View File

@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
REM = $8f ; BASIC token-code
NAME_LEN = 16 ; Maximum length of command-name
; Get possible command-line arguments. Goes into the special INIT segment,
; Get possible command-line arguments. Goes into the special ONCE segment,
; which may be reused after the startup code is run
.segment "INIT"
.segment "ONCE"
initmainargs:
@@ -125,7 +125,7 @@ done: lda #<argv
stx __argv + 1
rts
.segment "INITBSS"
.segment "INIT"
term: .res 1
name: .res NAME_LEN + 1

17
libsrc/plus4/waitvsync.s Normal file
View File

@@ -0,0 +1,17 @@
;
; Written by Groepaz <groepaz@gmx.net>
;
; void waitvsync (void);
;
.export _waitvsync
.include "plus4.inc"
_waitvsync:
@l1:
lda TED_VLINEHI
and #$01
ora TED_VLINELO
bne @l1
rts