Autor
| LMMM direction?
|
SLotman msx professional Mensajes: 541 | Publicado: Diciembre 17 2005, 01:20   |
According to MSX Tech. Handbook, LMMM copies have the following parameters:
Quote:
|
MXS: select the source memory 0 = VRAM, 1 = expansion RAM
MXD: select the destination memory 0 = VRAM, 1 = expansion RAM
SX: source origin X-coordinate (0 to 511)
SY: source origin Y-coordinate (0 to 1023)
NX: number of dots to be transferred in X direction (0 to 511)
NY: number of dots to be transferred in Y direction (0 to 1023)
DIX: direction of NX from the origin 0 = right, 1 = left
DIY: direction of NY from the origin 0 = below, 1 = above
DX: destination origin X-coordinate (0 to 511)
DY: destination origin Y-coordinate (0 to 1023)
|
So, what's the use of DIX and DIY? Can it actually mirror a copy?
In my pascal routines I tried setting both to 0/1 but got no changes whatsoever...
Any clues from the "wise ones"?  |
|
Edwin msx professional Mensajes: 620 | Publicado: Diciembre 17 2005, 01:32   |
DIX and DIY are for line drawing. The line draw only accept positive values for NX and NY and NY<NX. With DIX/Y you can make it draw in any direction.
It probably makes a difference when copying blocks where the destination overlaps the source. Not using it is also a valid feature though  |
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Diciembre 17 2005, 02:37   |
Here is simple example on BASIC, that uses DIX and DIY on VDP to deltapack the picture:
10 SCREEN 8
20 BLOAD"PICTURE.PIC",S
30 A$=INPUT$(1)
40 ' 2D deltapack picture with VDP
50 COPY (1,0)-(255,211) TO (0,0),,XOR
60 COPY (0,1)-(255,211) TO (0,0),,XOR
70 A$=INPUT$(1)
80 ' Unpack picture to original format
90 COPY (0,211)-(255,0) TO (0,210),,XOR
100 COPY (255,0)-(0,211) TO (254,0),,XOR
110 A$=INPUT$(1)
|
|
BiFi msx guru Mensajes: 3142 | Publicado: Diciembre 17 2005, 07:14   |
DIX and DIY are used for rotational copying. From BASIC it's only used by a copy from an array of a file. The parameter directly writes DIX and DIY.
COPY array,direction TO (DX,DY)
COPY "filename.ext",direction TO (DX,DY)
A use of DIX and DIY is in the Xak II - Rising of The Red Moon intro, when the game title is displayed where the lower part is a stretched version of the last line.
|
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Diciembre 18 2005, 15:37   |
BiFi, you must be kidding, right?
|
|
ro msx guru Mensajes: 2329 | Publicado: Diciembre 18 2005, 15:56   |
ain't it simple.. these copy commands do the same:
copy a block (width=10, height=20) from 50,100 to 150,200
SX= 50, SY= 100
NX= 10, NY= 20
DIX= 0, DIY= 0
DX= 150, DY= 200
SX= 60, SY= 120
NX= 10, NY= 20
DIX= 1, DIY= 1
DX= 160, DY= 220
The first copies the block starting from the upper left, the second from right/bottom.
what's the difference? -> when copying overlapping source/destination (a scroller for example)
when scrolling from right to left DIX/DIY can both be 0, but copying form left to right DIX must be 1. just figure it out...
|
|
[D-Tail]
 msx guru Mensajes: 3015 | Publicado: Diciembre 18 2005, 16:04   |
It seems that in BASIC/NBASIC this copy-thing shows up... I tried to make a left-to-right scroller once, which worked in BASIC... With the CALL TURBO ON statement, it went all wrong. Apparently, XBASIC (which is wrapped in NBASIC) doesn't set the DIX/DIY flags accordingly and it all goes haywire...
Feature request: please fix this in NBASIC?  |
|
SLotman msx professional Mensajes: 541 | Publicado: Diciembre 18 2005, 17:19   |
Quote:
| DIX and DIY are used for rotational copying. From BASIC it's only used by a copy from an array of a file. The parameter directly writes DIX and DIY.
COPY array,direction TO (DX,DY)
COPY "filename.ext",direction TO (DX,DY)
A use of DIX and DIY is in the Xak II - Rising of The Red Moon intro, when the game title is displayed where the lower part is a stretched version of the last line.
|
!!!!!!!!!!!!!
Man, I REALLY need to understand how this works. Just for you guys to know... I am thinking about doing BARBARIAN for MSX2 (the fighting one, from CPC, not the one that already exists on MSX1).
I already have the barbarian graphic ripped, but it takes a full VRAM page - just for the player. I would use another page for the enemy, and another for background and buffer (on scr5, of course)
So, I need to be able to mirror "shapes" on the fly, otherwise this game project/idea will never be completed...
The copy routines from Lammassari that I modified and use on MSXPad do have the DIX and DIY parameters, but I get no results from them... maybe only when copying from RAM they would work? |
|
Sonic_aka_T
 msx guru Mensajes: 2268 | Publicado: Diciembre 18 2005, 17:26   |
DIX/Y don't mirror the graphics, they just specify from which start point and in which direction the copy is executed. This is handy if you need to do a copy where the source and destination coordinates overlap. Nothing as exciting as mirroring tho. I guess that when you're doing logical copies from RAM you could idd use this to mirror the graphics by reading the source data in the original direction and having a reversed DIX/Y, but it would probably be just as easy to keep DIX/Y normal and read the source data in reverse if you're working with RAM...
|
|
ARTRAG msx master Mensajes: 1681 | Publicado: Diciembre 18 2005, 19:40   |
the problem is that DIX&DIY in VRAM-VRAM copies are both used for the source and the destination,
so no mirror is possible in this way.
Actually the only way to mirror a a block with DIX/DIY is to use RAM->VRAM commands
Accordingly to DIX you get an horizontal mirror of the block stored in RAM
BUT!!
Pay attention!!! In scr5/6/7 you must use logical commands (LMMC) or the bytes will
be copyed as they are (i.e. unmirrored) with the results you can immegine.
|
|
SLotman msx professional Mensajes: 541 | Publicado: Diciembre 19 2005, 02:04   |
Hmmm... so I have to change my routines to copy from RAM, and also do some timing test to see if the game will be possible...  |
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Diciembre 19 2005, 11:59   |
SLotman: I think you should not copy trought RAM as it is VERY slow. Better to keep the data on RAM or use loop to mirror graphics with VDP. On SCREEN 5 mirror loop is quite heavy as you can not use hispeed commands.
D-Tail: You must have had some other problem. COPY command works just fine on XBASIC. You may for example try the deltapack routine with following changes:
25 _TURBO ON
30 IF INKEY$="" THEN 30
70 IF INKEY$="" THEN 70
110 IF INKEY$="" THEN 110
|
|
|
|
|