diff options
author | Joakim Sindholt <opensource@zhasha.com> | 2010-04-07 22:42:03 +0200 |
---|---|---|
committer | Joakim Sindholt <opensource@zhasha.com> | 2010-04-07 22:42:03 +0200 |
commit | 269c326f68a517065a16fb5e3a491ef5b34951d9 (patch) | |
tree | 9bfe6336ed1568accb0014bec41b20ae4a2587f6 | |
parent | 09b328ccbfa84bec262ed18d45ef421456da87a8 (diff) |
csexport: show register# where applicable
-rw-r--r-- | src/csexport.c | 8 | ||||
-rw-r--r-- | src/csexport.vala | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/csexport.c b/src/csexport.c index ab623fc..986b7d4 100644 --- a/src/csexport.c +++ b/src/csexport.c @@ -306,7 +306,9 @@ EmulationRegister* emulation_register_iterator_get (EmulationRegisterIterator* s static inline void gui_cs_export_print_dest_reg (GUICSExport* self, FILE* fs, gchar nextpkg, gchar nextdw, gchar nextreg, EmulationRegister* reg, guint32 dword); GType emulation_register_info_get_type (void); EmulationRegisterInfo* emulation_register_get_info (EmulationRegister* self); +guint emulation_register_info_get_count (EmulationRegisterInfo* self); const char* emulation_register_info_get_name (EmulationRegisterInfo* self); +guint emulation_register_get_num (EmulationRegister* self); guint emulation_register_info_get_length (EmulationRegisterInfo* self); gpointer emulation_bitfield_iterator_ref (gpointer instance); void emulation_bitfield_iterator_unref (gpointer instance); @@ -768,7 +770,11 @@ static inline void gui_cs_export_print_dest_reg (GUICSExport* self, FILE* fs, gc g_return_if_fail (self != NULL); g_return_if_fail (fs != NULL); g_return_if_fail (reg != NULL); - fprintf (fs, "%c %c +-+- %s\n", (gint) nextpkg, (gint) nextdw, emulation_register_info_get_name (emulation_register_get_info (reg))); + if (emulation_register_info_get_count (emulation_register_get_info (reg)) == 1) { + fprintf (fs, "%c %c +-+- %s\n", (gint) nextpkg, (gint) nextdw, emulation_register_info_get_name (emulation_register_get_info (reg))); + } else { + fprintf (fs, "%c %c +-+- %s[%u]\n", (gint) nextpkg, (gint) nextdw, emulation_register_info_get_name (emulation_register_get_info (reg)), emulation_register_get_num (reg)); + } length = emulation_register_info_get_length (emulation_register_get_info (reg)); i = (guint) 0; { diff --git a/src/csexport.vala b/src/csexport.vala index 5da3f58..d11f087 100644 --- a/src/csexport.vala +++ b/src/csexport.vala @@ -541,7 +541,11 @@ namespace GUI private inline void print_dest_reg(FileStream fs, char nextpkg, char nextdw, char nextreg, Register reg, uint32 dword) { - fs.printf("%c %c +-+- %s\n", nextpkg, nextdw, reg.info.name); + if (reg.info.count == 1) { + fs.printf("%c %c +-+- %s\n", nextpkg, nextdw, reg.info.name); + } else { + fs.printf("%c %c +-+- %s[%u]\n", nextpkg, nextdw, reg.info.name, reg.num); + } uint length = reg.info.length; uint i = 0; |