Skip to content

Commit

Permalink
Fix timing and detection issues with Apple IIGS
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Aug 2, 2021
1 parent 7ac529c commit 2dd1f56
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ typedef struct {
#define GREY_DETECTED_LINE_COUNT 200
#define ARTIFACT_DETECTED_LINE_COUNT 100
#define DPMS_FRAME_COUNT 200
#define IIGS_DETECTED_LINE_COUNT 16
#define IIGS_DETECTED_LINE_COUNT 128

#define SIZEX2_DOUBLE_HEIGHT 1
#define SIZEX2_DOUBLE_WIDTH 2
Expand Down
15 changes: 2 additions & 13 deletions src/rgb_to_fb.S
Original file line number Diff line number Diff line change
Expand Up @@ -1219,15 +1219,6 @@ skip_osd_update:
#endif
push {r1-r5, r11}

ldr r1, flicker_counter //led flicker now synced to frame rate
mov r2, #1
tst r3, #BIT_OSD
movne r2, #2
tst r3, #BIT_INTERLACED_VIDEO
movne r2, #1
add r1, r1, r2
str r1, flicker_counter

mov r0, #0 //do not force genlock
bl recalculate_hdmi_clock_line_locked_update

Expand All @@ -1246,10 +1237,10 @@ skip_osd_update:
moveq r4, #MODE7_MASK
ldreq r3, =GPSET0
streq r4, [r3] //switch on mode7 led if no sync so at least one led is always lit (will be set correctly when sync reacquired)
ldr r1, flicker_counter
READ_CYCLE_COUNTER r1
mov r2, #LED1_MASK
tst r0, #1 // should LED flash?
tstne r1, #4 // flash rate ~ 12-15Hz
tstne r1, #(1 << 26) // flash rate ~ 8Hz
tsteq r0, #2 // should LED be on?
ldrne r1, =GPSET0 // LED on
ldreq r1, =GPCLR0 // LED off
Expand Down Expand Up @@ -1420,8 +1411,6 @@ dpmsframecount:
.word 0
dpms_state:
.word 0
flicker_counter:
.word 0

.ltorg

Expand Down
Binary file modified src/scripts/cpld_firmware/6-12_bit/6-12_BIT_RGB_CPLD_v94.xsvf
Binary file not shown.
Binary file modified src/scripts/cpld_firmware/recovery12/6-12_BIT_RGB_CPLD_v94.xsvf
Binary file not shown.

0 comments on commit 2dd1f56

Please sign in to comment.