Hi. I'm new to Saturn dev but already have coding background.
I'm using jo engine. I did some tests to draw BG and Sprite. Thanks to XL2 code, I can draw 4bit sprites.
I wish to use 3 Plans of VDP for scrolling Background 1024*512 and one for the HUD. I read the VDP2 doc and push data directly in VRAM A0-1 and B0-1 in 8bit and 4bit.
So i have 4 plans showing and scrolling with Yabause. As I can't test now on real hardware, I also try my iso with Mednafen and .... I don't have the expected result.
So, I make a minimal code to test, only 4 tiles on NBG0 just for testing. A map of 4 tiles, a palette and a 4 cells 8x8 pixels (color 1,2,3,4).
I don't know why this can't work on mednafen or what I miss. Mednafen only show the Background Color. Looks like I don't load data at the good place or the plan is hidden! I tried to use debug but
I'm using jo engine. I did some tests to draw BG and Sprite. Thanks to XL2 code, I can draw 4bit sprites.
I wish to use 3 Plans of VDP for scrolling Background 1024*512 and one for the HUD. I read the VDP2 doc and push data directly in VRAM A0-1 and B0-1 in 8bit and 4bit.
So i have 4 plans showing and scrolling with Yabause. As I can't test now on real hardware, I also try my iso with Mednafen and .... I don't have the expected result.
So, I make a minimal code to test, only 4 tiles on NBG0 just for testing. A map of 4 tiles, a palette and a 4 cells 8x8 pixels (color 1,2,3,4).
I don't know why this can't work on mednafen or what I miss. Mednafen only show the Background Color. Looks like I don't load data at the good place or the plan is hidden! I tried to use debug but
Code:
#include <jo/jo.h>
static unsigned short nbgA1_map[] = {0x0000,0x0002,0x0004,0x0006};
static unsigned short bg_pal[] = {0x8000,0x801f,0x83e0,0xfc00,0xFFFF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000};
static unsigned short cell_image[] =
{
0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,
0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,
0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,
0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,
};
#define NBG0_CEL_ADR (VDP2_VRAM_A0)
#define NBG0_MAP_ADR (VDP2_VRAM_B0)
#define NBG0_COL_ADR (VDP2_COLRAM)
void jo_main(void)
{
jo_core_init(JO_COLOR_Blue);
jo_set_displayed_screens(JO_NBG0_SCREEN);
slPlaneNbg0(PL_SIZE_1x1); //slPlaneNbg0(PL_SIZE_2x1); 1024 * 512
slCharNbg0(COL_TYPE_256, CHAR_SIZE_1x1); //CHAR_SIZE_2x2); Tile 16x16 pixels
slMapNbg0 ((void *) NBG0_MAP_ADR, (void *) NBG0_MAP_ADR, (void *) NBG0_MAP_ADR, (void *) NBG0_MAP_ADR);
slPageNbg0 ((void *)NBG0_CEL_ADR, 0, PNB_1WORD);
jo_dma_copy((void *)cell_image, (void *) NBG0_CEL_ADR, 128*2);
jo_dma_copy((void *)nbgA1_map, (void *) NBG0_MAP_ADR, 4*2);
slDMACopy ((void *) bg_pal, (void *) NBG0_COL_ADR, 32);
jo_core_run();
}
Last edited: