src/mess/drivers/pc6001.c
| r5919 | r5920 | |
| 13 | 13 | so this implementation will be used in the end. |
| 14 | 14 | B) It's easier to me to see what the attribute vram does since I don't |
| 15 | 15 | have any docs atm. |
| 16 | - IRQ vector 0x06 is clearly used on some games otherwise they locks, |
| 17 | check what is supposed to be. |
| 16 | 18 | |
| 17 | 19 | ================================================================================== |
| 18 | 20 | |
| r5919 | r5920 | |
| 72 | 74 | irq vector 00: writes 0x00 to [$fa19] |
| 73 | 75 | irq vector 02: (A = 0, B = 0) tests ppi port c, does something with ay ports (plus more?) ;keyboard data ready, no kanji lock, no caps lock |
| 74 | 76 | irq vector 04: uart irq |
| 75 | | irq vector 06: operates with $fa28, $fa2e, $fd1b |
| 77 | irq vector 06: operates with $fa28, $fa2e, $fd1b ;hblank? joypad irq? |
| 76 | 78 | irq vector 08: tests ppi port c, puts port A to $fa1d,puts 0x02 to [$fa19] ;tape data ready |
| 77 | 79 | irq vector 0A: writes 0x00 to [$fa19] |
| 78 | 80 | irq vector 0C: writes 0x00 to [$fa19] |
| r5919 | r5920 | |
| 97 | 99 | static UINT8 irq_vector = 0x00; |
| 98 | 100 | static UINT8 cas_switch,sys_latch; |
| 99 | 101 | |
| 102 | #define CAS_LENGTH 0x1655 |
| 103 | |
| 100 | 104 | static VIDEO_START( pc6001 ) |
| 101 | 105 | { |
| 102 | 106 | #if 0 |
| r5919 | r5920 | |
| 109 | 113 | cfg.get_char_rom = pc6001_get_char_rom; |
| 110 | 114 | m6847_init(machine, &cfg); |
| 111 | 115 | #endif |
| 112 | | pc6001_video_ram = auto_alloc_array(machine, UINT8, 0x1000); //0x400? We'll see... |
| 116 | pc6001_video_ram = auto_alloc_array(machine, UINT8, 0x2000); //0x400? We'll see... |
| 113 | 117 | } |
| 114 | 118 | |
| 115 | 119 | static VIDEO_UPDATE( pc6001 ) |
| r5919 | r5920 | |
| 119 | 123 | int tile,attr,pen,color; |
| 120 | 124 | int fgcol; |
| 121 | 125 | |
| 122 | | for(y=0;y<16;y++) |
| 126 | attr = pc6001_video_ram[0]; |
| 127 | |
| 128 | if(attr & 0x80) // 128x192 4 colors mode |
| 123 | 129 | { |
| 124 | | for(x=0;x<32;x++) |
| 130 | int shrink_x = 2*4; |
| 131 | int shrink_y = (attr & 8) ? 1 : 2; |
| 132 | int w = (shrink_x == 8) ? 32 : 16; |
| 133 | |
| 134 | for(y=0;y<(192/shrink_y);y++) |
| 125 | 135 | { |
| 126 | | tile = pc6001_video_ram[(x+(y*32))+0x200]; |
| 127 | | attr = pc6001_video_ram[(x+(y*32)) & 0x1ff] ; |
| 128 | | |
| 129 | | if(attr & 0x40) |
| 136 | for(x=0;x<w;x++) |
| 130 | 137 | { |
| 131 | | pen = (tile & 0xc0) >> 6 | (attr & 2)<<1; |
| 138 | tile = pc6001_video_ram[(x+(y*32))+0x200]; |
| 132 | 139 | |
| 133 | | for(yi=0;yi<12;yi++) |
| 140 | for(yi=0;yi<shrink_y;yi++) |
| 134 | 141 | { |
| 135 | | for(xi=0;xi<8;xi++) |
| 142 | for(xi=0;xi<shrink_x;xi++) |
| 136 | 143 | { |
| 137 | 144 | int i; |
| 138 | | i = (xi & 4)>>2; //x-axis |
| 139 | | i+= (yi & 4)>>1; //y-axis 1 |
| 140 | | i+= (yi & 8)>>1; //y-axis 2 |
| 145 | i = (shrink_x == 8) ? (xi & 0x06) : (xi & 0x0c)>>1; |
| 146 | color = ((tile >> i) & 3)+8; |
| 141 | 147 | |
| 142 | | color = ((tile >> i) & 1) ? pen+8 : 0; |
| 143 | | |
| 144 | | *BITMAP_ADDR16(bitmap, ((y*12+(11-yi))+24), (x*8+(7-xi))+32) = screen->machine->pens[color]; |
| 148 | *BITMAP_ADDR16(bitmap, ((y*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = screen->machine->pens[color]; |
| 145 | 149 | } |
| 146 | 150 | } |
| 147 | 151 | } |
| 148 | | else |
| 152 | } |
| 153 | } |
| 154 | else // text mode |
| 155 | { |
| 156 | for(y=0;y<16;y++) |
| 157 | { |
| 158 | for(x=0;x<32;x++) |
| 149 | 159 | { |
| 150 | | for(yi=0;yi<12;yi++) |
| 160 | tile = pc6001_video_ram[(x+(y*32))+0x200]; |
| 161 | attr = pc6001_video_ram[(x+(y*32)) & 0x1ff]; |
| 162 | |
| 163 | if(attr & 0x40) |
| 151 | 164 | { |
| 152 | | for(xi=0;xi<8;xi++) |
| 165 | pen = (tile & 0xc0) >> 6 | (attr & 2)<<1; |
| 166 | |
| 167 | for(yi=0;yi<12;yi++) |
| 153 | 168 | { |
| 154 | | pen = gfx_data[(tile*0x10)+yi]>>(7-xi) & 1; |
| 169 | for(xi=0;xi<8;xi++) |
| 170 | { |
| 171 | int i; |
| 172 | i = (xi & 4)>>2; //x-axis |
| 173 | i+= (yi & 4)>>1; //y-axis 1 |
| 174 | i+= (yi & 8)>>1; //y-axis 2 |
| 155 | 175 | |
| 156 | | fgcol = (attr & 2) ? 2 : 7; |
| 176 | color = ((tile >> i) & 1) ? pen+8 : 0; |
| 157 | 177 | |
| 158 | | if(attr & 1) |
| 159 | | color = pen ? 0 : fgcol; |
| 160 | | else |
| 161 | | color = pen ? fgcol : 0; |
| 178 | *BITMAP_ADDR16(bitmap, ((y*12+(11-yi))+24), (x*8+(7-xi))+32) = screen->machine->pens[color]; |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | else |
| 183 | { |
| 184 | for(yi=0;yi<12;yi++) |
| 185 | { |
| 186 | for(xi=0;xi<8;xi++) |
| 187 | { |
| 188 | pen = gfx_data[(tile*0x10)+yi]>>(7-xi) & 1; |
| 162 | 189 | |
| 190 | fgcol = (attr & 2) ? 2 : 7; |
| 191 | |
| 192 | if(attr & 1) |
| 193 | color = pen ? 0 : fgcol; |
| 194 | else |
| 195 | color = pen ? fgcol : 0; |
| 196 | |
| 163 | 197 | *BITMAP_ADDR16(bitmap, ((y*12+yi)+24), (x*8+xi)+32) = screen->machine->pens[color]; |
| 198 | } |
| 164 | 199 | } |
| 165 | 200 | } |
| 166 | 201 | } |
| r5919 | r5920 | |
| 472 | 507 | { |
| 473 | 508 | cur_keycode = gfx_data[i++]; |
| 474 | 509 | //popmessage("%04x",i); |
| 475 | | if(i >= 0x34c6) |
| 510 | if(i >= CAS_LENGTH) |
| 476 | 511 | { |
| 477 | 512 | i = 0; |
| 478 | 513 | cas_switch = 0; |
| r5919 | r5920 | |
| 592 | 627 | ROM_LOAD( "cgrom60.60", 0x0000, 0x1000, CRC(b0142d32) SHA1(9570495b10af5b1785802681be94b0ea216a1e26) ) |
| 593 | 628 | |
| 594 | 629 | ROM_REGION( 0x10000, "cas", ROMREGION_ERASEFF ) |
| 595 | | /* Load here your tape for now (and change line 475 with the length value that MESS returns) */ |
| 596 | | //ROM_LOAD( "demo.cas", 0x0000, 0x34c6, CRC(1) SHA1(1) ) |
| 630 | /* Load here your tape for now (and change the cas length macro according to what MESS returns) */ |
| 631 | // ROM_LOAD( "car.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) ) |
| 597 | 632 | ROM_END |
| 598 | 633 | |
| 599 | 634 | ROM_START( pc6001a ) |