Previous 15994 Revisions Next

r8245 Monday 7th June, 2010 at 22:56:46 UTC by Michael Zapf
Special addresses of CFI commands need to be masked to A14-A0
[src/mess/machine]at29040.c

src/mess/machine/at29040.c
r8244r8245
269269}
270270
271271/*
272    write a byte to FEEPROM
272    Write a byte to FEEPROM
273273*/
274274void at29c040a_w(int id, offs_t offset, UINT8 data)
275275{
276276   offset &= ADDRESS_MASK;
277
277   
278   /* The special CFI commands assume a smaller address space according */
279   /* to the specification ("address format A14-A0") */
280   offs_t cfi_offset = offset & 0x7fff;
281   
278282   if (at29c040a[id].s_enabling_bbl)
279283   {
280284      at29c040a[id].s_enabling_bbl = FALSE;
r8244r8245
296300   switch (at29c040a[id].s_cmd)
297301   {
298302   case s_cmd_0:
299      if ((offset == 0x5555) && (data == 0xaa))
303      if ((cfi_offset == 0x5555) && (data == 0xaa))
300304         at29c040a[id].s_cmd = s_cmd_1;
301305      else
302306      {
r8244r8245
306310      break;
307311
308312   case s_cmd_1:
309      if ((offset == 0x2aaa) && (data == 0x55))
313      if ((cfi_offset == 0x2aaa) && (data == 0x55))
310314         at29c040a[id].s_cmd = s_cmd_2;
311315      else
312316      {
r8244r8245
316320      break;
317321
318322   case s_cmd_2:
319      if (offset == 0x5555)
323      if (cfi_offset == 0x5555)
320324      {
321325         /* exit programming mode */
322326         at29c040a[id].s_pgm = s_pgm_0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team