@@ -16,6 +16,9 @@ typedef UINT8 (*read8z_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED
16
16
the first 16 banks. */
17
17
#define NUMBER_OF_CARTRIDGE_SLOTS 8
18
18
19
+ #define VERBOSE 2
20
+ #define LOG logerror
21
+
19
22
typedef int assmfct (device_t * );
20
23
21
24
DECLARE_LEGACY_CART_SLOT_DEVICE (TI99_CARTRIDGE_PCB_NONE , ti99_cartridge_pcb_none );
@@ -113,15 +116,6 @@ typedef struct _ti99_multicart_state
113
116
int gk_slot ;
114
117
int gk_guest_slot ;
115
118
116
- /* Legacy support. */
117
- // Counts the number of slots which currently contain legacy format
118
- // cartridge images.
119
- int legacy_slots ;
120
-
121
- // Counts the number of slots which currently contain new format
122
- // cartridge images.
123
- int multi_slots ;
124
-
125
119
/* Used to cache the switch settings. */
126
120
UINT8 gk_switch [8 ];
127
121
@@ -223,19 +217,14 @@ static int get_gk_switch(device_t *cartsys, int number)
223
217
return cartslots -> gk_switch [number ];
224
218
}
225
219
226
- static int in_legacy_mode (device_t * device )
227
- {
228
- ti99_multicart_state * cartslots = get_safe_token (device );
229
- return ((cartslots -> legacy_slots > 0 ) && (cartslots -> multi_slots == 0 ));
230
- }
231
-
232
220
/*
233
221
Activates a slot in the multi-cartridge extender.
234
222
*/
235
223
static void cartridge_slot_set (device_t * cartsys , UINT8 slotnumber )
236
224
{
237
225
ti99_multicart_state * cartslots = get_safe_token (cartsys );
238
- // if (cartslots->active_slot != slotnumber) printf("Setting cartslot to %d\n", slotnumber);
226
+ if (VERBOSE > 2 )
227
+ if (cartslots -> active_slot != slotnumber ) LOG ("ti99: gromport: Setting cartslot to %d\n" , slotnumber );
239
228
if (cartslots -> fixed_slot == AUTO )
240
229
cartslots -> active_slot = slotnumber ;
241
230
else
@@ -302,6 +291,8 @@ static cartridge_t *assemble_common(device_t *cartslot)
302
291
int slotnumber = get_index_from_tagname (cartslot )- 1 ;
303
292
assert (slotnumber >=0 && slotnumber < NUMBER_OF_CARTRIDGE_SLOTS );
304
293
294
+ if (VERBOSE > 1 ) LOG ("ti99: gromport: mounting cartridge in slot %d\n" , slotnumber );
295
+
305
296
/* There is a cartridge in this slot, check the maximum slot number. */
306
297
if (cartslots -> next_free_slot <= slotnumber )
307
298
{
@@ -326,7 +317,6 @@ static cartridge_t *assemble_common(device_t *cartslot)
326
317
{
327
318
cartridge -> rom_ptr = (UINT8 * )socketcont ;
328
319
cartridge -> rom_size = reslength ;
329
- // printf("set rom ptr = %lx, romlength = %04x, data = %02x %02x\n", cartridge->rom_ptr, cartridge->rom_size, cartridge->rom_ptr[0], cartridge->rom_ptr[1]);
330
320
}
331
321
332
322
socketcont = cartslot_get_socket (cartslot , "rom2_socket" );
@@ -376,8 +366,7 @@ static void set_pointers(device_t *pcb, int index)
376
366
377
367
/*****************************************************************************
378
368
Cartridge type: None
379
- This PCB device is just a pseudo device; the legacy mode is handled
380
- by dedicated functions.
369
+ This PCB device is just a pseudo device
381
370
******************************************************************************/
382
371
static DEVICE_START (ti99_pcb_none )
383
372
{
@@ -416,7 +405,7 @@ static READ8Z_DEVICE_HANDLER( read_cart_std )
416
405
417
406
static WRITE8_DEVICE_HANDLER ( write_cart_std )
418
407
{
419
- logerror ( " Write access to cartridge ROM at address %04x ignored\n" , offset );
408
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Write access to cartridge ROM at address %04x ignored\n" , offset );
420
409
}
421
410
422
411
/*
@@ -529,12 +518,12 @@ static int assemble_paged(device_t *image)
529
518
cart = assemble_common (image );
530
519
if (cart -> rom_ptr == NULL )
531
520
{
532
- logerror ( " Missing ROM for paged cartridge" );
521
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing ROM for paged cartridge" );
533
522
return IMAGE_INIT_FAIL ;
534
523
}
535
524
if (cart -> rom2_ptr == NULL )
536
525
{
537
- logerror ( " Missing second ROM for paged cartridge" );
526
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing second ROM for paged cartridge" );
538
527
return IMAGE_INIT_FAIL ;
539
528
}
540
529
@@ -579,13 +568,13 @@ static WRITE8_DEVICE_HANDLER( write_cart_minimem )
579
568
580
569
if ((offset & 0x1000 )== 0x0000 )
581
570
{
582
- logerror ( " Write access to cartridge ROM at address %04x ignored" , offset );
571
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Write access to cartridge ROM at address %04x ignored" , offset );
583
572
}
584
573
else
585
574
{
586
575
if (cartridge -> ram_ptr == NULL )
587
576
{
588
- logerror ( " No cartridge RAM at address %04x" , offset );
577
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: No cartridge RAM at address %04x" , offset );
589
578
/* TODO: Check for consistency with the GROM memory handling. */
590
579
}
591
580
else
@@ -602,19 +591,19 @@ static int assemble_minimem(device_t *image)
602
591
cart = assemble_common (image );
603
592
if (cart -> grom_size == 0 )
604
593
{
605
- logerror ( " Missing GROM for Mini Memory" );
594
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing GROM for Mini Memory" );
606
595
// should not fail here because there may be variations of
607
596
// cartridges which do not use all parts
608
597
// return IMAGE_INIT_FAIL;
609
598
}
610
599
if (cart -> rom_size == 0 )
611
600
{
612
- logerror ( " Missing ROM for Mini Memory" );
601
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing ROM for Mini Memory" );
613
602
// return IMAGE_INIT_FAIL;
614
603
}
615
604
if (cart -> ram_size == 0 )
616
605
{
617
- logerror ( " Missing RAM for Mini Memory" );
606
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing RAM for Mini Memory" );
618
607
// return IMAGE_INIT_FAIL;
619
608
}
620
609
@@ -674,7 +663,7 @@ static READ8Z_DEVICE_HANDLER( read_cart_cru )
674
663
// BNKS1 LDCR R1,0 Switch Banks
675
664
// SRL R0,1 Restore Bank Number (optional)
676
665
// RT
677
- logerror ( " Superspace: CRU accessed at %04x\n" , offset );
666
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Superspace: CRU accessed at %04x\n" , offset );
678
667
if ((offset & 1 ) == 0 || offset > 7 )
679
668
* value = 0 ;
680
669
@@ -689,7 +678,7 @@ static WRITE8_DEVICE_HANDLER( write_cart_cru )
689
678
cartridge_t * cartridge = pcb -> cartridge ;
690
679
// data is bit
691
680
// offset is address
692
- logerror ( " Superspace: CRU accessed at %04x\n" , offset );
681
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Superspace: CRU accessed at %04x\n" , offset );
693
682
if (offset < 8 )
694
683
{
695
684
if (data != 0 )
@@ -731,7 +720,7 @@ static WRITE8_DEVICE_HANDLER( write_cart_super )
731
720
732
721
if (cartridge -> ram_ptr == NULL )
733
722
{
734
- logerror ( " No cartridge RAM at address %04x" , offset );
723
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: No cartridge RAM at address %04x" , offset );
735
724
}
736
725
else
737
726
{
@@ -747,7 +736,7 @@ static int assemble_super(device_t *image)
747
736
cart = assemble_common (image );
748
737
if (cart -> ram_size == 0 )
749
738
{
750
- logerror ( " Missing RAM for SuperSpace" );
739
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing RAM for SuperSpace" );
751
740
return IMAGE_INIT_FAIL ;
752
741
}
753
742
return IMAGE_INIT_PASS ;
@@ -925,7 +914,7 @@ static int assemble_paged379i(device_t *image)
925
914
cart = assemble_common (image );
926
915
if (cart -> rom_ptr == NULL )
927
916
{
928
- logerror ( " Missing ROM for paged cartridge" );
917
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing ROM for paged cartridge" );
929
918
return IMAGE_INIT_FAIL ;
930
919
}
931
920
set_paged379i_bank (cart , 15 );
@@ -1032,7 +1021,7 @@ static int assemble_pagedcru(device_t *image)
1032
1021
cart = assemble_common (image );
1033
1022
if (cart -> rom_ptr == NULL )
1034
1023
{
1035
- logerror ( " Missing ROM for pagedcru cartridge" );
1024
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing ROM for pagedcru cartridge" );
1036
1025
return IMAGE_INIT_FAIL ;
1037
1026
}
1038
1027
cart -> rom_page = 0 ;
@@ -1065,13 +1054,13 @@ static int assemble_gramkracker(device_t *image)
1065
1054
1066
1055
if (cart -> grom_ptr == NULL )
1067
1056
{
1068
- logerror ( " Missing loader GROM for GRAM Kracker system" );
1057
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing loader GROM for GRAM Kracker system" );
1069
1058
return IMAGE_INIT_FAIL ;
1070
1059
}
1071
1060
1072
1061
if (cart -> ram_size < 81920 )
1073
1062
{
1074
- logerror ( " Missing or insufficient RAM for GRAM Kracker system" );
1063
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: Missing or insufficient RAM for GRAM Kracker system" );
1075
1064
return IMAGE_INIT_FAIL ;
1076
1065
}
1077
1066
@@ -1482,7 +1471,7 @@ static DEVICE_IMAGE_LOAD( ti99_cartridge )
1482
1471
// otherwise one cannot make use of multicart handling within such a
1483
1472
// custom LOAD function.
1484
1473
multicart_open_error me = multicart_open (image .device ().machine ().options (), image .filename (), image .device ().machine ().system ().name , MULTICART_FLAGS_LOAD_RESOURCES , & cart -> mc );
1485
-
1474
+ if ( VERBOSE > 1 ) LOG ( "ti99: gromport: opened %s as cartridge\n" , image . filename ());
1486
1475
// Now that we have loaded the image files, let the PCB put them all
1487
1476
// together. This means we put the images in a structure which allows
1488
1477
// for a quick access by the memory handlers. Every PCB defines an
@@ -2027,11 +2016,6 @@ static READ8Z_DEVICE_HANDLER( ti99_cart_gk_rz )
2027
2016
if (cartslots -> gk_guest_slot != -1 )
2028
2017
{
2029
2018
gkguestcart = & cartslots -> cartridge [cartslots -> gk_guest_slot ];
2030
- // Legacy mode is not supported with the GK
2031
- if (in_legacy_mode (device ))
2032
- {
2033
- return ;
2034
- }
2035
2019
// printf("accessing cartridge in slot %d\n", slot);
2036
2020
ti99_pcb_t * pcbdef = get_safe_pcb_token (gkguestcart -> pcb );
2037
2021
// printf("address=%lx, offset=%lx\n", pcbdef, offset);
@@ -2082,12 +2066,6 @@ static WRITE8_DEVICE_HANDLER( ti99_cart_gk_w )
2082
2066
if (cartslots -> gk_guest_slot != -1 )
2083
2067
{
2084
2068
gkguestcart = & cartslots -> cartridge [cartslots -> gk_guest_slot ];
2085
- // Legacy mode is not supported with the GK
2086
- if (in_legacy_mode (device ))
2087
- {
2088
- return ;
2089
- }
2090
-
2091
2069
ti99_pcb_t * pcbdef = get_safe_pcb_token (gkguestcart -> pcb );
2092
2070
(* pcbdef -> write )(gkguestcart -> pcb , offset , data );
2093
2071
}
@@ -2152,7 +2130,7 @@ static WRITE8_DEVICE_HANDLER( ti99_cart_cru_gk_w )
2152
2130
2153
2131
/*****************************************************************************/
2154
2132
#define TI99_CARTRIDGE_SLOT (p ) MCFG_MULTICARTSLOT_ADD(p) \
2155
- MCFG_MULTICARTSLOT_EXTENSION_LIST("rpk,bin ") \
2133
+ MCFG_MULTICARTSLOT_EXTENSION_LIST("rpk") \
2156
2134
MCFG_MULTICARTSLOT_PCBTYPE(0, "none", TI99_CARTRIDGE_PCB_NONE) \
2157
2135
MCFG_MULTICARTSLOT_PCBTYPE(1, "standard", TI99_CARTRIDGE_PCB_STD) \
2158
2136
MCFG_MULTICARTSLOT_PCBTYPE(2, "paged", TI99_CARTRIDGE_PCB_PAGED) \
0 commit comments