1
0
mirror of https://github.com/cc65/cc65.git synced 2026-04-26 13:18:31 +00:00

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
+4 -6
View File
@@ -39,18 +39,18 @@ L2: jsr KBDREAD ; Read char and return in A
;--------------------------------------------------------------------------
; Module constructor/destructor
.bss
.segment "INIT"
keyvec: .res 2
.segment "INIT"
.segment "ONCE"
initcgetc:
; Save the old vector
lda KeyStoreVec
ldx KeyStoreVec+1
sta keyvec
lda KeyStoreVec+1
sta keyvec+1
stx keyvec+1
; Set the new vector. I can only hope that this works for other C128
; versions...
@@ -68,5 +68,3 @@ SetVec: sei
stx KeyStoreVec+1
cli
rts
+2 -3
View File
@@ -8,7 +8,7 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
.import gotoxy
.import PLOT
.include "c128.inc"
@@ -21,8 +21,7 @@ newline = NEWLINE
_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
+5 -5
View File
@@ -8,7 +8,7 @@
.import zerobss
.import push0, callmain
.import RESTOR, BSOUT, CLRCH
.import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
.import __MAIN_START__, __MAIN_SIZE__, __STACKSIZE__
.importzp ST
.include "zeropage.inc"
@@ -56,10 +56,10 @@ L1: lda sp,x
tsx
stx spsave ; Save the system stack pointer
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 ; Set argument stack ptr
stx sp+1 ; Set argument stack ptr
; Call the module constructors.
@@ -108,7 +108,7 @@ L2: lda zpsave,x
; ------------------------------------------------------------------------
; Data
.segment "INITBSS"
.segment "INIT"
zpsave: .res zpspace
+1 -1
View File
@@ -9,7 +9,7 @@
; ------------------------------------------------------------------------
.segment "INIT"
.segment "ONCE"
initirq:
lda IRQVec
+2 -7
View File
@@ -104,7 +104,7 @@ joy1: lda #$7F
sei
sta CIA1_PRA
lda CIA1_PRB
cli
back: cli
and #$1F
eor #$1F
rts
@@ -118,9 +118,4 @@ joy2: ldx #0
sta CIA1_DDRA
lda CIA1_PRA
sty CIA1_DDRA
cli
and #$1F
eor #$1F
rts
jmp back
+3 -3
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:
@@ -127,7 +127,7 @@ done: lda #<argv
stx __argv + 1
rts
.segment "INITBSS"
.segment "INIT"
term: .res 1
name: .res NAME_LEN + 1
+1 -1
View File
@@ -29,7 +29,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
; --------------------------------------------------------------------------
; Initialize the mouse sprite.
.segment "INIT"
.segment "ONCE"
initmcb:
+1 -1
View File
@@ -63,7 +63,7 @@ BCD2dec:tax
; Constructor that writes to the 1/10 sec register of the TOD to kick it
; into action. If this is not done, the clock hangs. We will read the register
; and write it again, ignoring a possible change in between.
.segment "INIT"
.segment "ONCE"
.proc initsystime
+30
View File
@@ -0,0 +1,30 @@
;
; Written by Groepaz <groepaz@gmx.net>
;
; void waitvsync (void);
;
.export _waitvsync
.include "c128.inc"
_waitvsync:
bit MODE
bmi @c80
@l1:
bit VIC_CTRL1
bpl @l1
@l2:
bit VIC_CTRL1
bmi @l2
rts
@c80:
;FIXME: do we have to switch banks?
@l3:
lda VDC_INDEX
and #$20
beq @l3
rts