Add Apple IIGS autoswitch option without manual override

pull/229/head
IanSB 2021-08-04 16:04:02 +01:00
rodzic 396073231e
commit c3b3078f66
4 zmienionych plików z 28 dodań i 19 usunięć

Wyświetl plik

@ -474,13 +474,15 @@ typedef struct {
#define PALETTECONTROL_ATARI_GTIA 6
#define NUM_CONTROLS 7
#define AUTOSWITCH_OFF 0
#define AUTOSWITCH_PC 1
#define AUTOSWITCH_MODE7 2
#define AUTOSWITCH_VSYNC 3
#define AUTOSWITCH_IIGS 4
#define AUTOSWITCH_MANUAL 5
#define NUM_AUTOSWITCHES 6
#define AUTOSWITCH_OFF 0
#define AUTOSWITCH_PC 1
#define AUTOSWITCH_MODE7 2
#define AUTOSWITCH_VSYNC 3
#define AUTOSWITCH_IIGS 4
#define AUTOSWITCH_IIGS_MANUAL 5
#define AUTOSWITCH_MANUAL 6
#define NUM_AUTOSWITCHES 7
#define VSYNC_AUTO 0
#define VSYNC_INTERLACED 1

Wyświetl plik

@ -175,6 +175,7 @@ static const char *autoswitch_names[] = {
"Sub + BBC Mode 7",
"Sub + Vsync",
"Sub + Apple IIGS",
"Sub + IIGS + Manual",
"Sub + Manual"
};
@ -1030,7 +1031,7 @@ void set_menu_table() {
main_menu.items[index++] = (base_menu_item_t *) &profile_ref;
main_menu.items[index++] = (base_menu_item_t *) &autoswitch_ref;
main_menu.items[index++] = (base_menu_item_t *) &subprofile_ref;
if (get_autoswitch() == AUTOSWITCH_IIGS || get_autoswitch() == AUTOSWITCH_MANUAL) main_menu.items[index++] = (base_menu_item_t *) &timingset_ref;
if (get_autoswitch() == AUTOSWITCH_IIGS_MANUAL || get_autoswitch() == AUTOSWITCH_MANUAL) main_menu.items[index++] = (base_menu_item_t *) &timingset_ref;
if (single_button_mode) main_menu.items[index++] = (base_menu_item_t *) &direction_ref;
main_menu.items[index++] = NULL;
}
@ -4685,7 +4686,7 @@ int osd_key(int key) {
int action;
if (single_button_mode) {
if (key_pressed == 0) {
if (get_autoswitch() == AUTOSWITCH_IIGS || get_autoswitch() == AUTOSWITCH_MANUAL) {
if (get_autoswitch() == AUTOSWITCH_IIGS_MANUAL || get_autoswitch() == AUTOSWITCH_MANUAL) {
set_feature(F_TIMINGSET, 1 - get_feature(F_TIMINGSET));
osd_state = TIMINGSET_MESSAGE;
} else {
@ -4741,7 +4742,7 @@ int osd_key(int key) {
break;
case A2_CLOCK_CAL:
if (get_autoswitch() == AUTOSWITCH_IIGS || get_autoswitch() == AUTOSWITCH_MANUAL) {
if (get_autoswitch() == AUTOSWITCH_IIGS_MANUAL || get_autoswitch() == AUTOSWITCH_MANUAL) {
set_feature(F_TIMINGSET, 1 - get_feature(F_TIMINGSET));
ret = 1;
osd_state = TIMINGSET_MESSAGE;

Wyświetl plik

@ -465,22 +465,27 @@ glitch_detected:
no_vsync_test:
cmp r9, #AUTOSWITCH_IIGS
cmpne r9, #AUTOSWITCH_IIGS_MANUAL
bne no_mode_test
ldr r9, frame_countdown
cmp r9, #0
ldr r10, frame_countdown
cmp r10, #0
bne no_mode_test
ldr r7, vsync_detected
ldr r8, ntsc_status
mov r9, r8
mov r10, r8
cmp r7, #IIGS_DETECTED_LINE_COUNT
biclt r8, #NTSC_LAST_IIGS // set1
orrge r8, #NTSC_LAST_IIGS // set2
str r8, ntsc_status
eor r9, r9, r8
tst r9, #NTSC_LAST_IIGS
eor r10, r10, r8
mov r8, r8, lsr #NTSC_LAST_IIGS_SHIFT
and r8, r8, #1
cmp r9, #AUTOSWITCH_IIGS
moveq r0, r8
moveq r10, #0 //so branch test fails
tst r10, #NTSC_LAST_IIGS
beq no_mode_test
mov r0, r8, lsr #NTSC_LAST_IIGS_SHIFT
and r0, r0, #1
mov r0, r8
push {r0 - r12}
bl set_timingset
pop {r0 - r12}
@ -792,6 +797,7 @@ mod10:
bic r3, #BITDUP_IIGS_DETECT
ldr r0, param_autoswitch
cmp r0, #AUTOSWITCH_IIGS
cmpne r0, #AUTOSWITCH_IIGS_MANUAL
orreq r3, #BITDUP_IIGS_DETECT
bic r3, #BITDUP_FFOSD_DETECTED

Wyświetl plik

@ -3332,14 +3332,14 @@ void rgb_to_hdmi_main() {
last_modeset = modeset;
if (autoswitch == AUTOSWITCH_MODE7 || autoswitch == AUTOSWITCH_VSYNC) {
if (autoswitch == AUTOSWITCH_MODE7 || autoswitch == AUTOSWITCH_VSYNC || autoswitch == AUTOSWITCH_IIGS) {
if (result & RET_MODESET) {
modeset = MODE_SET2;
} else {
modeset = MODE_SET1;
}
} else if (autoswitch == AUTOSWITCH_MANUAL || autoswitch == AUTOSWITCH_IIGS) {
} else if (autoswitch == AUTOSWITCH_MANUAL || autoswitch == AUTOSWITCH_IIGS_MANUAL) {
modeset = timingset;
} else {
modeset = MODE_SET1;