[Homebrew] Problema Con El Código »  Mostrar los mensajes de    a     

SEGASaturno - Saturn, SEGA y Videojuegos


Desarrollo - [Homebrew] Problema Con El Código



milestailsprower [ 24 Diciembre 2009, 07:43 AM ]
Título del mensaje[Homebrew] Problema Con El Código
Hola, cuando intento cargar la ISO en el emulador SSF, no funciona
Aquí está el código

Código: [Ocultar] [Seleccionar]
/*----------------------------------------------------------------------*/
/* Draw 1 Polygon */
/*----------------------------------------------------------------------*/
#include "sgl.h"
#include "sega_tim.h"

/****************************************************************************************************/
/* CD access stuff **********************************************************************************/
/****************************************************************************************************/

#include <SEGA_GFS.H>
#define OPEN_MAX (Sint32)5
#define DIR_MAX (Sint32)25

// keep this info global
GfsDirTbl gfsDirTbl;
GfsDirName gfsDirName[DIR_MAX];
Uint32 gfsLibWork[GFS_WORK_SIZE(OPEN_MAX)/sizeof(Uint32)];
// number of files in current directory
Sint32 gfsDirN;

void init_CD()
{
GFS_DIRTBL_TYPE(&gfsDirTbl) = GFS_DIR_NAME;
GFS_DIRTBL_DIRNAME(&gfsDirTbl) = gfsDirName;
GFS_DIRTBL_NDIR(&gfsDirTbl) = DIR_MAX;
gfsDirN = GFS_Init(OPEN_MAX, gfsLibWork, &gfsDirTbl);
}


void init_VDP2()
{
//Desactivamos la salida de video.
slTVOff();
//Pintamos el fondo negro por si las dudas. ;)
slBack1ColSet((void *)BACK_CRAM, CD_Black);
//Asignamos un la prioridad en la que se verán los fondos. Siendo 7 el del frente.
slPriorityNbg0(7);
slPriorityNbg1(6);
// paleta: COL_TYPE_16, COL_TYPE_256, COL_TYPE_2048
// rgb: COL_TYPE_32768, COL_TYPE_1M
// bitmap sizes(BM_HxV): BM_512x256, BM_512x512, BM_1024x256, BM_1024x512
slBitMapNbg1(COL_TYPE_32768, BM_512x256, (void *)VDP2_VRAM_A0);
//Posicionamos el fondo.
slScrPosNbg1(toFIXED(0.0), toFIXED(0.0));
//Activamos ambos backgrounds
slScrAutoDisp(NBG0ON|NBG1ON);
//Activamos la salida de video.
slTVOn();
}

/****************************************************************************************************/
/* background ***************************************************************************************/
/****************************************************************************************************/

//funciones necesarias para la decompresión. Esto solo usa la cabecera de la función.
#include "DEHUFF.H"
// Transfiere linea a linea a la ram de video.
void img2VRAM(Uint16 *vram, Uint16 vram_width, Uint16 *img, Uint16 img_height, Uint16 img_width)
{
int i;
Uint32 oVRAM = 0;
Uint32 oIMG = 0;

for(i = 0; i < img_height; i++) {
memcpy((void *)(vram + oVRAM), (void *)(img + oIMG), img_width*sizeof(Uint16));
oVRAM += vram_width;
oIMG += img_width;
}
}
//Variables globales del background
#define BUFFER_SIZE 160096

//Carga del background
void loadBG()
{
// Cargamos del CD en un buffer de memoria, decomprimimos y luego lo cargamos a la video ram
// background image
void *buffer = malloc(BUFFER_SIZE);
Uint8 *adr = (Uint8 *)0x200000;
Sint32 load;

load = GFS_Load(GFS_NameToId("FONDO1.BIN"), 0, (Uint32 *)buffer, 120260);
if(load <= 0){
slPrint("Error: en cargar la imagen",slLocate(2,21));
};
if(DeHuff(buffer, (void *)adr) != 0)
{slPrint("Error: en decompresion",slLocate(2,21));
};

img2VRAM((Uint16 *)VDP2_VRAM_A0, 512, (Uint16 *)(0x200000), 240, 320);
}


void ss_main(void)
{
//Inicializamos el sistema con los sprites----------------------------
slInitSystem(TV_320x240, NULL, 0);

//Iniciamos el CD-----------------------------------------------------
init_CD();
//Iniciamos las configuraciones básicas del VDP2----------------------
init_VDP2();
//Cargamos el fondo---------------------------------------------------
loadBG();

FIXED pos[XYZS] = {toFIXED(0.0), toFIXED(50.0), toFIXED(104.0), toFIXED(1.0)};
ANGLE ang = DEGtoANG(0.0);

slSynch();
}

/*********************************/
/* taken from cinit.c */
/*********************************/
#define SystemWork 0x060ffc00 /* System Variable Address */
#define SystemSize (0x06100000-0x060ffc00) /* System Variable Size */
/* sl.lnk ‚ÅŽw’肵‚½.bssƒZƒNƒVƒ‡ƒ“‚ÌŠJŽnAI—¹ƒVƒ“ƒ{ƒ‹ */
extern Uint32 _bstart, _bend;

int main( void )
{
Uint8 *dst;
Uint32 i;

/* 1.Zero Set .bss Section */
for( dst = (Uint8 *)&_bstart; dst < (Uint8 *)&_bend; dst++ ) {
*dst = 0;
}
/* 2.ROM has data at end of text; copy it. */

/* 3.SGL System Variable Clear */
for( dst = (Uint8 *)SystemWork, i = 0;i < SystemSize; i++) {
*dst = 0;
}

/* Application Call */
ss_main();
return 1;
}




Si estoy usando una muestra, pero no quiero cargar Sonic


FacundoARG [ 26 Diciembre 2009, 08:18 PM ]
Título del mensajeRe: Problema Con El Código
Hola, veo que estas usando uno de mis ejemplos.
Que es lo que no te carga en el ssf? a mi parecer no hay ningun problema con este código.

No entiendo que me decis, en "Si estoy usando una muestra"




Powered by Icy Phoenix