Implement video memory access to all text mode planes. Fixes Fasttracker
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3669
This commit is contained in:
		
							parent
							
								
									dfd2200771
								
							
						
					
					
						commit
						02b866dc4a
					
				
					 1 changed files with 19 additions and 2 deletions
				
			
		|  | @ -466,12 +466,29 @@ public: | |||
| 	} | ||||
| 	Bitu readb(PhysPt addr) { | ||||
| 		addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; | ||||
| 		return vga.draw.font[addr]; | ||||
| 		switch(vga.gfx.read_map_select) { | ||||
| 		case 0: // character index
 | ||||
| 			return vga.mem.linear[CHECKED3(vga.svga.bank_read_full+addr)]; | ||||
| 		case 1: // character attribute
 | ||||
| 			return vga.mem.linear[CHECKED3(vga.svga.bank_read_full+addr+1)]; | ||||
| 		case 2: // font map
 | ||||
| 			return vga.draw.font[addr]; | ||||
| 		default: // 3=unused, but still RAM that could save values
 | ||||
| 			return 0; | ||||
| 		} | ||||
| 	} | ||||
| 	void writeb(PhysPt addr,Bitu val){ | ||||
| 		addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; | ||||
| 		if (vga.seq.map_mask & 0x4) { | ||||
| 		 | ||||
| 		if (GCC_LIKELY(vga.seq.map_mask == 0x4)) { | ||||
| 			vga.draw.font[addr]=(Bit8u)val; | ||||
| 		} else { | ||||
| 			if (vga.seq.map_mask & 0x4) // font map
 | ||||
| 				vga.draw.font[addr]=(Bit8u)val; | ||||
| 			if (vga.seq.map_mask & 0x2) // character attribute
 | ||||
| 				vga.mem.linear[CHECKED3(vga.svga.bank_read_full+addr+1)]=(Bit8u)val; | ||||
| 			if (vga.seq.map_mask & 0x1) // character index
 | ||||
| 				vga.mem.linear[CHECKED3(vga.svga.bank_read_full+addr)]=(Bit8u)val; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue