Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion firmware/render/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void DELAYED_COPY_CODE(render_loop)()
}
break;
case SOFTSW_HIRES_MODE: //4
if(current_softsw & SOFTSW_DGR)
if((current_softsw & (SOFTSW_80COL | SOFTSW_DGR)) == (SOFTSW_80COL | SOFTSW_DGR))
{
render_dhgr();
}
Expand Down
12 changes: 9 additions & 3 deletions firmware/render/render_hires.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,24 @@ static void DELAYED_COPY_CODE(render_hires_line)(bool p2, uint line)
// pixel
uint oddness = 0;

// The 'AN3 trick' is used by Prince of Persia and several demos for the IIe.
// It relies on setting AN3 but not turning on 80 column mode. This causes a 90 degree
// phase shift relative to the color carrier which can be used as a quick palette shift
// effect.
uint phase_shift = (IS_SOFTSWITCH(SOFTSW_DGR)) ? 1 : 0;

// Load in the first 14 dots
uint32_t dots = (uint32_t)hires_dot_patterns[line_mem[0]] << 15;
uint32_t dots = (uint32_t)hires_dot_patterns[line_mem[0]] << (15 + phase_shift);

for(uint i=1; i < 41; i++)
{
// Load in the next 14 dots
uint b = (i < 40) ? line_mem[i] : 0;
if(b & 0x80) {
// Extend the last bit from the previous byte
dots |= (dots & (1u << 15)) >> 1;
dots |= (dots & (1u << (15 + phase_shift))) >> 1;
}
dots |= (uint32_t)hires_dot_patterns[b] << 1;
dots |= (uint32_t)hires_dot_patterns[b] << (1 + phase_shift);

// Consume 14 dots
for(uint j=0; j < 7; j++)
Expand Down