Previous 15994 Revisions Next

r14512 Saturday 18th February, 2012 at 14:13:02 UTC by Miodrag Milanović
Sync with MAME r15426 (no whatsnew)
[src/lib/util]coretmpl.h
[src/mame/drivers]taitogn.c

src/mame/drivers/taitogn.c
r14511r14512
451451   taitogn_state *state = space->machine().driver_data<taitogn_state>();
452452
453453   if(offset >= 0x140 && offset <= 0x144) {
454      dynamic_buffer key;
454      dynamic_buffer key;   
455
455456      int pos = (offset - 0x140)*2;
456457      UINT8 v, k;
457458      if(ACCESSING_BITS_16_23) {
r14511r14512
459460         pos++;
460461      } else
461462         v = data;
462      get_disk_handle(space->machine(), ":card")->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, key);
463      get_disk_handle(space->machine(), ":drive_0")->read_metadata(HARD_DISK_KEY_METADATA_TAG, 0, key);
463464      k = pos < key.count() ? key[pos] : 0;
464465      if(v == k)
465466         state->m_locked &= ~(1 << pos);
r14511r14512
891892
892893   UINT32 metalength;
893894   memset(state->m_cis, 0xff, 512);
894   if (get_disk_handle(machine, ":card") != NULL)
895      get_disk_handle(machine, ":card")->read_metadata(PCMCIA_CIS_METADATA_TAG, 0, state->m_cis, 512, metalength);
895   if (get_disk_handle(machine, ":drive_0") != NULL)
896      get_disk_handle(machine, ":drive_0")->read_metadata(PCMCIA_CIS_METADATA_TAG, 0, state->m_cis, 512, metalength);
896897}
897898
898899static DRIVER_INIT( coh3002t_mp )
src/lib/util/coretmpl.h
r14511r14512
7676   
7777   // helpers
7878   void append(const _ElementType &element) { if (m_count == m_allocated) expand_internal((m_allocated == 0) ? 16 : (m_allocated << 1), true); m_array[m_count++] = element; }
79   void reset() { delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
79   void reset() { if (m_array) delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
8080   void resize(int count, bool keepdata = false) { if (count > m_allocated) expand_internal(count, keepdata); m_count = count; }
8181
8282private:
r14511r14512
8989      if (keepdata)
9090         for (int index = 0; index < m_count; index++)
9191            newarray[index] = m_array[index];
92      delete[] m_array;
92      if (m_array) delete[] m_array;
9393      m_array = newarray;
9494   }
9595

Previous 15994 Revisions Next


© 1998-2018 The MESS Team