This commit is contained in:
Stephen Toth 2018-07-18 15:53:34 -04:00
parent 46b083a251
commit f993fb057f
4 changed files with 1828 additions and 1790 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,21 @@
#define prgmloadersize prgmloaderend - prgmloader
#define prgmunloadersize prgmunloaderend - prgmunloader
prgmloaderloc equ SafeSScreen
prgmunloaderloc equ SafeSScreen + prgmloadersize
#define prgmloadersize prgmloaderend - prgmloader
#define prgmunloadersize prgmunloaderend - prgmunloader
#define prgm_to_usermem_size prgm_to_usermem - prgm_to_usermem_end
prgmloaderloc equ SafeSScreen
prgmunloaderloc equ SafeSScreen + prgmloadersize
prgm_to_usermem_loc equ SafeSScreen + prgmloadersize + prgmunloadersize
prgmbasic:
prgmasm:
call _clrtxtshdw
call _homeup
call _runindicon
call _apdsetup
call _enableapd
call _ClrTxtShdw
call _HomeUp
call _RunIndicOn
call _APDSetup
call _EnableAPD
jp prgmloaderloc
prgmloader:
call prgm_to_usermem
ld hl, prgmunloaderloc
push hl
set appautoscroll,(iy + appflags)
jp usermem
prgmloaderend:
prgmunloader:
ld hl, fsh
ld de, op1
call strcpy
call prgm_to_usermem
call _runindicoff
jp Fin
prgmunloaderend:
prgminstallload:
ld hl, prgmloader
ld de, prgmloaderloc
@ -39,11 +25,39 @@ prgminstallload:
ld de, prgmunloaderloc
ld bc, prgmunloadersize
ldir
ld hl, prgm_to_usermem
ld de, prgm_to_usermem_loc
ld bc, prgm_to_usermem_size
ldir
ret
prgmmov_start:
;.org SafeSScreen
prgmmov:
prgmloader:
call prgm_to_usermem_loc
ld hl, prgmunloaderloc
push hl
set appAutoScroll,(iy + appflags)
jp userMem
prgmloaderend:
prgmunloader:
ld hl, Fsh
ld de, OP1
call strcpy
call prgm_to_usermem_loc
call _RunIndicOff
jp Fin
prgmunloaderend:
prgm_to_usermem:
ld a,$9 ; 'add hl,bc'
ld a,$9 ; 'add hl,bc'
ld (prgm_to_usermem.smc),a
call _ChkFindSym
call _ChkInRam
@ -56,23 +70,28 @@ prgm_to_usermem:
ld e,(hl)
add hl,de
inc hl
prgm_to_usermem.in_ram: ; hl -> size bytes
prgm_to_usermem.in_ram: ; hl -> size bytes
call _LoadDEInd_s
inc hl
inc hl ; bypass tExtTok, tAsm84CECmp
inc hl ; bypass tExtTok, tAsm84CECmp
push hl
push de
ex de,hl
call _ErrNotEnoughMem ; check and see if we have enough memory
call _ErrNotEnoughMem ; check and see if we have enough memory
pop hl
ld (asm_prgm_size),hl ; store the size of the program
ld (asm_prgm_size),hl ; store the size of the program
ld de,userMem
push de
call _InsertMem ; insert memory into usermem
call _InsertMem; insert memory into usermem
pop de
pop hl ; hl -> start of program
ld bc,(asm_prgm_size) ; load size of current program
pop hl ; hl -> start of program
ld bc,(asm_prgm_size) ; load size of current program
prgm_to_usermem.smc equ $
add hl,bc ; if not in ram smc it so it doesn't execute
ldir ; copy the program to userMem
ret ; return
add hl,bc ; if not in ram smc it so it doesn't execute
ldir ; copy the program to userMem
ret
prgm_to_usermem_end:
prgmmov_end:
;.org prgmmov_start+prgmmov_end-prgmmov

View File

@ -25,6 +25,6 @@ FshCmdErrCode equ FshCmdArgFlags + 1
FshCmdOP equ FshCmdErrCode + 1
FshScratch equ FshCmdOP + 2
SafeSScreen equ RanVars + FshVarsSize + FshCmdInptSize + FshPrgmSize + 10
SafeSScreen equ RamVars + FshVarsSize + FshCmdInptSize + FshPrgmSize + 10
.list