Complete Rewrite #4 : keep it simple!!!

This commit is contained in:
Rémy GIBERT 2015-11-10 21:52:11 +01:00
parent a95b687065
commit a5ab6632dd
2 changed files with 72 additions and 59 deletions

View File

@ -11,23 +11,35 @@ AUTO 6
A2osX.GP.B.start
.PH $BE00
*--------------------------------------
A2osX.GP.Start bra A2osX.SYSCALL1
bra A2osX.LIBCALL1
bra A2osX.SLEEP1
bra A2osX.MLICALL1
*--------------------------------------
* A2osX.SYSCALL (MAINLC to AUXLC)
* A2osX.SYSCALL (AUXLC to AUXLC)
* In:
* X = SYSfnc.Index
* Y,A = free for Inline param
*--------------------------------------
A2osX.SYSCALL1 jmp KERNEL.SYSCALL
A2osX.GP.Start jmp (KERNEL.SYSCALL,x)
*--------------------------------------
* LIBCALL (MAINLC to MAINLC)
* LIBCALL (AUXLC to AUXLC)
* In:
* Y = LIB.ID
* X = LIBfnc.Index
* A = free for Inline param
*--------------------------------------
jmp A2osX.LIBCALL1
*--------------------------------------
* Kernel.MLICALL (AUXLC to MAINLC)
* In:
* X = MLI Function
* A = Param Count
*--------------------------------------
jmp A2osX.MLICALL1
*--------------------------------------
jmp A2osX.ROMCALL1
.BS $BE10-*
*--------------------------------------
jmp (pDev) pDevJmp
jmp (pCode) pCodeJmp
jmp (pLib) pLibJmp
.BS $BE20-*
*--------------------------------------
A2osX.LIBCALL1 pha
phx
@ -38,35 +50,6 @@ A2osX.LIBCALL1 pha
pla
.1 jmp $FFFF
*--------------------------------------
* SLEEP (MAINLC to AUXLC)
* In:
*--------------------------------------
A2osX.SLEEP1 ldy #S.PS.hCS
lda (pPs),y
>SYSCALL SYS.GetMemPtrA
>STYA A2osX.SaveCS
ldy #S.PS.PC
pla get PC LO
plx get PC HI
inc Advance PC one Byte
bne .1
inx
.1 sec
sbc A2osX.SaveCS
sta (pPs),y
iny
txa
sbc A2osX.SaveCS+1
sta (pPs),y
clc No error,
rts back to Kernel
*--------------------------------------
* Kernel.MLICALL (AUXLC to MAINLC)
* In:
* X = MLI Function
* A = Param Count
*--------------------------------------
A2osX.MLICALL1 jsr GO.MAINLC
stx .1
sta MLICALL.PARAMS
@ -76,6 +59,8 @@ A2osX.MLICALL1 jsr GO.MAINLC
jsr GO.AUXLC
rts
*--------------------------------------
A2osX.ROMCALL1 bra *
*--------------------------------------
GO.MAINLC php
clc
bra GO.SAVE.REG
@ -125,7 +110,34 @@ GO.EXIT.JMP jmp $FFFF
GO.Reset jsr GO.AUXLC
jmp KERNEL.COLDBOOT
*--------------------------------------
A2osX.SaveCS .BS 2
S.PRBYTE pha
lsr
lsr
lsr
lsr
ora #$30
cmp #$3A
bcc .1
adc #6
.1 jsr S.COUT
pla
and #$0F
ora #$30
cmp #$3A
bcc S.COUT
adc #6
bra S.COUT
*--------------------------------------
S.CROUT lda #13
*--------------------------------------
S.COUT phx
phy
ldx #DEVMGR.COUT
jsr pDevJmp
ply
plx
rts
*--------------------------------------
A2osX.SaveA .BS 1
A2osX.SaveX .BS 1
A2osX.SaveY .BS 1

View File

@ -10,8 +10,6 @@ AUTO 6
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/A2OSX.API.I
.INB INC/KERNEL.I
.INB INC/IO.I
.INB INC/MONITOR.I
.INB INC/PRODOS.I
@ -19,7 +17,6 @@ AUTO 6
TmpPtr1 .EQ $0 main & aux ZP
TmpPtr2 .EQ $2 main & aux ZP
*--------------------------------------
A2osX.Z80Stack .EQ $0F00 $0fff=0ffffh
A2osX.RelocAddr .EQ $1000
A2osX.KMLOAD .EQ $2000
A2osX.KMMAXLEN .EQ $4000
@ -29,9 +26,6 @@ A2osX.ReadBuff .EQ $6800 512 Buffer for MLIREAD01
Boot.Prefix .EQ $6A00 MLI.MAXPATH
KM.Filename .EQ $6A80 MLI.MAXPATH
*--------------------------------------
Z80STACK .EQ $0FFF (0FFFFh) Down to $0F00
Z80JMP .EQ $1000
*--------------------------------------
A2osX.Start .EQ *
.PH A2osX.RelocAddr
A2osX.Init0
@ -76,7 +70,16 @@ A2osX.Init1 bit RROMBNK1
jsr PrintCStrAX
bra *
.1 >LDAXI MSG.SYSMEM.OK
.1 lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
>LDAXI MSG.STAGE0
jsr PrintCStrAX
>LDAXI MSG.SYSMEM
jsr PrintCStrAX
>LDAXI MSG.SYSMEM.OK
jsr PrintCStrAX
>LDAXI MSG.CPU
@ -200,9 +203,10 @@ Init6502 ldy #0 Test 6502 BCD bug
dey y=2 -> R65C02
ldx $EA save zp $EA
stz $EA store 0 in $EA
.OP 65R02
smb 7,$EA if not Rockwell, assemble as nop nop
.OP 65C02
* .OP 65R02
.HS F7EA For compatibility with A2osX.ASM
* smb 7,$EA if not Rockwell, assemble as nop nop
* .OP 65C02
asl $EA cs if Rockwell
stx $EA restore zp $EA
bcs .9
@ -265,10 +269,7 @@ DisableRamDRV php
sec
rts
*--------------------------------------
InitZ80 sec
rts
ldx #Z80Code.Size
InitZ80 ldx #Z80Code.Size
.1 lda Z80Code.Start-1,x
sta $1000-1,x 00000H for Z80
dex
@ -456,20 +457,20 @@ MSG.Z80 >CSTRING "Detecting Z80 CPU..."
MSG.Z80.OK >CSTRING "Detected In Slot %d.\n"
MSG.Z80.KO >CSTRING "Not Detected.\n"
MSG.KMENUM >CSTRING "Looking For Kernel Modules...\n"
MSG.KMLOAD >CSTRING "\nLoading KM : "
MSG.KMLOAD >CSTRING "***Loading KM : "
MSG.STAGE0OK >CSTRING "A2osX[Stage0]:Complete.\n"
MSG.CPUTYPEL .DA #MSG.6502
.DA #MSG.65C02
.DA #MSG.R65C02
.DA #MSG.65C816
.DA #MSG.65R02
.DA #MSG.65816
MSG.CPUTYPEH .DA /MSG.6502
.DA /MSG.65C02
.DA /MSG.R65C02
.DA /MSG.65C816
.DA /MSG.65R02
.DA /MSG.65816
MSG.6502 >CSTRING "6502.\n"
MSG.65C02 >CSTRING "65C02.\n"
MSG.R65C02 >CSTRING "R65C02.\n"
MSG.65C816 >CSTRING "65C816.\n"
MSG.65R02 >CSTRING "65R02.\n"
MSG.65816 >CSTRING "65816.\n"
*--------------------------------------
MLIGETPREFIX01 .DA #1
.DA Boot.Prefix