Previous 199869 Revisions Next

r17890 Friday 14th September, 2012 at 16:37:26 UTC by Curt Coder
Rewrote the SAA5050 Teletext character generator. Removed saa505x.c which was used by bbc.c, and refactored all drivers to use the new implementation. [Curt Coder]
[src/emu/video]saa5050.c saa5050.h
[src/mame/drivers]malzak.c
[src/mame/includes]malzak.h
[src/mame/video]malzak.c
[src/mess]mess.mak
[src/mess/drivers]a6809.c abc80x.c bbc.c p2000t.c poly.c
[src/mess/includes]abc80x.h bbc.h p2000t.h
[src/mess/video]abc800.c bbc.c p2000m.c saa505x.c saa505x.h

trunk/src/mame/video/malzak.c
r17889r17890
1717#include "video/saa5050.h"
1818#include "includes/malzak.h"
1919
20
21SCREEN_UPDATE_IND16( malzak )
20SCREEN_UPDATE_RGB32( malzak )
2221{
22   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
2323   malzak_state *state = screen.machine().driver_data<malzak_state>();
2424   int sx, sy;
2525   int x,y;
2626
27   bitmap.fill(0);
27   bitmap.fill(RGB_BLACK);
2828
29   saa5050_update(state->m_saa5050, bitmap, cliprect);
30   saa5050_frame_advance(state->m_saa5050);
29   state->m_trom->screen_update(screen, bitmap, cliprect);
3130
3231   // playfield - not sure exactly how this works...
3332   for (x = 0; x < 16; x++)
r17889r17890
4140         if (sx < -15*2)
4241            sx += 256*2;
4342
44         drawgfxzoom_transpen(bitmap,cliprect, screen.machine().gfx[0], state->m_playfield_code[x * 16 + y], 7*2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
43         drawgfxzoom_transpen(bitmap,cliprect, screen.machine().gfx[0], state->m_playfield_code[x * 16 + y], 2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
4544      }
4645
4746   /* update the S2636 chips */
r17889r17890
6261            int pixel1 = s2636_1_bitmap.pix16(y, x);
6362
6463            if (S2636_IS_PIXEL_DRAWN(pixel0)) {
65               bitmap.pix16(y*2, x*2) = S2636_PIXEL_COLOR(pixel0);
66               bitmap.pix16(y*2+1, x*2) = S2636_PIXEL_COLOR(pixel0);
67               bitmap.pix16(y*2, x*2+1) = S2636_PIXEL_COLOR(pixel0);
68               bitmap.pix16(y*2+1, x*2+1) = S2636_PIXEL_COLOR(pixel0);
64               bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
65               bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
66               bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
67               bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
6968            }
7069
7170            if (S2636_IS_PIXEL_DRAWN(pixel1)) {
72               bitmap.pix16(y*2, x*2) = S2636_PIXEL_COLOR(pixel1);
73               bitmap.pix16(y*2+1, x*2) = S2636_PIXEL_COLOR(pixel1);
74               bitmap.pix16(y*2, x*2+1) = S2636_PIXEL_COLOR(pixel1);
75               bitmap.pix16(y*2+1, x*2+1) = S2636_PIXEL_COLOR(pixel1);
71               bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
72               bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
73               bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
74               bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
7675            }
7776         }
7877      }
trunk/src/mame/includes/malzak.h
r17889r17890
44
55*************************************************************************/
66
7#include "video/saa5050.h"
78
89class malzak_state : public driver_device
910{
1011public:
1112   malzak_state(const machine_config &mconfig, device_type type, const char *tag)
12      : driver_device(mconfig, type, tag) { }
13      : driver_device(mconfig, type, tag),
14        m_trom(*this, "saa5050"),
15        m_videoram(*this, "videoram")
16   { }
1317
18   required_device<saa5050_device> m_trom;
19   required_shared_ptr<UINT8> m_videoram;
20
1421   /* misc */
1522//  int playfield_x[256];
1623//  int playfield_y[256];
r17889r17890
3138   DECLARE_WRITE8_MEMBER(portc0_w);
3239   DECLARE_READ8_MEMBER(collision_r);
3340   DECLARE_WRITE8_MEMBER(malzak_playfield_w);
41   DECLARE_READ8_MEMBER(videoram_r);
3442   virtual void machine_start();
3543   virtual void machine_reset();
3644   virtual void palette_init();
r17889r17890
4048/*----------- defined in video/malzak.c -----------*/
4149
4250
43SCREEN_UPDATE_IND16( malzak );
51SCREEN_UPDATE_RGB32( malzak );
trunk/src/mame/drivers/malzak.c
r17889r17890
110110   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_1", s2636_work_ram_r, s2636_work_ram_w)
111111   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM_WRITE(malzak_playfield_w)
112112   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM
113   AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
113   AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("videoram")
114114   AM_RANGE(0x2000, 0x2fff) AM_ROM
115115   AM_RANGE(0x4000, 0x4fff) AM_ROM
116116   AM_RANGE(0x6000, 0x6fff) AM_ROM
r17889r17890
131131   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_1", s2636_work_ram_r, s2636_work_ram_w)
132132   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM_WRITE(malzak_playfield_w)
133133   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("nvram")
134   AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
134   AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("videoram")
135135   AM_RANGE(0x2000, 0x2fff) AM_ROM
136136   AM_RANGE(0x4000, 0x4fff) AM_ROM
137137   AM_RANGE(0x6000, 0x6fff) AM_ROM
r17889r17890
256256//  8*8
257257};
258258
259static const gfx_layout saa5050_charlayout =
260{
261   6, 10,
262   256,
263   1,
264   { 0 },
265   { 2, 3, 4, 5, 6, 7 },
266   { 0*8, 1*8, 2*8, 3*8, 4*8,
267     5*8, 6*8, 7*8, 8*8, 9*8 },
268   8 * 10
269};
270259
271static const gfx_layout saa5050_hilayout =
272{
273   6, 10,
274   256,
275   1,
276   { 0 },
277   { 2, 3, 4, 5, 6, 7 },
278   { 0*8, 0*8, 1*8, 1*8, 2*8,
279     2*8, 3*8, 3*8, 4*8, 4*8 },
280   8 * 10
281};
282
283static const gfx_layout saa5050_lolayout =
284{
285   6, 10,
286   256,
287   1,
288   { 0 },
289   { 2, 3, 4, 5, 6, 7 },
290   { 5*8, 5*8, 6*8, 6*8, 7*8,
291     7*8, 8*8, 8*8, 9*8, 9*8 },
292   8 * 10
293};
294
295
296260static GFXDECODE_START( malzak )
297261   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout,         0,  16 )
298   GFXDECODE_ENTRY( "gfx2", 0x0000, saa5050_charlayout, 0, 128 )
299   GFXDECODE_ENTRY( "gfx2", 0x0000, saa5050_hilayout,   0, 128 )
300   GFXDECODE_ENTRY( "gfx2", 0x0000, saa5050_lolayout,   0, 128 )
301262GFXDECODE_END
302263
303264
r17889r17890
357318   "s2636snd_1"
358319};
359320
360static const saa5050_interface malzac_saa5050_intf =
321READ8_MEMBER(malzak_state::videoram_r)
361322{
362   "screen",
363   1,   /* starting gfxnum */
364   42, 24, 64,  /* x, y, size */
365      1    /* rev y order */
323   return m_videoram[offset];
324}
325
326static SAA5050_INTERFACE( malzac_saa5050_intf )
327{
328   DEVCB_DRIVER_MEMBER(malzak_state, videoram_r),
329   42, 24, 64  /* x, y, size */
366330};
367331
368
369332void malzak_state::machine_start()
370333{
371334
r17889r17890
400363   /* video hardware */
401364   MCFG_SCREEN_ADD("screen", RASTER)
402365   MCFG_SCREEN_REFRESH_RATE(50)
403   //MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK))
366   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
404367   MCFG_SCREEN_SIZE(480, 512)   /* vert size is a guess */
405368   MCFG_SCREEN_VISIBLE_AREA(0, 479, 0, 479)
406369   MCFG_SCREEN_UPDATE_STATIC(malzak)
r17889r17890
411374   MCFG_S2636_ADD("s2636_0", malzac_s2636_0_config)
412375   MCFG_S2636_ADD("s2636_1", malzac_s2636_1_config)
413376
414   MCFG_SAA5050_ADD("saa5050", malzac_saa5050_intf)
377   MCFG_SAA5050_ADD("saa5050", 6000000, malzac_saa5050_intf)
415378
416379   /* sound hardware */
417380   MCFG_SPEAKER_STANDARD_MONO("mono")
r17889r17890
454417
455418   ROM_REGION( 0x0800, "gfx1", 0 )
456419   ROM_LOAD( "malzak.1",     0x0000, 0x0800, CRC(74d5ff7b) SHA1(cae326370dc83b86542f9d070e2dc91b1b833356) )
457
458   ROM_REGION(0x01000, "gfx2",0) // SAA5050 internal character ROM
459   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc) )
460
461420ROM_END
462421
463422ROM_START( malzak2 )
r17889r17890
478437
479438   ROM_REGION( 0x0800, "gfx1", 0 )
480439   ROM_LOAD( "malzak.1",     0x0000, 0x0800, CRC(74d5ff7b) SHA1(cae326370dc83b86542f9d070e2dc91b1b833356) )
481
482   ROM_REGION(0x01000, "gfx2",0) // SAA5050 internal character ROM
483   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc) )
484
485440ROM_END
486441
487442
trunk/src/emu/video/saa5050.c
r17889r17890
1/***************************************************************************
1/**********************************************************************
22
3    saa5050.c
3    Mullard SAA5050 Teletext Character Generator emulation
44
5    Functions to emulate the
6    SAA5050 - Teletext Character Generator.
5    http://www.bighole.nl/pub/mirror/homepage.ntlworld.com/kryten_droid/teletext/spec/teletext_spec_1974.htm
76
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12/*
13
814    TODO:
9    -  Implement BOX and dirtybuffer
10    -  Add support for non-English version (SAA505x), possibly merging
11       src/mess/video/saa505x.c unsed by bbc.c in MESS
12    -  Investigate why supporting code 0 behavior breaks p2000t vscroll
13       in MESS (but not supporting breaks malzak title background)
14    -  x,y sizes should probably be calculated from the screen parameters
15       rather than passed in the device interface
1615
17***************************************************************************/
16   - character rounding
17   - remote controller input
18   - boxing
1819
19#include "emu.h"
20#include "video/saa5050.h"
20*/
2121
22#define SAA5050_DBLHI   0x0001
23#define SAA5050_SEPGR   0x0002
24#define SAA5050_FLASH   0x0004
25#define SAA5050_BOX     0x0008
26#define SAA5050_GRAPH   0x0010
27#define SAA5050_CONCEAL 0x0020
28#define SAA5050_HOLDGR  0x0040
22#include "saa5050.h"
2923
30#define SAA5050_BLACK   0
31#define SAA5050_WHITE   7
3224
25//**************************************************************************
26//  DEVICE DEFINITIONS
27//**************************************************************************
3328
34typedef struct _saa5050_state  saa5050_state;
35struct _saa5050_state
36{
37   device_t *screen;
38   int         gfxnum;
39   int         x, y;
40   int         size;
41   int         rev;
29const device_type SAA5050 = &device_creator<saa5050_device>;
30const device_type SAA5052 = &device_creator<saa5052_device>;
4231
43   UINT8 *     videoram;
44   UINT16      flags;
45   UINT8         forecol;
46   UINT8         backcol;
47   UINT8         prvcol;
48   UINT8         prvchr;
49   INT8        frame_count;
50};
5132
33//-------------------------------------------------
34//  ROM( saa5050 )
35//-------------------------------------------------
5236
53/*************************************
54 *
55 *  Inline functions
56 *
57 *************************************/
37ROM_START( saa5050 )
38   ROM_REGION( 0x10000, "chargen", 0 )
39   ROM_LOAD( "saa5050", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc) )
40ROM_END
5841
59INLINE saa5050_state *get_safe_token( device_t *device )
60{
61   assert(device != NULL);
62   assert(device->type() == SAA5050);
6342
64   return (saa5050_state *)downcast<saa5050_device *>(device)->token();
65}
43//-------------------------------------------------
44//  ROM( saa5052 )
45//-------------------------------------------------
6646
67INLINE const saa5050_interface *get_interface( device_t *device )
47ROM_START( saa5052 )
48   ROM_REGION( 0x10000, "chargen", 0 )
49   ROM_LOAD( "saa5052", 0x0140, 0x08c0, BAD_DUMP CRC(cda3bf79) SHA1(cf5ea94459c09001d422dadc212bc970b4b4aa20) )
50ROM_END
51
52
53//-------------------------------------------------
54//  rom_region - device-specific ROM region
55//-------------------------------------------------
56
57const rom_entry *saa5050_device::device_rom_region() const
6858{
69   assert(device != NULL);
70   assert((device->type() == SAA5050));
71   return (const saa5050_interface *) device->static_config();
59   switch (m_variant)
60   {
61      default:      return ROM_NAME( saa5050 );
62      case TYPE_5052:   return ROM_NAME( saa5052 );
63   }
7264}
7365
74/*************************************
75 *
76 *  Graphics definitions
77 *
78 *************************************/
7966
80static const gfx_layout saa5050_charlayout =
81{
82   6, 10,
83   256,
84   1,
85   { 0 },
86   { 2, 3, 4, 5, 6, 7 },
87   { 0*8, 1*8, 2*8, 3*8, 4*8,
88     5*8, 6*8, 7*8, 8*8, 9*8 },
89   8 * 10
90};
9167
92static const gfx_layout saa5050_hilayout =
68//**************************************************************************
69//  MACROS / CONSTANTS
70//**************************************************************************
71
72enum
9373{
94   6, 10,
95   256,
96   1,
97   { 0 },
98   { 2, 3, 4, 5, 6, 7 },
99   { 0*8, 0*8, 1*8, 1*8, 2*8,
100     2*8, 3*8, 3*8, 4*8, 4*8 },
101   8 * 10
74   NUL = 0,
75   ALPHA_RED,
76   ALPHA_GREEN,
77   ALPHA_YELLOW,
78   ALPHA_BLUE,
79   ALPHA_MAGENTA,
80   ALPHA_CYAN,
81   ALPHA_WHITE,
82   FLASH,
83   STEADY,
84   END_BOX,
85   START_BOX,
86   NORMAL_HEIGHT,
87   DOUBLE_HEIGHT,
88   S0,
89   S1,
90   DLE,
91   GRAPHICS_RED,
92   GRAPHICS_GREEN,
93   GRAPHICS_YELLOW,
94   GRAPHICS_BLUE,
95   GRAPHICS_MAGENTA,
96   GRAPHICS_CYAN,
97   GRAPHICS_WHITE,
98   CONCEAL_DISPLAY,
99   CONTIGUOUS_GFX,
100   SEPARATED_GFX,
101   ESC,
102   BLACK_BACKGROUND,
103   NEW_BACKGROUND,
104   HOLD_GRAPHICS,
105   RELEASE_GRAPHICS
102106};
103107
104static const gfx_layout saa5050_lolayout =
108
109static const rgb_t PALETTE[] =
105110{
106   6, 10,
107   256,
108   1,
109   { 0 },
110   { 2, 3, 4, 5, 6, 7 },
111   { 5*8, 5*8, 6*8, 6*8, 7*8,
112     7*8, 8*8, 8*8, 9*8, 9*8 },
113   8 * 10
111   RGB_BLACK,
112   MAKE_RGB(0xff, 0x00, 0x00),
113   MAKE_RGB(0x00, 0xff, 0x00),
114   MAKE_RGB(0xff, 0xff, 0x00),
115   MAKE_RGB(0x00, 0x00, 0xff),
116   MAKE_RGB(0xff, 0x00, 0xff),
117   MAKE_RGB(0x00, 0xff, 0xff),
118   RGB_WHITE
114119};
115120
116GFXDECODE_START( saa5050 )
117   GFXDECODE_ENTRY( "gfx1", 0x0000, saa5050_charlayout, 0, 64 )
118   GFXDECODE_ENTRY( "gfx1", 0x0000, saa5050_hilayout, 0, 64 )
119   GFXDECODE_ENTRY( "gfx1", 0x0000, saa5050_lolayout, 0, 64 )
120GFXDECODE_END
121121
122122
123/*************************************
124 *
125 *  Palette initialization
126 *
127 *************************************/
123//**************************************************************************
124//  LIVE DEVICE
125//**************************************************************************
128126
129static const UINT8 saa5050_colors[8 * 3] =
127//-------------------------------------------------
128//  saa5050_device - constructor
129//-------------------------------------------------
130
131saa5050_device::saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
132    : device_t(mconfig, type, name, tag, owner, clock),
133      m_frame_count(0),
134      m_variant(variant)
130135{
131   0x00, 0x00, 0x00,   /* black */
132   0xff, 0x00, 0x00,   /* red */
133   0x00, 0xff, 0x00,   /* green */
134   0xff, 0xff, 0x00,   /* yellow */
135   0x00, 0x00, 0xff,   /* blue */
136   0xff, 0x00, 0xff,   /* magenta */
137   0x00, 0xff, 0xff,   /* cyan */
138   0xff, 0xff, 0xff   /* white */
139};
136}
140137
141static const UINT16 saa5050_palette[64 * 2] =   /* bgnd, fgnd */
138saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
139    : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock),
140      m_frame_count(0),
141      m_variant(TYPE_5050)
142142{
143   0,1, 0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7,
144   1,0, 1,1, 1,2, 1,3, 1,4, 1,5, 1,6, 1,7,
145   2,0, 2,1, 2,2, 2,3, 2,4, 2,5, 2,6, 2,7,
146   3,0, 3,1, 3,2, 3,3, 3,4, 3,5, 3,6, 3,7,
147   4,0, 4,1, 4,2, 4,3, 4,4, 4,5, 4,6, 4,7,
148   5,0, 5,1, 5,2, 5,3, 5,4, 5,5, 5,6, 5,7,
149   6,0, 6,1, 6,2, 6,3, 6,4, 6,5, 6,6, 6,7,
150   7,0, 7,1, 7,2, 7,3, 7,4, 7,5, 7,6, 7,7
151};
143}
152144
153PALETTE_INIT( saa5050 )
145saa5052_device::saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
146    : saa5050_device(mconfig, SAA5052, "SAA5052", tag, owner, clock, TYPE_5052)
154147{
155   UINT8 i, r, g, b;
148}
156149
157   machine.colortable = colortable_alloc(machine, 8);
158150
159   for ( i = 0; i < 8; i++ )
151//-------------------------------------------------
152//  device_config_complete - perform any
153//  operations now that the configuration is
154//  complete
155//-------------------------------------------------
156
157void saa5050_device::device_config_complete()
158{
159   // inherit a copy of the static code
160   const saa5050_interface *intf = reinterpret_cast<const saa5050_interface *>(static_config());
161   if (intf != NULL)
162      *static_cast<saa5050_interface *>(this) = *intf;
163
164   // or initialize to defaults if none provided
165   else
160166   {
161      r = saa5050_colors[i * 3];
162      g = saa5050_colors[i * 3 + 1];
163      b = saa5050_colors[i * 3 + 2];
164      colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
167      memset(&m_in_d_cb, 0, sizeof(m_in_d_cb));
165168   }
166169
167   for (i = 0; i < 128; i++)
168      colortable_entry_set_value(machine.colortable, i, saa5050_palette[i]);
170   switch (m_variant)
171   {
172      default:      m_shortname = "saa5050"; break;
173      case TYPE_5052:   m_shortname = "saa5052"; break;
174   }
169175}
170176
171/*************************************
172 *
173 *  Videoram access handlers
174 *
175 *************************************/
176177
177WRITE8_DEVICE_HANDLER( saa5050_videoram_w )
178//-------------------------------------------------
179//  device_start - device-specific startup
180//-------------------------------------------------
181
182void saa5050_device::device_start()
178183{
179   saa5050_state *saa5050 = get_safe_token(device);
180   saa5050->videoram[offset] = data;
181}
184   // resolve callbacks
185   m_in_d_func.resolve(m_in_d_cb, *this);
182186
187   // find memory regions
188   m_char_rom = memregion("chargen")->base();
183189
184READ8_DEVICE_HANDLER( saa5050_videoram_r )
185{
186   saa5050_state *saa5050 = get_safe_token(device);
187   return saa5050->videoram[offset];
190   // register for state saving
191   save_item(NAME(m_code));
192   save_item(NAME(m_last_code));
193   save_item(NAME(m_char_data));
194   save_item(NAME(m_bit));
195   save_item(NAME(m_color));
196   save_item(NAME(m_ra));
197   save_item(NAME(m_bg));
198   save_item(NAME(m_fg));
199   save_item(NAME(m_graphics));
200   save_item(NAME(m_separated));
201   save_item(NAME(m_conceal));
202   save_item(NAME(m_flash));
203   save_item(NAME(m_boxed));
204   save_item(NAME(m_double_height));
205   save_item(NAME(m_double_height_top_row));
206   save_item(NAME(m_double_height_bottom_row));
207   save_item(NAME(m_hold));
208   save_item(NAME(m_frame_count));
209   save_item(NAME(m_variant));
188210}
189211
190/*************************************
191 *
192 *  Emulation
193 *
194 *************************************/
195212
213//-------------------------------------------------
214//  process_control_character -
215//-------------------------------------------------
196216
197/* this should probably be put at the end of saa5050 update,
198but p2000t in MESS does not seem to currently support it.
199Hence, we leave it independent for the moment */
200void saa5050_frame_advance( device_t *device )
217void saa5050_device::process_control_character(UINT8 data)
201218{
202   saa5050_state *saa5050 = get_safe_token(device);
219   switch (data)
220   {
221   case ALPHA_RED:
222   case ALPHA_GREEN:
223   case ALPHA_YELLOW:
224   case ALPHA_BLUE:
225   case ALPHA_MAGENTA:
226   case ALPHA_CYAN:
227   case ALPHA_WHITE:
228      m_graphics = false;
229      m_conceal = false;
230      m_fg = data & 0x07;
231      break;
203232
204   saa5050->frame_count++;
205   if (saa5050->frame_count > 50)
206      saa5050->frame_count = 0;
207}
233   case FLASH:
234      m_flash = true;
235      break;
208236
209void saa5050_update( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect  )
210{
211   saa5050_state *saa5050 = get_safe_token(device);
212   int code, colour;
213   int sx, sy, ssy;
237   case STEADY:
238      m_flash = false;
239      break;
240     
241   case END_BOX:
242   case START_BOX:
243      // TODO
244      break;
214245
215   for (sy = 0; sy <= saa5050->y; sy++)
216   {
217      bool dblhi = false;
246   case NORMAL_HEIGHT:
247      m_double_height = 0;
248      break;
218249
219      /* Set start of line state */
220      saa5050->flags = 0;
221      saa5050->prvchr = 32;
222      saa5050->forecol = SAA5050_WHITE;
223      saa5050->prvcol = SAA5050_WHITE;
224      saa5050->backcol = SAA5050_BLACK;
250   case DOUBLE_HEIGHT:
251      if (!m_double_height_bottom_row)
252      {
253         m_double_height_top_row = true;
254      }
225255
226      /* should we go in reverse order? */
227      ssy = saa5050->rev ? saa5050->y - sy : sy;
256      m_double_height = 1;
257      break;
228258
229      for (sx = 0; sx < saa5050->x; sx++)
230      {
231         int blank = 0;
232         code = saa5050->videoram[ssy * saa5050->size + sx];
233         if (code < 32)
234         {
235            switch (code)
236            {
237            case 0x00:
238               // Temporary hack until proper docs are found
239               if (saa5050->rev) // This is not ok, but it is done only in case of malzak
240                  blank = 1;  // code 0x00 should not display anything, unless HOLDGR is set
241               break;
242            case 0x01: case 0x02: case 0x03: case 0x04:
243            case 0x05: case 0x06: case 0x07:
244               saa5050->prvcol = saa5050->forecol = code;
245               saa5050->flags &= ~(SAA5050_GRAPH | SAA5050_CONCEAL);
246               break;
247            case 0x11: case 0x12: case 0x13: case 0x14:
248            case 0x15: case 0x16: case 0x17:
249               saa5050->prvcol = (saa5050->forecol = (code & 0x07));
250               saa5050->flags &= ~SAA5050_CONCEAL;
251               saa5050->flags |= SAA5050_GRAPH;
252               break;
253            case 0x08:
254               saa5050->flags |= SAA5050_FLASH;
255               break;
256            case 0x09:
257               saa5050->flags &= ~SAA5050_FLASH;
258               break;
259            case 0x0a:
260               saa5050->flags |= SAA5050_BOX;
261               break;
262            case 0x0b:
263               saa5050->flags &= ~SAA5050_BOX;
264               break;
265            case 0x0c:
266               saa5050->flags &= ~SAA5050_DBLHI;
267               break;
268            case 0x0d:
269               saa5050->flags |= SAA5050_DBLHI;
270               dblhi = true;
271               break;
272            case 0x18:
273               saa5050->flags |= SAA5050_CONCEAL;
274               break;
275            case 0x19:
276               saa5050->flags |= SAA5050_SEPGR;
277               break;
278            case 0x1a:
279               saa5050->flags &= ~SAA5050_SEPGR;
280               break;
281            case 0x1c:
282               saa5050->backcol = SAA5050_BLACK;
283               break;
284            case 0x1d:
285               saa5050->backcol = saa5050->prvcol;
286               break;
287            case 0x1e:
288               saa5050->flags |= SAA5050_HOLDGR;
289               break;
290            case 0x1f:
291               saa5050->flags &= ~SAA5050_HOLDGR;
292               break;
293            }
259   case GRAPHICS_RED:
260   case GRAPHICS_GREEN:
261   case GRAPHICS_YELLOW:
262   case GRAPHICS_BLUE:
263   case GRAPHICS_MAGENTA:
264   case GRAPHICS_CYAN:
265   case GRAPHICS_WHITE:
266      m_graphics = true;
267      m_conceal = false;
268      m_fg = data & 0x07;
269      break;
294270
295            if (saa5050->flags & SAA5050_HOLDGR)
296               code = saa5050->prvchr;
297            else
298               code = 32;
299         }
271   case CONCEAL_DISPLAY:
272      m_conceal = true;
273      break;
300274
301         if (code & 0x80)
302            colour = (saa5050->forecol << 3) | saa5050->backcol;
303         else
304            colour = saa5050->forecol | (saa5050->backcol << 3);
275   case CONTIGUOUS_GFX:
276      m_separated = false;
277      break;
305278
306         if (saa5050->flags & SAA5050_CONCEAL)
307            code = 32;
308         else if ((saa5050->flags & SAA5050_FLASH) && (saa5050->frame_count > 38))
309            code = 32;
310         else
311         {
312            saa5050->prvchr = code;
313            if ((saa5050->flags & SAA5050_GRAPH) && (code & 0x20))
314            {
315               code += (code & 0x40) ? 64 : 96;
316               if (saa5050->flags & SAA5050_SEPGR)
317                  code += 64;
318            }
319         }
279   case SEPARATED_GFX:
280      m_separated = true;
281      break;
320282
321         if((blank == 0) || (saa5050->flags & SAA5050_HOLDGR))
322         {
323            if (saa5050->flags & SAA5050_DBLHI)
324            {
325               drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 1], code & 0x7f, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
326               drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 2], code & 0x7f, colour, 0, 0, sx * 12, (ssy + 1) * 20, 0x20000, 0x20000);
327            }
328            else
329            {
330               drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 0], code & 0x7f, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
331            }
332         }
333      }
283   case BLACK_BACKGROUND:
284      m_bg = 0;
285      break;
334286
335      if (dblhi)
336      {
337         sy++;
338      }
287   case NEW_BACKGROUND:
288      m_bg = m_fg;
289      break;
290
291   case HOLD_GRAPHICS:
292      m_hold = true;
293      break;
294
295   case RELEASE_GRAPHICS:
296      m_hold = false;
297      break;
339298   }
340299}
341300
342/*****************************************************************************
343    DEVICE INTERFACE
344*****************************************************************************/
345301
346static DEVICE_START( saa5050 )
302//-------------------------------------------------
303//  get_character_data -
304//-------------------------------------------------
305
306void saa5050_device::get_character_data(UINT8 data)
347307{
348   saa5050_state *saa5050 = get_safe_token(device);
349   const saa5050_interface *intf = get_interface(device);
308   if (m_graphics && (data & 0x20))
309   {
310      data += (data & 0x40) ? 64 : 96;
311      if (m_separated) data += 64;
312   }
350313
351   saa5050->screen = device->machine().device(intf->screen);
352   saa5050->gfxnum = intf->gfxnum;
353   saa5050->x = intf->x;
354   saa5050->y = intf->y;
355   saa5050->size = intf->size;
356   saa5050->rev = intf->rev;
314   if ((data < 0x20) && m_hold) data = m_last_code;
315   if (m_conceal) data = 0x20;
316   if (m_flash && (m_frame_count > 38)) data = 0x20;
317   if (m_double_height_bottom_row && !m_double_height) data = 0x20;
318   m_last_code = data;
357319
358   saa5050->videoram = auto_alloc_array(device->machine(), UINT8, 0x800);
320   offs_t ra = m_ra >> 1;
321   if (m_double_height) ra >>= 1;
322   if (m_double_height && m_double_height_bottom_row) ra += 5;
359323
360   device->save_pointer(NAME(saa5050->videoram), 0x800);
361   device->save_item(NAME(saa5050->flags));
362   device->save_item(NAME(saa5050->forecol));
363   device->save_item(NAME(saa5050->backcol));
364   device->save_item(NAME(saa5050->prvcol));
365   device->save_item(NAME(saa5050->prvchr));
366   device->save_item(NAME(saa5050->frame_count));
324   offs_t char_rom_addr = (data * 10) + ra;
325   m_char_data = m_char_rom[char_rom_addr];
367326}
368327
369static DEVICE_RESET( saa5050 )
328
329//-------------------------------------------------
330//  dew_w - data entry window
331//-------------------------------------------------
332
333WRITE_LINE_MEMBER( saa5050_device::dew_w )
370334{
371   saa5050_state *saa5050 = get_safe_token(device);
335   if (state)
336   {
337      m_ra = 19;
338      m_double_height_top_row = false;
339     
340      m_frame_count++;
341      if (m_frame_count > 50) m_frame_count = 0;
342   }
343}
372344
373   memset(saa5050->videoram, 0x00, 0x800);
374345
375   saa5050->flags = 0;
376   saa5050->forecol = SAA5050_WHITE;
377   saa5050->backcol = SAA5050_BLACK;
378   saa5050->prvcol = SAA5050_WHITE;
379   saa5050->prvchr = 32;
380   saa5050->frame_count = 0;
346//-------------------------------------------------
347//  lose_w - load output shift register enable
348//-------------------------------------------------
349
350WRITE_LINE_MEMBER( saa5050_device::lose_w )
351{
352   if (state)
353   {
354      m_ra++;
355      m_ra %= 20;
356
357      m_fg = 7;
358      m_bg = 0;
359      m_graphics = false;
360      m_separated = false;
361      m_conceal = false;
362      m_flash = false;
363      m_boxed = false;
364      m_hold = false;
365      m_double_height = 0;
366      m_bit = 5;
367      m_last_code = 0x20;
368
369      if (!m_ra)
370      {
371         m_double_height_bottom_row = m_double_height_top_row;
372         m_double_height_top_row = false;
373      }
374   }
381375}
382376
383377
384const device_type SAA5050 = &device_creator<saa5050_device>;
378//-------------------------------------------------
379//  write - character data write
380//-------------------------------------------------
385381
386saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
387   : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock)
382void saa5050_device::write(UINT8 data)
388383{
389   m_token = global_alloc_array_clear(UINT8, sizeof(saa5050_state));
384   m_code = data & 0x7f;
390385}
391386
387
392388//-------------------------------------------------
393//  device_config_complete - perform any
394//  operations now that the configuration is
395//  complete
389//  f1_w - character clock
396390//-------------------------------------------------
397391
398void saa5050_device::device_config_complete()
392WRITE_LINE_MEMBER( saa5050_device::f1_w )
399393{
394   if (state)
395   {
396      process_control_character(m_code);
397      get_character_data(m_code);
398   }
400399}
401400
401
402402//-------------------------------------------------
403//  device_start - device-specific startup
403//  tr6_w - pixel clock
404404//-------------------------------------------------
405405
406void saa5050_device::device_start()
406WRITE_LINE_MEMBER( saa5050_device::tr6_w )
407407{
408   DEVICE_START_NAME( saa5050 )(this);
408   if (state)
409   {
410      m_color = BIT(m_char_data, m_bit) ? m_fg : m_bg;
411
412      m_bit--;
413      if (m_bit < 0) m_bit = 5;
414   }
409415}
410416
417
411418//-------------------------------------------------
412//  device_reset - device-specific reset
419//  get_rgb - get output color
413420//-------------------------------------------------
414421
415void saa5050_device::device_reset()
422int saa5050_device::get_rgb()
416423{
417   DEVICE_RESET_NAME( saa5050 )(this);
424   return m_color;
418425}
419426
420427
428//-------------------------------------------------
429//  screen_update -
430//-------------------------------------------------
431
432UINT32 saa5050_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
433{
434   dew_w(1);
435   dew_w(0);
436
437   for (int y = 0; y < m_rows * 20; y++)
438   {
439      int sy = y / 20;
440      int x = 0;
441
442      lose_w(1);
443      lose_w(0);
444
445      int ssy = m_double_height_bottom_row ? sy - 1 : sy;
446      offs_t video_ram_addr = ssy * m_size;
447
448      for (int sx = 0; sx < m_cols; sx++)
449      {
450         UINT8 code = m_in_d_func(video_ram_addr++);
451
452         write(code & 0x7f);
453
454         f1_w(1);
455         f1_w(0);
456
457         for (int bit = 0; bit < 6; bit++)
458         {
459            tr6_w(1);
460            tr6_w(0);
461
462            int color = get_rgb();
463
464            if (BIT(code, 7)) color ^= 0x07;
465
466            int r = BIT(color, 0) * 0xff;
467            int g = BIT(color, 1) * 0xff;
468            int b = BIT(color, 2) * 0xff;
469
470            rgb_t rgb = MAKE_RGB(r, g, b);
471
472            bitmap.pix32(y, x++) = rgb;
473            bitmap.pix32(y, x++) = rgb;
474         }
475      }
476   }
477
478   return 0;
479}
trunk/src/emu/video/saa5050.h
r17889r17890
1/*****************************************************************************
2 *
3 * video/saa5050.h
4 *
5 * SAA5050
6 *
7 ****************************************************************************/
1/**********************************************************************
82
9#ifndef __SAA5050_H__
10#define __SAA5050_H__
3    Mullard SAA5050 Teletext Character Generator emulation
114
12#include "devlegcy.h"
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
137
14#define SAA5050_VBLANK 2500
8**********************************************************************
9                            _____   _____
10                   Vss   1 |*    \_/     | 28  DE
11                   _SI   2 |             | 27  PO
12                 _DATA   3 |             | 26  LOSE
13                    D1   4 |   SAA5050   | 25  BLAN
14                    D2   5 |   SAA5051   | 24  R
15                    D3   6 |   SAA5052   | 23  G
16                    D4   7 |   SAA5053   | 22  B
17                    D5   8 |   SAA5054   | 21  Y
18                    D6   9 |   SAA5055   | 20  F1
19                    D7  10 |   SAA5056   | 19  TR6
20                  DLIM  11 |   SAA5057   | 18  Vdd
21                  _GLR  12 |             | 17  N/C
22                   DEW  13 |             | 16  _TLC
23                   CRS  14 |_____________| 15  _BCS
1524
16/***************************************************************************
17    TYPE DEFINITIONS
18***************************************************************************/
25**********************************************************************/
1926
20typedef struct _saa5050_interface saa5050_interface;
21struct _saa5050_interface
27#pragma once
28
29#ifndef __SAA5050__
30#define __SAA5050__
31
32#include "emu.h"
33
34
35
36//**************************************************************************
37//  INTERFACE CONFIGURATION MACROS
38//**************************************************************************
39
40#define MCFG_SAA5050_ADD(_tag, _clock, _config) \
41   MCFG_DEVICE_ADD(_tag, SAA5050, _clock) \
42   MCFG_DEVICE_CONFIG(_config)
43
44#define MCFG_SAA5052_ADD(_tag, _clock, _config) \
45   MCFG_DEVICE_ADD(_tag, SAA5052, _clock) \
46   MCFG_DEVICE_CONFIG(_config)
47
48
49#define SAA5050_INTERFACE(name) \
50   const saa5050_interface (name) =
51
52
53
54//**************************************************************************
55//  TYPE DEFINITIONS
56//**************************************************************************
57
58// ======================> saa5050_interface
59
60struct saa5050_interface
2261{
23   const char *screen;
24   int gfxnum;
25   int x, y, size;
26   int rev;
62   devcb_read8 m_in_d_cb;
63
64   int m_cols;
65   int m_rows;
66   int m_size;
2767};
2868
29class saa5050_device : public device_t
69
70// ======================> saa5050_device
71
72class saa5050_device :   public device_t,
73                        public saa5050_interface
3074{
3175public:
32   saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~saa5050_device() { global_free(m_token); }
76    // construction/destruction
77    saa5050_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
78    saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3479
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
80   // optional information overrides
81   virtual const rom_entry *device_rom_region() const;
82
83   DECLARE_WRITE_LINE_MEMBER( dew_w );
84   DECLARE_WRITE_LINE_MEMBER( lose_w );
85   void write(UINT8 data);
86   DECLARE_WRITE_LINE_MEMBER( f1_w );
87   DECLARE_WRITE_LINE_MEMBER( tr6_w );
88   int get_rgb();
89
90   // NOTE: the following are provided for convenience only, SAA5050 is not a display controller
91   // this emulates the common setup where bit 7 of data inverts the display, and the
92   // bottom half of a double height row gets the same character data as the top half
93   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
94
3795protected:
38   // device-level overrides
96   enum
97   {
98      TYPE_5050,
99      TYPE_5052
100   };
101
102    // device-level overrides
39103   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_reset();
104    virtual void device_start();
105
42106private:
43   // internal state
44   void *m_token;
45};
107   void process_control_character(UINT8 data);
108   void get_character_data(UINT8 data);
46109
47extern const device_type SAA5050;
110   devcb_resolved_read8   m_in_d_func;
48111
112   const UINT8 *m_char_rom;
113   UINT8 m_code;
114   UINT8 m_last_code;
115   UINT8 m_char_data;
116   int m_bit;
117   rgb_t m_color;
118   int m_ra;
119   int m_bg;
120   int m_fg;
121   bool m_graphics;
122   bool m_separated;
123   bool m_conceal;
124   bool m_flash;
125   bool m_boxed;
126   int m_double_height;
127   bool m_double_height_top_row;
128   bool m_double_height_bottom_row;
129   bool m_hold;
130   int m_frame_count;
49131
50/***************************************************************************
51    DEVICE CONFIGURATION MACROS
52***************************************************************************/
132   int m_variant;
133};
53134
54#define MCFG_SAA5050_ADD(_tag, _interface) \
55   MCFG_DEVICE_ADD(_tag, SAA5050, 0) \
56   MCFG_DEVICE_CONFIG(_interface)
57135
136// ======================> saa5052_device
58137
59/***************************************************************************
60    DEVICE I/O FUNCTIONS
61***************************************************************************/
138class saa5052_device :  public saa5050_device
139{
140public:
141    // construction/destruction
142    saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
143};
62144
63void saa5050_update(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
64void saa5050_frame_advance(device_t *device);
65145
66GFXDECODE_EXTERN( saa5050 );
67PALETTE_INIT( saa5050 );
146// device type definition
147extern const device_type SAA5050;
148extern const device_type SAA5052;
68149
69WRITE8_DEVICE_HANDLER( saa5050_videoram_w );
70READ8_DEVICE_HANDLER( saa5050_videoram_r );
71150
72151
73#endif /* __SAA5050_H__ */
152#endif
trunk/src/mess/includes/p2000t.h
r17889r17890
1818public:
1919   p2000t_state(const machine_config &mconfig, device_type type, const char *tag)
2020      : driver_device(mconfig, type, tag),
21   m_maincpu(*this, "maincpu"),
22   m_speaker(*this, SPEAKER_TAG),
23   m_p_videoram(*this, "p_videoram"){ }
21        m_maincpu(*this, "maincpu"),
22        m_speaker(*this, SPEAKER_TAG),
23        m_videoram(*this, "videoram")
24   { }
2425
2526   required_device<cpu_device> m_maincpu;
2627   required_device<device_t> m_speaker;
r17889r17890
3334   DECLARE_WRITE8_MEMBER(p2000t_port_888b_w);
3435   DECLARE_WRITE8_MEMBER(p2000t_port_8c90_w);
3536   DECLARE_WRITE8_MEMBER(p2000t_port_9494_w);
36   optional_shared_ptr<UINT8> m_p_videoram;
37   DECLARE_READ8_MEMBER(videoram_r);
38   required_shared_ptr<UINT8> m_videoram;
3739   UINT8 m_port_101f;
3840   UINT8 m_port_202f;
3941   UINT8 m_port_303f;
trunk/src/mess/includes/abc80x.h
r17889r17890
187187        m_trom(*this, SAA5052_TAG)
188188   { }
189189
190   required_device<saa5050_device> m_trom;
190   required_device<saa5052_device> m_trom;
191191
192192   DECLARE_DRIVER_INIT(driver_init);
193193
194   virtual void video_start();
195   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
194   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
196195
197196   offs_t translate_trom_offset(offs_t offset);
198   void hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
197   void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
199198
200199   DECLARE_READ8_MEMBER( char_ram_r );
201   DECLARE_WRITE8_MEMBER( char_ram_w );
202200   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
203201};
204202
trunk/src/mess/includes/bbc.h
r17889r17890
1717#include "machine/wd17xx.h"
1818#include "machine/upd7002.h"
1919#include "video/mc6845.h"
20#include "video/saa5050.h"
2021#include "sound/sn76496.h"
2122
2223class bbc_state : public driver_device
r17889r17890
2627      : driver_device(mconfig, type, tag),
2728        m_maincpu(*this, "maincpu"),
2829        m_sn(*this, "sn76489"),
30        m_trom(*this, "saa505x"),
2931        m_ACCCON_IRR(CLEAR_LINE),
3032        m_via_system_irq(CLEAR_LINE),
3133        m_via_user_irq(CLEAR_LINE),
r17889r17890
3436
3537   required_device<cpu_device> m_maincpu;
3638   optional_device<sn76489_new_device> m_sn;
39   required_device<saa5050_device> m_trom;
3740
3841   void check_interrupts();
3942
r17889r17890
193196   unsigned char m_pixel_bits[256];
194197   int m_BBC_HSync;
195198   int m_BBC_VSync;
196   device_t *m_saa505x;
197199
198200
199201
r17889r17890
336338
337339SCREEN_UPDATE_IND16( bbc );
338340
339void bbc_draw_RGB_in(device_t *device, int offset, int data);
340341void bbc_set_video_memory_lookups(running_machine &machine, int ramsize);
341342void bbc_setscreenstart(running_machine &machine, int b4, int b5);
342343void bbcbp_setvideoshadow(running_machine &machine, int vdusel);
trunk/src/mess/video/saa505x.c
r17889r17890
1/************************************************************************
2SAA505X Teletext
3
4Variant     Character set
55050        English
65051        German
75052        Swedish
85053        Italian
95054        Belgian
105055        US ASCII
115056        Hebrew
125057        Cyrillic
13
14Pins
151   Vss             ground
1618  Vdd             positive supply
1717  NC              not connected
18
19Data In
20--------
214-10    D1 to D7    in      character data inputs
22
2316  ~TLC        out     transmitted large character
24
25Colour Our
26----------
2721  Y       out     monochrome video output
2822  Blue        out     blue video output
2923  Green       out     green video output
3024  Red     out     red video output
3125  BLAN        out     blanking output
32
33Display Control
34---------------
3527  PO      in      picture on in[ut
3628  DE      in      display enable input
37
38Remote Control Data Decoder and Store
39-------------------------------------
402   ~SI         in/out      superimposer
413   ~DATA       in      remote control data
4211  DLIM        in      remote control data clock
4312  ~GLR        in      general line reset
44
45Timing Generator/Flash Counter
46------------------------------
4713  DEW     in      data entry window
4819  TR6     in      6MHz input
4920  F1      in      1MHz input
5026  LOSE        in      load output shift register enable
51
52Character Rounding
53------------------
5414  CRS     in      character rounding select
5515  ~BCS        in      big character select
56
57
58
59
60Characters are output every 1us with a pixel dot rate of 6MHz.
61Each character is 6 x 10 pixels
62
63This device was designed to work over the top of a Television picture,
64so the BLAN blanking output is used to blank out the television signal under control
65of the PO and DE inputs and the box control characters.
66
6713 DEW Data Entry Window
68------------------------
69This input signal resets the internal ROM row address counter prior to the desplay peroid.
70It is also used internally to derive the 'flash' period.
71
7220 F1
73-----
74This input is a 1MHz equal mark/space ration signal. It is used to latch the 7-bit parallel character data into the input latches.
75
7626 LOSE Load output shift register enable
77-----------------------------------------
78This input resets the internal control character flip-flops prior to the start of each display line.
79This signal also defails the character display period.
80
81
82*/
83
84#include "emu.h"
85#include "saa505x.h"
86
87
88/* Normal Character Set */
89
90static const char teletext_saa5050_characters[96*60]={
91  // 0x20 ' '
92  0,0,0,0,0,0,
93  0,0,0,0,0,0,
94  0,0,0,0,0,0,
95  0,0,0,0,0,0,
96  0,0,0,0,0,0,
97  0,0,0,0,0,0,
98  0,0,0,0,0,0,
99  0,0,0,0,0,0,
100  0,0,0,0,0,0,
101  0,0,0,0,0,0
102, // 0x21 '!'
103  0,0,0,0,0,0,
104  0,0,0,1,0,0,
105  0,0,0,1,0,0,
106  0,0,0,1,0,0,
107  0,0,0,1,0,0,
108  0,0,0,1,0,0,
109  0,0,0,0,0,0,
110  0,0,0,1,0,0,
111  0,0,0,0,0,0,
112  0,0,0,0,0,0
113, // 0x22 '"'
114  0,0,0,0,0,0,
115  0,0,1,0,1,0,
116  0,0,1,0,1,0,
117  0,0,1,0,1,0,
118  0,0,0,0,0,0,
119  0,0,0,0,0,0,
120  0,0,0,0,0,0,
121  0,0,0,0,0,0,
122  0,0,0,0,0,0,
123  0,0,0,0,0,0
124, // 0x23 ' British Pound'
125  0,0,0,0,0,0,
126  0,0,0,1,1,0,
127  0,0,1,0,0,1,
128  0,0,1,0,0,0,
129  0,1,1,1,0,0,
130  0,0,1,0,0,0,
131  0,0,1,0,0,0,
132  0,1,1,1,1,1,
133  0,0,0,0,0,0,
134  0,0,0,0,0,0
135, // 0x24 '$'
136  0,0,0,0,0,0,
137  0,0,1,1,1,0,
138  0,1,0,1,0,1,
139  0,1,0,1,0,0,
140  0,0,1,1,1,0,
141  0,0,0,1,0,1,
142  0,1,0,1,0,1,
143  0,0,1,1,1,0,
144  0,0,0,0,0,0,
145  0,0,0,0,0,0
146, // 0x25 '%'
147  0,0,0,0,0,0,
148  0,1,1,0,0,0,
149  0,1,1,0,0,1,
150  0,0,0,0,1,0,
151  0,0,0,1,0,0,
152  0,0,1,0,0,0,
153  0,1,0,0,1,1,
154  0,0,0,0,1,1,
155  0,0,0,0,0,0,
156  0,0,0,0,0,0
157, // 0x26 '&'
158  0,0,0,0,0,0,
159  0,0,1,0,0,0,
160  0,1,0,1,0,0,
161  0,1,0,1,0,0,
162  0,0,1,0,0,0,
163  0,1,0,1,0,1,
164  0,1,0,0,1,0,
165  0,0,1,1,0,1,
166  0,0,0,0,0,0,
167  0,0,0,0,0,0
168, // 0x27 '''
169  0,0,0,0,0,0,
170  0,0,0,1,0,0,
171  0,0,0,1,0,0,
172  0,0,0,1,0,0,
173  0,0,0,0,0,0,
174  0,0,0,0,0,0,
175  0,0,0,0,0,0,
176  0,0,0,0,0,0,
177  0,0,0,0,0,0,
178  0,0,0,0,0,0
179, // 0x28 '('
180  0,0,0,0,0,0,
181  0,0,0,0,1,0,
182  0,0,0,1,0,0,
183  0,0,1,0,0,0,
184  0,0,1,0,0,0,
185  0,0,1,0,0,0,
186  0,0,0,1,0,0,
187  0,0,0,0,1,0,
188  0,0,0,0,0,0,
189  0,0,0,0,0,0
190, // 0x29 ')'
191  0,0,0,0,0,0,
192  0,0,1,0,0,0,
193  0,0,0,1,0,0,
194  0,0,0,0,1,0,
195  0,0,0,0,1,0,
196  0,0,0,0,1,0,
197  0,0,0,1,0,0,
198  0,0,1,0,0,0,
199  0,0,0,0,0,0,
200  0,0,0,0,0,0
201, // 0x2a '*'
202  0,0,0,0,0,0,
203  0,0,0,1,0,0,
204  0,1,0,1,0,1,
205  0,0,1,1,1,0,
206  0,0,0,1,0,0,
207  0,0,1,1,1,0,
208  0,1,0,1,0,1,
209  0,0,0,1,0,0,
210  0,0,0,0,0,0,
211  0,0,0,0,0,0
212, // 0x2b '+'
213  0,0,0,0,0,0,
214  0,0,0,0,0,0,
215  0,0,0,1,0,0,
216  0,0,0,1,0,0,
217  0,1,1,1,1,1,
218  0,0,0,1,0,0,
219  0,0,0,1,0,0,
220  0,0,0,0,0,0,
221  0,0,0,0,0,0,
222  0,0,0,0,0,0
223, // 0x2c ','
224  0,0,0,0,0,0,
225  0,0,0,0,0,0,
226  0,0,0,0,0,0,
227  0,0,0,0,0,0,
228  0,0,0,0,0,0,
229  0,0,0,1,0,0,
230  0,0,0,1,0,0,
231  0,0,1,0,0,0,
232  0,0,0,0,0,0,
233  0,0,0,0,0,0
234, // 0x2d '-'
235  0,0,0,0,0,0,
236  0,0,0,0,0,0,
237  0,0,0,0,0,0,
238  0,0,1,1,1,0,
239  0,0,0,0,0,0,
240  0,0,0,0,0,0,
241  0,0,0,0,0,0,
242  0,0,0,0,0,0,
243  0,0,0,0,0,0,
244  0,0,0,0,0,0
245, // 0x2e '.'
246  0,0,0,0,0,0,
247  0,0,0,0,0,0,
248  0,0,0,0,0,0,
249  0,0,0,0,0,0,
250  0,0,0,0,0,0,
251  0,0,0,0,0,0,
252  0,0,0,0,0,0,
253  0,0,0,1,0,0,
254  0,0,0,0,0,0,
255  0,0,0,0,0,0
256, // 0x2f '/'
257  0,0,0,0,0,0,
258  0,0,0,0,0,0,
259  0,0,0,0,0,1,
260  0,0,0,0,1,0,
261  0,0,0,1,0,0,
262  0,0,1,0,0,0,
263  0,1,0,0,0,0,
264  0,0,0,0,0,0,
265  0,0,0,0,0,0,
266  0,0,0,0,0,0
267, // 0x30 '0'
268  0,0,0,0,0,0,
269  0,0,0,1,0,0,
270  0,0,1,0,1,0,
271  0,1,0,0,0,1,
272  0,1,0,0,0,1,
273  0,1,0,0,0,1,
274  0,0,1,0,1,0,
275  0,0,0,1,0,0,
276  0,0,0,0,0,0,
277  0,0,0,0,0,0
278, // 0x31 '1'
279  0,0,0,0,0,0,
280  0,0,0,1,0,0,
281  0,0,1,1,0,0,
282  0,0,0,1,0,0,
283  0,0,0,1,0,0,
284  0,0,0,1,0,0,
285  0,0,0,1,0,0,
286  0,0,1,1,1,0,
287  0,0,0,0,0,0,
288  0,0,0,0,0,0
289, // 0x32 '2'
290  0,0,0,0,0,0,
291  0,0,1,1,1,0,
292  0,1,0,0,0,1,
293  0,0,0,0,0,1,
294  0,0,0,1,1,0,
295  0,0,1,0,0,0,
296  0,1,0,0,0,0,
297  0,1,1,1,1,1,
298  0,0,0,0,0,0,
299  0,0,0,0,0,0
300, // 0x33 '3'
301  0,0,0,0,0,0,
302  0,1,1,1,1,1,
303  0,0,0,0,0,1,
304  0,0,0,0,1,0,
305  0,0,0,1,1,0,
306  0,0,0,0,0,1,
307  0,1,0,0,0,1,
308  0,0,1,1,1,0,
309  0,0,0,0,0,0,
310  0,0,0,0,0,0
311, // 0x34 '4'
312  0,0,0,0,0,0,
313  0,0,0,0,1,0,
314  0,0,0,1,1,0,
315  0,0,1,0,1,0,
316  0,1,0,0,1,0,
317  0,1,1,1,1,1,
318  0,0,0,0,1,0,
319  0,0,0,0,1,0,
320  0,0,0,0,0,0,
321  0,0,0,0,0,0
322, // 0x35 '5'
323  0,0,0,0,0,0,
324  0,1,1,1,1,1,
325  0,1,0,0,0,0,
326  0,1,1,1,1,0,
327  0,0,0,0,0,1,
328  0,0,0,0,0,1,
329  0,1,0,0,0,1,
330  0,0,1,1,1,0,
331  0,0,0,0,0,0,
332  0,0,0,0,0,0
333, // 0x36 '6'
334  0,0,0,0,0,0,
335  0,0,0,1,1,0,
336  0,0,1,0,0,0,
337  0,1,0,0,0,0,
338  0,1,1,1,1,0,
339  0,1,0,0,0,1,
340  0,1,0,0,0,1,
341  0,0,1,1,1,0,
342  0,0,0,0,0,0,
343  0,0,0,0,0,0
344, // 0x37 '7'
345  0,0,0,0,0,0,
346  0,1,1,1,1,1,
347  0,0,0,0,0,1,
348  0,0,0,0,1,0,
349  0,0,0,1,0,0,
350  0,0,1,0,0,0,
351  0,0,1,0,0,0,
352  0,0,1,0,0,0,
353  0,0,0,0,0,0,
354  0,0,0,0,0,0
355, // 0x38 '8'
356  0,0,0,0,0,0,
357  0,0,1,1,1,0,
358  0,1,0,0,0,1,
359  0,1,0,0,0,1,
360  0,0,1,1,1,0,
361  0,1,0,0,0,1,
362  0,1,0,0,0,1,
363  0,0,1,1,1,0,
364  0,0,0,0,0,0,
365  0,0,0,0,0,0
366, // 0x39 '9'
367  0,0,0,0,0,0,
368  0,0,1,1,1,0,
369  0,1,0,0,0,1,
370  0,1,0,0,0,1,
371  0,0,1,1,1,1,
372  0,0,0,0,0,1,
373  0,0,0,0,1,0,
374  0,0,1,1,0,0,
375  0,0,0,0,0,0,
376  0,0,0,0,0,0
377, // 0x3a ':'
378  0,0,0,0,0,0,
379  0,0,0,0,0,0,
380  0,0,0,0,0,0,
381  0,0,0,1,0,0,
382  0,0,0,0,0,0,
383  0,0,0,0,0,0,
384  0,0,0,1,0,0,
385  0,0,0,0,0,0,
386  0,0,0,0,0,0,
387  0,0,0,0,0,0
388, // 0x3b ';'
389  0,0,0,0,0,0,
390  0,0,0,0,0,0,
391  0,0,0,0,0,0,
392  0,0,0,1,0,0,
393  0,0,0,0,0,0,
394  0,0,0,1,0,0,
395  0,0,0,1,0,0,
396  0,0,1,0,0,0,
397  0,0,0,0,0,0,
398  0,0,0,0,0,0
399, // 0x3c '<'
400  0,0,0,0,0,0,
401  0,0,0,0,1,0,
402  0,0,0,1,0,0,
403  0,0,1,0,0,0,
404  0,1,0,0,0,0,
405  0,0,1,0,0,0,
406  0,0,0,1,0,0,
407  0,0,0,0,1,0,
408  0,0,0,0,0,0,
409  0,0,0,0,0,0
410, // 0x3d '='
411  0,0,0,0,0,0,
412  0,0,0,0,0,0,
413  0,0,0,0,0,0,
414  0,1,1,1,1,1,
415  0,0,0,0,0,0,
416  0,1,1,1,1,1,
417  0,0,0,0,0,0,
418  0,0,0,0,0,0,
419  0,0,0,0,0,0,
420  0,0,0,0,0,0
421, // 0x3e '>'
422  0,0,0,0,0,0,
423  0,0,1,0,0,0,
424  0,0,0,1,0,0,
425  0,0,0,0,1,0,
426  0,0,0,0,0,1,
427  0,0,0,0,1,0,
428  0,0,0,1,0,0,
429  0,0,1,0,0,0,
430  0,0,0,0,0,0,
431  0,0,0,0,0,0
432, // 0x3f '?'
433  0,0,0,0,0,0,
434  0,0,1,1,1,0,
435  0,1,0,0,0,1,
436  0,0,0,0,1,0,
437  0,0,0,1,0,0,
438  0,0,0,1,0,0,
439  0,0,0,0,0,0,
440  0,0,0,1,0,0,
441  0,0,0,0,0,0,
442  0,0,0,0,0,0
443, // 0x40 '@'
444  0,0,0,0,0,0,
445  0,0,1,1,1,0,
446  0,1,0,0,0,1,
447  0,1,0,1,1,1,
448  0,1,0,1,0,1,
449  0,1,0,1,1,1,
450  0,1,0,0,0,0,
451  0,0,1,1,1,1,
452  0,0,0,0,0,0,
453  0,0,0,0,0,0
454, // 0x41 'A'
455  0,0,0,0,0,0,
456  0,0,0,1,0,0,
457  0,0,1,0,1,0,
458  0,1,0,0,0,1,
459  0,1,0,0,0,1,
460  0,1,1,1,1,1,
461  0,1,0,0,0,1,
462  0,1,0,0,0,1,
463  0,0,0,0,0,0,
464  0,0,0,0,0,0
465, // 0x42 'B'
466  0,0,0,0,0,0,
467  0,1,1,1,1,0,
468  0,1,0,0,0,1,
469  0,1,0,0,0,1,
470  0,1,1,1,1,0,
471  0,1,0,0,0,1,
472  0,1,0,0,0,1,
473  0,1,1,1,1,0,
474  0,0,0,0,0,0,
475  0,0,0,0,0,0
476, // 0x43 'C'
477  0,0,0,0,0,0,
478  0,0,1,1,1,0,
479  0,1,0,0,0,1,
480  0,1,0,0,0,0,
481  0,1,0,0,0,0,
482  0,1,0,0,0,0,
483  0,1,0,0,0,1,
484  0,0,1,1,1,0,
485  0,0,0,0,0,0,
486  0,0,0,0,0,0
487, // 0x44 'D'
488  0,0,0,0,0,0,
489  0,1,1,1,1,0,
490  0,1,0,0,0,1,
491  0,1,0,0,0,1,
492  0,1,0,0,0,1,
493  0,1,0,0,0,1,
494  0,1,0,0,0,1,
495  0,1,1,1,1,0,
496  0,0,0,0,0,0,
497  0,0,0,0,0,0
498, // 0x45 'E'
499  0,0,0,0,0,0,
500  0,1,1,1,1,1,
501  0,1,0,0,0,0,
502  0,1,0,0,0,0,
503  0,1,1,1,1,0,
504  0,1,0,0,0,0,
505  0,1,0,0,0,0,
506  0,1,1,1,1,1,
507  0,0,0,0,0,0,
508  0,0,0,0,0,0
509, // 0x46 'F'
510  0,0,0,0,0,0,
511  0,1,1,1,1,1,
512  0,1,0,0,0,0,
513  0,1,0,0,0,0,
514  0,1,1,1,1,0,
515  0,1,0,0,0,0,
516  0,1,0,0,0,0,
517  0,1,0,0,0,0,
518  0,0,0,0,0,0,
519  0,0,0,0,0,0
520, // 0x47 'G'
521  0,0,0,0,0,0,
522  0,0,1,1,1,0,
523  0,1,0,0,0,1,
524  0,1,0,0,0,0,
525  0,1,0,0,0,0,
526  0,1,0,0,1,1,
527  0,1,0,0,0,1,
528  0,0,1,1,1,1,
529  0,0,0,0,0,0,
530  0,0,0,0,0,0
531, // 0x48 'H'
532  0,0,0,0,0,0,
533  0,1,0,0,0,1,
534  0,1,0,0,0,1,
535  0,1,0,0,0,1,
536  0,1,1,1,1,1,
537  0,1,0,0,0,1,
538  0,1,0,0,0,1,
539  0,1,0,0,0,1,
540  0,0,0,0,0,0,
541  0,0,0,0,0,0
542, // 0x49 'I'
543  0,0,0,0,0,0,
544  0,0,1,1,1,0,
545  0,0,0,1,0,0,
546  0,0,0,1,0,0,
547  0,0,0,1,0,0,
548  0,0,0,1,0,0,
549  0,0,0,1,0,0,
550  0,0,1,1,1,0,
551  0,0,0,0,0,0,
552  0,0,0,0,0,0
553, // 0x4a 'J'
554  0,0,0,0,0,0,
555  0,0,0,0,0,1,
556  0,0,0,0,0,1,
557  0,0,0,0,0,1,
558  0,0,0,0,0,1,
559  0,0,0,0,0,1,
560  0,1,0,0,0,1,
561  0,0,1,1,1,0,
562  0,0,0,0,0,0,
563  0,0,0,0,0,0
564, // 0x4b 'K'
565  0,0,0,0,0,0,
566  0,1,0,0,0,1,
567  0,1,0,0,1,0,
568  0,1,0,1,0,0,
569  0,1,1,0,0,0,
570  0,1,0,1,0,0,
571  0,1,0,0,1,0,
572  0,1,0,0,0,1,
573  0,0,0,0,0,0,
574  0,0,0,0,0,0
575, // 0x4c 'L'
576  0,0,0,0,0,0,
577  0,1,0,0,0,0,
578  0,1,0,0,0,0,
579  0,1,0,0,0,0,
580  0,1,0,0,0,0,
581  0,1,0,0,0,0,
582  0,1,0,0,0,0,
583  0,1,1,1,1,1,
584  0,0,0,0,0,0,
585  0,0,0,0,0,0
586, // 0x4d 'M'
587  0,0,0,0,0,0,
588  0,1,0,0,0,1,
589  0,1,1,0,1,1,
590  0,1,0,1,0,1,
591  0,1,0,0,0,1,
592  0,1,0,0,0,1,
593  0,1,0,0,0,1,
594  0,1,0,0,0,1,
595  0,0,0,0,0,0,
596  0,0,0,0,0,0
597, // 0x4e 'N'
598  0,0,0,0,0,0,
599  0,1,0,0,0,1,
600  0,1,0,0,0,1,
601  0,1,1,0,0,1,
602  0,1,0,1,0,1,
603  0,1,0,0,1,1,
604  0,1,0,0,0,1,
605  0,1,0,0,0,1,
606  0,0,0,0,0,0,
607  0,0,0,0,0,0
608, // 0x4f 'O'
609  0,0,0,0,0,0,
610  0,0,1,1,1,0,
611  0,1,0,0,0,1,
612  0,1,0,0,0,1,
613  0,1,0,0,0,1,
614  0,1,0,0,0,1,
615  0,1,0,0,0,1,
616  0,0,1,1,1,0,
617  0,0,0,0,0,0,
618  0,0,0,0,0,0
619, // 0x50 'P'
620  0,0,0,0,0,0,
621  0,1,1,1,1,0,
622  0,1,0,0,0,1,
623  0,1,0,0,0,1,
624  0,1,1,1,1,0,
625  0,1,0,0,0,0,
626  0,1,0,0,0,0,
627  0,1,0,0,0,0,
628  0,0,0,0,0,0,
629  0,0,0,0,0,0
630, // 0x51 'Q'
631  0,0,0,0,0,0,
632  0,0,1,1,1,0,
633  0,1,0,0,0,1,
634  0,1,0,0,0,1,
635  0,1,0,0,0,1,
636  0,1,0,1,0,1,
637  0,1,0,0,1,0,
638  0,0,1,1,0,1,
639  0,0,0,0,0,0,
640  0,0,0,0,0,0
641, // 0x52 'R'
642  0,0,0,0,0,0,
643  0,1,1,1,1,0,
644  0,1,0,0,0,1,
645  0,1,0,0,0,1,
646  0,1,1,1,1,0,
647  0,1,0,1,0,0,
648  0,1,0,0,1,0,
649  0,1,0,0,0,1,
650  0,0,0,0,0,0,
651  0,0,0,0,0,0
652, // 0x53 'S'
653  0,0,0,0,0,0,
654  0,0,1,1,1,0,
655  0,1,0,0,0,1,
656  0,1,0,0,0,0,
657  0,0,1,1,1,0,
658  0,0,0,0,0,1,
659  0,1,0,0,0,1,
660  0,0,1,1,1,0,
661  0,0,0,0,0,0,
662  0,0,0,0,0,0
663, // 0x54 'T'
664  0,0,0,0,0,0,
665  0,1,1,1,1,1,
666  0,0,0,1,0,0,
667  0,0,0,1,0,0,
668  0,0,0,1,0,0,
669  0,0,0,1,0,0,
670  0,0,0,1,0,0,
671  0,0,0,1,0,0,
672  0,0,0,0,0,0,
673  0,0,0,0,0,0
674, // 0x55 'U'
675  0,0,0,0,0,0,
676  0,1,0,0,0,1,
677  0,1,0,0,0,1,
678  0,1,0,0,0,1,
679  0,1,0,0,0,1,
680  0,1,0,0,0,1,
681  0,1,0,0,0,1,
682  0,0,1,1,1,0,
683  0,0,0,0,0,0,
684  0,0,0,0,0,0
685, // 0x56 'V'
686  0,0,0,0,0,0,
687  0,1,0,0,0,1,
688  0,1,0,0,0,1,
689  0,1,0,0,0,1,
690  0,0,1,0,1,0,
691  0,0,1,0,1,0,
692  0,0,0,1,0,0,
693  0,0,0,1,0,0,
694  0,0,0,0,0,0,
695  0,0,0,0,0,0
696, // 0x57 'W'
697  0,0,0,0,0,0,
698  0,1,0,0,0,1,
699  0,1,0,0,0,1,
700  0,1,0,0,0,1,
701  0,1,0,1,0,1,
702  0,1,0,1,0,1,
703  0,1,0,1,0,1,
704  0,0,1,0,1,0,
705  0,0,0,0,0,0,
706  0,0,0,0,0,0
707, // 0x58 'X'
708  0,0,0,0,0,0,
709  0,1,0,0,0,1,
710  0,1,0,0,0,1,
711  0,0,1,0,1,0,
712  0,0,0,1,0,0,
713  0,0,1,0,1,0,
714  0,1,0,0,0,1,
715  0,1,0,0,0,1,
716  0,0,0,0,0,0,
717  0,0,0,0,0,0
718, // 0x59 'Y'
719  0,0,0,0,0,0,
720  0,1,0,0,0,1,
721  0,1,0,0,0,1,
722  0,0,1,0,1,0,
723  0,0,0,1,0,0,
724  0,0,0,1,0,0,
725  0,0,0,1,0,0,
726  0,0,0,1,0,0,
727  0,0,0,0,0,0,
728  0,0,0,0,0,0
729, // 0x5a 'Z'
730  0,0,0,0,0,0,
731  0,1,1,1,1,1,
732  0,0,0,0,0,1,
733  0,0,0,0,1,0,
734  0,0,0,1,0,0,
735  0,0,1,0,0,0,
736  0,1,0,0,0,0,
737  0,1,1,1,1,1,
738  0,0,0,0,0,0,
739  0,0,0,0,0,0
740, // 0x5b Left Arrow
741  0,0,0,0,0,0,
742  0,0,0,0,0,0,
743  0,0,0,1,0,0,
744  0,0,1,0,0,0,
745  0,1,1,1,1,1,
746  0,0,1,0,0,0,
747  0,0,0,1,0,0,
748  0,0,0,0,0,0,
749  0,0,0,0,0,0,
750  0,0,0,0,0,0
751, // 0x5c ' 1/2 symbol'
752  0,0,0,0,0,0,
753  0,1,0,0,0,0,
754  0,1,0,0,0,0,
755  0,1,0,0,0,0,
756  0,1,0,1,1,0,
757  0,0,0,0,0,1,
758  0,0,0,0,1,0,
759  0,0,0,1,0,0,
760  0,0,0,1,1,1,
761  0,0,0,0,0,0
762, // 0x5d Right Arrow
763  0,0,0,0,0,0,
764  0,0,0,0,0,0,
765  0,0,0,1,0,0,
766  0,0,0,0,1,0,
767  0,1,1,1,1,1,
768  0,0,0,0,1,0,
769  0,0,0,1,0,0,
770  0,0,0,0,0,0,
771  0,0,0,0,0,0,
772  0,0,0,0,0,0
773, // 0x5e Up Arrow
774  0,0,0,0,0,0,
775  0,0,0,0,0,0,
776  0,0,0,1,0,0,
777  0,0,1,1,1,0,
778  0,1,0,1,0,1,
779  0,0,0,1,0,0,
780  0,0,0,1,0,0,
781  0,0,0,0,0,0,
782  0,0,0,0,0,0,
783  0,0,0,0,0,0
784, // 0x5f '#'
785  0,0,0,0,0,0,
786  0,0,1,0,1,0,
787  0,0,1,0,1,0,
788  0,1,1,1,1,1,
789  0,0,1,0,1,0,
790  0,1,1,1,1,1,
791  0,0,1,0,1,0,
792  0,0,1,0,1,0,
793  0,0,0,0,0,0,
794  0,0,0,0,0,0
795, // 0x60 '_'
796  0,0,0,0,0,0,
797  0,0,0,0,0,0,
798  0,0,0,0,0,0,
799  0,0,0,0,0,0,
800  0,0,0,0,0,0,
801  0,1,1,1,1,1,
802  0,0,0,0,0,0,
803  0,0,0,0,0,0,
804  0,0,0,0,0,0,
805  0,0,0,0,0,0
806, // 0x61 'a'
807  0,0,0,0,0,0,
808  0,0,0,0,0,0,
809  0,0,0,0,0,0,
810  0,0,1,1,1,0,
811  0,0,0,0,0,1,
812  0,0,1,1,1,1,
813  0,1,0,0,0,1,
814  0,0,1,1,1,1,
815  0,0,0,0,0,0,
816  0,0,0,0,0,0
817, // 0x62 'b'
818  0,0,0,0,0,0,
819  0,1,0,0,0,0,
820  0,1,0,0,0,0,
821  0,1,1,1,1,0,
822  0,1,0,0,0,1,
823  0,1,0,0,0,1,
824  0,1,0,0,0,1,
825  0,1,1,1,1,0,
826  0,0,0,0,0,0,
827  0,0,0,0,0,0
828, // 0x63 'c'
829  0,0,0,0,0,0,
830  0,0,0,0,0,0,
831  0,0,0,0,0,0,
832  0,0,1,1,1,1,
833  0,1,0,0,0,0,
834  0,1,0,0,0,0,
835  0,1,0,0,0,0,
836  0,0,1,1,1,1,
837  0,0,0,0,0,0,
838  0,0,0,0,0,0
839, // 0x64 'd'
840  0,0,0,0,0,0,
841  0,0,0,0,0,1,
842  0,0,0,0,0,1,
843  0,0,1,1,1,1,
844  0,1,0,0,0,1,
845  0,1,0,0,0,1,
846  0,1,0,0,0,1,
847  0,0,1,1,1,1,
848  0,0,0,0,0,0,
849  0,0,0,0,0,0
850, // 0x65 'e'
851  0,0,0,0,0,0,
852  0,0,0,0,0,0,
853  0,0,0,0,0,0,
854  0,0,1,1,1,0,
855  0,1,0,0,0,1,
856  0,1,1,1,1,1,
857  0,1,0,0,0,0,
858  0,0,1,1,1,0,
859  0,0,0,0,0,0,
860  0,0,0,0,0,0
861, // 0x66 'f'
862  0,0,0,0,0,0,
863  0,0,0,0,1,0,
864  0,0,0,1,0,0,
865  0,0,0,1,0,0,
866  0,0,1,1,1,0,
867  0,0,0,1,0,0,
868  0,0,0,1,0,0,
869  0,0,0,1,0,0,
870  0,0,0,0,0,0,
871  0,0,0,0,0,0
872, // 0x67 'g'
873  0,0,0,0,0,0,
874  0,0,0,0,0,0,
875  0,0,0,0,0,0,
876  0,0,1,1,1,1,
877  0,1,0,0,0,1,
878  0,1,0,0,0,1,
879  0,1,0,0,0,1,
880  0,0,1,1,1,1,
881  0,0,0,0,0,1,
882  0,0,1,1,1,0
883, // 0x68 'h'
884  0,0,0,0,0,0,
885  0,1,0,0,0,0,
886  0,1,0,0,0,0,
887  0,1,1,1,1,0,
888  0,1,0,0,0,1,
889  0,1,0,0,0,1,
890  0,1,0,0,0,1,
891  0,1,0,0,0,1,
892  0,0,0,0,0,0,
893  0,0,0,0,0,0
894, // 0x69 'i'
895  0,0,0,0,0,0,
896  0,0,0,1,0,0,
897  0,0,0,0,0,0,
898  0,0,1,1,0,0,
899  0,0,0,1,0,0,
900  0,0,0,1,0,0,
901  0,0,0,1,0,0,
902  0,0,1,1,1,0,
903  0,0,0,0,0,0,
904  0,0,0,0,0,0
905, // 0x6a 'j'
906  0,0,0,0,0,0,
907  0,0,0,1,0,0,
908  0,0,0,0,0,0,
909  0,0,0,1,0,0,
910  0,0,0,1,0,0,
911  0,0,0,1,0,0,
912  0,0,0,1,0,0,
913  0,0,0,1,0,0,
914  0,0,1,0,0,0,
915  0,0,0,0,0,0
916, // 0x6b 'k'
917  0,0,0,0,0,0,
918  0,0,1,0,0,0,
919  0,0,1,0,0,0,
920  0,0,1,0,0,1,
921  0,0,1,0,1,0,
922  0,0,1,1,0,0,
923  0,0,1,0,1,0,
924  0,0,1,0,0,1,
925  0,0,0,0,0,0,
926  0,0,0,0,0,0
927, // 0x6c 'l'
928  0,0,0,0,0,0,
929  0,0,1,1,0,0,
930  0,0,0,1,0,0,
931  0,0,0,1,0,0,
932  0,0,0,1,0,0,
933  0,0,0,1,0,0,
934  0,0,0,1,0,0,
935  0,0,1,1,1,0,
936  0,0,0,0,0,0,
937  0,0,0,0,0,0
938, // 0x6d 'm'
939  0,0,0,0,0,0,
940  0,0,0,0,0,0,
941  0,0,0,0,0,0,
942  0,1,1,0,1,0,
943  0,1,0,1,0,1,
944  0,1,0,1,0,1,
945  0,1,0,1,0,1,
946  0,1,0,1,0,1,
947  0,0,0,0,0,0,
948  0,0,0,0,0,0
949, // 0x6e 'n'
950  0,0,0,0,0,0,
951  0,0,0,0,0,0,
952  0,0,0,0,0,0,
953  0,1,1,1,1,0,
954  0,1,0,0,0,1,
955  0,1,0,0,0,1,
956  0,1,0,0,0,1,
957  0,1,0,0,0,1,
958  0,0,0,0,0,0,
959  0,0,0,0,0,0
960, // 0x6f 'o'
961  0,0,0,0,0,0,
962  0,0,0,0,0,0,
963  0,0,0,0,0,0,
964  0,0,1,1,1,0,
965  0,1,0,0,0,1,
966  0,1,0,0,0,1,
967  0,1,0,0,0,1,
968  0,0,1,1,1,0,
969  0,0,0,0,0,0,
970  0,0,0,0,0,0
971, // 0x70 'p'
972  0,0,0,0,0,0,
973  0,0,0,0,0,0,
974  0,0,0,0,0,0,
975  0,1,1,1,1,0,
976  0,1,0,0,0,1,
977  0,1,0,0,0,1,
978  0,1,0,0,0,1,
979  0,1,1,1,1,0,
980  0,1,0,0,0,0,
981  0,1,0,0,0,0
982, // 0x71 'q'
983  0,0,0,0,0,0,
984  0,0,0,0,0,0,
985  0,0,0,0,0,0,
986  0,0,1,1,1,1,
987  0,1,0,0,0,1,
988  0,1,0,0,0,1,
989  0,1,0,0,0,1,
990  0,0,1,1,1,1,
991  0,0,0,0,0,1,
992  0,0,0,0,0,1
993, // 0x72 'r'
994  0,0,0,0,0,0,
995  0,0,0,0,0,0,
996  0,0,0,0,0,0,
997  0,0,1,0,1,1,
998  0,0,1,1,0,0,
999  0,0,1,0,0,0,
1000  0,0,1,0,0,0,
1001  0,0,1,0,0,0,
1002  0,0,0,0,0,0,
1003  0,0,0,0,0,0
1004, // 0x73 's'
1005  0,0,0,0,0,0,
1006  0,0,0,0,0,0,
1007  0,0,0,0,0,0,
1008  0,0,1,1,1,1,
1009  0,1,0,0,0,0,
1010  0,0,1,1,1,0,
1011  0,0,0,0,0,1,
1012  0,1,1,1,1,0,
1013  0,0,0,0,0,0,
1014  0,0,0,0,0,0
1015, // 0x74 't'
1016  0,0,0,0,0,0,
1017  0,0,0,1,0,0,
1018  0,0,0,1,0,0,
1019  0,0,1,1,1,0,
1020  0,0,0,1,0,0,
1021  0,0,0,1,0,0,
1022  0,0,0,1,0,0,
1023  0,0,0,0,1,0,
1024  0,0,0,0,0,0,
1025  0,0,0,0,0,0
1026, // 0x75 'u'
1027  0,0,0,0,0,0,
1028  0,0,0,0,0,0,
1029  0,0,0,0,0,0,
1030  0,1,0,0,0,1,
1031  0,1,0,0,0,1,
1032  0,1,0,0,0,1,
1033  0,1,0,0,0,1,
1034  0,0,1,1,1,1,
1035  0,0,0,0,0,0,
1036  0,0,0,0,0,0
1037, // 0x76 'v'
1038  0,0,0,0,0,0,
1039  0,0,0,0,0,0,
1040  0,0,0,0,0,0,
1041  0,1,0,0,0,1,
1042  0,1,0,0,0,1,
1043  0,0,1,0,1,0,
1044  0,0,1,0,1,0,
1045  0,0,0,1,0,0,
1046  0,0,0,0,0,0,
1047  0,0,0,0,0,0
1048, // 0x77 'w'
1049  0,0,0,0,0,0,
1050  0,0,0,0,0,0,
1051  0,0,0,0,0,0,
1052  0,1,0,0,0,1,
1053  0,1,0,0,0,1,
1054  0,1,0,1,0,1,
1055  0,1,0,1,0,1,
1056  0,0,1,0,1,0,
1057  0,0,0,0,0,0,
1058  0,0,0,0,0,0
1059, // 0x78 'x'
1060  0,0,0,0,0,0,
1061  0,0,0,0,0,0,
1062  0,0,0,0,0,0,
1063  0,1,0,0,0,1,
1064  0,0,1,0,1,0,
1065  0,0,0,1,0,0,
1066  0,0,1,0,1,0,
1067  0,1,0,0,0,1,
1068  0,0,0,0,0,0,
1069  0,0,0,0,0,0
1070, // 0x79 'y'
1071  0,0,0,0,0,0,
1072  0,0,0,0,0,0,
1073  0,0,0,0,0,0,
1074  0,1,0,0,0,1,
1075  0,1,0,0,0,1,
1076  0,1,0,0,0,1,
1077  0,1,0,0,0,1,
1078  0,0,1,1,1,1,
1079  0,0,0,0,0,1,
1080  0,0,1,1,1,0
1081, // 0x7a 'z'
1082  0,0,0,0,0,0,
1083  0,0,0,0,0,0,
1084  0,0,0,0,0,0,
1085  0,1,1,1,1,1,
1086  0,0,0,0,1,0,
1087  0,0,0,1,0,0,
1088  0,0,1,0,0,0,
1089  0,1,1,1,1,1,
1090  0,0,0,0,0,0,
1091  0,0,0,0,0,0
1092, // 0x7b 'one fourth symbol'
1093  0,0,0,0,0,0,
1094  0,0,1,0,0,0,
1095  0,0,1,0,0,0,
1096  0,0,1,0,0,0,
1097  0,0,1,0,0,1,
1098  0,0,0,0,1,1,
1099  0,0,0,1,0,1,
1100  0,0,0,1,1,1,
1101  0,0,0,0,0,1,
1102  0,0,0,0,0,0
1103, // 0x7c '|'
1104  0,0,0,0,0,0,
1105  0,0,1,0,1,0,
1106  0,0,1,0,1,0,
1107  0,0,1,0,1,0,
1108  0,0,1,0,1,0,
1109  0,0,1,0,1,0,
1110  0,0,1,0,1,0,
1111  0,0,1,0,1,0,
1112  0,0,0,0,0,0,
1113  0,0,0,0,0,0
1114, // 0x7d ' three fourths symbol'
1115  0,0,0,0,0,0,
1116  0,1,1,0,0,0,
1117  0,0,0,1,0,0,
1118  0,1,1,0,0,0,
1119  0,0,0,1,0,0,
1120  0,1,1,0,0,1,
1121  0,0,0,0,1,1,
1122  0,0,0,1,0,1,
1123  0,0,0,1,1,1,
1124  0,0,0,0,0,1
1125, // 0x7e Divide
1126  0,0,0,0,0,0,
1127  0,0,0,0,0,0,
1128  0,0,0,1,0,0,
1129  0,0,0,0,0,0,
1130  0,1,1,1,1,1,
1131  0,0,0,0,0,0,
1132  0,0,0,1,0,0,
1133  0,0,0,0,0,0,
1134  0,0,0,0,0,0,
1135  0,0,0,0,0,0
1136, // 0x7f Block
1137  0,0,0,0,0,0,
1138  0,1,1,1,1,1,
1139  0,1,1,1,1,1,
1140  0,1,1,1,1,1,
1141  0,1,1,1,1,1,
1142  0,1,1,1,1,1,
1143  0,1,1,1,1,1,
1144  0,1,1,1,1,1,
1145  0,0,0,0,0,0,
1146  0,0,0,0,0,0
1147};
1148
1149
1150/* Graphics Character Set */
1151
1152static const char teletext_graphics[96*60]={
1153  // 0x20
1154  0,0,0,0,0,0,
1155  0,0,0,0,0,0,
1156  0,0,0,0,0,0,
1157  0,0,0,0,0,0,
1158  0,0,0,0,0,0,
1159  0,0,0,0,0,0,
1160  0,0,0,0,0,0,
1161  0,0,0,0,0,0,
1162  0,0,0,0,0,0,
1163  0,0,0,0,0,0
1164, // 0x21
1165  1,1,1,0,0,0,
1166  1,1,1,0,0,0,
1167  1,1,1,0,0,0,
1168  0,0,0,0,0,0,
1169  0,0,0,0,0,0,
1170  0,0,0,0,0,0,
1171  0,0,0,0,0,0,
1172  0,0,0,0,0,0,
1173  0,0,0,0,0,0,
1174  0,0,0,0,0,0
1175, // 0x22
1176  0,0,0,1,1,1,
1177  0,0,0,1,1,1,
1178  0,0,0,1,1,1,
1179  0,0,0,0,0,0,
1180  0,0,0,0,0,0,
1181  0,0,0,0,0,0,
1182  0,0,0,0,0,0,
1183  0,0,0,0,0,0,
1184  0,0,0,0,0,0,
1185  0,0,0,0,0,0
1186, // 0x23
1187  1,1,1,1,1,1,
1188  1,1,1,1,1,1,
1189  1,1,1,1,1,1,
1190  0,0,0,0,0,0,
1191  0,0,0,0,0,0,
1192  0,0,0,0,0,0,
1193  0,0,0,0,0,0,
1194  0,0,0,0,0,0,
1195  0,0,0,0,0,0,
1196  0,0,0,0,0,0
1197, // 0x24
1198  0,0,0,0,0,0,
1199  0,0,0,0,0,0,
1200  0,0,0,0,0,0,
1201  1,1,1,0,0,0,
1202  1,1,1,0,0,0,
1203  1,1,1,0,0,0,
1204  1,1,1,0,0,0,
1205  0,0,0,0,0,0,
1206  0,0,0,0,0,0,
1207  0,0,0,0,0,0
1208, // 0x25
1209  1,1,1,0,0,0,
1210  1,1,1,0,0,0,
1211  1,1,1,0,0,0,
1212  1,1,1,0,0,0,
1213  1,1,1,0,0,0,
1214  1,1,1,0,0,0,
1215  1,1,1,0,0,0,
1216  0,0,0,0,0,0,
1217  0,0,0,0,0,0,
1218  0,0,0,0,0,0
1219, // 0x26
1220  0,0,0,1,1,1,
1221  0,0,0,1,1,1,
1222  0,0,0,1,1,1,
1223  1,1,1,0,0,0,
1224  1,1,1,0,0,0,
1225  1,1,1,0,0,0,
1226  1,1,1,0,0,0,
1227  0,0,0,0,0,0,
1228  0,0,0,0,0,0,
1229  0,0,0,0,0,0
1230, // 0x27
1231  1,1,1,1,1,1,
1232  1,1,1,1,1,1,
1233  1,1,1,1,1,1,
1234  1,1,1,0,0,0,
1235  1,1,1,0,0,0,
1236  1,1,1,0,0,0,
1237  1,1,1,0,0,0,
1238  0,0,0,0,0,0,
1239  0,0,0,0,0,0,
1240  0,0,0,0,0,0
1241, // 0x28
1242  0,0,0,0,0,0,
1243  0,0,0,0,0,0,
1244  0,0,0,0,0,0,
1245  0,0,0,1,1,1,
1246  0,0,0,1,1,1,
1247  0,0,0,1,1,1,
1248  0,0,0,1,1,1,
1249  0,0,0,0,0,0,
1250  0,0,0,0,0,0,
1251  0,0,0,0,0,0
1252, // 0x29
1253  1,1,1,0,0,0,
1254  1,1,1,0,0,0,
1255  1,1,1,0,0,0,
1256  0,0,0,1,1,1,
1257  0,0,0,1,1,1,
1258  0,0,0,1,1,1,
1259  0,0,0,1,1,1,
1260  0,0,0,0,0,0,
1261  0,0,0,0,0,0,
1262  0,0,0,0,0,0
1263, // 0x2a
1264  0,0,0,1,1,1,
1265  0,0,0,1,1,1,
1266  0,0,0,1,1,1,
1267  0,0,0,1,1,1,
1268  0,0,0,1,1,1,
1269  0,0,0,1,1,1,
1270  0,0,0,1,1,1,
1271  0,0,0,0,0,0,
1272  0,0,0,0,0,0,
1273  0,0,0,0,0,0
1274, // 0x2b
1275  1,1,1,1,1,1,
1276  1,1,1,1,1,1,
1277  1,1,1,1,1,1,
1278  0,0,0,1,1,1,
1279  0,0,0,1,1,1,
1280  0,0,0,1,1,1,
1281  0,0,0,1,1,1,
1282  0,0,0,0,0,0,
1283  0,0,0,0,0,0,
1284  0,0,0,0,0,0
1285, // 0x2c
1286  0,0,0,0,0,0,
1287  0,0,0,0,0,0,
1288  0,0,0,0,0,0,
1289  1,1,1,1,1,1,
1290  1,1,1,1,1,1,
1291  1,1,1,1,1,1,
1292  1,1,1,1,1,1,
1293  0,0,0,0,0,0,
1294  0,0,0,0,0,0,
1295  0,0,0,0,0,0
1296, // 0x2d
1297  1,1,1,0,0,0,
1298  1,1,1,0,0,0,
1299  1,1,1,0,0,0,
1300  1,1,1,1,1,1,
1301  1,1,1,1,1,1,
1302  1,1,1,1,1,1,
1303  1,1,1,1,1,1,
1304  0,0,0,0,0,0,
1305  0,0,0,0,0,0,
1306  0,0,0,0,0,0
1307, // 0x2e
1308  0,0,0,1,1,1,
1309  0,0,0,1,1,1,
1310  0,0,0,1,1,1,
1311  1,1,1,1,1,1,
1312  1,1,1,1,1,1,
1313  1,1,1,1,1,1,
1314  1,1,1,1,1,1,
1315  0,0,0,0,0,0,
1316  0,0,0,0,0,0,
1317  0,0,0,0,0,0
1318, // 0x2f
1319  1,1,1,1,1,1,
1320  1,1,1,1,1,1,
1321  1,1,1,1,1,1,
1322  1,1,1,1,1,1,
1323  1,1,1,1,1,1,
1324  1,1,1,1,1,1,
1325  1,1,1,1,1,1,
1326  0,0,0,0,0,0,
1327  0,0,0,0,0,0,
1328  0,0,0,0,0,0
1329, // 0x30
1330  0,0,0,0,0,0,
1331  0,0,0,0,0,0,
1332  0,0,0,0,0,0,
1333  0,0,0,0,0,0,
1334  0,0,0,0,0,0,
1335  0,0,0,0,0,0,
1336  0,0,0,0,0,0,
1337  1,1,1,0,0,0,
1338  1,1,1,0,0,0,
1339  1,1,1,0,0,0
1340, // 0x31
1341  1,1,1,0,0,0,
1342  1,1,1,0,0,0,
1343  1,1,1,0,0,0,
1344  0,0,0,0,0,0,
1345  0,0,0,0,0,0,
1346  0,0,0,0,0,0,
1347  0,0,0,0,0,0,
1348  1,1,1,0,0,0,
1349  1,1,1,0,0,0,
1350  1,1,1,0,0,0
1351, // 0x32
1352  0,0,0,1,1,1,
1353  0,0,0,1,1,1,
1354  0,0,0,1,1,1,
1355  0,0,0,0,0,0,
1356  0,0,0,0,0,0,
1357  0,0,0,0,0,0,
1358  0,0,0,0,0,0,
1359  1,1,1,0,0,0,
1360  1,1,1,0,0,0,
1361  1,1,1,0,0,0
1362, // 0x33
1363  1,1,1,1,1,1,
1364  1,1,1,1,1,1,
1365  1,1,1,1,1,1,
1366  0,0,0,0,0,0,
1367  0,0,0,0,0,0,
1368  0,0,0,0,0,0,
1369  0,0,0,0,0,0,
1370  1,1,1,0,0,0,
1371  1,1,1,0,0,0,
1372  1,1,1,0,0,0
1373, // 0x34
1374  0,0,0,0,0,0,
1375  0,0,0,0,0,0,
1376  0,0,0,0,0,0,
1377  1,1,1,0,0,0,
1378  1,1,1,0,0,0,
1379  1,1,1,0,0,0,
1380  1,1,1,0,0,0,
1381  1,1,1,0,0,0,
1382  1,1,1,0,0,0,
1383  1,1,1,0,0,0
1384, // 0x35
1385  1,1,1,0,0,0,
1386  1,1,1,0,0,0,
1387  1,1,1,0,0,0,
1388  1,1,1,0,0,0,
1389  1,1,1,0,0,0,
1390  1,1,1,0,0,0,
1391  1,1,1,0,0,0,
1392  1,1,1,0,0,0,
1393  1,1,1,0,0,0,
1394  1,1,1,0,0,0
1395, // 0x36
1396  0,0,0,1,1,1,
1397  0,0,0,1,1,1,
1398  0,0,0,1,1,1,
1399  1,1,1,0,0,0,
1400  1,1,1,0,0,0,
1401  1,1,1,0,0,0,
1402  1,1,1,0,0,0,
1403  1,1,1,0,0,0,
1404  1,1,1,0,0,0,
1405  1,1,1,0,0,0
1406, // 0x37
1407  1,1,1,1,1,1,
1408  1,1,1,1,1,1,
1409  1,1,1,1,1,1,
1410  1,1,1,0,0,0,
1411  1,1,1,0,0,0,
1412  1,1,1,0,0,0,
1413  1,1,1,0,0,0,
1414  1,1,1,0,0,0,
1415  1,1,1,0,0,0,
1416  1,1,1,0,0,0
1417, // 0x38
1418  0,0,0,0,0,0,
1419  0,0,0,0,0,0,
1420  0,0,0,0,0,0,
1421  0,0,0,1,1,1,
1422  0,0,0,1,1,1,
1423  0,0,0,1,1,1,
1424  0,0,0,1,1,1,
1425  1,1,1,0,0,0,
1426  1,1,1,0,0,0,
1427  1,1,1,0,0,0
1428, // 0x39
1429  1,1,1,0,0,0,
1430  1,1,1,0,0,0,
1431  1,1,1,0,0,0,
1432  0,0,0,1,1,1,
1433  0,0,0,1,1,1,
1434  0,0,0,1,1,1,
1435  0,0,0,1,1,1,
1436  1,1,1,0,0,0,
1437  1,1,1,0,0,0,
1438  1,1,1,0,0,0
1439, // 0x3a
1440  0,0,0,1,1,1,
1441  0,0,0,1,1,1,
1442  0,0,0,1,1,1,
1443  0,0,0,1,1,1,
1444  0,0,0,1,1,1,
1445  0,0,0,1,1,1,
1446  0,0,0,1,1,1,
1447  1,1,1,0,0,0,
1448  1,1,1,0,0,0,
1449  1,1,1,0,0,0
1450, // 0x3b
1451  1,1,1,1,1,1,
1452  1,1,1,1,1,1,
1453  1,1,1,1,1,1,
1454  0,0,0,1,1,1,
1455  0,0,0,1,1,1,
1456  0,0,0,1,1,1,
1457  0,0,0,1,1,1,
1458  1,1,1,0,0,0,
1459  1,1,1,0,0,0,
1460  1,1,1,0,0,0
1461, // 0x3c
1462  0,0,0,0,0,0,
1463  0,0,0,0,0,0,
1464  0,0,0,0,0,0,
1465  1,1,1,1,1,1,
1466  1,1,1,1,1,1,
1467  1,1,1,1,1,1,
1468  1,1,1,1,1,1,
1469  1,1,1,0,0,0,
1470  1,1,1,0,0,0,
1471  1,1,1,0,0,0
1472, // 0x3d
1473  1,1,1,0,0,0,
1474  1,1,1,0,0,0,
1475  1,1,1,0,0,0,
1476  1,1,1,1,1,1,
1477  1,1,1,1,1,1,
1478  1,1,1,1,1,1,
1479  1,1,1,1,1,1,
1480  1,1,1,0,0,0,
1481  1,1,1,0,0,0,
1482  1,1,1,0,0,0
1483, // 0x3e
1484  0,0,0,1,1,1,
1485  0,0,0,1,1,1,
1486  0,0,0,1,1,1,
1487  1,1,1,1,1,1,
1488  1,1,1,1,1,1,
1489  1,1,1,1,1,1,
1490  1,1,1,1,1,1,
1491  1,1,1,0,0,0,
1492  1,1,1,0,0,0,
1493  1,1,1,0,0,0
1494, // 0x3f
1495  1,1,1,1,1,1,
1496  1,1,1,1,1,1,
1497  1,1,1,1,1,1,
1498  1,1,1,1,1,1,
1499  1,1,1,1,1,1,
1500  1,1,1,1,1,1,
1501  1,1,1,1,1,1,
1502  1,1,1,0,0,0,
1503  1,1,1,0,0,0,
1504  1,1,1,0,0,0
1505, // 0x40 '@'
1506  0,0,0,0,0,0,
1507  0,0,1,1,1,0,
1508  0,1,0,0,0,1,
1509  0,1,0,1,1,1,
1510  0,1,0,1,0,1,
1511  0,1,0,1,1,1,
1512  0,1,0,0,0,0,
1513  0,0,1,1,1,1,
1514  0,0,0,0,0,0,
1515  0,0,0,0,0,0
1516, // 0x41 'A'
1517  0,0,0,0,0,0,
1518  0,0,0,1,0,0,
1519  0,0,1,0,1,0,
1520  0,1,0,0,0,1,
1521  0,1,0,0,0,1,
1522  0,1,1,1,1,1,
1523  0,1,0,0,0,1,
1524  0,1,0,0,0,1,
1525  0,0,0,0,0,0,
1526  0,0,0,0,0,0
1527, // 0x42 'B'
1528  0,0,0,0,0,0,
1529  0,1,1,1,1,0,
1530  0,1,0,0,0,1,
1531  0,1,0,0,0,1,
1532  0,1,1,1,1,0,
1533  0,1,0,0,0,1,
1534  0,1,0,0,0,1,
1535  0,1,1,1,1,0,
1536  0,0,0,0,0,0,
1537  0,0,0,0,0,0
1538, // 0x43 'C'
1539  0,0,0,0,0,0,
1540  0,0,1,1,1,0,
1541  0,1,0,0,0,1,
1542  0,1,0,0,0,0,
1543  0,1,0,0,0,0,
1544  0,1,0,0,0,0,
1545  0,1,0,0,0,1,
1546  0,0,1,1,1,0,
1547  0,0,0,0,0,0,
1548  0,0,0,0,0,0
1549, // 0x44 'D'
1550  0,0,0,0,0,0,
1551  0,1,1,1,1,0,
1552  0,1,0,0,0,1,
1553  0,1,0,0,0,1,
1554  0,1,0,0,0,1,
1555  0,1,0,0,0,1,
1556  0,1,0,0,0,1,
1557  0,1,1,1,1,0,
1558  0,0,0,0,0,0,
1559  0,0,0,0,0,0
1560, // 0x45 'E'
1561  0,0,0,0,0,0,
1562  0,1,1,1,1,1,
1563  0,1,0,0,0,0,
1564  0,1,0,0,0,0,
1565  0,1,1,1,1,0,
1566  0,1,0,0,0,0,
1567  0,1,0,0,0,0,
1568  0,1,1,1,1,1,
1569  0,0,0,0,0,0,
1570  0,0,0,0,0,0
1571, // 0x46 'F'
1572  0,0,0,0,0,0,
1573  0,1,1,1,1,1,
1574  0,1,0,0,0,0,
1575  0,1,0,0,0,0,
1576  0,1,1,1,1,0,
1577  0,1,0,0,0,0,
1578  0,1,0,0,0,0,
1579  0,1,0,0,0,0,
1580  0,0,0,0,0,0,
1581  0,0,0,0,0,0
1582, // 0x47 'G'
1583  0,0,0,0,0,0,
1584  0,0,1,1,1,0,
1585  0,1,0,0,0,1,
1586  0,1,0,0,0,0,
1587  0,1,0,0,0,0,
1588  0,1,0,0,1,1,
1589  0,1,0,0,0,1,
1590  0,0,1,1,1,1,
1591  0,0,0,0,0,0,
1592  0,0,0,0,0,0
1593, // 0x48 'H'
1594  0,0,0,0,0,0,
1595  0,1,0,0,0,1,
1596  0,1,0,0,0,1,
1597  0,1,0,0,0,1,
1598  0,1,1,1,1,1,
1599  0,1,0,0,0,1,
1600  0,1,0,0,0,1,
1601  0,1,0,0,0,1,
1602  0,0,0,0,0,0,
1603  0,0,0,0,0,0
1604, // 0x49 'I'
1605  0,0,0,0,0,0,
1606  0,0,1,1,1,0,
1607  0,0,0,1,0,0,
1608  0,0,0,1,0,0,
1609  0,0,0,1,0,0,
1610  0,0,0,1,0,0,
1611  0,0,0,1,0,0,
1612  0,0,1,1,1,0,
1613  0,0,0,0,0,0,
1614  0,0,0,0,0,0
1615, // 0x4a 'J'
1616  0,0,0,0,0,0,
1617  0,0,0,0,0,1,
1618  0,0,0,0,0,1,
1619  0,0,0,0,0,1,
1620  0,0,0,0,0,1,
1621  0,0,0,0,0,1,
1622  0,1,0,0,0,1,
1623  0,0,1,1,1,0,
1624  0,0,0,0,0,0,
1625  0,0,0,0,0,0
1626, // 0x4b 'K'
1627  0,0,0,0,0,0,
1628  0,1,0,0,0,1,
1629  0,1,0,0,1,0,
1630  0,1,0,1,0,0,
1631  0,1,1,0,0,0,
1632  0,1,0,1,0,0,
1633  0,1,0,0,1,0,
1634  0,1,0,0,0,1,
1635  0,0,0,0,0,0,
1636  0,0,0,0,0,0
1637, // 0x4c 'L'
1638  0,0,0,0,0,0,
1639  0,1,0,0,0,0,
1640  0,1,0,0,0,0,
1641  0,1,0,0,0,0,
1642  0,1,0,0,0,0,
1643  0,1,0,0,0,0,
1644  0,1,0,0,0,0,
1645  0,1,1,1,1,1,
1646  0,0,0,0,0,0,
1647  0,0,0,0,0,0
1648, // 0x4d 'M'
1649  0,0,0,0,0,0,
1650  0,1,0,0,0,1,
1651  0,1,1,0,1,1,
1652  0,1,0,1,0,1,
1653  0,1,0,0,0,1,
1654  0,1,0,0,0,1,
1655  0,1,0,0,0,1,
1656  0,1,0,0,0,1,
1657  0,0,0,0,0,0,
1658  0,0,0,0,0,0
1659, // 0x4e 'N'
1660  0,0,0,0,0,0,
1661  0,1,0,0,0,1,
1662  0,1,0,0,0,1,
1663  0,1,1,0,0,1,
1664  0,1,0,1,0,1,
1665  0,1,0,0,1,1,
1666  0,1,0,0,0,1,
1667  0,1,0,0,0,1,
1668  0,0,0,0,0,0,
1669  0,0,0,0,0,0
1670, // 0x4f 'O'
1671  0,0,0,0,0,0,
1672  0,0,1,1,1,0,
1673  0,1,0,0,0,1,
1674  0,1,0,0,0,1,
1675  0,1,0,0,0,1,
1676  0,1,0,0,0,1,
1677  0,1,0,0,0,1,
1678  0,0,1,1,1,0,
1679  0,0,0,0,0,0,
1680  0,0,0,0,0,0
1681, // 0x50 'P'
1682  0,0,0,0,0,0,
1683  0,1,1,1,1,0,
1684  0,1,0,0,0,1,
1685  0,1,0,0,0,1,
1686  0,1,1,1,1,0,
1687  0,1,0,0,0,0,
1688  0,1,0,0,0,0,
1689  0,1,0,0,0,0,
1690  0,0,0,0,0,0,
1691  0,0,0,0,0,0
1692, // 0x51 'Q'
1693  0,0,0,0,0,0,
1694  0,0,1,1,1,0,
1695  0,1,0,0,0,1,
1696  0,1,0,0,0,1,
1697  0,1,0,0,0,1,
1698  0,1,0,1,0,1,
1699  0,1,0,0,1,0,
1700  0,0,1,1,0,1,
1701  0,0,0,0,0,0,
1702  0,0,0,0,0,0
1703, // 0x52 'R'
1704  0,0,0,0,0,0,
1705  0,1,1,1,1,0,
1706  0,1,0,0,0,1,
1707  0,1,0,0,0,1,
1708  0,1,1,1,1,0,
1709  0,1,0,1,0,0,
1710  0,1,0,0,1,0,
1711  0,1,0,0,0,1,
1712  0,0,0,0,0,0,
1713  0,0,0,0,0,0
1714, // 0x53 'S'
1715  0,0,0,0,0,0,
1716  0,0,1,1,1,0,
1717  0,1,0,0,0,1,
1718  0,1,0,0,0,0,
1719  0,0,1,1,1,0,
1720  0,0,0,0,0,1,
1721  0,1,0,0,0,1,
1722  0,0,1,1,1,0,
1723  0,0,0,0,0,0,
1724  0,0,0,0,0,0
1725, // 0x54 'T'
1726  0,0,0,0,0,0,
1727  0,1,1,1,1,1,
1728  0,0,0,1,0,0,
1729  0,0,0,1,0,0,
1730  0,0,0,1,0,0,
1731  0,0,0,1,0,0,
1732  0,0,0,1,0,0,
1733  0,0,0,1,0,0,
1734  0,0,0,0,0,0,
1735  0,0,0,0,0,0
1736, // 0x55 'U'
1737  0,0,0,0,0,0,
1738  0,1,0,0,0,1,
1739  0,1,0,0,0,1,
1740  0,1,0,0,0,1,
1741  0,1,0,0,0,1,
1742  0,1,0,0,0,1,
1743  0,1,0,0,0,1,
1744  0,0,1,1,1,0,
1745  0,0,0,0,0,0,
1746  0,0,0,0,0,0
1747, // 0x56 'V'
1748  0,0,0,0,0,0,
1749  0,1,0,0,0,1,
1750  0,1,0,0,0,1,
1751  0,1,0,0,0,1,
1752  0,0,1,0,1,0,
1753  0,0,1,0,1,0,
1754  0,0,0,1,0,0,
1755  0,0,0,1,0,0,
1756  0,0,0,0,0,0,
1757  0,0,0,0,0,0
1758, // 0x57 'W'
1759  0,0,0,0,0,0,
1760  0,1,0,0,0,1,
1761  0,1,0,0,0,1,
1762  0,1,0,0,0,1,
1763  0,1,0,1,0,1,
1764  0,1,0,1,0,1,
1765  0,1,0,1,0,1,
1766  0,0,1,0,1,0,
1767  0,0,0,0,0,0,
1768  0,0,0,0,0,0
1769, // 0x58 'X'
1770  0,0,0,0,0,0,
1771  0,1,0,0,0,1,
1772  0,1,0,0,0,1,
1773  0,0,1,0,1,0,
1774  0,0,0,1,0,0,
1775  0,0,1,0,1,0,
1776  0,1,0,0,0,1,
1777  0,1,0,0,0,1,
1778  0,0,0,0,0,0,
1779  0,0,0,0,0,0
1780, // 0x59 'Y'
1781  0,0,0,0,0,0,
1782  0,1,0,0,0,1,
1783  0,1,0,0,0,1,
1784  0,0,1,0,1,0,
1785  0,0,0,1,0,0,
1786  0,0,0,1,0,0,
1787  0,0,0,1,0,0,
1788  0,0,0,1,0,0,
1789  0,0,0,0,0,0,
1790  0,0,0,0,0,0
1791, // 0x5a 'Z'
1792  0,0,0,0,0,0,
1793  0,1,1,1,1,1,
1794  0,0,0,0,0,1,
1795  0,0,0,0,1,0,
1796  0,0,0,1,0,0,
1797  0,0,1,0,0,0,
1798  0,1,0,0,0,0,
1799  0,1,1,1,1,1,
1800  0,0,0,0,0,0,
1801  0,0,0,0,0,0
1802, // 0x5b Left Arrow
1803  0,0,0,0,0,0,
1804  0,0,0,0,0,0,
1805  0,0,0,1,0,0,
1806  0,0,1,0,0,0,
1807  0,1,1,1,1,1,
1808  0,0,1,0,0,0,
1809  0,0,0,1,0,0,
1810  0,0,0,0,0,0,
1811  0,0,0,0,0,0,
1812  0,0,0,0,0,0
1813, // 0x5c '?'
1814  0,0,0,0,0,0,
1815  0,1,0,0,0,0,
1816  0,1,0,0,0,0,
1817  0,1,0,0,0,0,
1818  0,1,0,1,1,0,
1819  0,0,0,0,0,1,
1820  0,0,0,0,1,0,
1821  0,0,0,1,0,0,
1822  0,0,0,1,1,1,
1823  0,0,0,0,0,0
1824, // 0x5d Right Arrow
1825  0,0,0,0,0,0,
1826  0,0,0,0,0,0,
1827  0,0,0,1,0,0,
1828  0,0,0,0,1,0,
1829  0,1,1,1,1,1,
1830  0,0,0,0,1,0,
1831  0,0,0,1,0,0,
1832  0,0,0,0,0,0,
1833  0,0,0,0,0,0,
1834  0,0,0,0,0,0
1835, // 0x5e Up Arrow
1836  0,0,0,0,0,0,
1837  0,0,0,0,0,0,
1838  0,0,0,1,0,0,
1839  0,0,1,1,1,0,
1840  0,1,0,1,0,1,
1841  0,0,0,1,0,0,
1842  0,0,0,1,0,0,
1843  0,0,0,0,0,0,
1844  0,0,0,0,0,0,
1845  0,0,0,0,0,0
1846, // 0x5f '#'
1847  0,0,0,0,0,0,
1848  0,0,1,0,1,0,
1849  0,0,1,0,1,0,
1850  0,1,1,1,1,1,
1851  0,0,1,0,1,0,
1852  0,1,1,1,1,1,
1853  0,0,1,0,1,0,
1854  0,0,1,0,1,0,
1855  0,0,0,0,0,0,
1856  0,0,0,0,0,0
1857, // 0x60
1858  0,0,0,0,0,0,
1859  0,0,0,0,0,0,
1860  0,0,0,0,0,0,
1861  0,0,0,0,0,0,
1862  0,0,0,0,0,0,
1863  0,0,0,0,0,0,
1864  0,0,0,0,0,0,
1865  0,0,0,1,1,1,
1866  0,0,0,1,1,1,
1867  0,0,0,1,1,1
1868, // 0x61
1869  1,1,1,0,0,0,
1870  1,1,1,0,0,0,
1871  1,1,1,0,0,0,
1872  0,0,0,0,0,0,
1873  0,0,0,0,0,0,
1874  0,0,0,0,0,0,
1875  0,0,0,0,0,0,
1876  0,0,0,1,1,1,
1877  0,0,0,1,1,1,
1878  0,0,0,1,1,1
1879, // 0x62
1880  0,0,0,1,1,1,
1881  0,0,0,1,1,1,
1882  0,0,0,1,1,1,
1883  0,0,0,0,0,0,
1884  0,0,0,0,0,0,
1885  0,0,0,0,0,0,
1886  0,0,0,0,0,0,
1887  0,0,0,1,1,1,
1888  0,0,0,1,1,1,
1889  0,0,0,1,1,1
1890, // 0x63
1891  1,1,1,1,1,1,
1892  1,1,1,1,1,1,
1893  1,1,1,1,1,1,
1894  0,0,0,0,0,0,
1895  0,0,0,0,0,0,
1896  0,0,0,0,0,0,
1897  0,0,0,0,0,0,
1898  0,0,0,1,1,1,
1899  0,0,0,1,1,1,
1900  0,0,0,1,1,1
1901, // 0x64
1902  0,0,0,0,0,0,
1903  0,0,0,0,0,0,
1904  0,0,0,0,0,0,
1905  1,1,1,0,0,0,
1906  1,1,1,0,0,0,
1907  1,1,1,0,0,0,
1908  1,1,1,0,0,0,
1909  0,0,0,1,1,1,
1910  0,0,0,1,1,1,
1911  0,0,0,1,1,1
1912, // 0x65
1913  1,1,1,0,0,0,
1914  1,1,1,0,0,0,
1915  1,1,1,0,0,0,
1916  1,1,1,0,0,0,
1917  1,1,1,0,0,0,
1918  1,1,1,0,0,0,
1919  1,1,1,0,0,0,
1920  0,0,0,1,1,1,
1921  0,0,0,1,1,1,
1922  0,0,0,1,1,1
1923, // 0x66
1924  0,0,0,1,1,1,
1925  0,0,0,1,1,1,
1926  0,0,0,1,1,1,
1927  1,1,1,0,0,0,
1928  1,1,1,0,0,0,
1929  1,1,1,0,0,0,
1930  1,1,1,0,0,0,
1931  0,0,0,1,1,1,
1932  0,0,0,1,1,1,
1933  0,0,0,1,1,1
1934, // 0x67
1935  1,1,1,1,1,1,
1936  1,1,1,1,1,1,
1937  1,1,1,1,1,1,
1938  1,1,1,0,0,0,
1939  1,1,1,0,0,0,
1940  1,1,1,0,0,0,
1941  1,1,1,0,0,0,
1942  0,0,0,1,1,1,
1943  0,0,0,1,1,1,
1944  0,0,0,1,1,1
1945, // 0x68
1946  0,0,0,0,0,0,
1947  0,0,0,0,0,0,
1948  0,0,0,0,0,0,
1949  0,0,0,1,1,1,
1950  0,0,0,1,1,1,
1951  0,0,0,1,1,1,
1952  0,0,0,1,1,1,
1953  0,0,0,1,1,1,
1954  0,0,0,1,1,1,
1955  0,0,0,1,1,1
1956, // 0x69
1957  1,1,1,0,0,0,
1958  1,1,1,0,0,0,
1959  1,1,1,0,0,0,
1960  0,0,0,1,1,1,
1961  0,0,0,1,1,1,
1962  0,0,0,1,1,1,
1963  0,0,0,1,1,1,
1964  0,0,0,1,1,1,
1965  0,0,0,1,1,1,
1966  0,0,0,1,1,1
1967, // 0x6a
1968  0,0,0,1,1,1,
1969  0,0,0,1,1,1,
1970  0,0,0,1,1,1,
1971  0,0,0,1,1,1,
1972  0,0,0,1,1,1,
1973  0,0,0,1,1,1,
1974  0,0,0,1,1,1,
1975  0,0,0,1,1,1,
1976  0,0,0,1,1,1,
1977  0,0,0,1,1,1
1978, // 0x6b
1979  1,1,1,1,1,1,
1980  1,1,1,1,1,1,
1981  1,1,1,1,1,1,
1982  0,0,0,1,1,1,
1983  0,0,0,1,1,1,
1984  0,0,0,1,1,1,
1985  0,0,0,1,1,1,
1986  0,0,0,1,1,1,
1987  0,0,0,1,1,1,
1988  0,0,0,1,1,1
1989, // 0x6c
1990  0,0,0,0,0,0,
1991  0,0,0,0,0,0,
1992  0,0,0,0,0,0,
1993  1,1,1,1,1,1,
1994  1,1,1,1,1,1,
1995  1,1,1,1,1,1,
1996  1,1,1,1,1,1,
1997  0,0,0,1,1,1,
1998  0,0,0,1,1,1,
1999  0,0,0,1,1,1
2000, // 0x6d
2001  1,1,1,0,0,0,
2002  1,1,1,0,0,0,
2003  1,1,1,0,0,0,
2004  1,1,1,1,1,1,
2005  1,1,1,1,1,1,
2006  1,1,1,1,1,1,
2007  1,1,1,1,1,1,
2008  0,0,0,1,1,1,
2009  0,0,0,1,1,1,
2010  0,0,0,1,1,1
2011, // 0x6e
2012  0,0,0,1,1,1,
2013  0,0,0,1,1,1,
2014  0,0,0,1,1,1,
2015  1,1,1,1,1,1,
2016  1,1,1,1,1,1,
2017  1,1,1,1,1,1,
2018  1,1,1,1,1,1,
2019  0,0,0,1,1,1,
2020  0,0,0,1,1,1,
2021  0,0,0,1,1,1
2022, // 0x6f
2023  1,1,1,1,1,1,
2024  1,1,1,1,1,1,
2025  1,1,1,1,1,1,
2026  1,1,1,1,1,1,
2027  1,1,1,1,1,1,
2028  1,1,1,1,1,1,
2029  1,1,1,1,1,1,
2030  0,0,0,1,1,1,
2031  0,0,0,1,1,1,
2032  0,0,0,1,1,1
2033, // 0x70
2034  0,0,0,0,0,0,
2035  0,0,0,0,0,0,
2036  0,0,0,0,0,0,
2037  0,0,0,0,0,0,
2038  0,0,0,0,0,0,
2039  0,0,0,0,0,0,
2040  0,0,0,0,0,0,
2041  1,1,1,1,1,1,
2042  1,1,1,1,1,1,
2043  1,1,1,1,1,1
2044, // 0x71
2045  1,1,1,0,0,0,
2046  1,1,1,0,0,0,
2047  1,1,1,0,0,0,
2048  0,0,0,0,0,0,
2049  0,0,0,0,0,0,
2050  0,0,0,0,0,0,
2051  0,0,0,0,0,0,
2052  1,1,1,1,1,1,
2053  1,1,1,1,1,1,
2054  1,1,1,1,1,1
2055, // 0x72
2056  0,0,0,1,1,1,
2057  0,0,0,1,1,1,
2058  0,0,0,1,1,1,
2059  0,0,0,0,0,0,
2060  0,0,0,0,0,0,
2061  0,0,0,0,0,0,
2062  0,0,0,0,0,0,
2063  1,1,1,1,1,1,
2064  1,1,1,1,1,1,
2065  1,1,1,1,1,1
2066, // 0x73
2067  1,1,1,1,1,1,
2068  1,1,1,1,1,1,
2069  1,1,1,1,1,1,
2070  0,0,0,0,0,0,
2071  0,0,0,0,0,0,
2072  0,0,0,0,0,0,
2073  0,0,0,0,0,0,
2074  1,1,1,1,1,1,
2075  1,1,1,1,1,1,
2076  1,1,1,1,1,1
2077, // 0x74
2078  0,0,0,0,0,0,
2079  0,0,0,0,0,0,
2080  0,0,0,0,0,0,
2081  1,1,1,0,0,0,
2082  1,1,1,0,0,0,
2083  1,1,1,0,0,0,
2084  1,1,1,0,0,0,
2085  1,1,1,1,1,1,
2086  1,1,1,1,1,1,
2087  1,1,1,1,1,1
2088, // 0x75
2089  1,1,1,0,0,0,
2090  1,1,1,0,0,0,
2091  1,1,1,0,0,0,
2092  1,1,1,0,0,0,
2093  1,1,1,0,0,0,
2094  1,1,1,0,0,0,
2095  1,1,1,0,0,0,
2096  1,1,1,1,1,1,
2097  1,1,1,1,1,1,
2098  1,1,1,1,1,1
2099, // 0x76
2100  0,0,0,1,1,1,
2101  0,0,0,1,1,1,
2102  0,0,0,1,1,1,
2103  1,1,1,0,0,0,
2104  1,1,1,0,0,0,
2105  1,1,1,0,0,0,
2106  1,1,1,0,0,0,
2107  1,1,1,1,1,1,
2108  1,1,1,1,1,1,
2109  1,1,1,1,1,1
2110, // 0x77
2111  1,1,1,1,1,1,
2112  1,1,1,1,1,1,
2113  1,1,1,1,1,1,
2114  1,1,1,0,0,0,
2115  1,1,1,0,0,0,
2116  1,1,1,0,0,0,
2117  1,1,1,0,0,0,
2118  1,1,1,1,1,1,
2119  1,1,1,1,1,1,
2120  1,1,1,1,1,1
2121, // 0x78
2122  0,0,0,0,0,0,
2123  0,0,0,0,0,0,
2124  0,0,0,0,0,0,
2125  0,0,0,1,1,1,
2126  0,0,0,1,1,1,
2127  0,0,0,1,1,1,
2128  0,0,0,1,1,1,
2129  1,1,1,1,1,1,
2130  1,1,1,1,1,1,
2131  1,1,1,1,1,1
2132, // 0x79
2133  1,1,1,0,0,0,
2134  1,1,1,0,0,0,
2135  1,1,1,0,0,0,
2136  0,0,0,1,1,1,
2137  0,0,0,1,1,1,
2138  0,0,0,1,1,1,
2139  0,0,0,1,1,1,
2140  1,1,1,1,1,1,
2141  1,1,1,1,1,1,
2142  1,1,1,1,1,1
2143, // 0x7a
2144  0,0,0,1,1,1,
2145  0,0,0,1,1,1,
2146  0,0,0,1,1,1,
2147  0,0,0,1,1,1,
2148  0,0,0,1,1,1,
2149  0,0,0,1,1,1,
2150  0,0,0,1,1,1,
2151  1,1,1,1,1,1,
2152  1,1,1,1,1,1,
2153  1,1,1,1,1,1
2154, // 0x7b
2155  1,1,1,1,1,1,
2156  1,1,1,1,1,1,
2157  1,1,1,1,1,1,
2158  0,0,0,1,1,1,
2159  0,0,0,1,1,1,
2160  0,0,0,1,1,1,
2161  0,0,0,1,1,1,
2162  1,1,1,1,1,1,
2163  1,1,1,1,1,1,
2164  1,1,1,1,1,1
2165, // 0x7c
2166  0,0,0,0,0,0,
2167  0,0,0,0,0,0,
2168  0,0,0,0,0,0,
2169  1,1,1,1,1,1,
2170  1,1,1,1,1,1,
2171  1,1,1,1,1,1,
2172  1,1,1,1,1,1,
2173  1,1,1,1,1,1,
2174  1,1,1,1,1,1,
2175  1,1,1,1,1,1
2176, // 0x7d
2177  1,1,1,0,0,0,
2178  1,1,1,0,0,0,
2179  1,1,1,0,0,0,
2180  1,1,1,1,1,1,
2181  1,1,1,1,1,1,
2182  1,1,1,1,1,1,
2183  1,1,1,1,1,1,
2184  1,1,1,1,1,1,
2185  1,1,1,1,1,1,
2186  1,1,1,1,1,1
2187, // 0x7e
2188  0,0,0,1,1,1,
2189  0,0,0,1,1,1,
2190  0,0,0,1,1,1,
2191  1,1,1,1,1,1,
2192  1,1,1,1,1,1,
2193  1,1,1,1,1,1,
2194  1,1,1,1,1,1,
2195  1,1,1,1,1,1,
2196  1,1,1,1,1,1,
2197  1,1,1,1,1,1
2198, // 0x7f
2199  1,1,1,1,1,1,
2200  1,1,1,1,1,1,
2201  1,1,1,1,1,1,
2202  1,1,1,1,1,1,
2203  1,1,1,1,1,1,
2204  1,1,1,1,1,1,
2205  1,1,1,1,1,1,
2206  1,1,1,1,1,1,
2207  1,1,1,1,1,1,
2208  1,1,1,1,1,1
2209};
2210
2211/* Separated Graphics Character Set */
2212
2213static const char teletext_separated_graphics[96*60]={
2214  // Character ' ' (32)
2215  0,0,0,0,0,0,
2216  0,0,0,0,0,0,
2217  0,0,0,0,0,0,
2218  0,0,0,0,0,0,
2219  0,0,0,0,0,0,
2220  0,0,0,0,0,0,
2221  0,0,0,0,0,0,
2222  0,0,0,0,0,0,
2223  0,0,0,0,0,0,
2224  0,0,0,0,0,0
2225,
2226  // Character '!' (33)
2227  1,1,0,0,0,0,
2228  1,1,0,0,0,0,
2229  0,0,0,0,0,0,
2230  0,0,0,0,0,0,
2231  0,0,0,0,0,0,
2232  0,0,0,0,0,0,
2233  0,0,0,0,0,0,
2234  0,0,0,0,0,0,
2235  0,0,0,0,0,0,
2236  0,0,0,0,0,0
2237,
2238  // Character '"' (34)
2239  0,0,0,1,1,0,
2240  0,0,0,1,1,0,
2241  0,0,0,0,0,0,
2242  0,0,0,0,0,0,
2243  0,0,0,0,0,0,
2244  0,0,0,0,0,0,
2245  0,0,0,0,0,0,
2246  0,0,0,0,0,0,
2247  0,0,0,0,0,0,
2248  0,0,0,0,0,0
2249,
2250  // Character '#' (35)
2251  1,1,0,1,1,0,
2252  1,1,0,1,1,0,
2253  0,0,0,0,0,0,
2254  0,0,0,0,0,0,
2255  0,0,0,0,0,0,
2256  0,0,0,0,0,0,
2257  0,0,0,0,0,0,
2258  0,0,0,0,0,0,
2259  0,0,0,0,0,0,
2260  0,0,0,0,0,0
2261,
2262  // Character '$' (36)
2263  0,0,0,0,0,0,
2264  0,0,0,0,0,0,
2265  0,0,0,0,0,0,
2266  1,1,0,0,0,0,
2267  1,1,0,0,0,0,
2268  1,1,0,0,0,0,
2269  0,0,0,0,0,0,
2270  0,0,0,0,0,0,
2271  0,0,0,0,0,0,
2272  0,0,0,0,0,0
2273,
2274  // Character '%' (37)
2275  1,1,0,0,0,0,
2276  1,1,0,0,0,0,
2277  0,0,0,0,0,0,
2278  1,1,0,0,0,0,
2279  1,1,0,0,0,0,
2280  1,1,0,0,0,0,
2281  0,0,0,0,0,0,
2282  0,0,0,0,0,0,
2283  0,0,0,0,0,0,
2284  0,0,0,0,0,0
2285,
2286  // Character '&' (38)
2287  0,0,0,1,1,0,
2288  0,0,0,1,1,0,
2289  0,0,0,0,0,0,
2290  1,1,0,0,0,0,
2291  1,1,0,0,0,0,
2292  1,1,0,0,0,0,
2293  0,0,0,0,0,0,
2294  0,0,0,0,0,0,
2295  0,0,0,0,0,0,
2296  0,0,0,0,0,0
2297,
2298  // Character ''' (39)
2299  1,1,0,1,1,0,
2300  1,1,0,1,1,0,
2301  0,0,0,0,0,0,
2302  1,1,0,0,0,0,
2303  1,1,0,0,0,0,
2304  1,1,0,0,0,0,
2305  0,0,0,0,0,0,
2306  0,0,0,0,0,0,
2307  0,0,0,0,0,0,
2308  0,0,0,0,0,0
2309,
2310  // Character '(' (40)
2311  0,0,0,0,0,0,
2312  0,0,0,0,0,0,
2313  0,0,0,0,0,0,
2314  0,0,0,1,1,0,
2315  0,0,0,1,1,0,
2316  0,0,0,1,1,0,
2317  0,0,0,0,0,0,
2318  0,0,0,0,0,0,
2319  0,0,0,0,0,0,
2320  0,0,0,0,0,0
2321,
2322  // Character ')' (41)
2323  1,1,0,0,0,0,
2324  1,1,0,0,0,0,
2325  0,0,0,0,0,0,
2326  0,0,0,1,1,0,
2327  0,0,0,1,1,0,
2328  0,0,0,1,1,0,
2329  0,0,0,0,0,0,
2330  0,0,0,0,0,0,
2331  0,0,0,0,0,0,
2332  0,0,0,0,0,0
2333,
2334  // Character '*' (42)
2335  0,0,0,1,1,0,
2336  0,0,0,1,1,0,
2337  0,0,0,1,1,0,
2338  0,0,0,0,0,0,
2339  0,0,0,1,1,0,
2340  0,0,0,1,1,0,
2341  0,0,0,0,0,0,
2342  0,0,0,0,0,0,
2343  0,0,0,0,0,0,
2344  0,0,0,0,0,0
2345,
2346  // Character '+' (43)
2347  1,1,0,1,1,0,
2348  1,1,0,1,1,0,
2349  0,0,0,0,0,0,
2350  0,0,0,1,1,0,
2351  0,0,0,1,1,0,
2352  0,0,0,1,1,0,
2353  0,0,0,0,0,0,
2354  0,0,0,0,0,0,
2355  0,0,0,0,0,0,
2356  0,0,0,0,0,0
2357,
2358  // Character ',' (44)
2359  0,0,0,0,0,0,
2360  0,0,0,0,0,0,
2361  0,0,0,0,0,0,
2362  1,1,0,1,1,0,
2363  1,1,0,1,1,0,
2364  1,1,0,1,1,0,
2365  0,0,0,0,0,0,
2366  0,0,0,0,0,0,
2367  0,0,0,0,0,0,
2368  0,0,0,0,0,0
2369,
2370  // Character '-' (45)
2371  1,1,0,0,0,0,
2372  1,1,0,0,0,0,
2373  0,0,0,0,0,0,
2374  1,1,0,1,1,0,
2375  1,1,0,1,1,0,
2376  1,1,0,1,1,0,
2377  0,0,0,0,0,0,
2378  0,0,0,0,0,0,
2379  0,0,0,0,0,0,
2380  0,0,0,0,0,0
2381,
2382  // Character '.' (46)
2383  0,0,0,1,1,0,
2384  0,0,0,1,1,0,
2385  0,0,0,0,0,0,
2386  1,1,0,1,1,0,
2387  1,1,0,1,1,0,
2388  1,1,0,1,1,0,
2389  0,0,0,0,0,0,
2390  0,0,0,0,0,0,
2391  0,0,0,0,0,0,
2392  0,0,0,0,0,0
2393,
2394  // Character '/' (47)
2395  1,1,0,1,1,0,
2396  1,1,0,1,1,0,
2397  0,0,0,0,0,0,
2398  1,1,0,1,1,0,
2399  1,1,0,1,1,0,
2400  1,1,0,1,1,0,
2401  0,0,0,0,0,0,
2402  0,0,0,0,0,0,
2403  0,0,0,0,0,0,
2404  0,0,0,0,0,0
2405,
2406  // Character '0' (48)
2407  0,0,0,0,0,0,
2408  0,0,0,0,0,0,
2409  0,0,0,0,0,0,
2410  0,0,0,0,0,0,
2411  0,0,0,0,0,0,
2412  0,0,0,0,0,0,
2413  0,0,0,0,0,0,
2414  1,1,0,0,0,0,
2415  1,1,0,0,0,0,
2416  0,0,0,0,0,0
2417,
2418  // Character '1' (49)
2419  1,1,0,0,0,0,
2420  1,1,0,0,0,0,
2421  0,0,0,0,0,0,
2422  0,0,0,0,0,0,
2423  0,0,0,0,0,0,
2424  0,0,0,0,0,0,
2425  0,0,0,0,0,0,
2426  1,1,0,0,0,0,
2427  1,1,0,0,0,0,
2428  0,0,0,0,0,0
2429,
2430  // Character '2' (50)
2431  0,0,0,1,1,0,
2432  0,0,0,1,1,0,
2433  0,0,0,0,0,0,
2434  0,0,0,0,0,0,
2435  0,0,0,0,0,0,
2436  0,0,0,0,0,0,
2437  0,0,0,0,0,0,
2438  1,1,0,0,0,0,
2439  1,1,0,0,0,0,
2440  0,0,0,0,0,0
2441,
2442  // Character '3' (51)
2443  1,1,0,1,1,0,
2444  1,1,0,1,1,0,
2445  0,0,0,0,0,0,
2446  0,0,0,0,0,0,
2447  0,0,0,0,0,0,
2448  0,0,0,0,0,0,
2449  0,0,0,0,0,0,
2450  1,1,0,0,0,0,
2451  1,1,0,0,0,0,
2452  0,0,0,0,0,0
2453,
2454  // Character '4' (52)
2455  0,0,0,0,0,0,
2456  0,0,0,0,0,0,
2457  0,0,0,0,0,0,
2458  1,1,0,0,0,0,
2459  1,1,0,0,0,0,
2460  1,1,0,0,0,0,
2461  0,0,0,0,0,0,
2462  1,1,0,0,0,0,
2463  1,1,0,0,0,0,
2464  0,0,0,0,0,0
2465,
2466  // Character '5' (53)
2467  1,1,0,0,0,0,
2468  1,1,0,0,0,0,
2469  0,0,0,0,0,0,
2470  1,1,0,0,0,0,
2471  1,1,0,0,0,0,
2472  1,1,0,0,0,0,
2473  0,0,0,0,0,0,
2474  1,1,0,0,0,0,
2475  1,1,0,0,0,0,
2476  0,0,0,0,0,0
2477,
2478  // Character '6' (54)
2479  0,0,0,1,1,0,
2480  0,0,0,1,1,0,
2481  0,0,0,0,0,0,
2482  1,1,0,0,0,0,
2483  1,1,0,0,0,0,
2484  1,1,0,0,0,0,
2485  0,0,0,0,0,0,
2486  1,1,0,0,0,0,
2487  1,1,0,0,0,0,
2488  0,0,0,0,0,0
2489,
2490  // Character '7' (55)
2491  1,1,0,1,1,0,
2492  1,1,0,1,1,0,
2493  0,0,0,0,0,0,
2494  1,1,0,0,0,0,
2495  1,1,0,0,0,0,
2496  1,1,0,0,0,0,
2497  0,0,0,0,0,0,
2498  1,1,0,0,0,0,
2499  1,1,0,0,0,0,
2500  0,0,0,0,0,0
2501,
2502  // Character '8' (56)
2503  0,0,0,0,0,0,
2504  0,0,0,0,0,0,
2505  0,0,0,0,0,0,
2506  0,0,0,1,1,0,
2507  0,0,0,1,1,0,
2508  0,0,0,1,1,0,
2509  0,0,0,0,0,0,
2510  1,1,0,0,0,0,
2511  1,1,0,0,0,0,
2512  0,0,0,0,0,0
2513,
2514  // Character '9' (57)
2515  1,1,0,0,0,0,
2516  1,1,0,0,0,0,
2517  0,0,0,0,0,0,
2518  0,0,0,1,1,0,
2519  0,0,0,1,1,0,
2520  0,0,0,1,1,0,
2521  0,0,0,0,0,0,
2522  1,1,0,0,0,0,
2523  1,1,0,0,0,0,
2524  0,0,0,0,0,0
2525,
2526  // Character ':' (58)
2527  0,0,0,1,1,0,
2528  0,0,0,1,1,0,
2529  0,0,0,0,0,0,
2530  0,0,0,1,1,0,
2531  0,0,0,1,1,0,
2532  0,0,0,1,1,0,
2533  0,0,0,0,0,0,
2534  1,1,0,0,0,0,
2535  1,1,0,0,0,0,
2536  0,0,0,0,0,0
2537,
2538  // Character ';' (59)
2539  1,1,0,1,1,0,
2540  1,1,0,1,1,0,
2541  0,0,0,0,0,0,
2542  0,0,0,1,1,0,
2543  0,0,0,1,1,0,
2544  0,0,0,1,1,0,
2545  0,0,0,0,0,0,
2546  1,1,0,0,0,0,
2547  1,1,0,0,0,0,
2548  0,0,0,0,0,0
2549,
2550  // Character '<' (60)
2551  0,0,0,0,0,0,
2552  0,0,0,0,0,0,
2553  0,0,0,0,0,0,
2554  1,1,0,1,1,0,
2555  1,1,0,1,1,0,
2556  1,1,0,1,1,0,
2557  0,0,0,0,0,0,
2558  1,1,0,0,0,0,
2559  1,1,0,0,0,0,
2560  0,0,0,0,0,0
2561,
2562  // Character '=' (61)
2563  1,1,0,0,0,0,
2564  1,1,0,0,0,0,
2565  0,0,0,0,0,0,
2566  1,1,0,1,1,0,
2567  1,1,0,1,1,0,
2568  1,1,0,1,1,0,
2569  0,0,0,0,0,0,
2570  1,1,0,0,0,0,
2571  1,1,0,0,0,0,
2572  0,0,0,0,0,0
2573,
2574  // Character '>' (62)
2575  0,0,0,1,1,0,
2576  0,0,0,1,1,0,
2577  0,0,0,0,0,0,
2578  1,1,0,1,1,0,
2579  1,1,0,1,1,0,
2580  1,1,0,1,1,0,
2581  0,0,0,0,0,0,
2582  1,1,0,0,0,0,
2583  1,1,0,0,0,0,
2584  0,0,0,0,0,0
2585,
2586  // Character '?' (63)
2587  1,1,0,1,1,0,
2588  1,1,0,1,1,0,
2589  0,0,0,0,0,0,
2590  1,1,0,1,1,0,
2591  1,1,0,1,1,0,
2592  1,1,0,1,1,0,
2593  0,0,0,0,0,0,
2594  1,1,0,0,0,0,
2595  1,1,0,0,0,0,
2596  0,0,0,0,0,0
2597,
2598  // Character '@' (64)
2599  0,0,0,0,0,0,
2600  0,0,1,1,1,0,
2601  0,1,0,0,0,1,
2602  0,1,0,1,1,1,
2603  0,1,0,1,0,1,
2604  0,1,0,1,1,1,
2605  0,1,0,0,0,0,
2606  0,0,1,1,1,1,
2607  0,0,0,0,0,0,
2608  0,0,0,0,0,0
2609,
2610  // Character 'A' (65)
2611  0,0,0,0,0,0,
2612  0,0,0,1,0,0,
2613  0,0,1,0,1,0,
2614  0,1,0,0,0,1,
2615  0,1,0,0,0,1,
2616  0,1,1,1,1,1,
2617  0,1,0,0,0,1,
2618  0,1,0,0,0,1,
2619  0,0,0,0,0,0,
2620  0,0,0,0,0,0
2621,
2622  // Character 'B' (66)
2623  0,0,0,0,0,0,
2624  0,1,1,1,1,0,
2625  0,1,0,0,0,1,
2626  0,1,0,0,0,1,
2627  0,1,1,1,1,0,
2628  0,1,0,0,0,1,
2629  0,1,0,0,0,1,
2630  0,1,1,1,1,0,
2631  0,0,0,0,0,0,
2632  0,0,0,0,0,0
2633,
2634  // Character 'C' (67)
2635  0,0,0,0,0,0,
2636  0,0,1,1,1,0,
2637  0,1,0,0,0,1,
2638  0,1,0,0,0,0,
2639  0,1,0,0,0,0,
2640  0,1,0,0,0,0,
2641  0,1,0,0,0,1,
2642  0,0,1,1,1,0,
2643  0,0,0,0,0,0,
2644  0,0,0,0,0,0
2645,
2646  // Character 'D' (68)
2647  0,0,0,0,0,0,
2648  0,1,1,1,1,0,
2649  0,1,0,0,0,1,
2650  0,1,0,0,0,1,
2651  0,1,0,0,0,1,
2652  0,1,0,0,0,1,
2653  0,1,0,0,0,1,
2654  0,1,1,1,1,0,
2655  0,0,0,0,0,0,
2656  0,0,0,0,0,0
2657,
2658  // Character 'E' (69)
2659  0,0,0,0,0,0,
2660  0,1,1,1,1,1,
2661  0,1,0,0,0,0,
2662  0,1,0,0,0,0,
2663  0,1,1,1,1,0,
2664  0,1,0,0,0,0,
2665  0,1,0,0,0,0,
2666  0,1,1,1,1,1,
2667  0,0,0,0,0,0,
2668  0,0,0,0,0,0
2669,
2670  // Character 'F' (70)
2671  0,0,0,0,0,0,
2672  0,1,1,1,1,1,
2673  0,1,0,0,0,0,
2674  0,1,0,0,0,0,
2675  0,1,1,1,1,0,
2676  0,1,0,0,0,0,
2677  0,1,0,0,0,0,
2678  0,1,0,0,0,0,
2679  0,0,0,0,0,0,
2680  0,0,0,0,0,0
2681,
2682  // Character 'G' (71)
2683  0,0,0,0,0,0,
2684  0,0,1,1,1,0,
2685  0,1,0,0,0,1,
2686  0,1,0,0,0,0,
2687  0,1,0,0,0,0,
2688  0,1,0,0,1,1,
2689  0,1,0,0,0,1,
2690  0,0,1,1,1,1,
2691  0,0,0,0,0,0,
2692  0,0,0,0,0,0
2693,
2694  // Character 'H' (72)
2695  0,0,0,0,0,0,
2696  0,1,0,0,0,1,
2697  0,1,0,0,0,1,
2698  0,1,0,0,0,1,
2699  0,1,1,1,1,1,
2700  0,1,0,0,0,1,
2701  0,1,0,0,0,1,
2702  0,1,0,0,0,1,
2703  0,0,0,0,0,0,
2704  0,0,0,0,0,0
2705,
2706  // Character 'I' (73)
2707  0,0,0,0,0,0,
2708  0,0,1,1,1,0,
2709  0,0,0,1,0,0,
2710  0,0,0,1,0,0,
2711  0,0,0,1,0,0,
2712  0,0,0,1,0,0,
2713  0,0,0,1,0,0,
2714  0,0,1,1,1,0,
2715  0,0,0,0,0,0,
2716  0,0,0,0,0,0
2717,
2718  // Character 'J' (74)
2719  0,0,0,0,0,0,
2720  0,0,0,0,0,1,
2721  0,0,0,0,0,1,
2722  0,0,0,0,0,1,
2723  0,0,0,0,0,1,
2724  0,0,0,0,0,1,
2725  0,1,0,0,0,1,
2726  0,0,1,1,1,0,
2727  0,0,0,0,0,0,
2728  0,0,0,0,0,0
2729,
2730  // Character 'K' (75)
2731  0,0,0,0,0,0,
2732  0,1,0,0,0,1,
2733  0,1,0,0,1,0,
2734  0,1,0,1,0,0,
2735  0,1,1,0,0,0,
2736  0,1,0,1,0,0,
2737  0,1,0,0,1,0,
2738  0,1,0,0,0,1,
2739  0,0,0,0,0,0,
2740  0,0,0,0,0,0
2741,
2742  // Character 'L' (76)
2743  0,0,0,0,0,0,
2744  0,1,0,0,0,0,
2745  0,1,0,0,0,0,
2746  0,1,0,0,0,0,
2747  0,1,0,0,0,0,
2748  0,1,0,0,0,0,
2749  0,1,0,0,0,0,
2750  0,1,1,1,1,1,
2751  0,0,0,0,0,0,
2752  0,0,0,0,0,0
2753,
2754  // Character 'M' (77)
2755  0,0,0,0,0,0,
2756  0,1,0,0,0,1,
2757  0,1,1,0,1,1,
2758  0,1,0,1,0,1,
2759  0,1,0,0,0,1,
2760  0,1,0,0,0,1,
2761  0,1,0,0,0,1,
2762  0,1,0,0,0,1,
2763  0,0,0,0,0,0,
2764  0,0,0,0,0,0
2765,
2766  // Character 'N' (78)
2767  0,0,0,0,0,0,
2768  0,1,0,0,0,1,
2769  0,1,0,0,0,1,
2770  0,1,1,0,0,1,
2771  0,1,0,1,0,1,
2772  0,1,0,0,1,1,
2773  0,1,0,0,0,1,
2774  0,1,0,0,0,1,
2775  0,0,0,0,0,0,
2776  0,0,0,0,0,0
2777,
2778  // Character 'O' (79)
2779  0,0,0,0,0,0,
2780  0,0,1,1,1,0,
2781  0,1,0,0,0,1,
2782  0,1,0,0,0,1,
2783  0,1,0,0,0,1,
2784  0,1,0,0,0,1,
2785  0,1,0,0,0,1,
2786  0,0,1,1,1,0,
2787  0,0,0,0,0,0,
2788  0,0,0,0,0,0
2789,
2790  // Character 'P' (80)
2791  0,0,0,0,0,0,
2792  0,1,1,1,1,0,
2793  0,1,0,0,0,1,
2794  0,1,0,0,0,1,
2795  0,1,1,1,1,0,
2796  0,1,0,0,0,0,
2797  0,1,0,0,0,0,
2798  0,1,0,0,0,0,
2799  0,0,0,0,0,0,
2800  0,0,0,0,0,0
2801,
2802  // Character 'Q' (81)
2803  0,0,0,0,0,0,
2804  0,0,1,1,1,0,
2805  0,1,0,0,0,1,
2806  0,1,0,0,0,1,
2807  0,1,0,0,0,1,
2808  0,1,0,1,0,1,
2809  0,1,0,0,1,0,
2810  0,0,1,1,0,1,
2811  0,0,0,0,0,0,
2812  0,0,0,0,0,0
2813,
2814  // Character 'R' (82)
2815  0,0,0,0,0,0,
2816  0,1,1,1,1,0,
2817  0,1,0,0,0,1,
2818  0,1,0,0,0,1,
2819  0,1,1,1,1,0,
2820  0,1,0,1,0,0,
2821  0,1,0,0,1,0,
2822  0,1,0,0,0,1,
2823  0,0,0,0,0,0,
2824  0,0,0,0,0,0
2825,
2826  // Character 'S' (83)
2827  0,0,0,0,0,0,
2828  0,0,1,1,1,0,
2829  0,1,0,0,0,1,
2830  0,1,0,0,0,0,
2831  0,0,1,1,1,0,
2832  0,0,0,0,0,1,
2833  0,1,0,0,0,1,
2834  0,0,1,1,1,0,
2835  0,0,0,0,0,0,
2836  0,0,0,0,0,0
2837,
2838  // Character 'T' (84)
2839  0,0,0,0,0,0,
2840  0,1,1,1,1,1,
2841  0,0,0,1,0,0,
2842  0,0,0,1,0,0,
2843  0,0,0,1,0,0,
2844  0,0,0,1,0,0,
2845  0,0,0,1,0,0,
2846  0,0,0,1,0,0,
2847  0,0,0,0,0,0,
2848  0,0,0,0,0,0
2849,
2850  // Character 'U' (85)
2851  0,0,0,0,0,0,
2852  0,1,0,0,0,1,
2853  0,1,0,0,0,1,
2854  0,1,0,0,0,1,
2855  0,1,0,0,0,1,
2856  0,1,0,0,0,1,
2857  0,1,0,0,0,1,
2858  0,0,1,1,1,0,
2859  0,0,0,0,0,0,
2860  0,0,0,0,0,0
2861,
2862  // Character 'V' (86)
2863  0,0,0,0,0,0,
2864  0,1,0,0,0,1,
2865  0,1,0,0,0,1,
2866  0,1,0,0,0,1,
2867  0,0,1,0,1,0,
2868  0,0,1,0,1,0,
2869  0,0,0,1,0,0,
2870  0,0,0,1,0,0,
2871  0,0,0,0,0,0,
2872  0,0,0,0,0,0
2873,
2874  // Character 'W' (87)
2875  0,0,0,0,0,0,
2876  0,1,0,0,0,1,
2877  0,1,0,0,0,1,
2878  0,1,0,0,0,1,
2879  0,1,0,1,0,1,
2880  0,1,0,1,0,1,
2881  0,1,0,1,0,1,
2882  0,0,1,0,1,0,
2883  0,0,0,0,0,0,
2884  0,0,0,0,0,0
2885,
2886  // Character 'X' (88)
2887  0,0,0,0,0,0,
2888  0,1,0,0,0,1,
2889  0,1,0,0,0,1,
2890  0,0,1,0,1,0,
2891  0,0,0,1,0,0,
2892  0,0,1,0,1,0,
2893  0,1,0,0,0,1,
2894  0,1,0,0,0,1,
2895  0,0,0,0,0,0,
2896  0,0,0,0,0,0
2897,
2898  // Character 'Y' (89)
2899  0,0,0,0,0,0,
2900  0,1,0,0,0,1,
2901  0,1,0,0,0,1,
2902  0,0,1,0,1,0,
2903  0,0,0,1,0,0,
2904  0,0,0,1,0,0,
2905  0,0,0,1,0,0,
2906  0,0,0,1,0,0,
2907  0,0,0,0,0,0,
2908  0,0,0,0,0,0
2909,
2910  // Character 'Z' (90)
2911  0,0,0,0,0,0,
2912  0,1,1,1,1,1,
2913  0,0,0,0,0,1,
2914  0,0,0,0,1,0,
2915  0,0,0,1,0,0,
2916  0,0,1,0,0,0,
2917  0,1,0,0,0,0,
2918  0,1,1,1,1,1,
2919  0,0,0,0,0,0,
2920  0,0,0,0,0,0
2921,
2922  // Character '[' (91)
2923  0,0,0,0,0,0,
2924  0,0,0,0,0,0,
2925  0,0,0,1,0,0,
2926  0,0,1,0,0,0,
2927  0,1,1,1,1,1,
2928  0,0,1,0,0,0,
2929  0,0,0,1,0,0,
2930  0,0,0,0,0,0,
2931  0,0,0,0,0,0,
2932  0,0,0,0,0,0
2933,
2934  // Character '\' (92)
2935  0,0,0,0,0,0,
2936  0,1,0,0,0,0,
2937  0,1,0,0,0,0,
2938  0,1,0,0,0,0,
2939  0,1,0,1,1,0,
2940  0,0,0,0,0,1,
2941  0,0,0,0,1,0,
2942  0,0,0,1,0,0,
2943  0,0,0,1,1,1,
2944  0,0,0,0,0,0
2945,
2946  // Character ']' (93)
2947  0,0,0,0,0,0,
2948  0,0,0,0,0,0,
2949  0,0,0,1,0,0,
2950  0,0,0,0,1,0,
2951  0,1,1,1,1,1,
2952  0,0,0,0,1,0,
2953  0,0,0,1,0,0,
2954  0,0,0,0,0,0,
2955  0,0,0,0,0,0,
2956  0,0,0,0,0,0
2957,
2958  // Character '^' (94)
2959  0,0,0,0,0,0,
2960  0,0,0,0,0,0,
2961  0,0,0,1,0,0,
2962  0,0,1,1,1,0,
2963  0,1,0,1,0,1,
2964  0,0,0,1,0,0,
2965  0,0,0,1,0,0,
2966  0,0,0,0,0,0,
2967  0,0,0,0,0,0,
2968  0,0,0,0,0,0
2969,
2970  // Character '_' (95)
2971  0,0,0,0,0,0,
2972  0,0,1,0,1,0,
2973  0,0,1,0,1,0,
2974  0,1,1,1,1,1,
2975  0,0,1,0,1,0,
2976  0,1,1,1,1,1,
2977  0,0,1,0,1,0,
2978  0,0,1,0,1,0,
2979  0,0,0,0,0,0,
2980  0,0,0,0,0,0
2981,
2982  // Character '`' (96)
2983  0,0,0,0,0,0,
2984  0,0,0,0,0,0,
2985  0,0,0,0,0,0,
2986  0,0,0,0,0,0,
2987  0,0,0,0,0,0,
2988  0,0,0,0,0,0,
2989  0,0,0,0,0,0,
2990  0,0,0,1,1,0,
2991  0,0,0,1,1,0,
2992  0,0,0,0,0,0
2993,
2994  // Character 'a' (97)
2995  1,1,0,0,0,0,
2996  1,1,0,0,0,0,
2997  0,0,0,0,0,0,
2998  0,0,0,0,0,0,
2999  0,0,0,0,0,0,
3000  0,0,0,0,0,0,
3001  0,0,0,0,0,0,
3002  0,0,0,1,1,0,
3003  0,0,0,1,1,0,
3004  0,0,0,0,0,0
3005,
3006  // Character 'b' (98)
3007  0,0,0,1,1,0,
3008  0,0,0,1,1,0,
3009  0,0,0,0,0,0,
3010  0,0,0,0,0,0,
3011  0,0,0,0,0,0,
3012  0,0,0,0,0,0,
3013  0,0,0,0,0,0,
3014  0,0,0,1,1,0,
3015  0,0,0,1,1,0,
3016  0,0,0,0,0,0
3017,
3018  // Character 'c' (99)
3019  1,1,0,1,1,0,
3020  1,1,0,1,1,0,
3021  0,0,0,0,0,0,
3022  0,0,0,0,0,0,
3023  0,0,0,0,0,0,
3024  0,0,0,0,0,0,
3025  0,0,0,0,0,0,
3026  0,0,0,1,1,0,
3027  0,0,0,1,1,0,
3028  0,0,0,0,0,0
3029,
3030  // Character 'd' (100)
3031  0,0,0,0,0,0,
3032  0,0,0,0,0,0,
3033  0,0,0,0,0,0,
3034  1,1,0,0,0,0,
3035  1,1,0,0,0,0,
3036  1,1,0,0,0,0,
3037  0,0,0,0,0,0,
3038  0,0,0,1,1,0,
3039  0,0,0,1,1,0,
3040  0,0,0,0,0,0
3041,
3042  // Character 'e' (101)
3043  1,1,0,0,0,0,
3044  1,1,0,0,0,0,
3045  0,0,0,0,0,0,
3046  1,1,0,0,0,0,
3047  1,1,0,0,0,0,
3048  1,1,0,0,0,0,
3049  0,0,0,0,0,0,
3050  0,0,0,1,1,0,
3051  0,0,0,1,1,0,
3052  0,0,0,0,0,0
3053,
3054  // Character 'f' (102)
3055  0,0,0,1,1,0,
3056  0,0,0,1,1,0,
3057  0,0,0,0,0,0,
3058  1,1,0,0,0,0,
3059  1,1,0,0,0,0,
3060  1,1,0,0,0,0,
3061  0,0,0,0,0,0,
3062  0,0,0,1,1,0,
3063  0,0,0,1,1,0,
3064  0,0,0,0,0,0
3065,
3066  // Character 'g' (103)
3067  1,1,0,1,1,0,
3068  1,1,0,1,1,0,
3069  0,0,0,0,0,0,
3070  1,1,0,0,0,0,
3071  1,1,0,0,0,0,
3072  1,1,0,0,0,0,
3073  0,0,0,0,0,0,
3074  0,0,0,1,1,0,
3075  0,0,0,1,1,0,
3076  0,0,0,0,0,0
3077,
3078  // Character 'h' (104)
3079  0,0,0,0,0,0,
3080  0,0,0,0,0,0,
3081  0,0,0,0,0,0,
3082  0,0,0,1,1,0,
3083  0,0,0,1,1,0,
3084  0,0,0,1,1,0,
3085  0,0,0,0,0,0,
3086  0,0,0,1,1,0,
3087  0,0,0,1,1,0,
3088  0,0,0,0,0,0
3089,
3090  // Character 'i' (105)
3091  1,1,0,0,0,0,
3092  1,1,0,0,0,0,
3093  0,0,0,0,0,0,
3094  0,0,0,1,1,0,
3095  0,0,0,1,1,0,
3096  0,0,0,1,1,0,
3097  0,0,0,0,0,0,
3098  0,0,0,1,1,0,
3099  0,0,0,1,1,0,
3100  0,0,0,0,0,0
3101,
3102  // Character 'j' (106)
3103  0,0,0,1,1,0,
3104  0,0,0,1,1,0,
3105  0,0,0,0,0,0,
3106  0,0,0,1,1,0,
3107  0,0,0,1,1,0,
3108  0,0,0,1,1,0,
3109  0,0,0,0,0,0,
3110  0,0,0,1,1,0,
3111  0,0,0,1,1,0,
3112  0,0,0,0,0,0
3113,
3114  // Character 'k' (107)
3115  1,1,0,1,1,0,
3116  1,1,0,1,1,0,
3117  0,0,0,0,0,0,
3118  0,0,0,1,1,0,
3119  0,0,0,1,1,0,
3120  0,0,0,1,1,0,
3121  0,0,0,0,0,0,
3122  0,0,0,1,1,0,
3123  0,0,0,1,1,0,
3124  0,0,0,0,0,0
3125,
3126  // Character 'l' (108)
3127  0,0,0,0,0,0,
3128  0,0,0,0,0,0,
3129  0,0,0,0,0,0,
3130  1,1,0,1,1,0,
3131  1,1,0,1,1,0,
3132  1,1,0,1,1,0,
3133  0,0,0,0,0,0,
3134  0,0,0,1,1,0,
3135  0,0,0,1,1,0,
3136  0,0,0,0,0,0
3137,
3138  // Character 'm' (109)
3139  1,1,0,0,0,0,
3140  1,1,0,0,0,0,
3141  1,1,0,0,0,0,
3142  0,0,0,0,0,0,
3143  1,1,0,1,1,0,
3144  1,1,0,1,1,0,
3145  0,0,0,0,0,0,
3146  0,0,0,1,1,0,
3147  0,0,0,1,1,0,
3148  0,0,0,0,0,0
3149,
3150  // Character 'n' (110)
3151  0,0,0,1,1,0,
3152  0,0,0,1,1,0,
3153  0,0,0,0,0,0,
3154  1,1,0,1,1,0,
3155  1,1,0,1,1,0,
3156  1,1,0,1,1,0,
3157  0,0,0,0,0,0,
3158  0,0,0,1,1,0,
3159  0,0,0,1,1,0,
3160  0,0,0,0,0,0
3161,
3162  // Character 'o' (111)
3163  1,1,0,1,1,0,
3164  1,1,0,1,1,0,
3165  0,0,0,0,0,0,
3166  1,1,0,1,1,0,
3167  1,1,0,1,1,0,
3168  1,1,0,1,1,0,
3169  0,0,0,0,0,0,
3170  0,0,0,1,1,0,
3171  0,0,0,1,1,0,
3172  0,0,0,0,0,0
3173,
3174  // Character 'p' (112)
3175  0,0,0,0,0,0,
3176  0,0,0,0,0,0,
3177  0,0,0,0,0,0,
3178  0,0,0,0,0,0,
3179  0,0,0,0,0,0,
3180  0,0,0,0,0,0,
3181  0,0,0,0,0,0,
3182  1,1,0,1,1,0,
3183  1,1,0,1,1,0,
3184  0,0,0,0,0,0
3185,
3186  // Character 'q' (113)
3187  1,1,0,0,0,0,
3188  1,1,0,0,0,0,
3189  0,0,0,0,0,0,
3190  0,0,0,0,0,0,
3191  0,0,0,0,0,0,
3192  0,0,0,0,0,0,
3193  0,0,0,0,0,0,
3194  1,1,0,1,1,0,
3195  1,1,0,1,1,0,
3196  0,0,0,0,0,0
3197,
3198  // Character 'r' (114)
3199  0,0,0,1,1,0,
3200  0,0,0,1,1,0,
3201  0,0,0,0,0,0,
3202  0,0,0,0,0,0,
3203  0,0,0,0,0,0,
3204  0,0,0,0,0,0,
3205  0,0,0,0,0,0,
3206  1,1,0,1,1,0,
3207  1,1,0,1,1,0,
3208  0,0,0,0,0,0
3209,
3210  // Character 's' (115)
3211  1,1,0,1,1,0,
3212  1,1,0,1,1,0,
3213  0,0,0,0,0,0,
3214  0,0,0,0,0,0,
3215  0,0,0,0,0,0,
3216  0,0,0,0,0,0,
3217  0,0,0,0,0,0,
3218  1,1,0,1,1,0,
3219  1,1,0,1,1,0,
3220  0,0,0,0,0,0
3221,
3222  // Character 't' (116)
3223  0,0,0,0,0,0,
3224  0,0,0,0,0,0,
3225  0,0,0,0,0,0,
3226  1,1,0,0,0,0,
3227  1,1,0,0,0,0,
3228  1,1,0,0,0,0,
3229  0,0,0,0,0,0,
3230  1,1,0,1,1,0,
3231  1,1,0,1,1,0,
3232  0,0,0,0,0,0
3233,
3234  // Character 'u' (117)
3235  1,1,0,0,0,0,
3236  1,1,0,0,0,0,
3237  0,0,0,0,0,0,
3238  1,1,0,0,0,0,
3239  1,1,0,0,0,0,
3240  1,1,0,0,0,0,
3241  0,0,0,0,0,0,
3242  1,1,0,1,1,0,
3243  1,1,0,1,1,0,
3244  0,0,0,0,0,0
3245,
3246  // Character 'v' (118)
3247  0,0,0,1,1,0,
3248  0,0,0,1,1,0,
3249  0,0,0,0,0,0,
3250  1,1,0,0,0,0,
3251  1,1,0,0,0,0,
3252  1,1,0,0,0,0,
3253  0,0,0,0,0,0,
3254  1,1,0,1,1,0,
3255  1,1,0,1,1,0,
3256  0,0,0,0,0,0
3257,
3258  // Character 'w' (119)
3259  1,1,0,1,1,0,
3260  1,1,0,1,1,0,
3261  0,0,0,0,0,0,
3262  1,1,0,0,0,0,
3263  1,1,0,0,0,0,
3264  1,1,0,0,0,0,
3265  0,0,0,0,0,0,
3266  1,1,0,1,1,0,
3267  1,1,0,1,1,0,
3268  0,0,0,0,0,0
3269,
3270  // Character 'x' (120)
3271  0,0,0,0,0,0,
3272  0,0,0,0,0,0,
3273  0,0,0,0,0,0,
3274  0,0,0,1,1,0,
3275  0,0,0,1,1,0,
3276  0,0,0,1,1,0,
3277  0,0,0,0,0,0,
3278  1,1,0,1,1,0,
3279  1,1,0,1,1,0,
3280  0,0,0,0,0,0
3281,
3282  // Character 'y' (121)
3283  1,1,0,0,0,0,
3284  1,1,0,0,0,0,
3285  0,0,0,0,0,0,
3286  0,0,0,1,1,0,
3287  0,0,0,1,1,0,
3288  0,0,0,1,1,0,
3289  0,0,0,0,0,0,
3290  1,1,1,1,1,0,
3291  1,1,1,1,1,0,
3292  0,0,0,0,0,0
3293,
3294  // Character 'z' (122)
3295  0,0,0,1,1,0,
3296  0,0,0,1,1,0,
3297  0,0,0,0,0,0,
3298  0,0,0,1,1,0,
3299  0,0,0,1,1,0,
3300  0,0,0,1,1,0,
3301  0,0,0,0,0,0,
3302  1,1,0,1,1,0,
3303  1,1,0,1,1,0,
3304  0,0,0,0,0,0
3305,
3306  // Character '{' (123)
3307  1,1,0,1,1,0,
3308  1,1,0,1,1,0,
3309  0,0,0,0,0,0,
3310  0,0,0,1,1,0,
3311  0,0,0,1,1,0,
3312  0,0,0,1,1,0,
3313  0,0,0,0,0,0,
3314  1,1,0,1,1,0,
3315  1,1,0,1,1,0,
3316  0,0,0,0,0,0
3317,
3318  // Character '|' (124)
3319  0,0,0,0,0,0,
3320  0,0,0,0,0,0,
3321  0,0,0,0,0,0,
3322  1,1,0,1,1,0,
3323  1,1,0,1,1,0,
3324  1,1,0,1,1,0,
3325  0,0,0,0,0,0,
3326  1,1,0,1,1,0,
3327  1,1,0,1,1,0,
3328  0,0,0,0,0,0
3329,
3330  // Character '}' (125)
3331  1,1,0,0,0,0,
3332  1,1,0,0,0,0,
3333  0,0,0,0,0,0,
3334  1,1,0,1,1,0,
3335  1,1,0,1,1,0,
3336  1,1,0,1,1,0,
3337  0,0,0,0,0,0,
3338  1,1,0,1,1,0,
3339  1,1,0,1,1,0,
3340  0,0,0,0,0,0
3341,
3342  // Character '~' (126)
3343  0,0,0,1,1,0,
3344  0,0,0,1,1,0,
3345  0,0,0,0,0,0,
3346  1,1,0,1,1,0,
3347  1,1,0,1,1,0,
3348  1,1,0,1,1,0,
3349  0,0,0,0,0,0,
3350  1,1,0,1,1,0,
3351  1,1,0,1,1,0,
3352  0,0,0,0,0,0
3353,
3354  // Character '' (127)
3355  1,1,0,1,1,0,
3356  1,1,0,1,1,0,
3357  0,0,0,0,0,0,
3358  1,1,0,1,1,0,
3359  1,1,0,1,1,0,
3360  1,1,0,1,1,0,
3361  0,0,0,0,0,0,
3362  1,1,0,1,1,0,
3363  1,1,0,1,1,0,
3364  0,0,0,0,0,0
3365};
3366
3367
3368typedef struct
3369{
3370   int data;
3371   int lose;
3372
3373   const char *lookup;
3374   const char *graphics;
3375   int colour;
3376   int rcolour;
3377   int bgcolour;
3378   int start_line;
3379   int double_height;
3380   int double_height_set;
3381   int double_height_offset;
3382   int linecount;
3383   int flash;
3384   int holdgraphics;
3385   int lastcode;
3386
3387   int frame_count;
3388   const saa505x_interface *intf;
3389} teletext_t;
3390
3391
3392INLINE teletext_t *get_safe_token( device_t *device )
3393{
3394   assert(device != NULL);
3395   assert(device->type() == SAA505X);
3396
3397   return (teletext_t *)downcast<saa505x_device *>(device)->token();
3398}
3399
3400static DEVICE_START( saa505x )
3401{
3402   teletext_t *tt = get_safe_token(device);
3403   tt->lookup=teletext_saa5050_characters;
3404   tt->graphics=teletext_graphics;
3405   tt->colour=7;
3406   tt->intf = (const saa505x_interface *)device->static_config();
3407}
3408
3409const device_type SAA505X = &device_creator<saa505x_device>;
3410
3411saa505x_device::saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3412   : device_t(mconfig, SAA505X, "SAA505x Video", tag, owner, clock)
3413{
3414   m_token = global_alloc_array_clear(UINT8, sizeof(teletext_t));
3415}
3416
3417//-------------------------------------------------
3418//  device_config_complete - perform any
3419//  operations now that the configuration is
3420//  complete
3421//-------------------------------------------------
3422
3423void saa505x_device::device_config_complete()
3424{
3425}
3426
3427//-------------------------------------------------
3428//  device_start - device-specific startup
3429//-------------------------------------------------
3430
3431void saa505x_device::device_start()
3432{
3433   DEVICE_START_NAME( saa505x )(this);
3434}
3435
3436
3437
3438void teletext_data_w(device_t *device, int offset, int data)
3439{
3440   teletext_t *tt = get_safe_token(device);
3441   tt->data=data & 0x7f;
3442}
3443
3444void teletext_DEW(device_t *device)
3445{
3446   teletext_t *tt = get_safe_token(device);
3447   tt->linecount=18;
3448   tt->double_height=0;
3449   tt->double_height_set=0;
3450   tt->double_height_offset=0;
3451   tt->frame_count=(tt->frame_count+1)%50;
3452}
3453
3454void teletext_LOSE_w(device_t *device, int offset, int data)
3455{
3456   teletext_t *tt = get_safe_token(device);
3457
3458   if ((data)&&(!tt->lose))
3459   {
3460
3461      tt->lookup=teletext_saa5050_characters;
3462      tt->colour=7;
3463      tt->bgcolour=0;
3464      tt->graphics=teletext_graphics;
3465      tt->linecount=(tt->linecount+1)%19;
3466      tt->start_line=0;
3467      tt->double_height=0;
3468      tt->flash=0;
3469      tt->holdgraphics=0;
3470      tt->lastcode=0x20;
3471
3472      // only check the double height stuff if at the first row of a new line
3473      if (!tt->linecount)
3474      {
3475         tt->double_height_offset=((!tt->double_height_set)||tt->double_height_offset)?0:10;
3476         tt->double_height_set=0;
3477      }
3478
3479   }
3480
3481   tt->lose=data;
3482}
3483
3484
3485void teletext_F1(device_t *device)
3486{
3487   teletext_t *tt = get_safe_token(device);
3488   int sc1;
3489   int code;
3490   code=tt->data;
3491
3492   switch (code)
3493   {
3494      // 0x00 Not used
3495
3496      case 0x01: case 0x02: case 0x03: case 0x04:
3497      case 0x05: case 0x06: case 0x07:
3498         tt->lookup=teletext_saa5050_characters;
3499         tt->colour=code;
3500         break;
3501
3502
3503      case 0x08:  // Flash
3504         tt->flash=tt->frame_count<20?1:0;
3505         break;
3506      case 0x09:  // Steady
3507         tt->flash=0;
3508         break;
3509
3510      // 0x0a     End Box    NOT USED
3511      // 0x0b     Start Box  NOT USED
3512
3513      case 0x0c:   // Normal Height
3514         tt->double_height=0;
3515         tt->start_line=0;
3516         break;
3517      case 0x0d:   // Double Height
3518         tt->double_height=1;
3519         tt->double_height_set=1;
3520         tt->start_line=tt->double_height_offset;
3521         break;
3522
3523      // 0x0e     S0         NOT USED
3524      // 0x0f     S1         NOT USED
3525      // 0x10     DLE        NOT USED
3526
3527      case 0x11: case 0x12: case 0x13: case 0x14:
3528      case 0x15: case 0x16: case 0x17:
3529         tt->lookup=tt->graphics;
3530         tt->colour=code&0x07;
3531         break;
3532
3533      // 0x18     Conceal Display
3534
3535      case 0x19:   //  Contiguois Graphics
3536         tt->graphics=teletext_graphics;
3537         if (tt->lookup!=teletext_saa5050_characters)
3538            tt->lookup=tt->graphics;
3539         break;
3540      case 0x1a:   //  Separated Graphics
3541         tt->graphics=teletext_separated_graphics;
3542         if (tt->lookup!=teletext_saa5050_characters)
3543            tt->lookup=tt->graphics;
3544         break;
3545
3546      // 0x1b     ESC        NOT USED
3547
3548      case 0x1c:  //  Black Background
3549         tt->bgcolour=0;
3550         break;
3551      case 0x1d:  //  New Background
3552         tt->bgcolour=tt->colour;
3553         break;
3554
3555      case 0x1e:
3556         tt->holdgraphics=1;
3557         break;
3558
3559      case 0x1f:
3560         tt->holdgraphics=0;
3561         break;
3562   }
3563
3564   if (tt->lose)
3565   {
3566      tt->rcolour=tt->flash?tt->bgcolour:tt->colour;
3567      if (code<0x20) {
3568         if (tt->holdgraphics) {
3569            code=tt->lastcode;
3570         } else {
3571            code=0x20;
3572         }
3573      }
3574      tt->lastcode=code;
3575      code=(code-0x20)*60+(6*(((tt->linecount/2)+tt->start_line)>>tt->double_height));
3576      for(sc1=0;sc1<6;sc1++)
3577      {
3578         (tt->intf->out_Pixel_func)(device,0,tt->lookup[code++]?tt->rcolour:tt->bgcolour);
3579      }
3580   } else {
3581
3582      (tt->intf->out_Pixel_func)(device,0,0);
3583      (tt->intf->out_Pixel_func)(device,0,0);
3584      (tt->intf->out_Pixel_func)(device,0,0);
3585      (tt->intf->out_Pixel_func)(device,0,0);
3586      (tt->intf->out_Pixel_func)(device,0,0);
3587      (tt->intf->out_Pixel_func)(device,0,0);
3588   }
3589}
trunk/src/mess/video/saa505x.h
r17889r17890
1/************************************************************************
2    saa505x
3
4    MESS Driver By:
5
6    Gordon Jefferyes
7    mess_bbc@gjeffery.dircon.co.uk
8
9 ************************************************************************/
10
11
12typedef struct _saa505x_interface saa505x_interface;
13struct _saa505x_interface
14{
15   void (*out_Pixel_func)(device_t *device, int offset, int data);
16};
17
18void teletext_DEW(device_t *device);
19void teletext_LOSE_w(device_t *device, int offset, int data);
20void teletext_data_w(device_t *device, int offset, int data);
21void teletext_F1(device_t *device);
22
23class saa505x_device : public device_t
24{
25public:
26   saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~saa505x_device() { global_free(m_token); }
28
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35private:
36   // internal state
37   void *m_token;
38};
39
40extern const device_type SAA505X;
41
42
43#define MCFG_SAA505X_VIDEO_ADD(_tag, _intf) \
44   MCFG_DEVICE_ADD(_tag, SAA505X, 0) \
45   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/video/abc800.c
r17889r17890
1414#define VERTICAL_PORCH_HACK      29
1515
1616
17static const rgb_t PALETTE[] =
18{
19   RGB_BLACK,
20   MAKE_RGB(0xff, 0x00, 0x00), // red
21   MAKE_RGB(0x00, 0xff, 0x00), // green
22   MAKE_RGB(0xff, 0xff, 0x00), // yellow
23   MAKE_RGB(0x00, 0x00, 0xff), // blue
24   MAKE_RGB(0xff, 0x00, 0xff), // magenta
25   MAKE_RGB(0x00, 0xff, 0xff), // cyan
26   RGB_WHITE
27};
1728
29
30
1831//**************************************************************************
1932//  HIGH RESOLUTION GRAPHICS
2033//**************************************************************************
r17889r17890
5063
5164offs_t abc800c_state::translate_trom_offset(offs_t offset)
5265{
53   int row = offset >> 7;
54   int col = offset & 0x7f;
66   int row = offset / 40;
67   int col = offset % 40;
5568
56   if (col >= 80) row += 16;
57   else if (col >= 40) row += 8;
69   offset = ((row & 0x07) * 0x80) + col;
5870
59   return (row * 40) + (col % 40);
60}
71   if (row & 0x08) offset += 0x28;
72   if (row & 0x10) offset += 0x50;
6173
62
63//-------------------------------------------------
64//  char_ram_r - character RAM read
65//-------------------------------------------------
66
67READ8_MEMBER( abc800c_state::char_ram_r )
68{
69   return saa5050_videoram_r(m_trom, translate_trom_offset(offset));
74   return offset;
7075}
7176
7277
7378//-------------------------------------------------
74//  char_ram_w - character RAM write
75//-------------------------------------------------
76
77WRITE8_MEMBER( abc800c_state::char_ram_w )
78{
79   saa5050_videoram_w(m_trom, translate_trom_offset(offset), data);
80}
81
82
83//-------------------------------------------------
8479//  hr_update - high resolution screen update
8580//-------------------------------------------------
8681
87void abc800c_state::hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect)
82void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
8883{
8984   UINT16 addr = 0;
9085
r17889r17890
10499
105100            if (color)
106101            {
107               rgb_t rgb = palette_entry_get_color(machine().palette, bitmap.pix16(y, x));
108               bool black = !RGB_RED(rgb) && !RGB_GREEN(rgb) && !RGB_BLUE(rgb);
102               bool black = bitmap.pix32(y, x) == RGB_BLACK;
109103               bool opaque = !BIT(fgctl, 3);
110104
111105               if (black || opaque)
112106               {
113                  color += 128;
107                  bitmap.pix32(y, x) = PALETTE[color];
108                  bitmap.pix32(y, x + 1) = PALETTE[color];
114109
115                  bitmap.pix16(y, x) = color;
116                  bitmap.pix16(y, x + 1) = color;
117
118                  bitmap.pix16(y + 1, x) = color;
119                  bitmap.pix16(y + 1, x + 1) = color;
110                  bitmap.pix32(y + 1, x) = PALETTE[color];
111                  bitmap.pix32(y + 1, x + 1) = PALETTE[color];
120112               }
121113            }
122114
r17889r17890
145137
146138
147139//-------------------------------------------------
148//  VIDEO_START( abc800c )
149//-------------------------------------------------
150
151void abc800c_state::video_start()
152{
153   abc800_state::video_start();
154
155   // initialize palette
156   palette_set_color_rgb(machine(), 128+0, 0x00, 0x00, 0x00); // black
157   palette_set_color_rgb(machine(), 128+1, 0xff, 0x00, 0x00); // red
158   palette_set_color_rgb(machine(), 128+2, 0x00, 0xff, 0x00); // green
159   palette_set_color_rgb(machine(), 128+3, 0xff, 0xff, 0x00); // yellow
160   palette_set_color_rgb(machine(), 128+4, 0x00, 0x00, 0xff); // blue
161   palette_set_color_rgb(machine(), 128+5, 0xff, 0x00, 0xff); // magenta
162   palette_set_color_rgb(machine(), 128+6, 0x00, 0xff, 0xff); // cyan
163   palette_set_color_rgb(machine(), 128+7, 0xff, 0xff, 0xff); // white
164}
165
166
167//-------------------------------------------------
168140//  SCREEN_UPDATE( abc800c )
169141//-------------------------------------------------
170142
171UINT32 abc800c_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
143UINT32 abc800c_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
172144{
173145   // clear screen
174   bitmap.fill(get_black_pen(machine()), cliprect);
146   bitmap.fill(RGB_BLACK, cliprect);
175147
176148   // draw text
177149   if (!BIT(m_fgctl, 7))
178150   {
179      saa5050_update(m_trom, bitmap, cliprect);
151      m_trom->screen_update(screen, bitmap, cliprect);
180152   }
181153
182   saa5050_frame_advance(m_trom);
183
184154   // draw HR graphics
185155   hr_update(bitmap, cliprect);
186156
r17889r17890
189159
190160
191161//-------------------------------------------------
192//  saa5050_interface trom_intf
162//  SAA5050_INTERFACE( trom_intf )
193163//-------------------------------------------------
194164
195static const saa5050_interface trom_intf =
165READ8_MEMBER( abc800c_state::char_ram_r )
196166{
197   SCREEN_TAG,
198   0,   // starting gfxnum
199   40, 24, 40,  // x, y, size
200   0   // rev y order
167   return m_char_ram[translate_trom_offset(offset)];
168}
169
170static SAA5050_INTERFACE( trom_intf )
171{
172   DEVCB_DRIVER_MEMBER(abc800c_state, char_ram_r),
173   40, 24, 40  // x, y, size
201174};
202175
203176
r17889r17890
214187   MCFG_SCREEN_SIZE(480, 480)
215188   MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 480-1)
216189
217   MCFG_PALETTE_LENGTH(128+8)
218   MCFG_PALETTE_INIT(saa5050)
219
220   MCFG_GFXDECODE(saa5050)
221
222   MCFG_SAA5050_ADD(SAA5052_TAG, trom_intf)
190   MCFG_SAA5052_ADD(SAA5052_TAG, XTAL_12MHz/2, trom_intf)
223191MACHINE_CONFIG_END
224192
225193
trunk/src/mess/video/p2000m.c
r17889r17890
2020SCREEN_UPDATE_IND16( p2000m )
2121{
2222   p2000t_state *state = screen.machine().driver_data<p2000t_state>();
23   UINT8 *videoram = state->m_p_videoram;
23   UINT8 *videoram = state->m_videoram;
2424   int offs, sx, sy, code, loop;
2525
2626   for (offs = 0; offs < 80 * 24; offs++)
trunk/src/mess/video/bbc.c
r17889r17890
1818
1919#include "emu.h"
2020#include "includes/bbc.h"
21#include "saa505x.h"
21#include "video/saa5050.h"
2222#include "video/mc6845.h"
2323
2424/************************************************************************
r17889r17890
191191
192192static MC6845_UPDATE_ROW( vid_update_row )
193193{
194
195194   bbc_state *state = device->machine().driver_data<bbc_state>();
196195   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
197196
r17889r17890
199198
200199   if (state->m_videoULA_teletext_normal_select)
201200   {
201      state->m_trom->lose_w(1);
202      state->m_trom->lose_w(0);
202203
203         teletext_LOSE_w(state->m_saa505x, 0,0);
204         teletext_LOSE_w(state->m_saa505x, 0,1);
205
206204      for(int x_pos=0; x_pos<x_count; x_pos++)
207205      {
208206         //Teletext Latch bits 0 to 5 go to bits 0 to 5 on the Teletext chip
r17889r17890
211209
212210         returned_pixel_count=0;
213211
212         state->m_trom->write((state->m_Teletext_Latch&0x3f)|(state->m_Teletext_Latch&0x40));
214213
215         teletext_F1(state->m_saa505x);
214         state->m_trom->f1_w(1);
215         state->m_trom->f1_w(0);
216216
217         teletext_data_w(state->m_saa505x, 0, (state->m_Teletext_Latch&0x3f)|(state->m_Teletext_Latch&0x40));
218
219217         if (((ma>>13)&1)==0)
220218         {
221219            state->m_Teletext_Latch=0;
222220         } else {
223            state->m_Teletext_Latch=(state->m_BBC_Video_RAM[calculate_video_address(state,ma+x_pos,ra)]&0x7f);
221            state->m_Teletext_Latch=(state->m_BBC_Video_RAM[calculate_video_address(state,ma+x_pos,ra)]);
224222         }
225223         for(int pixelno=0;pixelno<6;pixelno++)
226224         {
227            int col=returned_pixels[pixelno];
225            state->m_trom->tr6_w(1);
226            state->m_trom->tr6_w(0);
228227
229               bitmap.pix32(y, (x_pos*state->m_pixels_per_byte)+pixelno)=palette[col];
230         }
228            int col=state->m_trom->get_rgb();
231229
230            int r = BIT(col, 0) * 0xff;
231            int g = BIT(col, 1) * 0xff;
232            int b = BIT(col, 2) * 0xff;
232233
234            rgb_t rgb = MAKE_RGB(r, g, b);
235
236            bitmap.pix32(y, (x_pos*state->m_pixels_per_byte)+pixelno) = rgb;
237         }
233238      }
239
240      if (ra == 18)
241      {
242         state->m_trom->lose_w(1);
243         state->m_trom->lose_w(0);
244      }
234245   }
235246   else
236247   {
r17889r17890
268279static WRITE_LINE_DEVICE_HANDLER( bbc_vsync )
269280{
270281   bbc_state *bstate = device->machine().driver_data<bbc_state>();
271   teletext_DEW(bstate->m_saa505x);
282   bstate->m_trom->dew_w(state);
272283}
273284
274285
r17889r17890
287298};
288299
289300
290void bbc_draw_RGB_in(device_t *device, int offset,int data)
291{
292   if (returned_pixel_count<6)
293      returned_pixels[returned_pixel_count++]=7-data;
294301
295}
296302
297
298
299
300303/************************************************************************
301304 * memory interface to BBC's 6845
302305 ************************************************************************/
r17889r17890
360363   state->m_VideoULA_CR_counter = 0;
361364
362365   set_pixel_lookup(state);
363   state->m_saa505x = machine.device("saa505x");
364366
365367   state->m_BBC_Video_RAM = state->memregion("maincpu")->base();
366368   state->m_memorySize=memorySize;
trunk/src/mess/drivers/a6809.c
r17889r17890
2222public:
2323   a6809_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag),
25        m_via(*this, "via")
25        m_via(*this, "via"),
26        m_videoram(*this, "videoram")
2627   { }
2728
2829   required_device<via6522_device> m_via;
30   required_shared_ptr<UINT8> m_videoram;
2931
3032   DECLARE_READ8_MEMBER( via_pb_r );
3133   DECLARE_WRITE8_MEMBER( kb_w );
34   DECLARE_READ8_MEMBER( videoram_r );
3235
3336   UINT8 m_keydata;
3437   virtual void machine_reset();
r17889r17890
3841static ADDRESS_MAP_START(a6809_mem, AS_PROGRAM, 8, a6809_state)
3942   ADDRESS_MAP_UNMAP_HIGH
4043   AM_RANGE(0x0000,0x03ff) AM_RAM
41   AM_RANGE(0x0400,0x07ff) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
44   AM_RANGE(0x0400,0x07ff) AM_RAM AM_SHARE("videoram")
4245   AM_RANGE(0x0800,0x0800) AM_DEVWRITE("mc6845", mc6845_device, address_w)
4346   AM_RANGE(0x0801,0x0801) AM_DEVREADWRITE("mc6845", mc6845_device, register_r, register_w)
4447   AM_RANGE(0x0900,0x090f) AM_MIRROR(0xf0) AM_DEVREADWRITE("via", via6522_device, read, write)
r17889r17890
5962{
6063}
6164
62static SCREEN_UPDATE_IND16( a6809 )
63{
64   device_t *saa5050 = screen.machine().device("saa5050");
65
66   saa5050_update(saa5050, bitmap, cliprect);
67   saa5050_frame_advance(saa5050);
68
69   return 0;
70}
71
7265static MC6845_UPDATE_ROW( a6809_update_row )
7366{
7467}
r17889r17890
8780   NULL
8881};
8982
90static const saa5050_interface a6809_saa5050_intf =
83READ8_MEMBER( a6809_state::videoram_r )
9184{
92   "screen",
93   0,   /* starting gfxnum */
94   40, 25, 40,  /* x, y, size */
95   0   /* rev y order */
85   return m_videoram[offset];
86}
87
88static SAA5050_INTERFACE( a6809_saa5050_intf )
89{
90   DEVCB_DRIVER_MEMBER(a6809_state, videoram_r),
91   40, 25, 40  /* x, y, size */
9692};
9793
9894READ8_MEMBER( a6809_state::via_pb_r )
r17889r17890
140136   /* video hardware */
141137   MCFG_SCREEN_ADD("screen", RASTER)
142138   MCFG_SCREEN_REFRESH_RATE(50)
143   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK))
139   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
144140   MCFG_SCREEN_SIZE(40 * 12, 24 * 20)
145141   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
146   MCFG_SCREEN_UPDATE_STATIC(a6809)
142   MCFG_SCREEN_UPDATE_DEVICE("saa5050", saa5050_device, screen_update)
147143
148   MCFG_GFXDECODE(saa5050)
149   MCFG_PALETTE_LENGTH(128)
150   MCFG_PALETTE_INIT(saa5050)
144   MCFG_SAA5050_ADD("saa5050", 6000000, a6809_saa5050_intf)
151145
152   MCFG_SAA5050_ADD("saa5050", a6809_saa5050_intf)
153
154146   MCFG_VIA6522_ADD("via", XTAL_4MHz / 4, via_intf)
155147
156148   MCFG_MC6845_ADD("mc6845", MC6845, XTAL_4MHz / 2, a6809_crtc6845_interface)
r17889r17890
165157
166158   ROM_REGION( 0x100, "proms", 0 )
167159   ROM_LOAD( "acorn6809.ic11", 0x0000, 0x0100, CRC(7908317d) SHA1(e0f1e5bd3a8598d3b62bc432dd1f3892ed7e66d8) ) // address decoder
168
169   ROM_REGION(0x01000, "gfx1",0)
170   ROM_LOAD( "p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc) ) // copied from p2000t.c
171160ROM_END
172161
173162/* Driver */
trunk/src/mess/drivers/poly.c
r17889r17890
3939public:
4040   poly_state(const machine_config &mconfig, device_type type, const char *tag)
4141      : driver_device(mconfig, type, tag),
42   m_maincpu(*this, "maincpu"),
43   m_pia0(*this, "pia0"),
44   m_pia1(*this, "pia1")
42        m_maincpu(*this, "maincpu"),
43        m_pia0(*this, "pia0"),
44        m_pia1(*this, "pia1"),
45        m_videoram(*this, "videoram")
4546   { }
4647
4748   required_device<cpu_device> m_maincpu;
4849   required_device<pia6821_device> m_pia0;
4950   required_device<pia6821_device> m_pia1;
51   required_shared_ptr<UINT8> m_videoram;
5052   DECLARE_WRITE8_MEMBER(kbd_put);
5153   DECLARE_READ8_MEMBER(pia1_b_in);
5254   DECLARE_READ_LINE_MEMBER(pia1_cb1_in);
55   DECLARE_READ8_MEMBER(videoram_r);
5356   UINT8 m_term_data;
5457   bool m_term_key;
5558   virtual void machine_reset();
r17889r17890
7073   AM_RANGE(0xe050,0xe05f) AM_RAM //Dynamic Address Translater (arranges memory banks)
7174   // AM_RANGE(0xe060,0xe060) Select Map 1
7275   // AM_RANGE(0xe070,0xe070) Select Map 2
73   AM_RANGE(0xe800,0xebbf) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
76   AM_RANGE(0xe800,0xebbf) AM_RAM AM_SHARE("videoram")
7477   AM_RANGE(0xebc0,0xebff) AM_RAM
7578   AM_RANGE(0xec00,0xefbf) AM_RAM // screen 2 AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
7679   AM_RANGE(0xefc0,0xefff) AM_RAM
r17889r17890
142145   DEVCB_NULL
143146};
144147
145static SCREEN_UPDATE_IND16( poly )
148READ8_MEMBER( poly_state::videoram_r )
146149{
147   device_t *saa5050 = screen.machine().device("saa5050");
148
149   saa5050_update(saa5050, bitmap, cliprect);
150   saa5050_frame_advance(saa5050);
151
152   return 0;
150   return m_videoram[offset];
153151}
154152
155
156static const saa5050_interface poly_saa5050_intf =
153static SAA5050_INTERFACE( poly_saa5050_intf )
157154{
158   "screen",
159   0,   /* starting gfxnum */
160   40, 24, 40,  /* x, y, size */
161   0   /* rev y order */
155   DEVCB_DRIVER_MEMBER(poly_state, videoram_r),
156   40, 24, 40  /* x, y, size */
162157};
163158
164159// temporary hack
r17889r17890
185180   /* video hardware */
186181   MCFG_SCREEN_ADD("screen", RASTER)
187182   MCFG_SCREEN_REFRESH_RATE(50)
188   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK))
183   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
189184   MCFG_SCREEN_SIZE(40 * 12, 24 * 20)
190185   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
191   MCFG_SCREEN_UPDATE_STATIC(poly)
192   MCFG_GFXDECODE(saa5050)
193   MCFG_PALETTE_LENGTH(128)
194   MCFG_PALETTE_INIT(saa5050)
186   MCFG_SCREEN_UPDATE_DEVICE("saa5050", saa5050_device, screen_update)
195187
196188   /* Devices */
197   MCFG_SAA5050_ADD("saa5050", poly_saa5050_intf)
189   MCFG_SAA5050_ADD("saa5050", 6000000, poly_saa5050_intf)
198190   MCFG_PIA6821_ADD( "pia0", poly_pia0_intf )
199191   MCFG_PIA6821_ADD( "pia1", poly_pia1_intf )
200192   MCFG_PTM6840_ADD("ptm", poly_ptm_intf)
r17889r17890
222214   ROMX_LOAD( "v2bas3.bin", 0xc000, 0x1000, CRC(04a58be5) SHA1(729fa02c76783213e40bb179e60c09d4b439ab90), ROM_BIOS(2) )
223215   ROMX_LOAD( "v2bas4.bin", 0x9000, 0x1000, CRC(328fe790) SHA1(43dca92092b27627603d3588f91cf9eca24ed29f), ROM_BIOS(2) )
224216   ROMX_LOAD( "slrt14_00f9.bin", 0xf000, 0x1000, CRC(6559a2ce) SHA1(7c38f449ca122342732123b56992ed0c446406c2), ROM_BIOS(2) )
225
226   /* This is SAA5050 came with poly emulator, identical to p2000t */
227   ROM_REGION(0x01000, "gfx1",0)
228   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc))
229217ROM_END
230218
231219/* Driver */
trunk/src/mess/drivers/p2000t.c
r17889r17890
4747static ADDRESS_MAP_START( p2000t_mem, AS_PROGRAM, 8, p2000t_state )
4848   AM_RANGE(0x0000, 0x0fff) AM_ROM
4949   AM_RANGE(0x1000, 0x4fff) AM_ROM
50   AM_RANGE(0x5000, 0x57ff) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
50   AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("videoram")
5151   AM_RANGE(0x5800, 0x9fff) AM_RAM
5252   AM_RANGE(0xa000, 0xffff) AM_NOP
5353ADDRESS_MAP_END
r17889r17890
5555static ADDRESS_MAP_START( p2000m_mem, AS_PROGRAM, 8, p2000t_state )
5656   AM_RANGE(0x0000, 0x0fff) AM_ROM
5757   AM_RANGE(0x1000, 0x4fff) AM_ROM
58   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_SHARE("p_videoram")
58   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_SHARE("videoram")
5959   AM_RANGE(0x6000, 0x9fff) AM_RAM
6060   AM_RANGE(0xa000, 0xffff) AM_NOP
6161ADDRESS_MAP_END
r17889r17890
207207   device->machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
208208}
209209
210
211static SCREEN_UPDATE_IND16( p2000t )
210READ8_MEMBER( p2000t_state::videoram_r )
212211{
213   device_t *saa5050 = screen.machine().device("saa5050");
214
215   saa5050_update(saa5050, bitmap, cliprect);
216   saa5050_frame_advance(saa5050);
217
218   return 0;
212   return m_videoram[offset];
219213}
220214
221static const saa5050_interface p2000t_saa5050_intf =
215static SAA5050_INTERFACE( p2000t_saa5050_intf )
222216{
223   "screen",
224   0,   /* starting gfxnum */
225   40, 24 - 1, 80,  /* x, y, size */
226   0   /* rev y order */
217   DEVCB_DRIVER_MEMBER(p2000t_state, videoram_r),
218   40, 24 - 1, 80  /* x, y, size */
227219};
228220
229221/* Machine definition */
r17889r17890
237229   /* video hardware */
238230   MCFG_SCREEN_ADD("screen", RASTER)
239231   MCFG_SCREEN_REFRESH_RATE(50)
240   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK))
232   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
241233   MCFG_SCREEN_SIZE(40 * 12, 24 * 20)
242234   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
243   MCFG_SCREEN_UPDATE_STATIC(p2000t)
244   MCFG_GFXDECODE(saa5050)
245   MCFG_PALETTE_LENGTH(128)
246   MCFG_PALETTE_INIT(saa5050)
235   MCFG_SCREEN_UPDATE_DEVICE("saa5050", saa5050_device, screen_update)
247236
248   MCFG_SAA5050_ADD("saa5050", p2000t_saa5050_intf)
237   MCFG_SAA5050_ADD("saa5050", 6000000, p2000t_saa5050_intf)
249238
250239   /* sound hardware */
251240   MCFG_SPEAKER_STANDARD_MONO("mono")
r17889r17890
286275   ROM_REGION(0x10000, "maincpu",0)
287276   ROM_LOAD("p2000.rom", 0x0000, 0x1000, CRC(650784a3) SHA1(4dbb28adad30587f2ea536ba116898d459faccac))
288277   ROM_LOAD("basic.rom", 0x1000, 0x4000, CRC(9d9d38f9) SHA1(fb5100436c99634a2592a10dff867f85bcff7aec))
289   ROM_REGION(0x01000, "gfx1",0)
290   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc))
291278ROM_END
292279
293280ROM_START(p2000m)
294281   ROM_REGION(0x10000, "maincpu",0)
295282   ROM_LOAD("p2000.rom", 0x0000, 0x1000, CRC(650784a3) SHA1(4dbb28adad30587f2ea536ba116898d459faccac))
296283   ROM_LOAD("basic.rom", 0x1000, 0x4000, CRC(9d9d38f9) SHA1(fb5100436c99634a2592a10dff867f85bcff7aec))
284
297285   ROM_REGION(0x01000, "gfx1",0)
298286   ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc))
299287ROM_END
trunk/src/mess/drivers/abc80x.c
r17889r17890
418418   ADDRESS_MAP_UNMAP_HIGH
419419   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("video_ram")
420420   AM_RANGE(0x4000, 0x7bff) AM_ROM
421   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(char_ram_r, char_ram_w)
421   AM_RANGE(0x7c00, 0x7fff) AM_RAM AM_SHARE("char_ram")
422422   AM_RANGE(0x8000, 0xffff) AM_RAM
423423ADDRESS_MAP_END
424424
trunk/src/mess/drivers/bbc.c
r17889r17890
2626#include "formats/uef_cas.h"
2727#include "formats/csw_cas.h"
2828#include "sound/sn76496.h"
29#include "video/saa505x.h"
29#include "video/saa5050.h"
3030#include "includes/bbc.h"
3131
3232
r17889r17890
772772   NULL
773773};
774774
775static const saa505x_interface bbc_saa505x_intf =
775
776static SAA5050_INTERFACE( trom_intf )
776777{
777   bbc_draw_RGB_in,
778   DEVCB_NULL,
779   40, 24, 40  // x, y, size
778780};
779781
780782static const mc6854_interface adlc_intf =
r17889r17890
854856
855857   MCFG_PALETTE_LENGTH(16)
856858   MCFG_PALETTE_INIT_OVERRIDE(bbc_state,bbc)
857   MCFG_SAA505X_VIDEO_ADD("saa505x", bbc_saa505x_intf)
859   MCFG_SAA5050_ADD("saa505x", XTAL_12MHz/2, trom_intf)
858860
859861    MCFG_MC6845_ADD("mc6845",MC6845,2000000, bbc_mc6845_intf)
860862
r17889r17890
948950   MCFG_PALETTE_INIT_OVERRIDE(bbc_state,bbc)
949951   MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update)
950952
951   MCFG_SAA505X_VIDEO_ADD("saa505x", bbc_saa505x_intf)
953   MCFG_SAA5050_ADD("saa505x", XTAL_12MHz/2, trom_intf)
952954
953955    MCFG_MC6845_ADD("mc6845",MC6845,2000000, bbc_mc6845_intf)
954956
trunk/src/mess/mess.mak
r17889r17890
543543   $(MESS_VIDEO)/hd44780.o      \
544544   $(MESS_VIDEO)/hd66421.o      \
545545   $(MESS_VIDEO)/mc6847.o      \
546   $(MESS_VIDEO)/saa505x.o      \
547546   $(MESS_VIDEO)/tms3556.o      \
548547   $(MESS_VIDEO)/upd7220.o      \
549548   $(MESS_MACHINE)/applefdc.o   \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team