int main(int argc, char **argv) { struct mamegame *lista; tamanyocd=74*MULTIPLIERm; /*tamanyocd=10*MULTIPLIERM;*/ neogeocd=0; mamecd=0; lista=NULL; /* Parseamos los argumentos de la linea de comandos */ if (ParseArgs(argc, argv)==ERROR) return(ERROR); /* Si no decimos nada hay que hacer todos los CDs */ if (!neogeocd && !mamecd) { neogeocd=1; mamecd=1; } /* Imprimimos un poco de informacion */ printf("\n"); printf("Make NEOGEO CD's "); if (neogeocd) printf("yes\n"); else printf("no\n"); printf("Make MAME CD's "); if (mamecd) printf("yes\n"); else printf("no\n"); if (!generatecds) printf("Don't generate ISO CDs\n"); if (!generatelist) printf("Don't generate game list\n"); if (generatefulllist) printf("Create full game list\n"); printf("Size of CD's %lu bytes (%lu Kb, %lu Mb, %lu')\n\n", tamanyocd/MULTIPLIERB, tamanyocd/MULTIPLIERK, tamanyocd/MULTIPLIERM, tamanyocd/MULTIPLIERm); /* Creamos la lista de juegos */ lista=MakeGameList(mamebin); printf("\n"); /* Creamos los CD's que toquen */ if (mamecd) CreateCDS(lista, MAME); if (neogeocd) CreateCDS(lista, NEOGEO); if (generatefulllist) { printf("Making full list (%4i games)\n", cuenta_juegos(lista,FULL,0)); MakeHTML(lista,FULL,0); } printf("\n"); return(0); }
//******************************************************************** // Конвертирование в один формат на заданной памяти Bool32 ROUT_GetObject ( uint32_t objIndex, // Индекс объекта начиная от 1 Byte *lpMem, // Адрес блока памяти ( 0 - старая память) long *sizeMem // На входе: длина блока памяти // На выходе: длина использованной памяти ) { // DEBUG_PRINT("ROUT_OneFormat"); ClearError(); // Загружена ли страница if ( !gPageHandle ) { PAGE_NOT_LOADED; return FALSE; } // Установить рабочую память INIT_MEMORY(lpMem,*sizeMem); switch(gFormat) { case ROUT_FMT_Text: case ROUT_FMT_SmartText: MakeText(); break; case ROUT_FMT_HOCR: MakeHOCR(); break; case ROUT_FMT_HTML: MakeHTML(); break; case ROUT_FMT_TableText: MakeTableText(); break; case ROUT_FMT_DBF: MakeTableDBF(); break; case ROUT_FMT_CSV: case ROUT_FMT_WKS: default: NOT_IMPLEMENTED; break; } // Сколько использовано памяти *sizeMem = gMemCur - gMemStart; return (gwLowRC_rout?FALSE:TRUE); }
int CreateCDS (struct mamegame *lista, int tipo) { int ncd; /* CD number */ int ret; /* Creamos el direcrotio temporal */ mkdir(tmpdir,S_IRWXU|S_IRWXG|S_IRWXO); ncd=1; ret=MORECDS; if (tipo==MAME) { while(ret!=LASTCD) { sprintf(cddir,"mame-%02i",ncd); ret=MakeCD(lista,tipo,ncd); printf("Making MAME\tCD %02i (%4i games)\n",ncd, cuenta_juegos(lista,tipo,ncd)); MakeHTML(lista,tipo,ncd); MakeIso(); ncd++; } } ncd=1; ret=MORECDS; if (tipo==NEOGEO) { while(ret!=LASTCD) { sprintf(cddir,"neogeo-%02i",ncd); ret=MakeCD(lista,tipo,ncd); printf("Making NEOGEO\tCD %02i (%4i games)\n",ncd, cuenta_juegos(lista,tipo,ncd)); MakeHTML(lista,tipo,ncd); MakeIso(); ncd++; } } return 0; }