src/mess/devices/cartslot.c
| r2786 | r2787 | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | | static int load_cartridge(const rom_entry *romrgn, const rom_entry *roment, const device_config *image) |
| 33 | static int load_cartridge(running_machine *machine, const rom_entry *romrgn, const rom_entry *roment, const device_config *image) |
| 34 | 34 | { |
| 35 | 35 | UINT32 region, flags; |
| 36 | 36 | offs_t offset, length, read_length, pos = 0, len; |
| r2786 | r2787 | |
| 127 | 127 | parse_rom_name(roment, &position, NULL); |
| 128 | 128 | if (position == image_index_in_device(image)) |
| 129 | 129 | { |
| 130 | | result = load_cartridge(romrgn, roment, file); |
| 130 | result = load_cartridge(image->machine, romrgn, roment, file); |
| 131 | 131 | if (!result) |
| 132 | 132 | return result; |
| 133 | 133 | } |
src/mess/machine/gamecom.c
| r2786 | r2787 | |
| 60 | 60 | //static const int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 }; |
| 61 | 61 | static const int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }; |
| 62 | 62 | |
| 63 | | static void gamecom_dma_init(void); |
| 63 | static void gamecom_dma_init(running_machine *machine); |
| 64 | 64 | |
| 65 | 65 | static TIMER_CALLBACK(gamecom_clock_timer_callback) |
| 66 | 66 | { |
| r2786 | r2787 | |
| 94 | 94 | gamecom_internal_w( machine, SM8521_WDTC, 0x38 ); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | | static void gamecom_set_mmu( int mmu, UINT8 data ) { |
| 97 | static void gamecom_set_mmu( running_machine *machine, int mmu, UINT8 data ) { |
| 98 | 98 | if ( data < 32 ) { |
| 99 | 99 | /* select internal ROM bank */ |
| 100 | 100 | memory_set_bankptr( mmu, memory_region(REGION_USER1) + (data << 13) ); |
| r2786 | r2787 | |
| 237 | 237 | default: cartridge = NULL; break; |
| 238 | 238 | } |
| 239 | 239 | /* update banks to reflect possible change of cartridge slot */ |
| 240 | | gamecom_set_mmu( 1, internal_registers[SM8521_MMU1] ); |
| 241 | | gamecom_set_mmu( 2, internal_registers[SM8521_MMU2] ); |
| 242 | | gamecom_set_mmu( 3, internal_registers[SM8521_MMU3] ); |
| 243 | | gamecom_set_mmu( 4, internal_registers[SM8521_MMU4] ); |
| 240 | gamecom_set_mmu( machine, 1, internal_registers[SM8521_MMU1] ); |
| 241 | gamecom_set_mmu( machine, 2, internal_registers[SM8521_MMU2] ); |
| 242 | gamecom_set_mmu( machine, 3, internal_registers[SM8521_MMU3] ); |
| 243 | gamecom_set_mmu( machine, 4, internal_registers[SM8521_MMU4] ); |
| 244 | 244 | return; |
| 245 | 245 | case SM8521_SYS: cpunum_set_reg( 0, SM8500_SYS, data ); return; |
| 246 | 246 | case SM8521_CKC: cpunum_set_reg( 0, SM8500_CKC, data ); return; |
| r2786 | r2787 | |
| 256 | 256 | logerror( "Write to MMU0\n" ); |
| 257 | 257 | break; |
| 258 | 258 | case SM8521_MMU1: |
| 259 | | gamecom_set_mmu( 1, data ); |
| 259 | gamecom_set_mmu( machine, 1, data ); |
| 260 | 260 | break; |
| 261 | 261 | case SM8521_MMU2: |
| 262 | | gamecom_set_mmu( 2, data ); |
| 262 | gamecom_set_mmu( machine, 2, data ); |
| 263 | 263 | break; |
| 264 | 264 | case SM8521_MMU3: |
| 265 | | gamecom_set_mmu( 3, data ); |
| 265 | gamecom_set_mmu( machine, 3, data ); |
| 266 | 266 | break; |
| 267 | 267 | case SM8521_MMU4: |
| 268 | | gamecom_set_mmu( 4, data ); |
| 268 | gamecom_set_mmu( machine, 4, data ); |
| 269 | 269 | break; |
| 270 | 270 | |
| 271 | 271 | /* Video hardware and DMA */ |
| r2786 | r2787 | |
| 283 | 283 | gamecom_dma.decrement_y = data & 0x10; |
| 284 | 284 | gamecom_dma.enabled = data & 0x80; |
| 285 | 285 | if ( gamecom_dma.enabled ) { |
| 286 | | gamecom_dma_init(); |
| 286 | gamecom_dma_init(machine); |
| 287 | 287 | } |
| 288 | 288 | break; |
| 289 | 289 | case SM8521_DMX1: |
| r2786 | r2787 | |
| 407 | 407 | |
| 408 | 408 | /* The manual is not conclusive as to which bit of the DMVP register (offset 0x3D) determines |
| 409 | 409 | which page for source or destination is used */ |
| 410 | | static void gamecom_dma_init(void) { |
| 410 | static void gamecom_dma_init(running_machine *machine) { |
| 411 | 411 | if ( gamecom_dma.decrement_x || gamecom_dma.decrement_y ) { |
| 412 | 412 | logerror( "TODO: Decrement-x and decrement-y are not supported yet\n" ); |
| 413 | 413 | } |
src/mess/machine/trs80.c
| r2786 | r2787 | |
| 69 | 69 | static int get_cycles = 0; /* cycle count at last input port read */ |
| 70 | 70 | |
| 71 | 71 | static void tape_put_byte(UINT8 value); |
| 72 | | static void tape_get_open(void); |
| 72 | static void tape_get_open(running_machine *machine); |
| 73 | 73 | static void tape_put_close(running_machine *machine); |
| 74 | 74 | |
| 75 | 75 | #define FW TRS80_FONT_W |
| r2786 | r2787 | |
| 431 | 431 | tape_put_file = 0; |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | | static void tape_get_byte(void) |
| 434 | static void tape_get_byte(running_machine *machine) |
| 435 | 435 | { |
| 436 | 436 | int count; |
| 437 | 437 | UINT8 value; |
| r2786 | r2787 | |
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | | static void tape_get_open(void) |
| 461 | static void tape_get_open(running_machine *machine) |
| 462 | 462 | { |
| 463 | 463 | /* TODO: remove this */ |
| 464 | 464 | unsigned char *RAM = memory_region(REGION_CPU1); |
| r2786 | r2787 | |
| 609 | 609 | /* need to read get new data ? */ |
| 610 | 610 | if (--get_bit_count <= 0) |
| 611 | 611 | { |
| 612 | | tape_get_open(); |
| 613 | | tape_get_byte(); |
| 612 | tape_get_open(machine); |
| 613 | tape_get_byte(machine); |
| 614 | 614 | } |
| 615 | 615 | /* shift next sync or data bit to bit 16 */ |
| 616 | 616 | tape_bits <<= 1; |