Previous 15994 Revisions Next

r13112 Tuesday 25th October, 2011 at 20:36:34 UTC by Sandro Ronco
Avigo: added code for load app files. (no whatsnew)
[src/mess/drivers]avigo.c
[src/mess/includes]avigo.h

src/mess/includes/avigo.h
r13111r13112
1313#include "machine/intelfsh.h"
1414#include "sound/speaker.h"
1515#include "machine/ram.h"
16#include "imagedev/snapquik.h"
1617
1718#define AVIGO_NUM_COLOURS 2
1819
src/mess/drivers/avigo.c
r13111r13112
5555         - Found a way to emulate the touchscreen panel out of the screen
5656            area (the six buttons at the bottom)
5757         - Alarm doesn't work
58         - Add the facility to load app file into flash memory
58         - Load app files causes the NVRAM corruption.
5959         - Serial communications and IR port.
6060
6161            I don't have any documentation on the hardware, so a lot of this
r13111r13112
813813   }
814814}
815815
816
817static QUICKLOAD_LOAD(avigo)
818{
819   avigo_state *state = image.device().machine().driver_data<avigo_state>();
820   address_space* flash1 = state->m_flashes[1]->memory().space(0);
821   int app_page;
822
823   // search the first empty page
824   for (app_page = (0x60000>>14) + 1; app_page<0x40; app_page++)
825   {
826      bool empty_page = true;
827
828      for (int offset=0; offset<0x4000; offset++)
829      {
830         if (flash1->read_byte((app_page<<14) + offset) != 0xff)
831         {
832            empty_page = false;
833            break;
834         }
835      }
836
837      if (empty_page)
838         break;
839   }
840
841   // if there is the required free space installs the application
842   if ((app_page + (image.length()>>14)) < 0x40)
843   {
844      logerror("Application loaded at 0x%05x-0x%05x\n", app_page<<14, (app_page<<14) + (UINT32)image.length());
845
846      // copy app file into flash memory
847      image.fread((UINT8*)state->m_flashes[1]->space()->get_read_ptr(app_page<<14), image.length());
848
849      // update the application ID
850      flash1->write_byte((app_page<<14) + 0x1a5, 0x80 + (app_page - 0x18));
851
852      // reset the CPU for allow at the Avigo OS to recognize the installed app
853      state->m_warm_start = 1;
854      state->m_maincpu->reset();
855
856      return IMAGE_INIT_PASS;
857   }
858
859   return IMAGE_INIT_FAIL;
860}
861
862
816863static MACHINE_CONFIG_START( avigo, avigo_state )
817864   /* basic machine hardware */
818865   MCFG_CPU_ADD("maincpu", Z80, 4000000)
r13111r13112
859906
860907   // IRQ 4 is generated every second, used for auto power off
861908   MCFG_TIMER_ADD_PERIODIC("1hz_timer", avigo_1hz_timer, attotime::from_hz(1))
909
910   /* quickload */
911   MCFG_QUICKLOAD_ADD("quickload", avigo, "app", 0)
862912MACHINE_CONFIG_END
863913
864914

Previous 15994 Revisions Next


© 1998-2018 The MESS Team