I'm having trouble trying to make BMXL work ...
Is there some trick I should know ? Something I'm missing ?
I'm trying to transfer a sequence of 31 pixels from the contents of VRAM address 10C00h, at X=113,Y=144 on layer A.
SA=10C00h
DX=113
DY=144
NX=31
NY=1
ARG=0
LOG='OR' (14)
WM=FF00h
CMD=80h (BMXL)
Thanks
Isn’t it wm=00FF for layer A?
There is some trickery involved, because of the interleaved VRAM in P1. I made a small demo back then you can get it in on github
demo was made to test BMXL, BMLX and BMLL support on openMSX, which should be correctly implemented in latest version.
Hope it helps, otherwise it must be explained better somewhere else on this forum.
no writemask works like logical AND thus for target plane A mask should be ff00h
There is some trickery involved, because of the interleaved VRAM in P1. I made a small demo back then you can get it in on github
demo was made to test BMXL, BMLX and BMLL support on openMSX, which should be correctly implemented in latest version.
Hope it helps, otherwise it must be explained better somewhere else on this forum.
Sorry but it does not help, because I don't know where to look in your test code to find an answer. And believe me, I've searched on this forum ...
But you're speaking of interleaved VRAM, and I do remember your explanation about BMLL in another topic. Would that mean that, in order for mt BMXL command to work, I need to store even bytes at 'address' and odd ones at 'address+40000h' ?
EDIT: after some quick experiment, that's indeed the case. So to summarize, for BMXL:
. source bytes needs to be stored separately, even bytes at at 'address' and odd ones at 'address+40000h'
. source address is 'address' shifted 1 bit to the right
EDIT 2: it's not as easy as that ! ... Now that I have stored even and odd bytes, nothing works anymore !! It's really, really, really frustrating !
two things: 'address' should be within 0 0000h to 3 ffffh
for setting up the BMXL source address try shifting the address 1 bit to the left
example: 'address' = 10000h, then 'even' bytes are stored from 10000h, 'odd' bytes from 50000h, and source address for command will be 20000h.
Yes, I finally figured it out. The problem was that I was calculating a relative address, so all was messed up by the 'doubling' of the address. Anyway, now it works, but I must say it's one crazy setup !!
So, for future reference, in order to make BMXL work you must:
. store source bytes separately, even bytes at at 'address' and odd ones at 'address+40000h'
. use source address shifted 1 bit to the left
I must thank GhostwriterP for its numerous studies and explanations on this forum, because I would never have figured it out without them. And I'm amazed that there's absolutely NO explanation whatsoever in the V9990 manual about that command. It's as if Yamaha did not know how to use it themselves !
I cannot take full credit for all of those studies, I see it more as an MRC team effort, but thanks!
Still working with BMXL ... and having further questions.
The problem with storing even and odd bytes at different addresses is that if you want to shift the source address a few pixels, you can access only even bytes. Let's say you have source image at 10000h for P1:
. (10000h) contains byte 0 (pixel 0,1) . (50000h) contains byte 1 (pixel 2,3) . (10001h) contains byte 2 (pixel 4,5) . (50001h) contains byte 3 (pixel 6,7) ...
It means that if you can only transfer image starting at a pixel which is a multiple of 4.
You cannot transfer the image starting at pixel 1,2 or 3.
Is there a way around that ?
Don't suppose there is... source address can only be byte aligned, but I think it is possible to start with pixel 2 (BMXL source address 20001h)