trunk/src/mess/drivers/lynx.c
| r32369 | r32370 | |
| 11 | 11 | #include "audio/lynx.h" |
| 12 | 12 | #include "includes/lynx.h" |
| 13 | 13 | |
| 14 | | #include "imagedev/snapquik.h" |
| 15 | 14 | #include "lynx.lh" |
| 16 | 15 | |
| 17 | 16 | static ADDRESS_MAP_START( lynx_mem , AS_PROGRAM, 8, lynx_state ) |
| r32369 | r32370 | |
| 70 | 69 | lynx_timer_count_down(1); |
| 71 | 70 | } |
| 72 | 71 | |
| 73 | | |
| 74 | 72 | static MACHINE_CONFIG_START( lynx, lynx_state ) |
| 75 | 73 | /* basic machine hardware */ |
| 76 | 74 | MCFG_CPU_ADD("maincpu", M65SC02, 4000000) /* vti core, integrated in vlsi, stz, but not bbr bbs */ |
| 77 | 75 | MCFG_CPU_PROGRAM_MAP(lynx_mem) |
| 78 | 76 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 79 | 77 | |
| 80 | | |
| 81 | 78 | /* video hardware */ |
| 82 | 79 | MCFG_SCREEN_ADD("screen", LCD) |
| 83 | 80 | MCFG_SCREEN_REFRESH_RATE(LCD_FRAMES_PER_SECOND) |
| r32369 | r32370 | |
| 100 | 97 | /* devices */ |
| 101 | 98 | MCFG_QUICKLOAD_ADD("quickload", lynx_state, lynx, "o", 0) |
| 102 | 99 | |
| 103 | | MCFG_FRAGMENT_ADD(lynx_cartslot) |
| 100 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "lynx_cart") |
| 101 | MCFG_GENERIC_EXTENSIONS("lnx,lyx") |
| 102 | MCFG_GENERIC_MANDATORY |
| 103 | MCFG_GENERIC_LOAD(lynx_state, lynx_cart) |
| 104 | |
| 105 | /* Software lists */ |
| 106 | MCFG_SOFTWARE_LIST_ADD("cart_list","lynx") |
| 104 | 107 | MACHINE_CONFIG_END |
| 105 | 108 | |
| 106 | 109 | #if 0 |
| r32369 | r32370 | |
| 131 | 134 | ROMX_LOAD( "lynxa.bin", 0x00000, 0x200, BAD_DUMP CRC(0d973c9d) SHA1(e4ed47fae31693e016b081c6bda48da5b70d7ccb), ROM_BIOS(2)) |
| 132 | 135 | |
| 133 | 136 | ROM_REGION(0x100,"gfx1", ROMREGION_ERASE00) |
| 134 | | |
| 135 | | ROM_REGION(0x100000, "user1", ROMREGION_ERASEFF) |
| 136 | 137 | ROM_END |
| 137 | 138 | |
| 138 | 139 | #if 0 |
| r32369 | r32370 | |
| 141 | 142 | ROM_LOAD("lynx2.bin", 0, 0x200, NO_DUMP) |
| 142 | 143 | |
| 143 | 144 | ROM_REGION(0x100,"gfx1", ROMREGION_ERASE00) |
| 144 | | |
| 145 | | ROM_REGION(0x100000, "user1", ROMREGION_ERASEFF) |
| 146 | 145 | ROM_END |
| 147 | 146 | #endif |
| 148 | 147 | |
trunk/src/mess/drivers/astrocde.c
| r32369 | r32370 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "includes/astrocde.h" |
| 13 | #include "machine/ram.h" |
| 13 | 14 | #include "sound/astrocde.h" |
| 14 | | #include "imagedev/cartslot.h" |
| 15 | | #include "machine/ram.h" |
| 15 | #include "bus/generic/slot.h" |
| 16 | #include "bus/generic/carts.h" |
| 16 | 17 | |
| 17 | 18 | class astrocde_mess_state : public astrocde_state |
| 18 | 19 | { |
| 19 | 20 | public: |
| 20 | 21 | astrocde_mess_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | | : astrocde_state(mconfig, type, tag) |
| 22 | : astrocde_state(mconfig, type, tag), |
| 23 | m_cart(*this, "cartslot") |
| 22 | 24 | { } |
| 23 | 25 | |
| 26 | required_device<generic_slot_device> m_cart; |
| 24 | 27 | void get_ram_expansion_settings(int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end); |
| 28 | DECLARE_MACHINE_START(astrocde); |
| 25 | 29 | DECLARE_MACHINE_RESET(astrocde); |
| 26 | 30 | DECLARE_INPUT_CHANGED_MEMBER(set_write_protect); |
| 27 | 31 | }; |
| r32369 | r32370 | |
| 117 | 121 | { |
| 118 | 122 | space.nop_write(expansion_ram_start, expansion_ram_end); |
| 119 | 123 | } |
| 120 | | } |
| 124 | } |
| 121 | 125 | } |
| 122 | 126 | |
| 123 | 127 | /************************************* |
| r32369 | r32370 | |
| 253 | 257 | MCFG_CPU_PROGRAM_MAP(astrocade_mem) |
| 254 | 258 | MCFG_CPU_IO_MAP(astrocade_io) |
| 255 | 259 | |
| 260 | MCFG_MACHINE_START_OVERRIDE(astrocde_mess_state, astrocde) |
| 256 | 261 | MCFG_MACHINE_RESET_OVERRIDE(astrocde_mess_state, astrocde) |
| 257 | 262 | |
| 258 | 263 | /* video hardware */ |
| r32369 | r32370 | |
| 274 | 279 | MCFG_RAM_DEFAULT_SIZE("32k") |
| 275 | 280 | |
| 276 | 281 | /* cartridge */ |
| 277 | | MCFG_CARTSLOT_ADD("cart") |
| 278 | | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 279 | | MCFG_CARTSLOT_INTERFACE("astrocde_cart") |
| 282 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "astrocde_cart") |
| 280 | 283 | |
| 281 | 284 | /* Software lists */ |
| 282 | 285 | MCFG_SOFTWARE_LIST_ADD("cart_list","astrocde") |
| r32369 | r32370 | |
| 292 | 295 | ROM_START( astrocde ) |
| 293 | 296 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 294 | 297 | ROM_LOAD( "astro.bin", 0x0000, 0x2000, CRC(ebc77f3a) SHA1(b902c941997c9d150a560435bf517c6a28137ecc) ) |
| 295 | | ROM_CART_LOAD( "cart", 0x2000, 0x8000, 0 ) |
| 296 | 298 | ROM_END |
| 297 | 299 | |
| 298 | 300 | ROM_START( astrocdl ) |
| 299 | 301 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 300 | 302 | ROM_LOAD( "ballyhlc.bin", 0x0000, 0x2000, CRC(d7c517ba) SHA1(6b2bef5d970e54ed204549f58ba6d197a8bfd3cc) ) |
| 301 | | ROM_CART_LOAD( "cart", 0x2000, 0x8000, 0 ) |
| 302 | 303 | ROM_END |
| 303 | 304 | |
| 304 | 305 | ROM_START( astrocdw ) |
| 305 | 306 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 306 | 307 | ROM_LOAD( "bioswhit.bin", 0x0000, 0x2000, CRC(6eb53e79) SHA1(d84341feec1a0a0e8aa6151b649bc3cf6ef69fbf) ) |
| 307 | | ROM_CART_LOAD( "cart", 0x2000, 0x8000, 0 ) |
| 308 | 308 | ROM_END |
| 309 | 309 | |
| 310 | 310 | /************************************* |
| r32369 | r32370 | |
| 318 | 318 | m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | MACHINE_START_MEMBER(astrocde_mess_state, astrocde) |
| 322 | { |
| 323 | if (m_cart->exists()) |
| 324 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x3fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart)); |
| 325 | } |
| 326 | |
| 321 | 327 | MACHINE_RESET_MEMBER(astrocde_mess_state, astrocde) |
| 322 | 328 | { |
| 323 | 329 | int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0; |
| r32369 | r32370 | |
| 339 | 345 | { |
| 340 | 346 | space.nop_write(expansion_ram_start, expansion_ram_end); |
| 341 | 347 | } |
| 342 | | } |
| 348 | } |
| 343 | 349 | } |
| 344 | 350 | |
| 345 | 351 | void astrocde_mess_state::get_ram_expansion_settings(int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end) |
trunk/src/mess/drivers/vtech2.c
| r32369 | r32370 | |
| 68 | 68 | #include "sound/speaker.h" |
| 69 | 69 | #include "sound/wave.h" |
| 70 | 70 | #include "includes/vtech2.h" |
| 71 | | #include "imagedev/cartslot.h" |
| 72 | 71 | #include "imagedev/cassette.h" |
| 73 | 72 | #include "imagedev/flopdrv.h" |
| 74 | 73 | #include "formats/vt_cas.h" |
| r32369 | r32370 | |
| 416 | 415 | MCFG_CPU_VBLANK_INT_DRIVER("screen", vtech2_state, vtech2_interrupt) |
| 417 | 416 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 418 | 417 | |
| 419 | | |
| 420 | 418 | /* video hardware */ |
| 421 | 419 | MCFG_SCREEN_ADD("screen", RASTER) |
| 422 | 420 | MCFG_SCREEN_REFRESH_RATE(50) |
| r32369 | r32370 | |
| 431 | 429 | MCFG_PALETTE_INDIRECT_ENTRIES(16) |
| 432 | 430 | MCFG_PALETTE_INIT_OWNER(vtech2_state, vtech2) |
| 433 | 431 | |
| 434 | | |
| 435 | 432 | /* sound hardware */ |
| 436 | 433 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 437 | 434 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") |
| r32369 | r32370 | |
| 444 | 441 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 445 | 442 | |
| 446 | 443 | /* cartridge */ |
| 447 | | MCFG_CARTSLOT_ADD("cart") |
| 448 | | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 449 | | MCFG_CARTSLOT_NOT_MANDATORY |
| 450 | | MCFG_CARTSLOT_LOAD(vtech2_state,laser_cart) |
| 451 | | MCFG_CARTSLOT_UNLOAD(vtech2_state,laser_cart) |
| 444 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "vtech_cart") |
| 445 | MCFG_GENERIC_EXTENSIONS("rom,bin") |
| 452 | 446 | |
| 453 | 447 | /* 5.25" Floppy drive */ |
| 454 | 448 | MCFG_LEGACY_FLOPPY_DRIVE_ADD( FLOPPY_0, vtech2_floppy_interface ) |
trunk/src/mess/machine/lynx.c
| r32369 | r32370 | |
| 1018 | 1018 | value = ioport("PAUSE")->read(); |
| 1019 | 1019 | break; |
| 1020 | 1020 | case RCART: |
| 1021 | | value = *(memregion("user1")->base() + (m_suzy.high * m_granularity) + m_suzy.low); |
| 1021 | if (m_cart->exists()) |
| 1022 | value = m_cart->read_rom(space, (m_suzy.high * m_granularity) + m_suzy.low); |
| 1023 | else |
| 1024 | value = 0; |
| 1022 | 1025 | m_suzy.low = (m_suzy.low + 1) & (m_granularity - 1); |
| 1023 | 1026 | break; |
| 1024 | 1027 | //case RCART_BANK1: /* we need bank 1 emulation!!! */ |
| r32369 | r32370 | |
| 2026 | 2029 | |
| 2027 | 2030 | ****************************************/ |
| 2028 | 2031 | |
| 2029 | | |
| 2030 | | static void lynx_partialhash(hash_collection &dest, const unsigned char *data, |
| 2031 | | unsigned long length, const char *functions) |
| 2032 | | { |
| 2033 | | if (length <= 64) |
| 2034 | | return; |
| 2035 | | dest.compute(&data[64], length - 64, functions); |
| 2036 | | } |
| 2037 | | |
| 2038 | 2032 | int lynx_state::lynx_verify_cart (char *header, int kind) |
| 2039 | 2033 | { |
| 2040 | 2034 | if (kind) |
| r32369 | r32370 | |
| 2047 | 2041 | } |
| 2048 | 2042 | else |
| 2049 | 2043 | { |
| 2050 | | if (strncmp("LYNX",&header[0],4)) |
| 2044 | if (strncmp("LYNX", &header[0], 4)) |
| 2051 | 2045 | { |
| 2052 | 2046 | if (!strncmp("BS93", &header[6], 4)) |
| 2053 | 2047 | { |
| r32369 | r32370 | |
| 2068 | 2062 | /* Lynx carts have 19 address lines, the upper 8 used for bank select. The lower |
| 2069 | 2063 | 11 bits are used to address data within the selected bank. Valid bank sizes are 256, |
| 2070 | 2064 | 512, 1024 or 2048 bytes. Commercial roms use all 256 banks.*/ |
| 2065 | UINT32 size = m_cart->common_get_size("rom"); |
| 2066 | UINT16 gran = 0; |
| 2071 | 2067 | |
| 2072 | | UINT8 *rom = memregion("user1")->base(); |
| 2073 | | UINT32 size; |
| 2074 | | UINT8 header[0x40]; |
| 2075 | | |
| 2076 | 2068 | if (image.software_entry() == NULL) |
| 2077 | 2069 | { |
| 2078 | | const char *filetype; |
| 2079 | | size = image.length(); |
| 2080 | | /* 64 byte header |
| 2081 | | LYNX |
| 2082 | | intelword lower counter size |
| 2083 | | 0 0 1 0 |
| 2084 | | 32 chars name |
| 2085 | | 22 chars manufacturer |
| 2086 | | */ |
| 2087 | | |
| 2088 | | filetype = image.filetype(); |
| 2089 | | |
| 2090 | | if (!core_stricmp (filetype, "lnx")) |
| 2070 | // check for lnx header |
| 2071 | const char *filetype = image.filetype(); |
| 2072 | if (!core_stricmp(filetype, "lnx")) |
| 2091 | 2073 | { |
| 2092 | | if (image.fread( header, 0x40) != 0x40) |
| 2093 | | return IMAGE_INIT_FAIL; |
| 2094 | | |
| 2095 | | /* Check the image */ |
| 2074 | // 64 byte header |
| 2075 | // LYNX |
| 2076 | // intelword lower counter size |
| 2077 | // 0 0 1 0 |
| 2078 | // 32 chars name |
| 2079 | // 22 chars manufacturer |
| 2080 | UINT8 header[0x40]; |
| 2081 | image.fread(header, 0x40); |
| 2082 | |
| 2083 | // Check the image |
| 2096 | 2084 | if (lynx_verify_cart((char*)header, LYNX_CART) == IMAGE_VERIFY_FAIL) |
| 2097 | 2085 | return IMAGE_INIT_FAIL; |
| 2098 | | |
| 2086 | |
| 2099 | 2087 | /* 2008-10 FP: According to Handy source these should be page_size_bank0. Are we using |
| 2100 | | it correctly in MESS? Moreover, the next two values should be page_size_bank1. We should |
| 2101 | | implement this as well */ |
| 2102 | | m_granularity = header[4] | (header[5] << 8); |
| 2103 | | |
| 2104 | | logerror ("%s %dkb cartridge with %dbyte granularity from %s\n", |
| 2105 | | header + 10, size / 1024, m_granularity, header + 42); |
| 2106 | | |
| 2088 | it correctly in MESS? Moreover, the next two values should be page_size_bank1. We should |
| 2089 | implement this as well */ |
| 2090 | gran = header[4] | (header[5] << 8); |
| 2091 | |
| 2092 | logerror ("%s %dkb cartridge with %dbyte granularity from %s\n", header + 10, size / 1024, gran, header + 42); |
| 2107 | 2093 | size -= 0x40; |
| 2108 | 2094 | } |
| 2109 | | else if (!core_stricmp (filetype, "lyx")) |
| 2095 | } |
| 2096 | |
| 2097 | m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); |
| 2098 | m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); |
| 2099 | |
| 2100 | // set-up granularity |
| 2101 | if (image.software_entry() == NULL) |
| 2102 | { |
| 2103 | const char *filetype = image.filetype(); |
| 2104 | if (!core_stricmp(filetype, "lnx")) // from header |
| 2105 | m_granularity = gran; |
| 2106 | else if (!core_stricmp(filetype, "lyx")) |
| 2110 | 2107 | { |
| 2111 | 2108 | /* 2008-10 FP: FIXME: .lyx file don't have an header, hence they miss "lynx_granularity" |
| 2112 | 2109 | (see above). What if bank 0 has to be loaded elsewhere? And what about bank 1? |
| r32369 | r32370 | |
| 2118 | 2115 | else |
| 2119 | 2116 | m_granularity = 0x0400; |
| 2120 | 2117 | } |
| 2121 | | |
| 2122 | | if (image.fread( rom, size) != size) |
| 2123 | | return IMAGE_INIT_FAIL; |
| 2124 | 2118 | } |
| 2125 | 2119 | else |
| 2126 | 2120 | { |
| 2127 | | size = image.get_software_region_length("rom"); |
| 2128 | 2121 | if (size > 0xffff) // 64,128,256,512k cartridges |
| 2129 | | m_granularity = size >> 8; |
| 2122 | m_granularity = size >> 8; |
| 2130 | 2123 | else |
| 2131 | | m_granularity = 0x400; // Homebrew roms not using all 256 banks (T-Tris) (none currently in softlist) |
| 2132 | | |
| 2133 | | memcpy(rom, image.get_software_region("rom"), size); |
| 2134 | | |
| 2124 | m_granularity = 0x400; // Homebrew roms not using all 256 banks (T-Tris) (none currently in softlist) |
| 2125 | } |
| 2126 | |
| 2127 | // set-up rotation from softlist |
| 2128 | if (image.software_entry() != NULL) |
| 2129 | { |
| 2135 | 2130 | const char *rotate = image.get_feature("rotation"); |
| 2136 | 2131 | m_rotate = 0; |
| 2137 | 2132 | if (rotate) |
| 2138 | 2133 | { |
| 2139 | | if(strcmp(rotate, "RIGHT") == 0) { |
| 2134 | if (!core_stricmp(rotate, "RIGHT")) |
| 2140 | 2135 | m_rotate = 1; |
| 2141 | | } |
| 2142 | | else if (strcmp(rotate, "LEFT") == 0) { |
| 2136 | else if (!core_stricmp(rotate, "LEFT")) |
| 2143 | 2137 | m_rotate = 2; |
| 2144 | | } |
| 2145 | 2138 | } |
| 2146 | 2139 | |
| 2147 | 2140 | } |
| r32369 | r32370 | |
| 2149 | 2142 | return IMAGE_INIT_PASS; |
| 2150 | 2143 | } |
| 2151 | 2144 | |
| 2152 | | MACHINE_CONFIG_FRAGMENT(lynx_cartslot) |
| 2153 | | MCFG_CARTSLOT_ADD("cart") |
| 2154 | | MCFG_CARTSLOT_EXTENSION_LIST("lnx,lyx") |
| 2155 | | MCFG_CARTSLOT_MANDATORY |
| 2156 | | MCFG_CARTSLOT_INTERFACE("lynx_cart") |
| 2157 | | MCFG_CARTSLOT_LOAD(lynx_state, lynx_cart) |
| 2158 | | MCFG_CARTSLOT_PARTIALHASH(lynx_partialhash) |
| 2159 | | |
| 2160 | | /* Software lists */ |
| 2161 | | MCFG_SOFTWARE_LIST_ADD("cart_list","lynx") |
| 2162 | | MACHINE_CONFIG_END |
trunk/src/mess/machine/vtech2.c
| r32369 | r32370 | |
| 71 | 71 | |
| 72 | 72 | m_laser_latch = -1; |
| 73 | 73 | m_mem = memregion("maincpu")->base(); |
| 74 | | |
| 74 | |
| 75 | // check ROM expansion |
| 76 | astring region_tag; |
| 77 | m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); |
| 78 | |
| 75 | 79 | for (i = 0; i < ARRAY_LENGTH(m_laser_bank); i++) |
| 76 | 80 | m_laser_bank[i] = -1; |
| 77 | 81 | } |
| r32369 | r32370 | |
| 80 | 84 | |
| 81 | 85 | void vtech2_state::laser_machine_init(int bank_mask, int video_mask) |
| 82 | 86 | { |
| 83 | | int i; |
| 84 | | |
| 85 | 87 | m_laser_bank_mask = bank_mask; |
| 86 | 88 | m_laser_video_bank = video_mask; |
| 87 | 89 | m_videoram = m_mem + m_laser_video_bank * 0x04000; |
| 88 | 90 | logerror("laser_machine_init(): bank mask $%04X, video %d [$%05X]\n", m_laser_bank_mask, m_laser_video_bank, m_laser_video_bank * 0x04000); |
| 89 | | |
| 90 | | for (i = 0; i < ARRAY_LENGTH(m_laser_bank); i++) |
| 91 | |
| 92 | for (int i = 0; i < ARRAY_LENGTH(m_laser_bank); i++) |
| 91 | 93 | laser_bank_select_w(m_maincpu->space(AS_PROGRAM), i, 0); |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | void vtech2_state::machine_reset() |
| 95 | 97 | { |
| 96 | 98 | /* banks 0 to 3 only, optional ROM extension */ |
| 97 | | laser_machine_init(0xf00f, 3); |
| 99 | laser_machine_init(0x00f, 3); |
| 98 | 100 | } |
| 99 | 101 | |
| 100 | 102 | MACHINE_RESET_MEMBER(vtech2_state,laser500) |
| 101 | 103 | { |
| 102 | | /* banks 0 to 2, and 4-7 only , optional ROM extension */ |
| 103 | | laser_machine_init(0xf0f7, 7); |
| 104 | /* banks 0 to 2, and 4-7 only, optional ROM extension */ |
| 105 | laser_machine_init(0x0f7, 7); |
| 104 | 106 | } |
| 105 | 107 | |
| 106 | 108 | MACHINE_RESET_MEMBER(vtech2_state,laser700) |
| 107 | 109 | { |
| 108 | 110 | /* all banks except #3 */ |
| 109 | | laser_machine_init(0xfff7, 7); |
| 111 | laser_machine_init(0xff7, 7); |
| 110 | 112 | } |
| 111 | 113 | |
| 112 | 114 | |
| r32369 | r32370 | |
| 150 | 152 | } |
| 151 | 153 | else |
| 152 | 154 | { |
| 153 | | sprintf(bank,"bank%d",offset+1); |
| 154 | | membank(bank)->set_base(&m_mem[0x4000*m_laser_bank[offset]]); |
| 155 | | if( m_laser_bank_mask & (1 << data) ) |
| 155 | sprintf(bank, "bank%d", offset + 1); |
| 156 | if (data >= 12 && m_cart_rom && (m_cart_rom->bytes() > (data % 12) * 0x4000)) // Expansion ROM banks |
| 156 | 157 | { |
| 157 | | /* video RAM bank selected? */ |
| 158 | | if( data == m_laser_video_bank ) |
| 159 | | { |
| 160 | | logerror("select bank #%d VIDEO!\n", offset+1); |
| 161 | | } |
| 158 | membank(bank)->set_base(m_cart_rom->base()+ (data % 12) * 0x4000); |
| 162 | 159 | m_maincpu->space(AS_PROGRAM).install_read_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_hard[offset]); |
| 163 | 160 | m_maincpu->space(AS_PROGRAM).install_write_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_hard[offset]); |
| 161 | } |
| 162 | else if (data < 12 && (m_laser_bank_mask & (1 << data))) // ROM/RAM banks |
| 163 | { |
| 164 | // video RAM bank selected? |
| 165 | if (data == m_laser_video_bank) |
| 166 | logerror("select bank #%d VIDEO!\n", offset + 1); |
| 164 | 167 | |
| 168 | membank(bank)->set_base(&m_mem[0x4000 * m_laser_bank[offset]]); |
| 169 | m_maincpu->space(AS_PROGRAM).install_read_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_hard[offset]); |
| 170 | m_maincpu->space(AS_PROGRAM).install_write_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_hard[offset]); |
| 165 | 171 | } |
| 166 | 172 | else |
| 167 | 173 | { |
| 168 | | logerror("select bank #%d MASKED!\n", offset+1); |
| 174 | logerror("select bank #%d MASKED!\n", offset + 1); |
| 169 | 175 | m_maincpu->space(AS_PROGRAM).nop_readwrite(offset * 0x4000, offset * 0x4000 + 0x3fff); |
| 170 | | |
| 171 | 176 | } |
| 172 | 177 | } |
| 178 | |
| 173 | 179 | } |
| 174 | 180 | } |
| 175 | 181 | |
| r32369 | r32370 | |
| 300 | 306 | } |
| 301 | 307 | } |
| 302 | 308 | |
| 303 | | DEVICE_IMAGE_LOAD_MEMBER( vtech2_state, laser_cart ) |
| 304 | | { |
| 305 | | int size = 0; |
| 306 | 309 | |
| 307 | | size = image.fread(&m_mem[0x30000], 0x10000); |
| 308 | | m_laser_bank_mask &= ~0xf000; |
| 309 | | if( size > 0 ) |
| 310 | | m_laser_bank_mask |= 0x1000; |
| 311 | | if( size > 0x4000 ) |
| 312 | | m_laser_bank_mask |= 0x2000; |
| 313 | | if( size > 0x8000 ) |
| 314 | | m_laser_bank_mask |= 0x4000; |
| 315 | | if( size > 0xc000 ) |
| 316 | | m_laser_bank_mask |= 0x8000; |
| 317 | | |
| 318 | | return size > 0 ? IMAGE_INIT_PASS : IMAGE_INIT_FAIL; |
| 319 | | } |
| 320 | | |
| 321 | | DEVICE_IMAGE_UNLOAD_MEMBER( vtech2_state, laser_cart ) |
| 322 | | { |
| 323 | | m_laser_bank_mask &= ~0xf000; |
| 324 | | /* wipe out the memory contents to be 100% sure */ |
| 325 | | memset(&m_mem[0x30000], 0xff, 0x10000); |
| 326 | | } |
| 327 | | |
| 328 | 310 | device_t *vtech2_state::laser_file() |
| 329 | 311 | { |
| 330 | 312 | return machine().device(m_laser_drive ? FLOPPY_1 : FLOPPY_0); |
trunk/src/mess/includes/vtech2.h
| r32369 | r32370 | |
| 8 | 8 | #define VTECH2_H_ |
| 9 | 9 | #include "sound/speaker.h" |
| 10 | 10 | #include "imagedev/cassette.h" |
| 11 | #include "bus/generic/slot.h" |
| 12 | #include "bus/generic/carts.h" |
| 11 | 13 | |
| 12 | 14 | #define TRKSIZE_FM 3172 /* size of a standard FM mode track */ |
| 13 | 15 | |
| r32369 | r32370 | |
| 19 | 21 | m_maincpu(*this, "maincpu"), |
| 20 | 22 | m_speaker(*this, "speaker"), |
| 21 | 23 | m_cassette(*this, "cassette"), |
| 24 | m_cart(*this, "cartslot"), |
| 22 | 25 | m_gfxdecode(*this, "gfxdecode"), |
| 23 | 26 | m_palette(*this, "palette") { } |
| 24 | 27 | |
| r32369 | r32370 | |
| 65 | 68 | |
| 66 | 69 | int mra_bank(int bank, int offs); |
| 67 | 70 | void mwa_bank(int bank, int offs, int data); |
| 71 | memory_region *m_cart_rom; |
| 68 | 72 | |
| 69 | 73 | DECLARE_WRITE8_MEMBER(mwa_bank1); |
| 70 | 74 | DECLARE_WRITE8_MEMBER(mwa_bank2); |
| r32369 | r32370 | |
| 74 | 78 | DECLARE_READ8_MEMBER(mra_bank2); |
| 75 | 79 | DECLARE_READ8_MEMBER(mra_bank3); |
| 76 | 80 | DECLARE_READ8_MEMBER(mra_bank4); |
| 77 | | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( laser_cart ); |
| 78 | | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( laser_cart ); |
| 79 | 81 | required_device<cpu_device> m_maincpu; |
| 80 | 82 | required_device<speaker_sound_device> m_speaker; |
| 81 | 83 | required_device<cassette_image_device> m_cassette; |
| 84 | required_device<generic_slot_device> m_cart; |
| 82 | 85 | void laser_machine_init(int bank_mask, int video_mask); |
| 83 | 86 | void laser_get_track(); |
| 84 | 87 | void laser_put_track(); |
trunk/src/mess/includes/lynx.h
| r32369 | r32370 | |
| 8 | 8 | #define LYNX_H_ |
| 9 | 9 | |
| 10 | 10 | #include "audio/lynx.h" |
| 11 | | #include "imagedev/cartslot.h" |
| 12 | 11 | #include "imagedev/snapquik.h" |
| 12 | #include "bus/generic/slot.h" |
| 13 | #include "bus/generic/carts.h" |
| 13 | 14 | |
| 14 | 15 | #define LYNX_CART 0 |
| 15 | 16 | #define LYNX_QUICKLOAD 1 |
| r32369 | r32370 | |
| 112 | 113 | m_mem_fffa(*this, "mem_fffa"), |
| 113 | 114 | m_maincpu(*this, "maincpu"), |
| 114 | 115 | m_sound(*this, "custom"), |
| 116 | m_cart(*this, "cartslot"), |
| 115 | 117 | m_palette(*this, "palette") { } |
| 116 | 118 | |
| 117 | 119 | virtual void video_start(); |
| r32369 | r32370 | |
| 125 | 127 | required_shared_ptr<UINT8> m_mem_fffa; |
| 126 | 128 | required_device<cpu_device> m_maincpu; |
| 127 | 129 | required_device<lynx_sound_device> m_sound; |
| 130 | required_device<generic_slot_device> m_cart; |
| 128 | 131 | required_device<palette_device> m_palette; |
| 129 | 132 | UINT16 m_granularity; |
| 130 | 133 | int m_sign_AB; |
| r32369 | r32370 | |
| 184 | 187 | }; |
| 185 | 188 | |
| 186 | 189 | |
| 187 | | /*----------- defined in machine/lynx.c -----------*/ |
| 188 | | |
| 189 | | MACHINE_CONFIG_EXTERN( lynx_cartslot ); |
| 190 | | |
| 191 | 190 | /*---------- suzy registers ------------- */ |
| 192 | 191 | #define TMPADRL 0x00 // Temporary address (not sure what this is used for) |
| 193 | 192 | #define TMPADRH 0x01 |