Previous 15994 Revisions Next

r2787 Saturday 31st May, 2008 at 17:43:01 UTC by Nathan Woods
More running_machine* parameter passing
[src/mess/devices]cartslot.c
[src/mess/machine]gamecom.c trs80.c

src/mess/devices/cartslot.c
r2786r2787
3030
3131
3232
33static int load_cartridge(const rom_entry *romrgn, const rom_entry *roment, const device_config *image)
33static int load_cartridge(running_machine *machine, const rom_entry *romrgn, const rom_entry *roment, const device_config *image)
3434{
3535   UINT32 region, flags;
3636   offs_t offset, length, read_length, pos = 0, len;
r2786r2787
127127            parse_rom_name(roment, &position, NULL);
128128            if (position == image_index_in_device(image))
129129            {
130               result = load_cartridge(romrgn, roment, file);
130               result = load_cartridge(image->machine, romrgn, roment, file);
131131               if (!result)
132132                  return result;
133133            }
src/mess/machine/gamecom.c
r2786r2787
6060//static const int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 };
6161static const int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 };
6262
63static void gamecom_dma_init(void);
63static void gamecom_dma_init(running_machine *machine);
6464
6565static TIMER_CALLBACK(gamecom_clock_timer_callback)
6666{
r2786r2787
9494   gamecom_internal_w( machine, SM8521_WDTC, 0x38 );
9595}
9696
97static void gamecom_set_mmu( int mmu, UINT8 data ) {
97static void gamecom_set_mmu( running_machine *machine, int mmu, UINT8 data ) {
9898   if ( data < 32 ) {
9999      /* select internal ROM bank */
100100      memory_set_bankptr( mmu, memory_region(REGION_USER1) + (data << 13) );
r2786r2787
237237            default:   cartridge = NULL;       break;
238238            }
239239            /* 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] );
244244            return;
245245   case SM8521_SYS:   cpunum_set_reg( 0, SM8500_SYS, data ); return;
246246   case SM8521_CKC:   cpunum_set_reg( 0, SM8500_CKC, data ); return;
r2786r2787
256256      logerror( "Write to MMU0\n" );
257257      break;
258258   case SM8521_MMU1:
259      gamecom_set_mmu( 1, data );
259      gamecom_set_mmu( machine, 1, data );
260260      break;
261261   case SM8521_MMU2:
262      gamecom_set_mmu( 2, data );
262      gamecom_set_mmu( machine, 2, data );
263263      break;
264264   case SM8521_MMU3:
265      gamecom_set_mmu( 3, data );
265      gamecom_set_mmu( machine, 3, data );
266266      break;
267267   case SM8521_MMU4:
268      gamecom_set_mmu( 4, data );
268      gamecom_set_mmu( machine, 4, data );
269269      break;
270270
271271   /* Video hardware and DMA */
r2786r2787
283283      gamecom_dma.decrement_y = data & 0x10;
284284      gamecom_dma.enabled = data & 0x80;
285285      if ( gamecom_dma.enabled ) {
286         gamecom_dma_init();
286         gamecom_dma_init(machine);
287287      }
288288      break;
289289   case SM8521_DMX1:
r2786r2787
407407
408408/* The manual is not conclusive as to which bit of the DMVP register (offset 0x3D) determines
409409   which page for source or destination is used */
410static void gamecom_dma_init(void) {
410static void gamecom_dma_init(running_machine *machine) {
411411   if ( gamecom_dma.decrement_x || gamecom_dma.decrement_y ) {
412412      logerror( "TODO: Decrement-x and decrement-y are not supported yet\n" );
413413   }
src/mess/machine/trs80.c
r2786r2787
6969static int get_cycles = 0;      /* cycle count at last input port read */
7070
7171static void tape_put_byte(UINT8 value);
72static void tape_get_open(void);
72static void tape_get_open(running_machine *machine);
7373static void tape_put_close(running_machine *machine);
7474
7575#define FW TRS80_FONT_W
r2786r2787
431431   tape_put_file = 0;
432432}
433433
434static void tape_get_byte(void)
434static void tape_get_byte(running_machine *machine)
435435{
436436   int    count;
437437   UINT8   value;
r2786r2787
458458   }
459459}
460460
461static void tape_get_open(void)
461static void tape_get_open(running_machine *machine)
462462{
463463   /* TODO: remove this */
464464   unsigned char *RAM = memory_region(REGION_CPU1);
r2786r2787
609609            /* need to read get new data ? */
610610            if (--get_bit_count <= 0)
611611            {
612               tape_get_open();
613               tape_get_byte();
612               tape_get_open(machine);
613               tape_get_byte(machine);
614614            }
615615            /* shift next sync or data bit to bit 16 */
616616            tape_bits <<= 1;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team