Previous 15994 Revisions Next

r1709 Friday 22nd February, 2008 at 12:57:40 UTC by PeT
apfm1000 added special video modes support, but exact cpu timing needed for video mode switching druing frame
[docs]messnew.txt
[src/mess/drivers]apf.c
[src/mess/includes]apf.h
[src/mess/video]apf.c

src/mess/includes/apf.h
r1708r1709
1111/*----------- defined in video/apf.c -----------*/
1212
1313VIDEO_START(apf);
14extern UINT8 apf_m6847_attr;
1415
1516
1617/*----------- defined in drivers/apf.c -----------*/
1718
1819void apf_update_ints(void);
1920
20
2121/*----------- defined in machine/apf.c -----------*/
2222
2323DEVICE_LOAD( apfimag_floppy );
src/mess/video/apf.c
r1708r1709
88
99UINT8 *apf_video_ram;
1010UINT8 apf_m6847_attr;
11static UINT8 apf_chars[0x20], apf_video[0x20];
1112
1213static ATTR_CONST UINT8 apf_get_attributes(UINT8 c)
1314{
15
1416   /* this seems to be the same so far, as it gives the same result as vapf */
15   UINT8 result = apf_m6847_attr;
17  UINT8 result = apf_m6847_attr;
18  if (apf_m6847_attr&M6847_AG) {
19    result |= M6847_GM2|M6847_GM1;
20  } else {
1621   if (c & 0x40)   result |= M6847_INV;
1722   if (c & 0x80)   result |= M6847_AS;
23  }
1824   return result;
1925}
2026
27static UINT8 apf_get_character(int character, int line)
28{
29  return apf_video_ram[(character&0x1f)*0x10+line+0x200];
30}
2131
22
2332static void apf_vsync_int(int line)
2433{
2534   extern unsigned int apf_ints;
r1708r1709
3443
3544static const UINT8 *apf_get_video_ram(int scanline)
3645{
37   return &apf_video_ram[(scanline / 12) * 0x20 + 0x200];
46  if (apf_m6847_attr&M6847_AG) {
47    /* apf has only 1kbyte ram and can't use all for video of course
48       it doesn't combine the 6847 with the 6883, instead it has own circuit
49       to do special 32x12 tilemap at 0x0000 with 8x16 sized characters. The 32 characters are defined at address 0x0200
50       and delivers resulting byte to the m6847 which operates in graphics mode
51     */
52    int i;
53    if ((scanline&0xf)==0)
54      memcpy (apf_chars, &apf_video_ram[(scanline/16)*0x20], sizeof(apf_chars));
55    for (i=0; i<sizeof(apf_video); i++)
56      apf_video[i]=apf_get_character(apf_chars[i], scanline&0xf);
57    return apf_video;
58  } else {
59    return &apf_video_ram[(scanline / 12) * 0x20 + 0x200];
60  }
3861}
3962
4063
r1708r1709
5073   cfg.get_video_ram = apf_get_video_ram;
5174   m6847_init(&cfg);
5275}
76
77VIDEO_UPDATE(apf)
78{
79    return VIDEO_UPDATE_CALL(m6847);
80}
src/mess/drivers/apf.c
r1708r1709
11/******************************************************************************
22
3driver by ?
4
5PeT mess@utanet.at around February 2008:
6 added apfm1000 cartridge loading
7 fixed apfm1000 pads
8 added apf video mode
9
10todo for apf m1000:
11 add exact cpu/video timing. memory controller+6847 memory operations hold cpu
12  (backgammon relies on exact video timing)
13 support special cartridges (basic, space destroyer)
14
315 ******************************************************************************/
416#include "driver.h"
517#include "video/m6847.h"
r1708r1709
100112   /* multi colour graphics mode */
101113   /* 158 = 1001 multi-colour graphics */
102114   /* 222 = 1101 mono graphics */
103   //  if (((previous_mode^data) & 0x0f0)!=0)
115   if (((previous_mode^data) & 0x0f0)!=0)
104116   {
105      extern UINT8 apf_m6847_attr;
117     //    logerror("apf vidmode %02x\n", data);
106118
107119      /* not sure if this is correct - need to check */
108120      apf_m6847_attr = 0x00;
109      if (data & 0x80)   apf_m6847_attr |= M6847_AG;
110      if (data & 0x40)   apf_m6847_attr |= M6847_GM2;
111      if (data & 0x20)   apf_m6847_attr |= M6847_GM1;
112      if (data & 0x10)   apf_m6847_attr |= M6847_GM0;
121             if (data & 0x80)   apf_m6847_attr |= M6847_AG;
122      if (data & 0x40)   apf_m6847_attr |= M6847_GM0;
123      //      if (data & 0x20)   apf_m6847_attr |= M6847_GM1; //?
124      //      if (data & 0x10)   apf_m6847_attr |= M6847_GM2; //M6847_GM0; //?
113125      previous_mode = data;
114126   }
115127}
r1708r1709
514526   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 5") PORT_CODE(KEYCODE_5_PAD) PORT_PLAYER(2)
515527   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 8") PORT_CODE(KEYCODE_8_PAD) PORT_PLAYER(2)
516528
529   PORT_INCLUDE( m6847_artifacting )
517530INPUT_PORTS_END
518531
519532
r1708r1709
620633static MACHINE_DRIVER_START( apf_imagination )
621634   /* basic machine hardware */
622635   MDRV_CPU_ADD_TAG("main", M6800, 3750000)        /* 7.8336 Mhz */
636   //        MDRV_CPU_ADD_TAG("main", M6800, (3750000/2) )        /* backgammon uses timing from vertical interrupt to switch between video modes during frame */
623637   MDRV_CPU_PROGRAM_MAP(apf_imagination_map, 0)
624638   MDRV_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
625639   MDRV_INTERLEAVE(0)
docs/messnew.txt
r1708r1709
1010----------------------
1111- [QL] System boots up again. (bug #1495) [Curt Coder]
1212
13- [APFM1000] added special APF video mode [PeT]
1314
1415
1516User Interface Changes:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team