src/mess/machine/lynx.c
| r13204 | r13205 | |
| 8 | 8 | #include "hashfile.h" |
| 9 | 9 | #include "imagedev/cartslot.h" |
| 10 | 10 | #include "hash.h" |
| 11 | | #include "rendutil.h" |
| 12 | 11 | |
| 13 | 12 | |
| 14 | 13 | |
| r13204 | r13205 | |
| 1816 | 1815 | machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(lynx_reset),&machine)); |
| 1817 | 1816 | |
| 1818 | 1817 | for (i = 0; i < NR_LYNX_TIMERS; i++) |
| 1819 | | lynx_timer_init(machine, i); |
| 1818 | lynx_timer_init(machine, i); |
| 1819 | } |
| 1820 | 1820 | |
| 1821 | MACHINE_RESET( lynx ) |
| 1822 | { |
| 1823 | lynx_state *state = machine.driver_data<lynx_state>(); |
| 1824 | render_target *target = machine.render().first_target(); |
| 1825 | target->set_view(state->m_rotate0); |
| 1821 | 1826 | } |
| 1822 | 1827 | |
| 1823 | | |
| 1824 | 1828 | /**************************************** |
| 1825 | 1829 | |
| 1826 | 1830 | Image handling |
| r13204 | r13205 | |
| 1866 | 1870 | |
| 1867 | 1871 | void lynx_crc_keyword(device_image_interface &image) |
| 1868 | 1872 | { |
| 1873 | lynx_state *state = image.device().machine().driver_data<lynx_state>(); |
| 1869 | 1874 | const char *info = NULL; |
| 1870 | 1875 | |
| 1871 | 1876 | info = hashfile_extrainfo(image); |
| 1872 | 1877 | |
| 1873 | | render_target *target = image.device().machine().render().first_target(); |
| 1874 | | target->set_orientation(ROT0); |
| 1878 | state->m_rotate0 = 0; |
| 1875 | 1879 | if (info) |
| 1876 | 1880 | { |
| 1877 | 1881 | if(strcmp(info, "ROTATE90DEGREE") == 0) |
| 1878 | | target->set_orientation(ROT90); |
| 1882 | state->m_rotate0 = 1; |
| 1879 | 1883 | else if (strcmp(info, "ROTATE270DEGREE") == 0) |
| 1880 | | target->set_orientation(ROT270); |
| 1884 | state->m_rotate0 = 2; |
| 1881 | 1885 | } |
| 1882 | 1886 | } |
| 1883 | 1887 | |
| r13204 | r13205 | |
| 1954 | 1958 | memcpy(rom, image.get_software_region("rom"), size); |
| 1955 | 1959 | |
| 1956 | 1960 | const char *rotate = image.get_feature("rotation"); |
| 1957 | | render_target *target = image.device().machine().render().first_target(); |
| 1958 | | int tmpint = ROT0; |
| 1961 | state->m_rotate0 = 0; |
| 1959 | 1962 | if (rotate) |
| 1960 | 1963 | { |
| 1961 | 1964 | if(strcmp(rotate, "RIGHT") == 0) { |
| 1962 | | tmpint = ROT90; |
| 1965 | state->m_rotate0 = 1; |
| 1963 | 1966 | } |
| 1964 | 1967 | else if (strcmp(rotate, "LEFT") == 0) { |
| 1965 | | tmpint = ROT270; |
| 1968 | state->m_rotate0 = 2; |
| 1966 | 1969 | } |
| 1967 | 1970 | } |
| 1968 | | target->set_orientation(tmpint); |
| 1969 | 1971 | |
| 1970 | | // apply the opposite orientation to the UI |
| 1971 | | if (target->is_ui_target()) |
| 1972 | | { |
| 1973 | | render_container::user_settings settings; |
| 1974 | | render_container &ui_container = image.device().machine().render().ui_container(); |
| 1975 | | |
| 1976 | | ui_container.get_user_settings(settings); |
| 1977 | | settings.m_orientation = orientation_add(orientation_reverse(tmpint), settings.m_orientation); |
| 1978 | | ui_container.set_user_settings(settings); |
| 1979 | | } |
| 1980 | | |
| 1981 | 1972 | } |
| 1982 | 1973 | |
| 1983 | 1974 | return IMAGE_INIT_PASS; |
| 1984 | 1975 | } |
| 1985 | 1976 | |
| 1986 | | static DEVICE_IMAGE_UNLOAD( lynx_cart ) |
| 1987 | | { |
| 1988 | | render_target *target = image.device().machine().render().first_target(); |
| 1989 | | target->set_orientation(ROT0); |
| 1990 | | } |
| 1991 | | |
| 1992 | 1977 | MACHINE_CONFIG_FRAGMENT(lynx_cartslot) |
| 1993 | 1978 | MCFG_CARTSLOT_ADD("cart") |
| 1994 | 1979 | MCFG_CARTSLOT_EXTENSION_LIST("lnx,lyx") |
| 1995 | 1980 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1996 | 1981 | MCFG_CARTSLOT_INTERFACE("lynx_cart") |
| 1997 | 1982 | MCFG_CARTSLOT_LOAD(lynx_cart) |
| 1998 | | MCFG_CARTSLOT_UNLOAD(lynx_cart) |
| 1999 | 1983 | MCFG_CARTSLOT_PARTIALHASH(lynx_partialhash) |
| 2000 | 1984 | |
| 2001 | 1985 | /* Software lists */ |
src/mess/drivers/lynx.c
| r13204 | r13205 | |
| 11 | 11 | #include "includes/lynx.h" |
| 12 | 12 | |
| 13 | 13 | #include "imagedev/snapquik.h" |
| 14 | #include "lynx.lh" |
| 14 | 15 | |
| 15 | 16 | static QUICKLOAD_LOAD( lynx ); |
| 16 | 17 | |
| r13204 | r13205 | |
| 61 | 62 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 62 | 63 | |
| 63 | 64 | MCFG_MACHINE_START( lynx ) |
| 65 | MCFG_MACHINE_RESET( lynx ) |
| 64 | 66 | |
| 65 | 67 | /* video hardware */ |
| 66 | 68 | MCFG_SCREEN_ADD("screen", LCD) |
| r13204 | r13205 | |
| 71 | 73 | MCFG_SCREEN_SIZE(160, 160) |
| 72 | 74 | MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 102-1) |
| 73 | 75 | MCFG_SCREEN_UPDATE( generic_bitmapped ) |
| 76 | MCFG_DEFAULT_LAYOUT(layout_lynx) |
| 74 | 77 | |
| 75 | 78 | MCFG_PALETTE_LENGTH(0x1000) |
| 76 | 79 | MCFG_PALETTE_INIT( lynx ) |