Previous 15994 Revisions Next

r8991 Wednesday 1st September, 2010 at 10:13:18 UTC by Miodrag Milanović
Source code cleanup
[src/mess]messdriv.c
[src/mess/devices]cartslot.h cassette.c chd_cd.c coco_fdc.c flopdrv.c flopdrv.h
[src/mess/drivers]3do.c a2600.c a310.c a6809.c a7000.c abc80x.c ami1200.c apple2gs.c atari.c atm.c avigo.c bebox.c bmjr.c bml3.c c10.c c128.c c64.c casloopy.c cc10.c cgc7900.c cosmicos.c crvision.c czk80.c elwro800.c fmtowns.c gba.c jr100.c jr200.c k8915.c mac.c mccpm.c mes.c multi8.c mycom.c mz2500.c mz700.c nes.c ng_aes.c p112.c palm.c pasopia.c pc.c pc6001.c pcw.c pentagon.c phc25.c pocketc.c prestige.c psion.c psx.c pv2000.c px8.c pyl601.c radio86.c rex6000.c rt1715.c rx78.c samcoupe.c scorpion.c selz80.c smc777.c sord.c spectrum.c supracan.c systec.c tandy2k.c tk80bs.c trs80m2.c tutor.c v1050.c vectrex.c vic20.c vii.c x1.c zexall.c
[src/mess/formats]d88_dsk.c timex_dck.c
[src/mess/includes]einstein.h fmtowns.h nes.h spectrum.h x1.h
[src/mess/machine]3do.c amstrad.c apple1.c apple2gs.c apple3.c ataricrt.c b2m.c bebox.c c128.c c64.c cdic.h gamecom.c jupiter.c lisa.c lviv.c mac.c msx.c nes.c nes_ines.c nes_mmc.c nes_mmc.h nes_pcb.c osborne1.c pc.c pk8020.c pmd85.c rmnimbus.c sms.c special.c tf20.c vectrex.c wd17xx.c z80ne.c zx.c
[src/mess/osd/winui]messui.c softwarelist.c
[src/mess/tools/imgtool/modules]psion.c
[src/mess/tools/imgtool/windows]attrdlg.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]kc.c vic6567.c x68k.c
[src/osd/winui]mui_opts.h mui_util.h properties.h resource.h splitters.h
[src/osd/winui/help]reshelp.h

src/osd/winui/properties.h
r8990r8991
2323void   InitPropertyPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num);
2424
2525#define PROPERTIES_PAGE 0
26#define AUDIT_PAGE      1   
26#define AUDIT_PAGE      1
2727
2828void   InitPropertyPageToPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num, int start_page);
2929void    InitDefaultPropertyPage(HINSTANCE hInst, HWND hWnd);
src/osd/winui/resource.h
r8990r8991
410410#define IDC_STATIC                      -1
411411
412412// Next default values for new objects
413//
413//
414414#ifdef APSTUDIO_INVOKED
415415#ifndef APSTUDIO_READONLY_SYMBOLS
416416#define _APS_NO_MFC                     1
src/osd/winui/splitters.h
r8990r8991
5353
5454extern int *nSplitterOffset;
5555
56typedef struct
56typedef struct
5757{
5858   double dPosition;
5959   int nSplitterWindow;
src/osd/winui/mui_opts.h
r8990r8991
3636} OPTIONS_TYPE;
3737
3838
39enum
39enum
4040{
4141   COLUMN_GAMES = 0,
4242   COLUMN_ORIENTATION,
r8990r8991
6262};
6363
6464/* Default input */
65enum
65enum
6666{
6767   INPUT_LAYOUT_STD,
6868   INPUT_LAYOUT_HR,
r8990r8991
105105   int x, y, width, height;
106106} AREA;
107107
108typedef struct
108typedef struct
109109{
110110   char* screen;
111111   char* aspect;
src/osd/winui/help/reshelp.h
r8990r8991
11// Include the Microsoft Developer Studio generated Help ID include file.
22//
33#include "..\resource.hm"
4#include "mame32.hm"
No newline at end of file
4#include "mame32.hm"
src/osd/winui/mui_util.h
r8990r8991
6969
7070HICON win_extract_icon_utf8(HINSTANCE inst, const char* exefilename, UINT iconindex);
7171TCHAR* win_tstring_strdup(LPCTSTR str);
72HANDLE win_create_file_utf8(const char* filename, DWORD desiredmode, DWORD sharemode,
73                        LPSECURITY_ATTRIBUTES securityattributes, DWORD creationdisposition,
74                        DWORD flagsandattributes, HANDLE templatehandle);
72HANDLE win_create_file_utf8(const char* filename, DWORD desiredmode, DWORD sharemode,
73                     LPSECURITY_ATTRIBUTES securityattributes, DWORD creationdisposition,
74                     DWORD flagsandattributes, HANDLE templatehandle);
7575DWORD win_get_current_directory_utf8(DWORD bufferlength, char* buffer);
7676HANDLE win_find_first_file_utf8(const char* filename, LPWIN32_FIND_DATA findfiledata);
7777
src/mess/devices/cassette.c
r8990r8991
445445         {
446446            strcpy(info->s, ((cassette_config *)device->static_config())->interface );
447447         }
448         break;         
448         break;
449449   }
450450}
451451
src/mess/devices/flopdrv.c
r8990r8991
382382   //devcb_call_write_line(&flopimg->out_dskchg_func, flopimg->dskchg);
383383
384384   /* inform disk image of step operation so it can cache information */
385   if (image->exists())
385   if (image->exists())
386386      pDrive->track = pDrive->current_track;
387387
388388   pDrive->id_index = 0;
src/mess/devices/flopdrv.h
r8990r8991
1313#define FLOPPY_TYPE_SONY   2
1414
1515#define FLOPPY_DRIVE_2_8_INCH   1
16#define FLOPPY_DRIVE_3_INCH       2
16#define FLOPPY_DRIVE_3_INCH      2
1717#define FLOPPY_DRIVE_3_5_INCH   3
1818#define FLOPPY_DRIVE_5_25_INCH   4
1919#define FLOPPY_DRIVE_8_INCH      5
src/mess/devices/coco_fdc.c
r8990r8991
228228static DEVICE_START(fdc)
229229{
230230   fdc_t *fdc = get_token(device);
231    const fdc_hardware_type *hwtype = (const fdc_hardware_type *)downcast<const legacy_cart_slot_device_config_base *>(&device->baseconfig())->get_config_ptr(FDCINFO_PTR_HWTYPE);   
231    const fdc_hardware_type *hwtype = (const fdc_hardware_type *)downcast<const legacy_cart_slot_device_config_base *>(&device->baseconfig())->get_config_ptr(FDCINFO_PTR_HWTYPE);
232232
233233   /* initialize variables */
234234   memset(fdc, 0, sizeof(*fdc));
r8990r8991
631631static MACHINE_CONFIG_FRAGMENT(dragon_fdc)
632632   MDRV_WD179X_ADD(WD_TAG, coco_wd17xx_interface)
633633MACHINE_CONFIG_END
634   
634
635635DEVICE_GET_INFO(coco_cartridge_pcb_fdc_dragon)
636636{
637637   static const fdc_hardware_type hwtype =
src/mess/devices/cartslot.h
r8990r8991
160160public:
161161   INT64 get_config_int(UINT32 state) const { return get_legacy_config_int(state); }
162162   genf *get_config_fct(UINT32 state) const { return get_legacy_config_fct(state); }
163   void *get_config_ptr(UINT32 state) const { return get_legacy_config_ptr(state); }   
163   void *get_config_ptr(UINT32 state) const { return get_legacy_config_ptr(state); }
164164};
165165
166166
src/mess/devices/chd_cd.c
r8990r8991
184184            strcpy(info->s, get_config_dev(device)->interface );
185185         }
186186         break;
187     
187
188188   }
189189}
190190
src/mess/osd/winui/messui.c
r8990r8991
587587   {
588588      const device_config_image_interface *dev;
589589      for (bool gotone = s_config->mconfig->m_devicelist.first(dev); gotone; gotone = dev->next(dev))
590      {         
590      {
591591         s = GetSelectedSoftware(drvindex, s_config->mconfig, dev);
592592         if ((s != NULL) && !mame_stricmp(s, pszFilename)) {
593593            device = dev;
r8990r8991
610610      {
611611          const device_config_image_interface *dev;
612612         for (bool gotone = s_config->mconfig->m_devicelist.first(dev); gotone; gotone = dev->next(dev))
613         {           
613         {
614614            s = GetSelectedSoftware(drvindex, s_config->mconfig, dev);
615615            if (is_null_or_empty(s) && dev->uses_file_extension(file_extension)) {
616616               device = dev;
src/mess/osd/winui/softwarelist.c
r8990r8991
4444   char publisher[MAX_PATH];
4545   char year[10];
4646   char full_name[MAX_PATH*2];
47   
47
4848   char device[MAX_PATH];
4949};
5050
r8990r8991
159159   strcpy(pInfo->year, pszYear);
160160   strcpy(pInfo->device, pszDevice);
161161   sprintf(pInfo->full_name,"%s:%s", pszListname,pszName);
162   
163162
163
164164   ppNewIndex = (file_info**)malloc((pPickerInfo->file_index_length + 1) * sizeof(*pPickerInfo->file_index));
165165   memcpy(ppNewIndex,pPickerInfo->file_index,pPickerInfo->file_index_length * sizeof(*pPickerInfo->file_index));
166166   if (pPickerInfo->file_index) free(pPickerInfo->file_index);
src/mess/tools/messtest/testmess.c
r8990r8991
356356      /* get the path */
357357      fullpath = assemble_software_path(astring_alloc(), driver, current_command->u.image_args.filename);
358358
359      /* get the option name */     
359      /* get the option name */
360360      device_opt = device_config_image_interface::device_typename(current_command->u.image_args.device_ident.type);
361361
362362      /* set the option */
r8990r8991
435435
436436
437437void osd_init(running_machine *machine)
438{   
438{
439439   machine->add_notifier(MACHINE_NOTIFY_EXIT, testmess_exit);
440440   target = render_target_alloc(machine, NULL, 0);
441441   render_target_set_orientation(target, 0);
src/mess/tools/imgtool/windows/attrdlg.c
r8990r8991
1#define WIN32_LEAN_AND_MEAN   
1#define WIN32_LEAN_AND_MEAN
22#include <windows.h>
33#include <windowsx.h>
44#include <commctrl.h>
src/mess/tools/imgtool/modules/psion.c
r8990r8991
22 
33        Psion Organiser II Datapack
44 
5      08/18/2010 Sandro Ronco
5        08/18/2010 Sandro Ronco
66 
77        Known file types:
88         0x00         invalid record
src/mess/machine/ataricrt.c
r8990r8991
296296      }
297297   }
298298   logerror("%s loaded cartridge '%s' size %dK\n",
299      image.device().machine->gamedrv->name, image.filename() , size/1024);   
299      image.device().machine->gamedrv->name, image.filename() , size/1024);
300300   return IMAGE_INIT_PASS;
301301}
302302
r8990r8991
328328   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
329329   UINT8 *cart = memory_region(space->machine, "user1");
330330   UINT8 *cpu  = memory_region(space->machine, "maincpu");
331   
331
332332   atari_machine_start(machine);
333333   memory_install_write8_handler(space, 0xd500, 0xd5ff, 0, 0, xegs_bankswitch);
334334
r8990r8991
349349{
350350   UINT32 size;
351351   UINT8 *ptr = memory_region(image.device().machine, "user1");
352   
352
353353   if (image.software_entry() == NULL)
354354   {
355355      // skip the header
src/mess/machine/apple3.c
r8990r8991
724724   via_1_irq = 0;
725725   apple3_update_memory(machine);
726726
727   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(apple3_opbase, *machine));   
727   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(apple3_opbase, *machine));
728728}
src/mess/machine/3do.c
r8990r8991
232232    During booting the following things get written/read:
233233    - write 03180000 to 03180000 (init reading sequence)
234234    - 4 read actions from 03180000 bit#0, if lower bit is 1 0 1 0 then   (expect to read 0x0a)
235   - read from 03180000 (init writing sequence)
236   - write 0x0100 to shift register bit#0
237   - reset PON bit in CSTATBITS
235    - read from 03180000 (init writing sequence)
236    - write 0x0100 to shift register bit#0
237    - reset PON bit in CSTATBITS
238238    - wait a little while
239239    - read from 03180000
240   - write 0x0200 to shift register bit#0
241   - write 0x0002 to shift register bit#1
242   - dummy write to 03180000
243   - read from shift register bits #0 and #1.
244   - check if data read equals 0x44696167 (=Diag)   If so, jump 302196c in default bios
245   - dummy read from shift register
246   - write 0x0300 to shift register bit #0
247   - dummy write to shift register
240    - write 0x0200 to shift register bit#0
241    - write 0x0002 to shift register bit#1
242    - dummy write to 03180000
243    - read from shift register bits #0 and #1.
244    - check if data read equals 0x44696167 (=Diag)   If so, jump 302196c in default bios
245    - dummy read from shift register
246    - write 0x0300 to shift register bit #0
247    - dummy write to shift register
248248    - read data from shift register bit #0.
249249    - xor that data with 0x07ff
250   - write that data & 0x00ff | 0x4000 to the shift register
250    - write that data & 0x00ff | 0x4000 to the shift register
2512513022630
252252*/
253253
src/mess/machine/gamecom.c
r8990r8991
670670
671671   cartridge2 = memory_region(image.device().machine, "cart2");
672672
673//   if (image.software_entry() == NULL)
673//  if (image.software_entry() == NULL)
674674      filesize = image.length();
675//   else
676//      filesize = image.get_software_region_length("rom");
675//  else
676//      filesize = image.get_software_region_length("rom");
677677
678678   switch(filesize)
679679   {
r8990r8991
689689         return IMAGE_INIT_FAIL;
690690   }
691691
692//   if (image.software_entry() == NULL)
692//  if (image.software_entry() == NULL)
693693   {
694694      if (image.fread( cartridge2 + load_offset, filesize) != filesize)
695695      {
r8990r8991
697697         return IMAGE_INIT_FAIL;
698698      }
699699   }
700//   else
701//      memcpy(cartridge2 + load_offset, image.get_software_region("rom"), filesize);
700//  else
701//      memcpy(cartridge2 + load_offset, image.get_software_region("rom"), filesize);
702702
703703   if (filesize < 0x010000) { memcpy(cartridge2 + 0x008000, cartridge2, 0x008000); } /* ->64KB */
704704   if (filesize < 0x020000) { memcpy(cartridge2 + 0x010000, cartridge2, 0x010000); } /* ->128KB */
src/mess/machine/b2m.c
r8990r8991
216216
217217   if (state->b2m_drive!=drive) {
218218      wd17xx_set_drive(state->fdc,drive);
219      floppy_mon_w(floppy_get_device(device->machine, 0), 0);         
219      floppy_mon_w(floppy_get_device(device->machine, 0), 0);
220220      floppy_drive_set_ready_state(floppy_get_device(device->machine, 0), 1, 1);
221221      state->b2m_drive = drive;
222222   }
src/mess/machine/pmd85.c
r8990r8991
945945
946946   timer_set(machine, attotime_zero, NULL, 0, setup_machine_state);
947947
948   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(pmd85_opbaseoverride, *machine));               
948   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(pmd85_opbaseoverride, *machine));
949949}
src/mess/machine/c128.c
r8990r8991
11081108
11091109   c64_memory[0x000] = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM)->read_byte(0);
11101110   c64_memory[0x001] = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM)->read_byte(1);
1111   
1111
11121112}
11131113
11141114UINT8 c128_m6510_port_read( running_device *device, UINT8 direction )
src/mess/machine/osborne1.c
r8990r8991
467467      floppy_install_load_proc(floppy_get_device(machine, drive), osborne1_load_proc);
468468   }
469469
470   space->set_direct_update_handler(direct_update_delegate_create_static(osborne1_opbase, *machine));   
470   space->set_direct_update_handler(direct_update_delegate_create_static(osborne1_opbase, *machine));
471471}
472472
473473
src/mess/machine/amstrad.c
r8990r8991
12051205        multiface_flags &= ~(MULTIFACE_VISIBLE|MULTIFACE_STOP_BUTTON_PRESSED);
12061206
12071207       /* clear op base override */
1208        cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(amstrad_default, *machine));           
1208        cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(amstrad_default, *machine));
12091209      }
12101210
12111211      return pc;
src/mess/machine/wd17xx.c
r8990r8991
523523         else
524524         {
525525            /* Delay the INTRQ 3 byte times because we need to read two CRC bytes and
526               compare them with a calculated CRC */
526                   compare them with a calculated CRC */
527527            wd17xx_complete_command(device, DELAY_DATADONE);
528528
529529            if (VERBOSE)
src/mess/machine/sms.c
r8990r8991
2929   UINT8 *BIOS;
3030   UINT8 *mapper_ram;
3131   UINT8 mapper[4];
32   // we are going to use 1-6, same as bank numbers. Notice, though, that most mappers
33   // only work on 16K banks and, hence, banks 4-6 are not always directly set
32   // we are going to use 1-6, same as bank numbers. Notice, though, that most mappers
33   // only work on 16K banks and, hence, banks 4-6 are not always directly set
3434   // (they often use bank3 + 0x2000 and bank5 + 0x2000)
35   UINT8 *banking_bios[7];
35   UINT8 *banking_bios[7];
3636   UINT8 *banking_cart[7];
3737   UINT8 *banking_none[7];
3838   UINT8 gg_sio[5];
r8990r8991
770770   {
771771      UINT8 rom_page_count = sms_state.cartridge[sms_state.current_cartridge].size / 0x2000;
772772      int page = (rom_page_count > 0) ? data % rom_page_count : 0;
773     
773
774774      if (!sms_state.cartridge[sms_state.current_cartridge].ROM)
775775         return;
776     
776
777777      switch (offset & 3)
778778      {
779779         case 0:
r8990r8991
833833
834834static READ8_HANDLER( sms_kor_nobank_r )
835835{
836//   printf("read %x\n", offset);
836//  printf("read %x\n", offset);
837837   return space->read_byte(0xdffc + offset);
838838}
839839
r8990r8991
841841{
842842   UINT8 *SOURCE_BIOS;
843843   UINT8 *SOURCE = NULL;
844   
844
845845   space->write_byte(0xdffc + offset, data);
846846   sms_state.mapper[offset] = data;
847847
r8990r8991
851851      SOURCE_BIOS = sms_state.BIOS + ((sms_state.bios_page_count > 0) ? data % sms_state.bios_page_count : 0) * 0x4000;
852852   else
853853      SOURCE_BIOS = sms_state.banking_none[1];
854   
854
855855   if (sms_state.bios_port & IO_BIOS_ROM || (sms_state.is_gamegear && sms_state.BIOS == NULL))
856856      return;
857857   else
r8990r8991
861861      SOURCE = SOURCE_BIOS;
862862   }
863863
864//   printf("write %x, %x\n", offset, data);
864//  printf("write %x, %x\n", offset, data);
865865
866866   switch (offset)
867867   {
r8990r8991
876876            }
877877         }
878878         break;
879         
879
880880      case 1: /* Select 16k ROM bank for 0400-3FFF */
881881         sms_state.banking_bios[2] = SOURCE_BIOS + 0x0400;
882882         memory_set_bankptr(space->machine, "bank2", SOURCE + 0x0400);
883883         break;
884         
884
885885      case 2: /* Select 16k ROM bank for 4000-7FFF */
886886         sms_state.banking_bios[3] = SOURCE_BIOS;
887887         memory_set_bankptr(space->machine, "bank3", SOURCE);
888888         memory_set_bankptr(space->machine, "bank4", SOURCE + 0x2000);
889889         break;
890         
890
891891      case 3: /* Select 16k ROM bank for 8000-BFFF */
892892         sms_state.banking_bios[5] = SOURCE_BIOS;
893893         if (!(sms_state.mapper[0] & 0x08)) /* is RAM disabled? */
r8990r8991
11791179}
11801180
11811181#ifdef UNUSED_FUNCTION
1182// For the moment we switch to a different detection routine which allows to detect
1183// in a single run Codemasters mapper, Korean mapper (including Jang Pung 3 which
1182// For the moment we switch to a different detection routine which allows to detect
1183// in a single run Codemasters mapper, Korean mapper (including Jang Pung 3 which
11841184// uses a diff signature then the one below here) and Zemina mapper (used by Wonsiin, etc.).
11851185// I leave these here to document alt. detection routines and in the case these functions
11861186// can be updated
r8990r8991
14601460               { i += 2; cA000++; continue; }
14611461            }
14621462         }
1463         
1463
14641464         LOG(("Mapper test: c002 = %d, c8000 = %d, cA000 = %d, cFFFF = %d\n", c0002, c8000, cA000, cFFFF));
1465         
1465
14661466         // 2 is a security measure, although tests on existing ROM showed it was not needed
14671467         if (c0002 > cFFFF + 2 || (c0002 > 0 && cFFFF == 0))
14681468            sms_state.cartridge[index].features |= CF_KOREAN_ZEMINA_MAPPER;
r8990r8991
14701470            sms_state.cartridge[index].features |= CF_CODEMASTERS_MAPPER;
14711471         else if (cA000 > cFFFF + 2 || (cA000 > 0 && cFFFF == 0))
14721472            sms_state.cartridge[index].features |= CF_KOREAN_MAPPER;
1473         
1473
14741474      }
1475     
1475
14761476      /* Check for special SMS Compatibility mode gamegear cartridges */
14771477      if (sms_state.is_gamegear && image.software_entry() == NULL)   // not sure about how to handle this with softlists
14781478      {
r8990r8991
15101510      address_space *program = cputag_get_address_space(image.device().machine, "maincpu", ADDRESS_SPACE_PROGRAM);
15111511      memory_install_readwrite8_handler(program, 0xfffc, 0xffff, 0, 0, &sms_kor_nobank_r, &sms_kor_nobank_w);
15121512   }
1513   
1513
15141514   LOG(("Cart Features: %x\n", sms_state.cartridge[index].features));
15151515
15161516   /* Load battery backed RAM, if available */
r8990r8991
16091609
16101610   if (sms_state.cartridge[sms_state.current_cartridge].features & CF_KOREAN_ZEMINA_MAPPER)
16111611      memory_install_write8_handler(space, 0x0000, 0x0003, 0, 0, sms_korean_zemina_banksw_w);
1612   
1612
16131613   if (sms_state.cartridge[sms_state.current_cartridge].features & CF_GG_SMS_MODE)
16141614      sms_vdp_set_ggsmsmode(smsvdp, 1);
16151615
src/mess/machine/nes_pcb.c
r8990r8991
621621int nes_get_pcb_id( running_machine *machine, const char *feature )
622622{
623623   const nes_pcb *pcb = nes_pcb_lookup(feature);
624   
624
625625   if (pcb == NULL)
626626      fatalerror("Unimplemented PCB type %s\n", feature);
627   
627
628628   return pcb->pcb_id;
629629}
630630
r8990r8991
668668}
669669
670670/*************************************************************
671
671
672672 NROM board emulation
673
673
674674 Games: Mario Bros., Super Mario Bros., Tennis and most of
675675 the first generation games
676
676
677677 iNES: mapper 0
678
678
679679 In MESS: Supported, no need of specific handlers or IRQ
680
680
681681 *************************************************************/
682682
683683/*************************************************************
684684
685685 UxROM board emulation
686 
687 Games: Castlevania, Dragon Quest II, Duck Tales, MegaMan,
686
687 Games: Castlevania, Dragon Quest II, Duck Tales, MegaMan,
688688 Metal Gear
689689
690690 writes to 0x8000-0xffff change PRG 16K lower banks
r8990r8991
753753/*************************************************************
754754
755755 CNROM board emulation
756
756
757757 Games: B-Wings, Mighty Bomb Jack, Seicross, Spy vs. Spy,
758758 Adventure Island, Flipull, Friday 13th, GeGeGe no
759759 Kitarou, Ghostbusters, Gradius, Hokuto no Ken, Milon's
r8990r8991
763763
764764 missing BC?
765765
766 iNES: mappers 3 & 185 (the latter for games using Pins as
766 iNES: mappers 3 & 185 (the latter for games using Pins as
767767 protection)
768768
769769 Notice that BANDAI_PT554 board (Aerobics Studio) uses very
r8990r8991
14491449 iNES: mapper 118
14501450
14511451 In MESS: Supported. It also uses mmc3_irq.
1452
1452
14531453 *************************************************************/
14541454
14551455static void txsrom_set_mirror( running_machine *machine )
r8990r8991
14801480static WRITE8_HANDLER( txsrom_w )
14811481{
14821482   LOG_MMC(("txsrom_w, offset: %04x, data: %02x\n", offset, data));
1483   
1483
14841484   switch (offset & 0x6001)
14851485   {
14861486      case 0x2000:
14871487         break;
1488         
1488
14891489      default:
14901490         txrom_w(space, offset, data);
14911491         break;
r8990r8991
14971497 TQROM (MMC3 based) board emulation
14981498
14991499 Games: Pin Bot, High Speed
1500
1500
15011501 iNES: mapper 119
15021502
15031503 In MESS: Supported. It also uses mmc3_irq.
1504
1504
15051505 *************************************************************/
15061506
15071507static void tqrom_set_chr( running_machine *machine )
r8990r8991
16361636      case 0:   // 8k banks
16371637         chr8(machine, state->mmc5_vrom_regA[7] & 0xff, CHRROM);
16381638         break;
1639         
1639
16401640      case 1:   // 4k banks
16411641         chr4_0(machine, state->mmc5_vrom_regA[3] & 0xff, CHRROM);
16421642         chr4_4(machine, state->mmc5_vrom_regA[7] & 0xff, CHRROM);
16431643         break;
1644         
1644
16451645      case 2:   // 2k banks
16461646         chr2_0(machine, state->mmc5_vrom_regA[1], CHRROM);
16471647         chr2_2(machine, state->mmc5_vrom_regA[3], CHRROM);
16481648         chr2_4(machine, state->mmc5_vrom_regA[5], CHRROM);
16491649         chr2_6(machine, state->mmc5_vrom_regA[7], CHRROM);
16501650         break;
1651         
1651
16521652      case 3:   // 1k banks
16531653         chr1_0(machine, state->mmc5_vrom_regA[0], CHRROM);
16541654         chr1_1(machine, state->mmc5_vrom_regA[1], CHRROM);
r8990r8991
16701670      case 0:   // 8k banks
16711671         chr8(machine, state->mmc5_vrom_regB[3] & 0xff, CHRROM);
16721672         break;
1673         
1673
16741674      case 1:   // 4k banks
16751675         chr4_0(machine, state->mmc5_vrom_regB[3] & 0xff, CHRROM);
16761676         chr4_4(machine, state->mmc5_vrom_regB[3] & 0xff, CHRROM);
16771677         break;
1678         
1678
16791679      case 2:   // 2k banks
16801680         chr2_0(machine, state->mmc5_vrom_regB[1], CHRROM);
16811681         chr2_2(machine, state->mmc5_vrom_regB[3], CHRROM);
16821682         chr2_4(machine, state->mmc5_vrom_regB[1], CHRROM);
16831683         chr2_6(machine, state->mmc5_vrom_regB[3], CHRROM);
16841684         break;
1685         
1685
16861686      case 3:   // 1k banks
16871687         chr1_0(machine, state->mmc5_vrom_regB[0], CHRROM);
16881688         chr1_1(machine, state->mmc5_vrom_regB[1], CHRROM);
r8990r8991
17011701{
17021702   nes_state *state = machine->driver_data<nes_state>();
17031703   int bank1, bank2, bank3;
1704   
1704
17051705   switch (state->mmc5_prg_mode)
17061706   {
17071707      case 0:   // 32k banks
17081708         prg32(machine, state->mmc5_prg_regs[3] >> 2);
17091709         break;
1710         
1710
17111711      case 1:   // 16k banks
17121712         //          printf("problema 1: %x\n", state->mmc5_prg_regs[1]);
17131713         bank1 = state->mmc5_prg_regs[1];
1714         
1714
17151715         if (!BIT(bank1, 7))
17161716         {
17171717            state->prg_bank[0] = state->prg_chunks + (bank1 & 0x06);
r8990r8991
17211721         }
17221722         else
17231723            prg16_89ab(machine, bank1 >> 1);
1724         
1724
17251725         prg16_cdef(machine, state->mmc5_prg_regs[3] >> 1);
17261726         break;
1727         
1727
17281728      case 2:   // 16k-8k banks
17291729         //          printf("problema 2: %x %x\n", state->mmc5_prg_regs[1], state->mmc5_prg_regs[2]);
17301730         bank1 = state->mmc5_prg_regs[1];
17311731         bank3 = state->mmc5_prg_regs[2];
1732         
1732
17331733         if (!BIT(bank1, 7))
17341734         {
17351735            state->prg_bank[0] = state->prg_chunks + (bank1 & 0x06);
r8990r8991
17391739         }
17401740         else
17411741            prg16_89ab(machine, (bank1 & 0x7f) >> 1);
1742         
1742
17431743         if (!BIT(bank3, 7))
17441744         {
17451745            state->prg_bank[2] = state->prg_chunks + (bank3 & 0x07);
r8990r8991
17471747         }
17481748         else
17491749            prg8_cd(machine, bank3 & 0x7f);
1750         
1750
17511751         prg8_ef(machine, state->mmc5_prg_regs[3]);
17521752         break;
1753         
1753
17541754      case 3:   // 8k banks
17551755         //          printf("problema 3: %x %x %x\n", state->mmc5_prg_regs[0], state->mmc5_prg_regs[1], state->mmc5_prg_regs[2]);
17561756         bank1 = state->mmc5_prg_regs[0];
17571757         bank2 = state->mmc5_prg_regs[1];
17581758         bank3 = state->mmc5_prg_regs[2];
1759         
1759
17601760         if (!BIT(bank1, 7))
17611761         {
17621762            state->prg_bank[0] = state->prg_chunks + (bank1 & 0x07);
r8990r8991
17641764         }
17651765         else
17661766            prg8_89(machine, bank1 & 0x7f);
1767         
1767
17681768         if (!BIT(bank2, 7))
17691769         {
17701770            state->prg_bank[1] = state->prg_chunks + (bank2 & 0x07);
r8990r8991
17721772         }
17731773         else
17741774            prg8_ab(machine, bank2 & 0x7f);
1775         
1775
17761776         if (!BIT(bank3, 7))
17771777         {
17781778            state->prg_bank[2] = state->prg_chunks + (bank3 & 0x07);
r8990r8991
17801780         }
17811781         else
17821782            prg8_cd(machine, bank3 & 0x7f);
1783         
1783
17841784         prg8_ef(machine, state->mmc5_prg_regs[3]);
17851785         break;
17861786   }
r8990r8991
17931793static void mmc5_irq( running_device *device, int scanline, int vblank, int blanked )
17941794{
17951795   nes_state *state = device->machine->driver_data<nes_state>();
1796   
1796
17971797#if 1
17981798   if (scanline == 0)
17991799      state->IRQ_status |= 0x40;
18001800   else if (scanline > PPU_BOTTOM_VISIBLE_SCANLINE)
18011801      state->IRQ_status &= ~0x40;
18021802#endif
1803   
1803
18041804   if (scanline == state->IRQ_count)
18051805   {
18061806      if (state->IRQ_enable)
18071807         cpu_set_input_line(state->maincpu, M6502_IRQ_LINE, HOLD_LINE);
1808     
1808
18091809      state->IRQ_status = 0xff;
18101810   }
1811   
1811
18121812   /* FIXME: this is ok, but then we would need to update them again when we have the BG Hblank
18131813     I leave it commented out until the PPU is updated for this */
18141814   //  if (ppu2c0x_is_sprite_8x16(state->ppu) || state->mmc5_last_chr_a)
r8990r8991
18431843{
18441844   nes_state *state = space->machine->driver_data<nes_state>();
18451845   int retVal;
1846   
1846
18471847   /* $5c00 - $5fff: extended videoram attributes */
18481848   if ((offset >= 0x1b00) && (offset <= 0x1eff))
18491849   {
18501850      return state->mapper_ram[offset - 0x1b00];
18511851   }
1852   
1852
18531853   switch (offset)
18541854   {
18551855      case 0x1104: /* $5204 */
r8990r8991
18631863         state->IRQ_status &= ~0x80;
18641864         return retVal;
18651865#endif
1866         
1866
18671867      case 0x1105: /* $5205 */
18681868         return (state->mult1 * state->mult2) & 0xff;
18691869      case 0x1106: /* $5206 */
18701870         return ((state->mult1 * state->mult2) & 0xff00) >> 8;
1871         
1871
18721872      default:
18731873         logerror("** MMC5 uncaught read, offset: %04x\n", offset + 0x4100);
18741874         return 0x00;
r8990r8991
18791879static WRITE8_HANDLER( exrom_l_w )
18801880{
18811881   nes_state *state = space->machine->driver_data<nes_state>();
1882   
1882
18831883   //  LOG_MMC(("Mapper 5 write, offset: %04x, data: %02x\n", offset + 0x4100, data));
18841884   /* Send $5000-$5015 to the sound chip */
18851885   if ((offset >= 0xf00) && (offset <= 0xf15))
r8990r8991
18871887      nes_psg_w(state->sound, offset & 0x1f, data);
18881888      return;
18891889   }
1890   
1890
18911891   /* $5c00 - $5fff: extended videoram attributes */
18921892   if ((offset >= 0x1b00) && (offset <= 0x1eff))
18931893   {
r8990r8991
18951895         state->mapper_ram[offset - 0x1b00] = data;
18961896      return;
18971897   }
1898   
1898
18991899   switch (offset)
19001900   {
19011901      case 0x1000: /* $5100 */
r8990r8991
19031903         //          mmc5_update_prg(space->machine);
19041904         LOG_MMC(("MMC5 rom bank mode: %02x\n", data));
19051905         break;
1906         
1906
19071907      case 0x1001: /* $5101 */
19081908         state->mmc5_chr_mode = data & 0x03;
19091909         // update chr
19101910         LOG_MMC(("MMC5 vrom bank mode: %02x\n", data));
19111911         break;
1912         
1912
19131913      case 0x1002: /* $5102 */
19141914         if (data == 0x02)
19151915            state->MMC5_vram_protect |= 1;
r8990r8991
19241924            state->MMC5_vram_protect = 0;
19251925         LOG_MMC(("MMC5 vram protect 2: %02x\n", data));
19261926         break;
1927         
1927
19281928      case 0x1004: /* $5104 - Extra VRAM (EXRAM) control */
19291929         state->mmc5_vram_control = data & 0x03;
19301930         // update render
19311931         mmc5_update_render_mode(space->machine);
19321932         LOG_MMC(("MMC5 exram control: %02x\n", data));
19331933         break;
1934         
1934
19351935      case 0x1005: /* $5105 */
19361936         mmc5_ppu_mirror(space->machine, 0, data & 0x03);
19371937         mmc5_ppu_mirror(space->machine, 1, (data & 0x0c) >> 2);
r8990r8991
19401940         // update render
19411941         mmc5_update_render_mode(space->machine);
19421942         break;
1943         
1943
19441944         /* tile data for MMC5 flood-fill NT mode */
19451945      case 0x1006:
19461946         state->MMC5_floodtile = data;
19471947         break;
1948         
1948
19491949         /* attr data for MMC5 flood-fill NT mode */
19501950      case 0x1007:
19511951         switch (data & 3)
r8990r8991
19571957         case 3: state->MMC5_floodattr = 0xff; break;
19581958      }
19591959         break;
1960         
1960
19611961      case 0x1013: /* $5113 */
19621962         LOG_MMC(("MMC5 mid RAM bank select: %02x\n", data & 0x07));
19631963         // FIXME: a few Koei games have both WRAM & BWRAM but here we don't support this (yet)
r8990r8991
19661966         else
19671967            wram_bank(space->machine, data, NES_WRAM);
19681968         break;
1969         
1970         
1969
1970
19711971      case 0x1014: /* $5114 */
19721972      case 0x1015: /* $5115 */
19731973      case 0x1016: /* $5116 */
r8990r8991
19751975         state->mmc5_prg_regs[offset & 3] = data;
19761976         mmc5_update_prg(space->machine);
19771977         break;
1978         
1978
19791979#if 0
19801980      // these do not work as expected... I guess we definitely need the bank update at proper times (with BG vs. sprite timing)
19811981      case 0x1020: /* $5120 */
r8990r8991
19951995               mmc5_update_chr_a(space->machine);
19961996         }
19971997         break;
1998         
1999         
1998
1999
20002000      case 0x1028: /* $5128 */
20012001      case 0x1029: /* $5129 */
20022002      case 0x102a: /* $512a */
r8990r8991
20162016            // is to be used for all background tiles on the screen.
20172017         }
20182018         break;
2019         
2019
20202020#endif
2021         
2021
20222022      case 0x1020: /* $5120 */
20232023         LOG_MMC(("MMC5 $5120 vrom select: %02x (mode: %d)\n", data, state->mmc5_chr_mode));
20242024         switch (state->mmc5_chr_mode)
r8990r8991
22752275            break;
22762276      }
22772277         break;
2278         
2278
22792279      case 0x1030: /* $5130 */
22802280         state->mmc5_high_chr = data & 0x03;
22812281         if (state->mmc5_vram_control == 1)
r8990r8991
22842284            // is to be used for all background tiles on the screen.
22852285         }
22862286         break;
2287         
2288         
2287
2288
22892289      case 0x1100: /* $5200 */
22902290         state->mmc5_split_scr = data;
22912291         // in EX2 and EX3 modes, no split screen
r8990r8991
22932293            state->mmc5_split_scr &= 0x7f;
22942294         state->mmc5_split_ctrl = data;
22952295         break;
2296         
2296
22972297      case 0x1101: /* $5201 */
22982298         state->mmc5_split_yst = (data >= 240) ? data - 16 : data;
22992299         break;
2300         
2300
23012301      case 0x1102: /* $5202 */
23022302         state->mmc5_split_bank = data;
23032303         break;
2304         
2304
23052305      case 0x1103: /* $5203 */
23062306         state->IRQ_count = data;
23072307         state->MMC5_scanline = data;
r8990r8991
23172317      case 0x1106: /* $5206 */
23182318         state->mult2 = data;
23192319         break;
2320         
2320
23212321      default:
23222322         logerror("** MMC5 uncaught write, offset: %04x, data: %02x\n", offset + 0x4100, data);
23232323         break;
r8990r8991
25852585 Namcot 3453 board emulation
25862586
25872587 Games: Devil Man
2588
2588
25892589 These are the same as Namcot 34x3, but with additional mirroring
25902590 control
25912591
r8990r8991
27122712 iNES: mapper 11
27132713
27142714 In MESS: Supported
2715
2715
27162716 *************************************************************/
27172717
27182718static WRITE8_HANDLER( dis_74x377_w )
r8990r8991
27842784
27852785 Bandai LZ93D50 boards emulation
27862786
2787 There are several variants: plain board with or without SRAM,
2788 board + 24C01 EEPROM, board + 24C02 EEPROM, board + Barcode
2787 There are several variants: plain board with or without SRAM,
2788 board + 24C01 EEPROM, board + 24C02 EEPROM, board + Barcode
27892789 Reader (DATACH).
27902790 We currently only emulate the base hardware.
27912791
27922792 Games: Crayon Shin-Chan - Ora to Poi Poi, Dragon Ball Z Gaiden,
27932793 Dragon Ball Z II & III, Rokudenashi Blues, SD Gundam
2794 Gaiden - KGM2, Dragon Ball Z, Magical Taruruuto-kun, SD Gundam
2795 Gaiden [with EEPROM], Dragon Ball, Dragon Ball 3, Famicom Jump,
2794 Gaiden - KGM2, Dragon Ball Z, Magical Taruruuto-kun, SD Gundam
2795 Gaiden [with EEPROM], Dragon Ball, Dragon Ball 3, Famicom Jump,
27962796 Famicom Jump II [no EEPROM], Datach Games
27972797
27982798 At the moment, we don't support EEPROM I/O
r8990r8991
28002800 iNES: mappers 16, 153, 157 & 159
28012801
28022802 In MESS: Supported
2803
2803
28042804 *************************************************************/
28052805
28062806/* Here, IRQ counter decrements every CPU cycle. Since we update it every scanline,
r8990r8991
29142914 Bandai Karaoke Studio board emulation
29152915
29162916 Games: Karaoke Studio
2917
2917
29182918 Note: we currently do not emulate the mic
29192919
29202920 iNES: mapper 188
r8990r8991
29382938 iNES: mapper 96
29392939
29402940 In MESS: Preliminary Support.
2941
2941
29422942 *************************************************************/
29432943
29442944static WRITE8_HANDLER( bandai_ok_w )
r8990r8991
29992999 iNES: mapper 97
30003000
30013001 In MESS: Supported.
3002
3002
30033003 *************************************************************/
30043004
30053005static WRITE8_HANDLER( tam_s1_w )
r8990r8991
31323132
31333133 Jaleco SS88006 board emulation, aka JF-27, JF-29, JF-30, ...,
31343134 JF-38, JF-40, JF-41
3135
3135
31363136 Games: Lord of King, Magic John, Moe Pro '90, Ninja Jajamaru,
31373137 Pizza Pop, Plasma Ball
31383138
31393139 iNES: mapper 18
31403140
31413141 In MESS: Supported
3142
3142
31433143 *************************************************************/
31443144
31453145/* Here, IRQ counter decrements every CPU cycle. Since we update it every scanline,
r8990r8991
32873287 iNES: mapper 140
32883288
32893289 In MESS: Supported.
3290
3290
32913291 *************************************************************/
32923292
32933293static WRITE8_HANDLER( jf11_m_w )
r8990r8991
33873387 iNES: mapper 92
33883388
33893389 In MESS: Supported (no samples).
3390
3390
33913391 *************************************************************/
33923392
33933393static WRITE8_HANDLER( jf19_w )
r8990r8991
40754075 Sengoku Fuuunji
40764076
40774077 iNES: mapper 33
4078
4078
40794079 In MESS: Supported.
40804080
40814081 *************************************************************/
r8990r8991
41204120
41214121 Games: Bakushou!! Jinsei Gekijou 3, Bubble Bobble 2,
41224122 Captain Saver, Don Doko Don 2, Flintstones, Jetsons
4123
4123
41244124 This is basically Mapper 33 + IRQ. Notably, IRQ works the
41254125 same as MMC3 irq, BUT latch values are "inverted" (XOR'ed
41264126 with 0xff) and there is a little delay (not implemented yet)
41274127 We simply use MMC3 IRQ and XOR the value written in the
41284128 register 0xc000 below
4129
4129
41304130 iNES: mapper 48
41314131
41324132 In MESS: Supported.
4133
4133
41344134 *************************************************************/
41354135
41364136static WRITE8_HANDLER( tc0190fmc_p16_w )
r8990r8991
42894289 iNES: mapper 82
42904290
42914291 In MESS: Supported.
4292
4292
42934293 *************************************************************/
42944294
42954295static void x1017_set_chr( running_machine *machine )
r8990r8991
49034903}
49044904
49054905/*************************************************************
4906
4906
49074907 Bootleg Board by Fukutake
4908
4908
49094909 Games: Study Box
4910
4910
49114911 iNES: mapper 186
4912
4912
49134913 In MESS: Unsupported.
4914 
4915 
4914
4915
49164916 *************************************************************/
49174917
49184918static WRITE8_HANDLER( fukutake_l_w )
r8990r8991
49204920   nes_state *state = space->machine->driver_data<nes_state>();
49214921   LOG_MMC(("fukutake_l_w offset: %04x, data: %02x\n", offset, data));
49224922   offset += 0x100;
4923   
4923
49244924   if (offset >= 0x200 && offset < 0x400)
49254925   {
49264926      if (offset & 1)
49274927         prg16_89ab(space->machine, data);
49284928      else
4929         wram_bank(space->machine, data >> 6, NES_WRAM);         
4929         wram_bank(space->machine, data >> 6, NES_WRAM);
49304930   }
49314931   else if (offset >= 0x400 && offset < 0xf00)
49324932      state->mapper_ram[offset - 0x400] = data;
r8990r8991
49374937   nes_state *state = space->machine->driver_data<nes_state>();
49384938   LOG_MMC(("fukutake_l_r offset: %04x\n", offset));
49394939   offset += 0x100;
4940   
4940
49414941   if (offset >= 0x200 && offset < 0x400)
49424942   {
49434943      if (offset == 0x200 || offset == 0x201 || offset == 0x203)
r8990r8991
52855285}
52865286
52875287/*************************************************************
5288
5288
52895289 Kaiser Board KS7022
5290
5290
52915291 Games: 15 in 1
5292
5292
52935293 iNES: mapper 175
5294
5294
52955295 In MESS: Supported?
5296
5296
52975297 *************************************************************/
52985298
52995299static WRITE8_HANDLER( ks7022_w )
r8990r8991
53125312{
53135313   nes_state *state = space->machine->driver_data<nes_state>();
53145314   LOG_MMC(("ks7022_r, offset: %04x\n", offset));
5315   
5315
53165316   if (offset == 0x7ffc)
53175317   {
53185318      chr8(space->machine, state->mmc_latch1, CHRROM);
r8990r8991
53245324}
53255325
53265326/*************************************************************
5327
5327
53285328 Kaiser Board KS7032
5329 
5330 Games:
5331 
5332 iNES:
5333 
5334 In MESS:
5335 
5329
5330 Games:
5331
5332 iNES:
5333
5334 In MESS:
5335
53365336 *************************************************************/
53375337
53385338static void ks7032_prg_update( running_machine *machine )
r8990r8991
53485348static void ks7032_irq( running_device *device, int scanline, int vblank, int blanked )
53495349{
53505350   nes_state *state = device->machine->driver_data<nes_state>();
5351   
5351
53525352   if (state->IRQ_enable)
53535353   {
53545354      if (state->IRQ_count >= (0xffff - 114))
r8990r8991
53665366{
53675367   nes_state *state = space->machine->driver_data<nes_state>();
53685368   LOG_MMC(("ks7032_w, offset: %04x, data: %02x\n", offset, data));
5369   
5369
53705370   switch (offset & 0x7000)
53715371   {
53725372      case 0x0000:
r8990r8991
53955395}
53965396
53975397/*************************************************************
5398
5398
53995399 Kaiser Board KS202
5400 
5401 Games:
5402 
5403 iNES:
5404 
5400
5401 Games:
5402
5403 iNES:
5404
54055405 In MESS: Supported?
5406
5406
54075407 *************************************************************/
54085408
54095409
r8990r8991
54115411{
54125412   nes_state *state = space->machine->driver_data<nes_state>();
54135413   LOG_MMC(("ks202_w, offset: %04x, data: %02x\n", offset, data));
5414   
5414
54155415   switch (offset & 0x7000)
54165416   {
54175417      case 0x0000:
r8990r8991
54495449}
54505450
54515451/*************************************************************
5452
5452
54535453 Kaiser Board KS7017
5454 
5455 Games:
5456 
5457 iNES:
5458 
5454
5455 Games:
5456
5457 iNES:
5458
54595459 In MESS: Not working
5460
5460
54615461 *************************************************************/
54625462
54635463static void mmc_fds_irq( running_device *device, int scanline, int vblank, int blanked )
54645464{
54655465   nes_state *state = device->machine->driver_data<nes_state>();
5466   
5466
54675467   if (state->IRQ_enable)
54685468   {
54695469      if (state->IRQ_count <= 114)
r8990r8991
54815481{
54825482   nes_state *state = space->machine->driver_data<nes_state>();
54835483   LOG_MMC(("ks7022_w, offset: %04x, data: %02x\n", offset, data));
5484   
5484
54855485   offset += 0x100;
54865486
54875487   if (offset >= 0xa00 && offset < 0xb00)
54885488      state->mmc_latch1 = ((offset >> 2) & 0x03) | ((offset >> 4) & 0x04);
5489   
5489
54905490   if (offset >= 0x1000 && offset < 0x1100)
54915491      prg16_89ab(space->machine, state->mmc_latch1);
54925492}
r8990r8991
54955495{
54965496   nes_state *state = space->machine->driver_data<nes_state>();
54975497   LOG_MMC(("ks7017_extra_w, offset: %04x, data: %02x\n", offset, data));
5498   
5498
54995499   offset += 0x20;
55005500
55015501   if (offset == 0x0020) /* 0x4020 */
55025502      state->IRQ_count = (state->IRQ_count & 0xff00) | data;
5503   
5503
55045504   if (offset == 0x0021) /* 0x4021 */
55055505      state->IRQ_count = (state->IRQ_count & 0x00ff) | (data << 8);
55065506
r8990r8991
55125512{
55135513   nes_state *state = space->machine->driver_data<nes_state>();
55145514   LOG_MMC(("ks7017_extra_r, offset: %04x\n", offset));
5515   
5515
55165516   state->IRQ_status &= ~0x01;
55175517   return state->IRQ_status;
55185518}
r8990r8991
55715571static void kay_pp_update_regs( running_machine *machine )
55725572{
55735573   nes_state *state = machine->driver_data<nes_state>();
5574   
5574
55755575   switch (state->mmc_reg[5] & 0x3f)
55765576   {
55775577      case 0x20:
r8990r8991
55905590         if (state->mmc_reg[6])
55915591            state->mmc_reg[1] = state->mmc_reg[6];
55925592         break;
5593         
5593
55945594      case 0x28:
55955595         state->mmc_reg[7] = 0;
55965596         state->mmc_reg[2] = state->mmc_reg[6];
55975597         break;
5598         
5598
55995599      case 0x2a:
56005600         state->mmc_reg[7] = 0;
56015601         state->mmc_reg[3] = state->mmc_reg[6];
56025602         break;
5603         
5603
56045604      case 0x2f:
56055605         break;
5606         
5606
56075607      default:
56085608         state->mmc_reg[5] = 0;
56095609         break;
r8990r8991
56135613static void kay_pp_prg_cb( running_machine *machine, int start, int bank )
56145614{
56155615   nes_state *state = machine->driver_data<nes_state>();
5616   
5616
56175617   if (state->mmc_reg[5] & 0x3f)
56185618   {
56195619      prg8_x(machine, start, bank & 0x3f);
r8990r8991
56295629{
56305630   nes_state *state = machine->driver_data<nes_state>();
56315631   UINT8 chr_page = (state->mmc3_latch & 0x80) >> 5;
5632   
5632
56335633   if ((start & 0x04) == chr_page)
56345634      bank |= 0x100;
5635   
5635
56365636   chr1_x(machine, start, bank, source);
56375637}
56385638
r8990r8991
56405640{
56415641   nes_state *state = space->machine->driver_data<nes_state>();
56425642   LOG_MMC(("kay_pp_w, offset: %04x, data: %02x\n", offset, data));
5643   
5643
56445644   switch (offset & 0x6003)
56455645   {
56465646      case 0x0000:
56475647         txrom_w(space, offset, data);
56485648         mmc3_set_prg(space->machine, state->mmc_prg_base, state->mmc_prg_mask);
56495649         break;
5650         
5650
56515651      case 0x0001:
56525652         state->mmc_reg[6] = (BIT(data, 0) << 5) | (BIT(data, 1) << 4) | (BIT(data, 2) << 3)
56535653                        | (BIT(data, 3) << 2) | (BIT(data, 4) << 1) | BIT(data, 5);
r8990r8991
56565656         txrom_w(space, offset, data);
56575657         mmc3_set_prg(space->machine, state->mmc_prg_base, state->mmc_prg_mask);
56585658         break;
5659         
5659
56605660      case 0x0003:
56615661         state->mmc_reg[5] = data;
56625662         kay_pp_update_regs(space->machine);
r8990r8991
56935693   else
56945694      prg8_x(machine, start, bank);
56955695}
5696   
5696
56975697static WRITE8_HANDLER( kasing_m_w )
56985698{
56995699   nes_state *state = space->machine->driver_data<nes_state>();
57005700   LOG_MMC(("kasing_m_w, offset: %04x, data: %02x\n", offset, data));
5701   
5701
57025702   switch (offset & 0x01)
57035703   {
57045704      case 0x00:
r8990r8991
63056305
63066306 Games: Chess Academy, Chinese Checkers Jpn, Mahjong Academy,
63076307 Olympic IQ, Poker II, Tasac [150], Poker III [243]
6308
6308
63096309 iNES: mappers 150 & 243
63106310
63116311 *************************************************************/
r8990r8991
65106510
65116511
65126512/*************************************************************
6513
6513
65146514 Sachen SA009 bootleg boards
6515
6515
65166516 Games: Pipe 5
6517
6517
65186518 iNES: mapper 160
6519
6519
65206520 In MESS: Supported.
6521
6521
65226522 *************************************************************/
65236523
65246524static WRITE8_HANDLER( sa009_l_w )
65256525{
65266526   nes_state *state = space->machine->driver_data<nes_state>();
65276527   LOG_MMC(("sa009_l_w, offset: %04x, data: %02x\n", offset, data));
6528   
6528
65296529   chr8(space->machine, data, state->mmc_chr_source);
65306530}
65316531
r8990r8991
65346534 Sachen SA0036 bootleg boards
65356535
65366536 Games: Taiwan Mahjong 16
6537
6537
65386538 iNES: mapper 149
65396539
65406540 In MESS: Supported.
6541
6541
65426542 *************************************************************/
65436543
65446544static WRITE8_HANDLER( sa0036_w )
r8990r8991
65536553 Sachen SA0037 bootleg boards
65546554
65556555 Games: Mahjong World, Shisen Mahjong
6556
6556
65576557 iNES: mapper 148
65586558
65596559 In MESS: Supported.
6560
6560
65616561 *************************************************************/
65626562
65636563static WRITE8_HANDLER( sa0037_w )
r8990r8991
65736573 Sachen SA72007 bootleg boards
65746574
65756575 Games: Sidewinder
6576
6576
65776577 iNES: mapper 145
65786578
65796579 In MESS: Supported.
6580
6580
65816581 *************************************************************/
65826582
65836583static WRITE8_HANDLER( sa72007_l_w )
r8990r8991
65946594 Sachen SA72008 bootleg boards
65956595
65966596 Games: Jovial Race, Qi Wang
6597
6597
65986598 iNES: mapper 133
65996599
66006600 In MESS: Supported.
r8990r8991
66376637 Sachen TCU-01 bootleg boards
66386638
66396639 Games: Challenge of the Dragon, Chinese Kungfu
6640
6640
66416641 iNES: mapper 147
66426642
66436643 In MESS: Supported.
r8990r8991
68156815static void sgame_boog_chr_cb( running_machine *machine, int start, int bank, int source )
68166816{
68176817   nes_state *state = machine->driver_data<nes_state>();
6818   
6818
68196819   if ((state->mmc_reg[1] & 0x04))
68206820      bank |= 0x100;
68216821   else
68226822      bank = (bank & 0x7f) | ((state->mmc_reg[1] & 0x10) << 3);
6823   
6823
68246824   chr1_x(machine, start, bank, source);
68256825}
68266826
r8990r8991
68656865{
68666866   nes_state *state = space->machine->driver_data<nes_state>();
68676867   LOG_MMC(("sgame_boog_m_w, offset: %04x, data: %02x\n", offset, data));
6868   
6868
68696869   if (offset == 0x0000)
68706870   {
68716871      state->mmc_reg[0] = data;
r8990r8991
68976897         if (!state->mmc_reg[2])
68986898            txrom_w(space, 0x0000, data);
68996899         break;
6900         
6900
69016901      case 0x0001:
69026902         if (!state->mmc_reg[2])
69036903            txrom_w(space, 0x0001, data);
r8990r8991
69076907            txrom_w(space, 0x0001, data);
69086908         }
69096909         break;
6910         
6910
69116911      case 0x2000:
69126912         if (!state->mmc_reg[2])
69136913            txrom_w(space, 0x2000, data);
r8990r8991
69236923      case 0x4000:
69246924         if (!state->mmc_reg[2])
69256925            txrom_w(space, 0x4000, data);
6926         else
6926         else
69276927            set_nt_mirroring(space->machine, ((data >> 7) | data) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
69286928         break;
69296929
69306930      case 0x4001:
69316931         if (!state->mmc_reg[2])
69326932            txrom_w(space, 0x4001, data);
6933         else
6933         else
69346934            txrom_w(space, 0x6001, data);
69356935         break;
69366936
69376937      case 0x6001:
69386938         if (!state->mmc_reg[2])
69396939            txrom_w(space, 0x6001, data);
6940         else
6940         else
69416941         {
69426942            txrom_w(space, 0x4000, data);
69436943            txrom_w(space, 0x4001, data);
69446944         }
69456945         break;
6946         
6946
69476947      default:
69486948         txrom_w(space, offset, data);
69496949         break;
r8990r8991
75287528/* Luo Ke Ren X only works with this */
75297529static void waixing_a_chr_cb( running_machine *machine, int start, int bank, int source )
75307530{
7531   int chr_src = (bank <= 9) ? CHRRAM : CHRROM;   
7531   int chr_src = (bank <= 9) ? CHRRAM : CHRROM;
75327532   chr1_x(machine, start, bank, chr_src);
75337533}
75347534
r8990r8991
75767576
75777577static void waixing_b_chr_cb( running_machine *machine, int start, int bank, int source )
75787578{
7579   int chr_src = BIT(bank, 7) ? CHRRAM : CHRROM;   
7579   int chr_src = BIT(bank, 7) ? CHRRAM : CHRROM;
75807580   chr1_x(machine, start, bank, chr_src);
75817581}
75827582
r8990r8991
77277727   nes_state *state = space->machine->driver_data<nes_state>();
77287728   UINT8 MMC3_helper, cmd;
77297729   LOG_MMC(("waixing_g_w, offset: %04x, data: %02x\n", offset, data));
7730   
7730
77317731   switch (offset & 0x6001)
77327732   {
77337733      case 0x0000:
77347734         MMC3_helper = state->mmc_latch1 ^ data;
77357735         state->mmc_latch1 = data;
7736         
7736
77377737         /* Has PRG Mode changed? */
77387738         if (MMC3_helper & 0x40)
77397739            mmc3_set_prg(space->machine, state->mmc_prg_base, state->mmc_prg_mask);
7740         
7740
77417741         /* Has CHR Mode changed? */
77427742         if (MMC3_helper & 0x80)
77437743            waixing_g_set_chr(space->machine, state->mmc_chr_base, state->mmc_chr_mask);
77447744         break;
7745         
7745
77467746      case 0x0001:
77477747         cmd = state->mmc_latch1 & 0x0f;
77487748         switch (cmd)
r8990r8991
80948094static void waixing_sec_prg_cb( running_machine *machine, int start, int bank )
80958095{
80968096   nes_state *state = machine->driver_data<nes_state>();
8097   
8097
80988098   if (state->mmc_reg[0])
80998099      bank = ((bank & 0x01)) | ((bank >> 3) & 0x02) | ((bank >> 1) & 0x04) | ((bank << 2) & 0x18);
81008100
r8990r8991
81068106   nes_state *state = machine->driver_data<nes_state>();
81078107
81088108   if (state->mmc_reg[0])
8109      bank = ((bank & 0x03)) | ((bank >> 1) & 0x04) | ((bank >> 4) & 0x08) |
8109      bank = ((bank & 0x03)) | ((bank >> 1) & 0x04) | ((bank >> 4) & 0x08) |
81108110            ((bank >> 2) & 0x10) | ((bank << 3) & 0x20) | ((bank << 2) & 0xc0);
8111   
8111
81128112   chr1_x(machine, start, bank, source);
81138113}
81148114
r8990r8991
81288128}
81298129
81308130/*************************************************************
8131
8131
81328132 Waixing SH2 Board
8133
8133
81348134 Games: Fire Emblem (C) and Fire Emblem Gaiden (C)
8135
8135
81368136 MMC3 clone with different access to CHR
8137
8137
81388138 iNES: mapper 165
8139
8139
81408140 In MESS: Partially Supported.
8141
8141
81428142 *************************************************************/
81438143
81448144static void waixing_sh2_chr_cb( running_machine *machine, int start, int bank, int source )
81458145{
81468146   nes_state *state = machine->driver_data<nes_state>();
8147   
8147
81488148   chr4_0(machine, state->mmc_reg[0], state->mmc_reg[0] ? CHRRAM : CHRROM);
81498149   chr4_4(machine, state->mmc_reg[1], state->mmc_reg[1] ? CHRRAM : CHRROM);
81508150}
r8990r8991
81628162      case 0xfe8: chr_helper = (bank & 0x4) | 0x2; break;
81638163      default: return val;
81648164   }
8165   
8165
81668166   state->mmc_reg[offset >> 12] = chr_helper;
81678167   if (offset & 0x1000)
81688168      chr4_4(space->machine, state->mmc_reg[1], state->mmc_reg[1] ? CHRRAM : CHRROM);
81698169   else
81708170      chr4_0(space->machine, state->mmc_reg[0], state->mmc_reg[0] ? CHRRAM : CHRROM);
8171     
8172   return val;   
8171
8172   return val;
81738173}
81748174
81758175/*************************************************************
r8990r8991
81878187static void unl_8237_prg_cb( running_machine *machine, int start, int bank )
81888188{
81898189   nes_state *state = machine->driver_data<nes_state>();
8190   
8190
81918191   if (!(state->mmc_reg[0] & 0x80))
81928192      prg8_x(machine, start, bank);
81938193}
r8990r8991
82428242      case 0x1000:
82438243         set_nt_mirroring(space->machine, (data | (data >> 7)) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
82448244         break;
8245         
8245
82468246      case 0x2000:
82478247      case 0x3000:
82488248         state->mmc_reg[2] = 1;
r8990r8991
84178417         case 0x2001:
84188418            data = unl_kof97_unscramble(data);
84198419            txrom_w(space, offset, data);
8420            break;         
8420            break;
84218421      }
84228422   }
84238423}
r8990r8991
85838583            state->mmc_reg[1] = 0x00;
85848584            break;
85858585      }
8586     
8586
85878587   }
8588   
8588
85898589   if (!state->mmc_reg[3] && offset > 0x1000)
85908590   {
85918591      state->mmc_reg[3] = 1;
r8990r8991
89508950 MMC3 clone
89518951
89528952 iNES: mapper 197
8953
8953
89548954 In MESS: Supported.
89558955
89568956 *************************************************************/
r8990r8991
91879187}
91889188
91899189/*************************************************************
9190
9190
91919191 WHIRLWIND-2706
9192
9192
91939193 Games: Meikyuu Jiin Dababa (FDS conversion)
9194
9194
91959195 iNES: mapper 108
9196
9196
91979197 In MESS: Supported.
9198
9198
91999199 *************************************************************/
92009200
92019201static WRITE8_HANDLER( whirl2706_w )
r8990r8991
92059205}
92069206
92079207/*************************************************************
9208
9208
92099209 Bootleg Board used for FDS conversion
9210
9210
92119211 Games: Tobidase Daisakusen (FDS conversion)
9212
9212
92139213 iNES: mapper 120
9214
9214
92159215 In MESS: Partially Supported.
9216
9216
92179217 *************************************************************/
92189218
92199219static WRITE8_HANDLER( btl_tobi_l_w )
r8990r8991
93639363}
93649364
93659365/*************************************************************
9366
9366
93679367 BTL-PIKACHUY2K
9368
9368
93699369 Games: Pikachu Y2k
9370
9370
93719371 iNES: mapper 254
9372 
9373 In MESS:
9374 
9372
9373 In MESS:
9374
93759375 *************************************************************/
93769376
93779377static WRITE8_HANDLER( btl_pika_y2k_w )
r8990r8991
94069406{
94079407   nes_state *state = space->machine->driver_data<nes_state>();
94089408   LOG_MMC(("btl_pika_y2k_m_r, offset: %04x\n", offset));
9409   
9410   return    state->wram[offset] ^ (state->mmc_latch2 & state->mmc_reg[0]);
9409
9410   return   state->wram[offset] ^ (state->mmc_latch2 & state->mmc_reg[0]);
94119411}
94129412
94139413/*************************************************************
r8990r8991
94179417 *************************************************************/
94189418
94199419/*************************************************************
9420
9420
94219421 Board BMC-FK23C
9422
9422
94239423 In MESS: partially supported (still to sort initial banking
94249424 for many games)
9425
9425
94269426 *************************************************************/
94279427
94289428#if 0
94299429static void fk23c_prg_cb( running_machine *machine, int start, int bank )
94309430{
94319431   nes_state *state = machine->driver_data<nes_state>();
9432   
9432
94339433   if (((state->mmc_reg[0] & 0x07) - 3) > 1 && (!(state->mmc_reg[3] & 0x02) || start < 2))
94349434   {
94359435      if (state->mmc_reg[0] & 0x03)
94369436         bank = (bank & (0x3f >> (state->mmc_reg[0] & 0x03))) | (state->mmc_reg[1] << 1);
9437     
9437
94389438      prg8_x(machine, start, bank);
94399439   }
94409440}
r8990r8991
94429442static void fk23c_chr_cb( running_machine *machine, int start, int bank, int source )
94439443{
94449444   nes_state *state = machine->driver_data<nes_state>();
9445   
9445
94469446   if (!(state->mmc_reg[0] & 0x40) && (!(state->mmc_reg[3] & 0x02) || (start != 1 && start != 3)))
94479447      chr1_x(machine, start, ((state->mmc_reg[2] & 0x7f) << 3) | bank, source);
94489448}
r8990r8991
94539453{
94549454   nes_state *state = machine->driver_data<nes_state>();
94559455   UINT8 mask = (0x3f >> (state->mmc_reg[0] & 0x03));
9456   
9456
94579457   if ((state->mmc_reg[0] & 0x07) < 3)
94589458   {
94599459      if (!(state->mmc_reg[0] & 0x03))
r8990r8991
94899489         prg8_cd(machine, state->mmc_reg[4]);
94909490         prg8_ef(machine, state->mmc_reg[5]);
94919491      }
9492     
9492
94939493      mmc3_set_prg(machine, state->mmc_prg_base, state->mmc_prg_mask);
94949494   }
94959495}
r8990r8991
95249524      if (offset & (1 << 4))   // here it should be (4 + state->mmc_dipsetting)
95259525      {
95269526         state->mmc_reg[offset & 0x03] = data;
9527         
9527
95289528         fk23c_set_prg(space->machine);
95299529         fk23c_set_chr(space->machine);
95309530      }
r8990r8991
95359535{
95369536   nes_state *state = space->machine->driver_data<nes_state>();
95379537   LOG_MMC(("fk23c_w, offset: %04x, data: %02x\n", offset, data));
9538   
9538
95399539   if (state->mmc_reg[0] & 0x40)
95409540   {
95419541      if (state->mmc_reg[0] & 0x30)
r8990r8991
95609560            else
95619561               txrom_w(space, offset, data);
95629562            break;
9563           
9563
95649564         case 0x2000:
95659565            set_nt_mirroring(space->machine, data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
95669566            break;
9567           
9567
95689568         default:
95699569            txrom_w(space, offset, data);
95709570            break;
9571      }   
9571      }
95729572   }
95739573}
95749574
r8990r8991
97479747   nes_state *state = machine->driver_data<nes_state>();
97489748   UINT8 chr = BIT(state->mmc_reg[0], 5) ? CHRRAM : CHRROM;
97499749   int chr_base = (state->mmc_reg[2] << 3) & 0xf00;
9750   
9750
97519751   chr1_x(machine, start, chr_base | bank, chr);
97529752}
97539753
r8990r8991
99219921
99229922
99239923/*************************************************************
9924
9924
99259925 Board UNL-STUDYNGAME
9926
9926
99279927 Games: Study n Game 32 in 1
9928
9928
99299929 iNES: mapper 39
9930 
9931 In MESS: Partially Supported (problems with PRG bankswitch,
9930
9931 In MESS: Partially Supported (problems with PRG bankswitch,
99329932 only keyboard exercise work).
9933
9933
99349934 *************************************************************/
99359935
99369936static WRITE8_HANDLER( sng32_w )
r8990r8991
1108211082}
1108311083
1108411084/*************************************************************
11085
11085
1108611086 UNL-H2288
11087
11087
1108811088 *************************************************************/
1108911089
1109011090static void h2288_prg_cb( running_machine *machine, int start, int bank )
1109111091{
1109211092   nes_state *state = machine->driver_data<nes_state>();
11093   
11093
1109411094   if (!(state->mmc_reg[0] & 0x40))
1109511095      prg8_x(machine, start, bank);
1109611096}
r8990r8991
1110011100   nes_state *state = space->machine->driver_data<nes_state>();
1110111101   LOG_MMC(("h2288_l_w offset: %04x, data: %02x\n", offset, data));
1110211102   offset += 0x100;
11103   
11103
1110411104   if (offset >= 0x1800)
1110511105   {
1110611106      state->mmc_reg[offset & 1] = data;
r8990r8991
1112011120{
1112111121   LOG_MMC(("h2288_l_r offset: %04x\n", offset));
1112211122   offset += 0x100;
11123   
11123
1112411124   if (offset >= 0x1000)
1112511125   {
1112611126      int helper = offset >> 8;
r8990r8991
1113711137{
1113811138   static const UINT8 conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4};
1113911139   LOG_MMC(("h2288_w, offset: %04x, data: %02x\n", offset, data));
11140   
11140
1114111141   switch (offset & 0x6001)
1114211142   {
1114311143      case 0x0000:
1114411144         txrom_w(space, 0x0000, (data & 0xc0) | conv_table[data & 0x07]);
1114511145         break;
11146         
11146
1114711147      default:
1114811148         txrom_w(space, offset, data);
1114911149         break;
r8990r8991
1115111151}
1115211152
1115311153/*************************************************************
11154
11154
1115511155 UNL-SHJY3
11156
11156
1115711157 *************************************************************/
1115811158
1115911159/* I think the IRQ should only get fired if enough CPU cycles have passed, but we don't implement (yet) this part */
r8990r8991
1117711177{
1117811178   nes_state *state = machine->driver_data<nes_state>();
1117911179   int i;
11180   
11180
1118111181   prg8_89(machine, state->mmc_prg_bank[0]);
1118211182   prg8_ab(machine, state->mmc_prg_bank[1]);
1118311183
r8990r8991
1121311213      mmc_helper += 2;
1121411214      mmc_helper &= 7;
1121511215      shift = offset & 4;
11216     
11216
1121711217      state->mmc_vrom_bank[mmc_helper] = (state->mmc_vrom_bank[mmc_helper] & (0xf0 >> shift)) | ((data & 0x0f) << shift);
1121811218      if (shift)
1121911219         state->mmc_extra_bank[mmc_helper] = data >> 4;
r8990r8991
1125411254}
1125511255
1125611256/*************************************************************
11257
11257
1125811258 UNL-603-5052
11259
11259
1126011260 MMC3 + protection access in 0x4020 - 0x7fff
11261
11261
1126211262 in MESS: Partial support
1126311263
1126411264 *************************************************************/
r8990r8991
1127511275READ8_HANDLER( unl_6035052_extra_r )
1127611276{
1127711277   nes_state *state = space->machine->driver_data<nes_state>();
11278   LOG_MMC(("unl_6035052_extra_r, offset: %04x\n", offset));   
11278   LOG_MMC(("unl_6035052_extra_r, offset: %04x\n", offset));
1127911279   return state->mmc_latch1;
1128011280}
1128111281
1128211282
1128311283/*************************************************************
11284
11284
1128511285 BMC-POWERJOY
11286
11286
1128711287 *************************************************************/
1128811288
1128911289static void pjoy84_prg_cb( running_machine *machine, int start, int bank )
1129011290{
1129111291   nes_state *state = machine->driver_data<nes_state>();
1129211292   UINT8 flip = (state->mmc3_latch & 0x40) ? 2 : 0;
11293   
11293
1129411294   if (!(state->mmc_reg[3] & 0x03))
1129511295      prg8_x(machine, start, bank);
1129611296   else if (start == flip)
r8990r8991
1132411324                  ((state->mmc_reg[0] << 4) & 0x080 & state->mmc_reg[0]) |
1132511325                  ((state->mmc_reg[0] << 3) & 0x100) |
1132611326                  ((state->mmc_reg[0] << 5) & 0x200);
11327   
11327
1132811328   state->mmc_prg_mask = BIT(state->mmc_reg[0], 6) ? 0x0f : 0x1f;
1132911329   state->mmc_chr_mask = BIT(state->mmc_reg[0], 7) ? 0x7f : 0xff;
1133011330}
r8990r8991
1134611346         pjoy84_set_base_mask(space->machine);
1134711347         if (state->mmc_reg[3] & 0x10)
1134811348            chr8(space->machine, (state->mmc_chr_base >> 3) | (state->mmc_reg[2] & 0x0f), state->mmc_chr_source);
11349         else
11349         else
1135011350            mmc3_set_chr(space->machine, state->mmc_chr_source, state->mmc_chr_base, state->mmc_chr_mask);
1135111351         mmc3_set_prg(space->machine, state->mmc_prg_base, state->mmc_prg_mask);
1135211352         break;
r8990r8991
1135411354}
1135511355
1135611356/*************************************************************
11357
11357
1135811358 SOMERI TEAM
11359
11359
1136011360 iNES: mapper 116
11361
11361
1136211362 Emulation note about regs in MESS: currently,
1136311363 - state->mmc_cmd1 represent the board mode
1136411364 - state->mmc_reg[n] for n=0,1,2,3 represent the MMC1 regs
r8990r8991
1136611366 - state->mmc_vrom_bank[n] for n=0,...,5 represent the MMC3 CHR banks
1136711367 - state->mmc_prg_bank[n] for n=4,5 represent the VRC2 PRG banks
1136811368 - state->mmc_vrom_bank[n] for n=6,...,13 represent the VRC2 CHR banks
11369
11369
1137011370 In MESS: Preliminary support
11371
11371
1137211372 *************************************************************/
1137311373
1137411374// MMC1 Mode emulation
r8990r8991
1139911399{
1140011400   nes_state *state = machine->driver_data<nes_state>();
1140111401   UINT8 chr_mode = BIT(state->mmc_reg[0], 4);
11402   
11402
1140311403   if (chr_mode)
1140411404   {
1140511405      chr4_0(machine, state->mmc_reg[1] & 0x1f, state->mmc_chr_source);
r8990r8991
1141211412static WRITE8_HANDLER( someri_mmc1_w )
1141311413{
1141411414   nes_state *state = space->machine->driver_data<nes_state>();
11415   
11415
1141611416   assert(state->mmc_cmd1 == 2);
1141711417
1141811418   if (data & 0x80)
1141911419   {
1142011420      state->mmc1_count = 0;
1142111421      state->mmc1_latch = 0;
11422     
11422
1142311423      state->mmc_reg[0] |= 0x0c;
1142411424      someri_mmc1_set_prg(space->machine);
1142511425      return;
1142611426   }
11427   
11427
1142811428   if (state->mmc1_count < 5)
1142911429   {
1143011430      if (state->mmc1_count == 0) state->mmc1_latch = 0;
r8990r8991
1143211432      state->mmc1_latch |= (data & 0x01) ? 0x10 : 0x00;
1143311433      state->mmc1_count++;
1143411434   }
11435   
11435
1143611436   if (state->mmc1_count == 5)
1143711437   {
1143811438      switch (offset & 0x6000)
r8990r8991
1146311463            someri_mmc1_set_prg(space->machine);
1146411464            break;
1146511465      }
11466     
11466
1146711467      state->mmc1_count = 0;
1146811468   }
1146911469}
r8990r8991
1147311473{
1147411474   nes_state *state = space->machine->driver_data<nes_state>();
1147511475   UINT8 mmc_helper, cmd;
11476   
11476
1147711477   assert(state->mmc_cmd1 == 1);
1147811478   switch (offset & 0x6001)
1147911479   {
1148011480      case 0x0000:
1148111481         mmc_helper = state->mmc3_latch ^ data;
1148211482         state->mmc3_latch = data;
11483         
11483
1148411484         if (mmc_helper & 0x40)
1148511485            mmc3_set_prg(space->machine, state->mmc_prg_base, state->mmc_prg_mask);
11486         
11486
1148711487         if (mmc_helper & 0x80)
1148811488            mmc3_set_chr(space->machine, state->mmc_chr_source, state->mmc_chr_base, state->mmc_chr_mask);
1148911489         break;
11490         
11490
1149111491      case 0x0001:
1149211492         cmd = state->mmc3_latch & 0x07;
1149311493         switch (cmd)
r8990r8991
1150411504            break;
1150511505         }
1150611506         break;
11507         
11507
1150811508      case 0x2000:
1150911509         set_nt_mirroring(space->machine, BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
1151011510         break;
r8990r8991
1152111521{
1152211522   nes_state *state = space->machine->driver_data<nes_state>();
1152311523   UINT8 bank, shift;
11524   
11524
1152511525   assert(state->mmc_cmd1 == 0);
1152611526
1152711527   if (offset < 0x1000)
r8990r8991
1157411574
1157511575   switch (state->mmc_cmd1)
1157611576   {
11577      case 0x00:
11577      case 0x00:
1157811578         prg8_89(machine, state->mmc_prg_bank[4]);
1157911579         prg8_ab(machine, state->mmc_prg_bank[5]);
1158011580         for (i = 0; i < 8; i++)
1158111581            chr1_x(machine, i, state->mmc_vrom_bank[6 + i], CHRROM);
1158211582         break;
11583      case 0x01:
11583      case 0x01:
1158411584         mmc3_set_prg(machine, state->mmc_prg_base, state->mmc_prg_mask);
1158511585         mmc3_set_chr(machine, state->mmc_chr_source, state->mmc_chr_base, state->mmc_chr_mask);
1158611586         break;
11587      case 0x02:
11587      case 0x02:
1158811588         someri_mmc1_set_prg(machine);
1158911589         someri_mmc1_set_chr(machine);
1159011590         break;
r8990r8991
1160911609
1161011610#ifdef UNUSED_FUNCTION
1161111611/*************************************************************
11612
11612
1161311613 FUJIYA Board - mapper 170 according to NEStopia
11614
11614
1161511615 Which games are supposed to use this?
11616
11616
1161711617 *************************************************************/
1161811618
1161911619static WRITE8_HANDLER( fujiya_m_w )
r8990r8991
1162111621   nes_state *state = space->machine->driver_data<nes_state>();
1162211622   LOG_MMC(("fujiya_m_w, offset: %04x, data: %02x\n", offset, data));
1162311623   offset += 0x6000;
11624   
11624
1162511625   if (offset == 0x6502 || offset == 0x7000)
1162611626      state->mmc_latch1 = (data & 0x40) << 1;
1162711627}
r8990r8991
1162911629static READ8_HANDLER( fujiya_m_r )
1163011630{
1163111631   nes_state *state = space->machine->driver_data<nes_state>();
11632   LOG_MMC(("fujiya_m_r, offset: %04x\n", offset));   
11632   LOG_MMC(("fujiya_m_r, offset: %04x\n", offset));
1163311633   offset += 0x6000;
11634   
11634
1163511635   if (offset == 0x7001 || offset == 0x7777)
1163611636      return state->mmc_latch1 | ((offset >> 8) & 0x7f);
11637   
11637
1163811638   return 0;
1163911639}
1164011640#endif
r8990r8991
1168811688
1168911689static READ8_HANDLER( dummy_l_r )
1169011690{
11691   logerror("read access, offset: %04x\n", offset + 0x4100);   
11691   logerror("read access, offset: %04x\n", offset + 0x4100);
1169211692   return 0x00;
1169311693}
1169411694
1169511695static READ8_HANDLER( dummy_m_r )
1169611696{
11697   logerror("read access, offset: %04x\n", offset + 0x6000);   
11697   logerror("read access, offset: %04x\n", offset + 0x6000);
1169811698   return 0x00;
1169911699}
1170011700
1170111701static READ8_HANDLER( dummy_r )
1170211702{
11703   logerror("read access, offset: %04x\n", offset + 0x8000);   
11703   logerror("read access, offset: %04x\n", offset + 0x8000);
1170411704   return 0x00;
1170511705}
1170611706
r8990r8991
1196911969{
1197011970   nes_state *state = machine->driver_data<nes_state>();
1197111971   const nes_pcb_intf *intf = nes_pcb_intf_lookup(state->pcb_id);
11972   
11972
1197311973   if (intf == NULL)
1197411974      fatalerror("Missing PCB interface\n");
11975   
11975
1197611976   if (intf)
1197711977   {
1197811978      state->mmc_write_low = intf->mmc_l.write;
r8990r8991
1199411994      state->mmc_read = NULL;   // in progress
1199511995      ppu_latch = NULL;
1199611996   }
11997   
11997
1199811998   state->mmc3_prg_cb = prg8_x;
1199911999   state->mmc3_chr_cb = chr1_x;
12000   
12000
1200112001   switch (state->pcb_id)
1200212002   {
1200312003      case STD_TXSROM:
r8990r8991
1208112081}
1208212082
1208312083/*************************************************************
12084
12084
1208512085 pcb_initialize
1208612086
1208712087 Initialize all the necessary registers and quantities for
1208812088 emulation of each board
12089
12089
1209012090 *************************************************************/
1209112091
1209212092/* this is used by many boards (MMC3, MMC6 + most MMC3 pirate clone boards) */
1209312093static void mmc3_common_initialize( running_machine *machine, int prg_mask, int chr_mask, int IRQ_type )
1209412094{
1209512095   nes_state *state = machine->driver_data<nes_state>();
12096   
12096
1209712097   state->mmc3_alt_irq = IRQ_type;      // later MMC3 boards seem to use MMC6-type IRQ... more investigations are in progress at NESDev...
1209812098   state->mmc_prg_bank[0] = state->mmc_prg_bank[2] = 0xfe;   // prg_bank[2] & prg_bank[3] remain always the same in most MMC3 variants
1209912099   state->mmc_prg_bank[1] = state->mmc_prg_bank[3] = 0xff;   // but some pirate clone mappers change them after writing certain registers
r8990r8991
1211112111{
1211212112   nes_state *state = machine->driver_data<nes_state>();
1211312113   int err = 0, i;
12114   
12114
1211512115   /* basic PRG config */
1211612116   prg32(machine, 0);
12117   
12117
1211812118   /* some boards will not use this, but directly CHRROM (resp. CHRRAM) if the board only has VROM (resp. VRAM) */
1211912119   state->mmc_chr_source = state->chr_chunks ? CHRROM : CHRRAM;
1212012120   chr8(machine, 0, state->mmc_chr_source);
12121   
12121
1212212122   /* Here, we init a few helpers: 4 prg banks and 16 chr banks - some mappers use them */
1212312123   for (i = 0; i < 4; i++)
1212412124      state->mmc_prg_bank[i] = 0;
r8990r8991
1212612126      state->mmc_vrom_bank[i] = 0;
1212712127   for (i = 0; i < 16; i++)
1212812128      state->mmc_extra_bank[i] = 0;
12129   
12129
1213012130   state->mmc_latch1 = 0;
1213112131   state->mmc_latch2 = 0;
12132   
12132
1213312133   /* Finally, we init IRQ-related quantities. */
1213412134   state->IRQ_enable = state->IRQ_enable_latch = 0;
1213512135   state->IRQ_count = state->IRQ_count_latch = 0;
1213612136   state->IRQ_toggle = 0;
12137   
12137
1213812138   switch (idx)
1213912139   {
1214012140         /* many boards only needs PRG to point at first 32k and CHR at first 8k */
r8990r8991
1219312193      case BMC_WS:
1219412194      case UNL_EDU2K:
1219512195         break;
12196         
12196
1219712197         /* other boards need additional initialization */
1219812198      case STD_UXROM:   // mapper 2
1219912199      case STD_UN1ROM:   // mapper 94
r8990r8991
1223812238         prg16_89ab(machine, 0);
1223912239         prg16_cdef(machine, state->prg_chunks - 1);
1224012240         break;
12241         
12241
1224212242      case STD_CPROM:   // mapper 13
1224312243         chr4_0(machine, 0, CHRRAM);
1224412244         chr4_4(machine, 0, CHRRAM);
r8990r8991
1240212402         if (!state->hard_mirroring)
1240312403            set_nt_mirroring(machine, PPU_MIRROR_LOW);
1240412404         break;
12405         
12405
1240612406         // mapper 14
1240712407      case REXSOFT_SL1632:
1240812408         state->mmc_extra_bank[2] = 0xfe;
r8990r8991
1241612416      case WAIXING_PS2:
1241712417         set_nt_mirroring(machine, PPU_MIRROR_VERT);
1241812418         break;
12419         
12419
1242012420         // mapper 35
1242112421      case UNL_SC127:
1242212422         // mapper 42
r8990r8991
1242412424      case BTL_AISENSHINICOL:
1242512425         prg32(machine, 0xff);
1242612426         break;
12427         
12427
1242812428         // mapper 40
1242912429      case BTL_SMB2A:
1243012430         prg8_67(machine, 0xfe);
r8990r8991
1243312433         prg8_cd(machine, 0xfe);
1243412434         prg8_ef(machine, 0xff);
1243512435         break;
12436         
12436
1243712437         // mapper 43
1243812438      case UNL_SMB2J:
1243912439         if (state->battery)
r8990r8991
1245212452         state->mmc_reg[0] = state->mmc_reg[1] = state->mmc_reg[2] = state->mmc_reg[3] = 0;
1245312453         mmc3_common_initialize(machine, 0x3f, 0xff, 0);
1245412454         break;
12455         
12455
1245612456         // mapper 50
1245712457      case BTL_SMB2B:
1245812458         prg8_67(machine, 0x0f);
r8990r8991
1248112481         prg16_89ab(machine, 0);
1248212482         prg16_cdef(machine, 0);
1248312483         break;
12484         
12484
1248512485         // mapper 64
1248612486      case TENGEN_800032:
1248712487         // mapper 158
r8990r8991
1249512495      case CAMERICA_BF9093:
1249612496         prg32(machine, 0xff);
1249712497         break;
12498         
12498
1249912499         // mapper 79 (& 146)
1250012500      case AVE_NINA06:
1250112501         set_nt_mirroring(machine, PPU_MIRROR_HORZ);
1250212502         break;
12503         
12503
1250412504         // mapper 83
1250512505      case CONY_BOARD:
1250612506         state->mapper83_reg[9] = 0x0f;
1250712507         prg8_cd(machine, 0x1e);
1250812508         prg8_ef(machine, 0x1f);
1250912509         break;
12510         
12510
1251112511         // mapper 91
1251212512      case UNL_MK2:
1251312513         set_nt_mirroring(machine, PPU_MIRROR_VERT);
1251412514         prg16_89ab(machine, state->prg_chunks - 1);
1251512515         prg16_cdef(machine, state->prg_chunks - 1);
1251612516         break;
12517         
12517
1251812518         // mapper 104
1251912519      case CAMERICA_GOLDENFIVE:
1252012520         prg16_89ab(machine, 0x00);
r8990r8991
1252712527         prg8_cd(machine, 0);
1252812528         prg8_ef(machine, (state->prg_chunks << 1) - 1);
1252912529         break;
12530         
12530
1253112531         // mapper 108
1253212532      case WHIRLWIND_2706:
1253312533         prg32(machine, 0xff);
1253412534         break;
12535         
12535
1253612536         // mapper 114
1253712537      case SUPERGAME_LIONKING:
1253812538         state->map114_reg = state->map114_reg_enabled = 0;
r8990r8991
1257512575            state->mmc_vrom_bank[6 + i] = i;
1257612576         someri_mode_update(machine);
1257712577         break;
12578         
12578
1257912579         // mapper 120
1258012580      case BTL_TOBIDASE:
1258112581         prg32(machine, 2);
1258212582         break;
12583         
12583
1258412584         // mapper 121
1258512585      case KAY_PANDAPRINCE:
1258612586         state->mmc_reg[5] = state->mmc_reg[6] = state->mmc_reg[7] = 0;
1258712587         mmc3_common_initialize(machine, 0xff, 0xff, 0);
1258812588         break;
12589         
12589
1259012590         // mapper 126
1259112591      case BMC_PJOY84:
1259212592         mmc3_common_initialize(machine, 0xff, 0xff, 0);
r8990r8991
1259512595         mmc3_set_chr(machine, state->mmc_chr_source, state->mmc_chr_base, state->mmc_chr_mask);
1259612596         mmc3_set_prg(machine, state->mmc_prg_base, state->mmc_prg_mask);
1259712597         break;
12598         
12598
1259912599         // mapper 132
1260012600      case TXC_22211A:
1260112601         // mapper 172
r8990r8991
1260412604      case TXC_22211C:
1260512605         state->txc_reg[0] = state->txc_reg[1] = state->txc_reg[2] = state->txc_reg[3] = 0;
1260612606         break;
12607         
12607
1260812608         // mapper 134
1260912609      case BMC_FAMILY_4646B:
1261012610         mmc3_common_initialize(machine, 0x1f, 0xff, 0);
1261112611         break;
12612         
12612
1261312613         // mapper 137
1261412614      case SACHEN_8259D:
1261512615         chr8(machine, state->chr_chunks - 1, CHRROM);
r8990r8991
1263012630         prg16_89ab(machine, 0);
1263112631         prg16_cdef(machine, 1);
1263212632         break;
12633         
12633
1263412634         // mapper 156
1263512635      case OPENCORP_DAOU306:
1263612636         prg16_89ab(machine, state->prg_chunks - 2);
r8990r8991
1266212662         prg16_89ab(machine, 0);
1266312663         prg16_cdef(machine, 0x20);
1266412664         break;
12665         
12665
1266612666         // mapper 176
1266712667      case UNL_XZY:
1266812668         // mapper 182
1266912669      case HOSENKAN_BOARD:
1267012670         prg32(machine, (state->prg_chunks - 1) >> 1);
1267112671         break;
12672         
12672
1267312673      case FUKUTAKE_BOARD:   // mapper 186
1267412674         prg16_89ab(machine, 0);
1267512675         prg16_cdef(machine, 0);
1267612676         break;
12677         
12677
1267812678         // mapper 187
1267912679      case UNL_KOF96:
1268012680         state->mmc_reg[0] = state->mmc_reg[1] = state->mmc_reg[2] = state->mmc_reg[3] = 0;
r8990r8991
1272512725         state->mmc_vrom_bank[7] = 0x03;
1272612726         waixing_g_set_chr(machine, state->mmc_chr_base, state->mmc_chr_mask);
1272712727         break;
12728         
12728
1272912729         // mapper 200
1273012730      case BMC_36IN1:
1273112731         prg16_89ab(machine, state->prg_chunks - 1);
1273212732         prg16_cdef(machine, state->prg_chunks - 1);
1273312733         break;
12734         
12734
1273512735         // mapper 202
1273612736      case BMC_150IN1:
1273712737         // mapper 203
r8990r8991
1274912749         state->mmc_prg_base = 0x10;   // this board has a diff prg_base
1275012750         mmc3_set_prg(machine, state->mmc_prg_base, state->mmc_prg_mask);
1275112751         break;
12752         
12752
1275312753         // mapper 208
1275412754      case GOUDER_37017:
1275512755         state->mmc_reg[0] = state->mmc_reg[1] = state->mmc_reg[2] = state->mmc_reg[3] = state->mmc_reg[4] = 0;
r8990r8991
1276012760         chr8(machine, 0xff, CHRROM);
1276112761         prg32(machine, 0xff);
1276212762         break;
12763         
12763
1276412764         // mapper 215
1276512765      case SUPERGAME_BOOGERMAN:
1276612766         state->mmc_reg[0] = 0x00;
r8990r8991
1277112771         sgame_boog_set_prg(machine);
1277212772         mmc3_set_chr(machine, state->mmc_chr_source, state->mmc_chr_base, state->mmc_chr_mask);
1277312773         break;
12774         
12774
1277512775         // mapper 217
1277612776      case BMC_GOLDENCARD_6IN1:
1277712777         mmc3_common_initialize(machine, 0xff, 0xff, 0);
r8990r8991
1278712787         prg16_89ab(machine, 0);
1278812788         prg16_cdef(machine, 0);
1278912789         break;
12790         
12790
1279112791         // mapper 223?
1279212792      case WAIXING_TYPE_I:
1279312793         mmc3_common_initialize(machine, 0xff, 0xff, 0);
1279412794         state->mmc3_wram_protect = 0;
1279512795         break;
12796         
12796
1279712797         // mapper 224?
1279812798      case WAIXING_TYPE_J:
1279912799         mmc3_common_initialize(machine, 0xff, 0xff, 0);
r8990r8991
1280312803         state->mmc_prg_bank[3] = 0x7f;
1280412804         mmc3_set_prg(machine, state->mmc_prg_base, state->mmc_prg_mask);
1280512805         break;
12806         
12806
1280712807         // mapper 227
1280812808      case BMC_1200IN1:
1280912809         prg16_89ab(machine, 0);
1281012810         prg16_cdef(machine, 0);
1281112811         break;
12812         
12812
1281312813         // mapper 229
1281412814      case BMC_31IN1:
1281512815         prg16_89ab(machine, 0);
r8990r8991
1283312833         state->mmc_latch2 = 0x00;
1283412834         bf9096_set_prg(machine);
1283512835         break;
12836         
12836
1283712837         // mapper 243
1283812838      case SACHEN_74LS374_A:
1283912839         state->mmc_vrom_bank[0] = 3;
1284012840         chr8(machine, 3, CHRROM);
1284112841         set_nt_mirroring(machine, PPU_MIRROR_VERT);
1284212842         break;
12843         
12843
1284412844         // mapper 246
1284512845      case CNE_FSB:
1284612846         prg32(machine, 0xff);
r8990r8991
1285012850         state->mmc_reg[0] = 0;
1285112851         mmc3_common_initialize(machine, 0xff, 0xff, 0);
1285212852         break;
12853         
12853
1285412854         // mapper 254
1285512855      case BTL_PIKACHUY2K:
1285612856         state->mmc_reg[0] = 0xff;
1285712857         mmc3_common_initialize(machine, 0xff, 0xff, 0);
1285812858         break;
12859         
12859
1286012860         // mapper 255
1286112861      case BMC_110IN1:
1286212862         prg16_89ab(machine, 0);
1286312863         prg16_cdef(machine, 1);
1286412864         set_nt_mirroring(machine, PPU_MIRROR_VERT);
1286512865         break;
12866         
12866
1286712867         // UNIF only
1286812868      case BMC_64IN1NR:
1286912869         state->mmc_reg[0] = 0x80;
r8990r8991
1291912919         prg16_89ab(machine, 0);
1292012920         prg16_cdef(machine, state->prg_chunks - 1);
1292112921         break;
12922         
12922
1292312923      case BMC_BENSHENG_BS5:
1292412924         state->mmc_prg_bank[0] = 0xff;
1292512925         state->mmc_prg_bank[1] = 0xff;
r8990r8991
1292712927         state->mmc_prg_bank[3] = 0xff;
1292812928         bmc_bs5_update_banks(machine);
1292912929         break;
12930         
12930
1293112931      case BMC_810544:
1293212932         prg16_89ab(machine, 0);
1293312933         prg16_cdef(machine, 0);
1293412934         set_nt_mirroring(machine, PPU_MIRROR_VERT);
1293512935         break;
12936         
12936
1293712937      case BMC_G63IN1:
1293812938         bmc_gb63_update(machine);
1293912939         break;
12940         
12940
1294112941      case BMC_FK23C:
1294212942         state->mmc_reg[0] = 4;
1294312943         state->mmc_reg[1] = 0xff;
r8990r8991
1294712947         fk23c_set_prg(machine);
1294812948         fk23c_set_chr(machine);
1294912949         break;
12950         
12950
1295112951      case BMC_FK23CA:
1295212952         state->mmc_reg[0] = state->mmc_reg[1] = state->mmc_reg[2] = state->mmc_reg[3] = 0;
1295312953         state->mmc_reg[4] = state->mmc_reg[5] = state->mmc_reg[6] = state->mmc_reg[7] = 0xff;
r8990r8991
1295512955         fk23c_set_prg(machine);
1295612956         fk23c_set_chr(machine);
1295712957         break;
12958         
12959         
12958
12959
1296012960      case FFE_MAPPER6:
1296112961         prg16_89ab(machine, 0);
1296212962         prg16_cdef(machine, 7);
r8990r8991
1296812968         prg16_89ab(machine, 0);
1296912969         prg16_cdef(machine, state->prg_chunks - 1);
1297012970         break;
12971         
12971
1297212972      case UNSUPPORTED_BOARD:
1297312973      default:
1297412974         /* Mapper not supported */
1297512975         err = 2;
1297612976         break;
1297712977   }
12978   
12978
1297912979   return err;
1298012980}
1298112981
1298212982/*************************************************************
12983
12983
1298412984 nes_pcb_reset
12985
12985
1298612986 Resets the mmc bankswitch areas to their defaults.
1298712987 It returns a value "err" that indicates if it was
1298812988 successful. Possible values for err are:
12989
12989
1299012990 0 = success
1299112991 1 = no pcb found
1299212992 2 = pcb not supported
12993
12993
1299412994 *************************************************************/
1299512995
1299612996int nes_pcb_reset( running_machine *machine )
src/mess/machine/zx.c
r8990r8991
8080
8181MACHINE_RESET ( zx80 )
8282{
83   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(zx_setdirect, *machine));   
83   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(zx_setdirect, *machine));
8484   zx_tape_bit = 0x80;
8585}
8686
src/mess/machine/z80ne.c
r8990r8991
212212
213213   if (!nmi_delay_counter)
214214   {
215      cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(z80ne_default, *machine));     
215      cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(z80ne_default, *machine));
216216      cputag_set_input_line(machine, "z80ne", INPUT_LINE_NMI, PULSE_LINE);
217217   }
218218   return address;
r8990r8991
259259
260260   /* after the first 3 bytes have been read from ROM, switch the RAM back in */
261261   reset_delay_counter = 2;
262   space->set_direct_update_handler(direct_update_delegate_create_static(reset_delay_count, *machine));     
262   space->set_direct_update_handler(direct_update_delegate_create_static(reset_delay_count, *machine));
263263}
264264
265265static void reset_lx390_banking(running_machine *machine)
r8990r8991
277277       memory_set_bank(machine, "bank4", 0);  /* RAM   at 0xF000 */
278278      /* after the first 3 bytes have been read from ROM, switch the RAM back in */
279279      reset_delay_counter = 2;
280      space->set_direct_update_handler(direct_update_delegate_create_static(reset_delay_count, *machine));         
280      space->set_direct_update_handler(direct_update_delegate_create_static(reset_delay_count, *machine));
281281       break;
282282   case 0x02: /* EP548  16k BASIC */
283283      if (VERBOSE)
r8990r8991
517517    else
518518       /* after writing to port 0xF8 and the first ~M1 cycles strike a NMI for single step execution */
519519       nmi_delay_counter = 1;
520      cputag_get_address_space(space->machine, "z80ne", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(nmi_delay_count, *space->machine));               
520      cputag_get_address_space(space->machine, "z80ne", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(nmi_delay_count, *space->machine));
521521}
522522
523523
src/mess/machine/apple2gs.c
r8990r8991
16051605      if (opptr != NULL)
16061606      {
16071607         direct.explicit_configure(address, address, ~0, opptr - address);
1608         
1608
16091609         address = ~0;
16101610      }
16111611   }
r8990r8991
16901690   memory_install_read8_handler(space, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_r);
16911691   memory_install_write8_handler(space, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_w);
16921692   space->set_direct_update_handler(direct_update_delegate_create_static(apple2gs_opbase, *machine));
1693   
16941693
1694
16951695   /* install aux memory writes (for shadowing) */
16961696   memory_install_write8_handler(space, 0x010400, 0x0107FF, 0, 0, apple2gs_aux0400_w);
16971697   memory_install_write8_handler(space, 0x012000, 0x013FFF, 0, 0, apple2gs_aux2000_w);
src/mess/machine/mac.c
r8990r8991
18331833               }
18341834            }
18351835
1836//            mac->adb_timer_ticks = 8;
1837//            timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0);
1836//              mac->adb_timer_ticks = 8;
1837//              timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0);
18381838
18391839            if ((mac->adb_datasize == 0) && (mac->adb_streaming == MCU_STREAMING_NONE))
18401840            {
r8990r8991
18721872   ret = (mac->adb_send & 0x80)>>7;
18731873   mac->adb_send <<= 1;
18741874
1875//   printf("VIA IN CB2 = %x\n", ret);
1875//  printf("VIA IN CB2 = %x\n", ret);
18761876
18771877   return ret;
18781878}
r8990r8991
19641964   mac->adb_buffer[4] = 1;   // type
19651965   mac->adb_buffer[3] = 0;   // flag
19661966   mac->adb_buffer[2] = cmd; // command
1967   mac->adb_buffer[1] = mac->rtc_ram[addr];
1967   mac->adb_buffer[1] = mac->rtc_ram[addr];
19681968
19691969   mac->adb_state |= 1;
19701970   mac->adb_timer_ticks = 8;
r8990r8991
28342834       (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || ((mac->mac_model >= MODEL_MAC_II) && (mac->mac_model <= MODEL_MAC_SE30)) ||
28352835       (model == MODEL_MAC_PORTABLE) || (model == MODEL_MAC_PB100))
28362836   {
2837      cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(overlay_opbaseoverride, *machine));           
2837      cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(overlay_opbaseoverride, *machine));
28382838   }
28392839
28402840   /* setup keyboard */
src/mess/machine/nes.c
r8990r8991
449449}
450450
451451
452// FIXME: this is getting messier and messier (no pun intended). inputs reading should be simplified and port_categories cleaned up
452// FIXME: this is getting messier and messier (no pun intended). inputs reading should be simplified and port_categories cleaned up
453453// to also emulate the fact that nothing should be in Port 2 if there is a Crazy Climber pad, etc.
454454static void nes_read_input_device( running_machine *machine, int cfg, nes_input *vals, int pad_port, int supports_zapper )
455455{
456456   nes_state *state = machine->driver_data<nes_state>();
457457   static const char *const padnames[] = { "PAD1", "PAD2", "PAD3", "PAD4", "CC_LEFT", "CC_RIGHT" };
458   
458
459459   vals->i0 = 0;
460460   vals->i1 = 0;
461461   vals->i2 = 0;
462   
462
463463   switch (cfg & 0x0f)
464464   {
465465      case 0x01:   /* gamepad */
466466         if (pad_port >= 0)
467467            vals->i0 = input_port_read(machine, padnames[pad_port]);
468468         break;
469         
469
470470      case 0x02:   /* zapper 1 */
471471         if (supports_zapper)
472472         {
r8990r8991
475475            vals->i2 = input_port_read(machine, "ZAPPER1_Y");
476476         }
477477         break;
478         
478
479479      case 0x03:   /* zapper 2 */
480480         if (supports_zapper)
481481         {
r8990r8991
484484            vals->i2 = input_port_read(machine, "ZAPPER2_Y");
485485         }
486486         break;
487         
487
488488      case 0x04:   /* arkanoid paddle */
489489         if (pad_port == 1)
490490            vals->i0 = (UINT8) ((UINT8) input_port_read(machine, "PADDLE") + (UINT8)0x52) ^ 0xff;
491491         break;
492         
492
493493      case 0x05:   /* crazy climber controller */
494494         if (pad_port == 0)
495495         {
r8990r8991
556556   {
557557      if (data & 0x01)
558558         return;
559     
559
560560      if (LOG_JOY)
561561         logerror("joy 0 bits read: %d\n", state->in_0.shift);
562     
562
563563      /* Toggling bit 0 high then low resets both controllers */
564564      state->in_0.shift = 0;
565565      state->in_1.shift = 0;
566     
566
567567      /* Read the input devices */
568568      if ((cfg & 0x000f) != 0x06)
569569      {
r8990r8991
579579         nes_read_input_device(space->machine, 0, &state->in_3, 3, FALSE);
580580         nes_read_input_device(space->machine, cfg >>  0, &state->in_0, 0,  TRUE);
581581      }
582     
582
583583      if (cfg & 0x0f00)
584584         state->in_0.i0 |= (state->in_2.i0 << 8) | (0x08 << 16);
585     
585
586586      if (cfg & 0xf000)
587587         state->in_1.i0 |= (state->in_3.i0 << 8) | (0x04 << 16);
588588   }
r8990r8991
710710               state->prg_chunks = mapint3;
711711               state->chr_chunks = mapint4;
712712               logerror("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
713//               printf("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
713//                  printf("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
714714               goodcrcinfo = 1;
715715               state->ines20 = 0;
716716            }
r8990r8991
725725         }
726726
727727         state->hard_mirroring = (local_options & 0x01) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ;
728//         printf("%s\n", state->hard_mirroring & 0x01 ? "Vertical" : "Horizontal");
728//          printf("%s\n", state->hard_mirroring & 0x01 ? "Vertical" : "Horizontal");
729729         state->battery = local_options & 0x02;
730730         state->trainer = local_options & 0x04;
731731         state->four_screen_vram = local_options & 0x08;
r8990r8991
895895         /* Allocate internal Mapper RAM for boards which require it */
896896         if (state->pcb_id == STD_EXROM)
897897            state->mapper_ram = auto_alloc_array(image.device().machine, UINT8, 0x400);
898         
898
899899         if (state->pcb_id == TAITO_X1_005 || state->pcb_id == TAITO_X1_005_A)
900900            state->mapper_bram = auto_alloc_array(image.device().machine, UINT8, 0x80);
901         
901
902902         if (state->pcb_id == TAITO_X1_017)
903903            state->mapper_bram = auto_alloc_array(image.device().machine, UINT8, 0x1400);
904         
904
905905         if (state->pcb_id == NAMCOT_163)
906906            state->mapper_ram = auto_alloc_array(image.device().machine, UINT8, 0x2000);
907         
907
908908         /* Position past the header */
909909         image.fseek(16, SEEK_SET);
910910
r8990r8991
11231123                  logerror("[MIRR] chunk found.\n");
11241124                  image.fread(&buffer, 4);
11251125                  chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24);
1126                 
1126
11271127                  image.fread(&temp_byte, 1);
11281128                  switch (temp_byte)
11291129                  {
r8990r8991
11531153                        state->hard_mirroring = PPU_MIRROR_HORZ;
11541154                        break;
11551155                  }
1156                 
1156
11571157                  read_length += (chunk_length + 8);
11581158               }
11591159               else if ((magic2[0] == 'P') && (magic2[1] == 'C') && (magic2[2] == 'K'))
src/mess/machine/msx.c
r8990r8991
136136   if (strcmp(image.extrainfo(), ""))
137137      extra = image.extrainfo ();
138138
139   if (!extra)
139   if (!extra)
140140   {
141141      logerror("cart #%d: warning: no information in crc file\n", id);
142142      type = -1;
143143   }
144144   else if ((1 != sscanf(extra, "%d", &type) ) ||
145         type < 0 || type > SLOT_LAST_CARTRIDGE_TYPE)
145         type < 0 || type > SLOT_LAST_CARTRIDGE_TYPE)
146146   {
147147      logerror("cart #%d: warning: information in crc file not valid\n", id);
148148      type = -1;
149149   }
150   else
150   else
151151   {
152152      logerror ("cart #%d: info: cart extra info: '%s' = %s\n", id, extra,
153153                  msx_slot_list[type].name);
154154   }
155155
156156   /* if not, attempt autodetection */
157   if (type < 0)
157   if (type < 0)
158158   {
159159      type = msx_probe_type (mem, size);
160160
src/mess/machine/vectrex.c
r8990r8991
7979{
8080   UINT8 *mem = memory_region(image.device().machine, "maincpu");
8181   if (image.software_entry() == NULL)
82   {   
82   {
8383      image.fread( mem, 0x8000);
8484   } else {
8585      int size = image.get_software_region_length("rom");
src/mess/machine/nes_mmc.c
r8990r8991
8686    * 113 - HES 6-in-1 requires mirroring (check Bookyman playfield), while other games break with this (check AV Soccer)
8787    * 153 - Famicom Jump II uses a different board (or the same in a very different way)
8888    * 242 - DQ8 has no mirroring (missing graphics is due to other reasons though)
89
89
9090    crc_hacks have been added also to handle a few wiring settings which would require submappers:
9191    * CHR protection pins for mapper 185
9292    * VRC-2, VRC-4 and VRC-6 line wiring
r8990r8991
374374static void prg8_x( running_machine *machine, int start, int bank )
375375{
376376   nes_state *state = machine->driver_data<nes_state>();
377   
377
378378   assert(start < 4);
379379
380380   /* assumes that bank references an 8k chunk */
381381   bank &= ((state->prg_chunks << 1) - 1);
382   
382
383383   state->prg_bank[start] = bank;
384384   prg_bank_refresh(machine);
385385}
src/mess/machine/nes_mmc.h
r8990r8991
5050   /* Rex Soft */
5151   REXSOFT_SL1632, REXSOFT_DBZ5,
5252   /* Sachen */
53   SACHEN_8259A, SACHEN_8259B, SACHEN_8259C, SACHEN_8259D,
53   SACHEN_8259A, SACHEN_8259B, SACHEN_8259C, SACHEN_8259D,
5454   SACHEN_SA009, SACHEN_SA0036, SACHEN_SA0037,
5555   SACHEN_SA72007, SACHEN_SA72008, SACHEN_TCA01,
5656   SACHEN_TCU01, SACHEN_TCU02,
r8990r8991
9090   /* Misc: these are needed to convert mappers to boards, I will sort them later */
9191   OPENCORP_DAOU306, HES_BOARD, HES6IN1_BOARD, RUMBLESTATION_BOARD,
9292   MAGICSERIES_MD, KASING_BOARD, FUTUREMEDIA_BOARD, FUKUTAKE_BOARD, SOMERI_SL12,
93   HENGEDIANZI_BOARD, HENGEDIANZI_XJZB, SUBOR_TYPE0, SUBOR_TYPE1,
93   HENGEDIANZI_BOARD, HENGEDIANZI_XJZB, SUBOR_TYPE0, SUBOR_TYPE1,
9494   KAISER_KS7058, KAISER_KS7032, KAISER_KS7022, KAISER_KS7017, KAISER_KS202, CONY_BOARD,
9595   CNE_DECATHLON, CNE_FSB, CNE_SHLZ, RCM_GS2015, RCM_TETRISFAMILY,
9696   WAIXING_TYPE_A, WAIXING_TYPE_A_1, WAIXING_TYPE_B, WAIXING_TYPE_C, WAIXING_TYPE_D,
src/mess/machine/lisa.c
r8990r8991
11471147
11481148   videoROM_ptr = memory_region(machine, "gfx1");
11491149
1150   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine));     
1151   cputag_get_address_space(machine, "fdccpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_fdc_OPbaseoverride, *machine));     
1150   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine));
1151   cputag_get_address_space(machine, "fdccpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_fdc_OPbaseoverride, *machine));
11521152
11531153   m68k_set_reset_callback(machine->device("maincpu"), /*lisa_reset_instr_callback*/NULL);
11541154
src/mess/machine/lviv.c
r8990r8991
222222MACHINE_RESET( lviv )
223223{
224224   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
225   space->set_direct_update_handler(direct_update_delegate_create_static(lviv_directoverride, *machine));   
225   space->set_direct_update_handler(direct_update_delegate_create_static(lviv_directoverride, *machine));
226226
227227   lviv_video_ram = messram_get_ptr(machine->device("messram")) + 0xc000;
228228
src/mess/machine/nes_ines.c
r8990r8991
358358   { 172, TXC_22211B },
359359   { 173, TXC_22211C },
360360   // 174 Unused
361   { 175, KAISER_KS7022},
361   { 175, KAISER_KS7022},
362362   { 176, UNL_XZY },
363363   { 177, HENGEDIANZI_BOARD },
364364   { 178, WAIXING_SGZLZ },
r8990r8991
457457int nes_get_mmc_id( running_machine *machine, int mapper )
458458{
459459   const nes_mmc *mmc = nes_mapper_lookup(mapper);
460   
460
461461   if (mmc == NULL)
462462      fatalerror("Unimplemented Mapper %d", mapper);
463   
463
464464   return mmc->pcb_id;
465465}
src/mess/machine/apple1.c
r8990r8991
258258       addr <= end_addr;
259259       addr++, snapptr++)
260260      cputag_get_address_space(image.device().machine, "maincpu", ADDRESS_SPACE_PROGRAM)->write_byte(addr, *snapptr);
261     
262261
262
263263   return IMAGE_INIT_PASS;
264264}
265265
src/mess/machine/bebox.c
r8990r8991
945945static UINT32 scsi53c810_fetch(running_machine *machine, UINT32 dsp)
946946{
947947   UINT32 result;
948   result = cputag_get_address_space(machine, "ppc1", ADDRESS_SPACE_PROGRAM)->read_dword(dsp & 0x7FFFFFFF);   
948   result = cputag_get_address_space(machine, "ppc1", ADDRESS_SPACE_PROGRAM)->read_dword(dsp & 0x7FFFFFFF);
949949   return BYTE_REVERSE32(result);
950950}
951951
src/mess/machine/special.c
r8990r8991
269269   specimx_color = 0x70;
270270   timer_set(machine,  attotime_zero, NULL, 0, setup_pit8253_gates );
271271   running_device *fdc = machine->device("wd1793");
272   wd17xx_set_pause_time(fdc,12);   
272   wd17xx_set_pause_time(fdc,12);
273273   wd17xx_dden_w(fdc, 0);
274274}
275275
src/mess/machine/jupiter.c
r8990r8991
9191
9292   if (jupiter_data)
9393   {
94      logerror("data: %p. type: %d.\n", jupiter_data,   jupiter_data_type);     
94      logerror("data: %p. type: %d.\n", jupiter_data,   jupiter_data_type);
9595      space->set_direct_update_handler(direct_update_delegate_create_static(jupiter_opbaseoverride, *machine));
96     
96
9797   }
9898
9999   machine->add_notifier(MACHINE_NOTIFY_EXIT, jupiter_machine_stop);
src/mess/machine/rmnimbus.c
r8990r8991
13421342        debug_console_register_command(machine, "nimbus_intmasks", CMDFLAG_NONE, 0, 0, 0, execute_debug_intmasks);
13431343        debug_console_register_command(machine, "nimbus_debug", CMDFLAG_NONE, 0, 0, 1, nimbus_debug);
13441344
1345        /* set up the instruction hook */       
1345        /* set up the instruction hook */
13461346      machine->device(MAINCPU_TAG)->debug()->set_instruction_hook(instruction_hook);
13471347    }
13481348
src/mess/machine/tf20.c
r8990r8991
55    Dual floppy drive with HX-20 factory option
66
77
8    Status: Boots from system disk, missing µPD7201 emulation
8    Status: Boots from system disk, missing ??PD7201 emulation
99
1010***************************************************************************/
1111
src/mess/machine/c64.c
r8990r8991
608608
609609   c64_memory[0x000] = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM)->read_byte(0);
610610   c64_memory[0x001] = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM)->read_byte(1);
611   
611
612612}
613613
614614UINT8 c64_m6510_port_read( running_device *device, UINT8 direction )
r8990r8991
10481048
10491049      if (i >= C64_MAX_ROMBANK)
10501050         return IMAGE_INIT_FAIL;
1051     
1051
10521052      /* Start to parse the .crt header */
10531053      /* 0x16-0x17 is Hardware type */
10541054      image.fseek(0x16, SEEK_SET);
r8990r8991
11531153         /* Does CHIP contain any data? */
11541154         if (test != c64_cart.bank[i].size)
11551155            return IMAGE_INIT_FAIL;
1156         
1156
11571157         /* Advance to the next CHIP block */
11581158         i++;
11591159         j += chip_size;
r8990r8991
12241224                  a0_loaded = 1;
12251225               if (c64_cart.bank[ii].size > 0x3000)
12261226                  b0_loaded = 1;
1227//               printf("addr 0x8000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
1227//                  printf("addr 0x8000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
12281228            }
12291229
12301230            if (c64_cart.bank[ii].addr == 0x9000 && !_90_loaded)
r8990r8991
12351235                  a0_loaded = 1;
12361236               if (c64_cart.bank[ii].size > 0x2000)
12371237                  b0_loaded = 1;
1238//               printf("addr 0x9000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
1238//                  printf("addr 0x9000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
12391239            }
12401240
12411241            if (c64_cart.bank[ii].addr == 0xa000 && !a0_loaded)
r8990r8991
12441244               a0_loaded = 1;
12451245               if (c64_cart.bank[ii].size > 0x1000)
12461246                  b0_loaded = 1;
1247//               printf("addr 0xa000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
1247//                  printf("addr 0xa000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
12481248            }
12491249
12501250            if (c64_cart.bank[ii].addr == 0xb000 && !b0_loaded)
12511251            {
12521252               memcpy(roml + 0x3000, cart_cpy + c64_cart.bank[ii].start, c64_cart.bank[ii].size);
12531253               b0_loaded = 1;
1254//               printf("addr 0xb000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
1254//                  printf("addr 0xb000: 80 %d, 90 %d, a0 %d, b0 %d\n", _80_loaded, _90_loaded, a0_loaded, b0_loaded);
12551255            }
12561256
12571257            if (c64_cart.bank[ii].addr == 0xe000 && !e0_loaded)
r8990r8991
12601260               e0_loaded = 1;
12611261               if (c64_cart.bank[ii].size > 0x1000)
12621262                  f0_loaded = 1;
1263//               printf("addr 0xe000: e0 %d, f0 %d\n", e0_loaded, f0_loaded);
1263//                  printf("addr 0xe000: e0 %d, f0 %d\n", e0_loaded, f0_loaded);
12641264            }
12651265
12661266            if (c64_cart.bank[ii].addr == 0xf000 && !f0_loaded)
12671267            {
12681268               memcpy(romh + 0x1000, cart_cpy + c64_cart.bank[ii].start, c64_cart.bank[ii].size);
12691269               f0_loaded = 1;
1270//               printf("addr 0xe000: e0 %d, f0 %d\n", e0_loaded, f0_loaded);
1270//                  printf("addr 0xe000: e0 %d, f0 %d\n", e0_loaded, f0_loaded);
12711271            }
12721272         }
12731273      }
src/mess/machine/pc.c
r8990r8991
13551355   st->ppi_data_signal = 0;
13561356   st->ppi_shift_register = 0;
13571357   st->ppi_shift_enable = 0;
1358   
1358
13591359   pc_mouse_set_serial_port( machine->device("ins8250_0") );
13601360   pc_hdc_set_dma8237_device( st->dma8237 );
13611361   speaker_level_w( speaker, 0 );
src/mess/machine/cdic.h
r8990r8991
8484
8585}
8686
87#endif // _MACHINE_CDIC_H_
No newline at end of file
87#endif // _MACHINE_CDIC_H_
src/mess/machine/pk8020.c
r8990r8991
875875   floppy_mon_w(floppy_get_device(device->machine, 0), 1);
876876   floppy_mon_w(floppy_get_device(device->machine, 1), 1);
877877   floppy_mon_w(floppy_get_device(device->machine, 2), 1);
878   floppy_mon_w(floppy_get_device(device->machine, 3), 1);   
878   floppy_mon_w(floppy_get_device(device->machine, 3), 1);
879879   wd17xx_set_side(fdc,BIT(data,4));
880880   if (BIT(data,0)) {
881881      wd17xx_set_drive(fdc,0);
src/mess/video/x68k.c
r8990r8991
5151/*
5252static bitmap_t* x68k_get_gfx_page(int pri,int type)
5353{
54   if(type == GFX16)
55   {
56      switch(pri)
57      {
58      case 0:
59         return x68k_gfx_0_bitmap_16;
60      case 1:
61         return x68k_gfx_1_bitmap_16;
62      case 2:
63         return x68k_gfx_2_bitmap_16;
64      case 3:
65         return x68k_gfx_3_bitmap_16;
66      default:
67         return x68k_gfx_0_bitmap_16;  // should never reach here.
68      }
69   }
70   if(type == GFX256)
71   {
72      switch(pri)
73      {
74      case 0:
75      case 1:
76         return x68k_gfx_0_bitmap_256;
77      case 2:
78      case 3:
79         return x68k_gfx_1_bitmap_256;
80      default:
81         return x68k_gfx_0_bitmap_256;  // should never reach here.
82      }
83   }
84   if(type == GFX65536)
85      return x68k_gfx_0_bitmap_65536;
54    if(type == GFX16)
55    {
56        switch(pri)
57        {
58        case 0:
59            return x68k_gfx_0_bitmap_16;
60        case 1:
61            return x68k_gfx_1_bitmap_16;
62        case 2:
63            return x68k_gfx_2_bitmap_16;
64        case 3:
65            return x68k_gfx_3_bitmap_16;
66        default:
67            return x68k_gfx_0_bitmap_16;  // should never reach here.
68        }
69    }
70    if(type == GFX256)
71    {
72        switch(pri)
73        {
74        case 0:
75        case 1:
76            return x68k_gfx_0_bitmap_256;
77        case 2:
78        case 3:
79            return x68k_gfx_1_bitmap_256;
80        default:
81            return x68k_gfx_0_bitmap_256;  // should never reach here.
82        }
83    }
84    if(type == GFX65536)
85        return x68k_gfx_0_bitmap_65536;
8686
87   return NULL;  // should never reach here either.
87    return NULL;  // should never reach here either.
8888}
8989*/
9090static void x68k_crtc_text_copy(int src, int dest)
r8990r8991
432432            break;
433433         }
434434      }
435/*      if(ACCESSING_BITS_8_15)
436      {
437         x68k_sys.crtc.interlace = 0;
438         if(data & 0x0400)
439            x68k_sys.crtc.interlace = 1;
440      }*/
435/*      if(ACCESSING_BITS_8_15)
436        {
437            x68k_sys.crtc.interlace = 0;
438            if(data & 0x0400)
439                x68k_sys.crtc.interlace = 1;
440        }*/
441441      x68k_crtc_refresh_mode(space->machine);
442442      break;
443443   case 576:  // operation register
r8990r8991
499499
500500WRITE16_HANDLER( x68k_gvram_w )
501501{
502//   int xloc,yloc,pageoffset;
502//  int xloc,yloc,pageoffset;
503503   /*
504504       G-VRAM usage is determined by colour depth and "real" screen size.
505505
src/mess/video/vic6567.c
r8990r8991
378378      vic2->first_ba_cycle = vic2->cycles_counter;
379379      if ((vic2->rdy_workaround_cb != NULL) && (vic2->rdy_workaround_cb(machine) != 7 ))
380380      {
381//         cpu_suspend(machine->firstcpu, SUSPEND_REASON_SPIN, 0);
381//          cpu_suspend(machine->firstcpu, SUSPEND_REASON_SPIN, 0);
382382      }
383383      vic2->cpu_suspended = 1;
384384   }
r8990r8991
391391   {
392392      if ((vic2->rdy_workaround_cb != NULL))
393393      {
394//   cpu_resume(machine->firstcpu, SUSPEND_REASON_SPIN);
394//  cpu_resume(machine->firstcpu, SUSPEND_REASON_SPIN);
395395      }
396396      vic2->cpu_suspended = 0;
397397   }
r8990r8991
452452// Video matrix access
453453INLINE void vic2_matrix_access( running_machine *machine, vic2_state *vic2 )
454454{
455//   if (vic2->cpu_suspended == 1)
455//  if (vic2->cpu_suspended == 1)
456456   {
457457      if ((vic2->cycles_counter - vic2->first_ba_cycle) < 0)
458458         vic2->matrix_line[vic2->ml_index] = vic2->color_line[vic2->ml_index] = 0xff;
r8990r8991
10051005   UINT8 vic_cycles = (vic2->cycles_counter + 1) & 0xff;
10061006   vic2->cycles_counter++;
10071007
1008//   printf("%02x %02x %02x\n",cpu_cycles,vic_cycles,rdy_cycles);
1008//  printf("%02x %02x %02x\n",cpu_cycles,vic_cycles,rdy_cycles);
10091009/*
10101010if (input_code_pressed(machine, KEYCODE_X))
10111011{
r8990r8991
10281028if (input_code_pressed_once(machine, KEYCODE_C)) adjust[0]++;
10291029if (input_code_pressed_once(machine, KEYCODE_V)) adjust[0]--;
10301030if (input_code_pressed_once(machine, KEYCODE_Z)) printf("b:%02x 1:%02x 2:%02x 3:%02x 4:%02x 5:%02x 6:%02x 7:%02x 8:%02x\n",
1031                        adjust[0],adjust[1],adjust[2],adjust[3],adjust[4],adjust[5],adjust[6],adjust[7],adjust[8]);
1031                                adjust[0],adjust[1],adjust[2],adjust[3],adjust[4],adjust[5],adjust[6],adjust[7],adjust[8]);
10321032}
10331033*/
10341034
r8990r8991
10411041      {
10421042         vic2->vblanking = 1;
10431043
1044//         if (LIGHTPEN_BUTTON)
1044//          if (LIGHTPEN_BUTTON)
10451045         {
10461046            /* lightpen timer start */
10471047            timer_set(machine, attotime_make(0, 0), vic2, 1, vic2_timer_timeout);
r8990r8991
16321632      {
16331633         vic2->vblanking = 1;
16341634
1635//         if (LIGHTPEN_BUTTON)
1635//          if (LIGHTPEN_BUTTON)
16361636         {
16371637            /* lightpen timer starten */
16381638            timer_set(machine, attotime_make(0, 0), vic2, 1, vic2_timer_timeout);
src/mess/video/kc.c
r8990r8991
111111/* set new blink state - record blink state in event list */
112112void kc85_video_set_blink_state(running_machine *machine, int data)
113113{
114//   EventList_AddItemOffset(machine, KC85_VIDEO_EVENT_SET_BLINK_STATE, ((data & 0x01)<<7), machine->firstcpu->attotime_to_cycles(attotime_mul(machine->primary_screen->scan_period(), machine->primary_screen->vpos())));
114//  EventList_AddItemOffset(machine, KC85_VIDEO_EVENT_SET_BLINK_STATE, ((data & 0x01)<<7), machine->firstcpu->attotime_to_cycles(attotime_mul(machine->primary_screen->scan_period(), machine->primary_screen->vpos())));
115115}
116116
117117
r8990r8991
496496{
497497   int cycles_remaining_in_frame = KC85_CYCLES_PER_FRAME;
498498
499//   EVENT_LIST_ITEM *pItem;
499//  EVENT_LIST_ITEM *pItem;
500500//    int NumItems;
501501
502502   struct video_update_state video_update;
503//   int cycles_offset = 0;
503//  int cycles_offset = 0;
504504
505505   video_update.render_x = 0;
506506   video_update.render_y = 0;
r8990r8991
516516   video_update.vertical.cycles_remaining_in_state = vertical_graphics_state_lines[video_update.vertical.state];
517517   video_update.vertical.cycles_remaining = KC85_CYCLES_PER_FRAME;
518518
519//   /* first item in list */
520//   pItem = EventList_GetFirstItem();
521//   /* number of items remaining */
522//   NumItems = EventList_NumEvents();
519//  /* first item in list */
520//  pItem = EventList_GetFirstItem();
521//  /* number of items remaining */
522//  NumItems = EventList_NumEvents();
523523//
524//   while (NumItems)
525//   {
526//      int delta_cycles;
524//  while (NumItems)
525//  {
526//      int delta_cycles;
527527//
528//      /* number of cycles until event will trigger */
529//      delta_cycles = pItem->Event_Time - cycles_offset;
528//      /* number of cycles until event will trigger */
529//      delta_cycles = pItem->Event_Time - cycles_offset;
530530//
531//      //logerror("cycles between this event and next: %d\n",delta_cycles);
532//      kc85_common_vh_process_lines(&video_update, delta_cycles);
531//      //logerror("cycles between this event and next: %d\n",delta_cycles);
532//      kc85_common_vh_process_lines(&video_update, delta_cycles);
533533//
534//      /* update number of cycles remaining in frame */
535//      cycles_remaining_in_frame -= delta_cycles;
536//      /* set new blink state */
537//      kc85_blink_state = pItem->Event_Data;
534//      /* update number of cycles remaining in frame */
535//      cycles_remaining_in_frame -= delta_cycles;
536//      /* set new blink state */
537//      kc85_blink_state = pItem->Event_Data;
538538//
539//      /* set new cycles into frame */
540//      cycles_offset = pItem->Event_Time;
541//      /* next event */
542//      pItem++;
543//      /* update number of events remaining */
544//      NumItems--;
545//   }
539//      /* set new cycles into frame */
540//      cycles_offset = pItem->Event_Time;
541//      /* next event */
542//      pItem++;
543//      /* update number of events remaining */
544//      NumItems--;
545//  }
546546
547547
548548   /* process remainder */
549549   kc85_common_vh_process_lines(&video_update, cycles_remaining_in_frame);
550//   EventList_Reset();
551//   EventList_SetOffsetStartTime ( machine->firstcpu->attotime_to_cycles(attotime_mul(machine->primary_screen->scan_period(), machine->primary_screen->vpos())) );
550//  EventList_Reset();
551//  EventList_SetOffsetStartTime ( machine->firstcpu->attotime_to_cycles(attotime_mul(machine->primary_screen->scan_period(), machine->primary_screen->vpos())) );
552552}
553553
554554
r8990r8991
559559static void kc85_common_vh_start(running_machine *machine)
560560{
561561   kc85_blink_state = 0;
562//   EventList_Initialise(machine, 30000);
562//  EventList_Initialise(machine, 30000);
563563}
564564
565565static unsigned char *kc85_4_display_video_ram;
src/mess/includes/nes.h
r8990r8991
9292   UINT8 mmc5_high_chr;
9393   UINT8 mmc5_split_scr;
9494   UINT8 *extended_ntram;
95   
95
9696   UINT8 mmc5_last_chr_a;
9797   UINT16 mmc5_vrom_regA[8];
9898   UINT16 mmc5_vrom_regB[4];
src/mess/includes/x1.h
r8990r8991
5353
5454extern const device_type X1_KEYBOARD;
5555
56#endif /* X1_H_ */
No newline at end of file
56#endif /* X1_H_ */
src/mess/includes/spectrum.h
r8990r8991
146146void    EventList_AddItemOffset(running_machine *machine, int ID, int Data,int Time);
147147int     EventList_NumEvents(void);
148148EVENT_LIST_ITEM *EventList_GetFirstItem(void);
149           
149
150150/*----------- defined in video/timex.c -----------*/
151151extern VIDEO_EOF( ts2068 );
152152extern VIDEO_UPDATE( ts2068 );
src/mess/includes/fmtowns.h
r8990r8991
7878   static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, towns_state(machine)); }
7979   towns_state(running_machine &machine)
8080      : driver_data_t(machine) { }
81     
81
8282   UINT8 ftimer;
8383   UINT8 nmi_mask;
8484   UINT8 compat_mode;
src/mess/includes/einstein.h
r8990r8991
185185
186186extern const device_type EINSTEIN_FIRE_DAISY;
187187
188#endif /* EINSTEIN_H_ */
No newline at end of file
188#endif /* EINSTEIN_H_ */
src/mess/formats/d88_dsk.c
r8990r8991
311311
312312   if(floppy_image_size(floppy) == size)
313313   {
314      *vote = 100;     
314      *vote = 100;
315315   }
316316   else
317317   {
r8990r8991
348348   tag->disk_type = type;
349349   tag->heads = 2;
350350   if (tag->disk_type==0x30 || tag->disk_type==0x40) tag->heads = 1;
351   
351
352352   tag->image_size = size;
353353   for(x=0;x<164;x++)
354354      tag->trackoffset[x] = offs[x];
src/mess/formats/timex_dck.c
r8990r8991
3838{
3939   int file_size;
4040   UINT8 * file_data;
41   
41
4242   int chunks_in_file = 0;
43   
43
4444   int i;
45   
45
4646   logerror ("Trying to load cart\n");
47   
47
4848   file_size = image.length();
49   
49
5050   if (file_size < 0x09)
5151   {
5252      logerror ("Bad file size\n");
5353      return IMAGE_INIT_FAIL;
5454   }
55   
55
5656   file_data = (UINT8 *)malloc(file_size);
5757   if (file_data == NULL)
5858   {
5959      logerror ("Memory allocating error\n");
6060      return IMAGE_INIT_FAIL;
6161   }
62   
62
6363   image.fread(file_data, file_size);
64   
64
6565   for (i=0; i<8; i++)
6666      if(file_data[i+1]&0x02) chunks_in_file++;
67   
67
6868   if (chunks_in_file*0x2000+0x09 != file_size)
6969   {
7070      free (file_data);
7171      logerror ("File corrupted\n");
7272      return IMAGE_INIT_FAIL;
7373   }
74   
74
7575   switch (file_data[0x00])
7676   {
7777      case 0x00:  logerror ("DOCK cart\n");
r8990r8991
102102            }
103103            free (file_data);
104104            break;
105   
105
106106      default:    logerror ("Cart type not supported\n");
107107            free (file_data);
108108            timex_cart_type = TIMEX_CART_NONE;
109109            return IMAGE_INIT_FAIL;
110110   }
111   
111
112112   logerror ("Cart loaded\n");
113113   logerror ("Chunks %02x\n", timex_cart_chunks);
114114   return IMAGE_INIT_PASS;
src/mess/messdriv.c
r8990r8991
4747   DRIVER( a7800 )    /* Atari 7800 NTSC   */
4848   DRIVER( a7800p )   /* Atari 7800 PAL      */
4949   DRIVER( lynx )     /* Atari Lynx Handheld      */
50//   DRIVER( lynx2 )    /* Atari Lynx II Handheld redesigned, no additions  */
50//  DRIVER( lynx2 ) /* Atari Lynx II Handheld redesigned, no additions  */
5151   DRIVER( jaguar )   /* Atari Jaguar  */
5252   DRIVER( jaguarcd )  /* Atari Jaguar CD    */
5353
r8990r8991
762762
763763   /* TI 99 clones */
764764   DRIVER( tutor)     /* 1983? Tomy Tutor    */
765   DRIVER( pyuuta )   /* 1982 Tomy Pyuuta      */
765   DRIVER( pyuuta )   /* 1982 Tomy Pyuuta     */
766766   DRIVER( geneve )   /* 1987? Myarc Geneve 9640    */
767767   DRIVER( genmod )   /* 199?? Myarc Geneve 9640    */
768768   DRIVER( ti99_4p )   /* 1996 SNUG 99/4P (a.k.a. SGCPU)      */
src/mess/drivers/3do.c
r8990r8991
158158
159159   MDRV_MACHINE_RESET( 3do )
160160
161//   MDRV_VIDEO_START( generic_bitmapped )
162//   MDRV_VIDEO_UPDATE( generic_bitmapped )
161//  MDRV_VIDEO_START( generic_bitmapped )
162//  MDRV_VIDEO_UPDATE( generic_bitmapped )
163163   MDRV_VIDEO_START( _3do )
164164   MDRV_VIDEO_UPDATE( _3do )
165165
src/mess/drivers/pc6001.c
r8990r8991
1919        B) It's easier to me to see what the attribute vram does since I don't
2020           have any docs atm.
2121
22   TODO (game specific):
23   - (several AX* games, namely Galaxy Mission Part 1/2 and others): inputs doesn't work
24   - AX6 - Demo: When AY-based speech talks, other emus emulates the screen drawing to be a solid green (plain PC-6001) or solid white (Mk2 version),
25                 but, according to an original video reference that I've seen, that screen should actually some kind of weird garbage on it ...
26   - AX6 - Powered Knight: doesn't work too well, according to the asm code it asks the player to press either 'B' or 'C' then a number but
27                           nothing is shown on screen, other emus behaves the same, bad dump?
28   (Mk2 mode 5 games)
29   - 3D Golf Simulation Super Version: gameplay / inputs looks broken
30   - American Truck: Screen is offset at the loading screen, loading bug?
31   - Castle Excellent: copyright text drawing is quite bogus, scans text in vertical instead of horizontal?
32   - Dezeni Land (ALL versions) / Hurry Fox 1/2: asks you to "load something", can't do it with current cassette kludge, also, for Dezeni Land(s) keyboard irqs
33                                                 doesn't seem to work too well with halt opcode execution?
34   - Dezeni Land 1/4: dies after loading of main program
35   - Dezeni Land 2: dies at the "load something" screen with presumably wrong stack opcodes
36   - (MyCom BASIC games with multiple files): most of them refuses to run ... how to load them?
37   - Grobda: when "get ready" speech plays, screen should be full white but instead it's all black, same issue as AX-6 Demo?
38   - Pac-Man / Tiny Xevious 2: gameplay is too fast
39   - Salad no Kunino Tomato-Hime: can't start a play
40   - Space Harrier: inputs doesn't work properly
41   - The Black Onyx: dies when it attempts to save the character, that obviously means saving on the tape
42   - Yakyukyo / Punchball Mario: waits for an irq, check which one;
22    TODO (game specific):
23    - (several AX* games, namely Galaxy Mission Part 1/2 and others): inputs doesn't work
24    - AX6 - Demo: When AY-based speech talks, other emus emulates the screen drawing to be a solid green (plain PC-6001) or solid white (Mk2 version),
25                  but, according to an original video reference that I've seen, that screen should actually some kind of weird garbage on it ...
26    - AX6 - Powered Knight: doesn't work too well, according to the asm code it asks the player to press either 'B' or 'C' then a number but
27                            nothing is shown on screen, other emus behaves the same, bad dump?
28    (Mk2 mode 5 games)
29    - 3D Golf Simulation Super Version: gameplay / inputs looks broken
30    - American Truck: Screen is offset at the loading screen, loading bug?
31    - Castle Excellent: copyright text drawing is quite bogus, scans text in vertical instead of horizontal?
32    - Dezeni Land (ALL versions) / Hurry Fox 1/2: asks you to "load something", can't do it with current cassette kludge, also, for Dezeni Land(s) keyboard irqs
33                                                  doesn't seem to work too well with halt opcode execution?
34    - Dezeni Land 1/4: dies after loading of main program
35    - Dezeni Land 2: dies at the "load something" screen with presumably wrong stack opcodes
36    - (MyCom BASIC games with multiple files): most of them refuses to run ... how to load them?
37    - Grobda: when "get ready" speech plays, screen should be full white but instead it's all black, same issue as AX-6 Demo?
38    - Pac-Man / Tiny Xevious 2: gameplay is too fast
39    - Salad no Kunino Tomato-Hime: can't start a play
40    - Space Harrier: inputs doesn't work properly
41    - The Black Onyx: dies when it attempts to save the character, that obviously means saving on the tape
42    - Yakyukyo / Punchball Mario: waits for an irq, check which one;
4343
4444========================================================================================================================================================
4545
r8990r8991
9797==================================================================================
9898
9999PC-6001 irq table:
100irq vector 0x00: writes 0x00 to [$fa19]                                            ;(unused)
100irq vector 0x00: writes 0x00 to [$fa19]                                                     ;(unused)
101101irq vector 0x02: (A = 0, B = 0) tests ppi port c, does something with ay ports (plus more?) ;keyboard data ready, no kanji lock, no caps lock
102irq vector 0x04:                                                          ;uart irq
103irq vector 0x06: operates with $fa28, $fa2e, $fd1b                                  ;timer irq
104irq vector 0x08: tests ppi port c, puts port A to $fa1d,puts 0x02 to [$fa19]             ;tape data ready
105irq vector 0x0a: writes 0x00 to [$fa19]                                          ;(unused)
106irq vector 0x0c: writes 0x00 to [$fa19]                                          ;(unused)
107irq vector 0x0e: same as 2, (A = 0x03, B = 0x00)                                  ;keyboard data ready, unknown type
108irq vector 0x10: same as 2, (A = 0x03, B = 0x00)                                 ;(unused)
109irq vector 0x12: writes 0x10 to [$fa19]                                        ;end of tape reached
110irq vector 0x14: same as 2, (A = 0x00, B = 0x01)                                  ;kanji lock enabled
111irq vector 0x16: tests ppi port c, writes the result to $feca.                         ;joystick
112irq vector 0x18:                                                          ;TVR (?)
113irq vector 0x1a:                                                          ;Date
114irq vector 0x1c:                                                          ;(unused)
115irq vector 0x1e:                                                          ;(unused)
116irq vector 0x20:                                                          ;voice
117irq vector 0x22:                                                          ;VRTC (?)
118irq vector 0x24:                                                          ;(unused)
119irq vector 0x26:                                                          ;(unused)
102irq vector 0x04:                                                                            ;uart irq
103irq vector 0x06: operates with $fa28, $fa2e, $fd1b                                          ;timer irq
104irq vector 0x08: tests ppi port c, puts port A to $fa1d,puts 0x02 to [$fa19]                ;tape data ready
105irq vector 0x0a: writes 0x00 to [$fa19]                                                     ;(unused)
106irq vector 0x0c: writes 0x00 to [$fa19]                                                     ;(unused)
107irq vector 0x0e: same as 2, (A = 0x03, B = 0x00)                                            ;keyboard data ready, unknown type
108irq vector 0x10: same as 2, (A = 0x03, B = 0x00)                                            ;(unused)
109irq vector 0x12: writes 0x10 to [$fa19]                                                     ;end of tape reached
110irq vector 0x14: same as 2, (A = 0x00, B = 0x01)                                            ;kanji lock enabled
111irq vector 0x16: tests ppi port c, writes the result to $feca.                              ;joystick
112irq vector 0x18:                                                                            ;TVR (?)
113irq vector 0x1a:                                                                            ;Date
114irq vector 0x1c:                                                                            ;(unused)
115irq vector 0x1e:                                                                            ;(unused)
116irq vector 0x20:                                                                            ;voice
117irq vector 0x22:                                                                            ;VRTC (?)
118irq vector 0x24:                                                                            ;(unused)
119irq vector 0x26:                                                                            ;(unused)
120120
121121
122122*******************************************************************************************************************************************************/
r8990r8991
410410               int pen[2];
411411
412412               /*
413               palette reference:
414               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05,
415                                   0x02, 0x06, 0x03, 0x07,
416                                   0x08, 0x0c, 0x09, 0x0d,
417                                   0x0a, 0x0e, 0x0b, 0x0f };
413                    palette reference:
414                    UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05,
415                                        0x02, 0x06, 0x03, 0x07,
416                                        0x08, 0x0c, 0x09, 0x0d,
417                                        0x0a, 0x0e, 0x0b, 0x0f };
418418
419               color |= pal_num[(pen[0] & 3) | ((pen[1] & 3) << 2)];
420               */
419                    color |= pal_num[(pen[0] & 3) | ((pen[1] & 3) << 2)];
420                    */
421421
422422               pen[0] = pc6001_video_ram[count+0x0000] >> (6-i*2) & 3;
423423               pen[1] = pc6001_video_ram[count+0x2000] >> (6-i*2) & 3;
r8990r8991
453453               int pen[2];
454454
455455               /*
456               palette reference:
457               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05 };
456                    palette reference:
457                    UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05 };
458458
459               color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)];
460               */
459                    color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)];
460                    */
461461
462462               pen[0] = pc6001_video_ram[count+0x0000] >> (7-i) & 1;
463463               pen[1] = pc6001_video_ram[count+0x2000] >> (7-i) & 1;
r8990r8991
496496         for(x=0;x<40;x++)
497497         {
498498            /*
499            exgfx attr format:
500            x--- ---- rom bank select
501            -xxx ---- bg color
502            ---- xxxx fg color
503            Note that the exgfx banks a different gfx ROM
504            */
499                exgfx attr format:
500                x--- ---- rom bank select
501                -xxx ---- bg color
502                ---- xxxx fg color
503                Note that the exgfx banks a different gfx ROM
504                */
505505            tile = pc6001_video_ram[(x+(y*40))+0x400] + 0x200;
506506            attr = pc6001_video_ram[(x+(y*40)) & 0x3ff];
507507            tile+= ((attr & 0x80) << 1);
r8990r8991
940940
941941   bank_r0 = data;
942942
943//   printf("%02x BANK | %02x\n",data,bank_opt);
943//  printf("%02x BANK | %02x\n",data,bank_opt);
944944   memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][0]]);
945945   memory_set_bankptr(space->machine, "bank2", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][1]]);
946946   memory_set_bankptr(space->machine, "bank3", &ROM[banksw_table_r0[((data & 0xf0)>>4)+(bank_opt*0x10)][2]]);
r8990r8991
959959
960960   bank_r1 = data;
961961
962//   printf("%02x BANK\n",data);
962//  printf("%02x BANK\n",data);
963963   memory_set_bankptr(space->machine, "bank5", &ROM[banksw_table_r1[(data & 0xf)+(bank_opt*0x10)][0]]);
964964   memory_set_bankptr(space->machine, "bank6", &ROM[banksw_table_r1[(data & 0xf)+(bank_opt*0x10)][1]]);
965965   memory_set_bankptr(space->machine, "bank7", &ROM[banksw_table_r1[((data & 0xf0)>>4)+(bank_opt*0x10)][2]]);
r8990r8991
977977   UINT8 *gfx_data = memory_region(space->machine, "gfx1");
978978
979979   /*
980   0 - TVROM / VOICE ROM
981   1 - KANJI ROM bank 0
982   2 - KANJI ROM bank 1
983   3 - TVROM / VOICE ROM
984   */
980    0 - TVROM / VOICE ROM
981    1 - KANJI ROM bank 0
982    2 - KANJI ROM bank 1
983    3 - TVROM / VOICE ROM
984    */
985985   bank_opt = data & 3;
986986
987987   memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(bank_r0 & 0xf)+(bank_opt*0x10)][0]]);
r8990r8991
10521052{
10531053   UINT8 *work_ram = memory_region(machine, "maincpu");
10541054
1055//   popmessage("%02x",vram_bank);
1055//  popmessage("%02x",vram_bank);
10561056
10571057   switch(vram_bank & 0x66)
10581058   {
r8990r8991
11031103
11041104static WRITE8_HANDLER( pc6001m2_vram_bank_w )
11051105{
1106//   UINT32 startaddr[] = {WRAM(6), WRAM(6), WRAM(0), WRAM(4) };
1106//  UINT32 startaddr[] = {WRAM(6), WRAM(6), WRAM(0), WRAM(4) };
11071107
11081108   ex_vram_bank = data;
11091109   vram_bank_change(space->machine,(ex_vram_bank & 0x06) | ((sys_latch & 0x06) << 4));
r8990r8991
11301130      }
11311131   }
11321132
1133//   popmessage("%02x",data);
1133//  popmessage("%02x",data);
11341134
1135//   pc6001_video_ram = work_ram + startaddr[(data >> 1) & 0x03];
1135//  pc6001_video_ram = work_ram + startaddr[(data >> 1) & 0x03];
11361136}
11371137
11381138static WRITE8_HANDLER( pc6001m2_col_bank_w )
r8990r8991
11821182static WRITE8_HANDLER( pc6001m2_0xf3_w )
11831183{
11841184   /*
1185   x--- ---- M1 (?) wait setting
1186   -x-- ---- ROM wait setting
1187   --x- ---- RAM wait setting
1188   ---x ---- custom irq 2 address output
1189   ---- x--- custom irq 1 address output
1190   ---- -x-- timer irq mask 2 (mirror?)
1191   ---- --x- custom irq 2 mask
1192   ---- ---x custom irq 1 mask
1193   */
1185    x--- ---- M1 (?) wait setting
1186    -x-- ---- ROM wait setting
1187    --x- ---- RAM wait setting
1188    ---x ---- custom irq 2 address output
1189    ---- x--- custom irq 1 address output
1190    ---- -x-- timer irq mask 2 (mirror?)
1191    ---- --x- custom irq 2 mask
1192    ---- ---x custom irq 1 mask
1193    */
11941194   timer_irq_mask2 = data & 4;
11951195}
11961196
r8990r8991
12711271   AM_RANGE(0xf1, 0xf1) AM_READWRITE(pc6001m2_bank_r1_r,pc6001m2_bank_r1_w)
12721272   AM_RANGE(0xf2, 0xf2) AM_READWRITE(pc6001m2_bank_w0_r,pc6001m2_bank_w0_w)
12731273   AM_RANGE(0xf3, 0xf3) AM_WRITE(pc6001m2_0xf3_w)
1274//   AM_RANGE(0xf4
1275//   AM_RANGE(0xf5
1274//  AM_RANGE(0xf4
1275//  AM_RANGE(0xf5
12761276   AM_RANGE(0xf6, 0xf6) AM_WRITE(pc6001m2_timer_adj_w)
12771277   AM_RANGE(0xf7, 0xf7) AM_WRITE(pc6001m2_timer_irqv_w)
12781278ADDRESS_MAP_END
r8990r8991
13021302
13031303   AM_RANGE(0xb0, 0xb0) AM_WRITE(pc6001m2_system_latch_w)
13041304   /* these are disk related */
1305//   AM_RANGE(0xb1
1306//   AM_RANGE(0xb2
1307//   AM_RANGE(0xb3
1305//  AM_RANGE(0xb1
1306//  AM_RANGE(0xb2
1307//  AM_RANGE(0xb3
13081308
13091309   AM_RANGE(0xc0, 0xc0) AM_WRITE(pc6001m2_col_bank_w)
13101310   AM_RANGE(0xc1, 0xc1) AM_WRITE(pc6001m2_vram_bank_w)
r8990r8991
13181318   AM_RANGE(0xf1, 0xf1) AM_READWRITE(pc6001m2_bank_r1_r,pc6001m2_bank_r1_w)
13191319   AM_RANGE(0xf2, 0xf2) AM_READWRITE(pc6001m2_bank_w0_r,pc6001m2_bank_w0_w)
13201320   AM_RANGE(0xf3, 0xf3) AM_WRITE(pc6001m2_0xf3_w)
1321//   AM_RANGE(0xf4
1322//   AM_RANGE(0xf5
1321//  AM_RANGE(0xf4
1322//  AM_RANGE(0xf5
13231323   AM_RANGE(0xf6, 0xf6) AM_WRITE(pc6001m2_timer_adj_w)
13241324   AM_RANGE(0xf7, 0xf7) AM_WRITE(pc6001m2_timer_irqv_w)
13251325ADDRESS_MAP_END
r8990r8991
15131513
15141514   AM_RANGE(0xb0, 0xb0) AM_WRITE(pc6001sr_system_latch_w)
15151515   /* these are disk related */
1516//   AM_RANGE(0xb1
1517//   AM_RANGE(0xb2
1518//   AM_RANGE(0xb3
1516//  AM_RANGE(0xb1
1517//  AM_RANGE(0xb2
1518//  AM_RANGE(0xb3
15191519
1520//   AM_RANGE(0xc0, 0xc0) AM_WRITE(pc6001m2_col_bank_w)
1521//   AM_RANGE(0xc1, 0xc1) AM_WRITE(pc6001m2_vram_bank_w)
1522//   AM_RANGE(0xc2, 0xc2) AM_WRITE(pc6001m2_opt_bank_w)
1520//  AM_RANGE(0xc0, 0xc0) AM_WRITE(pc6001m2_col_bank_w)
1521//  AM_RANGE(0xc1, 0xc1) AM_WRITE(pc6001m2_vram_bank_w)
1522//  AM_RANGE(0xc2, 0xc2) AM_WRITE(pc6001m2_opt_bank_w)
15231523
15241524   AM_RANGE(0xc8, 0xc8) AM_WRITE(pc6001sr_mode_w)
15251525   AM_RANGE(0xc9, 0xc9) AM_WRITE(pc6001sr_vram_bank_w)
r8990r8991
15281528
15291529   AM_RANGE(0xe0, 0xe3) AM_MIRROR(0x0c) AM_READWRITE(upd7752_reg_r,upd7752_reg_w)
15301530
1531//   AM_RANGE(0xf0, 0xf0) AM_READWRITE(pc6001m2_bank_r0_r,pc6001m2_bank_r0_w)
1532//   AM_RANGE(0xf1, 0xf1) AM_READWRITE(pc6001m2_bank_r1_r,pc6001m2_bank_r1_w)
1533//   AM_RANGE(0xf2, 0xf2) AM_READWRITE(pc6001m2_bank_w0_r,pc6001m2_bank_w0_w)
1531//  AM_RANGE(0xf0, 0xf0) AM_READWRITE(pc6001m2_bank_r0_r,pc6001m2_bank_r0_w)
1532//  AM_RANGE(0xf1, 0xf1) AM_READWRITE(pc6001m2_bank_r1_r,pc6001m2_bank_r1_w)
1533//  AM_RANGE(0xf2, 0xf2) AM_READWRITE(pc6001m2_bank_w0_r,pc6001m2_bank_w0_w)
15341534   AM_RANGE(0xf3, 0xf3) AM_WRITE(pc6001m2_0xf3_w)
1535//   AM_RANGE(0xf4
1536//   AM_RANGE(0xf5
1535//  AM_RANGE(0xf4
1536//  AM_RANGE(0xf5
15371537   AM_RANGE(0xf6, 0xf6) AM_WRITE(pc6001m2_timer_adj_w)
15381538   AM_RANGE(0xf7, 0xf7) AM_WRITE(pc6001m2_timer_irqv_w)
15391539ADDRESS_MAP_END
r8990r8991
17181718
17191719static WRITE8_DEVICE_HANDLER (pc6001_8255_porta_w )
17201720{
1721//   if(data != 0x06)
1722//      printf("pc6001_8255_porta_w %02x\n",data);
1721//  if(data != 0x06)
1722//      printf("pc6001_8255_porta_w %02x\n",data);
17231723}
17241724
17251725static READ8_DEVICE_HANDLER (pc6001_8255_portb_r )
r8990r8991
18211821   static UINT8 joy_press;
18221822
18231823      /*
1824         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1825         PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1826         PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1827         PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1828         PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1829         PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1830         PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1831         PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1832      */
1824            PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1825            PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1826            PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1827            PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1828            PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1829            PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1830            PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1831            PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1832        */
18331833
18341834   joy_press = 0;
18351835
r8990r8991
19021902   UINT32 key2 = input_port_read(machine,"key2");
19031903   UINT32 key3 = input_port_read(machine,"key3");
19041904   static UINT32 old_key1,old_key2,old_key3;
1905//   UINT8 p1_key = input_port_read(machine, "P1");;
1905//  UINT8 p1_key = input_port_read(machine, "P1");;
19061906
19071907   if(cas_switch == 0)
19081908   {
r8990r8991
20202020      sr_bank_r[5] = 0x0a; memory_set_bankptr(machine, "bank6", &ROM[SR_WRAM0(0x0a)]);
20212021      sr_bank_r[6] = 0x0c; memory_set_bankptr(machine, "bank7", &ROM[SR_WRAM0(0x0c)]);
20222022      sr_bank_r[7] = 0x0e; memory_set_bankptr(machine, "bank8", &ROM[SR_WRAM0(0x0e)]);
2023//      bank_opt = 0x02; //tv rom
2023//      bank_opt = 0x02; //tv rom
20242024
20252025      /* enable default work RAM writes */
20262026      sr_bank_w[0] = 0x00;
r8990r8991
21902190   MDRV_CARTSLOT_EXTENSION_LIST("bin")
21912191   MDRV_CARTSLOT_NOT_MANDATORY
21922192
2193//   MDRV_CASSETTE_ADD("cass",pc6001_cassette_config)
2193//  MDRV_CASSETTE_ADD("cass",pc6001_cassette_config)
21942194   MDRV_CARTSLOT_ADD("cass")
21952195   MDRV_CARTSLOT_EXTENSION_LIST("cas,p6")
21962196   MDRV_CARTSLOT_NOT_MANDATORY
r8990r8991
23392339   ROM_REGION( 0x90000, "maincpu", ROMREGION_ERASEFF )
23402340   ROM_LOAD( "systemrom1.64", 0x10000, 0x10000, CRC(b6fc2db2) SHA1(dd48b1eee60aa34780f153359f5da7f590f8dff4) )
23412341   ROM_LOAD( "systemrom2.64", 0x20000, 0x10000, CRC(55a62a1d) SHA1(3a19855d290fd4ac04e6066fe4a80ecd81dc8dd7) )
2342//  cgrom 1                      0x30000, 0x10000
2343//  exrom 0                      0x40000, 0x10000
2344//  exrom 1                      0x50000, 0x10000
2345//  exram 0                      0x60000, 0x10000
2346//  work ram 0                  0x70000, 0x10000
2347//   <invalid>                  0x80000, 0x10000
2342//  cgrom 1                    0x30000, 0x10000
2343//  exrom 0                    0x40000, 0x10000
2344//  exrom 1                    0x50000, 0x10000
2345//  exram 0                    0x60000, 0x10000
2346//  work ram 0                 0x70000, 0x10000
2347//  <invalid>                  0x80000, 0x10000
23482348
23492349   ROM_REGION( 0x1000, "mcu", ROMREGION_ERASEFF )
23502350   ROM_LOAD( "i8049", 0x0000, 0x1000, NO_DUMP )
src/mess/drivers/mycom.c
r8990r8991
11/***************************************************************************
22
3   MYCOMZ-80A (c) 1981 Japan Electronics College
3    MYCOMZ-80A (c) 1981 Japan Electronics College
44
5   preliminary driver by Angelo Salese
5    preliminary driver by Angelo Salese
66
7   TODO:
8   - SN doesn't seem to work properly, needs to find out what's the WE bit
9     for.
10   - Hook-up FDC and CMT load / save;
11   - Printer
12   - RTC
7    TODO:
8    - SN doesn't seem to work properly, needs to find out what's the WE bit
9      for.
10    - Hook-up FDC and CMT load / save;
11    - Printer
12    - RTC
1313
1414****************************************************************************/
1515
r8990r8991
367367   /* doesn't work? */
368368   //printf("%02x %02x\n",data,sn_we);
369369   //if(sn_we)
370   //   sn76496_w(device->machine->device("sn1"), 0, data);
370   //  sn76496_w(device->machine->device("sn1"), 0, data);
371371}
372372
373373static WRITE8_DEVICE_HANDLER( vram_haddr_w )
r8990r8991
378378static READ8_DEVICE_HANDLER( input_1a )
379379{
380380   /*
381   x--- ---- display flag
382   ---- --x- keyboard shift
383   ---- ---x keyboard strobe
384   */
381    x--- ---- display flag
382    ---- --x- keyboard shift
383    ---- ---x keyboard strobe
384    */
385385   int res;
386386
387387   res = keyb_press_flag;
r8990r8991
393393static READ8_DEVICE_HANDLER( input_0c )
394394{
395395   /*
396   xxxx ---- keyboard related, it expects to return 1101 here
397   */
396    xxxx ---- keyboard related, it expects to return 1101 here
397    */
398398   return (mame_rand(device->machine) & 0x20) | 0x00;
399399}
400400
r8990r8991
407407static WRITE8_DEVICE_HANDLER( output_1c )
408408{
409409   /*
410   x--- ---- width 80/40 (0 = 80, 1 = 40)
411   -x-- ---- video mode (0= tile, 1 = bitmap)
412   --x- ---- PSG Chip Select bit
413   ---x ---- PSG Write Enable bit
414   ---- x--- cmt remote
415   ---- -x-- cmt output
416   ---- --x- printer reset
417   ---- ---x printer strobe
418   */
410    x--- ---- width 80/40 (0 = 80, 1 = 40)
411    -x-- ---- video mode (0= tile, 1 = bitmap)
412    --x- ---- PSG Chip Select bit
413    ---x ---- PSG Write Enable bit
414    ---- x--- cmt remote
415    ---- -x-- cmt output
416    ---- --x- printer reset
417    ---- ---x printer strobe
418    */
419419
420420   video_mode = data & 0xc0;
421421   sn_we = data & 0x10;
422//   printf("%02x\n",data & 0x10);
422//  printf("%02x\n",data & 0x10);
423423}
424424
425425static I8255A_INTERFACE( ppi8255_intf_0 )
r8990r8991
471471            if(!shift_press_flag)  // shift not pressed
472472            {
473473               //if(scancode >= 0x41 && scancode < 0x5b)
474               //   scancode += 0x20;  // lowercase, FIXME: 'A' doesn't work properly?
474               //  scancode += 0x20;  // lowercase, FIXME: 'A' doesn't work properly?
475475            }
476476            else
477477            {
r8990r8991
559559/* Driver */
560560
561561/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
562COMP( 1981, mycom,     0,       0,       mycom,    mycom,     0,        "Japan Electronics College",   "MYCOMZ-80A",      GAME_NOT_WORKING | GAME_NO_SOUND)
562COMP( 1981, mycom,     0,       0,       mycom,   mycom,    0,       "Japan Electronics College",   "MYCOMZ-80A",      GAME_NOT_WORKING | GAME_NO_SOUND)
563563
src/mess/drivers/vii.c
r8990r8991
884884      {
885885         image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" );
886886         return IMAGE_INIT_FAIL;
887      }     
887      }
888888   }
889889   else
890890   {
r8990r8991
977977
978978   MDRV_VIDEO_START( vii )
979979   MDRV_VIDEO_UPDATE( vii )
980   
981   MDRV_SOFTWARE_LIST_ADD("vii_cart","vii")   
980
981   MDRV_SOFTWARE_LIST_ADD("vii_cart","vii")
982982MACHINE_CONFIG_END
983983
984984static MACHINE_CONFIG_START( vsmile, vii_state )
src/mess/drivers/x1.c
r8990r8991
2525      (it's gray in the Arcade version),could be either flickering for pseudo-alpha effect or it's
2626      a btanb;
2727    - Exoa II - Warroid: major tile width/height positioning bugs (especially during gameplay);
28   - Hydlide 2 / 3: can't get the user disk to work properly
29   - Gruppe: shows a random bitmap graphic then returns "program load error"
30   - Sorcerian / Ys 3 / Psy-O-Blade (and others): they all fails tight loops with the fdc ready bit check
31   - Turbo Alpha: has z80dma / fdc bugs, doesn't show the presentation properly and then hangs;
32   - Legend of Kage: has serious graphic artifacts, pcg doesn't scroll properly, bitmap-based sprites aren't shown properly, dma bugs?
33   - "newtype": dies with a z80dma assert;
34   - Ys 2: fills the screen with "syntax errors"
35   - Thexder: Can't start a play, keyboard related issue?
36   - V.I.P.: can't get inputs to work at all there;
28    - Hydlide 2 / 3: can't get the user disk to work properly
29    - Gruppe: shows a random bitmap graphic then returns "program load error"
30    - Sorcerian / Ys 3 / Psy-O-Blade (and others): they all fails tight loops with the fdc ready bit check
31    - Turbo Alpha: has z80dma / fdc bugs, doesn't show the presentation properly and then hangs;
32    - Legend of Kage: has serious graphic artifacts, pcg doesn't scroll properly, bitmap-based sprites aren't shown properly, dma bugs?
33    - "newtype": dies with a z80dma assert;
34    - Ys 2: fills the screen with "syntax errors"
35    - Thexder: Can't start a play, keyboard related issue?
36    - V.I.P.: can't get inputs to work at all there;
3737
3838    Notes:
3939    - An interesting feature of the Sharp X-1 is the extended i/o bank. When the ppi port c bit 5
src/mess/drivers/pocketc.c
r8990r8991
953953   ROM_LOAD( "b4-1360.rom", 0x10000, 0x4000, CRC(0d311e21) SHA1(55987b7b00ddc666db30f35cbf23500b49e7ff09))
954954   ROM_LOAD( "b5-1360.rom", 0x14000, 0x4000, CRC(f945f3f7) SHA1(26116d8277212e14bddb64c531f134fbb5c86f9e))
955955   ROM_LOAD( "b6-1360.rom", 0x18000, 0x4000, CRC(ae823112) SHA1(9ab458e70752cacfd5d3ed36a8e89f96c63a6f50))
956   ROM_LOAD( "b7-1360.rom", 0x1c000, 0x4000, CRC(ba7384b6) SHA1(95396d506f1d71e66c3ae2d47ffb4b6d10b31401))   
956   ROM_LOAD( "b7-1360.rom", 0x1c000, 0x4000, CRC(ba7384b6) SHA1(95396d506f1d71e66c3ae2d47ffb4b6d10b31401))
957957   ROM_REGION(0x100,"gfx1",ROMREGION_ERASEFF)
958958ROM_END
959 
959
960960ROM_START(pc1403)
961961   ROM_REGION(0x10000,"maincpu",0)
962962   ROM_LOAD("introm.bin", 0x0000, 0x2000, CRC(588c500b) SHA1(2fed9ebede27e20a8ee4b4b03b9f8cd7808ada5c))
r8990r8991
996996   pc1600
997997*/
998998ROM_START( pc1500 )
999    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )   
999    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
10001000   ROM_LOAD( "sys1500.rom", 0x0000, 0x4000, CRC(d480b50d) SHA1(4bf748ba4d7c2b7cd7da7f3fdefcdd2e4cd41c4e))
10011001    ROM_REGION( 0x10000, "ce150", ROMREGION_ERASEFF )
10021002   ROM_LOAD( "ce-150.rom", 0x0000, 0x2000, CRC(8fa1df6d) SHA1(a3aa02a641a46c27c0d4c0dc025b0dbe9b5b79c8))
src/mess/drivers/palm.c
r8990r8991
100100    state_save_register_global(machine, spim_data);
101101   if (machine->device<cpu_device>("maincpu")->debug()) {
102102      machine->device<cpu_device>("maincpu")->debug()->set_dasm_override(palm_dasm_override);
103   }   
103   }
104104}
105105
106106static MACHINE_RESET( palm )
src/mess/drivers/a6809.c
r8990r8991
1818static ADDRESS_MAP_START(a6809_mem, ADDRESS_SPACE_PROGRAM, 8)
1919   ADDRESS_MAP_UNMAP_HIGH
2020   AM_RANGE(0x0000,0x03ff) AM_RAM
21   AM_RANGE(0x0400,0x07ff) AM_DEVREADWRITE("saa5050", saa5050_videoram_r, saa5050_videoram_w)   
21   AM_RANGE(0x0400,0x07ff) AM_DEVREADWRITE("saa5050", saa5050_videoram_r, saa5050_videoram_w)
2222   AM_RANGE(0x0800,0x0800) AM_DEVWRITE("mc6845", mc6845_address_w)
2323   AM_RANGE(0x0801,0x0801) AM_DEVREADWRITE("mc6845", mc6845_register_r , mc6845_register_w)
2424   AM_RANGE(0x0900,0x090f) AM_MIRROR(0xf0)AM_DEVREADWRITE("via", via_r, via_w)
r8990r8991
113113   MDRV_SAA5050_ADD("saa5050", a6809_saa5050_intf)
114114
115115   MDRV_VIDEO_UPDATE(a6809)
116   
116
117117   MDRV_VIA6522_ADD("via", XTAL_4MHz / 4, via_intf)
118   
118
119119   MDRV_MC6845_ADD("mc6845", MC6845, XTAL_4MHz / 2, a6809_crtc6845_interface)
120120MACHINE_CONFIG_END
121121
r8990r8991
127127   /* This looks like some sort of prom */
128128   ROM_REGION( 0x100, "proms", 0 )
129129   ROM_LOAD( "acorn6809.ic11", 0x0000, 0x0100, CRC(7908317d) SHA1(e0f1e5bd3a8598d3b62bc432dd1f3892ed7e66d8) )
130   
130
131131   /* This is SAA5050 so same char def is taken as in p2000t driver */
132132   ROM_REGION(0x01000, "gfx1",0)
133133   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc))
src/mess/drivers/radio86.c
r8990r8991
513513/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
514514COMP( 1986, radio86,  0,       0,   radio86,   radio86, radio86,  "<unknown>", "Radio-86RK",   0)
515515COMP( 1986, radio16,  radio86, 0,   radio16,   radio86, radio86,  "<unknown>", "Radio-86RK (16K RAM)",   0)
516COMP( 1986, kr03,      radio86, 0,   radio86,   radio86, radio86,  "Elektronika", "KR-03",   0)
516COMP( 1986, kr03,     radio86, 0,   radio86,   radio86, radio86,  "Elektronika", "KR-03",   0)
517517COMP( 1986, radio4k,  radio86, 0,   radio86,   radio86, radio86,  "<unknown>", "Radio-86RK (4K ROM)",   0)
518518COMP( 1986, radiorom, radio86, 0,   radiorom,   radio86, radio86,  "<unknown>", "Radio-86RK (ROM-Disk)",   0)
519519COMP( 1986, radioram, radio86, 0,   radioram,   radio86, radioram, "<unknown>", "Radio-86RK (ROM/RAM Disk)",   0)
src/mess/drivers/vic20.c
r8990r8991
584584      {
585585         image.fread(ptr + address, 0x2000);
586586         image.fread(ptr + 0xa000, 0x2000);
587         
587
588588         memory_install_rom(program, address, address + 0x1fff, 0, 0, ptr + address);
589589         memory_install_rom(program, 0xa000, 0xbfff, 0, 0, ptr + 0xa000);
590590      }
r8990r8991
603603         memcpy(ptr + address, image.get_software_region("2000"), size);
604604         memory_install_rom(program, address, (address + size) - 1, 0, 0, ptr + address);
605605      }
606     
606
607607      size = image.get_software_region_length("4000");
608608      if (size)
609609      {
r8990r8991
611611         memcpy(ptr + address, image.get_software_region("4000"), size);
612612         memory_install_rom(program, address, (address + size) - 1, 0, 0, ptr + address);
613613      }
614     
614
615615      size = image.get_software_region_length("6000");
616616      if (size)
617617      {
r8990r8991
619619         memcpy(ptr + address, image.get_software_region("6000"), size);
620620         memory_install_rom(program, address, (address + size) - 1, 0, 0, ptr + address);
621621      }
622     
622
623623      size = image.get_software_region_length("a000");
624624      if (size)
625625      {
src/mess/drivers/selz80.c
r8990r8991
11/***************************************************************************
2   
2
33        SEL Z80 Trainer
44
55        31/08/2010 Skeleton driver.
r8990r8991
1818
1919static ADDRESS_MAP_START( selz80_io , ADDRESS_SPACE_IO, 8)
2020   ADDRESS_MAP_UNMAP_HIGH
21   ADDRESS_MAP_GLOBAL_MASK(0xff)   
21   ADDRESS_MAP_GLOBAL_MASK(0xff)
2222ADDRESS_MAP_END
2323
2424/* Input ports */
r8990r8991
2626INPUT_PORTS_END
2727
2828
29static MACHINE_RESET(selz80)
30{   
29static MACHINE_RESET(selz80)
30{
3131}
3232
3333static VIDEO_START( selz80 )
r8990r8991
4343    /* basic machine hardware */
4444    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
4545    MDRV_CPU_PROGRAM_MAP(selz80_mem)
46    MDRV_CPU_IO_MAP(selz80_io)   
46    MDRV_CPU_IO_MAP(selz80_io)
4747
4848    MDRV_MACHINE_RESET(selz80)
49   
49
5050    /* video hardware */
5151    MDRV_SCREEN_ADD("screen", RASTER)
5252    MDRV_SCREEN_REFRESH_RATE(50)
r8990r8991
7272/* Driver */
7373
7474/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
75COMP( 1985, selz80,  0,       0,    selz80,    selz80,    0,     "SEL",   "Z80 Trainer",      GAME_NOT_WORKING | GAME_NO_SOUND)
75COMP( 1985, selz80,  0,       0,   selz80,    selz80,    0,    "SEL",   "Z80 Trainer",      GAME_NOT_WORKING | GAME_NO_SOUND)
7676
src/mess/drivers/smc777.c
r8990r8991
77    TODO:
88    - no documentation, the entire driver is just a bunch of educated
99      guesses ...
10   - BEEP pitch is horrible
11   - fix fdc issue with 1dd disks (irq related?)
10    - BEEP pitch is horrible
11    - fix fdc issue with 1dd disks (irq related?)
1212
1313****************************************************************************/
1414
r8990r8991
307307      case 0x04:
308308         // ---- xxxx select floppy drive (yes, 15 of them, A to P)
309309         wd17xx_set_drive(dev,data & 0x01);
310         //   wd17xx_set_side(dev,(data & 0x10)>>4);
310         //  wd17xx_set_side(dev,(data & 0x10)>>4);
311311         if(data & 0xf0)
312312         printf("%02x\n",data);
313313         break;
r8990r8991
317317static WRITE_LINE_DEVICE_HANDLER( smc777_fdc_intrq_w )
318318{
319319   fdc_irq_flag = state;
320//   cputag_set_input_line(device->machine, "maincpu", 0, (state) ? ASSERT_LINE : CLEAR_LINE);
320//  cputag_set_input_line(device->machine, "maincpu", 0, (state) ? ASSERT_LINE : CLEAR_LINE);
321321}
322322
323323static WRITE_LINE_DEVICE_HANDLER( smc777_fdc_drq_w )
r8990r8991
335335
336336   keyb_press_flag = 0;
337337   res = keyb_press;
338//   keyb_press = 0xff;
338//  keyb_press = 0xff;
339339
340340   return res;
341341}
r8990r8991
355355static WRITE8_HANDLER( system_output_w )
356356{
357357   /*
358   ---x --- beep
359   all the rest is unknown at current time
360   */
358    ---x --- beep
359    all the rest is unknown at current time
360    */
361361   system_data = data;
362362   beep_set_state(space->machine->device("beeper"),data & 0x10);
363363}
r8990r8991
389389static WRITE8_HANDLER( display_reg_w )
390390{
391391   /*
392   x--- ---- width 80 / 40 switch (0 = 640 x 200 1 = 320 x 200)
393   ---- -x-- mode select?
394   */
392    x--- ---- width 80 / 40 switch (0 = 640 x 200 1 = 320 x 200)
393    ---- -x-- mode select?
394    */
395395
396396   {
397397      if((display_reg & 0x80) != (data & 0x80))
r8990r8991
426426   AM_RANGE(0x18, 0x19) AM_WRITE(smc777_6845_w)
427427   AM_RANGE(0x1a, 0x1b) AM_READ(key_r) AM_WRITENOP//keyboard data
428428   AM_RANGE(0x1c, 0x1c) AM_READWRITE(system_input_r,system_output_w) //status and control data / Printer strobe
429//   AM_RANGE(0x1d, 0x1d) AM_WRITENOP //status and control data / Printer status / strobe
430//   AM_RANGE(0x1e, 0x1f) AM_WRITENOP //RS232C irq control
429//  AM_RANGE(0x1d, 0x1d) AM_WRITENOP //status and control data / Printer status / strobe
430//  AM_RANGE(0x1e, 0x1f) AM_WRITENOP //RS232C irq control
431431   AM_RANGE(0x20, 0x20) AM_READWRITE(display_reg_r,display_reg_w) //display mode switching
432//   AM_RANGE(0x21, 0x21) AM_WRITENOP //60 Hz irq control
433//   AM_RANGE(0x22, 0x22) AM_WRITENOP //printer output data
432//  AM_RANGE(0x21, 0x21) AM_WRITENOP //60 Hz irq control
433//  AM_RANGE(0x22, 0x22) AM_WRITENOP //printer output data
434434   AM_RANGE(0x23, 0x23) AM_WRITE(border_col_w) //border area control
435//   AM_RANGE(0x24, 0x24) AM_WRITENOP //Timer write / specify address (RTC)
436//   AM_RANGE(0x25, 0x25) AM_READNOP  //Timer read (RTC)
437//   AM_RANGE(0x26, 0x26) AM_WRITENOP //RS232C RX / TX
438//   AM_RANGE(0x27, 0x27) AM_WRITENOP //RS232C Mode / Command / Status
435//  AM_RANGE(0x24, 0x24) AM_WRITENOP //Timer write / specify address (RTC)
436//  AM_RANGE(0x25, 0x25) AM_READNOP  //Timer read (RTC)
437//  AM_RANGE(0x26, 0x26) AM_WRITENOP //RS232C RX / TX
438//  AM_RANGE(0x27, 0x27) AM_WRITENOP //RS232C Mode / Command / Status
439439
440//   AM_RANGE(0x28, 0x2c) AM_READWRITE(smc777_fdc_r,smc777_fdc_w) //fdc 2, MB8876 -> FD1791
441//   AM_RANGE(0x2d, 0x2f) AM_NOP //rs-232c no. 2
440//  AM_RANGE(0x28, 0x2c) AM_READWRITE(smc777_fdc_r,smc777_fdc_w) //fdc 2, MB8876 -> FD1791
441//  AM_RANGE(0x2d, 0x2f) AM_NOP //rs-232c no. 2
442442   AM_RANGE(0x30, 0x34) AM_READWRITE(smc777_fdc1_r,smc777_fdc1_w) //fdc 1, MB8876 -> FD1791
443//   AM_RANGE(0x35, 0x37) AM_NOP //rs-232c no. 3
444//   AM_RANGE(0x38, 0x3b) AM_NOP //cache disk unit
445//   AM_RANGE(0x3c, 0x3d) AM_NOP //RGB Superimposer
446//   AM_RANGE(0x40, 0x47) AM_NOP //IEEE-488 interface unit
447//   AM_RANGE(0x48, 0x50) AM_NOP //HDD (Winchester)
443//  AM_RANGE(0x35, 0x37) AM_NOP //rs-232c no. 3
444//  AM_RANGE(0x38, 0x3b) AM_NOP //cache disk unit
445//  AM_RANGE(0x3c, 0x3d) AM_NOP //RGB Superimposer
446//  AM_RANGE(0x40, 0x47) AM_NOP //IEEE-488 interface unit
447//  AM_RANGE(0x48, 0x50) AM_NOP //HDD (Winchester)
448448   AM_RANGE(0x51, 0x51) AM_READ(unk_r)
449449   AM_RANGE(0x52, 0x52) AM_WRITE(smc777_ramdac_w)
450//   AM_RANGE(0x54, 0x59) AM_NOP //VTR Controller
450//  AM_RANGE(0x54, 0x59) AM_NOP //VTR Controller
451451   AM_RANGE(0x53, 0x53) AM_DEVWRITE("sn1", sn76496_w) //not in the datasheet ... almost certainly SMC-777 specific
452//   AM_RANGE(0x5a, 0x5b) AM_WRITENOP //RAM banking
453//   AM_RANGE(0x70, 0x70) AM_NOP //Auto Start ROM
454//   AM_RANGE(0x74, 0x74) AM_NOP //IEEE-488 ROM
455//   AM_RANGE(0x75, 0x75) AM_NOP //VTR Controller ROM
452//  AM_RANGE(0x5a, 0x5b) AM_WRITENOP //RAM banking
453//  AM_RANGE(0x70, 0x70) AM_NOP //Auto Start ROM
454//  AM_RANGE(0x74, 0x74) AM_NOP //IEEE-488 ROM
455//  AM_RANGE(0x75, 0x75) AM_NOP //VTR Controller ROM
456456   AM_RANGE(0x80, 0xff) AM_READWRITE(smc777_fbuf_r, smc777_fbuf_w) //GRAM
457457ADDRESS_MAP_END
458458
r8990r8991
580580         if((input_port_read(machine,portnames[port_i])>>i) & 1)
581581         {
582582            //key_flag = 1;
583//            if(keymod & 0x02)  // shift not pressed
584//            {
585//               if(scancode >= 0x41 && scancode < 0x5a)
586//                  scancode += 0x20;  // lowercase
587//            }
588//            else
589//            {
590//               if(scancode >= 0x31 && scancode < 0x3a)
591//                  scancode -= 0x10;
592//               if(scancode == 0x30)
593//               {
594//                  scancode = 0x3d;
595//               }
596//            }
583//              if(keymod & 0x02)  // shift not pressed
584//              {
585//                  if(scancode >= 0x41 && scancode < 0x5a)
586//                      scancode += 0x20;  // lowercase
587//              }
588//              else
589//              {
590//                  if(scancode >= 0x31 && scancode < 0x3a)
591//                      scancode -= 0x10;
592//                  if(scancode == 0x30)
593//                  {
594//                      scancode = 0x3d;
595//                  }
596//              }
597597            keyb_press = scancode;
598598            keyb_press_flag = 1;
599599            return;
r8990r8991
755755/* Driver */
756756
757757/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
758COMP( 1983, smc777,  0,       0,    smc777,    smc777,     0,  "Sony",   "SMC-777",      GAME_NOT_WORKING | GAME_IMPERFECT_SOUND)
758COMP( 1983, smc777,  0,       0,   smc777,    smc777,     0,  "Sony",   "SMC-777",      GAME_NOT_WORKING | GAME_IMPERFECT_SOUND)
759759
src/mess/drivers/scorpion.c
r8990r8991
222222   running_device *beta = machine->device(BETA_DISK_TAG);
223223   UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE);
224224   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
225   
225
226226   if (betadisk_is_active(beta))
227227   {
228228      if (pc >= 0x4000)
src/mess/drivers/zexall.c
r8990r8991
137137
138138static MACHINE_CONFIG_START( zexall, driver_data_t )
139139    /* basic machine hardware */
140    MDRV_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz*10) 
140    MDRV_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz*10)
141141    MDRV_CPU_PROGRAM_MAP(z80_mem)
142142    MDRV_CPU_IO_MAP(z80_io)
143143    MDRV_QUANTUM_TIME(HZ(60))
src/mess/drivers/spectrum.c
r8990r8991
639639   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
640640
641641   space->set_direct_update_handler(direct_update_delegate_create_static(spectrum_direct, *machine));
642   
642
643643   state->port_7ffd_data = -1;
644644   state->port_1ffd_data = -1;
645645}
src/mess/drivers/c128.c
r8990r8991
823823   MDRV_CPU_MODIFY("m8502")
824824   MDRV_CPU_CLOCK( VIC6569_CLOCK)
825825   MDRV_CPU_CONFIG( c128_m8502_interface )
826   
826
827827   MDRV_SCREEN_MODIFY("screen")
828828   MDRV_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE)
829829   MDRV_SCREEN_SIZE(VIC6569_COLUMNS * 2, VIC6569_LINES)
src/mess/drivers/px8.c
r8990r8991
466466//
467467//static UINT8 krtn_read(running_machine *machine)
468468//{
469//   px8_state *state = machine->driver_data<px8_state>();
470//   UINT8 data = 0xff;
469//  px8_state *state = machine->driver_data<px8_state>();
470//  UINT8 data = 0xff;
471471//
472//   switch (state->ksc)
473//   {
474//   case 0: data = input_port_read(machine, "KSC0"); break;
475//   case 1: data = input_port_read(machine, "KSC1"); break;
476//   case 2: data = input_port_read(machine, "KSC2"); break;
477//   case 3: data = input_port_read(machine, "KSC3"); break;
478//   case 4: data = input_port_read(machine, "KSC4"); break;
479//   case 5: data = input_port_read(machine, "KSC5"); break;
480//   case 6: data = input_port_read(machine, "KSC6"); break;
481//   case 7: data = input_port_read(machine, "KSC7"); break;
482//   case 8: data = input_port_read(machine, "KSC8"); break;
483//   case 9: data = input_port_read(machine, "SW4");  break;
484//   }
472//  switch (state->ksc)
473//  {
474//  case 0: data = input_port_read(machine, "KSC0"); break;
475//  case 1: data = input_port_read(machine, "KSC1"); break;
476//  case 2: data = input_port_read(machine, "KSC2"); break;
477//  case 3: data = input_port_read(machine, "KSC3"); break;
478//  case 4: data = input_port_read(machine, "KSC4"); break;
479//  case 5: data = input_port_read(machine, "KSC5"); break;
480//  case 6: data = input_port_read(machine, "KSC6"); break;
481//  case 7: data = input_port_read(machine, "KSC7"); break;
482//  case 8: data = input_port_read(machine, "KSC8"); break;
483//  case 9: data = input_port_read(machine, "SW4");  break;
484//  }
485485//
486//   return data;
486//  return data;
487487//}
488488//
489489///*-------------------------------------------------
r8990r8991
492492//
493493//static READ8_HANDLER( krtn_0_3_r )
494494//{
495//   return krtn_read(space->machine) & 0x0f;
495//  return krtn_read(space->machine) & 0x0f;
496496//}
497497//
498498///*-------------------------------------------------
r8990r8991
501501//
502502//static READ8_HANDLER( krtn_4_7_r )
503503//{
504//   return krtn_read(space->machine) >> 4;
504//  return krtn_read(space->machine) >> 4;
505505//}
506506//
507507///*-------------------------------------------------
r8990r8991
510510//
511511//static WRITE8_HANDLER( ksc_w )
512512//{
513//   px8_state *state = space->machine->driver_data<px8_state>();
513//  px8_state *state = space->machine->driver_data<px8_state>();
514514//
515//   state->ksc = data;
515//  state->ksc = data;
516516//}
517517
518518/***************************************************************************
r8990r8991
575575
576576//static ADDRESS_MAP_START( px8_sub_io, ADDRESS_SPACE_IO, 8 )
577577////  AM_RANGE(0x00, 0x00) AM_READWRITE()
578//   AM_RANGE(0x01, 0x01) AM_READ(krtn_0_3_r)
578//  AM_RANGE(0x01, 0x01) AM_READ(krtn_0_3_r)
579579////  AM_RANGE(0x02, 0x02) AM_WRITE()
580//   AM_RANGE(0x03, 0x03) AM_WRITE(ksc_w)
580//  AM_RANGE(0x03, 0x03) AM_WRITE(ksc_w)
581581////  AM_RANGE(0x04, 0x04) AM_WRITE()
582//   AM_RANGE(0x05, 0x05) AM_READ(krtn_4_7_r)
582//  AM_RANGE(0x05, 0x05) AM_READ(krtn_4_7_r)
583583////  AM_RANGE(0x06, 0x06) AM_READ()
584584////  AM_RANGE(0x07, 0x07) AM_WRITE()
585585//ADDRESS_MAP_END
src/mess/drivers/phc25.c
r8990r8991
2727    - tune cassette trigger level
2828    - accurate video timing
2929
30   10 SCREEN 2,1,1:CLS
31   20 FOR X=0 TO 8
32   30 LINE(X*24,0)-(X*24+16,191),X,BF
33   40 NEXT
30    10 SCREEN 2,1,1:CLS
31    20 FOR X=0 TO 8
32    30 LINE(X*24,0)-(X*24+16,191),X,BF
33    40 NEXT
3434
35   10 SCREEN3,1,1:COLOR,,1:CLS
36   20 X1=INT(RND(1)*256):Y1=INT(RND(1)*192):X2=INT(RND(1)*256):Y2=INT(RND(1)*192):C=INT(RND(1)*4)+1:LINE(X1,Y1)-(X2,Y2),C:GOTO 20
37   RUN
35    10 SCREEN3,1,1:COLOR,,1:CLS
36    20 X1=INT(RND(1)*256):Y1=INT(RND(1)*192):X2=INT(RND(1)*256):Y2=INT(RND(1)*192):C=INT(RND(1)*4)+1:LINE(X1,Y1)-(X2,Y2),C:GOTO 20
37    RUN
3838
3939
40   10 SCREEN2,1,1:CLS:FORX=0TO8:LINE(X*24,0)-(X*24+16,191),X,BF:NEXT
40    10 SCREEN2,1,1:CLS:FORX=0TO8:LINE(X*24,0)-(X*24+16,191),X,BF:NEXT
4141
4242*/
4343
src/mess/drivers/a2600.c
r8990r8991
18661866      memory_set_bankptr(machine, "bank1", bank_base[1] );
18671867      memory_set_bankptr(machine, "bank2", bank_base[2] );
18681868      modeSS_write_enabled = 0;
1869      modeSS_byte_started = 0;     
1869      modeSS_byte_started = 0;
18701870      space->set_direct_update_handler(direct_update_delegate_create_static(modeSS_opbase, *machine));
18711871      /* The Supercharger has no motor control so just enable it */
18721872      cassette_change_state( machine->device("cassette"), CASSETTE_MOTOR_ENABLED, CASSETTE_MOTOR_DISABLED );
r8990r8991
18811881      memory_install_read8_handler(space, 0x1000, 0x103f, 0, 0, modeDPC_r);
18821882      memory_install_write8_handler(space, 0x1040, 0x107f, 0, 0, modeDPC_w);
18831883      memory_install_write8_handler(space, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_w);
1884      memory_install_read8_handler(space, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r);     
1884      memory_install_read8_handler(space, 0x1ff8, 0x1ff9, 0, 0, modeF8_switch_r);
18851885      space->set_direct_update_handler(direct_update_delegate_create_static(modeDPC_opbase_handler, *machine));
18861886      {
18871887         int   data_fetcher;
src/mess/drivers/pcw.c
r8990r8991
356356   }
357357
358358   /* if boot is active, page in fake ROM */
359/*   if ((pcw_boot) && (block==0))
360   {
361      unsigned char *FakeROM;
359/*  if ((pcw_boot) && (block==0))
360    {
361        unsigned char *FakeROM;
362362
363      FakeROM = &memory_region(machine, "maincpu")[0x010000];
363        FakeROM = &memory_region(machine, "maincpu")[0x010000];
364364
365      memory_set_bankptr(machine, "bank1", FakeROM);
366   }*/
365        memory_set_bankptr(machine, "bank1", FakeROM);
366    }*/
367367}
368368
369369/* from Jacob Nevins docs */
r8990r8991
689689
690690static  READ8_HANDLER(pcw_printer_data_r)
691691{
692//   pcw_printer_data = 0xf8;
692//  pcw_printer_data = 0xf8;
693693   pcw_printer_data = upi41_master_r(space->machine->device("printer_mcu"),0);
694694   return pcw_printer_data;
695695}
r8990r8991
703703/* MCU handlers */
704704/*static READ8_HANDLER(mcu_printer_data_r)
705705{
706   return pcw_printer_data;
706    return pcw_printer_data;
707707}
708708
709709static WRITE8_HANDLER(mcu_printer_data_w)
710710{
711   pcw_printer_data = data;
711    pcw_printer_data = data;
712712}*/
713713
714714static READ8_HANDLER(mcu_printer_command_r)
r8990r8991
730730   int seq;
731731
732732   /* Keyboard data is sent in serial from the MCU through the keyboard port, to the ASIC
733      Sends a string of 12-bit sequences, first 4 bits are the RAM location (from &3ff0),
734      then 8 bits for the data to be written there. */
733       Sends a string of 12-bit sequences, first 4 bits are the RAM location (from &3ff0),
734       then 8 bits for the data to be written there. */
735735   seq = mcu_transmit_count % 12;
736736   if(seq < 4)
737737   {
r8990r8991
873873/* i8041 MCU */
874874static ADDRESS_MAP_START(pcw_printer_io, ADDRESS_SPACE_IO, 8)
875875   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(mcu_printer_command_r)
876//   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mcu_printer_data_r, mcu_printer_data_w)
877//   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(mcu_printer_p2_r)
876//  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mcu_printer_data_r, mcu_printer_data_w)
877//  AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(mcu_printer_p2_r)
878878   AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("printer_8243",i8243_prog_w)
879879ADDRESS_MAP_END
880880
r8990r8991
10651065   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)                     PORT_CHAR('2') PORT_CHAR('"')
10661066   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Stop") PORT_CODE(KEYCODE_ESC)      PORT_CHAR(UCHAR_MAMEKEY(ESC))
10671067   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q)                     PORT_CHAR('q') PORT_CHAR('Q')
1068   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB)                   PORT_CHAR('\t')
1068   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB)                  PORT_CHAR('\t')
10691069   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A)                     PORT_CHAR('a') PORT_CHAR('A')
10701070   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
10711071   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z)                     PORT_CHAR('z') PORT_CHAR('Z')
r8990r8991
10771077   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[-]") PORT_CODE(KEYCODE_F4)         PORT_CHAR(UCHAR_MAMEKEY(PGDN))   // 1st key on the right from 'Spacebar'
10781078   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F7  F8") PORT_CODE(KEYCODE_F7)      PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CHAR(UCHAR_MAMEKEY(F8))
10791079   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD)               PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD))
1080   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD)                PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
1080   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD)               PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
10811081   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL<") PORT_CODE(KEYCODE_BACKSPACE)   PORT_CHAR(8)
10821082
10831083   PORT_START("LINE10")   /* 0x03ffa */
r8990r8991
10961096    For now, I let it with no default mapping. */
10971097   PORT_START("LINE13")   /* 0x03ffd */
10981098   PORT_BIT(0xff, 0xff, IPT_UNUSED)
1099//   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT LOCK") //PORT_CODE(KEYCODE_CAPSLOCK)
1100//   PORT_BIT(0x80, 0xff, IPT_UNUSED)
1099//  PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT LOCK") //PORT_CODE(KEYCODE_CAPSLOCK)
1100//  PORT_BIT(0x80, 0xff, IPT_UNUSED)
11011101
11021102   PORT_START("LINE14")   /* 0x03ffe */
11031103   PORT_BIT ( 0xff, 0xff,    IPT_UNUSED )
src/mess/drivers/rt1715.c
r8990r8991
55        10/06/2008 Preliminary driver.
66
77
8   Notes:
8    Notes:
99
10   - keyboard connected to sio channel a
11   - sio channel a clock output connected to ctc trigger 0
10    - keyboard connected to sio channel a
11    - sio channel a clock output connected to ctc trigger 0
1212
1313****************************************************************************/
1414
src/mess/drivers/rex6000.c
r8990r8991
11/***************************************************************************
2   
2
33        Xircom / Intel REX 6000
44
55        18/06/2009 Skeleton driver.
r8990r8991
2323INPUT_PORTS_END
2424
2525
26static MACHINE_RESET(rex6000)
27{   
26static MACHINE_RESET(rex6000)
27{
2828}
2929
3030static VIDEO_START( rex6000 )
r8990r8991
4040    /* basic machine hardware */
4141    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
4242    MDRV_CPU_PROGRAM_MAP(rex6000_mem)
43    MDRV_CPU_IO_MAP(rex6000_io)   
43    MDRV_CPU_IO_MAP(rex6000_io)
4444
4545    MDRV_MACHINE_RESET(rex6000)
46   
46
4747    /* video hardware */
4848    MDRV_SCREEN_ADD("screen", RASTER)
4949    MDRV_SCREEN_REFRESH_RATE(50)
r8990r8991
6767/* Driver */
6868
6969/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
70COMP( 2000, rex6000,  0,       0,    rex6000,    rex6000,     0,   "Xircom / Intel",   "REX 6000",      GAME_NOT_WORKING | GAME_NO_SOUND)
70COMP( 2000, rex6000,  0,       0,   rex6000,   rex6000,    0,   "Xircom / Intel",   "REX 6000",      GAME_NOT_WORKING | GAME_NO_SOUND)
7171
src/mess/drivers/v1050.c
r8990r8991
379379
380380/*static READ8_HANDLER( keyboard_r )
381381{
382   v1050_state *state = space->machine->driver_data<v1050_state>();
382    v1050_state *state = space->machine->driver_data<v1050_state>();
383383
384   static const char *const KEY_ROW[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", "XA", "XB" };
384    static const char *const KEY_ROW[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", "XA", "XB" };
385385
386   return input_port_read(space->machine, KEY_ROW[state->keylatch]);
386    return input_port_read(space->machine, KEY_ROW[state->keylatch]);
387387}
388388
389389static WRITE8_HANDLER( keyboard_w )
390390{
391   v1050_state *state = space->machine->driver_data<v1050_state>();
391    v1050_state *state = space->machine->driver_data<v1050_state>();
392392
393   state->keylatch = data & 0x0f;
393    state->keylatch = data & 0x0f;
394394}
395395*/
396396//static WRITE8_HANDLER( p2_w )
397397//{
398//   /*
398//  /*
399399//
400400//        bit     description
401401//
r8990r8991
410410//
411411//    */
412412//
413//   v1050_state *state = space->machine->driver_data<v1050_state>();
413//  v1050_state *state = space->machine->driver_data<v1050_state>();
414414//
415//   output_set_led_value(0, BIT(data, 5));
415//  output_set_led_value(0, BIT(data, 5));
416416////  discrete_sound_w(discrete, NODE_01, BIT(data, 6));
417//   state->kb_so = BIT(data, 7);
417//  state->kb_so = BIT(data, 7);
418418//}
419419
420420/* Memory Maps */
r8990r8991
460460ADDRESS_MAP_END
461461
462462//static ADDRESS_MAP_START( v1050_kbd_io, ADDRESS_SPACE_IO, 8 )
463//   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(keyboard_r, keyboard_w)
464//   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(p2_w)
463//  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(keyboard_r, keyboard_w)
464//  AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(p2_w)
465465//ADDRESS_MAP_END
466466
467467/* Input Ports */
r8990r8991
11651165   state->bank = 0;
11661166
11671167   v1050_bankswitch(machine);
1168   
1169   state->timer_sio->adjust(attotime_zero, 0, ATTOTIME_IN_HZ((double)XTAL_16MHz/4/13/16));   
1168
1169   state->timer_sio->adjust(attotime_zero, 0, ATTOTIME_IN_HZ((double)XTAL_16MHz/4/13/16));
11701170}
11711171
11721172
src/mess/drivers/cgc7900.c
r8990r8991
295295-------------------------------------------------*/
296296
297297//static ADDRESS_MAP_START( keyboard_mem, ADDRESS_SPACE_PROGRAM, 8 )
298//   AM_RANGE(0x000, 0x7ff) AM_ROM
298//  AM_RANGE(0x000, 0x7ff) AM_ROM
299299//ADDRESS_MAP_END
300300
301301/*-------------------------------------------------
src/mess/drivers/abc80x.c
r8990r8991
5454
5555    TODO:
5656
57   - replace the 2nd Z80DART with Z80SIO when it is implemented properly
57    - replace the 2nd Z80DART with Z80SIO when it is implemented properly
5858    - ABC 77 keyboard
5959    - bit accurate Z80 SIO/2 (cassette)
6060    - floppy controller board
r8990r8991
9393
9494/* Keyboard HACK */
9595
96enum
96enum
9797{
9898   CHANNEL_A = 0,
9999   CHANNEL_B
r8990r8991
937937
938938static ABCBUS_DAISY( abcbus_daisy )
939939{
940//   { LUXOR_55_21046_ABCBUS("abc830") },
940//  { LUXOR_55_21046_ABCBUS("abc830") },
941941   { NULL }
942942};
943943
src/mess/drivers/a7000.c
r8990r8991
11/***************************************************************************
22
3   Acorn Archimedes 7000/7000+
3    Acorn Archimedes 7000/7000+
44
55    preliminary driver by Angelo Salese,
66    based on work by Tomasz Slanina and Tom Walker
77
8   ???
9   bp (0382827C) (second trigger)
10   do R13 = SR13
8    ???
9    bp (0382827C) (second trigger)
10    do R13 = SR13
1111
1212****************************************************************************/
1313
r8990r8991
2828
2929static const char *const vidc20_regnames[] =
3030{
31   "Video Palette",                // 0
32   "Video Palette Address",          // 1
31   "Video Palette",               // 0
32   "Video Palette Address",         // 1
3333   "RESERVED",                   // 2
34   "LCD offset",                   // 3
34   "LCD offset",                  // 3
3535   "Border Colour",               // 4
36   "Cursor Palette Logical Colour 1",    // 5
37   "Cursor Palette Logical Colour 2",    // 6
38   "Cursor Palette Logical Colour 3",    // 7
36   "Cursor Palette Logical Colour 1",   // 5
37   "Cursor Palette Logical Colour 2",   // 6
38   "Cursor Palette Logical Colour 3",   // 7
3939   "Horizontal",                  // 8
4040   "Vertical",                     // 9
4141   "Stereo Image",                  // A
r8990r8991
4949static const char *const vidc20_horz_regnames[] =
5050{
5151   "Horizontal Cycle",             // 0x80 HCR
52   "Horizontal Sync Width",          // 0x81 HSWR
53   "Horizontal Border Start",          // 0x82 HBSR
54   "Horizontal Display Start",          // 0x83 HDSR
55   "Horizontal Display End",          // 0x84 HDER
56   "Horizontal Border End",          // 0x85 HBER
57   "Horizontal Cursor Start",          // 0x86 HCSR
52   "Horizontal Sync Width",         // 0x81 HSWR
53   "Horizontal Border Start",         // 0x82 HBSR
54   "Horizontal Display Start",         // 0x83 HDSR
55   "Horizontal Display End",         // 0x84 HDER
56   "Horizontal Border End",         // 0x85 HBER
57   "Horizontal Cursor Start",         // 0x86 HCSR
5858   "Horizontal Interlace",          // 0x87 HIR
59   "Horizontal Counter TEST",          // 0x88
60   "Horizontal <UNDEFINED>",          // 0x89
61   "Horizontal <UNDEFINED>",          // 0x8a
62   "Horizontal <UNDEFINED>",          // 0x8b
63   "Horizontal All TEST",             // 0x8c
64   "Horizontal <UNDEFINED>",          // 0x8d
65   "Horizontal <UNDEFINED>",          // 0x8e
66   "Horizontal <UNDEFINED>"          // 0x8f
59   "Horizontal Counter TEST",         // 0x88
60   "Horizontal <UNDEFINED>",         // 0x89
61   "Horizontal <UNDEFINED>",         // 0x8a
62   "Horizontal <UNDEFINED>",         // 0x8b
63   "Horizontal All TEST",            // 0x8c
64   "Horizontal <UNDEFINED>",         // 0x8d
65   "Horizontal <UNDEFINED>",         // 0x8e
66   "Horizontal <UNDEFINED>"         // 0x8f
6767};
6868
6969#define HCR  0
r8990r8991
7777
7878static const char *const vidc20_vert_regnames[] =
7979{
80   "Vertical Cycle",                // 0x90 VCR
81   "Vertical Sync Width",             // 0x91 VSWR
82   "Vertical Border Start",          // 0x92 VBSR
83   "Vertical Display Start",          // 0x93 VDSR
80   "Vertical Cycle",               // 0x90 VCR
81   "Vertical Sync Width",            // 0x91 VSWR
82   "Vertical Border Start",         // 0x92 VBSR
83   "Vertical Display Start",         // 0x93 VDSR
8484   "Vertical Display End",          // 0x94 VDER
85   "Vertical Border End",             // 0x95 VBER
86   "Vertical Cursor Start",          // 0x96 VCSR
87   "Vertical Cursor End",             // 0x97 VCER
88   "Vertical Counter TEST",          // 0x98
89   "Horizontal <UNDEFINED>",          // 0x99
90   "Vertical Counter Increment TEST",    // 0x9a
91   "Horizontal <UNDEFINED>",          // 0x9b
92   "Vertical All TEST",             // 0x9c
93   "Horizontal <UNDEFINED>",          // 0x9d
94   "Horizontal <UNDEFINED>",          // 0x9e
95   "Horizontal <UNDEFINED>"          // 0x9f
85   "Vertical Border End",            // 0x95 VBER
86   "Vertical Cursor Start",         // 0x96 VCSR
87   "Vertical Cursor End",            // 0x97 VCER
88   "Vertical Counter TEST",         // 0x98
89   "Horizontal <UNDEFINED>",         // 0x99
90   "Vertical Counter Increment TEST",   // 0x9a
91   "Horizontal <UNDEFINED>",         // 0x9b
92   "Vertical All TEST",            // 0x9c
93   "Horizontal <UNDEFINED>",         // 0x9d
94   "Horizontal <UNDEFINED>",         // 0x9e
95   "Horizontal <UNDEFINED>"         // 0x9f
9696};
9797
9898#define VCR  0
r8990r8991
108108{
109109   /* sanity checks - first pass */
110110   /*
111   total cycles + border start/end
112   */
111    total cycles + border start/end
112    */
113113   if(vidc20_horz_reg[HCR] && vidc20_horz_reg[HBSR] && vidc20_horz_reg[HBER] &&
114114      vidc20_vert_reg[VCR] && vidc20_vert_reg[VBSR] && vidc20_vert_reg[VBER])
115115   {
116116      /* sanity checks - second pass */
117117      /*
118      total cycles > border end > border start
119      */
118        total cycles > border end > border start
119        */
120120      if((vidc20_horz_reg[HCR] > vidc20_horz_reg[HBER]) &&
121121         (vidc20_horz_reg[HBER] > vidc20_horz_reg[HBSR]) &&
122122         (vidc20_vert_reg[VCR] > vidc20_vert_reg[VBER]) &&
r8990r8991
262262   if(x_size <= 0 || y_size <= 0)
263263      return 0;
264264
265//   popmessage("%d",vidc20_bpp_mode);
265//  popmessage("%d",vidc20_bpp_mode);
266266
267267   count = 0;
268268
r8990r8991
513513   "<RESERVED>"                  // 0x1fc
514514};
515515
516#define IOMD_IOCR       0x000/4
516#define IOMD_IOCR      0x000/4
517517#define IOMD_KBDDAT      0x004/4
518518#define IOMD_KBDCR      0x008/4
519519
r8990r8991
531531#define IOMD_T1GO      0x058/4
532532#define IOMD_T1LATCH   0x05c/4
533533
534#define IOMD_ID0       0x094/4
535#define IOMD_ID1       0x098/4
534#define IOMD_ID0      0x094/4
535#define IOMD_ID1      0x098/4
536536#define IOMD_VERSION   0x09c/4
537537
538538#define IOMD_VIDCUR      0x1d0/4
r8990r8991
610610
611611static READ32_HANDLER( a7000_iomd_r )
612612{
613//   if(offset != IOMD_KBDCR)
614//      logerror("IOMD: %s Register (%04x) read\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4);
613//  if(offset != IOMD_KBDCR)
614//      logerror("IOMD: %s Register (%04x) read\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4);
615615
616616
617617   switch(offset)
r8990r8991
626626
627627         return IOMD_IO_ctrl | 0x34 | flyback;
628628      }
629      case IOMD_KBDCR:    return IOMD_keyb_ctrl | 0x80; //IOMD Keyb status
629      case IOMD_KBDCR:   return IOMD_keyb_ctrl | 0x80; //IOMD Keyb status
630630
631631      /*
632      1--- ---- always high
633      -x-- ---- Timer 1
634      --x- ---- Timer 0
635      ---x ---- Power On Reset
636      ---- x--- Flyback
637      ---- -x-- nINT1
638      ---- --0- always low
639      ---- ---x INT2
640      */
632        1--- ---- always high
633        -x-- ---- Timer 1
634        --x- ---- Timer 0
635        ---x ---- Power On Reset
636        ---- x--- Flyback
637        ---- -x-- nINT1
638        ---- --0- always low
639        ---- ---x INT2
640        */
641641      case IOMD_IRQSTA:   return (IRQ_status_A & ~2) | 0x80;
642642      case IOMD_IRQRQA:   return (IRQ_status_A & IRQ_mask_A) | 0x80;
643643      case IOMD_IRQMSKA:   return (IRQ_mask_A);
r8990r8991
648648      case IOMD_T1LOW:   return timer_out[1] & 0xff;
649649      case IOMD_T1HIGH:   return (timer_out[1] >> 8) & 0xff;
650650
651      case IOMD_ID0:       return io_id & 0xff; // IOMD ID low
652      case IOMD_ID1:       return (io_id >> 8) & 0xff; // IOMD ID high
651      case IOMD_ID0:      return io_id & 0xff; // IOMD ID low
652      case IOMD_ID1:      return (io_id >> 8) & 0xff; // IOMD ID high
653653      case IOMD_VERSION:   return 0;
654654
655      case IOMD_VIDEND:    return (viddma_addr_end & 0x00fffff8); //bits 31:24 undefined
655      case IOMD_VIDEND:   return (viddma_addr_end & 0x00fffff8); //bits 31:24 undefined
656656      case IOMD_VIDSTART: return (viddma_addr_start & 0x1ffffff8); //bits 31, 30, 29 undefined
657657      case IOMD_VIDCR:   return (viddma_status & 0xa0) | 0x50; //bit 6 = DRAM mode, bit 4 = QWORD transfer
658658
659      default:    logerror("IOMD: %s Register (%04x) read\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4); break;
659      default:   logerror("IOMD: %s Register (%04x) read\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4); break;
660660   }
661661
662662   return 0;
r8990r8991
664664
665665static WRITE32_HANDLER( a7000_iomd_w )
666666{
667//   logerror("IOMD: %s Register (%04x) write = %08x\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4,data);
667//  logerror("IOMD: %s Register (%04x) write = %08x\n",iomd_regnames[offset & (0x1ff >> 2)],offset*4,data);
668668
669669   switch(offset)
670670   {
r8990r8991
678678      case IOMD_IRQRQA:   IRQ_status_A &= ~data; break;
679679      case IOMD_IRQMSKA:   IRQ_mask_A = (data & ~2) | 0x80; break;
680680
681      case IOMD_T0LOW:    timer_in[0] = (timer_in[0] & 0xff00) | (data & 0xff); break;
682      case IOMD_T0HIGH:    timer_in[0] = (timer_in[0] & 0x00ff) | ((data & 0xff) << 8); break;
681      case IOMD_T0LOW:   timer_in[0] = (timer_in[0] & 0xff00) | (data & 0xff); break;
682      case IOMD_T0HIGH:   timer_in[0] = (timer_in[0] & 0x00ff) | ((data & 0xff) << 8); break;
683683      case IOMD_T0GO:
684684         timer_counter[0] = timer_in[0];
685685         fire_iomd_timer(0,timer_counter[0]);
r8990r8991
698698         }
699699         break;
700700
701      case IOMD_T1LOW:    timer_in[1] = (timer_in[1] & 0xff00) | (data & 0xff); break;
702      case IOMD_T1HIGH:    timer_in[1] = (timer_in[1] & 0x00ff) | ((data & 0xff) << 8); break;
701      case IOMD_T1LOW:   timer_in[1] = (timer_in[1] & 0xff00) | (data & 0xff); break;
702      case IOMD_T1HIGH:   timer_in[1] = (timer_in[1] & 0x00ff) | ((data & 0xff) << 8); break;
703703      case IOMD_T1GO:
704704         timer_counter[1] = timer_in[1];
705705         fire_iomd_timer(1,timer_counter[1]);
r8990r8991
718718         }
719719         break;
720720
721      case IOMD_VIDEND:    viddma_addr_end = data & 0x00fffff8; //bits 31:24 unused
721      case IOMD_VIDEND:   viddma_addr_end = data & 0x00fffff8; //bits 31:24 unused
722722      case IOMD_VIDSTART: viddma_addr_start = data & 0x1ffffff8; //bits 31, 30, 29 unused
723723      case IOMD_VIDCR:
724724         viddma_status = data & 0xa0; if(data & 0x20) { viddma_transfer_start(space); }
r8990r8991
731731
732732static ADDRESS_MAP_START( a7000_mem, ADDRESS_SPACE_PROGRAM, 32)
733733   AM_RANGE(0x00000000, 0x003fffff) AM_MIRROR(0x00800000) AM_ROM AM_REGION("user1", 0x0)
734//   AM_RANGE(0x01000000, 0x01ffffff) AM_NOP //expansion ROM
735//   AM_RANGE(0x02000000, 0x02ffffff) AM_RAM //VRAM
736//   I/O 03000000 - 033fffff
737//   AM_RANGE(0x03010000, 0x03011fff) //Super IO
738//   AM_RANGE(0x03012000, 0x03029fff) //FDC
739//   AM_RANGE(0x0302b000, 0x0302bfff) //Network podule
740//   AM_RANGE(0x03040000, 0x0304ffff) //podule space 0,1,2,3
741//   AM_RANGE(0x03070000, 0x0307ffff) //podule space 4,5,6,7
734//  AM_RANGE(0x01000000, 0x01ffffff) AM_NOP //expansion ROM
735//  AM_RANGE(0x02000000, 0x02ffffff) AM_RAM //VRAM
736//  I/O 03000000 - 033fffff
737//  AM_RANGE(0x03010000, 0x03011fff) //Super IO
738//  AM_RANGE(0x03012000, 0x03029fff) //FDC
739//  AM_RANGE(0x0302b000, 0x0302bfff) //Network podule
740//  AM_RANGE(0x03040000, 0x0304ffff) //podule space 0,1,2,3
741//  AM_RANGE(0x03070000, 0x0307ffff) //podule space 4,5,6,7
742742   AM_RANGE(0x03200000, 0x032001ff) AM_READWRITE(a7000_iomd_r,a7000_iomd_w) //IOMD Registers //mirrored at 0x03000000-0x1ff?
743//   AM_RANGE(0x03310000, 0x03310003) //Mouse Buttons
743//  AM_RANGE(0x03310000, 0x03310003) //Mouse Buttons
744744
745745   AM_RANGE(0x03400000, 0x037fffff) AM_WRITE(a7000_vidc20_w)
746//   AM_RANGE(0x08000000, 0x08ffffff) AM_MIRROR(0x07000000) //EASI space
746//  AM_RANGE(0x08000000, 0x08ffffff) AM_MIRROR(0x07000000) //EASI space
747747   AM_RANGE(0x10000000, 0x13ffffff) AM_RAM //SIMM 0 bank 0
748748   AM_RANGE(0x14000000, 0x17ffffff) AM_RAM //SIMM 0 bank 1
749//   AM_RANGE(0x18000000, 0x18ffffff) AM_MIRROR(0x03000000) AM_RAM //SIMM 1 bank 0
750//   AM_RANGE(0x1c000000, 0x1cffffff) AM_MIRROR(0x03000000) AM_RAM //SIMM 1 bank 1
749//  AM_RANGE(0x18000000, 0x18ffffff) AM_MIRROR(0x03000000) AM_RAM //SIMM 1 bank 0
750//  AM_RANGE(0x1c000000, 0x1cffffff) AM_MIRROR(0x03000000) AM_RAM //SIMM 1 bank 1
751751ADDRESS_MAP_END
752752
753753
r8990r8991
767767static MACHINE_RESET(a7000)
768768{
769769   IOMD_IO_ctrl = 0x0b | 0x34; //bit 0,1 and 3 set high on reset plus 2,4,5 always high
770//   IRQ_status_A = 0x10; // set POR bit ON
770//  IRQ_status_A = 0x10; // set POR bit ON
771771   IRQ_mask_A = 0x00;
772772
773773   IOMD_keyb_ctrl = 0x00;
src/mess/drivers/crvision.c
r8990r8991
99
1010    TODO:
1111
12   CreatiVision
12    CreatiVision
1313
1414    - fix Diagnostic A (video) sprites generator test
1515    - proper keyboard emulation, need keyboard schematics
r8990r8991
2222        * Titanic Frogger Demo 1.0
2323        * Titanic Frogger Demo 1.1
2424
25   Salora Manager
25    Salora Manager
2626
27   - keyboard Ctrl+I/J/N don't print out BASIC commands
28   - RAM mapping
29   - cassette (figure out correct input level)
30   - floppy (interface cartridge needed)
27    - keyboard Ctrl+I/J/N don't print out BASIC commands
28    - RAM mapping
29    - cassette (figure out correct input level)
30    - floppy (interface cartridge needed)
3131
3232*/
3333
r8990r8991
8686CN3     - printer connector (7x2 PCB edge male)
8787CN4     - expansion connector (30x2 PCB edge male)
8888CN5     - cartridge connector (18x2 PCB edge female)
89CN6      - keyboard connector (16x1 pin header)
89CN6     - keyboard connector (16x1 pin header)
9090
9191
9292Sub board
r8990r8991
393393
394394static INPUT_PORTS_START( manager )
395395   PORT_START("ROW0")
396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
397   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
397   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
398398   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
399399   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r')
400400   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('-')
r8990r8991
403403   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
404404
405405   PORT_START("ROW1")
406   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
407   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
406   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
407   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
408408   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xC3\x84 \xC3\xA4") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0x00C4) PORT_CHAR(0x00E4)
409409   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(';') PORT_CHAR('+')
410410   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
r8990r8991
414414
415415   PORT_START("ROW2")
416416   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
417   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
417   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
418418   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
419419   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xC3\x85 \xC3\xA5") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(0x00C5) PORT_CHAR(0x00E5)
420   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
420   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
421421   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
422422   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
423423   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
r8990r8991
433433   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
434434
435435   PORT_START("ROW4")
436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
437   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
437   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
438438   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
439439   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
440440   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
r8990r8991
444444
445445   PORT_START("ROW5")
446446   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
448448   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
449449   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=')
450450   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
r8990r8991
453453   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
454454
455455   PORT_START("ROW6")
456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
457457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
458458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
459459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
r8990r8991
471471   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
472472   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
473473   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
474   
474
475475   PORT_START("JOY0")
476476   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
477477   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
r8990r8991
761761
762762   /* keyboard latch */
763763   state->keylatch = data;
764   
764
765765   /* centronics data */
766766   centronics_data_w(device, 0, data);
767767}
r8990r8991
779779static READ_LINE_DEVICE_HANDLER( lasr2001_pia_cb1_r )
780780{
781781   crvision_state *state = device->machine->driver_data<crvision_state>();
782   
782
783783   /* actually this is a diode-AND (READY & _BUSY), but ctronics.c returns busy status if printer image is not mounted -> Manager won't boot */
784784   return sn76496_ready_r(state->psg) & (centronics_not_busy_r(state->centronics) | pia6821_get_output_ca2_z(device));
785785}
r8990r8991
12071207CONS( 1983,   vz2000,     crvision,   0,      pal,      crvision,   0,      "Dick Smith Electronics",   "VZ 2000 (Oceania)", 0 )
12081208CONS( 1983,   crvisio2,   crvision,   0,      pal,      crvision,   0,      "Video Technology",         "CreatiVision MK-II (Europe)", 0 )
12091209/*
1210COMP( 1983, lasr2001,   0,          0,      lasr2001,   lasr2001,   0,      "Video Technology",         "Laser 2001", GAME_NOT_WORKING )
1211COMP( 1983, vz2001,     lasr2001,   0,      lasr2001,   lasr2001,   0,      "Dick Smith Electronics",   "VZ 2001 (Oceania)", GAME_NOT_WORKING )
1210COMP( 1983, lasr2001,   0,          0,      lasr2001,   lasr2001,   0,      "Video Technology",         "Laser 2001", GAME_NOT_WORKING )
1211COMP( 1983, vz2001,     lasr2001,   0,      lasr2001,   lasr2001,   0,      "Dick Smith Electronics",   "VZ 2001 (Oceania)", GAME_NOT_WORKING )
12121212*/
12131213COMP( 1983,   manager,   0,         0,      lasr2001,   manager,   0,      "Salora",               "Manager (Finland)", 0 )
src/mess/drivers/fmtowns.c
r8990r8991
272272   switch(offset)
273273   {
274274      case 0x00:  // bit 7 = NMI vector protect, bit 6 = power off, bit 0 = software reset, bit 3 = A20 line?
275//         cputag_set_input_line(space->machine,"maincpu",INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
275//          cputag_set_input_line(space->machine,"maincpu",INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
276276         logerror("SYS: port 0x20 write %02x\n",data);
277277         break;
278278      case 0x02:
src/mess/drivers/mz2500.c
r8990r8991
44
55    driver by Angelo Salese
66
7   TODO:
8   - Kanji text is cutted in half when font_size is 1 / interlace is disabled, different data used? (check Back to the Future);
9   - Find real CRTC registers
10   - Some games doesn't set proper registers if you have interlace enabled, is there any real reason?
11   - Implement external ROM hook-up;
12   - FDC loading without the IPLPRO doesn't work at all, why?
13   - reverse / blanking tvram attributes;
14   - clean-ups! ^^'
7    TODO:
8    - Kanji text is cutted in half when font_size is 1 / interlace is disabled, different data used? (check Back to the Future);
9    - Find real CRTC registers
10    - Some games doesn't set proper registers if you have interlace enabled, is there any real reason?
11    - Implement external ROM hook-up;
12    - FDC loading without the IPLPRO doesn't work at all, why?
13    - reverse / blanking tvram attributes;
14    - clean-ups! ^^'
1515
1616    per-game/program specific TODO:
17   - Basic: vertical scrolling returns wrap-around that shouldn't wrap;
18   - Basic: loading has an alignment bug with the bitmap
19   - LayDock: hangs by reading the FDC status and expecting it to become 0x81;
20   - Mappy: TVRAM layer is double x sized than it should be;
21   - Marchen Veil I: dies with garbage on screen;
22   - Moon Child: needs mixed 3+3bpp tvram supported;
23   - Moon Child: appears to be a network / system link game, obviously doesn't work with current MAME / MESS framework;
24   - Mugen no Shinzou: returns an HW error if you attempt to start a play;
25   - Mugen no Shinzou II - The Prince of Darkness: dies on IPLPRO loading, presumably a wd17xx core bug;
26   - Multiplan: random hangs/crashes after you set the RTC, sometimes it loads properly;
27   - Murder Club: has lots of CG artifacts;
28   - Penguin Kun Wars: has a bug with window effects ("Push space or trigger" msg on the bottom"), needs investigation;
29   - Relics: doesn't boot, sets fdc register 0xdc bit 2 to 1
30   - Sound Gal Music Editor: dies with bad code, another wd17xx core bug;
31   - Telephone Soft: shows garbage with the CG layer;
32   - The Tower of Druaga: has a small priority/layer clearance bug at the digital / analog screen select;
33   - Xevious: has issues with the window effects, it should actually be applied on TV layer and not CG.
34   - Ys 3: has garbage on top / bottom (note: you have to load both disks at start-up otherwise it refuses to run)
35   - Yukar K2 (normal version): moans about something, DFJustin: "please put the system disk back to normal", disk write-protected?
17    - Basic: vertical scrolling returns wrap-around that shouldn't wrap;
18    - Basic: loading has an alignment bug with the bitmap
19    - LayDock: hangs by reading the FDC status and expecting it to become 0x81;
20    - Mappy: TVRAM layer is double x sized than it should be;
21    - Marchen Veil I: dies with garbage on screen;
22    - Moon Child: needs mixed 3+3bpp tvram supported;
23    - Moon Child: appears to be a network / system link game, obviously doesn't work with current MAME / MESS framework;
24    - Mugen no Shinzou: returns an HW error if you attempt to start a play;
25    - Mugen no Shinzou II - The Prince of Darkness: dies on IPLPRO loading, presumably a wd17xx core bug;
26    - Multiplan: random hangs/crashes after you set the RTC, sometimes it loads properly;
27    - Murder Club: has lots of CG artifacts;
28    - Penguin Kun Wars: has a bug with window effects ("Push space or trigger" msg on the bottom"), needs investigation;
29    - Relics: doesn't boot, sets fdc register 0xdc bit 2 to 1
30    - Sound Gal Music Editor: dies with bad code, another wd17xx core bug;
31    - Telephone Soft: shows garbage with the CG layer;
32    - The Tower of Druaga: has a small priority/layer clearance bug at the digital / analog screen select;
33    - Xevious: has issues with the window effects, it should actually be applied on TV layer and not CG.
34    - Ys 3: has garbage on top / bottom (note: you have to load both disks at start-up otherwise it refuses to run)
35    - Yukar K2 (normal version): moans about something, DFJustin: "please put the system disk back to normal", disk write-protected?
3636
3737    memory map:
3838    0x00000-0x3ffff Work RAM
r8990r8991
285285
286286   base_addr = text_reg[1] | ((text_reg[2] & 0x7) << 8);
287287
288//   popmessage("%02x",text_reg[9]);
288//  popmessage("%02x",text_reg[9]);
289289
290290   if(text_col_size)
291291      draw_80x25(machine,bitmap,cliprect,base_addr);
r8990r8991
297297
298298      switch(tv_mode & 3)
299299      {
300//         case 0: mixed 6bpp mode
300//          case 0: mixed 6bpp mode
301301         case 1:
302302            draw_40x25(machine,bitmap,cliprect,0,base_addr);
303303            break;
r8990r8991
334334
335335            /* check window boundaries */
336336            //if(res_x < cg_hs || res_x >= cg_he || res_y < cg_vs || res_y >= cg_ve)
337            //   continue;
337            //  continue;
338338
339339            /* TODO: very preliminary, just Yukar K2 uses this so far*/
340340            pen_bit[0] = (vram[count + 0x00000]>>(xi)) & 1 ? 7 : 0; // B
r8990r8991
515515   draw_cg_screen(screen->machine,bitmap,cliprect,0);
516516   draw_tv_screen(screen->machine,bitmap,cliprect);
517517   draw_cg_screen(screen->machine,bitmap,cliprect,1);
518   //   popmessage("%02x (%02x %02x) (%02x %02x) (%02x %02x) (%02x %02x)",cg_reg[0x0f],cg_reg[0x10],cg_reg[0x11],cg_reg[0x12],cg_reg[0x13],cg_reg[0x14],cg_reg[0x15],cg_reg[0x16],cg_reg[0x17]);
518   //  popmessage("%02x (%02x %02x) (%02x %02x) (%02x %02x) (%02x %02x)",cg_reg[0x0f],cg_reg[0x10],cg_reg[0x11],cg_reg[0x12],cg_reg[0x13],cg_reg[0x14],cg_reg[0x15],cg_reg[0x16],cg_reg[0x17]);
519519
520520    return 0;
521521}
r8990r8991
615615   UINT8 *ram = memory_region(machine, "maincpu");
616616   UINT8 cur_bank = bank_val[bank_num];
617617
618//   if(cur_bank >= 0x30 && cur_bank <= 0x33)
619//      printf("CG REG = %02x %02x %02x %02x | offset = %04x | data = %02x\n",cg_reg[0],cg_reg[1],cg_reg[2],cg_reg[3],offset,data);
618//  if(cur_bank >= 0x30 && cur_bank <= 0x33)
619//      printf("CG REG = %02x %02x %02x %02x | offset = %04x | data = %02x\n",cg_reg[0],cg_reg[1],cg_reg[2],cg_reg[3],offset,data);
620620
621621   switch(cur_bank)
622622   {
r8990r8991
756756
757757static WRITE8_HANDLER( mz2500_bank_addr_w )
758758{
759//   printf("%02x\n",data);
759//  printf("%02x\n",data);
760760   bank_addr = data & 7;
761761}
762762
r8990r8991
897897         if(text_reg_index >= 0x80 && text_reg_index <= 0x8f) //Bitmap 16 clut registers
898898         {
899899            /*
900            ---x ---- priority
901            ---- xxxx clut number
902            */
900                ---x ---- priority
901                ---- xxxx clut number
902                */
903903            clut16[text_reg_index & 0xf] = data & 0x1f;
904904            //printf("%02x -> [%02x]\n",text_reg[text_reg_index],text_reg_index);
905905
r8990r8991
947947   if(irq_sel & 0x10)
948948      irq_vector[3] = data; //RP5c15
949949
950//   popmessage("%02x %02x %02x %02x",irq_vector[0],irq_vector[1],irq_vector[2],irq_vector[3]);
950//  popmessage("%02x %02x %02x %02x",irq_vector[0],irq_vector[1],irq_vector[2],irq_vector[3]);
951951}
952952
953953static WRITE8_HANDLER( mz2500_fdc_w )
r8990r8991
17611761static WRITE8_DEVICE_HANDLER( opn_porta_w )
17621762{
17631763   /*
1764   ---- x--- mouse select
1765   ---- -x-- palette bit (16/4096 colors)
1766   ---- --x- floppy reverse bit (controls wd17xx bits in command registers)
1767   */
1764    ---- x--- mouse select
1765    ---- -x-- palette bit (16/4096 colors)
1766    ---- --x- floppy reverse bit (controls wd17xx bits in command registers)
1767    */
17681768
17691769   fdc_reverse = (data & 2) ? 0x00 : 0xff;
17701770   pal_select = (data & 4) ? 1 : 0;
r8990r8991
18311831static void mz2500_rtc_alarm_irq(int state)
18321832{
18331833   /* TODO: doesn't work yet */
1834//   if(irq_mask[3] && state & 1)
1835//      cputag_set_input_line_and_vector(device, "maincpu", 0, HOLD_LINE,irq_vector[3]);
1834//  if(irq_mask[3] && state & 1)
1835//      cputag_set_input_line_and_vector(device, "maincpu", 0, HOLD_LINE,irq_vector[3]);
18361836}
18371837
18381838static const struct rp5c15_interface rtc_intf =
src/mess/drivers/tk80bs.c
r8990r8991
11/***************************************************************************
22
3   TK-80BS (c) 1980 NEC
3    TK-80BS (c) 1980 NEC
44
5   preliminary driver by Angelo Salese
5    preliminary driver by Angelo Salese
66
7   TODO:
8   - (try to) dump proper roms, the whole driver is based off fake roms;
9   - Remove the PPI hack;
10   - BASIC doesn't seem to work properly;
7    TODO:
8    - (try to) dump proper roms, the whole driver is based off fake roms;
9    - Remove the PPI hack;
10    - BASIC doesn't seem to work properly;
1111
1212****************************************************************************/
1313
r8990r8991
7676/* FIXME: current i8255 core doesn't seem to like this system at all, so we use custom code here for now */
7777static READ8_HANDLER( ppi_custom_r )
7878{
79//   printf("%02x\n",offset);
79//  printf("%02x\n",offset);
8080
8181   switch(offset+0x7dfc)
8282   {
r8990r8991
101101static ADDRESS_MAP_START(tk80bs_mem, ADDRESS_SPACE_PROGRAM, 8)
102102   ADDRESS_MAP_UNMAP_HIGH
103103   AM_RANGE(0x0000, 0x07ff) AM_ROM
104//   AM_RANGE(0x0c00, 0x7bff) AM_ROM // ext
104//  AM_RANGE(0x0c00, 0x7bff) AM_ROM // ext
105105   AM_RANGE(0x7df8, 0x7df9) AM_NOP // i8251 sio
106//   AM_RANGE(0x7dfc, 0x7dff) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w)
106//  AM_RANGE(0x7dfc, 0x7dff) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w)
107107   AM_RANGE(0x7dfc, 0x7dff) AM_READWRITE(ppi_custom_r,ppi_custom_w)
108108   AM_RANGE(0x7e00, 0x7fff) AM_RAM AM_BASE(&vram) // video ram
109109   AM_RANGE(0x8000, 0xcfff) AM_RAM // RAM
r8990r8991
248248            if(!shift_press_flag)  // shift not pressed
249249            {
250250               //if(scancode >= 0x41 && scancode < 0x5b)
251               //   scancode += 0x20;  // lowercase doesn't exist here
251               //  scancode += 0x20;  // lowercase doesn't exist here
252252            }
253253            else
254254            {
r8990r8991
335335    /* basic machine hardware */
336336    MDRV_CPU_ADD("maincpu",I8080, XTAL_1MHz)
337337    MDRV_CPU_PROGRAM_MAP(tk80_mem)
338    MDRV_CPU_IO_MAP(tk80_io)   
338    MDRV_CPU_IO_MAP(tk80_io)
339339
340340    MDRV_MACHINE_RESET(tk80)
341   
341
342342    /* video hardware */
343343    MDRV_SCREEN_ADD("screen", RASTER)
344344    MDRV_SCREEN_REFRESH_RATE(50)
r8990r8991
358358    MDRV_CPU_ADD("maincpu",I8080, XTAL_1MHz) //unknown clock
359359    MDRV_CPU_PROGRAM_MAP(tk80bs_mem)
360360
361//   MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 )
361//  MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 )
362362
363363    MDRV_MACHINE_START(tk80bs)
364364    MDRV_MACHINE_RESET(tk80bs)
r8990r8991
414414/* Driver */
415415
416416/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
417COMP( 1976, tk80,    0,      0,       tk80,      tk80,    0,       "Nippon Electronic Company",   "TK-80",      GAME_NOT_WORKING | GAME_NO_SOUND)
417COMP( 1976, tk80,   0,      0,       tk80,      tk80,    0,       "Nippon Electronic Company",   "TK-80",      GAME_NOT_WORKING | GAME_NO_SOUND)
418418COMP( 1980, tk80bs, tk80,   0,       tk80bs,    tk80bs,  0,       "Nippon Electronic Company",   "TK-80BS",      GAME_NOT_WORKING | GAME_NO_SOUND)
419419
src/mess/drivers/multi8.c
r8990r8991
11/***************************************************************************
22
3   Multi 8 (c) 1983 Mitsubishi
3    Multi 8 (c) 1983 Mitsubishi
44
5   preliminary driver by Angelo Salese
5    preliminary driver by Angelo Salese
66
7   TODO:
8   - dunno how to trigger the text color mode in BASIC, I just modify
9     $f0b1 to 1 for now
10   - bitmap B/W mode is untested
7    TODO:
8    - dunno how to trigger the text color mode in BASIC, I just modify
9      $f0b1 to 1 for now
10    - bitmap B/W mode is untested
1111
1212****************************************************************************/
1313
r8990r8991
3030   cursor_addr = cursor_raster = 0;
3131   for (bw_mode = 0; bw_mode < 8; bw_mode++) pen_clut[bw_mode]=0;
3232   vram_bank = 8;
33   bw_mode = 0;   
33   bw_mode = 0;
3434}
3535
3636static VIDEO_UPDATE( multi8 )
r8990r8991
168168
169169static READ8_HANDLER( key_status_r )
170170{
171   if(mcu_init == 0){             return 1; }
171   if(mcu_init == 0){            return 1; }
172172   if(mcu_init == 1){ mcu_init++;   return 1; }
173173   if(mcu_init == 2){ mcu_init++;   return 0; }
174174
r8990r8991
237237ADDRESS_MAP_END
238238
239239static ADDRESS_MAP_START( multi8_io , ADDRESS_SPACE_IO, 8)
240//   ADDRESS_MAP_UNMAP_HIGH
240//  ADDRESS_MAP_UNMAP_HIGH
241241   ADDRESS_MAP_GLOBAL_MASK(0xff)
242242   AM_RANGE(0x00, 0x00) AM_READ(key_input_r) AM_WRITENOP//keyboard
243243   AM_RANGE(0x01, 0x01) AM_READ(key_status_r) AM_WRITENOP//keyboard
244244   AM_RANGE(0x18, 0x19) AM_DEVWRITE("ymsnd", ym2203_w)
245//   AM_RANGE(0x18, 0x18) //opn read 0
245//  AM_RANGE(0x18, 0x18) //opn read 0
246246   AM_RANGE(0x1a, 0x1a) AM_DEVREAD("ymsnd", ym2203_r)
247247   AM_RANGE(0x1c, 0x1d) AM_WRITE(multi8_6845_w)
248//   AM_RANGE(0x20, 0x21) //sio, cmt
249//   AM_RANGE(0x24, 0x27) //pit
248//  AM_RANGE(0x20, 0x21) //sio, cmt
249//  AM_RANGE(0x24, 0x27) //pit
250250   AM_RANGE(0x28, 0x2b) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w)
251//   AM_RANGE(0x2c, 0x2d) //i8259
251//  AM_RANGE(0x2c, 0x2d) //i8259
252252   AM_RANGE(0x30, 0x37) AM_READWRITE(pal_r,pal_w)
253//   AM_RANGE(0x40, 0x41) //kanji regs
254//   AM_RANGE(0x70, 0x74) //upd765a fdc
255//   AM_RANGE(0x78, 0x78) //memory banking
253//  AM_RANGE(0x40, 0x41) //kanji regs
254//  AM_RANGE(0x70, 0x74) //upd765a fdc
255//  AM_RANGE(0x78, 0x78) //memory banking
256256ADDRESS_MAP_END
257257
258258/* Input ports */
r8990r8991
470470static WRITE8_DEVICE_HANDLER( portb_w )
471471{
472472   /*
473      x--- ---- color mode
474      -x-- ---- screen width (80 / 40)
475      ---- x--- memory bank status
476      ---- -xxx page screen graphics in B/W mode
477   */
478//   address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
473        x--- ---- color mode
474        -x-- ---- screen width (80 / 40)
475        ---- x--- memory bank status
476        ---- -xxx page screen graphics in B/W mode
477    */
478//  address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
479479
480//   printf("Port B w = %02x %04x\n",data,cpu_get_pc(space->cpu));
480//  printf("Port B w = %02x %04x\n",data,cpu_get_pc(space->cpu));
481481
482482   {
483483      if((display_reg & 0x40) != (data & 0x40))
r8990r8991
500500
501501static WRITE8_DEVICE_HANDLER( portc_w )
502502{
503//   printf("Port C w = %02x\n",data);
503//  printf("Port C w = %02x\n",data);
504504   vram_bank = data & 0x1f;
505505
506506   if(data & 0x20 && data != 0xff)
507507      printf("Work RAM bank selected!\n");
508//      fatalerror("Work RAM bank selected");
508//      fatalerror("Work RAM bank selected");
509509}
510510
511511
r8990r8991
603603/* Driver */
604604
605605/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
606COMP( 1983, multi8,  0,       0,    multi8,    multi8,     0,   "Mitsubishi",   "Multi 8",      GAME_NOT_WORKING | GAME_NO_SOUND)
606COMP( 1983, multi8,  0,       0,   multi8,    multi8,     0,   "Mitsubishi",   "Multi 8",      GAME_NOT_WORKING | GAME_NO_SOUND)
607607
src/mess/drivers/p112.c
r8990r8991
11/***************************************************************************
22
3      P112 Single Board Computer
4       
3        P112 Single Board Computer
4
55        30/08/2010 Skeleton driver
6     
6
77****************************************************************************/
88
99#include "emu.h"
r8990r8991
8585/* Driver */
8686
8787/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY    FULLNAME       FLAGS */
88COMP( 1996, p112,  0,       0,   p112,    p112,  0,     "Dave Brooks",   "P112",      GAME_NOT_WORKING | GAME_NO_SOUND)
88COMP( 1996, p112,  0,       0,   p112,   p112,  0,    "Dave Brooks",   "P112",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/mes.c
r8990r8991
33        Schleicher MES
44
55        30/08/2010 Skeleton driver
6     
6
77****************************************************************************/
88
99#include "emu.h"
r8990r8991
7070
7171/* Driver */
7272
73/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
74COMP( 198?, mes,  0,       0,    mes,    mes,     0,       "Schleicher",   "MES",      GAME_NOT_WORKING | GAME_NO_SOUND)
73/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
74COMP( 198?, mes,  0,       0,   mes,   mes,    0,      "Schleicher",   "MES",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/ng_aes.c
r8990r8991
824824               set_audio_cpu_rom_source(space, bit); /* this is a guess */
825825               break;
826826      case 0x05: neogeo_set_fixed_layer_source(space->machine, bit); break;
827//      case 0x06: set_save_ram_unlock(space->machine, bit); break;
827//      case 0x06: set_save_ram_unlock(space->machine, bit); break;
828828      case 0x07: neogeo_set_palette_bank(space->machine, bit); break;
829829
830830      case 0x02: /* unknown - HC32 middle pin 1 */
r8990r8991
843843 *
844844 *  DMA
845845
846   FF0061   Write 0x40 means start DMA transfer
847   FF0064   Source address (in copy mode), Target address (in filll mode)
848   FF0068   Target address (in copy mode)
849   FF006C   Fill word
850   FF0070   Words count
851   FF007E   \
852   ......    | DMA programming words?   NeoGeoCD uses Sanyo Puppet LC8359 chip to
853   FF008E   /                           interface with CD, and do DMA transfers
846    FF0061  Write 0x40 means start DMA transfer
847    FF0064  Source address (in copy mode), Target address (in filll mode)
848    FF0068  Target address (in copy mode)
849    FF006C  Fill word
850    FF0070  Words count
851    FF007E  \
852    ......   | DMA programming words?   NeoGeoCD uses Sanyo Puppet LC8359 chip to
853    FF008E  /                           interface with CD, and do DMA transfers
854854
855   Memory access control
855    Memory access control
856856
857   FF011C   DIP SWITCH (Region code)
858   FF0105   Area Selector (5 = FIX, 0 = SPR, 4 = Z80, 1 = PCM)
859   FF01A1   Sprite bank selector
860   FF01A3   PCM bank selector
861   FF0120   Prepare sprite area for transfer
862   FF0122   Prepare PCM area for transfer
863   FF0126   Prepare Z80 area for transfer
864   FF0128   Prepare Fix area for transfer
865   FF0140   Terminate work on Spr Area   (Sprites must be decoded here)
866   FF0142   Terminate work on Pcm Area
867   FF0146   Terminate work on Z80 Area   (Z80 needs to be reset)
868   FF0148   Terminate work on Fix Area
857    FF011C  DIP SWITCH (Region code)
858    FF0105  Area Selector (5 = FIX, 0 = SPR, 4 = Z80, 1 = PCM)
859    FF01A1  Sprite bank selector
860    FF01A3  PCM bank selector
861    FF0120  Prepare sprite area for transfer
862    FF0122  Prepare PCM area for transfer
863    FF0126  Prepare Z80 area for transfer
864    FF0128  Prepare Fix area for transfer
865    FF0140  Terminate work on Spr Area  (Sprites must be decoded here)
866    FF0142  Terminate work on Pcm Area
867    FF0146  Terminate work on Z80 Area  (Z80 needs to be reset)
868    FF0148  Terminate work on Fix Area
869869
870   CD-ROM:
871   0xff0102 == 0xF0 start cd transfer
872   int m=bcd(fast_r8(0x10f6c8));
873   int s=bcd(fast_r8(0x10f6c9));
874   int f=bcd(fast_r8(0x10f6ca));
875   int seccount=fast_r16(0x10f688);
870    CD-ROM:
871    0xff0102 == 0xF0 start cd transfer
872    int m=bcd(fast_r8(0x10f6c8));
873    int s=bcd(fast_r8(0x10f6c9));
874    int f=bcd(fast_r8(0x10f6ca));
875    int seccount=fast_r16(0x10f688);
876876
877   inisec=((m*60)+s)*75+f;
878   inisec-=150;
879   dstaddr=0x111204; // this must come from somewhere
877    inisec=((m*60)+s)*75+f;
878    inisec-=150;
879    dstaddr=0x111204; // this must come from somewhere
880880
881   the value @ 0x10f688 is decremented each time a sector is read until it's 0.
881    the value @ 0x10f688 is decremented each time a sector is read until it's 0.
882882
883883 *
884884 */
r8990r8991
887887{
888888   // TODO: Proper DMA timing and control
889889   int count;
890//   UINT16 word;
890//  UINT16 word;
891891
892892   switch(neocd_ctrl.dma_mode[0])
893893   {
r8990r8991
14771477#define STANDARD_IN2                                                            \
14781478   PORT_START("IN2")                                                            \
14791479   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )                                       \
1480   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )                            \
1480   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )                           \
14811481   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("1P Select") PORT_CODE(KEYCODE_5) PORT_PLAYER(1)   \
1482   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )                            \
1482   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )                           \
14831483   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("2P Select") PORT_CODE(KEYCODE_6) PORT_PLAYER(2)   \
14841484   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)         \
14851485   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )  /* Matrimelee expects this bit to be active high when on an AES */
r8990r8991
17581758   ROMX_LOAD("neo-po.bin",  0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1))   /* AES Console (Japan) Bios */
17591759   ROM_SYSTEM_BIOS( 1, "asia-aes",   "Asia AES" )
17601760   ROMX_LOAD("neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2))   /* AES Console (Asia?) Bios */
1761//   ROM_SYSTEM_BIOS( 2, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" )
1762//   ROMX_LOAD( "uni-bios_2_3.rom",  0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(3) ) /* Universe Bios v2.3 (hack) */
1761//  ROM_SYSTEM_BIOS( 2, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" )
1762//  ROMX_LOAD( "uni-bios_2_3.rom",  0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(3) ) /* Universe Bios v2.3 (hack) */
17631763
17641764   ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF )
17651765
src/mess/drivers/bml3.c
r8990r8991
11/**************************************************************************************
22
3   Basic Master Level 3 (MB-6890) (c) 1980 Hitachi
3    Basic Master Level 3 (MB-6890) (c) 1980 Hitachi
44
5   preliminary driver by Angelo Salese
5    preliminary driver by Angelo Salese
66
7   TODO:
8   - no documentation, the entire driver is just a bunch of educated
7    TODO:
8    - no documentation, the entire driver is just a bunch of educated
99      guesses ...
10   - keyboard shift key is ugly mapped.
11   - understand how to load a tape
12   - every time that you switch with NEW ON command, there's a "device i/o error" if
13     the hres_reg bit 5 is active.
14   - LINE command doesn't work? It says "type mismatch"
10    - keyboard shift key is ugly mapped.
11    - understand how to load a tape
12    - every time that you switch with NEW ON command, there's a "device i/o error" if
13      the hres_reg bit 5 is active.
14    - LINE command doesn't work? It says "type mismatch"
1515
16   NOTES:
17   - NEW ON changes the video mode, they are:
18      0: 320 x 200, bit 5 active
19      1: 320 x 200, bit 5 unactive
20      2: 320 x 375, bit 5 active
21      3: 320 x 375, bit 5 unactive
22      4: 640 x 200, bit 5 active
23      5: 640 x 200, bit 5 unactive
24      6: 640 x 375, bit 5 active
25      7: 640 x 375, bit 5 unactive
26      8-15: same as above plus sets bit 4
27      16-31: same as above plus shows the bar at the bottom
16    NOTES:
17    - NEW ON changes the video mode, they are:
18        0: 320 x 200, bit 5 active
19        1: 320 x 200, bit 5 unactive
20        2: 320 x 375, bit 5 active
21        3: 320 x 375, bit 5 unactive
22        4: 640 x 200, bit 5 active
23        5: 640 x 200, bit 5 unactive
24        6: 640 x 375, bit 5 active
25        7: 640 x 375, bit 5 unactive
26        8-15: same as above plus sets bit 4
27        16-31: same as above plus shows the bar at the bottom
2828
2929**************************************************************************************/
3030
r8990r8991
5555   width = (hres_reg & 0x80) ? 80 : 40;
5656   height = (vres_reg & 0x08) ? 1 : 0;
5757
58//   popmessage("%02x %02x",hres_reg,vres_reg);
58//  popmessage("%02x %02x",hres_reg,vres_reg);
5959
6060   for(y=0;y<25;y++)
6161   {
r8990r8991
167167
168168   if(offset == 0x19) return io_latch;
169169   if(offset == 0xc4) return 0xff; //some video modes wants this to be high
170//   if(offset == 0xc5 || offset == 0xca) return mame_rand(space->machine); //tape related
170//  if(offset == 0xc5 || offset == 0xca) return mame_rand(space->machine); //tape related
171171   if(offset == 0xc8) return 0; //??? checks bit 7, scrolls vertically if active high
172172   if(offset == 0xc9) return 0x11; //0x01 put 320 x 200 mode, 0x07 = 640 x 375
173173
174174   /* one of these sets something, apparently available RAM space is smaller if one of these bits is zero (?) */
175//   if(offset == 0x40) return 0 ? 0xff : 0x00;
176//   if(offset == 0x42) return 0 ? 0xff : 0x00;
177//   if(offset == 0x44) return 0 ? 0xff : 0x00;
178//   if(offset == 0x46) return 0 ? 0xff : 0x00;
175//  if(offset == 0x40) return 0 ? 0xff : 0x00;
176//  if(offset == 0x42) return 0 ? 0xff : 0x00;
177//  if(offset == 0x44) return 0 ? 0xff : 0x00;
178//  if(offset == 0x46) return 0 ? 0xff : 0x00;
179179
180180   if(offset == 0xd8) return attr_latch;
181181   if(offset == 0xe0) return bml3_keyboard_r(space,0);
182182
183//   if(offset == 0xcb)
183//  if(offset == 0xcb)
184184
185//   if(offset == 0x40 || offset == 0x42 || offset == 0x44 || offset == 0x46)
185//  if(offset == 0x40 || offset == 0x42 || offset == 0x44 || offset == 0x46)
186186
187187   if(offset < 0xf0)
188188   {
r8990r8991
214214static WRITE8_HANDLER( bml3_hres_reg_w )
215215{
216216   /*
217   x--- ---- width (1) 80 / (0) 40
218   -x-- ---- used in some modes, unknown purpose
219   --x- ---- used in some modes, unknown purpose (also wants $ffc4 to be 0xff), color / monochrome switch?
220   */
217    x--- ---- width (1) 80 / (0) 40
218    -x-- ---- used in some modes, unknown purpose
219    --x- ---- used in some modes, unknown purpose (also wants $ffc4 to be 0xff), color / monochrome switch?
220    */
221221
222222   hres_reg = data;
223223
r8990r8991
227227static WRITE8_HANDLER( bml3_vres_reg_w )
228228{
229229   /*
230   ---- x--- char height
231   */
230    ---- x--- char height
231    */
232232   vres_reg = data;
233233
234234   m6845_change_clock(space->machine,(hres_reg & 0x80) | (vres_reg & 0x08));
r8990r8991
236236
237237static WRITE8_HANDLER( bml3_io_w )
238238{
239   if(offset == 0x19)                      { io_latch = data; } //???
240//   else if(offset == 0xc4)                  { /* system latch, writes 0x53 -> 0x51 when a tape is loaded */}
241   else if(offset == 0xc6 || offset == 0xc7)    { bml3_6845_w(space,offset-0xc6,data); }
239   if(offset == 0x19)                     { io_latch = data; } //???
240//  else if(offset == 0xc4)                     { /* system latch, writes 0x53 -> 0x51 when a tape is loaded */}
241   else if(offset == 0xc6 || offset == 0xc7)   { bml3_6845_w(space,offset-0xc6,data); }
242242   else if(offset == 0xd0)                  { bml3_hres_reg_w(space,0,data);  }
243243   else if(offset == 0xd3)                  { beep_set_state(space->machine->device("beeper"),!(data & 0x80)); }
244244   else if(offset == 0xd6)                  { bml3_vres_reg_w(space,0,data); }
245   else if(offset == 0xd8)                  { attr_latch = data; }
245   else if(offset == 0xd8)                  { attr_latch = data; }
246246   else
247247   {
248248      logerror("I/O write %02x -> [%02x] at PC=%04x\n",data,offset,cpu_get_pc(space->cpu));
r8990r8991
312312   PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
313313   PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("7 PAD") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
314314   PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("X7") //backspace
315   PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xC2\xA5") //PORT_NAME("¥")
315   PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xC2\xA5") //PORT_NAME("?")
316316
317317   PORT_START("key2") //0x20-0x3f
318318   PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
r8990r8991
466466    /* basic machine hardware */
467467   MDRV_CPU_ADD("maincpu",M6809, XTAL_1MHz)
468468   MDRV_CPU_PROGRAM_MAP(bml3_mem)
469//   MDRV_CPU_VBLANK_INT("screen", bml3_irq )
470//   MDRV_CPU_PERIODIC_INT(bml3_firq,45)
469//  MDRV_CPU_VBLANK_INT("screen", bml3_irq )
470//  MDRV_CPU_PERIODIC_INT(bml3_firq,45)
471471
472472   MDRV_MACHINE_START(bml3)
473    MDRV_MACHINE_RESET(bml3)
473   MDRV_MACHINE_RESET(bml3)
474474
475    /* video hardware */
475   /* video hardware */
476476   MDRV_SCREEN_ADD("screen", RASTER)
477477   MDRV_SCREEN_REFRESH_RATE(60)
478478   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
r8990r8991
497497/* ROM definition */
498498ROM_START( bml3 )
499499    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
500//   ROM_LOAD( "l3bas.rom", 0xa000, 0x6000, BAD_DUMP CRC(d81baa07) SHA1(a8fd6b29d8c505b756dbf5354341c48f9ac1d24d)) //original, 24k isn't a proper rom size!
500//  ROM_LOAD( "l3bas.rom", 0xa000, 0x6000, BAD_DUMP CRC(d81baa07) SHA1(a8fd6b29d8c505b756dbf5354341c48f9ac1d24d)) //original, 24k isn't a proper rom size!
501501   /* Handcrafted ROMs, rom labels and contents might not match */
502502   ROM_LOAD( "598 p16611.ic3", 0xa000, 0x2000, BAD_DUMP CRC(954b9bad) SHA1(047948fac6808717c60a1d0ac9205a5725362430))
503503   ROM_LOAD( "599 p16561.ic4", 0xc000, 0x2000, BAD_DUMP CRC(b27a48f5) SHA1(94cb616df4caa6415c5076f9acdf675acb7453e2))
r8990r8991
513513/* Driver */
514514
515515/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
516COMP( 1980, bml3,     0,       0,       bml3,    bml3,     0,        "Hitachi",   "Basic Master Level 3",      GAME_NOT_WORKING | GAME_NO_SOUND)
516COMP( 1980, bml3,   0,       0,       bml3,   bml3,    0,       "Hitachi",   "Basic Master Level 3",      GAME_NOT_WORKING | GAME_NO_SOUND)
517517
src/mess/drivers/mccpm.c
r8990r8991
11/***************************************************************************
2   
2
33        mc-CP/M-Computer
44
55        31/08/2010 Skeleton driver.
r8990r8991
1818
1919static ADDRESS_MAP_START( mccpm_io , ADDRESS_SPACE_IO, 8)
2020   ADDRESS_MAP_UNMAP_HIGH
21   ADDRESS_MAP_GLOBAL_MASK(0xff)   
21   ADDRESS_MAP_GLOBAL_MASK(0xff)
2222ADDRESS_MAP_END
2323
2424/* Input ports */
r8990r8991
2626INPUT_PORTS_END
2727
2828
29static MACHINE_RESET(mccpm)
30{   
29static MACHINE_RESET(mccpm)
30{
3131   UINT8* bios = memory_region(machine, "maincpu");
3232
3333   memcpy(mccpm_ram,bios, 0x1000);
r8990r8991
4646    /* basic machine hardware */
4747    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
4848    MDRV_CPU_PROGRAM_MAP(mccpm_mem)
49    MDRV_CPU_IO_MAP(mccpm_io)   
49    MDRV_CPU_IO_MAP(mccpm_io)
5050
5151    MDRV_MACHINE_RESET(mccpm)
52   
52
5353    /* video hardware */
5454    MDRV_SCREEN_ADD("screen", RASTER)
5555    MDRV_SCREEN_REFRESH_RATE(50)
r8990r8991
7373/* Driver */
7474
7575/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
76COMP( 1981, mccpm,  0,       0,       mccpm,    mccpm,     0,      "GRAF Elektronik Systeme GmbH",   "mc-CP/M-Computer",      GAME_NOT_WORKING | GAME_NO_SOUND)
76COMP( 1981, mccpm,  0,       0,       mccpm,   mccpm,    0,     "GRAF Elektronik Systeme GmbH",   "mc-CP/M-Computer",      GAME_NOT_WORKING | GAME_NO_SOUND)
7777
src/mess/drivers/systec.c
r8990r8991
11/***************************************************************************
22
3      Systec Z80
4       
5      More data :
6         http://www.hd64180-cpm.de/html/systecz80.html
3        Systec Z80
74
5        More data :
6            http://www.hd64180-cpm.de/html/systecz80.html
7
88        30/08/2010 Skeleton driver
99
10      Systec Platine 1
10        Systec Platine 1
1111
12      SYSTEC 155.1L
13      EPROM 2764 CP/M LOADER 155 / 9600 Baud
14      Z8400APS CPU
15      Z8420APS PIO
16      Z8430APS CTC
17      Z8470APS DART
12        SYSTEC 155.1L
13        EPROM 2764 CP/M LOADER 155 / 9600 Baud
14        Z8400APS CPU
15        Z8420APS PIO
16        Z8430APS CTC
17        Z8470APS DART
1818
19      Systec Platine 2
19        Systec Platine 2
2020
21      SYSTEC 100.3B
22      MB8877A FDC Controller
23      FDC9229BT SMC 8608
24      Z8410APS DMA
25      Z8420APS PIO
21        SYSTEC 100.3B
22        MB8877A FDC Controller
23        FDC9229BT SMC 8608
24        Z8410APS DMA
25        Z8420APS PIO
2626
27      MB8877A Compatible FD1793     
27        MB8877A Compatible FD1793
2828****************************************************************************/
2929
3030#include "emu.h"
r8990r8991
8989
9090/* Driver */
9191
92/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
93COMP( 19??, systec,  0,       0,    systec,    systec,     0,       "Systec",   "Systec Z80",      GAME_NOT_WORKING | GAME_NO_SOUND)
92/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
93COMP( 19??, systec,  0,       0,   systec,    systec,     0,      "Systec",   "Systec Z80",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/psx.c
r8990r8991
433433      return IMAGE_INIT_FAIL;
434434   }
435435   exe_size = quickload_size;
436   space->set_direct_update_handler(direct_update_delegate_create_static(psx_setopbase, *image.device().machine));         
436   space->set_direct_update_handler(direct_update_delegate_create_static(psx_setopbase, *image.device().machine));
437437
438438   return IMAGE_INIT_PASS;
439439}
src/mess/drivers/samcoupe.c
r8990r8991
564564
565565   MDRV_MACHINE_START(samcoupe)
566566   MDRV_MACHINE_RESET(samcoupe)
567   
567
568568    /* video hardware */
569569   MDRV_SCREEN_ADD("screen", RASTER)
570570   MDRV_SCREEN_RAW_PARAMS(SAMCOUPE_XTAL_X1/2, SAM_TOTAL_WIDTH, 0, SAM_BORDER_LEFT + SAM_SCREEN_WIDTH + SAM_BORDER_RIGHT, SAM_TOTAL_HEIGHT, 0, SAM_BORDER_TOP + SAM_SCREEN_HEIGHT + SAM_BORDER_BOTTOM)
src/mess/drivers/tutor.c
r8990r8991
269269{
270270   UINT32 size;
271271   UINT8 *ptr = memory_region(image.device().machine, "maincpu");
272   
272
273273   if (image.software_entry() == NULL)
274274   {
275275      size = image.length();
r8990r8991
281281      size = image.get_software_region_length("rom");
282282      memcpy(ptr + cartridge_base, image.get_software_region("rom"), size);
283283   }
284   
284
285285   return IMAGE_INIT_PASS;
286286}
287287
src/mess/drivers/atm.c
r8990r8991
1515   running_device *beta = machine->device(BETA_DISK_TAG);
1616   UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE);
1717   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
18   
18
1919   if (beta->started() && betadisk_is_active(beta))
2020   {
2121      if (pc >= 0x4000)
r8990r8991
114114   }
115115
116116   space->set_direct_update_handler(direct_update_delegate_create_static(atm_direct, *machine));
117   
117
118118   memset(messram,0,128*1024);
119119
120120   /* Bank 5 is always in 0x4000 - 0x7fff */
src/mess/drivers/casloopy.c
r8990r8991
11/*****************************************************************************
22 
3   Casio Loopy (c) 1995 Casio
3    Casio Loopy (c) 1995 Casio
44 
5   skeleton driver
5    skeleton driver
66 
7   Note:
8   - just a placeholder for any HW discovery, until we decap/trojan the BIOS,
9     the idea is to understand the HW enough to extract the SH-1 internal BIOS
10     data via a trojan;
7    Note:
8    - just a placeholder for any HW discovery, until we decap/trojan the BIOS,
9      the idea is to understand the HW enough to extract the SH-1 internal BIOS
10      data via a trojan;
1111 
1212******************************************************************************/
1313 
src/mess/drivers/tandy2k.c
r8990r8991
200200
201201//static READ8_HANDLER( keyboard_x0_r )
202202//{
203//   /*
203//  /*
204204//
205205//        bit     description
206206//
r8990r8991
215215//
216216//    */
217217//
218//   tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
218//  tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
219219//
220//   UINT8 data = 0xff;
220//  UINT8 data = 0xff;
221221//
222//   if (!BIT(state->keylatch,  0)) data &= input_port_read(space->machine,  "Y0");
223//   if (!BIT(state->keylatch,  1)) data &= input_port_read(space->machine,  "Y1");
224//   if (!BIT(state->keylatch,  2)) data &= input_port_read(space->machine,  "Y2");
225//   if (!BIT(state->keylatch,  3)) data &= input_port_read(space->machine,  "Y3");
226//   if (!BIT(state->keylatch,  4)) data &= input_port_read(space->machine,  "Y4");
227//   if (!BIT(state->keylatch,  5)) data &= input_port_read(space->machine,  "Y5");
228//   if (!BIT(state->keylatch,  6)) data &= input_port_read(space->machine,  "Y6");
229//   if (!BIT(state->keylatch,  7)) data &= input_port_read(space->machine,  "Y7");
230//   if (!BIT(state->keylatch,  8)) data &= input_port_read(space->machine,  "Y8");
231//   if (!BIT(state->keylatch,  9)) data &= input_port_read(space->machine,  "Y9");
232//   if (!BIT(state->keylatch, 10)) data &= input_port_read(space->machine, "Y10");
233//   if (!BIT(state->keylatch, 11)) data &= input_port_read(space->machine, "Y11");
222//  if (!BIT(state->keylatch,  0)) data &= input_port_read(space->machine,  "Y0");
223//  if (!BIT(state->keylatch,  1)) data &= input_port_read(space->machine,  "Y1");
224//  if (!BIT(state->keylatch,  2)) data &= input_port_read(space->machine,  "Y2");
225//  if (!BIT(state->keylatch,  3)) data &= input_port_read(space->machine,  "Y3");
226//  if (!BIT(state->keylatch,  4)) data &= input_port_read(space->machine,  "Y4");
227//  if (!BIT(state->keylatch,  5)) data &= input_port_read(space->machine,  "Y5");
228//  if (!BIT(state->keylatch,  6)) data &= input_port_read(space->machine,  "Y6");
229//  if (!BIT(state->keylatch,  7)) data &= input_port_read(space->machine,  "Y7");
230//  if (!BIT(state->keylatch,  8)) data &= input_port_read(space->machine,  "Y8");
231//  if (!BIT(state->keylatch,  9)) data &= input_port_read(space->machine,  "Y9");
232//  if (!BIT(state->keylatch, 10)) data &= input_port_read(space->machine, "Y10");
233//  if (!BIT(state->keylatch, 11)) data &= input_port_read(space->machine, "Y11");
234234//
235//   return ~data;
235//  return ~data;
236236//}
237237//
238238//static WRITE8_HANDLER( keyboard_y0_w )
239239//{
240//   /*
240//  /*
241241//
242242//        bit     description
243243//
r8990r8991
252252//
253253//    */
254254//
255//   tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
255//  tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
256256//
257//   /* keyboard row select */
258//   state->keylatch = (state->keylatch & 0xff00) | data;
257//  /* keyboard row select */
258//  state->keylatch = (state->keylatch & 0xff00) | data;
259259//}
260260//
261261//static WRITE8_HANDLER( keyboard_y8_w )
262262//{
263//   /*
263//  /*
264264//
265265//        bit     description
266266//
r8990r8991
275275//
276276//    */
277277//
278//   tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
278//  tandy2k_state *state = space->machine->driver_data<tandy2k_state>();
279279//
280//   /* keyboard row select */
281//   state->keylatch = ((data & 0x0f) << 8) | (state->keylatch & 0xff);
280//  /* keyboard row select */
281//  state->keylatch = ((data & 0x0f) << 8) | (state->keylatch & 0xff);
282282//}
283283
284284/* Memory Maps */
r8990r8991
320320ADDRESS_MAP_END
321321
322322//static ADDRESS_MAP_START( keyboard_io, ADDRESS_SPACE_IO, 8 )
323//   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_y0_w)
324//   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_y8_w)
325//   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(keyboard_x0_r)
323//  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_y0_w)
324//  AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_y8_w)
325//  AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(keyboard_x0_r)
326326//ADDRESS_MAP_END
327327
328328/* Input Ports */
src/mess/drivers/k8915.c
r8990r8991
33        Robotron K8915
44
55        30/08/2010 Skeleton driver
6     
6
77****************************************************************************/
88
99#include "emu.h"
r8990r8991
7171
7272/* Driver */
7373
74/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
75COMP( 1982, k8915,  0,       0,    k8915,    k8915,     0,       "Robotron",   "K8915",      GAME_NOT_WORKING | GAME_NO_SOUND)
74/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
75COMP( 1982, k8915,  0,       0,    k8915,   k8915,    0,      "Robotron",   "K8915",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/c10.c
r8990r8991
33        Cromemco C-10 Personal Computer
44
55        30/08/2010 Skeleton driver
6     
6
77****************************************************************************/
88
99#include "emu.h"
r8990r8991
9090   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
9191   ROM_LOAD( "c10_cros.bin", 0x0000, 0x4000, CRC(2ccf5983) SHA1(52f7c497f5284bf5df9eb0d6e9142bb1869d8c24))
9292   ROM_REGION( 0x2000, "chargen", 0 )
93   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))   
93   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
9494ROM_END
9595
9696/* Driver */
9797
98/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
99COMP( 1982, c10,  0,       0,    c10,    c10,     0,       "Cromemco",   "C-10",      GAME_NOT_WORKING | GAME_NO_SOUND)
98/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
99COMP( 1982, c10,  0,       0,   c10,   c10,    0,      "Cromemco",   "C-10",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/jr100.c
r8990r8991
238238   DEVCB_NULL,                                 /* in_a_func */
239239   DEVCB_HANDLER(jr100_via_read_b),               /* in_b_func */
240240   DEVCB_NULL,                                /* in_ca1_func */
241   DEVCB_NULL,                                 /* in_cb1_func */
242   DEVCB_NULL,                                 /* in_ca2_func */
243   DEVCB_NULL,                                 /* in_cb2_func */
241   DEVCB_NULL,                                /* in_cb1_func */
242   DEVCB_NULL,                                /* in_ca2_func */
243   DEVCB_NULL,                                /* in_cb2_func */
244244   DEVCB_HANDLER(jr100_via_write_a),               /* out_a_func */
245245   DEVCB_HANDLER(jr100_via_write_b),               /* out_b_func */
246   DEVCB_NULL,                                 /* out_ca1_func */
246   DEVCB_NULL,                                /* out_ca1_func */
247247   DEVCB_NULL,                                 /* out_cb1_func */
248   DEVCB_NULL,                                 /* out_ca2_func */
249   DEVCB_LINE(jr100_via_write_cb2),                  /* out_cb2_func */
250   DEVCB_NULL                                  /* irq_func */
248   DEVCB_NULL,                                /* out_ca2_func */
249   DEVCB_LINE(jr100_via_write_cb2),                /* out_cb2_func */
250   DEVCB_NULL                                /* irq_func */
251251};
252252static const cassette_config jr100_cassette_config =
253253{
r8990r8991
307307   pos += len; // skip name
308308   UINT32 start_address = readByLittleEndian(buf,pos); pos+= 4;
309309   UINT32 code_length   = readByLittleEndian(buf,pos); pos+= 4;
310   UINT32 flag        = readByLittleEndian(buf,pos); pos+= 4;
310   UINT32 flag        = readByLittleEndian(buf,pos); pos+= 4;
311311
312312   UINT32 end_address = start_address + code_length - 1;
313313   // copy code
r8990r8991
380380
381381/* Driver */
382382
383/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
384//COMP( 1981, jr100,  0,       0,    jr100,    jr100,     0,       "National",   "JR-100",      GAME_NOT_WORKING | GAME_NO_SOUND)
385COMP( 1981, jr100u,  0,       0,    jr100,    jr100,     0,       "Panasonic",   "JR-100U",      GAME_NOT_WORKING | GAME_NO_SOUND)
383/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
384//COMP( 1981, jr100,  0,       0,   jr100,  jr100,   0,       "National",   "JR-100",       GAME_NOT_WORKING | GAME_NO_SOUND)
385COMP( 1981, jr100u,  0,       0,   jr100,   jr100,    0,      "Panasonic",   "JR-100U",      GAME_NOT_WORKING | GAME_NO_SOUND)
386386
src/mess/drivers/czk80.c
r8990r8991
33        CZK-80
44
55        30/08/2010 Skeleton driver
6     
7      On main board there are Z80A CPU, Z80A PIO, Z80A DART and Z80A CTC
8         there is 8K ROM and XTAL 16MHz
9      FDC board contains Z80A DMA and NEC 765A (XTAL on it is 8MHZ)
10      Mega board contains 74LS612 and memory chips
116
7        On main board there are Z80A CPU, Z80A PIO, Z80A DART and Z80A CTC
8            there is 8K ROM and XTAL 16MHz
9        FDC board contains Z80A DMA and NEC 765A (XTAL on it is 8MHZ)
10        Mega board contains 74LS612 and memory chips
11
1212****************************************************************************/
1313
1414#include "emu.h"
r8990r8991
7878
7979/* Driver */
8080
81/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
82COMP( 198?, czk80,  0,       0,    czk80,    czk80,     0,       "<unknown>",   "CZK-80",      GAME_NOT_WORKING | GAME_NO_SOUND)
81/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
82COMP( 198?, czk80,  0,       0,    czk80,   czk80,    0,      "<unknown>",   "CZK-80",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/ami1200.c
r8990r8991
443443   MDRV_CPU_ADD("maincpu", M68EC020, AMIGA_68EC020_NTSC_CLOCK) /* 14.3 Mhz */
444444   MDRV_CPU_PROGRAM_MAP(a1200_map)
445445
446//   MDRV_CPU_ADD("keyboard_mpu", MC68HC05)
446//  MDRV_CPU_ADD("keyboard_mpu", MC68HC05)
447447
448448   MDRV_MACHINE_RESET(amiga)
449449
src/mess/drivers/apple2gs.c
r8990r8991
303303
304304ROM_START(apple2gsr1)
305305   ROM_REGION(0xc00,"keyboard",0)
306   ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) )
306   ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) )
307307
308308   ROM_REGION(0x1000,"gfx1",0)
309309   ROM_LOAD ( "apple2gs.chr", 0x0000, 0x1000, CRC(91e53cd8) SHA1(34e2443e2ef960a36c047a09ed5a93f471797f89)) /* need label/part number */
r8990r8991
314314
315315ROM_START(apple2gsr0)
316316   ROM_REGION(0xc00,"keyboard",0)
317   ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) )
317   ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) )
318318
319319   ROM_REGION(0x1000,"gfx1",0)
320320   ROM_LOAD ( "apple2gs.chr", 0x0000, 0x1000, CRC(91e53cd8) SHA1(34e2443e2ef960a36c047a09ed5a93f471797f89))
src/mess/drivers/trs80m2.c
r8990r8991
322322
323323//static READ8_HANDLER( keyboard_busy_r )
324324//{
325//   trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
325//  trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
326326//
327//   return state->kbirq;
327//  return state->kbirq;
328328//}
329329//
330330//static READ8_HANDLER( keyboard_data_r )
331331//{
332//   trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
332//  trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
333333//
334//   static const char *const KEY_ROW[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9", "ROW10", "ROW11" };
334//  static const char *const KEY_ROW[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9", "ROW10", "ROW11" };
335335//
336//   return input_port_read(space->machine, KEY_ROW[state->key_latch]);
336//  return input_port_read(space->machine, KEY_ROW[state->key_latch]);
337337//}
338338//
339339//static WRITE8_HANDLER( keyboard_ctrl_w )
340340//{
341//   /*
341//  /*
342342//
343343//        bit     description
344344//
r8990r8991
353353//
354354//    */
355355//
356//   trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
356//  trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
357357//
358//   int kbdata = BIT(data, 0);
359//   int kbclk = BIT(data, 1);
358//  int kbdata = BIT(data, 0);
359//  int kbclk = BIT(data, 1);
360360//
361//   if (state->key_bit == 8)
362//   {
363//      if (!state->kbdata && kbdata)
364//      {
365//         /* trigger keyboard interrupt */
366//         state->kbirq = 0;
367//         z80ctc_trg3_w(state->z80ctc, state->kbirq);
368//      }
369//   }
370//   else
371//   {
372//      if (!state->kbclk && kbclk)
373//      {
374//         /* shift in keyboard data bit */
375//         state->key_data <<= 1;
376//         state->key_data |= kbdata;
377//         state->key_bit++;
378//      }
379//   }
361//  if (state->key_bit == 8)
362//  {
363//      if (!state->kbdata && kbdata)
364//      {
365//          /* trigger keyboard interrupt */
366//          state->kbirq = 0;
367//          z80ctc_trg3_w(state->z80ctc, state->kbirq);
368//      }
369//  }
370//  else
371//  {
372//      if (!state->kbclk && kbclk)
373//      {
374//          /* shift in keyboard data bit */
375//          state->key_data <<= 1;
376//          state->key_data |= kbdata;
377//          state->key_bit++;
378//      }
379//  }
380380//
381//   state->kbdata = kbdata;
382//   state->kbclk = kbclk;
381//  state->kbdata = kbdata;
382//  state->kbclk = kbclk;
383383//}
384384//
385385//static WRITE8_HANDLER( keyboard_latch_w )
386386//{
387//   /*
387//  /*
388388//
389389//        bit     description
390390//
r8990r8991
399399//
400400//    */
401401//
402//   trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
402//  trs80m2_state *state = space->machine->driver_data<trs80m2_state>();
403403//
404//   state->key_latch = BITSWAP8(data, 7, 6, 5, 4, 0, 1, 2, 3) & 0x0f;
404//  state->key_latch = BITSWAP8(data, 7, 6, 5, 4, 0, 1, 2, 3) & 0x0f;
405405//}
406406
407407/* Memory Maps */
r8990r8991
427427ADDRESS_MAP_END
428428
429429//static ADDRESS_MAP_START( trs80m2_keyboard_io, ADDRESS_SPACE_IO, 8 )
430//   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(keyboard_busy_r)
431//   AM_RANGE(MCS48_PORT_P0, MCS48_PORT_P0) AM_READ(keyboard_data_r)
432//   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_ctrl_w)
433//   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_latch_w)
430//  AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(keyboard_busy_r)
431//  AM_RANGE(MCS48_PORT_P0, MCS48_PORT_P0) AM_READ(keyboard_data_r)
432//  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_ctrl_w)
433//  AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_latch_w)
434434//ADDRESS_MAP_END
435435
436436//static ADDRESS_MAP_START( m68000_mem, ADDRESS_SPACE_PROGRAM, 16 )
src/mess/drivers/atari.c
r8990r8991
849849static void xegs_mmu(running_machine *machine, UINT8 new_mmu)
850850{
851851   UINT8 *base2, *base3, *base4;
852   
852
853853   /* check if memory C000-FFFF changed */
854854   if( new_mmu & 0x01 )
855855   {
r8990r8991
871871   }
872872   memory_set_bankptr(machine, "bank3", base3);
873873   memory_set_bankptr(machine, "bank4", base4);
874   
875   
874
875
876876   /* check if self-test ROM changed */
877877   if( new_mmu & 0x80 )
878878   {
r8990r8991
12391239
12401240   /* Software lists */
12411241   MDRV_SOFTWARE_LIST_ADD("cart_list","a5200")
1242   
1242
12431243   /* internal ram */
12441244   MDRV_RAM_MODIFY("messram")
12451245   MDRV_RAM_DEFAULT_SIZE("16K")
src/mess/drivers/mac.c
r8990r8991
9191      case 0x800:   // VERSION
9292         // LC/LCII return 0xe8 (V8 ASIC ASC emulation)
9393         if ((mac->mac_model == MODEL_MAC_LC) || (mac->mac_model == MODEL_MAC_LC_II))
94               {
94             {
9595            return 0xe8;
9696         }
9797
r8990r8991
105105
106106      case 0x804:
107107         if ((mac->mac_model == MODEL_MAC_LC) || (mac->mac_model == MODEL_MAC_LC_II))
108               {
108             {
109109            return 3;
110110         }
111111         break;
src/mess/drivers/sord.c
r8990r8991
535535{
536536   UINT32 size;
537537   UINT8 *ptr = memory_region(image.device().machine, "maincpu");
538   
538
539539   if (image.software_entry() == NULL)
540540   {
541541      size = image.length();
r8990r8991
547547      size = image.get_software_region_length("rom");
548548      memcpy(ptr + 0x2000, image.get_software_region("rom"), size);
549549   }
550   
550
551551   return IMAGE_INIT_PASS;
552552}
553553
r8990r8991
658658   ROM_SYSTEM_BIOS(0, "int", "International")
659659   ROMX_LOAD("sordint.rom", 0x0000, 0x2000, CRC(78848d39) SHA1(ac042c4ae8272ad6abe09ae83492ef9a0026d0b2),ROM_BIOS(1))
660660   ROM_SYSTEM_BIOS(1, "jap", "Japanese")
661    ROMX_LOAD("sordjap.rom", 0x0000, 0x2000, CRC(92cf9353) SHA1(b0a4b3658fde68cb1f344dfb095bac16a78e9b3e),ROM_BIOS(2))   
661    ROMX_LOAD("sordjap.rom", 0x0000, 0x2000, CRC(92cf9353) SHA1(b0a4b3658fde68cb1f344dfb095bac16a78e9b3e),ROM_BIOS(2))
662662ROM_END
663663
664664
src/mess/drivers/pentagon.c
r8990r8991
1515   running_device *beta = machine->device(BETA_DISK_TAG);
1616   UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE);
1717   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
18   
18
1919   if (beta->started() && betadisk_is_active(beta))
2020   {
2121      if (pc >= 0x4000)
r8990r8991
3838      if (state->ROMSelection == 3) {
3939         if (beta->started()) {
4040            direct.explicit_configure(0x0000, 0x3fff, 0x3fff, memory_region(machine, "beta:beta"));
41            memory_set_bankptr(machine, "bank1", memory_region(machine, "beta:beta"));           
41            memory_set_bankptr(machine, "bank1", memory_region(machine, "beta:beta"));
4242         }
4343      } else {
44         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, memory_region(machine, "maincpu") + 0x010000 + (state->ROMSelection<<14));         
45         memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + 0x010000 + (state->ROMSelection<<14));         
46      }     
44         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, memory_region(machine, "maincpu") + 0x010000 + (state->ROMSelection<<14));
45         memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + 0x010000 + (state->ROMSelection<<14));
46      }
4747      return ~0;
4848   }
4949   return address;
src/mess/drivers/prestige.c
r8990r8991
4141*/
4242
4343/*
44   
45   Undumped cartridges:
46 
47   80-1410   Super Science
48   80-1533   Famous Things & Places
49   80-0989   Bible Knowledge
50   80-1001   Fantasy Trivia
51   80-1002   General Knowledge II
52   80-1003   Sports History
53   80-2314   Familiar Faces
54   80-2315   Historical Happenings
55   80-2333   Arts, Entertainment & More
56   80-2334   Customs & Cultures
57   80-1531   32K RAM Memory Expansion Cartridge
58   80-12051  Space Scholar
59   80-12053  Frenzy of Facts
60   80-12052  Spreadsheet Success
6144
45    Undumped cartridges:
46
47    80-1410   Super Science
48    80-1533   Famous Things & Places
49    80-0989   Bible Knowledge
50    80-1001   Fantasy Trivia
51    80-1002   General Knowledge II
52    80-1003   Sports History
53    80-2314   Familiar Faces
54    80-2315   Historical Happenings
55    80-2333   Arts, Entertainment & More
56    80-2334   Customs & Cultures
57    80-1531   32K RAM Memory Expansion Cartridge
58    80-12051  Space Scholar
59    80-12053  Frenzy of Facts
60    80-12052  Spreadsheet Success
61
6262*/
6363
6464/*
6565
66   TODO:
66    TODO:
6767
68   - identify unknown chips
69   - boot animation won't play
70   - keyboard
71   - mouse
72   - sound
73   - cartridges
68    - identify unknown chips
69    - boot animation won't play
70    - keyboard
71    - mouse
72    - sound
73    - cartridges
7474
7575*/
7676
src/mess/drivers/nes.c
r8990r8991
6767   PORT_CATEGORY_ITEM(  0x0010, "Gamepad",         2 )
6868   PORT_CATEGORY_ITEM(  0x0030, "Zapper",         6 )
6969   PORT_CATEGORY_ITEM(  0x0040, "Arkanoid paddle",   7 )
70//   PORT_CATEGORY_ITEM(  0x0050, "Family Trainer",  11 )
70//  PORT_CATEGORY_ITEM(  0x0050, "Family Trainer",  11 )
7171   PORT_CATEGORY_CLASS( 0x0f00, 0x0000, "P3 Controller")
7272   PORT_CATEGORY_ITEM(  0x0000, "Unconnected",      0 )
7373   PORT_CATEGORY_ITEM(  0x0100, "Gamepad",         3 )
r8990r8991
410410   PORT_CATEGORY_ITEM(  0x0010, "Gamepad",         2 )
411411   PORT_CATEGORY_ITEM(  0x0030, "Zapper",         6 )
412412   PORT_CATEGORY_ITEM(  0x0040, "Arkanoid paddle",   7 )
413//   PORT_CATEGORY_ITEM(  0x0050, "Family Trainer",  11 )
413//  PORT_CATEGORY_ITEM(  0x0050, "Family Trainer",  11 )
414414   PORT_CATEGORY_CLASS( 0x0f00, 0x0000, "P3 Controller")
415415   PORT_CATEGORY_ITEM(  0x0000, "Unconnected",      0 )
416416   PORT_CATEGORY_ITEM(  0x0100, "Gamepad",         3 )
src/mess/drivers/cc10.c
r8990r8991
11/***************************************************************************
22
3      Fidelity Chess Challenger 10
4       
5      More data :
6         http://home.germany.net/nils.eilers/cc10.htm
3        Fidelity Chess Challenger 10
74
5        More data :
6            http://home.germany.net/nils.eilers/cc10.htm
7
88        30/08/2010 Skeleton driver
9     
9
1010****************************************************************************/
1111
1212#include "emu.h"
r8990r8991
7171
7272/* Driver */
7373
74/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
75COMP( 1978, cc10,  0,       0,    cc10,    cc10,     0,       "Fidelity",   "Chess Challenger 10",      GAME_NOT_WORKING | GAME_NO_SOUND)
74/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
75COMP( 1978, cc10,  0,       0,   cc10,   cc10,    0,      "Fidelity",   "Chess Challenger 10",      GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/mz700.c
r8990r8991
409409ROM_START( mz700j )
410410   ROM_REGION( 0x1000, "monitor", 0 )
411411   ROM_LOAD( "1z-009b.rom", 0x0000, 0x1000, CRC(ab1fbe6f) SHA1(7b10d7965c541393e33a265bcf71a00314d2db7a))
412   
412
413413   ROM_REGION( 0x1000, "cgrom", 0 )
414   //ROM_LOAD( "mz700fon.jp", 0x0000, 0x1000, CRC(697ec121) SHA1(5eb1d42d273b1fd2cab120486279ab8ff6c85dc7))   
414   //ROM_LOAD( "mz700fon.jp", 0x0000, 0x1000, CRC(697ec121) SHA1(5eb1d42d273b1fd2cab120486279ab8ff6c85dc7))
415415   ROM_LOAD( "mz700fon.jpn", 0x0000, 0x1000, CRC(425eedf5) SHA1(bd2cc750f2d2f63e50a59786668509e81a276e32) )
416416ROM_END
417417
r8990r8991
421421ROM_END
422422
423423ROM_START( mz1500 )
424   ROM_REGION( 0x4000, "monitor", 0 )   
424   ROM_REGION( 0x4000, "monitor", 0 )
425425   ROM_LOAD( "9z-502m.rom",  0x0000, 0x2800, CRC(643db428) SHA1(c2ad8af2ef00db32afde54d5741b07de5d4da16a))
426426   ROM_REGION( 0x1000, "cgrom", 0 )
427   //ROM_LOAD( "mz700fon.jp", 0x0000, 0x1000, CRC(697ec121) SHA1(5eb1d42d273b1fd2cab120486279ab8ff6c85dc7))   
427   //ROM_LOAD( "mz700fon.jp", 0x0000, 0x1000, CRC(697ec121) SHA1(5eb1d42d273b1fd2cab120486279ab8ff6c85dc7))
428428   ROM_LOAD( "mz700fon.jpn", 0x0000, 0x1000, CRC(425eedf5) SHA1(bd2cc750f2d2f63e50a59786668509e81a276e32) )
429429ROM_END
430430
src/mess/drivers/vectrex.c
r8990r8991
130130   MDRV_CARTSLOT_NOT_MANDATORY
131131   MDRV_CARTSLOT_LOAD(vectrex_cart)
132132   MDRV_CARTSLOT_INTERFACE("vectrex_cart")
133   
133
134134   /* software lists */
135135   MDRV_SOFTWARE_LIST_ADD("cart_list","vectrex")
136136MACHINE_CONFIG_END
src/mess/drivers/pasopia.c
r8990r8991
11/**************************************************************************************************
22
3   Toshiba Pasopia 7 (c) 1983 Toshiba
3    Toshiba Pasopia 7 (c) 1983 Toshiba
44
55    preliminary driver by Angelo Salese
66
7   TODO:
8   - floppy support (but floppy images are unobtainable at current time)
9   - Z80PIO keyboard irq doesn't work at all, kludged keyboard inputs to work for now
10   - advanced BASIC commands (width 80, circle, line ...) makes the emulation to go to la-la-land
11   - some text garbage pops up in place, first example is when you type "10 for a=0 to n"
7    TODO:
8    - floppy support (but floppy images are unobtainable at current time)
9    - Z80PIO keyboard irq doesn't work at all, kludged keyboard inputs to work for now
10    - advanced BASIC commands (width 80, circle, line ...) makes the emulation to go to la-la-land
11    - some text garbage pops up in place, first example is when you type "10 for a=0 to n"
1212
1313***************************************************************************************************/
1414
r8990r8991
9797   keyb_shift_press(KEYCODE_0, '=');
9898   keyb_shift_press(KEYCODE_1, '!');
9999   keyb_shift_press(KEYCODE_2, '"');
100   keyb_shift_press(KEYCODE_3, '£');
100   keyb_shift_press(KEYCODE_3, '?');
101101   keyb_shift_press(KEYCODE_4, '$');
102102   keyb_shift_press(KEYCODE_5, '%');
103103   keyb_shift_press(KEYCODE_6, '&');
r8990r8991
197197   static UINT8 res;
198198
199199   //if(!vram_sel)
200   //   return 0xff;
200   //  return 0xff;
201201
202202   if(pal_sel && (plane_reg & 0x70) == 0x00)
203203      return p7_pal[offset & 0xf];
r8990r8991
270270
271271   // bank4 is always RAM
272272
273//   printf("%02x\n",data);
273//  printf("%02x\n",data);
274274}
275275
276276#if 0
r8990r8991
289289   UINT8 *pac2_ram2 = memory_region(space->machine, "rampac2");
290290
291291   /*
292   select register:
293   4 = ram1;
294   3 = ram2;
295   2 = kanji ROM;
296   1 = joy;
297   anything else is nop
298   */
292    select register:
293    4 = ram1;
294    3 = ram2;
295    2 = kanji ROM;
296    1 = joy;
297    anything else is nop
298    */
299299
300300
301301   switch(offset)
r8990r8991
387387
388388   io_port = offset & 0xff; //trim down to 8-bit bus
389389
390   if(io_port >= 0x08 && io_port <= 0x0b)       { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); }
390   if(io_port >= 0x08 && io_port <= 0x0b)      { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); }
391391   else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3); }
392//   else if(io_port == 0x10 || io_port == 0x11) { M6845 read }
392//  else if(io_port == 0x10 || io_port == 0x11) { M6845 read }
393393   else if(io_port >= 0x18 && io_port <= 0x1b) { return pac2_r(space, io_port-0x18);  }
394394   else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(space->machine->device("ppi8255_2"), (io_port-0x20) & 3); }
395395   else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(space->machine->device("ctc"), io_port-0x28);  }
396396   else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_cd_ba_r(space->machine->device("z80pio_0"), (io_port-0x30) & 3); }
397//   else if(io_port == 0x3a)                  { SN1 }
398//   else if(io_port == 0x3b)                  { SN2 }
399//   else if(io_port == 0x3c)                  { bankswitch }
400//   else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc }
397//  else if(io_port == 0x3a)                    { SN1 }
398//  else if(io_port == 0x3b)                    { SN2 }
399//  else if(io_port == 0x3c)                    { bankswitch }
400//  else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc }
401401   else
402402   {
403403      logerror("(PC=%06x) Read i/o address %02x\n",cpu_get_pc(space->cpu),io_port);
r8990r8991
419419
420420   io_port = offset & 0xff; //trim down to 8-bit bus
421421
422   if(io_port >= 0x08 && io_port <= 0x0b)       { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); }
422   if(io_port >= 0x08 && io_port <= 0x0b)      { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); }
423423   else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3, data); }
424424   else if(io_port >= 0x10 && io_port <= 0x11) { pasopia7_6845_w(space, io_port-0x10, data); }
425425   else if(io_port >= 0x18 && io_port <= 0x1b) { pac2_w(space, io_port-0x18, data);  }
426426   else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(space->machine->device("ppi8255_2"), (io_port-0x20) & 3, data); }
427427   else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(space->machine->device("ctc"), io_port-0x28,data);  }
428428   else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_cd_ba_w(space->machine->device("z80pio_0"), (io_port-0x30) & 3, data); }
429   else if(io_port == 0x3a)                  { sn76496_w(space->machine->device("sn1"), 0, data); }
430   else if(io_port == 0x3b)                  { sn76496_w(space->machine->device("sn2"), 0, data); }
431   else if(io_port == 0x3c)                  { pasopia7_memory_ctrl_w(space,0, data); }
432//   else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc }
429   else if(io_port == 0x3a)               { sn76496_w(space->machine->device("sn1"), 0, data); }
430   else if(io_port == 0x3b)               { sn76496_w(space->machine->device("sn2"), 0, data); }
431   else if(io_port == 0x3c)               { pasopia7_memory_ctrl_w(space,0, data); }
432//  else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc }
433433   else
434434   {
435435      logerror("(PC=%06x) Write i/o address %02x = %02x\n",cpu_get_pc(space->cpu),offset,data);
r8990r8991
561561static WRITE8_DEVICE_HANDLER( video_misc_w )
562562{
563563   /*
564      --x- ---- blinking
565      ---x ---- attribute wrap
566      ---- x--- pal disable
567      ---- xx-- palette selector (both bits enables this, odd hook-up)
568   */
569//   if(data & 2)
570//   {
571//      printf("VIDEO MISC %02x\n",data);
572//      debugger_break(device->machine);
573//   }
564        --x- ---- blinking
565        ---x ---- attribute wrap
566        ---- x--- pal disable
567        ---- xx-- palette selector (both bits enables this, odd hook-up)
568    */
569//  if(data & 2)
570//  {
571//      printf("VIDEO MISC %02x\n",data);
572//      debugger_break(device->machine);
573//  }
574574   cursor_blink = data & 0x20;
575575   attr_wrap = data & 0x10;
576//   pal_sel = data & 0x02;
576//  pal_sel = data & 0x02;
577577}
578578
579579static WRITE8_DEVICE_HANDLER( nmi_mask_w )
580580{
581581   /*
582   --x- ---- (related to the data rec)
583   ---x ---- data rec out
584   ---- --x- sound off
585   ---- ---x reset NMI (writes to port B = clears bits 1 & 2) (???)
586   */
587//   printf("SYSTEM MISC %02x\n",data);
582    --x- ---- (related to the data rec)
583    ---x ---- data rec out
584    ---- --x- sound off
585    ---- ---x reset NMI (writes to port B = clears bits 1 & 2) (???)
586    */
587//  printf("SYSTEM MISC %02x\n",data);
588588
589//   if(data & 1)
590//      i8255a_w(devtag_get_device(device->machine, "ppi8255_2"), 1, 0);
589//  if(data & 1)
590//      i8255a_w(devtag_get_device(device->machine, "ppi8255_2"), 1, 0);
591591
592592}
593593
r8990r8991
607607static WRITE8_DEVICE_HANDLER( nmi_reg_w )
608608{
609609   /*
610      x--- ---- NMI mask
611      -x-- ---- enable NMI regs (?)
612   */
610        x--- ---- NMI mask
611        -x-- ---- enable NMI regs (?)
612    */
613613   nmi_mask = data & 0x80;
614614   nmi_enable_reg = data & 0x40;
615615
r8990r8991
655655
656656   memory_set_bankptr(machine, "bank1", bios + 0x10000);
657657   memory_set_bankptr(machine, "bank2", bios + 0x10000);
658//   memory_set_bankptr(machine, "bank3", bios + 0x10000);
659//   memory_set_bankptr(machine, "bank4", bios + 0x10000);
658//  memory_set_bankptr(machine, "bank3", bios + 0x10000);
659//  memory_set_bankptr(machine, "bank4", bios + 0x10000);
660660}
661661
662662static PALETTE_INIT( pasopia7 )
r8990r8991
686686    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
687687    MDRV_CPU_PROGRAM_MAP(paso7_mem)
688688    MDRV_CPU_IO_MAP(paso7_io)
689//   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
689//  MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
690690   MDRV_CPU_CONFIG(p7_daisy)
691691
692692   MDRV_Z80CTC_ADD( "ctc", XTAL_4MHz, ctc_intf )
r8990r8991
738738   ROM_LOAD( "kanji.rom", 0x0000, 0x20000, CRC(6109e308) SHA1(5c21cf1f241ef1fa0b41009ea41e81771729785f))
739739
740740   ROM_REGION( 0x8000, "rampac1", ROMREGION_ERASEFF )
741//   ROM_LOAD( "rampac1.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
741//  ROM_LOAD( "rampac1.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
742742
743743   ROM_REGION( 0x8000, "rampac2", ROMREGION_ERASEFF )
744//   ROM_LOAD( "rampac2.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
744//  ROM_LOAD( "rampac2.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
745745ROM_END
746746
747747static DRIVER_INIT( paso7 )
r8990r8991
751751/* Driver */
752752
753753/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
754COMP( 1983, pasopia7,  0,       0,     paso7,   paso7,   paso7,   "Toshiba",   "PASOPIA 7", GAME_NOT_WORKING )
754COMP( 1983, pasopia7,  0,       0,    paso7,   paso7,   paso7,   "Toshiba",   "PASOPIA 7", GAME_NOT_WORKING )
src/mess/drivers/jr200.c
r8990r8991
22
33    JR-200 (c) 1982 National / Panasonic
44
5   preliminary driver by Roberto Zandonà and Angelo Salese
5    preliminary driver by Roberto Zandon? and Angelo Salese
66
77    http://www.armchairarcade.com/neo/node/1598
88
9   TODO:
10   - Timings are basically screwed, it takes too much to load the POST but
11     then the cursor blink is too fast
12   - keyboard MCU irq and data polling simulation should be inside a timer
13     callback
14   - MN1544 4-bit CPU core and ROM dump
9    TODO:
10    - Timings are basically screwed, it takes too much to load the POST but
11      then the cursor blink is too fast
12    - keyboard MCU irq and data polling simulation should be inside a timer
13      callback
14    - MN1544 4-bit CPU core and ROM dump
1515
1616****************************************************************************/
1717
r8990r8991
106106               if(attr & 0x80) //bitmap mode
107107               {
108108                  /*
109                     this mode draws 4 x 4 dot blocks, by combining lower 6 bits of tile and attribute vram
109                            this mode draws 4 x 4 dot blocks, by combining lower 6 bits of tile and attribute vram
110110
111                     tile def
112                     00xx x--- up-right
113                     00-- -xxx up-left
114                     attr def
115                     10xx x--- down-right
116                     10-- -xxx down-left
117                  */
111                            tile def
112                            00xx x--- up-right
113                            00-- -xxx up-left
114                            attr def
115                            10xx x--- down-right
116                            10-- -xxx down-left
117                        */
118118                  int step;
119119
120120                  step = ((xi & 4) ? 3 : 0);
r8990r8991
178178
179179static WRITE8_HANDLER( jr200_bios_char_w )
180180{
181//   static UINT8 *gfx = memory_region(space->machine, "gfx_ram");
181//  static UINT8 *gfx = memory_region(space->machine, "gfx_ram");
182182
183183   /* TODO: writing is presumably controlled by an I/O bit */
184//   gfx[offset] = data;
185//   gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
184//  gfx[offset] = data;
185//  gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
186186}
187187
188188/*
r8990r8991
258258}
259259
260260static READ8_HANDLER( mn1271_io_r )
261{   
261{
262262   UINT8 retVal = mn1271_ram[offset];
263   if((offset+0xc800) > 0xca00)
263   if((offset+0xc800) > 0xca00)
264264      retVal= 0xff;
265265
266266   switch(offset+0xc800)
r8990r8991
274274      case 0xc810: retVal= 0; break;
275275      case 0xc816: retVal= 0x4e; break;
276276      case 0xc81c: retVal= (mn1271_ram[0x1c] & 0xfe) | 1;  break;//bit 0 needs to be high otherwise system refuses to boot
277      case 0xc81d: retVal= (mn1271_ram[0x1d] & 0xed); break;     
277      case 0xc81d: retVal= (mn1271_ram[0x1d] & 0xed); break;
278278   }
279279   //logerror("mn1271_io_r [%04x] = %02x\n",offset+0xc800,retVal);
280280   return retVal;
r8990r8991
287287   {
288288      case 0xc805: break; //LPT printer port W
289289      case 0xc816: if (data!=0) {
290               timer_adjust_periodic(timer_d, attotime_zero, 0, attotime_mul(ATTOTIME_IN_HZ(XTAL_14_31818MHz), (mn1271_ram[0x17]*0x100 + mn1271_ram[0x18])));
290               timer_adjust_periodic(timer_d, attotime_zero, 0, attotime_mul(ATTOTIME_IN_HZ(XTAL_14_31818MHz), (mn1271_ram[0x17]*0x100 + mn1271_ram[0x18])));
291291            } else {
292               timer_adjust_periodic(timer_d, attotime_zero, 0,  attotime_zero);
292               timer_adjust_periodic(timer_d, attotime_zero, 0,  attotime_zero);
293293            }
294294            break;
295295      case 0xc819: jr200_beep_w(space,0,data); break;
r8990r8991
315315   AM_RANGE(0xc400, 0xc4ff) AM_READWRITE(jr200_pcg_2_r,jr200_pcg_2_w) //PCG area (2)
316316   AM_RANGE(0xc500, 0xc7ff) AM_RAM AM_BASE(&jr200_cram)
317317
318//   0xc800 - 0xcfff I / O area
318//  0xc800 - 0xcfff I / O area
319319   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(mn1271_io_r,mn1271_io_w) AM_BASE(&mn1271_ram)
320320
321321   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(jr200_bios_char_r,jr200_bios_char_w) //BIOS PCG RAM area
r8990r8991
325325
326326/* Input ports */
327327static INPUT_PORTS_START( jr200 )
328//   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
328//  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
329329
330330   PORT_START("ROW0")
331331   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HELP") PORT_CODE(KEYCODE_TILDE)
r8990r8991
452452static MACHINE_START(jr200)
453453{
454454   beep_set_frequency(machine->device("beeper"),0);
455   beep_set_state(machine->device("beeper"),0);   
455   beep_set_state(machine->device("beeper"),0);
456456   timer_d = timer_alloc(machine, timer_d_callback, NULL);
457457}
458458
r8990r8991
476476   MDRV_CPU_ADD("maincpu", M6802, XTAL_14_31818MHz / 4) /* MN1800A, ? Mhz assumption that it is same as JR-100*/
477477   MDRV_CPU_PROGRAM_MAP(jr200_mem)
478478
479//   MDRV_CPU_ADD("mn1544", MN1544, ?)
479//  MDRV_CPU_ADD("mn1544", MN1544, ?)
480480
481481   MDRV_MACHINE_START(jr200)
482482   MDRV_MACHINE_RESET(jr200)
src/mess/drivers/rx78.c
r8990r8991
11/************************************************************************************************************
22
3   Gundam RX-78 (c) 1983 Bandai
3    Gundam RX-78 (c) 1983 Bandai
44
5   preliminary driver by Angelo Salese
6   Monitor command list, and cassette interface added by Robbbert.
5    preliminary driver by Angelo Salese
6    Monitor command list, and cassette interface added by Robbbert.
77
8   TODO:
9   - implement printer
10   - caps lock doesn't seem quite right, I need to press it twice to have the desired effect;
8    TODO:
9    - implement printer
10    - caps lock doesn't seem quite right, I need to press it twice to have the desired effect;
1111
12   Notes:
13   - BS-BASIC v1.0 have a graphic bug with the RX-78 logo, it doesn't set the read bank so all of the color
14     info minus plane 1 is lost when the screen scrolls vertically. Almost certainly a btanb.
15   - To stop a cmt load, press STOP + SHIFT keys
12    Notes:
13    - BS-BASIC v1.0 have a graphic bug with the RX-78 logo, it doesn't set the read bank so all of the color
14      info minus plane 1 is lost when the screen scrolls vertically. Almost certainly a btanb.
15    - To stop a cmt load, press STOP + SHIFT keys
1616
1717==============================================================================================================
18   Summary of Monitor commands.
19   - The monitor is entered at bootup. The prompt is the * character. This is followed by a command
20     letter (upper case). Some commands require hex parameters. You must enter all 4 characters of
21     these. No spaces allowed except where shown.
22   - While in BASIC, you may enter the monitor by using the MON command. After you have finished,
23     you can return to BASIC by entering the command *J2005.
18    Summary of Monitor commands.
19    - The monitor is entered at bootup. The prompt is the * character. This is followed by a command
20      letter (upper case). Some commands require hex parameters. You must enter all 4 characters of
21      these. No spaces allowed except where shown.
22    - While in BASIC, you may enter the monitor by using the MON command. After you have finished,
23      you can return to BASIC by entering the command *J2005.
2424
25   - Tape commands:
26   *L Load a tape
27   *V Verify a tape
28   *S Save a block of memory to tape. You are asked for a filename (blank is allowed), the start address,
29      the end address, and the Jump address (where it should begin execution)
25    - Tape commands:
26    *L Load a tape
27    *V Verify a tape
28    *S Save a block of memory to tape. You are asked for a filename (blank is allowed), the start address,
29       the end address, and the Jump address (where it should begin execution)
3030
31   - Memory commands:
32   *Dnnnn nnnn Displays a hex dump in the address range entered
33   *Mnnnn      Allows you to examine and modify memory. Enter to skip to next, period (.) to quit.
34   *Jnnnn      Transfer execution (Jump) to a program in memory at the specified address
31    - Memory commands:
32    *Dnnnn nnnn Displays a hex dump in the address range entered
33    *Mnnnn      Allows you to examine and modify memory. Enter to skip to next, period (.) to quit.
34    *Jnnnn      Transfer execution (Jump) to a program in memory at the specified address
3535
36   - Other:
37   *R          This is a block transfer load from a mystery parallel device, using ports E0 and E1,
38               using handshaking similar to a centronics printer. The incoming file is loaded into
39               memory and it appears that the operator is not provided any information of what happened.
36    - Other:
37    *R          This is a block transfer load from a mystery parallel device, using ports E0 and E1,
38                using handshaking similar to a centronics printer. The incoming file is loaded into
39                memory and it appears that the operator is not provided any information of what happened.
4040
4141*************************************************************************************************************/
4242
r8990r8991
234234static ADDRESS_MAP_START( rx78_io , ADDRESS_SPACE_IO, 8)
235235   ADDRESS_MAP_UNMAP_HIGH
236236   ADDRESS_MAP_GLOBAL_MASK(0xff)
237//   AM_RANGE(0xe2, 0xe2) AM_READNOP AM_WRITENOP //printer
238//   AM_RANGE(0xe3, 0xe3) AM_WRITENOP //printer
237//  AM_RANGE(0xe2, 0xe2) AM_READNOP AM_WRITENOP //printer
238//  AM_RANGE(0xe3, 0xe3) AM_WRITENOP //printer
239239   AM_RANGE(0xf0, 0xf0) AM_READWRITE(rx78_f0_r,rx78_f0_w) //cmt
240240   AM_RANGE(0xf1, 0xf1) AM_WRITE(vram_read_bank_w)
241241   AM_RANGE(0xf2, 0xf2) AM_WRITE(vram_write_bank_w)
r8990r8991
495495/* Driver */
496496
497497/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
498COMP( 1983, rx78,     0,       0,       rx78,    rx78,     rx78,       "Bandai",   "Gundam RX-78",      GAME_NOT_WORKING)
498COMP( 1983, rx78,   0,       0,       rx78,   rx78,    rx78,       "Bandai",   "Gundam RX-78",      GAME_NOT_WORKING)
499499
src/mess/drivers/supracan.c
r8990r8991
19791979    /*
19801980    supracan_state *state = (supracan_state *)device->machine->driver_data<supracan_state>();
19811981
1982   if(state->irq_mask)
1982    if(state->irq_mask)
19831983    {
1984      cpu_set_input_line(device, 7, HOLD_LINE);
1984        cpu_set_input_line(device, 7, HOLD_LINE);
19851985    }
19861986    */
19871987}
src/mess/drivers/bebox.c
r8990r8991
179179static MACHINE_CONFIG_DERIVED( bebox2, bebox )
180180   MDRV_CPU_REPLACE("ppc1", PPC603E, 133000000)   /* 133 MHz */
181181   MDRV_CPU_PROGRAM_MAP(bebox_mem)
182   
182
183183   MDRV_CPU_REPLACE("ppc2", PPC603E, 133000000)   /* 133 MHz */
184184   MDRV_CPU_PROGRAM_MAP(bebox_slave_mem)
185185MACHINE_CONFIG_END
src/mess/drivers/elwro800.c
r8990r8991
4242   spectrum_state *state = machine->driver_data<spectrum_state>();
4343   if (state->ram_at_0000 && address == 0x66)
4444   {
45      direct.explicit_configure(0x66, 0x66, 0, &state->df_on_databus);         
45      direct.explicit_configure(0x66, 0x66, 0, &state->df_on_databus);
4646      return ~0;
4747   }
4848   return address;
src/mess/drivers/pv2000.c
r8990r8991
4040public:
4141   static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pv2000_state(machine)); }
4242
43   pv2000_state(running_machine &machine)
43   pv2000_state(running_machine &machine)
4444      : driver_data_t(machine) { last_state = 0; }
4545
4646   int      last_state;
r8990r8991
196196   AM_RANGE(0x40, 0x40) AM_READ(pv2000_keys_mod_r) AM_DEVWRITE("sn76489a", sn76496_w)
197197
198198   /* Cassette input. Gets hit a lot after a GLOAD command */
199//   AM_RANGE(0x60, 0x60)
199//  AM_RANGE(0x60, 0x60)
200200ADDRESS_MAP_END
201201
202202
r8990r8991
443443   MDRV_CARTSLOT_EXTENSION_LIST("rom,col,bin")
444444   MDRV_CARTSLOT_NOT_MANDATORY
445445   MDRV_CARTSLOT_LOAD(pv2000_cart)
446   MDRV_CARTSLOT_INTERFACE("pv2000_cart")   
447   
446   MDRV_CARTSLOT_INTERFACE("pv2000_cart")
447
448448   /* Software lists */
449   MDRV_SOFTWARE_LIST_ADD("cart_list","pv2000")   
449   MDRV_SOFTWARE_LIST_ADD("cart_list","pv2000")
450450MACHINE_CONFIG_END
451451
452452
src/mess/drivers/pyl601.c
r8990r8991
557557
558558static MACHINE_CONFIG_DERIVED( pyl601a, pyl601 )
559559   MDRV_CPU_MODIFY("maincpu")
560   MDRV_CPU_CLOCK( XTAL_2MHz)   
561   
560   MDRV_CPU_CLOCK( XTAL_2MHz)
561
562562   MDRV_GFXDECODE(pyl601a)
563563   MDRV_DEVICE_REMOVE("crtc")
564564   MDRV_MC6845_ADD("crtc", MC6845, XTAL_2MHz, pyl601a_crtc6845_interface)
src/mess/drivers/a310.c
r8990r8991
4141 *
4242 *****************************************************************************/
4343/*
44   DASM of code (bios 2 / RISC OS 2)
45   0x380d4e0: MEMC: control to 0x10c (page size 32 kbytes, DRAM ram refresh only during flyback)
46   0x380d4f0: VIDC: params (screen + sound frequency)
47   0x380d51c: IOC: sets control to 0xff, clear IRQA and FIQ masks, sets IRQB mask to 0x80 (keyboard receive full irq)
48   0x380d530: IOC: sets timer 0 to 0x4e20, go command
49      0x380e0a8: work RAM physical check, max size etc.
50   0x380e1f8: IOC: Disables DRAM ram refresh, sets timer 1 to 0x7ffe, go command, then it tests the latch of this timer, enables DRAM refresh
51      0x380d00c: Set up default logical space
52      0x380d16c: Set up case by case logical space
44    DASM of code (bios 2 / RISC OS 2)
45    0x380d4e0: MEMC: control to 0x10c (page size 32 kbytes, DRAM ram refresh only during flyback)
46    0x380d4f0: VIDC: params (screen + sound frequency)
47    0x380d51c: IOC: sets control to 0xff, clear IRQA and FIQ masks, sets IRQB mask to 0x80 (keyboard receive full irq)
48    0x380d530: IOC: sets timer 0 to 0x4e20, go command
49        0x380e0a8: work RAM physical check, max size etc.
50    0x380e1f8: IOC: Disables DRAM ram refresh, sets timer 1 to 0x7ffe, go command, then it tests the latch of this timer, enables DRAM refresh
51        0x380d00c: Set up default logical space
52        0x380d16c: Set up case by case logical space
5353
5454
5555*/
r8990r8991
117117
118118static ADDRESS_MAP_START( a310_mem, ADDRESS_SPACE_PROGRAM, 32 )
119119   AM_RANGE(0x00000000, 0x01ffffff) AM_READWRITE(archimedes_memc_logical_r, archimedes_memc_logical_w)
120//   AM_RANGE(0x02000000, 0x02ffffff) AM_RAM AM_BASE(&archimedes_memc_physmem) /* physical RAM - 16 MB for now, should be 512k for the A310 */
120//  AM_RANGE(0x02000000, 0x02ffffff) AM_RAM AM_BASE(&archimedes_memc_physmem) /* physical RAM - 16 MB for now, should be 512k for the A310 */
121121   AM_RANGE(0x03000000, 0x033fffff) AM_READWRITE(archimedes_ioc_r, archimedes_ioc_w)
122122   AM_RANGE(0x03400000, 0x035fffff) AM_READWRITE(archimedes_vidc_r, archimedes_vidc_w)
123123   AM_RANGE(0x03600000, 0x037fffff) AM_READWRITE(archimedes_memc_r, archimedes_memc_w)
src/mess/drivers/avigo.c
r8990r8991
403403   opbase_ptr = avigo_banked_opbase[address / 0x4000];
404404   if (opbase_ptr != NULL)
405405   {
406      direct.explicit_configure(0x0000, 0xffff, 0xffff, (UINT8*)opbase_ptr);   
406      direct.explicit_configure(0x0000, 0xffff, 0xffff, (UINT8*)opbase_ptr);
407407      address = ~0;
408408   }
409409   return address;
src/mess/drivers/c64.c
r8990r8991
985985COMP(1983, pet64,   c64,  0,    pet64,   c64,     c64,     "Commodore Business Machines", "PET 64 (NTSC)", 0)
986986COMP(1983, cbm4064, c64,  0,    pet64,   c64,     c64,     "Commodore Business Machines", "CBM 4064 (NTSC)", 0)
987987COMP(1983, edu64,   c64,  0,    pet64,   c64,     c64,     "Commodore Business Machines", "Educator 64 (NTSC)", 0) // maybe different palette?
988//COMP(1983, clipper,  c64,  0,   c64pal,  clipper, c64pal,  "PDC", "Clipper", GAME_NOT_WORKING) // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer
989//COMP(1983, tesa6240, c64,  0,   c64pal,  c64,     c64pal,  "Tesa", "6240", GAME_NOT_WORKING) // modified SX64 with label printer
988//COMP(1983, clipper,  c64,  0, c64pal,  clipper, c64pal,  "PDC", "Clipper", GAME_NOT_WORKING) // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer
989//COMP(1983, tesa6240, c64,  0, c64pal,  c64,     c64pal,  "Tesa", "6240", GAME_NOT_WORKING) // modified SX64 with label printer
990990
991991COMP(1984, sx64,    c64,  0,    sx64,    c64,     sx64,    "Commodore Business Machines", "SX-64 Executive Computer (PAL)", GAME_NOT_WORKING)
992992COMP(1984, vip64,   c64,  0,    sx64,    vip64,   sx64,    "Commodore Business Machines", "VIP64 (SX64 PAL), Swedish Expansion Kit", GAME_NOT_WORKING)
src/mess/drivers/pc.c
r8990r8991
418418   AM_RANGE(0xc8000, 0xc9fff) AM_ROM
419419   AM_RANGE(0xca000, 0xcffff) AM_NOP
420420   AM_RANGE(0xe0000, 0xeffff) AM_NOP
421   AM_RANGE(0xf8000, 0xfffff) AM_ROM
421   AM_RANGE(0xf8000, 0xfffff) AM_ROM
422422ADDRESS_MAP_END
423423
424424
src/mess/drivers/cosmicos.c
r8990r8991
2121
2222    TODO:
2323
24   - fix direct update handler to make system work again
24    - fix direct update handler to make system work again
2525    - display interface INH
2626    - 2 segment display
2727    - single step
src/mess/drivers/psion.c
r8990r8991
22
33        Psion Organiser II series
44
5      Driver by Sandro Ronco
5        Driver by Sandro Ronco
66
7      TODO:
8      - implement Datapack read/write interface
9      - add save state and NVRAM
10      - dump CGROM of the HD44780
11      - move HD44780 implementation in a device
7        TODO:
8        - implement Datapack read/write interface
9        - add save state and NVRAM
10        - dump CGROM of the HD44780
11        - move HD44780 implementation in a device
1212
13      Note:
14      - 4 lines display has an custom LCD controller derived from an HD66780
15      - NVRAM works only if the machine is turned off (with OFF menu) before closing MESS
13        Note:
14        - 4 lines display has an custom LCD controller derived from an HD66780
15        - NVRAM works only if the machine is turned off (with OFF menu) before closing MESS
1616
1717        16/07/2010 Skeleton driver.
1818
19      Memory map info :
20         http://archive.psion2.org/org2/techref/memory.htm
19        Memory map info :
20            http://archive.psion2.org/org2/techref/memory.htm
2121
2222****************************************************************************/
2323
r8990r8991
315315   struct datapack *pack = get_active_slot(machine, psion.port6);
316316
317317   if (pack != NULL && pack->len > 0 && !(psion.port6 & 0x80))
318    {
318   {
319319      UINT32 pack_addr = pack->counter + ((pack->id & 0x04) ? 0x100 * pack->page : 0);
320320
321321      if (pack_addr < pack->len * 0x2000)
322322         return pack->data[pack_addr];
323    }
323   }
324324
325325   return 0;
326326}
r8990r8991
347347      break;
348348   case 0x17:
349349      /*
350      datapack control lines
351      x--- ---- slot on/off
352      -x-- ---- slot 3
353      --x- ---- slot 2
354      ---x ---- slot 1
355      ---- x--- output enable
356      ---- -x-- program line
357      ---- --x- reset line
358      ---- ---x clock line
359      */
350        datapack control lines
351        x--- ---- slot on/off
352        -x-- ---- slot 3
353        --x- ---- slot 2
354        ---x ---- slot 1
355        ---- x--- output enable
356        ---- -x-- program line
357        ---- --x- reset line
358        ---- ---x clock line
359        */
360360      if (psion.port6_ddr == 0xff)
361361      {
362362         struct datapack *pack = get_active_slot(space->machine, data);
363363
364364         if (pack != NULL)
365          {
365         {
366366            if ((psion.port6 & 0x01) != (data & 0x01))
367367            {
368368               pack->counter++;
r8990r8991
384384               pack->counter = 0;
385385               pack->page = 0;
386386            }
387          }
387         }
388388
389389         psion.port6 = data;
390390      }
r8990r8991
405405      return (hd63701_internal_registers_r(space, offset)&0x7f) | (psion.stby_pwr<<7);
406406   case 0x15:
407407      /*
408      x--- ---- ON key active high
409      -xxx xx-- keys matrix active low
410      ---- --x- ??
411      ---- ---x battery status
412      */
408        x--- ---- ON key active high
409        -xxx xx-- keys matrix active low
410        ---- --x- ??
411        ---- ---x battery status
412        */
413413      return kb_read(space->machine) | input_port_read(space->machine, "BATTERY") | input_port_read(space->machine, "ON") | (psion.kb_counter == 0x7ff)<<1;
414414   case 0x17:
415415      return psion.port6;
r8990r8991
10851085/* Driver */
10861086
10871087/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT COMPANY   FULLNAME       FLAGS */
1088COMP( 1986, psioncm,   0,       0,    psioncm,       psion,     0,   "Psion",   "Organiser II CM",      GAME_NOT_WORKING | GAME_NO_SOUND)
1089COMP( 198?, psionla,   psioncm, 0,    psionla,        psion,     0,   "Psion",   "Organiser II LA",      GAME_NOT_WORKING | GAME_NO_SOUND)
1090COMP( 198?, psionp350,   psioncm, 0,    psionp350,        psion,     0,   "Psion",   "Organiser II P350",   GAME_NOT_WORKING | GAME_NO_SOUND)
1091COMP( 198?, psionlam,   psioncm, 0,    psionlam,        psion,     0,   "Psion",   "Organiser II LAM",   GAME_NOT_WORKING | GAME_NO_SOUND)
1092COMP( 1989, psionlz64,  psioncm, 0,    psionlz,        psion,     0,   "Psion",   "Organiser II LZ64",   GAME_NOT_WORKING | GAME_NO_SOUND)
1093COMP( 1989, psionlz64s,   psioncm, 0,    psionlz,        psion,     0,   "Psion",   "Organiser II LZ64S",   GAME_NOT_WORKING | GAME_NO_SOUND)
1094COMP( 1989, psionlz,   psioncm, 0,    psionlz,        psion,     0,   "Psion",   "Organiser II LZ",      GAME_NOT_WORKING | GAME_NO_SOUND)
1095COMP( 198?, psionp464,   psioncm, 0,    psionlz,        psion,     0,   "Psion",   "Organiser II P464",   GAME_NOT_WORKING | GAME_NO_SOUND)
1088COMP( 1986, psioncm,   0,       0,    psioncm,      psion,    0,   "Psion",   "Organiser II CM",      GAME_NOT_WORKING | GAME_NO_SOUND)
1089COMP( 198?, psionla,   psioncm, 0,    psionla,       psion,    0,   "Psion",   "Organiser II LA",      GAME_NOT_WORKING | GAME_NO_SOUND)
1090COMP( 198?, psionp350,   psioncm, 0,    psionp350,       psion,    0,   "Psion",   "Organiser II P350",   GAME_NOT_WORKING | GAME_NO_SOUND)
1091COMP( 198?, psionlam,   psioncm, 0,    psionlam,       psion,    0,   "Psion",   "Organiser II LAM",   GAME_NOT_WORKING | GAME_NO_SOUND)
1092COMP( 1989, psionlz64,  psioncm, 0,    psionlz,       psion,    0,   "Psion",   "Organiser II LZ64",   GAME_NOT_WORKING | GAME_NO_SOUND)
1093COMP( 1989, psionlz64s,   psioncm, 0,    psionlz,       psion,    0,   "Psion",   "Organiser II LZ64S",   GAME_NOT_WORKING | GAME_NO_SOUND)
1094COMP( 1989, psionlz,   psioncm, 0,    psionlz,       psion,    0,   "Psion",   "Organiser II LZ",      GAME_NOT_WORKING | GAME_NO_SOUND)
1095COMP( 198?, psionp464,   psioncm, 0,    psionlz,       psion,    0,   "Psion",   "Organiser II P464",   GAME_NOT_WORKING | GAME_NO_SOUND)
src/mess/drivers/gba.c
r8990r8991
24722472
24732473static DRIVER_INIT(gbadv)
24742474{
2475   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(gba_direct, *machine));   
2475   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(gba_direct, *machine));
24762476}
24772477
24782478/*    YEAR  NAME PARENT COMPAT MACHINE INPUT   INIT   COMPANY     FULLNAME */
src/mess/drivers/bmjr.c
r8990r8991
11/***************************************************************************
22
3   Basic Master Jr (MB-6885) (c) 1982? Hitachi
3    Basic Master Jr (MB-6885) (c) 1982? Hitachi
44
5   preliminary driver by Angelo Salese
5    preliminary driver by Angelo Salese
66
7   TODO:
8   - for whatever reason, BASIC won't work if you try to use it directly,
9     it does if you enter into MON first then exit (with E)
10   - tape hook-up doesn't work yet (shouldn't be hard to fix)
11   - Break key is unemulated (tied with the NMI)
7    TODO:
8    - for whatever reason, BASIC won't work if you try to use it directly,
9      it does if you enter into MON first then exit (with E)
10    - tape hook-up doesn't work yet (shouldn't be hard to fix)
11    - Break key is unemulated (tied with the NMI)
1212
1313****************************************************************************/
1414
r8990r8991
7979{
8080   key_mux = data & 0xf;
8181
82//   if(data & 0xf0)
83//      printf("%02x",data & 0xf0);
82//  if(data & 0xf0)
83//      printf("%02x",data & 0xf0);
8484}
8585
8686static running_device *bmjr_cassette;
r8990r8991
143143   AM_RANGE(0x0000, 0xafff) AM_RAM AM_BASE(&wram)
144144   AM_RANGE(0xb000, 0xdfff) AM_ROM
145145   AM_RANGE(0xe000, 0xe7ff) AM_ROM
146//   AM_RANGE(0xe890, 0xe890) W MP-1710 tile color
147//   AM_RANGE(0xe891, 0xe891) W MP-1710 background color
148//   AM_RANGE(0xe892, 0xe892) W MP-1710 monochrome / color setting
146//  AM_RANGE(0xe890, 0xe890) W MP-1710 tile color
147//  AM_RANGE(0xe891, 0xe891) W MP-1710 background color
148//  AM_RANGE(0xe892, 0xe892) W MP-1710 monochrome / color setting
149149   AM_RANGE(0xee00, 0xee00) AM_READ(tape_stop_r) //R stop tape
150150   AM_RANGE(0xee20, 0xee20) AM_READ(tape_start_r) //R start tape
151151   AM_RANGE(0xee40, 0xee40) AM_WRITE(xor_display_w) //W Picture reverse
r8990r8991
154154   AM_RANGE(0xef00, 0xef00) AM_READ(ff_r) //R timer
155155   AM_RANGE(0xef40, 0xef40) AM_READ(ff_r) //R unknown
156156   AM_RANGE(0xef80, 0xef80) AM_READ(unk_r) //R unknown
157//   AM_RANGE(0xefe0, 0xefe0) W screen mode
157//  AM_RANGE(0xefe0, 0xefe0) W screen mode
158158   AM_RANGE(0xf000, 0xffff) AM_ROM
159159ADDRESS_MAP_END
160160
r8990r8991
367367}
368368
369369/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
370COMP( 1982, bmjr,     0,       0,    bmjr,       bmjr,     bmjr,      "Hitachi",   "Basic Master Jr",   GAME_NOT_WORKING | GAME_NO_SOUND)
370COMP( 1982, bmjr,   0,       0,    bmjr,      bmjr,    bmjr,      "Hitachi",   "Basic Master Jr",   GAME_NOT_WORKING | GAME_NO_SOUND)
371371

Previous 15994 Revisions Next


© 1998-2018 The MESS Team