Previous 15994 Revisions Next

r3769 Monday 8th December, 2008 at 01:36:25 UTC by Firewave
Machine cleanups
[src/mess/drivers]amiga.c lynx.c saturn.c super80.c
[src/mess/machine]atom.c c16.c c64.c cbm.c coco.c lynx.c matsucd.c pet.c tx0.c
[src/mess/video]exidy.c hp48.c m6847.c

src/mess/video/hp48.c
r3768r3769
1313
1414#include "includes/hp48.h"
1515
16#include "deprecat.h"
17
1816/***************************************************************************
1917    DEBUGGING
2018***************************************************************************/
r3768r3769
133131   data >>= 1
134132
135133#define draw_quart               \
136   UINT8 data = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM),  addr );   \
134   UINT8 data = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM),  addr );   \
137135   draw_pixel; draw_pixel; draw_pixel; draw_pixel;
138136
139137
src/mess/video/m6847.c
r3768r3769
16191619static TIMER_CALLBACK(hs_fall)
16201620{
16211621   if (LOG_HS)
1622      logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION));
1622      logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION));
16231623
16241624   set_horizontal_sync();
16251625}
r3768r3769
16271627static TIMER_CALLBACK(hs_rise)
16281628{
16291629   if (LOG_HS)
1630      logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION));
1630      logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION));
16311631
16321632   timer_adjust_oneshot(m6847->hs_rise_timer,
16331633      attotime_make(0, m6847->scanline_period), 0);
r3768r3769
16411641static TIMER_CALLBACK(fs_fall)
16421642{
16431643   if (LOG_FS)
1644      logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION), get_scanline());
1644      logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline());
16451645
16461646   set_field_sync();
16471647}
r3768r3769
16491649static TIMER_CALLBACK(fs_rise)
16501650{
16511651   if (LOG_FS)
1652      logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION), get_scanline());
1652      logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline());
16531653
16541654   /* adjust field sync falling edge timer */
16551655   timer_adjust_oneshot(m6847->fs_fall_timer,
src/mess/video/exidy.c
r3768r3769
88
99#include "driver.h"
1010#include "includes/exidy.h"
11#include "deprecat.h"
1211
1312
1413VIDEO_UPDATE( exidy )
r3768r3769
2827         int ch;
2928
3029         /* get char from z80 address space */
31         ch = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x0f080 + (y<<6) + x) & 0x0ff;
30         ch = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), 0x0f080 + (y<<6) + x) & 0x0ff;
3231
3332         /* prom at 0x0f800, user chars from 0x0fc00 */
3433         char_addr = 0x0f800 | (ch<<3);
r3768r3769
4039
4140            /* read byte of graphics data from z80 memory */
4241            /* either prom or ram */
43            byte = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), char_addr|cheight);
42            byte = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), char_addr|cheight);
4443
4544            px = (x<<3);
4645            py = (y<<3)|cheight;
src/mess/machine/coco.c
r3768r3769
586586   memcpy(pakbase, rambase + 0xC000, 0x3F00);
587587
588588   if (trailer_load)
589      pak_load_trailer(Machine, &trailer);
589      pak_load_trailer(image->machine, &trailer);
590590   return INIT_PASS;
591591}
592592
src/mess/machine/tx0.c
r3768r3769
336336         if (data & 0100)
337337         {
338338            /* read current AC */
339            ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
339            ac = cpu_get_reg(machine->cpu[0], TX0_AC);
340340            /* cycle right */
341341            ac = (ac >> 1) | ((ac & 1) << 17);
342342            /* shuffle and insert data into AC */
343343            ac = (ac /*& 0333333*/) | ((data & 001) << 17) | ((data & 002) << 13) | ((data & 004) << 9) | ((data & 010) << 5) | ((data & 020) << 1) | ((data & 040) >> 3);
344344            /* write modified AC */
345            cpu_set_reg(Machine->cpu[0], TX0_AC, ac);
345            cpu_set_reg(machine->cpu[0], TX0_AC, ac);
346346
347347            tape_reader.rc = (tape_reader.rc+1) & 3;
348348
349349            if (tape_reader.rc == 0)
350350            {   /* IO complete */
351351               tape_reader.rcl = 0;
352               cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
352               cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0);
353353            }
354354         }
355355      }
r3768r3769
367367*/
368368static TIMER_CALLBACK(puncher_callback)
369369{
370   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
370   cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0);
371371}
372372
373373/*
r3768r3769
455455*/
456456static TIMER_CALLBACK(prt_callback)
457457{
458   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
458   cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0);
459459}
460460
461461/*
r3768r3769
481481*/
482482static TIMER_CALLBACK(dis_callback)
483483{
484   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
484   cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0);
485485}
486486
487487/*
r3768r3769
596596      if ((magtape.state == MTS_SELECTED) || ((magtape.state == MTS_SELECTING) && (magtape.command == 2)))
597597      {   /* unit has become unavailable */
598598         magtape.state = MTS_UNSELECTING;
599         cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC);
599         cpu_set_reg(image->machine->cpu[0], TX0_PF, cpu_get_reg(image->machine->cpu[0], TX0_PF) | PF_RWC);
600600         schedule_unselect();
601601      }
602602   }
src/mess/machine/pet.c
r3768r3769
2020#include "devices/cartslot.h"
2121#include "devices/cassette.h"
2222
23#include "deprecat.h"
24
2523#define VERBOSE_LEVEL 0
2624#define DBG_LOG(N,M,A) \
2725   do { \
r3768r3769
555553{
556554   static int level = 0;
557555
558   pia_0_cb1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, level);
556   pia_0_cb1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, level);
559557   level = !level;
560558}
561559
r3768r3769
565563{
566564//   cassette 1
567565   UINT8 data = (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette1" )) > +0.0) ? 1 : 0;
568   pia_0_ca1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, data);
566   pia_0_ca1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, data);
569567}
570568
571569/* NOT WORKING - Just placeholder */
r3768r3769
573571{
574572//   cassette 2
575573   UINT8 data = (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette2" )) > +0.0) ? 1 : 0;
576   via_0_cb1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, data);
574   via_0_cb1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, data);
577575}
578576
579577
src/mess/machine/c16.c
r3768r3769
438438   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read);
439439   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write);
440440
441   c16_select_roms (cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
442   c16_switch_to_rom (cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
441   c16_select_roms (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
442   c16_switch_to_rom (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
443443
444444   if (has_c1551)      /* C1551 */
445445    {
src/mess/machine/matsucd.c
r3768r3769
6868
6969   cd.cdrom = mess_cd_get_cdrom_file( cdrom_device );
7070
71   cd.frame_timer = timer_alloc(Machine, matsu_subcode_proc, NULL);
71   cd.frame_timer = timer_alloc(cdrom_device->machine, matsu_subcode_proc, NULL);
7272
7373   cd.stch_signal = 1;
7474}
src/mess/machine/cbm.c
r3768r3769
2525   UINT32 bytesread;
2626   UINT16 address = 0;
2727   int i;
28   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
28   const address_space *space = cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2929
3030   if (!file_type)
3131      goto error;
src/mess/machine/lynx.c
r3768r3769
99#include "devices/cartslot.h"
1010#include "hash.h"
1111
12#include "deprecat.h"
13
1412static UINT16 lynx_granularity = 1;
1513static int lynx_line;
1614static int lynx_line_y;   
r3768r3769
787785   int i; int o;int colors;
788786
789787   blitter.memory_accesses = 0;
790   blitter.mem = memory_get_read_ptr(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000);
788   blitter.mem = memory_get_read_ptr(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000);
791789
792790   blitter.xoff   = GET_WORD(suzy.data, 0x04);
793791   blitter.yoff   = GET_WORD(suzy.data, 0x06);
src/mess/machine/atom.c
r3768r3769
316316   /* copy data into memory */
317317   for (i=size-1; i>=0; i--)
318318   {
319      memory_write_byte( cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), addr, data[0]);
319      memory_write_byte( cpu_get_address_space( image->machine->cpu[0], ADDRESS_SPACE_PROGRAM ), addr, data[0]);
320320      addr++;
321321      data++;
322322   }
323323
324324
325325   /* set new pc address */
326   cpu_set_reg( Machine->cpu[0], REG_PC, exec);
326   cpu_set_reg( image->machine->cpu[0], REG_PC, exec);
327327
328328   /* free the data */
329329   free(quickload_data);
src/mess/machine/c64.c
r3768r3769
271271      value &= t;
272272   }
273273
274   if ( input_port_read(Machine, "CTRLSEL") & 0x80 )
274   if ( input_port_read(device->machine, "CTRLSEL") & 0x80 )
275275      value &= c64_keyline[8];
276276   else
277277      value &= c64_keyline[9];
r3768r3769
293293    if (!(cia0porta & 0x02)) value &= c64_keyline[1];
294294    if (!(cia0porta & 0x01)) value &= c64_keyline[0];
295295
296   if ( input_port_read(Machine, "CTRLSEL") & 0x80 )
296   if ( input_port_read(device->machine, "CTRLSEL") & 0x80 )
297297      value &= c64_keyline[9];
298298    else
299299      value &= c64_keyline[8];
300300
301    if (is_c128(Machine))
301    if (is_c128(device->machine))
302302    {
303303      if (!vic2e_k0_r ())
304304         value &= c128_keyline[0];
r3768r3769
307307      if (!vic2e_k2_r ())
308308         value &= c128_keyline[2];
309309    }
310    if (is_c65(Machine))
310    if (is_c65(device->machine))
311311   {
312312      if (!(c65_6511_port & 0x02))
313313         value &= c65_keyline;
r3768r3769
407407   cbm_serial_data_write (serial_data = !(data & 0x20));
408408   cbm_serial_atn_write (serial_atn = !(data & 0x08));
409409   c64_vicaddr = c64_memory + helper[data & 0x03];
410   if (is_c128(Machine))
410   if (is_c128(device->machine))
411411   {
412412      c128_vicaddr = c64_memory + helper[data & 0x03] + c128_va1617;
413413   }
src/mess/drivers/lynx.c
r3768r3769
1212
1313#include "devices/snapquik.h"
1414
15#include "deprecat.h"
16
1715static QUICKLOAD_LOAD( lynx );
1816
1917static ADDRESS_MAP_START( lynx_mem , ADDRESS_SPACE_PROGRAM, 8)
r3768r3769
174172      return INIT_FAIL;
175173
176174   for (i = 0; i < length; i++)
177      memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), start + i, data[i]);
175      memory_write_byte(cputag_get_address_space(image->machine,"main",ADDRESS_SPACE_PROGRAM), start + i, data[i]);
178176
179177   rom[0x1fc] = start & 0xff;
180178   rom[0x1fd] = start >> 8;
src/mess/drivers/super80.c
r3768r3769
1010#include "sound/speaker.h"
1111#include "machine/centroni.h"
1212#include "devices/printer.h"
13#include "deprecat.h"
1413
1514static UINT8 super80_mhz=2;   /* state of bit 2 of port F0 */
1615static UINT16 vidpg=0xfe00;   /* Home position of video page being displayed */
r3768r3769
240239      for (x=0; x<32; x++)
241240      {
242241         if (screen_on)
243            code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5));
242            code = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5));
244243
245244         drawgfx(bitmap, screen->machine->gfx[0], code & mask, 0, 0, 0, x*8, y*10,
246245            cliprect, TRANSPARENCY_NONE, 0);
r3768r3769
275274      {
276275         if (screen_on)
277276         {
278            code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5));      /* get character to display */
277            code = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5));      /* get character to display */
279278
280            if (!(options & 0x40)) col = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xfe00 + x + (y<<5));   /* byte of colour to display */
279            if (!(options & 0x40)) col = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), 0xfe00 + x + (y<<5));   /* byte of colour to display */
281280         }
282281
283282         drawgfx(bitmap, screen->machine->gfx[cgen], code, col, 0, 0, x*8, y*10,
src/mess/drivers/saturn.c
r3768r3769
532532         {
533533            case 0:
534534               return_data = 0x90;
535//               return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>4) & 0xf);
535//               return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>4) & 0xf);
536536               break;
537537
538538            case 1:
539//               return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>12) & 0xf);
539//               return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>12) & 0xf);
540540               break;
541541
542542            case 2:
543//               return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>8) & 0xf);
543//               return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>8) & 0xf);
544544               break;
545545
546546            case 3:
547547               return_data = 0x94;
548//               return_data = 0xf0 | (input_port_read(Machine, "JOY1")&0x8) | 0x4;
548//               return_data = 0xf0 | (input_port_read(space->machine, "JOY1")&0x8) | 0x4;
549549               break;
550550         }
551551      }
src/mess/drivers/amiga.c
r3768r3769
399399      /* overlay disabled, map RAM on 0x000000 */
400400      memory_install_write16_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1);
401401
402      amiga_cart_check_overlay(Machine);
402      amiga_cart_check_overlay(device->machine);
403403   }
404404   else
405405      /* overlay enabled, map Amiga system ROM on 0x000000 */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team