src/mess/drivers/avigo.c
| r13111 | r13112 | |
| 55 | 55 | - Found a way to emulate the touchscreen panel out of the screen |
| 56 | 56 | area (the six buttons at the bottom) |
| 57 | 57 | - Alarm doesn't work |
| 58 | | - Add the facility to load app file into flash memory |
| 58 | - Load app files causes the NVRAM corruption. |
| 59 | 59 | - Serial communications and IR port. |
| 60 | 60 | |
| 61 | 61 | I don't have any documentation on the hardware, so a lot of this |
| r13111 | r13112 | |
| 813 | 813 | } |
| 814 | 814 | } |
| 815 | 815 | |
| 816 | |
| 817 | static 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 | |
| 816 | 863 | static MACHINE_CONFIG_START( avigo, avigo_state ) |
| 817 | 864 | /* basic machine hardware */ |
| 818 | 865 | MCFG_CPU_ADD("maincpu", Z80, 4000000) |
| r13111 | r13112 | |
| 859 | 906 | |
| 860 | 907 | // IRQ 4 is generated every second, used for auto power off |
| 861 | 908 | MCFG_TIMER_ADD_PERIODIC("1hz_timer", avigo_1hz_timer, attotime::from_hz(1)) |
| 909 | |
| 910 | /* quickload */ |
| 911 | MCFG_QUICKLOAD_ADD("quickload", avigo, "app", 0) |
| 862 | 912 | MACHINE_CONFIG_END |
| 863 | 913 | |
| 864 | 914 | |