trunk/src/mess/includes/thomson.h
| r31952 | r31953 | |
| 259 | 259 | void to9_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 260 | 260 | void bitmap4_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 261 | 261 | void bitmap4alt_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 262 | void bitmap4althalf_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 262 | 263 | void bitmap16_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 263 | 264 | void mode80_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 264 | 265 | void mode80_to9_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| r31952 | r31953 | |
| 271 | 272 | void to9_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 272 | 273 | void bitmap4_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 273 | 274 | void bitmap4alt_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 275 | void bitmap4althalf_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 274 | 276 | void bitmap16_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 275 | 277 | void mode80_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| 276 | 278 | void mode80_to9_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); |
| r31952 | r31953 | |
| 306 | 308 | WRITE_LINE_MEMBER( fdc_index_3_w ); |
| 307 | 309 | void thomson_index_callback(legacy_floppy_image_device *device, int state); |
| 308 | 310 | DECLARE_PALETTE_INIT(thom); |
| 311 | DECLARE_PALETTE_INIT(mo5); |
| 309 | 312 | |
| 310 | 313 | optional_device<mc6854_device> m_mc6854; |
| 311 | 314 | |
| r31952 | r31953 | |
| 519 | 522 | void thom_set_mode_point( int point ); |
| 520 | 523 | void thom_floppy_active( int write ); |
| 521 | 524 | unsigned to7_lightpen_gpl( int decx, int decy ); |
| 525 | void thom_configure_palette( double gamma, const UINT16* pal, palette_device& palette ); |
| 522 | 526 | |
| 523 | 527 | int thom_floppy_make_addr( chrn_id id, UINT8* dst, int sector_size ); |
| 524 | 528 | int thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, UINT8* dst, int sector_size ); |
| r31952 | r31953 | |
| 602 | 606 | #define THOM_VMODE_OVERLAY3 9 |
| 603 | 607 | #define THOM_VMODE_TO9 10 |
| 604 | 608 | #define THOM_VMODE_80_TO9 11 |
| 605 | | #define THOM_VMODE_NB 12 |
| 609 | #define THOM_VMODE_BITMAP4_ALT_HALF 12 |
| 610 | #define THOM_VMODE_NB 13 |
| 606 | 611 | |
| 607 | 612 | |
| 608 | 613 | class to7_io_line_device : public device_t |
trunk/src/mess/video/thomson.c
| r31952 | r31953 | |
| 495 | 495 | END_UPDATE |
| 496 | 496 | |
| 497 | 497 | |
| 498 | /* 160x200, 4 colors, no constraint, using only one memory page (undocumented) */ |
| 498 | 499 | |
| 500 | UPDATE_HI( bitmap4althalf ) |
| 501 | { |
| 502 | dst[ 0] = dst[ 1] = dst[ 2] = dst[ 3] = pal[ rama >> 6 ]; |
| 503 | dst[ 4] = dst[ 5] = dst[ 6] = dst[ 7] = pal[ (rama >> 4) & 3 ]; |
| 504 | dst[ 8] = dst[ 9] = dst[10] = dst[11] = pal[ (rama >> 2) & 3]; |
| 505 | dst[12] = dst[13] = dst[14] = dst[15] = pal[ rama & 3 ]; |
| 506 | (void)ramb; // ramb is not used |
| 507 | } |
| 508 | END_UPDATE |
| 509 | |
| 510 | UPDATE_LOW( bitmap4althalf ) |
| 511 | { |
| 512 | dst[0] = dst[1] = pal[ rama >> 6 ]; |
| 513 | dst[2] = dst[3] = pal[ (rama >> 4) & 3 ]; |
| 514 | dst[4] = dst[5] = pal[ (rama >> 2) & 3]; |
| 515 | dst[6] = dst[7] = pal[ rama & 3 ]; |
| 516 | (void)ramb; // ramb is not used |
| 517 | } |
| 518 | END_UPDATE |
| 519 | |
| 520 | |
| 521 | |
| 499 | 522 | /* 160x200, 16-colors, no constraint */ |
| 500 | 523 | |
| 501 | 524 | UPDATE_HI( bitmap16 ) |
| r31952 | r31953 | |
| 702 | 725 | FUN(to770), FUN(mo5), FUN(bitmap4), FUN(bitmap4alt), FUN(mode80), |
| 703 | 726 | FUN(bitmap16), FUN(page1), FUN(page2), FUN(overlay), FUN(overlay3), |
| 704 | 727 | FUN(to9), FUN(mode80_to9), |
| 728 | FUN(bitmap4althalf), |
| 705 | 729 | }; |
| 706 | 730 | |
| 707 | 731 | |
| r31952 | r31953 | |
| 1002 | 1026 | /* -------------- initialization --------------- */ |
| 1003 | 1027 | |
| 1004 | 1028 | |
| 1005 | | |
| 1029 | /* TO7, TO7/70 palette, hardcoded in ROM |
| 1030 | without further information, we assume that the hardcoded values |
| 1031 | are the same as those setup by the TO8/TO9+/MO6 when booting up |
| 1032 | */ |
| 1006 | 1033 | static const UINT16 thom_pal_init[16] = |
| 1007 | 1034 | { |
| 1008 | 1035 | 0x1000, /* 0: black */ 0x000f, /* 1: red */ |
| r31952 | r31953 | |
| 1012 | 1039 | 0x0777, /* 8: gray */ 0x033a, /* 9: pink */ |
| 1013 | 1040 | 0x03a3, /* a: light green */ 0x03aa, /* b: light yellow */ |
| 1014 | 1041 | 0x0a33, /* c: light blue */ 0x0a3a, /* d: redish pink */ |
| 1015 | | 0x0ee7, /* e: light cyan */ 0x003b, /* f: orange */ |
| 1042 | 0x0ee7, /* e: light cyan */ 0x007b, /* f: orange */ |
| 1016 | 1043 | }; |
| 1017 | 1044 | |
| 1045 | /* MO5 palette, hardcoded in a ROM |
| 1046 | values are from "Manuel Technique du MO5", p.19 |
| 1047 | */ |
| 1048 | static const UINT16 mo5_pal_init[16] = |
| 1049 | { |
| 1050 | 0x1000, /* 0: black */ 0x055f, /* 1: red */ |
| 1051 | 0x00f0, /* 2: geen */ 0x00ff, /* 3: yellow */ |
| 1052 | 0x0f55, /* 4: blue */ 0x0f0f, /* 5: purple */ |
| 1053 | 0x0ff5, /* 6: cyan */ 0x0fff, /* 7: white */ |
| 1054 | 0x0aaa, /* 8: gray */ 0x0aaf, /* 9: pink */ |
| 1055 | 0x0afa, /* a: light green */ 0x0aff, /* b: light yellow */ |
| 1056 | 0x0fa5, /* c: light blue */ 0x0faf, /* d: parama pink */ |
| 1057 | 0x0ffa, /* e: light cyan */ 0x05af, /* f: orange */ |
| 1058 | }; |
| 1018 | 1059 | |
| 1019 | 1060 | |
| 1020 | 1061 | VIDEO_START_MEMBER( thomson_state, thom ) |
| r31952 | r31953 | |
| 1022 | 1063 | LOG (( "thom: video start called\n" )); |
| 1023 | 1064 | |
| 1024 | 1065 | /* scan-line state */ |
| 1025 | | memcpy( m_thom_last_pal, thom_pal_init, 32 ); |
| 1026 | | memcpy( m_thom_pal, thom_pal_init, 32 ); |
| 1027 | 1066 | memset( m_thom_border_l, 0xff, sizeof( m_thom_border_l ) ); |
| 1028 | 1067 | memset( m_thom_border_r, 0xff, sizeof( m_thom_border_r ) ); |
| 1029 | 1068 | memset( m_thom_vbody, 0, sizeof( m_thom_vbody ) ); |
| r31952 | r31953 | |
| 1082 | 1121 | } |
| 1083 | 1122 | |
| 1084 | 1123 | |
| 1085 | | |
| 1086 | | PALETTE_INIT_MEMBER(thomson_state, thom) |
| 1124 | /* sets the fixed palette (for MO5,TO7,TO7/70) and gamma correction */ |
| 1125 | void thomson_state::thom_configure_palette(double gamma, const UINT16* pal, palette_device& palette) |
| 1087 | 1126 | { |
| 1088 | | double gamma = 0.6f; |
| 1089 | | unsigned i; |
| 1127 | memcpy( m_thom_last_pal, pal, 32 ); |
| 1128 | memcpy( m_thom_pal, pal, 32 ); |
| 1090 | 1129 | |
| 1091 | | LOG (( "thom: palette init called\n" )); |
| 1092 | | |
| 1093 | | for ( i = 0; i < 4097; i++ ) |
| 1130 | for ( int i = 0; i < 4097; i++ ) |
| 1094 | 1131 | { |
| 1095 | 1132 | UINT8 r = 255. * pow( (i & 15) / 15., gamma ); |
| 1096 | 1133 | UINT8 g = 255. * pow( ((i>> 4) & 15) / 15., gamma ); |
| r31952 | r31953 | |
| 1101 | 1138 | } |
| 1102 | 1139 | |
| 1103 | 1140 | |
| 1141 | PALETTE_INIT_MEMBER(thomson_state, thom) |
| 1142 | { |
| 1143 | LOG (( "thom: palette init called\n" )); |
| 1104 | 1144 | |
| 1145 | /* TO8 and later use an EF9369 color palette chip |
| 1146 | The spec shows a built-in gamma correction for gamma=2.8 |
| 1147 | i.e., output is out = in ^ (1/2.8) |
| 1148 | |
| 1149 | For the TO7, the gamma correction is irrelevant. |
| 1150 | |
| 1151 | For the TO7/70, we use the same palette and gamma has the TO8, |
| 1152 | which gives good results (but is not verified). |
| 1153 | */ |
| 1154 | thom_configure_palette(1.0 / 2.8, thom_pal_init, palette); |
| 1155 | } |
| 1156 | |
| 1157 | PALETTE_INIT_MEMBER(thomson_state, mo5) |
| 1158 | { |
| 1159 | LOG (( "thom: MO5 palette init called\n" )); |
| 1160 | |
| 1161 | /* The MO5 has a different fixed palette than the TO7/70. |
| 1162 | We use a smaller gamma correction which gives intutively better |
| 1163 | results (but is not verified). |
| 1164 | */ |
| 1165 | thom_configure_palette(1.0, mo5_pal_init, palette); |
| 1166 | } |
| 1167 | |
| 1168 | |
| 1169 | |
| 1105 | 1170 | /***************************** TO7 / T9000 *************************/ |
| 1106 | 1171 | |
| 1107 | 1172 | |