Previous 15994 Revisions Next

r4445 Monday 30th March, 2009 at 02:57:43 UTC by Robbbert
[TRS80] WIP oops forgot a file
[src/mess/video]trs80.c

src/mess/video/trs80.c
r4444r4445
4848/* 7 or 8-bit video, 32/64 characters per line = trs80, trs80l2, sys80 */
4949VIDEO_UPDATE( trs80 )
5050{
51   UINT8 y,ra,chr,gfx;
51   UINT8 y,ra,chr,gfx,gfxbit;
5252   UINT16 sy=0,ma=0,x;
5353   UINT8 *FNT = memory_region(screen->machine, "gfx1");
5454   UINT8 seven_bit = screen->machine->gamedrv->flags >> 24;
55   static UINT8 size_store=0;
55   static UINT8 size_store=0xff;
5656   static UINT8 cols=64,skip=1;
57   UINT8 lores1,lores2;
5857
5958   if ((trs80_mode & 0x7f) != size_store)
6059   {
r4444r4445
7675
7776            if (chr & 0x80)
7877            {
79               lores1 = 1<<((ra & 0x0c)>>1);
80               lores2 = lores1<<1;
78               gfxbit = 1<<((ra & 0x0c)>>1);
8179               /* Display one line of a lores character (6 pixels) */
82               *p = ( chr & lores1 ) ? 1 : 0; p++;
83               *p = ( chr & lores1 ) ? 1 : 0; p++;
84               *p = ( chr & lores1 ) ? 1 : 0; p++;
85               *p = ( chr & lores2 ) ? 1 : 0; p++;
86               *p = ( chr & lores2 ) ? 1 : 0; p++;
87               *p = ( chr & lores2 ) ? 1 : 0; p++;
80               *p = ( chr & gfxbit ) ? 1 : 0; p++;
81               *p = ( chr & gfxbit ) ? 1 : 0; p++;
82               *p = ( chr & gfxbit ) ? 1 : 0; p++;
83               gfxbit = gfxbit<<1;
84               *p = ( chr & gfxbit ) ? 1 : 0; p++;
85               *p = ( chr & gfxbit ) ? 1 : 0; p++;
86               *p = ( chr & gfxbit ) ? 1 : 0; p++;
8887            }
8988            else
9089            {
r4444r4445
111110   return 0;
112111}
113112
113/* 8-bit video, 32/64/40/80 characters per line = trs80m3, trs80m4.
114   The proper character generator is not dumped, and has extra characters in the 192-255 range. */
115VIDEO_UPDATE( trs80m4 )
116{
117   UINT8 y,ra,chr,gfx,gfxbit;
118   UINT16 sy=0,ma=0,x;
119   UINT8 *FNT = memory_region(screen->machine, "gfx1");
120   static UINT8 size_store=0xff;
121   static UINT8 cols=64,rows=16,skip=1,s_cols;
114122
123   if ((trs80_mode & 0x7f) != size_store)
124   {
125      size_store = trs80_mode & 0x7f;
126      s_cols = cols = (trs80_mode & 4) ? 80 : 64;
127      rows = (trs80_mode & 4) ? 24 : 16;
128
129      if (trs80_mode & 1)
130      {
131         s_cols >>= 1;
132         skip = 2;
133      }
134      video_screen_set_visarea(screen, 0, s_cols*FW-1, 0, rows*FH-1);
135   }
136
137   for (y = 0; y < rows; y++)
138   {
139      for (ra = 0; ra < FH; ra++)
140      {
141         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
142
143         for (x = ma; x < ma + cols; x+=skip)
144         {
145            chr = videoram[x+start_address];
146
147            if ((chr & 0x80) && (~trs80_mode & 8))
148            {
149               gfxbit = 1<<((ra & 0x0c)>>1);
150               /* Display one line of a lores character (6 pixels) */
151               *p = ( chr & gfxbit ) ? 1 : 0; p++;
152               *p = ( chr & gfxbit ) ? 1 : 0; p++;
153               *p = ( chr & gfxbit ) ? 1 : 0; p++;
154               gfxbit <<= 1;
155               *p = ( chr & gfxbit ) ? 1 : 0; p++;
156               *p = ( chr & gfxbit ) ? 1 : 0; p++;
157               *p = ( chr & gfxbit ) ? 1 : 0; p++;
158            }
159            else
160            {
161               /* get pattern of pixels for that character scanline */
162               if (ra < 8)
163                  gfx = FNT[((chr&0x7f)<<3) | ra ];
164               else
165                  gfx = 0;
166
167               /* if inverse mode, and bit 7 set, invert gfx */
168               if ((trs80_mode & 8) && (chr & 0x80))
169                  gfx ^= 0xff;
170
171               /* Display a scanline of a character (6 pixels) */
172               *p = ( gfx & 0x20 ) ? 1 : 0; p++;
173               *p = ( gfx & 0x10 ) ? 1 : 0; p++;
174               *p = ( gfx & 0x08 ) ? 1 : 0; p++;
175               *p = ( gfx & 0x04 ) ? 1 : 0; p++;
176               *p = ( gfx & 0x02 ) ? 1 : 0; p++;
177               *p = ( gfx & 0x01 ) ? 1 : 0; p++;
178            }
179         }
180      }
181      ma+=cols;
182   }
183   return 0;
184}
185
115186/* 7 or 8-bit video, 64/32 characters per line = ht1080z, ht1080z2, ht108064 */     
116187VIDEO_UPDATE( ht1080z )
117188{
118   UINT8 y,ra,chr,gfx;
189   UINT8 y,ra,chr,gfx,gfxbit;
119190   UINT16 sy=0,ma=0,x;
120191   UINT8 *FNT = memory_region(screen->machine, "gfx1");
121192   UINT8 seven_bit = screen->machine->gamedrv->flags >> 24;
122   static UINT8 size_store=0;
193   static UINT8 size_store=0xff;
123194   static UINT8 cols=64,skip=1;
124   UINT8 lores1,lores2;
125195
126196   if ((trs80_mode & 0x7f) != size_store)
127197   {
r4444r4445
143213
144214            if (chr & 0x80)
145215            {
146               lores1 = 1<<((ra & 0x0c)>>1);
147               lores2 = lores1<<1;
216               gfxbit = 1<<((ra & 0x0c)>>1);
148217               /* Display one line of a lores character (6 pixels) */
149               *p = ( chr & lores1 ) ? 1 : 0; p++;
150               *p = ( chr & lores1 ) ? 1 : 0; p++;
151               *p = ( chr & lores1 ) ? 1 : 0; p++;
152               *p = ( chr & lores2 ) ? 1 : 0; p++;
153               *p = ( chr & lores2 ) ? 1 : 0; p++;
154               *p = ( chr & lores2 ) ? 1 : 0; p++;
218               *p = ( chr & gfxbit ) ? 1 : 0; p++;
219               *p = ( chr & gfxbit ) ? 1 : 0; p++;
220               *p = ( chr & gfxbit ) ? 1 : 0; p++;
221               gfxbit = gfxbit<<1;
222               *p = ( chr & gfxbit ) ? 1 : 0; p++;
223               *p = ( chr & gfxbit ) ? 1 : 0; p++;
224               *p = ( chr & gfxbit ) ? 1 : 0; p++;
155225            }
156226            else
157227            {
r4444r4445
178248VIDEO_UPDATE( lnw80 )
179249{
180250   const UINT16 rows[] = { 0, 0x200, 0x100, 0x300, 1, 0x201, 0x101, 0x301 };
181   UINT8 y,ra,chr,gfx;
251   UINT8 y,ra,chr,gfx,gfxbit;
182252   UINT16 sy=0,ma=0,x;
183253   UINT8 *FNT = memory_region(screen->machine, "gfx1");
184   static UINT8 size_store=0;
254   static UINT8 size_store=0xff;
185255   static UINT8 cols=64,skip=1;
186   UINT8 lores1,lores2;
187256
188257   if ((trs80_mode & 0x7f) != size_store)
189258   {
r4444r4445
205274
206275            if (chr & 0x80)
207276            {
208               lores1 = 1<<((ra & 0x0c)>>1);
209               lores2 = lores1<<1;
277               gfxbit = 1<<((ra & 0x0c)>>1);
210278               /* Display one line of a lores character (6 pixels) */
211               *p = ( chr & lores1 ) ? 1 : 0; p++;
212               *p = ( chr & lores1 ) ? 1 : 0; p++;
213               *p = ( chr & lores1 ) ? 1 : 0; p++;
214               *p = ( chr & lores2 ) ? 1 : 0; p++;
215               *p = ( chr & lores2 ) ? 1 : 0; p++;
216               *p = ( chr & lores2 ) ? 1 : 0; p++;
279               *p = ( chr & gfxbit ) ? 1 : 0; p++;
280               *p = ( chr & gfxbit ) ? 1 : 0; p++;
281               *p = ( chr & gfxbit ) ? 1 : 0; p++;
282               gfxbit = gfxbit<<1;
283               *p = ( chr & gfxbit ) ? 1 : 0; p++;
284               *p = ( chr & gfxbit ) ? 1 : 0; p++;
285               *p = ( chr & gfxbit ) ? 1 : 0; p++;
217286            }
218287            else
219288            {
r4444r4445
238307   return 0;
239308}
240309
241
310/* lores characters are in the character generator. Each character is 8x16. */
242311VIDEO_UPDATE( radionic )
243312{
244313   UINT8 y,ra,chr,gfx;
245314   UINT16 sy=0,ma=0,x;
246315   UINT8 *FNT = memory_region(screen->machine, "gfx1");
247   static UINT8 size_store=0;
316   static UINT8 size_store=0xff;
248317   static UINT8 cols=64,skip=1;
249   UINT8 lores1,lores2;
250318
251319   if ((trs80_mode & 0x7f) != size_store)
252320   {
253321      size_store = trs80_mode & 0x7f;
254322      cols = (trs80_mode & 1) ? 32 : 64;
255323      skip = (trs80_mode & 1) ? 2 : 1;
256      video_screen_set_visarea(screen, 0, cols*FW-1, 0, 16*FH-1);
324      video_screen_set_visarea(screen, 0, cols*8-1, 0, 16*16-1);
257325   }
258326
259327   for (y = 0; y < 16; y++)
260328   {
261      for (ra = 0; ra < FH; ra++)
329      for (ra = 0; ra < 16; ra++)
262330      {
263331         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
264332
r4444r4445
266334         {
267335            chr = videoram[x];
268336
269            if ((chr & 0xc0) == 0x80)
270            {
271               lores1 = 1<<((ra & 0x0c)>>1);
272               lores2 = lores1<<1;
273               /* Display one line of a lores character (6 pixels) */
274               *p = ( chr & lores1 ) ? 1 : 0; p++;
275               *p = ( chr & lores1 ) ? 1 : 0; p++;
276               *p = ( chr & lores1 ) ? 1 : 0; p++;
277               *p = ( chr & lores2 ) ? 1 : 0; p++;
278               *p = ( chr & lores2 ) ? 1 : 0; p++;
279               *p = ( chr & lores2 ) ? 1 : 0; p++;
280            }
281            else
282            {
283               /* get pattern of pixels for that character scanline */
284               if (ra < 8)
285                  gfx = FNT[(chr<<3) | ra ];
286               else
287                  gfx = FNT[(chr<<3) | (ra & 7) | 0x800];
337            /* get pattern of pixels for that character scanline */
338            gfx = FNT[(chr<<3) | (ra & 7) | (ra & 8) << 8];
288339
289               /* Display a scanline of a character (6 pixels) */
290               *p = ( gfx & 0x01 ) ? 1 : 0; p++;
291               *p = ( gfx & 0x02 ) ? 1 : 0; p++;
292               *p = ( gfx & 0x04 ) ? 1 : 0; p++;
293               *p = ( gfx & 0x08 ) ? 1 : 0; p++;
294               *p = ( gfx & 0x10 ) ? 1 : 0; p++;
295               *p = ( gfx & 0x20 ) ? 1 : 0; p++;
296            }
340            /* Display a scanline of a character (8 pixels) */
341            *p = ( gfx & 0x01 ) ? 1 : 0; p++;
342            *p = ( gfx & 0x02 ) ? 1 : 0; p++;
343            *p = ( gfx & 0x04 ) ? 1 : 0; p++;
344            *p = ( gfx & 0x08 ) ? 1 : 0; p++;
345            *p = ( gfx & 0x10 ) ? 1 : 0; p++;
346            *p = ( gfx & 0x20 ) ? 1 : 0; p++;
347            *p = ( gfx & 0x40 ) ? 1 : 0; p++;
348            *p = ( gfx & 0x80 ) ? 1 : 0; p++;
297349         }
298350      }
299351      ma+=64;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team