1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Merge pull request #521 from TomHarte/AppleVideo

Fixes Apple II double low resolution graphics
This commit is contained in:
Thomas Harte 2018-08-11 23:20:40 -04:00 committed by GitHub
commit 760817eb3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View File

@ -20,6 +20,7 @@
#include "../../Components/AudioToggle/AudioToggle.hpp"
#include "../../Outputs/Speaker/Implementation/LowpassSpeaker.hpp"
#include "../../Outputs/Log.hpp"
#include "Card.hpp"
#include "DiskIICard.hpp"
@ -427,7 +428,10 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
bool has_updated_cards = false;
if(read_pages_[address >> 8]) {
if(isReadOperation(operation)) *value = read_pages_[address >> 8][address & 0xff];
else if(write_pages_[address >> 8]) write_pages_[address >> 8][address & 0xff] = *value;
else {
if(address >= 0x200 && address < 0x6000) update_video();
if(write_pages_[address >> 8]) write_pages_[address >> 8][address & 0xff] = *value;
}
if(is_iie() && address >= 0xc300 && address < 0xd000) {
bool internal_c8_rom = internal_c8_rom_;
@ -526,7 +530,7 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
// Write-only switches. All IIe as currently implemented.
if(is_iie()) {
switch(address) {
default: printf("Write %04x?\n", address); break;
default: break;
case 0xc000:
case 0xc001:

View File

@ -332,13 +332,13 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
case GraphicsMode::DoubleLowRes: {
const int row_shift = (row_&4);
for(int c = column_; c < pixel_end; ++c) {
const uint16_t nibble = (bus_handler_.perform_aux_read(static_cast<uint16_t>(text_address + c)) >> row_shift) & 0xf0f;
const uint16_t nibble = bus_handler_.perform_aux_read(static_cast<uint16_t>(text_address + c)) >> row_shift;
if(c&1) {
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 4;
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 8;
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 1;
pixel_pointer_[3] = (nibble >> 8) & 2;
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 2;
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 4;
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 8;
pixel_pointer_[3] = (nibble >> 8) & 1;
pixel_pointer_[8] = pixel_pointer_[12] = nibble & 4;
pixel_pointer_[9] = pixel_pointer_[13] = nibble & 8;
@ -346,10 +346,10 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
pixel_pointer_[7] = pixel_pointer_[11] = nibble & 2;
graphics_carry_ = nibble & 8;
} else {
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 1;
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 2;
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 4;
pixel_pointer_[3] = (nibble >> 8) & 8;
pixel_pointer_[0] = pixel_pointer_[4] = (nibble >> 8) & 8;
pixel_pointer_[1] = pixel_pointer_[5] = (nibble >> 8) & 1;
pixel_pointer_[2] = pixel_pointer_[6] = (nibble >> 8) & 2;
pixel_pointer_[3] = (nibble >> 8) & 4;
pixel_pointer_[8] = pixel_pointer_[12] = nibble & 1;
pixel_pointer_[9] = pixel_pointer_[13] = nibble & 2;