About sticking libraries in SEs: I think that since everything will have to be ported from scratch and all of the legacy requirements will be thrown out, we can totally support this by making the dependency requirements part of the program header: a program that doesn't have a particular dependency simply won't run by DCS, without the program having to do this check itself.
Of course, I don't know if we can feasibly support multiple dependencies or chained dependencies. I can think of two ways to do this:
1. Dynamically allocate all the dependencies. This would allow all the systems to be easily organized, but all programs could only support relative jumps - not even any calls except on subdependencies.
2. Load all the subroutines the program calls for (including core subroutines) into an extra RAM page and map it to $4000. The beginning of the page contains a jump table that references all the other programs. The beginning of each subroutine also contains a list of where all of its subroutines are in the jump table. To illustrate:
Code:
This, of course, would limit a program to only 16K of libraries, including the jump table. However, it would allow for calls.
What do you think? Do I even remotely make sense?
Of course, I don't know if we can feasibly support multiple dependencies or chained dependencies. I can think of two ways to do this:
1. Dynamically allocate all the dependencies. This would allow all the systems to be easily organized, but all programs could only support relative jumps - not even any calls except on subdependencies.
2. Load all the subroutines the program calls for (including core subroutines) into an extra RAM page and map it to $4000. The beginning of the page contains a jump table that references all the other programs. The beginning of each subroutine also contains a list of where all of its subroutines are in the jump table. To illustrate:
Code:
progstart:
;*header preamble*
;note: these are *codes*, not addresses
.dw CLR_LCD
.dw FAST_COPY
.dw DRAW_SPRITE
;*rest of header*
call $4000 ;acts as "call CLR_LCD"
------------------------------------------
$4000:
;BIG MASTER JUMP TABLE
jp Clr_Lcd ; these are addresses in the jump table
jp Fast_Copy
jp Draw_Sprite
jp Align_Sprite ;dependency of Draw_Sprite
Clr_Lcd:
; code for Clr_Lcd
Fast_Copy:
; code for Fast_Copy
Draw_Sprite:
.dw Align_Sprite ; so that Draw_Sprite knows where it is
; some code for Draw_Sprite
jp (Draw_Sprite) ; first call in the table
; some more code for Draw_Sprite
This, of course, would limit a program to only 16K of libraries, including the jump table. However, it would allow for calls.
What do you think? Do I even remotely make sense?