Previous 199869 Revisions Next

r20222 Saturday 12th January, 2013 at 20:17:04 UTC by Wilbert Pol
(MESS) odyssey2: Changed #defines into constants; moved some code around. (nw)
[src/mess/drivers]odyssey2.c
[src/mess/includes]odyssey2.h
[src/mess/video]odyssey2.c

trunk/src/mess/drivers/odyssey2.c
r20221r20222
129129INPUT_PORTS_END
130130
131131
132/* character sprite colors
133   dark grey, red, green, orange, blue, violet, light grey, white
134   dark back / grid colors
135   black, dark blue, dark green, light green, red, violet, orange, light grey
136   light back / grid colors
137   black, blue, green, light green, red, violet, orange, light grey */
138
139const UINT8 odyssey2_colors[] =
140{
141   /* Background,Grid Dim */
142   0x00,0x00,0x00,                  // i r g b
143   0x00,0x00,0xFF,   /* Blue */      // i r g B
144   0x00,0x80,0x00,   /* DK Green */   // i r G b
145   0xff,0x9b,0x60,                  // i r G B
146   0xCC,0x00,0x00,   /* Red */         // i R g b
147   0xa9,0x80,0xff,                  // i R g B
148   0x82,0xfd,0xdb,                  // i R G b
149   0xFF,0xFF,0xFF,                  // i R G B
150
151   /* Background,Grid Bright */
152   0x80,0x80,0x80,                  // I r g b
153   0x50,0xAE,0xFF,   /* Blue */      // I r g B
154   0x00,0xFF,0x00,   /* Dk Green */   // I r G b
155   0x82,0xfb,0xdb,   /* Lt Grey */      // I r G B
156   0xEC,0x02,0x60,   /* Red */         // I R g b
157   0xa9,0x80,0xff,   /* Violet */      // I R g B
158   0xff,0x9b,0x60,   /* Orange */      // I R G b
159   0xFF,0xFF,0xFF,                  // I R G B
160
161   /* Character,Sprite colors */
162   0x80,0x80,0x80,   /* Dark Grey */   // I r g b
163   0xFF,0x80,0x80,   /* Red */         // I R g b
164   0x00,0xC0,0x00,   /* Green */      // I r G b
165   0xff,0x9b,0x60,   /* Orange */      // I R G b
166   0x50,0xAE,0xFF,   /* Blue */      // I r g B
167   0xa9,0x80,0xff,   /* Violet */      // I R g B
168   0x82,0xfb,0xdb,   /* Lt Grey */      // I r G B
169   0xff,0xff,0xff,   /* White */      // I R G B
170
171   /* EF9340/EF9341 colors */
172   0x00, 0x00, 0x00,
173   0x00, 0x00, 0xFF,
174   0x00, 0xFF, 0x00,
175   0x00, 0xFF, 0xFF,
176   0xFF, 0x00, 0x00,
177   0xFF, 0x00, 0xFF,
178   0xFF, 0xFF, 0x00,
179   0xFF, 0xFF, 0xFF
180};
181
182
183void odyssey2_state::palette_init()
184{
185   int i;
186
187   for ( i = 0; i < 32; i++ )
188   {
189      palette_set_color_rgb( machine(), i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
190   }
191}
192
193
132194WRITE_LINE_MEMBER(odyssey2_state::irq_callback)
133195{
134196   m_maincpu->set_input_line(0, state);
r20221r20222
324386}
325387
326388
389UINT32 odyssey2_state::screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
390{
391   return m_i8244->screen_update(screen, bitmap, cliprect);
392}
393
394
327395READ8_MEMBER(odyssey2_state::t1_read)
328396{
329397   if ( m_i8244->vblank() || m_i8244->hblank() )
trunk/src/mess/includes/odyssey2.h
r20221r20222
1111#include "video/i8244.h"
1212
1313
14#define P1_BANK_LO_BIT            (0x01)
15#define P1_BANK_HI_BIT            (0x02)
16#define P1_KEYBOARD_SCAN_ENABLE   (0x04)  /* active low */
17#define P1_VDC_ENABLE             (0x08)  /* active low */
18#define P1_EXT_RAM_ENABLE         (0x10)  /* active low */
19#define P1_VDC_COPY_MODE_ENABLE   (0x40)
20
21#define P2_KEYBOARD_SELECT_MASK   (0x07)  /* select row to scan */
22
23#define I824X_START_ACTIVE_SCAN         6
24#define I824X_END_ACTIVE_SCAN           (6 + 160)
25#define I824X_START_Y                   1
26#define I824X_SCREEN_HEIGHT             243
27#define I824X_LINE_CLOCKS               228
28
2914struct ef9341_t
3015{
3116   UINT8   TA;
r20221r20222
9782   DECLARE_WRITE16_MEMBER(scanline_postprocess);
9883
9984protected:
85   /* constants */
86   static const UINT8 P1_BANK_LO_BIT          = 0x01;
87   static const UINT8 P1_BANK_HI_BIT          = 0x02;
88   static const UINT8 P1_KEYBOARD_SCAN_ENABLE = 0x04; /* active low */
89   static const UINT8 P1_VDC_ENABLE           = 0x08; /* active low */
90   static const UINT8 P1_EXT_RAM_ENABLE       = 0x10; /* active low */
91   static const UINT8 P1_VDC_COPY_MODE_ENABLE = 0x40;
92   static const UINT8 P2_KEYBOARD_SELECT_MASK = 0x07; /* select row to scan */
93
10094   ef9340_t m_ef9340;
10195   ef9341_t m_ef9341;
10296   UINT8   m_ef934x_ram_a[1024];
trunk/src/mess/video/odyssey2.c
r20221r20222
1515#include "video/ef9341_chargen.h"
1616
1717
18#define COLLISION_SPRITE_0          0x01
19#define COLLISION_SPRITE_1          0x02
20#define COLLISION_SPRITE_2          0x04
21#define COLLISION_SPRITE_3          0x08
22#define COLLISION_VERTICAL_GRID     0x10
23#define COLLISION_HORIZ_GRID_DOTS   0x20
24#define COLLISION_EXTERNAL_UNUSED   0x40
25#define COLLISION_CHARACTERS        0x80
18#define I824X_START_ACTIVE_SCAN         6
19#define I824X_END_ACTIVE_SCAN           (6 + 160)
20#define I824X_START_Y                   1
21#define I824X_SCREEN_HEIGHT             243
22#define I824X_LINE_CLOCKS               228
2623
27/* character sprite colors
28   dark grey, red, green, orange, blue, violet, light grey, white
29   dark back / grid colors
30   black, dark blue, dark green, light green, red, violet, orange, light grey
31   light back / grid colors
32   black, blue, green, light green, red, violet, orange, light grey */
3324
34const UINT8 odyssey2_colors[] =
35{
36   /* Background,Grid Dim */
37   0x00,0x00,0x00,                  // i r g b
38   0x00,0x00,0xFF,   /* Blue */      // i r g B
39   0x00,0x80,0x00,   /* DK Green */   // i r G b
40   0xff,0x9b,0x60,                  // i r G B
41   0xCC,0x00,0x00,   /* Red */         // i R g b
42   0xa9,0x80,0xff,                  // i R g B
43   0x82,0xfd,0xdb,                  // i R G b
44   0xFF,0xFF,0xFF,                  // i R G B
45
46   /* Background,Grid Bright */
47   0x80,0x80,0x80,                  // I r g b
48   0x50,0xAE,0xFF,   /* Blue */      // I r g B
49   0x00,0xFF,0x00,   /* Dk Green */   // I r G b
50   0x82,0xfb,0xdb,   /* Lt Grey */      // I r G B
51   0xEC,0x02,0x60,   /* Red */         // I R g b
52   0xa9,0x80,0xff,   /* Violet */      // I R g B
53   0xff,0x9b,0x60,   /* Orange */      // I R G b
54   0xFF,0xFF,0xFF,                  // I R G B
55
56   /* Character,Sprite colors */
57   0x80,0x80,0x80,   /* Dark Grey */   // I r g b
58   0xFF,0x80,0x80,   /* Red */         // I R g b
59   0x00,0xC0,0x00,   /* Green */      // I r G b
60   0xff,0x9b,0x60,   /* Orange */      // I R G b
61   0x50,0xAE,0xFF,   /* Blue */      // I r g B
62   0xa9,0x80,0xff,   /* Violet */      // I R g B
63   0x82,0xfb,0xdb,   /* Lt Grey */      // I r G B
64   0xff,0xff,0xff,   /* White */      // I R G B
65
66   /* EF9340/EF9341 colors */
67   0x00, 0x00, 0x00,
68   0x00, 0x00, 0xFF,
69   0x00, 0xFF, 0x00,
70   0x00, 0xFF, 0xFF,
71   0xFF, 0x00, 0x00,
72   0xFF, 0x00, 0xFF,
73   0xFF, 0xFF, 0x00,
74   0xFF, 0xFF, 0xFF
75};
76
77
78void odyssey2_state::palette_init()
79{
80   int i;
81
82   for ( i = 0; i < 32; i++ )
83   {
84      palette_set_color_rgb( machine(), i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
85   }
86}
87
88
8925void odyssey2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
9026{
9127   int vpos = m_screen->vpos();
r20221r20222
14379}
14480
14581
146/***************************************************************************
14782
148  Refresh the video screen
149
150***************************************************************************/
151
152UINT32 odyssey2_state::screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
153{
154   return m_i8244->screen_update(screen, bitmap, cliprect);
155}
156
157
15883/*
15984    Thomson EF9340/EF9341 extra chips in the g7400
16085 */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team