Kernel version 0.9 : IRQ/VBL refactoring...

This commit is contained in:
Rémy GIBERT 2017-02-07 08:27:27 +01:00
parent 0442bf83c2
commit ec6669ec7e
9 changed files with 95 additions and 58 deletions

Binary file not shown.

Binary file not shown.

View File

@ -372,14 +372,17 @@ HOME stz CH
lda #' '
ora INVFLG
php
sei
sta SETWRITEAUX
ldy #39
.2 sta (ZPBaseL1),y
dey
bpl .2
sta CLRWRITEAUX
plp
ldy #39
.3 sta (ZPBaseL1),y
@ -420,23 +423,7 @@ SCROLL.UP ldx SCROLLTOP
lda BASEH,x
sta ZPBaseL2+1
ldy #39
sta SETWRITEAUX
sta SETREADAUX
.2 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .2
ldy #39
sta CLRWRITEAUX
sta CLRREADAUX
.3 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .3
jsr COPY.L2toL1
cpx SCROLLBOT
bne .1
@ -475,23 +462,7 @@ SCROLL.DN ldx SCROLLBOT
lda BASEH,x
sta ZPBaseL2+1
ldy #39
sta SETWRITEAUX
sta SETREADAUX
.2 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .2
ldy #39
sta CLRWRITEAUX
sta CLRREADAUX
.3 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .3
jsr COPY.L2toL1
cpx SCROLLTOP
bne .1
@ -661,11 +632,14 @@ SetCharAtXY cmp #$40
bcs .10
and #$3F
.10 pha
.10 php
pha
txa
lsr
bcs .1
sei
sta SETWRITEAUX
.1 clc
@ -676,13 +650,19 @@ SetCharAtXY cmp #$40
pla
sta (ZPBaseL1)
sta CLRWRITEAUX
plp
rts
*--------------------------------------
GetCharAtXY txa
GetCharAtXY php
txa
lsr
bcs .1
sei
sta SETREADAUX
.1 clc
@ -692,9 +672,36 @@ GetCharAtXY txa
sta ZPBaseL1+1
lda (ZPBaseL1)
sta CLRREADAUX
plp
rts
*--------------------------------------
COPY.L2toL1 php
sei
sta SETWRITEAUX
sta SETREADAUX
ldy #39
.1 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .1
sta CLRWRITEAUX
sta CLRREADAUX
plp
ldy #39
.2 lda (ZPBaseL2),y
sta (ZPBaseL1),y
dey
bpl .2
rts
*--------------------------------------
IsDigit cmp #'0'
bcc .9
cmp #'9'+1

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.SRC
LOMEM $A00
LOMEM $900
INC 1
AUTO 6
.LIST OFF
@ -207,17 +207,22 @@ DevMgr.SYS.Scroll
lda DevMgr.SYS.BASEH,x
sta ZPDRV+3
ldy #39
php
sei
sta SETWRITEAUX
sta SETREADAUX
ldy #39
.2 lda (ZPDRV+2),y
sta (ZPDRV),y
dey
bpl .2
ldy #39
sta CLRWRITEAUX
sta CLRREADAUX
plp
ldy #39
.3 lda (ZPDRV+2),y
sta (ZPDRV),y
dey
@ -231,9 +236,11 @@ DevMgr.SYS.ClrLineAtX
sta ZPDRV
lda DevMgr.SYS.BASEH,x
sta ZPDRV+1
php
sei
lda #$A0
ldy #39
.1 sta SETWRITEAUX
@ -243,6 +250,8 @@ DevMgr.SYS.ClrLineAtX
dey
bpl .1
plp
rts
*--------------------------------------
DevMgr.SYS.Home ldx #23
@ -264,7 +273,9 @@ DevMgr.SYS.SetCharAtYX
bcs .1
and #$3F
.1 phy
.1 php
phy
pha
lda DevMgr.SYS.BASEL,x
sta ZPDRV
@ -280,6 +291,9 @@ DevMgr.SYS.SetCharAtYX
sta (ZPDRV),y
sta CLRWRITEAUX
ply
plp
rts
*--------------------------------------
DevMgr.SYS.CH .BS 1

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.SRC
LOMEM $A00
LOMEM $900
INC 1
AUTO 6
.LIST OFF
@ -16,13 +16,12 @@ EVT.GetEvents stz pEvent point to start of event list
stz EvtMgr.Count reset Size
lda K.IrkMgr.VBL do we have IRQ enabled for VBL ?
beq .10 no, regular poll
bpl .10 no, regular poll
lda K.IrkMgr.VBLINT
beq EVT.GetEvents.DEV no
dec K.IrkMgr.VBLINT
stz K.IrkMgr.VBLINT
bra .11
.10 lda VBL get VLINE status

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.SRC
LOMEM $A00
LOMEM $900
INC 1
AUTO 6
.LIST OFF
@ -145,6 +145,7 @@ DevMgr.SYS .DA DevMgr.SYS.Code
*--------------------------------------
SETMOUSE .EQ $12 Sets mouse mode
SERVEMOUSE .EQ $13 Services mouse interrupt
READMOUSE .EQ $14 Reads mouse position
INITMOUSE .EQ $19 Resets mouse clamps to default values,sets mouse position to 0,0
*--------------------------------------
IrqMgrInit php
@ -191,17 +192,23 @@ IrqMgrInit php
.4 lda ZPPtr1+1
sta GOMOUSE.JMP+2 DEVSLOTCn
sta K.IrqMgrVBL.JMP+2
and #$0F
sta K.IrqMgrVBL.MSM+2
sta K.IrqMgrVBL.MRM+2
asl
asl
asl
asl
sta GOMOUSE.n0+1
sta K.IrqMgrVBL.n0
ldy #SERVEMOUSE
lda (ZPPtr1),y
sta K.IrqMgrVBL.JMP+1
sta K.IrqMgrVBL.MSM+1
ldy #READMOUSE
lda (ZPPtr1),y
sta K.IrqMgrVBL.MRM+1
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
@ -217,7 +224,7 @@ IrqMgrInit php
bit RRAMWRAMBNK1 Back To LC Ram
bit RRAMWRAMBNK1
inc K.IrkMgr.VBL
inc K.IrkMgr.VBL set=1 awaiting IrqMgr confirmation
plp
clc

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.SRC
LOMEM $A00
LOMEM $900
INC 1
AUTO 6
.LIST OFF
@ -59,12 +59,20 @@ K.IrkMgr.VBLINT .BS 1
* Called by ProDOS IRQ Manager (GP)
*--------------------------------------
K.IrqHandler lda K.IrkMgr.VBL
beq .10
beq .10 0, totally disabled....
jsr K.IrqMgrVBL.JMP
jsr K.IrqMgrVBL.MSM SERVEMOUSE
bcs .10 Not From Mouse VBL
ldx K.IrqMgrVBL.MRM+2 $Cn
ldy K.IrqMgrVBL.n0
jsr K.IrqMgrVBL.MRM READMOUSE
inc K.IrkMgr.VBLINT
lda #$ff
sta K.IrkMgr.VBL Confirm VBL signal valid for EvtMgr
clc
rts
@ -97,7 +105,9 @@ K.IrqHandler lda K.IrkMgr.VBL
.8 rts
*--------------------------------------
K.IrqMgrVBL.JMP jmp $0000
K.IrqMgrVBL.n0 .BS 1
K.IrqMgrVBL.MSM jmp $0000
K.IrqMgrVBL.MRM jmp $0000
*--------------------------------------
K.IrqHandlerJMP lda ($fe)
sta .1+1

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.SRC
LOMEM $A00
LOMEM $900
INC 1
AUTO 6
.LIST OFF

View File

@ -97,7 +97,7 @@ AT.INIT >LDAXI MSG.INIT
bcs .9
jsr GO.WSCARD
.DA #MLIGETPREFIX
.DA #MLISETPREFIX
.DA MLIGETPREFIX.PARAMS
bcs .9
@ -128,7 +128,7 @@ WC.Flag .BS 1
MLIATALK.PARAMS .DA #0 Sync
.DA #1 INIT
.BS 2 RC
.DA #$40 ??? from ATINIT dissaembly
.DA #$40 ??? from ATINIT disassembly
*--------------------------------------
MLIALLOCIRQ.PARAMS
.DA #2 Param Count