Can anyone tell me if there is a fusion-c example of a tile based horizontal scrolling for the MSX2 available somewhere?
Entrar ou registrar-se para comentar
Can anyone tell me if there is a fusion-c example of a tile based horizontal scrolling for the MSX2 available somewhere?
In which screen mode?
In tile-based screen mode (screen 0, 1, 2 et 4), you just have to write your new patterns in the Name table with any VRAM write function.
I don't know if there any function/sample to do that automatically, but it's quit simple to do.
If you need more information, feel free to ask here.
Pixel based scrolling with tiles would have been a better description. So Manbow-style.
I know how to do pixel-based vertical scrolling, but I have never experimented with horizontal scrolling.
I won't be able to be of much help.
I could explain the Space Manbow scroll if you want, but I don’t have any Fusion-C code examples.
Well, I still have to study v9938 but I think that space mambow horizontal scrolling works in this way:
Set adjust (basic name, I still don't know how to name it in asm) positioning is used to move the screen 7 times, one pixel each frame. Then, at 8th frame the start position is restored and the whole nametable is shifted one column to the left and a new column is plotted to the rightmost position. To preserve scoreboard (upper rows) you have to synch with the related hblank (rasterline)
Yes I know how it works... I was only looking for source code examples.
Quick and Dirty Example, with no Vsynch
// Quick & Dirty Horizontal Scroll in Screen 5 // Fusion-C 1.3 #include "fusion-c/header/msx_fusion.h" #include "fusion-c/header/vdp_graph2.h" char tile=4; char sc=0; void TilesCreation(void) { char i; for ( i = 0; i < 15; ++i) { BoxFill(0,256+i*8,8,256+8+i*8,i,0); BoxLine(0,256+i*8,8,256+8+i*8,15,0); } } void PrintTiles(void) { char i=0; char y=0; unsigned int sx,sy,dx,dy; while (i<24) { sx=0; sy=256+tile*8; dx=256-8; dy=y; HMMM(sx,sy,dx,dy,8,8); tile++; y+=8; sc++; if (tile>14) { tile=0; } if (y>192) { y=0; } i++; } } void Scroll(void) { sc++; SetAdjust(sc, 0); if (sc>7) { SetAdjust(0, 0); HMMM(8,0,0,0,248,192); PrintTiles(); sc=0; } } void main (void) { SetColors(15,0,1); Screen(5); Cls(); KeySound(0); SpriteReset(); Sprite16(); VDP60Hz(); TilesCreation(); SetAdjust(0, 0); PrintTiles(); while (1) { Scroll(); } }
Hi Eric. It seems this example works only with version 1.3? I can't find the "SetAdjust" function in version 1.2
Just theory but if you have a function void SetAdjust(char x, char y)
the content should be to set the VDP register #18 with ((-x) & 0x0F) | (((-y) & 0x0F) << 4)
.
EDIT: Be careful. You should not modify R#18 while a VDP command is running.
Don't you have an account yet? Become an MSX-friend and register an account!