Mercurial > repos > blastem
comparison romdb.c @ 1792:52a47611a273
Avoid printing a bunch of junk to stdout when GDB remote debugging is enabled as this can confuse GDB
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 20 Mar 2019 22:05:27 -0700 |
parents | c206a422d466 |
children | 4cd226288958 |
comparison
equal
deleted
inserted
replaced
1791:1843823f1e9b | 1792:52a47611a273 |
---|---|
558 } | 558 } |
559 tern_node * bits_write = tern_find_node(node, "bits_write"); | 559 tern_node * bits_write = tern_find_node(node, "bits_write"); |
560 if (bits_write) { | 560 if (bits_write) { |
561 tern_foreach(bits_write, eeprom_write_fun, eep_map); | 561 tern_foreach(bits_write, eeprom_write_fun, eep_map); |
562 } | 562 } |
563 printf("EEPROM address %X: sda read: %X, sda write: %X, scl: %X\n", start, eep_map->sda_read_bit, eep_map->sda_write_mask, eep_map->scl_mask); | 563 debug_message("EEPROM address %X: sda read: %X, sda write: %X, scl: %X\n", start, eep_map->sda_read_bit, eep_map->sda_write_mask, eep_map->scl_mask); |
564 state->info->num_eeprom++; | 564 state->info->num_eeprom++; |
565 } | 565 } |
566 | 566 |
567 void map_iter_fun(char *key, tern_val val, uint8_t valtype, void *data) | 567 void map_iter_fun(char *key, tern_val val, uint8_t valtype, void *data) |
568 { | 568 { |
845 break; | 845 break; |
846 } | 846 } |
847 product_id[i] = rom[GAME_ID_OFF + i]; | 847 product_id[i] = rom[GAME_ID_OFF + i]; |
848 | 848 |
849 } | 849 } |
850 printf("Product ID: %s\n", product_id); | 850 debug_message("Product ID: %s\n", product_id); |
851 uint8_t raw_hash[20]; | 851 uint8_t raw_hash[20]; |
852 sha1(vrom, rom_size, raw_hash); | 852 sha1(vrom, rom_size, raw_hash); |
853 uint8_t hex_hash[41]; | 853 uint8_t hex_hash[41]; |
854 bin_to_hex(hex_hash, raw_hash, 20); | 854 bin_to_hex(hex_hash, raw_hash, 20); |
855 printf("SHA1: %s\n", hex_hash); | 855 debug_message("SHA1: %s\n", hex_hash); |
856 tern_node * entry = tern_find_node(rom_db, hex_hash); | 856 tern_node * entry = tern_find_node(rom_db, hex_hash); |
857 if (!entry) { | 857 if (!entry) { |
858 entry = tern_find_node(rom_db, product_id); | 858 entry = tern_find_node(rom_db, product_id); |
859 } | 859 } |
860 if (!entry) { | 860 if (!entry) { |
861 puts("Not found in ROM DB, examining header\n"); | 861 debug_message("Not found in ROM DB, examining header\n"); |
862 if (xband_detect(rom, rom_size)) { | 862 if (xband_detect(rom, rom_size)) { |
863 return xband_configure_rom(rom_db, rom, rom_size, lock_on, lock_on_size, base_map, base_chunks); | 863 return xband_configure_rom(rom_db, rom, rom_size, lock_on, lock_on_size, base_map, base_chunks); |
864 } | 864 } |
865 if (realtec_detect(rom, rom_size)) { | 865 if (realtec_detect(rom, rom_size)) { |
866 return realtec_configure_rom(rom, rom_size, base_map, base_chunks); | 866 return realtec_configure_rom(rom, rom_size, base_map, base_chunks); |
869 } | 869 } |
870 rom_info info; | 870 rom_info info; |
871 info.mapper_type = MAPPER_NONE; | 871 info.mapper_type = MAPPER_NONE; |
872 info.name = tern_find_ptr(entry, "name"); | 872 info.name = tern_find_ptr(entry, "name"); |
873 if (info.name) { | 873 if (info.name) { |
874 printf("Found name: %s\n", info.name); | 874 debug_message("Found name: %s\n", info.name); |
875 info.name = strdup(info.name); | 875 info.name = strdup(info.name); |
876 } else { | 876 } else { |
877 info.name = get_header_name(rom); | 877 info.name = get_header_name(rom); |
878 } | 878 } |
879 | 879 |