SymbOS MSX multitasking operating system - help needed!
One to get you started. It should still be optimised. For one it used the slow pixel accurate fill and not the byte accurate one if possible. But hey, it's a start. 
PS I hope it's free of bugs
PSS Yes, yes, the comments were lost somewhere

PNTBOX:
ld (LMMV.C),a
ld a,$80
jr nc,$+4
or 3
ld (LMMV.CM),a
push hl
ld hl,(winxbg)
ex de,hl
or a
sbc hl,de
ld de,(winxps)
jr c,.off_left
add hl,de
push bc
jr .set_left
.off_left:
add hl,bc
push hl
ex de,hl
.set_left:
ld (LMMV.DX),hl
pop de
add hl,de
or a
ld bc,(winxps)
sbc hl,bc
ld bc,(winxln)
sbc hl,bc
jr c,.set_right
ex de,hl
sbc hl,de
ex de,hl
.set_right:
ld (LMMV.NX),de
pop hl
ld de,(winybg)
or a
sbc hl,de
ld de,(winyps)
jr c,.off_top
add hl,de
jr .set_top
.off_top:
ex de,hl
add ix,de
.set_top:
push ix
ld (LMMV.DY),hl
pop de
add hl,de
or a
ld bc,(winyps)
sbc hl,bc
ld bc,(winyln)
sbc hl,bc
jr c,.set_bottom
ex de,hl
sbc hl,de
ex de,hl
.set_bottom:
ld (LMMV.NY),de
call WaitForVDP
ld a,36 ; start at DX
out (99h),a
ld a,91h
out (99h),a
ld bc,$0B9B
ld hl,LMMV
otir
ret
LMMV:
.DX: dw 0
.DY: dw 0
.NX: dw 0
.NY: dw 0
.C: db 0
db 0
.CM: db 0
WaitForVDP:
ld a,2 ; select S#2
out (99h),a
ld a,8Fh
out (99h),a
.wait:
in a,(99h)
rra
jr c,.wait
xor a ; select S#0
out (99h),a
ld a,8Fh
out (99h),a
ret
PS I hope it's free of bugs

PSS Yes, yes, the comments were lost somewhere

That's it?? Wow!! And it looks logical! I will try it soon. The VDP appears to be great! I am getting more and more impressed by the MSX.
Btw, Sonic_aka_T already asked me for clipping support routines. So I will add the routines used for the CPC soon. The thing why I didn't include them yet is the fact, that in my routines Y coordinates are limited to 8 bit. In general SymbOS (=the system independant desktop manager module) can handle 16bit for X and Y, but as the CPC can't display more than 200 lines (usually) the internal routines always work with 8bit for Y.
Ok, for the MSX normally it's the same, so it makes sense to use the same routines.
So please wait for an update. Btw, I think, many of you are from the netherlands? Unfortunately in the past I did the mistake to comment most of my source codes in german. Would this be a problem? (usually I can read most of the dutch language, too
) In any case I will try to translate as much as I can to english, if needed.
CU,
Prodatron
Btw, Sonic_aka_T already asked me for clipping support routines. So I will add the routines used for the CPC soon. The thing why I didn't include them yet is the fact, that in my routines Y coordinates are limited to 8 bit. In general SymbOS (=the system independant desktop manager module) can handle 16bit for X and Y, but as the CPC can't display more than 200 lines (usually) the internal routines always work with 8bit for Y.
Ok, for the MSX normally it's the same, so it makes sense to use the same routines.
So please wait for an update. Btw, I think, many of you are from the netherlands? Unfortunately in the past I did the mistake to comment most of my source codes in german. Would this be a problem? (usually I can read most of the dutch language, too
) In any case I will try to translate as much as I can to english, if needed.CU,
Prodatron
You may be a bit less impressed after checking this.
The visible screen only exceeds one byte when using interlace. But I have hopes that someone will write the same stuff for v9990 so we can enjoy 640x400.
German comments should be no problem for most Dutchies. Don't know about the visitors from the rest of the world though.
The visible screen only exceeds one byte when using interlace. But I have hopes that someone will write the same stuff for v9990 so we can enjoy 640x400.

German comments should be no problem for most Dutchies. Don't know about the visitors from the rest of the world though.
Very good site! Currently I didn't find a summary of all VDP commands. Do you have a link for that?
Or is everything said on this site?
Or is everything said on this site?
Now that I'm awake again, a few comments about the piece of code. The VDP access part can't be interrupted. I didn't put DI/EI's there because I have no clue how you will deal with things like this in your system. Also, I keep the status register set to 2 while waiting for any VDP commands to finish. That would be messy if interrupted by a standard ISR.
Also, it is a bit of a waste to wait for the VDP on a multitasking environment. Maybe something smarter can be done for this.
Also, it is a bit of a waste to wait for the VDP on a multitasking environment. Maybe something smarter can be done for this.
Thanx again for the information. Now I have a much better understanding about the possibilities and the usage of the VDP.
Currently I am excited about it, as it looks like a nice 2D accelerator
I just hope, that the VDP itself is not too slow. I will make some tests by myself now to get an impression about the possible speed. Maybe I need to rethink something.
As an example now I think it could be optimal to store the complete font 12 or 16times in the VRAM to have a version for any pen(0-3)/paper(0-3) combination. But when plotting proportional text, the VDP has to do a lot of very small pixel copy operations (one for every char). I hope that it will still be fast enough...
Currently I am excited about it, as it looks like a nice 2D accelerator
I just hope, that the VDP itself is not too slow. I will make some tests by myself now to get an impression about the possible speed. Maybe I need to rethink something.As an example now I think it could be optimal to store the complete font 12 or 16times in the VRAM to have a version for any pen(0-3)/paper(0-3) combination. But when plotting proportional text, the VDP has to do a lot of very small pixel copy operations (one for every char). I hope that it will still be fast enough...
As an example now I think it could be optimal to store the complete font 12 or 16times in the VRAM to have a version for any pen(0-3)/paper(0-3) combination. But when plotting proportional text, the VDP has to do a lot of very small pixel copy operations (one for every char). I hope that it will still be fast enough...
use TPSET copy, you store fonts once on "0" background and then copy them wherever you like
use TPSET copy, you store fonts once on "0" background and then copy them wherever you like
Do you mean setting bit3 of the command register 2E to 1? Is the VDP in transparent mode as fast as in normal mode? If yes, that's a good idea, as then I would only need to store it 6 times in memory (3 times with colours 1-3 and background=0; and 3 times with colour 0 and background 1-3).
Hm, but on the other hand I would need to fill the background first...

By Prodatron
Paragon (1125)
08-05-2006, 16:44