Code: Select all
VDP_setWindowAddress(0xB000);
VDP_setSpriteListAddress(0xBC00);
VDP_setHScrollTableAddress(0xB800);
VDP_setBPlanAddress(0xC000);
VDP_setAPlanAddress(0xE000);
VDP_setPlanSize(64, 64);
Moderator: Stef
Code: Select all
VDP_setWindowAddress(0xB000);
VDP_setSpriteListAddress(0xBC00);
VDP_setHScrollTableAddress(0xB800);
VDP_setBPlanAddress(0xC000);
VDP_setAPlanAddress(0xE000);
VDP_setPlanSize(64, 64);
Yes, you are right! the problem was another one.Stef wrote: ↑Thu Nov 22, 2018 12:25 pmBetter to do it in this way:
Normally having the sprite table at 0xBC00 should be alright so i guess the problem is somewhere elseCode: Select all
VDP_setWindowAddress(0xB000); VDP_setSpriteListAddress(0xBC00); VDP_setHScrollTableAddress(0xB800); VDP_setBPlanAddress(0xC000); VDP_setAPlanAddress(0xE000); VDP_setPlanSize(64, 64);
Code: Select all
/* ---- WRONG CODE --- */
u8 i;
velScroll3 -= 1;
for (i = 0; i <= 63; i++)
{
hscroll3[i] = velScroll3>>3;
}
VDP_setHorizontalScrollTile(PLAN_B, 0, hscroll2,64,0);
Code: Select all
/* ---- CORRECT CODE --- */
u8 i;
velScroll3 -= 1;
for (i = 0; i <= 27; i++)
{
hscroll3[i] = velScroll3>>3;
}
VDP_setHorizontalScrollTile(PLAN_B, 0, hscroll2,28,0);
Code: Select all
JOY_setEventHandler(joyEvent);
static void joyEvent(u16 joy, u16 changed, u16 state)
{
etc
}
Code: Select all
JOY_setEventHandler(joyEvent1);
JOY_setEventHandler(joyEvent2);
Code: Select all
void setJoyEventCBEntry(u16 joy, eventCBEntry cb)
{
eventJT[joy] = cb;
}
void myJoyEventCB(u16 joy, u16 changed, u16 state)
{
if (eventJT[joy])
(eventJT[joy])(changed, state);
}
Thanks! I will try it.Chilly Willy wrote: ↑Mon Feb 18, 2019 9:31 pmNot directly. The joyEventCB is universal for all controllers, but passes the index as a parameter. You can make your own jump table and fill it in and then do something like
Code: Select all
void setJoyEventCBEntry(u16 joy, eventCBEntry cb) { eventJT[joy] = cb; } void myJoyEventCB(u16 joy, u16 changed, u16 state) { if (eventJT[joy]) (eventJT[joy])(changed, state); }
Code: Select all
static void joyEvent(u16 joy, u16 changed, u16 state)
{
if (joy == JOY_1) joy1Event(changed, state);
else if (joy == JOY_2) joy2Event(changed, state);
}
static void joy1Event(u16 changed, u16 state)
{
// player 1 stuff
...
}
static void joy2Event(u16 changed, u16 state)
{
// player 2 stuff
...
}