trunk/src/mess/machine/apple3.c
| r243707 | r243708 | |
| 240 | 240 | result = 0x00; |
| 241 | 241 | break; |
| 242 | 242 | |
| 243 | | case 0xd9: |
| 244 | | popmessage("Smooth scroll enabled, contact MESSdev"); |
| 243 | case 0xd8: case 0xd9: |
| 244 | m_smoothscr = offset & 1; |
| 245 | 245 | break; |
| 246 | 246 | |
| 247 | 247 | case 0xDB: |
| 248 | 248 | apple3_write_charmem(); |
| 249 | 249 | break; |
| 250 | 250 | |
| 251 | | case 0xE0: case 0xE1: case 0xE2: case 0xE3: |
| 252 | | case 0xE4: case 0xE5: case 0xE6: case 0xE7: |
| 253 | | case 0xE8: case 0xE9: case 0xEA: case 0xEB: |
| 254 | | case 0xEC: case 0xED: case 0xEE: case 0xEF: |
| 251 | case 0xE0: case 0xE1: |
| 255 | 252 | result = m_fdc->read(space, offset&0xf); |
| 253 | m_va = offset & 1; |
| 256 | 254 | break; |
| 257 | 255 | |
| 256 | case 0xE2: case 0xE3: |
| 257 | result = m_fdc->read(space, offset&0xf); |
| 258 | m_vb = offset & 1; |
| 259 | break; |
| 260 | |
| 261 | case 0xE4: case 0xE5: |
| 262 | result = m_fdc->read(space, offset&0xf); |
| 263 | m_vc = offset & 1; |
| 264 | break; |
| 265 | |
| 266 | case 0xE6: case 0xE7: case 0xE8: case 0xE9: |
| 267 | case 0xEA: case 0xEB: case 0xEC: case 0xED: |
| 268 | case 0xEE: case 0xEF: |
| 269 | result = m_fdc->read(space, offset&0xf); |
| 270 | break; |
| 271 | |
| 258 | 272 | case 0xF0: |
| 259 | 273 | case 0xF1: |
| 260 | 274 | case 0xF2: |
| r243707 | r243708 | |
| 659 | 673 | m_via_1_a = ~0; |
| 660 | 674 | m_via_0_irq = 0; |
| 661 | 675 | m_via_1_irq = 0; |
| 676 | m_va = 0; |
| 677 | m_vb = 0; |
| 678 | m_vc = 0; |
| 679 | m_smoothscr = 0; |
| 662 | 680 | |
| 663 | 681 | // kludge round +12v pull up resistors, which after conversion will bring this low when nothing is plugged in. issue also affects dcd/dsr but those don't affect booting. |
| 664 | 682 | m_acia->write_cts(0); |
| r243707 | r243708 | |
| 707 | 725 | save_item(NAME(m_analog_sel)); |
| 708 | 726 | save_item(NAME(m_ramp_active)); |
| 709 | 727 | save_item(NAME(m_pdl_charge)); |
| 728 | save_item(NAME(m_va)); |
| 729 | save_item(NAME(m_vb)); |
| 730 | save_item(NAME(m_vc)); |
| 731 | save_item(NAME(m_smoothscr)); |
| 710 | 732 | |
| 711 | 733 | machine().save().register_postload(save_prepost_delegate(FUNC(apple3_state::apple3_postload), this)); |
| 712 | 734 | } |
| r243707 | r243708 | |
| 1275 | 1297 | m_maincpu->set_input_line(INPUT_LINE_NMI, state); |
| 1276 | 1298 | } |
| 1277 | 1299 | } |
| 1300 | |
trunk/src/mess/video/apple3.c
| r243707 | r243708 | |
| 138 | 138 | |
| 139 | 139 | void apple3_state::apple3_video_text40(bitmap_ind16 &bitmap) |
| 140 | 140 | { |
| 141 | | int x, y, col, row; |
| 141 | int x, y, col, row, lc; |
| 142 | 142 | offs_t offset; |
| 143 | 143 | UINT8 ch; |
| 144 | 144 | const UINT8 *char_data; |
| r243707 | r243708 | |
| 146 | 146 | UINT16 *dest; |
| 147 | 147 | UINT8 *ram = m_ram->pointer(); |
| 148 | 148 | UINT32 ram_size = m_ram->size(); |
| 149 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 149 | 150 | |
| 150 | 151 | for (y = 0; y < 24; y++) |
| 151 | 152 | { |
| r243707 | r243708 | |
| 164 | 165 | } |
| 165 | 166 | else |
| 166 | 167 | { |
| 167 | | /* monochrome */ |
| 168 | /* monochrome - on a real /// with an RGB monitor, text is white */ |
| 168 | 169 | bg = BLACK; |
| 169 | | fg = GREEN; |
| 170 | fg = WHITE; |
| 170 | 171 | } |
| 171 | 172 | |
| 172 | 173 | /* inverse? */ |
| r243707 | r243708 | |
| 183 | 184 | { |
| 184 | 185 | for (col = 0; col < 7; col++) |
| 185 | 186 | { |
| 186 | | dest = &bitmap.pix16(y * 8 + row, x * 14 + col * 2); |
| 187 | if (m_smoothscr) |
| 188 | { |
| 189 | // get the offset into the group of 8 lines |
| 190 | lc = (col + smooth) & 7; |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | lc = col; |
| 195 | } |
| 196 | |
| 197 | dest = &bitmap.pix16(y * 8 + row, x * 14 + lc * 2); |
| 187 | 198 | dest[0] = (char_data[row] & (1 << col)) ? fg : bg; |
| 188 | 199 | dest[1] = (char_data[row] & (1 << col)) ? fg : bg; |
| 189 | 200 | } |
| r243707 | r243708 | |
| 196 | 207 | |
| 197 | 208 | void apple3_state::apple3_video_text80(bitmap_ind16 &bitmap) |
| 198 | 209 | { |
| 199 | | int x, y, col, row; |
| 210 | int x, y, col, row, lc; |
| 200 | 211 | offs_t offset; |
| 201 | 212 | UINT8 ch; |
| 202 | 213 | const UINT8 *char_data; |
| r243707 | r243708 | |
| 204 | 215 | UINT16 *dest; |
| 205 | 216 | UINT8 *ram = m_ram->pointer(); |
| 206 | 217 | UINT32 ram_size = m_ram->size(); |
| 218 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 207 | 219 | |
| 208 | 220 | for (y = 0; y < 24; y++) |
| 209 | 221 | { |
| r243707 | r243708 | |
| 221 | 233 | { |
| 222 | 234 | for (col = 0; col < 7; col++) |
| 223 | 235 | { |
| 224 | | dest = &bitmap.pix16(y * 8 + row, x * 14 + col + 0); |
| 236 | if (m_smoothscr) |
| 237 | { |
| 238 | // get the offset into the group of 8 lines |
| 239 | lc = (col + smooth) & 7; |
| 240 | } |
| 241 | else |
| 242 | { |
| 243 | lc = col; |
| 244 | } |
| 245 | |
| 246 | dest = &bitmap.pix16(y * 8 + row, x * 14 + lc + 0); |
| 225 | 247 | *dest = (char_data[row] & (1 << col)) ? fg : bg; |
| 226 | 248 | } |
| 227 | 249 | } |
| r243707 | r243708 | |
| 249 | 271 | void apple3_state::apple3_video_graphics_hgr(bitmap_ind16 &bitmap) |
| 250 | 272 | { |
| 251 | 273 | /* hi-res mode: 280x192x2 */ |
| 252 | | int y, i, x; |
| 274 | int y, i, x, ly, lyb; |
| 253 | 275 | const UINT8 *pix_info; |
| 254 | 276 | UINT16 *ptr; |
| 255 | 277 | UINT8 b; |
| 256 | 278 | UINT8 *ram = m_ram->pointer(); |
| 279 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 257 | 280 | |
| 258 | 281 | for (y = 0; y < 192; y++) |
| 259 | 282 | { |
| 283 | ly = y; |
| 284 | if (m_smoothscr) |
| 285 | { |
| 286 | // get our base Y position |
| 287 | ly = y & ~7; |
| 288 | // get the offset into the group of 8 lines |
| 289 | lyb = ((y % 8) + smooth) & 7; |
| 290 | // add to the base |
| 291 | ly += lyb; |
| 292 | } |
| 293 | |
| 260 | 294 | if (m_flags & VAR_VM2) |
| 261 | | pix_info = &ram[m_hgr_map[y]]; |
| 295 | pix_info = &ram[m_hgr_map[ly]]; |
| 262 | 296 | else |
| 263 | | pix_info = &ram[m_hgr_map[y] - 0x2000]; |
| 297 | pix_info = &ram[m_hgr_map[ly] - 0x2000]; |
| 264 | 298 | ptr = &bitmap.pix16(y); |
| 265 | 299 | |
| 266 | 300 | for (i = 0; i < 40; i++) |
| r243707 | r243708 | |
| 280 | 314 | void apple3_state::apple3_video_graphics_chgr(bitmap_ind16 &bitmap) |
| 281 | 315 | { |
| 282 | 316 | /* color hi-res mode: 280x192x16 */ |
| 283 | | int y, i, x; |
| 317 | int y, i, x, ly, lyb; |
| 284 | 318 | const UINT8 *pix_info; |
| 285 | 319 | const UINT8 *col_info; |
| 286 | 320 | UINT16 *ptr; |
| 287 | 321 | UINT8 b; |
| 288 | 322 | UINT16 fgcolor, bgcolor; |
| 289 | 323 | UINT8 *ram = m_ram->pointer(); |
| 324 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 290 | 325 | |
| 291 | 326 | for (y = 0; y < 192; y++) |
| 292 | 327 | { |
| 328 | ly = y; |
| 329 | if (m_smoothscr) |
| 330 | { |
| 331 | // get our base Y position |
| 332 | ly = y & ~7; |
| 333 | // get the offset into the group of 8 lines |
| 334 | lyb = ((y % 8) + smooth) & 7; |
| 335 | // add to the base |
| 336 | ly += lyb; |
| 337 | } |
| 338 | |
| 293 | 339 | if (m_flags & VAR_VM2) |
| 294 | 340 | { |
| 295 | | pix_info = &ram[m_hgr_map[y] + 0x2000]; |
| 296 | | col_info = &ram[m_hgr_map[y] + 0x4000]; |
| 341 | pix_info = &ram[m_hgr_map[ly] + 0x2000]; |
| 342 | col_info = &ram[m_hgr_map[ly] + 0x4000]; |
| 297 | 343 | } |
| 298 | 344 | else |
| 299 | 345 | { |
| 300 | | pix_info = &ram[m_hgr_map[y] - 0x2000]; |
| 301 | | col_info = &ram[m_hgr_map[y]]; |
| 346 | pix_info = &ram[m_hgr_map[ly] - 0x2000]; |
| 347 | col_info = &ram[m_hgr_map[ly]]; |
| 302 | 348 | } |
| 303 | 349 | ptr = &bitmap.pix16(y); |
| 304 | 350 | |
| r243707 | r243708 | |
| 326 | 372 | void apple3_state::apple3_video_graphics_shgr(bitmap_ind16 &bitmap) |
| 327 | 373 | { |
| 328 | 374 | /* super hi-res mode: 560x192x2 */ |
| 329 | | int y, i, x; |
| 375 | int y, i, x, ly, lyb; |
| 330 | 376 | const UINT8 *pix_info1; |
| 331 | 377 | const UINT8 *pix_info2; |
| 332 | 378 | UINT16 *ptr; |
| 333 | 379 | UINT8 b1, b2; |
| 334 | 380 | UINT8 *ram = m_ram->pointer(); |
| 381 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 335 | 382 | |
| 336 | 383 | for (y = 0; y < 192; y++) |
| 337 | 384 | { |
| 385 | ly = y; |
| 386 | if (m_smoothscr) |
| 387 | { |
| 388 | // get our base Y position |
| 389 | ly = y & ~7; |
| 390 | // get the offset into the group of 8 lines |
| 391 | lyb = ((y % 8) + smooth) & 7; |
| 392 | // add to the base |
| 393 | ly += lyb; |
| 394 | } |
| 395 | |
| 338 | 396 | if (m_flags & VAR_VM2) |
| 339 | 397 | { |
| 340 | | pix_info1 = &ram[m_hgr_map[y] + 0x2000]; |
| 341 | | pix_info2 = &ram[m_hgr_map[y] + 0x4000]; |
| 398 | pix_info1 = &ram[m_hgr_map[ly] + 0x2000]; |
| 399 | pix_info2 = &ram[m_hgr_map[ly] + 0x4000]; |
| 342 | 400 | } |
| 343 | 401 | else |
| 344 | 402 | { |
| 345 | | pix_info1 = &ram[m_hgr_map[y] - 0x2000]; |
| 346 | | pix_info2 = &ram[m_hgr_map[y]]; |
| 403 | pix_info1 = &ram[m_hgr_map[ly] - 0x2000]; |
| 404 | pix_info2 = &ram[m_hgr_map[ly]]; |
| 347 | 405 | } |
| 348 | 406 | ptr = &bitmap.pix16(y); |
| 349 | 407 | |
| r243707 | r243708 | |
| 373 | 431 | { |
| 374 | 432 | UINT16 *pen; |
| 375 | 433 | UINT8 p1, p2, p3, p4; |
| 376 | | int y, i; |
| 434 | int y, i, ly, lyb; |
| 377 | 435 | UINT8 *ram = m_ram->pointer(); |
| 436 | int smooth = m_va | (m_vb << 1) | (m_vc << 2); |
| 378 | 437 | |
| 379 | 438 | for (y = 0; y < 192; y++) |
| 380 | 439 | { |
| 440 | ly = y; |
| 441 | if (m_smoothscr) |
| 442 | { |
| 443 | // get our base Y position |
| 444 | ly = y & ~7; |
| 445 | // get the offset into the group of 8 lines |
| 446 | lyb = ((y % 8) + smooth) & 7; |
| 447 | // add to the base |
| 448 | ly += lyb; |
| 449 | } |
| 450 | |
| 381 | 451 | pen = &bitmap.pix16(y); |
| 382 | 452 | for (i = 0; i < 20; i++) |
| 383 | 453 | { |
| 384 | 454 | if (m_flags & VAR_VM2) |
| 385 | 455 | { |
| 386 | | p1 = ram[m_hgr_map[y] + 0x2000 + (i * 2) + 0]; |
| 387 | | p2 = ram[m_hgr_map[y] + 0x4000 + (i * 2) + 0]; |
| 388 | | p3 = ram[m_hgr_map[y] + 0x2000 + (i * 2) + 1]; |
| 389 | | p4 = ram[m_hgr_map[y] + 0x4000 + (i * 2) + 1]; |
| 456 | p1 = ram[m_hgr_map[ly] + 0x2000 + (i * 2) + 0]; |
| 457 | p2 = ram[m_hgr_map[ly] + 0x4000 + (i * 2) + 0]; |
| 458 | p3 = ram[m_hgr_map[ly] + 0x2000 + (i * 2) + 1]; |
| 459 | p4 = ram[m_hgr_map[ly] + 0x4000 + (i * 2) + 1]; |
| 390 | 460 | } |
| 391 | 461 | else |
| 392 | 462 | { |
| 393 | | p1 = ram[m_hgr_map[y] - 0x2000 + (i * 2) + 0]; |
| 394 | | p2 = ram[m_hgr_map[y] - 0x0000 + (i * 2) + 0]; |
| 395 | | p3 = ram[m_hgr_map[y] - 0x2000 + (i * 2) + 1]; |
| 396 | | p4 = ram[m_hgr_map[y] - 0x0000 + (i * 2) + 1]; |
| 463 | p1 = ram[m_hgr_map[ly] - 0x2000 + (i * 2) + 0]; |
| 464 | p2 = ram[m_hgr_map[ly] - 0x0000 + (i * 2) + 0]; |
| 465 | p3 = ram[m_hgr_map[ly] - 0x2000 + (i * 2) + 1]; |
| 466 | p4 = ram[m_hgr_map[ly] - 0x0000 + (i * 2) + 1]; |
| 397 | 467 | } |
| 398 | 468 | |
| 399 | 469 | pen[ 0] = pen[ 1] = pen[ 2] = pen[ 3] = (p1 & 0x0f); |
| r243707 | r243708 | |
| 412 | 482 | |
| 413 | 483 | UINT32 apple3_state::screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 414 | 484 | { |
| 415 | | // printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0)); |
| 485 | // printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0)); |
| 416 | 486 | |
| 417 | 487 | switch(m_flags & (VAR_VM3|VAR_VM1|VAR_VM0)) |
| 418 | 488 | { |