Style-0 wrote:Nice, keep going and let us know about further progress. Maybe it's time for a movable sprite, if you have succeded in interfacing with the controller

Thanks!
In the video, the two "normal" sprites are moving, and yeah, the controller interface is implement 100%. Its called the "SMPC" which also has "commands" that can "turn off" the M68k, Slave SH-2, the CD-drive, soft reset the Saturn, etc.
You guys can checkout a snapshot of the code
here.
I can write up a simple example to display a sprite:
Code: Select all
#include <system.h>
/* There is a maximum of 512 command table entries. */
struct vdp1_cmd cmd_list[512];
static void
load_normal_sprite(int offset)
{
struct vdp1_cmd_sup sup;
sup.cmdcolr = VDP1_CLUT_BASE;
sup.cmdsrca = VDP1_VRAM_BASE;
sup.w = 16;
sup.h = 16;
cmd[offset].cmdctrl = SUP_CTRL_COMM_NORMAL;
cmd[offset].cmdpmod = SUP_PMOD_COLR_MODE_1 | SUP_PMOD_ECD_DISABLE;
cmd[offset].pa.x = 0;
cmd[offset].pa.y = 0;
yl_vdp1_cmd_normal_sprite(sup, cmd);
}
int
main(void)
{
struct smpc_peripheral_digital pad;
yl_system_init();
/* Load the graphics here. */
yl_vdp1_cmd_list_start();
/* Send the "normal sprite" to the list. */
load_normal_sprite(0);
/* Last command table sent to the list should be a "DRAW END" command. */
yl_vdp1_cmd_link_end(cmd_list);
/* Send the list to "VDP1 VRAM." */
yl_vdp1_cwb_send_list(cmd_list, yl_vdp1_cmd_list_size());
while (1) {
yl_vdp2_vsync();
pad = yl_smpc_per_type_digital(SMPC_PER_PORT_1);
if (pad.status == SMPC_PER_STATUS_CONNECTED) {
/* Press the start button to exit to the "CD Player" screen. */
if ((pad.button_pressed & SMPC_PER_DGTL_START) == 0)
yl_bios_exec_cd_player();
if ((pad.button_pressed & SMPC_PER_DGTL_LEFT) == 0)
cmd_list[0].pa.x--;
if ((pad.button_pressed & SMPC_PER_DGTL_RIGHT) == 0)
cmd_list[0].pa.x++;
}
}
}
Since school just started this week, I won't be able to fix or add any new features to the library as I'll be very busy with school. I have a very long list of the things that need to be fixed and added. As far as I'm concerned, the "VDP1" is near completition.
There is a graphic tool that I'm rewriting which produces a special file format that my library can handle. It will make life much easier.