Pagina 1 di 2

Re: Compilare e personalizzare Mame

Inviato: 18/12/2010, 15:37
da PaTrYcK
antoniomauro ha scritto:Mi pare di aver capito che con il c/c++ non vai molto d'accordo :-D :-D
Bravissimo, mai utilizzato, e' arrivata l'ora :wink:
antoniomauro ha scritto:Cerco di darti delle indicazioni passo passo dando per scontato 2 cose:
1) Hai già scaricato il sorgente da mamedev del mame 140 originale e scompattato in una cartella (es. c:\mingw\mame)
Ok
antoniomauro ha scritto: 2) Hai già scaricato ed installato mingw e, lanciando il "make", riesci ad ottenere un eseguibile funzionante originale
Nn ci sono ancora, mi incarto e nn riesco ad andare avanti....quindi da principio
Ho scaricato Mingw messo su cartella:
Immagine
Su alcune guide ho letto che devo pure aggiungere delle librerie dx80_mgw nella sotto cartella include, cmq inserite anche queste, poi ho scaricato il sorgente mameuifx32:
Immagine

antoniomauro ha scritto:Cominciamo ad aprire il file diff che ti ho mandato nel punto che riguarda la modifica dei 60hz:
Aperto il file ed ho visto le modifiche fatte, ma come lo do in "pasto" x essere compilato ottenendo la versione modificata del mameuifx32 del quale ho il sorgente? Come faccio a far partire la compilazione x crearmi una copia del mame modificata?

Come hai creato un diff?
Ti bastano questi miei dubbi? 8-)
Grazie!!! :wink:

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 10:55
da antoniomauro
Crea un file di testo con estensione.bat ed incollaci questo:

Codice: Seleziona tutto

set path=%PATH%;"C:\mingw\bin"

cd mamesrc

make 

pause
Salva il file come: c:\mingw\compila.bat

Esegui il file c:\mingw\compila.bat

Se ti da errori postali!

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 11:35
da PaTrYcK
Nn trova alcuni file/dir...
ho provato a cercarli nella cartella che mi sono creato (della quale ho incollato le img nel post precedente) ma nn le ho, cosa mi sono dimenticato di scaricare?
Immagine

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 11:58
da antoniomauro
Sembra che il sorgente che hai scaricato sia sprovvisto dei file .mak (indispensabili)
Nella cartella C:\mingw\mamesrc\src\mame non c'è il file mame.mak?

Puoi provare la stessa operazione con i sorgenti del mame "liscio" preso da mamedev?

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 12:30
da PaTrYcK
antoniomauro ha scritto:Sembra che il sorgente che hai scaricato sia sprovvisto dei file .mak (indispensabili)
Nella cartella C:\mingw\mamesrc\src\mame non c'è il file mame.mak?
Nada, nn sono presenti,li ho presi dal sito ufficiale del mameuifx32:
http://mame32fx.altervista.org/home.htm


Adesso provo con un sorgente differente <-gamer1->

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 12:33
da antoniomauro
Nella pagina che hai linkato c'è scritto:

MAMEUIFX source code.
Extract it over official MAME source.

Immagino che devi scaricare il sorgente originale e sovrascriverci questo!

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 14:36
da PaTrYcK
Ecco, il mio errore e' stato quello di credere che quella indicazione fosse riferita alla vers 138...

Partita la compilazione quindi adesso tutto ok...
X fare le eventuali modifiche come si dovrebbe procedere?

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 14:48
da antoniomauro
Riassumo quello che ti avevo scritto qualche post fa:

1) Scaricati notepad++

2) Apri il file C:\mingw\mame/src/emu/video.c

3) Vai alla riga 1788 e sostituisci la funzione

Codice: Seleziona tutto

  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
 	screen->m_refresh = rate;
  }
con:

Codice: Seleziona tutto

  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
 	screen->m_refresh = HZ_TO_ATTOSECONDS(60);
  }
4) Ricompila

Ti invito a studiare un po il file diff che ho postato dove sono presenti anche tutte le altre modifiche

Dimenticavo:
per alcune modifiche basta ricompilare mentre per altre devi eseguire prima un make clean

Codice: Seleziona tutto

set path=%PATH%;"C:\mingw\bin"

cd mame

make clean
Senza dilungarmi troppo ti consiglio di provare prima a ricompilare (ci mette poco tempo) e, nel caso in cui avessi errori od il mame dovesse crashare, fai il clean e poi ricompile (molto + lungo)

Re: Compilare e personalizzare Mame

Inviato: 20/12/2010, 14:56
da PaTrYcK
Ottimo, grazie Antonio, stasera ci provo, vediamo cosa esce fuori :wink:

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 14:09
da PaTrYcK
Ok, il mio primo mame ha visto la luce :)
Ho tolto le schermate di caricamento, impostato a 60hz e altre piccole cosette...
Alla fine il miglior modo x nn essere troppo dipendenti dalle versioni altrui e' crearsele da soli :wink:
Ho notato che per qualsiasi successiva modifica la compilazione e' velocissima e nn riparte da zero!

Domanda, x ottenere 60Hz fissi tu suggerisci la modifica su video.c:
void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate) { screen_device_config *screen = downcast<screen_device_config *>(device); screen->m_refresh = rate; }
con
void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate) { screen_device_config *screen = downcast<screen_device_config *>(device); screen->m_refresh = HZ_TO_ATTOSECONDS(60); }

Mentre Stormrider procede modificando video.h:

MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) \
con
MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS((((HZ_TO_ATTOSECONDS(_pixclock)) * (_htotal) * (_vtotal))>= 50) ? 60 : ((HZ_TO_ATTOSECONDS(_pixclock)) * (_htotal) * (_vtotal)))) \

ed
MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_rate))
con
MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(((_rate)>= 50) ? 60 : (_rate)))

Si puo' quindi raggiungere lo scopo con due differenti vie ?

Ho dato uno sguardo al tuo file diff, mi sembra di capire che si tratta di un txt dove sono presenti le modifiche da te eseguite, ma nn mi e' chiaro come poterle interpretare...
Inoltre come si da in pasto un file diff in modo da ricompilare l'exe? Come si crea un file diff?

Grazie!!!!

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 14:49
da antoniomauro
PaTrYcK ha scritto:Alla fine il miglior modo x nn essere troppo dipendenti dalle versioni altrui e' crearsele da soli
E' quello che cerco di fare su tutto quello che riguarda il mio cab (mobile,monitor,software,ecc....)

La soluzione che ho adottato dipende dal fatto che quelle macro non sono più presenti nelle ultime versioni dei sorgenti (almeno io non le ho trovate)
Ad ogni modo nella programmazione ci sono infiniti modi per fare la stessa cosa!

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 14:55
da antoniomauro
PaTrYcK ha scritto: Ho dato uno sguardo al tuo file diff, mi sembra di capire che si tratta di un txt dove sono presenti le modifiche da te eseguite, ma nn mi e' chiaro come poterle interpretare...
Inoltre come si da in pasto un file diff in modo da ricompilare l'exe? Come si crea un file diff?
Se guardi bene su http://mamedev.org/tools/ devi:

1) Installare Win32 GNU-like tools

e poi puoi generare un diff con:

Codice: Seleziona tutto

set path=%PATH%;"C:\mingw\bin"

diff -crB C:\mingw\mame_original C:\mingw\mame_modificato > diffname.diff
applicare un diff

Codice: Seleziona tutto

set path=%PATH%;"C:\mingw\bin"

patch -p0 -E <diffname.diff


Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 15:05
da PaTrYcK
Ok perfetto, ma sul diff da te creato quali sono precisamente le modifiche che hai apportato?

Inoltre puoi riassumere le modifiche da eseguire sui sorgenti che riguardano:
60 Hz fissi ok
Rimozione riquadro bianco
Rimozione percentuale caricamento
Rimozione schermata info del gioco
Rimozione schermata info gioco non ben emulato
<-clap-> <-clap-> <-clap->

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 16:58
da antoniomauro
AUDIO SYNC parte 1

Codice: Seleziona tutto

diff -crB C:\mingw\mame_original/src/emu/machine.h C:\mingw\mame/src/emu/machine.h
*** C:\mingw\mame_original/src/emu/machine.h	Thu Oct 14 00:04:18 2010
--- C:\mingw\mame/src/emu/machine.h	Fri Dec 17 10:11:58 2010
***************
*** 395,400 ****
--- 395,402 ----
  	UINT32 rand();
  	const char *describe_context();
  
+ 	double 					speed_percent;		// most recent speed percentage 
+ 	
  	// internals
  	resource_pool			m_respool;			// pool of resources for this machine
  	region_list				m_regionlist;		// list of memory regions
PERCENTUALE CARICAMENTO

Codice: Seleziona tutto

diff -crB C:\mingw\mame_original/src/emu/romload.c C:\mingw\mame/src/emu/romload.c
*** C:\mingw\mame_original/src/emu/romload.c	Thu Sep  2 22:21:48 2010
--- C:\mingw\mame/src/emu/romload.c	Thu Dec 16 17:08:41 2010
***************
*** 515,520 ****
--- 515,522 ----
  
  static void display_loading_rom_message(rom_load_data *romdata, const char *name)
  {
+ 	return;
+ 
  	char buffer[200];
  
  	// 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
diff -crB C:\mingw\mame_original/src/emu/ui.c C:\mingw\mame/src/emu/ui.c
RIMOZIONE SCHERMATE INFO E WARNING

Codice: Seleziona tutto

*** C:\mingw\mame_original/src/emu/ui.c	Tue Oct 12 23:20:12 2010
--- C:\mingw\mame/src/emu/ui.c	Thu Dec 16 17:12:35 2010
***************
*** 287,292 ****
--- 287,294 ----
  	if (!first_time || (str > 0 && str < 60*5) || machine->gamedrv == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
  		show_gameinfo = show_warnings = show_disclaimer = FALSE;
  
+ 	show_gameinfo = show_warnings = show_disclaimer = FALSE;
+ 	
  	/* initialize the on-screen display system */
  	slider_list = slider_current = slider_init(machine);
  
***************
RIMOZIONE RIQUADRO BIANCO

Codice: Seleziona tutto

*** 328,338 ****
  
  		/* loop while we have a handler */
  		while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
! 			video_frame_update(machine, FALSE);
  
  		/* clear the handler and force an update */
  		ui_set_handler(handler_ingame, 0);
! 		video_frame_update(machine, FALSE);
  	}
  
  	/* if we're the empty driver, force the menus on */
--- 330,340 ----
  
  		/* loop while we have a handler */
  		while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
! 			//video_frame_update(machine, FALSE);
  
  		/* clear the handler and force an update */
  		ui_set_handler(handler_ingame, 0);
! 		//video_frame_update(machine, FALSE);
  	}
  
  	/* if we're the empty driver, force the menus on */
AUDIO SYNC parte 2

Codice: Seleziona tutto

diff -crB C:\mingw\mame_original/src/emu/video.c C:\mingw\mame/src/emu/video.c
*** C:\mingw\mame_original/src/emu/video.c	Wed Oct 20 23:01:18 2010
--- C:\mingw\mame/src/emu/video.c	Thu Dec 16 17:22:15 2010
***************
*** 1052,1058 ****
  
  		/* convert from ticks to attoseconds */
  		global.speed_percent = (double)delta_emutime * (double)tps / ((double)delta_realtime * (double)ATTOSECONDS_PER_SECOND);
! 
  		/* remember the last times */
  		global.speed_last_realtime = realtime;
  		global.speed_last_emutime = emutime;
--- 1052,1060 ----
  
  		/* convert from ticks to attoseconds */
  		global.speed_percent = (double)delta_emutime * (double)tps / ((double)delta_realtime * (double)ATTOSECONDS_PER_SECOND);
! 		
! 		machine->speed_percent = global.speed_percent;
! 	
  		/* remember the last times */
  		global.speed_last_realtime = realtime;
  		global.speed_last_emutime = emutime;
***************
60hz

Codice: Seleziona tutto

*** 1788,1794 ****
  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
! 	screen->m_refresh = rate;
  }
  
  
--- 1790,1796 ----
  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
! 	screen->m_refresh = HZ_TO_ATTOSECONDS(60);
  }
  
 
Audio sync parte 3

Codice: Seleziona tutto

 
diff -crB C:\mingw\mame_original/src/osd/windows/sound.c C:\mingw\mame/src/osd/windows/sound.c
*** C:\mingw\mame_original/src/osd/windows/sound.c	Tue Jun 29 20:46:22 2010
--- C:\mingw\mame/src/osd/windows/sound.c	Thu Dec 16 17:11:01 2010
***************
*** 203,208 ****
--- 203,214 ----
  	if (stream_buffer == NULL)
  		return;
  
+ 	/* if we are active, update the sampling frequency */
+ 	if (machine->speed_percent > 0.0f)
+ 	{
+ 		IDirectSoundBuffer_SetFrequency(stream_buffer, machine->sample_rate * machine->speed_percent);
+ 	}
+ 	
  	// determine the current play position
  	result = IDirectSoundBuffer_GetCurrentPosition(stream_buffer, &play_position, &write_position);
  	if (result == DS_OK)
***************
*** 392,398 ****
  	// create a buffer desc for the stream buffer
  	memset(&stream_desc, 0, sizeof(stream_desc));
  	stream_desc.dwSize = sizeof(stream_desc);
! 	stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;
  	stream_desc.dwBufferBytes = stream_buffer_size;
  	stream_desc.lpwfxFormat	= &stream_format;
  
--- 398,405 ----
  	// create a buffer desc for the stream buffer
  	memset(&stream_desc, 0, sizeof(stream_desc));
  	stream_desc.dwSize = sizeof(stream_desc);
! 	stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY;
! 	//stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;	
  	stream_desc.dwBufferBytes = stream_buffer_size;
  	stream_desc.lpwfxFormat	= &stream_format;

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 17:15
da Kernel
Spettacolo! <-thumbup->

Re: Compilare e personalizzare Mame

Inviato: 21/12/2010, 18:19
da PaTrYcK
ok antonio, ci siamo quasi <-clap-> un ultimo dubbio (spero...)

Prendiamo ad esempio:
codice x i 60HZ:

*** 1788,1794 ****
void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate) { screen_device_config *screen = downcast<screen_device_config *>(device); ! screen->m_refresh = rate; }
Qui i valori 1788-1794 indicano che dalla riga 1788 alla riga 1794 e' presente il comando sopra, da sostituire con:
--- 1790,1796 ----
void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate) { screen_device_config *screen = downcast<screen_device_config *>(device); ! screen->m_refresh = HZ_TO_ATTOSECONDS(60);

comando presente dalla riga 1790 alla 1796

Se prendiamo invece:
Comando x eliminare percentuale caricamento:

-diff -crB C:\mingw\mame_original/src/emu/romload.c C:\mingw\mame/src/emu/romload.c
*** C:\mingw\mame_original/src/emu/romload.c Thu Sep 2 22:21:48 2010
--- C:\mingw\mame/src/emu/romload.c Thu Dec 16 17:08:41 2010
***************
*** 515,520 ****
--- 515,522 ----
static void display_loading_rom_message(rom_load_data *romdata, const char *name)
{
+ return;
+
char buffer[200];
// 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
diff -crB C:\mingw\mame_original/src/emu/ui.c C:\mingw\mame/src/emu/ui.c

vediamo essere un diff, mettiamo il caso che io voglia modificare il sorgente romload.c senza applicare direttamente il diff, nn mi e' ben chiaro il riferimento al file:
*** 515,520 ****
--- 515,522 ----

come dovrei procedere in questo caso x apportare la modifica?
Grazie!

Re: Compilare e personalizzare Mame

Inviato: 22/12/2010, 8:52
da antoniomauro
In questo caso la modifica è:

Codice: Seleziona tutto

+ return;
+ 
ovvero vegono aggiunte (+) due riga

I diff files in pratica documentano le modifiche al codice in 2 modi possibili (grossomodo):
1) Utilizzando i simboli + o - accanto alle righe per indicare in un blocco di codice le modifiche
2) Riportando il blocco originale e quello modificato segnando i punti di modifica con !

Sembra complesso ma dopo un paio di volte che li guardi li leggerai come se fosse un libro!

Re: Compilare e personalizzare Mame

Inviato: 22/12/2010, 9:44
da antoniomauro
Ho aggiunto un'altra piccola modifica che evita i messaggi "Initializing" e "Decrypting" prima del caricamento di alcuni giochi:

ecco la singola modifica

Codice: Seleziona tutto

diff -crB C:\mingw\mame_original/src/emu/ui.c C:\mingw\mame/src/emu/ui.c
*** C:\mingw\mame_original/src/emu/ui.c	Tue Oct 12 23:20:12 2010
--- C:\mingw\mame/src/emu/ui.c	Wed Dec 22 09:01:28 2010
***************
*** 350,355 ****
--- 352,359 ----
  
  void ui_set_startup_text(running_machine *machine, const char *text, int force)
  {
+ 	return;
+ 
  	static osd_ticks_t lastupdatetime = 0;
  	osd_ticks_t curtime = osd_ticks();
Ecco tutto il diff

Codice: Seleziona tutto

diff -crB C:\mingw\mame_original/src/emu/machine.h C:\mingw\mame/src/emu/machine.h
*** C:\mingw\mame_original/src/emu/machine.h	Thu Oct 14 00:04:18 2010
--- C:\mingw\mame/src/emu/machine.h	Fri Dec 17 10:11:58 2010
***************
*** 395,400 ****
--- 395,402 ----
  	UINT32 rand();
  	const char *describe_context();
  
+ 	double 					speed_percent;		// most recent speed percentage 
+ 	
  	// internals
  	resource_pool			m_respool;			// pool of resources for this machine
  	region_list				m_regionlist;		// list of memory regions
diff -crB C:\mingw\mame_original/src/emu/romload.c C:\mingw\mame/src/emu/romload.c
*** C:\mingw\mame_original/src/emu/romload.c	Thu Sep  2 22:21:48 2010
--- C:\mingw\mame/src/emu/romload.c	Thu Dec 16 17:08:41 2010
***************
*** 515,520 ****
--- 515,522 ----
  
  static void display_loading_rom_message(rom_load_data *romdata, const char *name)
  {
+ 	return;
+ 
  	char buffer[200];
  
  	// 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
diff -crB C:\mingw\mame_original/src/emu/ui.c C:\mingw\mame/src/emu/ui.c
*** C:\mingw\mame_original/src/emu/ui.c	Tue Oct 12 23:20:12 2010
--- C:\mingw\mame/src/emu/ui.c	Wed Dec 22 09:01:28 2010
***************
*** 287,292 ****
--- 287,294 ----
  	if (!first_time || (str > 0 && str < 60*5) || machine->gamedrv == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
  		show_gameinfo = show_warnings = show_disclaimer = FALSE;
  
+ 	show_gameinfo = show_warnings = show_disclaimer = FALSE;
+ 	
  	/* initialize the on-screen display system */
  	slider_list = slider_current = slider_init(machine);
  
***************
*** 328,338 ****
  
  		/* loop while we have a handler */
  		while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
! 			video_frame_update(machine, FALSE);
  
  		/* clear the handler and force an update */
  		ui_set_handler(handler_ingame, 0);
! 		video_frame_update(machine, FALSE);
  	}
  
  	/* if we're the empty driver, force the menus on */
--- 330,340 ----
  
  		/* loop while we have a handler */
  		while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
! 			//video_frame_update(machine, FALSE);
  
  		/* clear the handler and force an update */
  		ui_set_handler(handler_ingame, 0);
! 		//video_frame_update(machine, FALSE);
  	}
  
  	/* if we're the empty driver, force the menus on */
***************
*** 350,355 ****
--- 352,359 ----
  
  void ui_set_startup_text(running_machine *machine, const char *text, int force)
  {
+ 	return;
+ 
  	static osd_ticks_t lastupdatetime = 0;
  	osd_ticks_t curtime = osd_ticks();
  
diff -crB C:\mingw\mame_original/src/emu/video.c C:\mingw\mame/src/emu/video.c
*** C:\mingw\mame_original/src/emu/video.c	Wed Oct 20 23:01:18 2010
--- C:\mingw\mame/src/emu/video.c	Thu Dec 16 17:22:15 2010
***************
*** 1052,1058 ****
  
  		/* convert from ticks to attoseconds */
  		global.speed_percent = (double)delta_emutime * (double)tps / ((double)delta_realtime * (double)ATTOSECONDS_PER_SECOND);
! 
  		/* remember the last times */
  		global.speed_last_realtime = realtime;
  		global.speed_last_emutime = emutime;
--- 1052,1060 ----
  
  		/* convert from ticks to attoseconds */
  		global.speed_percent = (double)delta_emutime * (double)tps / ((double)delta_realtime * (double)ATTOSECONDS_PER_SECOND);
! 		
! 		machine->speed_percent = global.speed_percent;
! 	
  		/* remember the last times */
  		global.speed_last_realtime = realtime;
  		global.speed_last_emutime = emutime;
***************
*** 1788,1794 ****
  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
! 	screen->m_refresh = rate;
  }
  
  
--- 1790,1796 ----
  void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
  {
  	screen_device_config *screen = downcast<screen_device_config *>(device);
! 	screen->m_refresh = HZ_TO_ATTOSECONDS(60);
  }
  
  
diff -crB C:\mingw\mame_original/src/osd/windows/sound.c C:\mingw\mame/src/osd/windows/sound.c
*** C:\mingw\mame_original/src/osd/windows/sound.c	Tue Jun 29 20:46:22 2010
--- C:\mingw\mame/src/osd/windows/sound.c	Thu Dec 16 17:11:01 2010
***************
*** 203,208 ****
--- 203,214 ----
  	if (stream_buffer == NULL)
  		return;
  
+ 	/* if we are active, update the sampling frequency */
+ 	if (machine->speed_percent > 0.0f)
+ 	{
+ 		IDirectSoundBuffer_SetFrequency(stream_buffer, machine->sample_rate * machine->speed_percent);
+ 	}
+ 	
  	// determine the current play position
  	result = IDirectSoundBuffer_GetCurrentPosition(stream_buffer, &play_position, &write_position);
  	if (result == DS_OK)
***************
*** 392,398 ****
  	// create a buffer desc for the stream buffer
  	memset(&stream_desc, 0, sizeof(stream_desc));
  	stream_desc.dwSize = sizeof(stream_desc);
! 	stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;
  	stream_desc.dwBufferBytes = stream_buffer_size;
  	stream_desc.lpwfxFormat	= &stream_format;
  
--- 398,405 ----
  	// create a buffer desc for the stream buffer
  	memset(&stream_desc, 0, sizeof(stream_desc));
  	stream_desc.dwSize = sizeof(stream_desc);
! 	stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY;
! 	//stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;	
  	stream_desc.dwBufferBytes = stream_buffer_size;
  	stream_desc.lpwfxFormat	= &stream_format;
  

Re: Compilare e personalizzare Mame

Inviato: 22/12/2010, 10:37
da PaTrYcK
Prendo come esempio il solito:
Comando x eliminare percentuale caricamento: (Copio l'intero codice presente su romload.c):

/*-------------------------------------------------
display_loading_rom_message - display
messages about ROM loading to the user
-------------------------------------------------*/

static void display_loading_rom_message(rom_load_data *romdata, const char *name)
{
char buffer[200];

// 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
// as a temp workaround, I added a check for romstotalsize !=0.
if (name != NULL && romdata->romstotalsize)
sprintf(buffer, "Loading (%d%%)", (UINT32)(100 * (UINT64)romdata->romsloadedsize / (UINT64)romdata->romstotalsize));
else
sprintf(buffer, "Loading Complete");

ui_set_startup_text(romdata->machine, buffer, FALSE);
}

Il relativo diff:
diff -crB C:\mingw\mame_original/src/emu/romload.c C:\mingw\mame/src/emu/romload.c
*** C:\mingw\mame_original/src/emu/romload.c Thu Sep 2 22:21:48 2010
--- C:\mingw\mame/src/emu/romload.c Thu Dec 16 17:08:41 2010
***************
*** 515,520 ****
--- 515,522 ----

static void display_loading_rom_message(rom_load_data *romdata, const char *name)
{
+ return;
+
char buffer[200];

// 2010-04, FP - FIXME: in MESS, load_software_part_region sometimes calls this with romstotalsize = 0!
diff -crB C:\mingw\mame_original/src/emu/ui.c C:\mingw\mame/src/emu/ui.c

Sul diff si evince che le modifiche sono presenti:
*** 515,520 **** Codice originale
--- 515,522 ---- Codice modificato con l'aggiunta di due righe:
+ return;
+

Mentre nel caso dovessimo trovare nel diff il simbolo "!", questo ci indica il comando modificato nella riga stessa
Al momento intervengo io manualmente sostituendo i valori nel codice senza applicare i diff in modo da capire dove e come sto intervenendo per poi ricompilare l'exe...
Dimmi se ci sono oppure se ho toppato da qualche parte :wink:

Re: Compilare e personalizzare Mame

Inviato: 22/12/2010, 11:24
da antoniomauro
Perfetto!

un esempio di modifica riportata con il ! è questo:

Codice: Seleziona tutto

*** C:\mingw\mame_original/src/emu/ui.c   Tue Oct 12 23:20:12 2010
--- C:\mingw\mame/src/emu/ui.c   Wed Dec 22 09:01:28 2010
***************
*** 328,338 ****
 
        /* loop while we have a handler */
        while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
!          video_frame_update(machine, FALSE);
 
        /* clear the handler and force an update */
        ui_set_handler(handler_ingame, 0);
!       video_frame_update(machine, FALSE);
     }
 
     /* if we're the empty driver, force the menus on */
--- 330,340 ----
 
        /* loop while we have a handler */
        while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
!          //video_frame_update(machine, FALSE);
 
        /* clear the handler and force an update */
        ui_set_handler(handler_ingame, 0);
!       //video_frame_update(machine, FALSE);
     }
 
     /* if we're the empty driver, force the menus on */
Come puoi osservare il diff non è riuscito a risolvere la modifica con un'aggiunta + ed ha optato per riportare il codice originale e quello modificato segnando con ! le righe diverse