newbie's questions
Moderator: BigEvilCorporation
I think it doesn't work.
Tried two options:
and
I think I'll just try to move on XGCC (too much trouble with that gendev). Thanks for all your help.
Tried two options:
Code: Select all
VDP_setTile(APLAN, 130+(1<<13), 3, 10);
Code: Select all
VDP_setTile(APLAN, 130+(0<<13), 3, 10);
Move to XGCC will make no sense at all. You can simply use compiler from Stef's devkit without using his libs (as I do, that's why I can say anything certain how to solve your problem).
What exactly does not work? Do you see the tile with wrong palette or don't see anything at all? If second, do you sure that you really have something in tile 130 (which is 131th in memory)?
What exactly does not work? Do you see the tile with wrong palette or don't see anything at all? If second, do you sure that you really have something in tile 130 (which is 131th in memory)?
I've spent few minutes to learning Stef's API, and here is working code:
Shows same tile with different palettes. I don't know why you have problem with this, probably error or typo somewhere in your code, as it usually happens with mysterious problems.
Code: Select all
#include "genesis.h"
const unsigned short palette0[16]={
0x0000,0x000f,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
const unsigned short palette1[16]={
0x0000,0x00f0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
const unsigned int tile[8]={
0x11111111,
0x10000001,
0x10100101,
0x10000001,
0x10100101,
0x10111101,
0x10000001,
0x11111111
};
int main()
{
VDP_init();
VDP_loadTileTo(tile,0,1,0);
VDP_setPalette(0,palette0);
VDP_setPalette(1,palette1);
VDP_setTile(APLAN,0<<13,0,0);
VDP_setTile(APLAN,1<<13,1,0);
return 0;
}
Did you mean to try this?
Or are you sure it's 130, not 0x130?
Code: Select all
VDP_setTile(APLAN, 0x130+(1<<13), 3, 10);
Thanks, it works now with this code:
Code: Select all
VDP_setTile(APLAN, 1<<13^130, 3, 10);
Code: Select all
VDP_setTile(APLAN, 1<<13^130, 3, 10);
That's really strange.
Should be exactly the same as
The same is true of operator |. Are you sure something else wasn't out of place?
Code: Select all
VDP_setTile(APLAN, 1<<13^130, 3, 10);
Code: Select all
VDP_setTile(APLAN, 130+(1<<13), 3, 10);
I got another problem, this time about music.
I have a bin from MSV Tracker (exported with Export MSV0). When I try to convert it to c/h format with converter from bin folder (using bintocs16.bat) and play it in app, a noise can be heard for about second. When I try to play music from particle example, it is played correctly. Except changing the name of played music, I apply no changes in code.
What program should I use to make bin compatibile with this converter?
Thanks in advance.
I have a bin from MSV Tracker (exported with Export MSV0). When I try to convert it to c/h format with converter from bin folder (using bintocs16.bat) and play it in app, a noise can be heard for about second. When I try to play music from particle example, it is played correctly. Except changing the name of played music, I apply no changes in code.
What program should I use to make bin compatibile with this converter?
Thanks in advance.
You could just modify the original routine by adding a palette parameter for future use.
void VDP_setTilePal(u16 plan, u16 tile, u16 x, u16 y, u16 pal)
{
volatile u32 *plctrl;
volatile u16 *pwdata;
u32 addr;
addr = plan + (2 * (x + (VDP_getPlanWidth() * y)));
/* point to vdp port */
plctrl = (u32 *) GFX_CTRL_PORT;
pwdata = (u16 *) GFX_DATA_PORT;
*plctrl = GFX_WRITE_VRAM_ADDR(addr);
*pwdata = tile | (pal << 13);
}
void VDP_setTilePal(u16 plan, u16 tile, u16 x, u16 y, u16 pal)
{
volatile u32 *plctrl;
volatile u16 *pwdata;
u32 addr;
addr = plan + (2 * (x + (VDP_getPlanWidth() * y)));
/* point to vdp port */
plctrl = (u32 *) GFX_CTRL_PORT;
pwdata = (u16 *) GFX_DATA_PORT;
*plctrl = GFX_WRITE_VRAM_ADDR(addr);
*pwdata = tile | (pal << 13);
}
Plee: Thanks, but I fixed this problem some days ago.
I think the problem is in bin, not converter. That's what I wrote.Why you think problem is with bin2c converter?
What should I do to change the version of MVS output then? Or what tracker do you recommend?It is probably problem with MVS output, too old/new version or something.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
There is Shiru's TFM Music Maker, which is muuuuch more featured than MVStracker is. TFM replay routine lacks support for PCM and PSG though.
There is also my sound engine and tools, but they're not meant for public right now since things aren't in good shape...
There is also my sound engine and tools, but they're not meant for public right now since things aren't in good shape...
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen