@@ -171,117 +171,117 @@ LibretroCore::LibretroCore(retro_log_printf_t log_cb_, int machineDetailedType_,
171
171
if (enhancedRom)
172
172
{
173
173
bootframes = 20 *10 ;
174
- config->memory .rom [0x00 ].file =romBasePath+ " exos24uk.rom" ;
174
+ config->memory .rom [0x00 ].file =" exos24uk.rom" ;
175
175
config->memory .rom [0x00 ].offset =0 ;
176
- config->memory .rom [0x01 ].file =romBasePath+ " exos24uk.rom" ;
176
+ config->memory .rom [0x01 ].file =" exos24uk.rom" ;
177
177
config->memory .rom [0x01 ].offset =16384 ;
178
- config->memory .rom [0x02 ].file =romBasePath+ " exos24uk.rom" ;
178
+ config->memory .rom [0x02 ].file =" exos24uk.rom" ;
179
179
config->memory .rom [0x02 ].offset =32768 ;
180
- config->memory .rom [0x03 ].file =romBasePath+ " exos24uk.rom" ;
180
+ config->memory .rom [0x03 ].file =" exos24uk.rom" ;
181
181
config->memory .rom [0x03 ].offset =49152 ;
182
182
}
183
183
else if (is_EP64)
184
184
{
185
185
bootframes = 30 *10 ;
186
- config->memory .rom [0x00 ].file =romBasePath+ " exos20.rom" ;
186
+ config->memory .rom [0x00 ].file =" exos20.rom" ;
187
187
config->memory .rom [0x00 ].offset =0 ;
188
- config->memory .rom [0x01 ].file =romBasePath+ " exos20.rom" ;
188
+ config->memory .rom [0x01 ].file =" exos20.rom" ;
189
189
config->memory .rom [0x01 ].offset =16384 ;
190
190
}
191
191
else
192
192
{
193
193
bootframes = 40 *10 ;
194
- config->memory .rom [0x00 ].file =romBasePath+ " exos21.rom" ;
194
+ config->memory .rom [0x00 ].file =" exos21.rom" ;
195
195
config->memory .rom [0x00 ].offset =0 ;
196
- config->memory .rom [0x01 ].file =romBasePath+ " exos21.rom" ;
196
+ config->memory .rom [0x01 ].file =" exos21.rom" ;
197
197
config->memory .rom [0x01 ].offset =16384 ;
198
198
}
199
199
if (contentLocale == LOCALE_HUN)
200
200
{
201
201
// Locale support: HUN ROM goes to segment 4 and then Basic goes to segment 5
202
- config->memory .rom [0x04 ].file =romBasePath+ " hun.rom" ;
202
+ config->memory .rom [0x04 ].file =" hun.rom" ;
203
203
config->memory .rom [0x04 ].offset =0 ;
204
204
if (use_cartridge) {
205
205
if (is_EP64)
206
- config->memory .rom [0x05 ].file =romBasePath+ " basic20.rom" ;
206
+ config->memory .rom [0x05 ].file =" basic20.rom" ;
207
207
else
208
- config->memory .rom [0x05 ].file =romBasePath+ " basic21.rom" ;
208
+ config->memory .rom [0x05 ].file =" basic21.rom" ;
209
209
config->memory .rom [0x05 ].offset =0 ;
210
210
}
211
211
// HFONT is used from epdos rom (and CLKOFF, as it is not present after this 1.6f version)
212
- config->memory .rom [0x06 ].file =romBasePath+ " epdos16f.rom" ;
212
+ config->memory .rom [0x06 ].file =" epdos16f.rom" ;
213
213
config->memory .rom [0x06 ].offset =0 ;
214
- config->memory .rom [0x07 ].file =romBasePath+ " epdos16f.rom" ;
214
+ config->memory .rom [0x07 ].file =" epdos16f.rom" ;
215
215
config->memory .rom [0x07 ].offset =16384 ;
216
216
}
217
217
else if (contentLocale == LOCALE_GER)
218
218
{
219
219
// Locale support: BRD ROM goes to segment 4 and then Basic goes to segment 5
220
- config->memory .rom [0x04 ].file =romBasePath+ " brd.rom" ;
220
+ config->memory .rom [0x04 ].file =" brd.rom" ;
221
221
config->memory .rom [0x04 ].offset =0 ;
222
222
if (use_cartridge) {
223
223
if (is_EP64)
224
- config->memory .rom [0x05 ].file =romBasePath+ " basic20.rom" ;
224
+ config->memory .rom [0x05 ].file =" basic20.rom" ;
225
225
else
226
- config->memory .rom [0x05 ].file =romBasePath+ " basic21.rom" ;
226
+ config->memory .rom [0x05 ].file =" basic21.rom" ;
227
227
config->memory .rom [0x05 ].offset =0 ;
228
228
}
229
229
}
230
230
else
231
231
{
232
232
if (use_cartridge) {
233
233
if (is_EP64)
234
- config->memory .rom [0x04 ].file =romBasePath+ " basic20.rom" ;
234
+ config->memory .rom [0x04 ].file =" basic20.rom" ;
235
235
else
236
- config->memory .rom [0x05 ].file =romBasePath+ " basic21.rom" ;
236
+ config->memory .rom [0x05 ].file =" basic21.rom" ;
237
237
config->memory .rom [0x04 ].offset =0 ;
238
238
}
239
239
}
240
240
241
241
if (use_file || use_dtf)
242
242
{
243
- config->memory .rom [0x10 ].file =romBasePath+ " epfileio.rom" ;
243
+ config->memory .rom [0x10 ].file =" epfileio.rom" ;
244
244
config->memory .rom [0x10 ].offset =0 ;
245
245
if (use_dtf)
246
246
{
247
- config->memory .rom [0x40 ].file =romBasePath+ " zt19uk.rom" ;
247
+ config->memory .rom [0x40 ].file =" zt19uk.rom" ;
248
248
config->memory .rom [0x40 ].offset =0 ;
249
- config->memory .rom [0x41 ].file =romBasePath+ " zt19uk.rom" ;
249
+ config->memory .rom [0x41 ].file =" zt19uk.rom" ;
250
250
config->memory .rom [0x41 ].offset =16384 ;
251
251
}
252
252
}
253
253
if (use_isdos)
254
254
{
255
- config->memory .rom [0x20 ].file =romBasePath+ " exdos14isdos10uk.rom" ;
255
+ config->memory .rom [0x20 ].file =" exdos14isdos10uk.rom" ;
256
256
config->memory .rom [0x20 ].offset =0 ;
257
- config->memory .rom [0x21 ].file =romBasePath+ " exdos14isdos10uk.rom" ;
257
+ config->memory .rom [0x21 ].file =" exdos14isdos10uk.rom" ;
258
258
config->memory .rom [0x21 ].offset =16384 ;
259
259
startSequence += " \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff " " \x27 " " isdos\r " " \xff\xff\xff\xff\xff\xff\xff " " dir\r " ;
260
260
}
261
261
else if (use_file || use_disk)
262
262
{
263
- config->memory .rom [0x20 ].file =romBasePath+ " exdos13.rom" ;
263
+ config->memory .rom [0x20 ].file =" exdos13.rom" ;
264
264
config->memory .rom [0x20 ].offset =0 ;
265
- config->memory .rom [0x21 ].file =romBasePath+ " exdos13.rom" ;
265
+ config->memory .rom [0x21 ].file =" exdos13.rom" ;
266
266
config->memory .rom [0x21 ].offset =16384 ;
267
267
}
268
268
}
269
269
else if (machineType == MACHINE_TVC)
270
270
{
271
271
bootframes = 50 *10 ;
272
272
config->memory .ram .size =128 ;
273
- config->memory .rom [0x00 ].file =romBasePath+ " tvc22_sys.rom" ;
273
+ config->memory .rom [0x00 ].file =" tvc22_sys.rom" ;
274
274
config->memory .rom [0x00 ].offset =0 ;
275
- config->memory .rom [0x02 ].file =romBasePath+ " tvc22_ext.rom" ;
275
+ config->memory .rom [0x02 ].file =" tvc22_ext.rom" ;
276
276
config->memory .rom [0x02 ].offset =0 ;
277
277
if (machineDetailedType == VM_config.at (" TVC64_FILE" ))
278
278
{
279
- config->memory .rom [0x04 ].file =romBasePath+ " tvcfileio.rom" ;
279
+ config->memory .rom [0x04 ].file =" tvcfileio.rom" ;
280
280
config->memory .rom [0x04 ].offset =0 ;
281
281
}
282
282
if (machineDetailedType == VM_config.at (" TVC64_DISK" ))
283
283
{
284
- config->memory .rom [0x03 ].file =romBasePath+ " tvc_dos12d.rom" ;
284
+ config->memory .rom [0x03 ].file =" tvc_dos12d.rom" ;
285
285
config->memory .rom [0x03 ].offset =0 ;
286
286
}
287
287
}
@@ -292,31 +292,31 @@ LibretroCore::LibretroCore(retro_log_printf_t log_cb_, int machineDetailedType_,
292
292
if (machineDetailedType == VM_config.at (" CPC_464_TAPE" ))
293
293
{
294
294
config->memory .ram .size =64 ;
295
- config->memory .rom [0x10 ].file =romBasePath+ " cpc464.rom" ;
295
+ config->memory .rom [0x10 ].file =" cpc464.rom" ;
296
296
config->memory .rom [0x10 ].offset =0 ;
297
- config->memory .rom [0x00 ].file =romBasePath+ " cpc464.rom" ;
297
+ config->memory .rom [0x00 ].file =" cpc464.rom" ;
298
298
config->memory .rom [0x00 ].offset =16384 ;
299
299
}
300
300
else if (machineDetailedType == VM_config.at (" CPC_664_DISK" ))
301
301
{
302
302
config->memory .ram .size =64 ;
303
- config->memory .rom [0x10 ].file =romBasePath+ " cpc664.rom" ;
303
+ config->memory .rom [0x10 ].file =" cpc664.rom" ;
304
304
config->memory .rom [0x10 ].offset =0 ;
305
- config->memory .rom [0x00 ].file =romBasePath+ " cpc664.rom" ;
305
+ config->memory .rom [0x00 ].file =" cpc664.rom" ;
306
306
config->memory .rom [0x00 ].offset =16384 ;
307
307
}
308
308
else
309
309
{
310
310
// 6128 as default
311
311
config->memory .ram .size =128 ;
312
- config->memory .rom [0x10 ].file =romBasePath+ " cpc6128.rom" ;
312
+ config->memory .rom [0x10 ].file =" cpc6128.rom" ;
313
313
config->memory .rom [0x10 ].offset =0 ;
314
- config->memory .rom [0x00 ].file =romBasePath+ " cpc6128.rom" ;
314
+ config->memory .rom [0x00 ].file =" cpc6128.rom" ;
315
315
config->memory .rom [0x00 ].offset =16384 ;
316
316
}
317
317
if (machineDetailedType == VM_config.at (" CPC_DISK" ) || machineDetailedType == VM_config.at (" CPC_664_DISK" ))
318
318
{
319
- config->memory .rom [0x07 ].file =romBasePath+ " cpc_amsdos.rom" ;
319
+ config->memory .rom [0x07 ].file =" cpc_amsdos.rom" ;
320
320
config->memory .rom [0x07 ].offset =0 ;
321
321
}
322
322
@@ -339,23 +339,92 @@ LibretroCore::LibretroCore(retro_log_printf_t log_cb_, int machineDetailedType_,
339
339
340
340
if (machineDetailedType == VM_config.at (" ZX128_TAPE" ) || machineDetailedType == VM_config.at (" ZX128_FILE" ))
341
341
{
342
- config->memory .rom [0x00 ].file =romBasePath+ " zx128.rom" ;
342
+ config->memory .rom [0x00 ].file =" zx128.rom" ;
343
343
config->memory .rom [0x00 ].offset =0 ;
344
- config->memory .rom [0x01 ].file =romBasePath+ " zx128.rom" ;
344
+ config->memory .rom [0x01 ].file =" zx128.rom" ;
345
345
config->memory .rom [0x01 ].offset =16384 ;
346
346
}
347
347
else
348
348
{
349
- config->memory .rom [0x00 ].file =romBasePath+ " zx48.rom" ;
349
+ config->memory .rom [0x00 ].file =" zx48.rom" ;
350
350
config->memory .rom [0x00 ].offset =0 ;
351
351
}
352
352
}
353
+
354
+ if (machineType == MACHINE_EP)
355
+ {
356
+ config->vm .cpuClockFrequency =4000000 ;
357
+ config->vm .enableMemoryTimingEmulation =true ;
358
+ config->vm .soundClockFrequency =500000 ;
359
+ config->vm .videoClockFrequency =889846 ;
360
+ }
361
+ else if (machineType == MACHINE_TVC)
362
+ {
363
+ config->vm .cpuClockFrequency =3125000 ;
364
+ config->vm .enableMemoryTimingEmulation =true ;
365
+ config->vm .soundClockFrequency =390625 ;
366
+ config->vm .videoClockFrequency =1562500 ;
367
+ }
368
+ else if (machineType == MACHINE_CPC)
369
+ {
370
+ config->vm .cpuClockFrequency =4000000 ;
371
+ config->vm .enableMemoryTimingEmulation =true ;
372
+ config->vm .soundClockFrequency =125000 ;
373
+ config->vm .videoClockFrequency =1000000 ;
374
+ }
375
+ else if (machineType == MACHINE_ZX)
376
+ {
377
+ if (machineDetailedType == VM_config.at (" ZX128_TAPE" ) || machineDetailedType == VM_config.at (" ZX128_FILE" ))
378
+ {
379
+ config->vm .cpuClockFrequency =3546896 ;
380
+ config->vm .soundClockFrequency =221681 ;
381
+ config->vm .videoClockFrequency =886724 ;
382
+ }
383
+ else
384
+ {
385
+ config->vm .cpuClockFrequency =3500000 ;
386
+ config->vm .soundClockFrequency =218750 ;
387
+ config->vm .videoClockFrequency =875000 ;
388
+ }
389
+ config->vm .enableMemoryTimingEmulation =true ;
390
+ }
391
+ config->vmConfigurationChanged = true ;
392
+
393
+ config->sound .sampleRate = EP128EMU_SAMPLE_RATE_FLOAT;
394
+ config->sound .hwPeriods = 16 ;
395
+ // config->sound.swPeriods = 16;
396
+ // config->sound.enabled = false;
397
+ config->sound .highQuality = true ;
398
+ config->soundSettingsChanged = true ;
399
+
400
+ // Reload config files to enforce priority of settings.
401
+ if (Ep128Emu::does_file_exist (configBaseFile.c_str ()))
402
+ {
403
+ config->loadState (configBaseFile.c_str (),false );
404
+ }
405
+ // highest: content-specific file
406
+ if (cfgFile[0 ])
407
+ {
408
+ config->loadState (cfgFile,false );
409
+ }
410
+
353
411
// ROM validity check: scan ROM definitions and check if files can be be found.
354
412
// If not, try to use replacement file
355
413
for (int i=0 ; i<68 ; i++)
356
414
{
357
415
if (config->memory .rom [i].file .length ()>0 )
358
416
{
417
+ // Prepend romBasePath if the rom name is not a path already (useful for rom settings read from .ep128cfg)
418
+ #ifdef WIN32
419
+ size_t idx = config->memory .rom [i].file .rfind (' \\ ' );
420
+ #else
421
+ size_t idx = config->memory .rom [i].file .rfind (' /' );
422
+ #endif
423
+ if (idx == std::string::npos)
424
+ {
425
+ config->memory .rom [i].file =romBasePath+config->memory .rom [i].file ;
426
+ }
427
+
359
428
if (!Ep128Emu::does_file_exist (config->memory .rom [i].file .c_str ()))
360
429
{
361
430
std::map< std::string, std::string >::const_iterator iter_altrom;
@@ -422,65 +491,8 @@ LibretroCore::LibretroCore(retro_log_printf_t log_cb_, int machineDetailedType_,
422
491
}
423
492
}
424
493
}
425
- config->memoryConfigurationChanged = true ;
426
-
427
- if (machineType == MACHINE_EP)
428
- {
429
- config->vm .cpuClockFrequency =4000000 ;
430
- config->vm .enableMemoryTimingEmulation =true ;
431
- config->vm .soundClockFrequency =500000 ;
432
- config->vm .videoClockFrequency =889846 ;
433
- }
434
- else if (machineType == MACHINE_TVC)
435
- {
436
- config->vm .cpuClockFrequency =3125000 ;
437
- config->vm .enableMemoryTimingEmulation =true ;
438
- config->vm .soundClockFrequency =390625 ;
439
- config->vm .videoClockFrequency =1562500 ;
440
- }
441
- else if (machineType == MACHINE_CPC)
442
- {
443
- config->vm .cpuClockFrequency =4000000 ;
444
- config->vm .enableMemoryTimingEmulation =true ;
445
- config->vm .soundClockFrequency =125000 ;
446
- config->vm .videoClockFrequency =1000000 ;
447
- }
448
- else if (machineType == MACHINE_ZX)
449
- {
450
- if (machineDetailedType == VM_config.at (" ZX128_TAPE" ) || machineDetailedType == VM_config.at (" ZX128_FILE" ))
451
- {
452
- config->vm .cpuClockFrequency =3546896 ;
453
- config->vm .soundClockFrequency =221681 ;
454
- config->vm .videoClockFrequency =886724 ;
455
- }
456
- else
457
- {
458
- config->vm .cpuClockFrequency =3500000 ;
459
- config->vm .soundClockFrequency =218750 ;
460
- config->vm .videoClockFrequency =875000 ;
461
- }
462
- config->vm .enableMemoryTimingEmulation =true ;
463
- }
464
- config->vmConfigurationChanged = true ;
465
-
466
- config->sound .sampleRate = EP128EMU_SAMPLE_RATE_FLOAT;
467
- config->sound .hwPeriods = 16 ;
468
- // config->sound.swPeriods = 16;
469
- // config->sound.enabled = false;
470
- config->sound .highQuality = true ;
471
- config->soundSettingsChanged = true ;
472
-
473
- // Reload config files to enforce priority of settings.
474
- if (Ep128Emu::does_file_exist (configBaseFile.c_str ()))
475
- {
476
- config->loadState (configBaseFile.c_str (),false );
477
- }
478
- // highest: content-specific file
479
- if (cfgFile[0 ])
480
- {
481
- config->loadState (cfgFile,false );
482
- }
483
-
494
+ config->memoryConfigurationChanged = true ;
495
+
484
496
initialize_keyboard_map ();
485
497
initialize_joystick_map (std::string (" " ),std::string (" " ),std::string (" " ),-1 ,
486
498
joystick_type.at (" DEFAULT" ), joystick_type.at (" DEFAULT" ), joystick_type.at (" DEFAULT" ),
0 commit comments