mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-11 14:30:08 +00:00
Some interface/keys cleanup
* Condensed reboot code path into reset codepath * Reset sequence now checks for openapple or closedapple key and routes accordingly * Pause/Break key is now strictly emulation pause key * F4 is now unused * End key is now mapped as //e reset key (easier to hit, and less likely window manager is using it) * PrintScreen/SysReq key is now unused
This commit is contained in:
parent
05e8e0f4a2
commit
2ce40ddba9
12
src/cpu.S
12
src/cpu.S
@ -2704,14 +2704,16 @@ continue:
|
||||
Exception handlers
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
exception: testb $RebootSig, %al
|
||||
jnz emul_reinit
|
||||
testb $ResetSig, %al
|
||||
jnz ex_reset
|
||||
exception: testb $ResetSig, %al
|
||||
jnz ex_reset0
|
||||
testb $DebugStepSig, %al
|
||||
jnz ex_step
|
||||
jmp ex_irq
|
||||
|
||||
ex_reset0: testb $0xff, SN(joy_button0) // OpenApple
|
||||
jnz emul_reinit
|
||||
testb $0xff, SN(joy_button1) // ClosedApple
|
||||
jnz emul_reinit
|
||||
ex_reset: movb $0, SN(cpu65__signal)
|
||||
movw $0xFFFC, EffectiveAddr // ROM reset vector
|
||||
GetFromEA_W
|
||||
@ -2766,7 +2768,7 @@ exit_cpu65_run: SaveState // Return to timing
|
||||
popal
|
||||
ret
|
||||
|
||||
emul_reinit: movb $0, SN(cpu65__signal) // EXIT CPURUN
|
||||
emul_reinit: movb $0, SN(cpu65__signal) // Return to timing loop ...
|
||||
movb $1, SN(emul_reinitialize)
|
||||
popal
|
||||
ret
|
||||
|
@ -83,7 +83,6 @@ extern uint8_t emul_reinitialize;
|
||||
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
#define RebootSig 0x01
|
||||
#define ResetSig 0x02
|
||||
#define DebugStepSig 0x04
|
||||
#define IRQ6522 0x08
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include "cpu.h"
|
||||
#include "prefs.h"
|
||||
|
||||
#define MOUSETEXT_BEGIN 0x90
|
||||
|
||||
static struct stat statbuf;
|
||||
static int altdrive;
|
||||
|
||||
@ -78,10 +80,6 @@ extern long js_timelimit;
|
||||
|
||||
void c_load_interface_font()
|
||||
{
|
||||
/* Only codes 0x20 -- 0x8A are actually used. But I feel safer
|
||||
* explicitly initializing all of them.
|
||||
*/
|
||||
|
||||
video_loadfont_int(0x00,0x40,ucase_glyphs);
|
||||
video_loadfont_int(0x40,0x20,ucase_glyphs);
|
||||
video_loadfont_int(0x60,0x20,lcase_glyphs);
|
||||
@ -90,6 +88,7 @@ void c_load_interface_font()
|
||||
video_loadfont_int(0xE0,0x20,lcase_glyphs);
|
||||
|
||||
video_loadfont_int(0x80,11,interface_glyphs);
|
||||
video_loadfont_int(MOUSETEXT_BEGIN,0x20,mousetext_glyphs);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
@ -931,7 +930,7 @@ void c_interface_parameters()
|
||||
//1. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80.",
|
||||
{ "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| |",
|
||||
"| Apple //ix |",
|
||||
"| @ Apple //ix @ |",
|
||||
"| |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| |",
|
||||
@ -946,12 +945,12 @@ void c_interface_parameters()
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| Emulator Hotkeys |",
|
||||
"| |",
|
||||
"| F1 F2: Slot6 Disk Drive A, Drive B F4 : Un/Pause Emulation |",
|
||||
"| F5 : Show Keyboard Layout F7 : 6502 VM Debugger |",
|
||||
"| F1 F2: Insert Diskette in Slot6 Disk Drive A or Drive B |",
|
||||
"| F5 : Show Keyboard Layout F7 : 6502 Debugger |",
|
||||
"| F9 : Toggle Between CPU% / ALT CPU% Speeds |",
|
||||
"| F10 : Show This Menu ESC exits menu |",
|
||||
"| F10 : Show This Menu |",
|
||||
"| |",
|
||||
"| For interface help press '?' |",
|
||||
"| For interface help press '?' ... ESC exits menu |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" };
|
||||
|
||||
|
||||
@ -965,6 +964,9 @@ void c_interface_parameters()
|
||||
cur_x = 0;
|
||||
video_setpage( 0 );
|
||||
|
||||
screen[ 2 ][ 33 ] = MOUSETEXT_BEGIN + 0x01;
|
||||
screen[ 2 ][ 46 ] = MOUSETEXT_BEGIN + 0x00;
|
||||
|
||||
c_interface_translate_screen( screen );
|
||||
c_interface_print_screen( screen );
|
||||
|
||||
@ -1434,7 +1436,8 @@ void c_interface_parameters()
|
||||
/* reboot machine if different */
|
||||
if (current_mode != apple_mode)
|
||||
{
|
||||
cpu65_interrupt(RebootSig);
|
||||
// FIXME : broken ...
|
||||
//cpu65_interrupt(RebootSig);
|
||||
}
|
||||
|
||||
c_interface_exit();
|
||||
@ -1442,29 +1445,27 @@ void c_interface_parameters()
|
||||
}
|
||||
else if ((ch == '?') && (option != OPT_PATH))
|
||||
{
|
||||
#define MAINHELP_SUBMENU_H 20
|
||||
#define MAINHELP_SUBMENU_H 18
|
||||
#define MAINHELP_SUBMENU_W 40
|
||||
char submenu[MAINHELP_SUBMENU_H][MAINHELP_SUBMENU_W+1] =
|
||||
//1. 5. 10. 15. 20. 25. 30. 35. 40.
|
||||
{ "||||||||||||||||||||||||||||||||||||||||",
|
||||
"| |",
|
||||
"| Movement : Up/Down arrows |",
|
||||
"| |",
|
||||
"| Change : Left/Right arrows to |",
|
||||
"| Values : toggle or press the |",
|
||||
"| 'Return' key to select |",
|
||||
"| |",
|
||||
"||||||||||||||||||||||||||||||||||||||||",
|
||||
"| |",
|
||||
"| Hotkeys used while emulator running: |",
|
||||
"| |",
|
||||
"| F1 F2: Slot6 Disk Drive A, Drive B |",
|
||||
"| F4 : Toggle Emulation Pause |",
|
||||
"| F5 : Show Keyboard Layout |",
|
||||
"| F7 : Virtual 6502 Debugger |",
|
||||
"| F7 : 6502 Debugger |",
|
||||
"| F9 : Toggle Emulator Speed |",
|
||||
"| F10 : Main Menu |",
|
||||
"| |",
|
||||
"| Ctrl-LeftAlt-End Reboots //e |",
|
||||
"| Pause/Brk : Pause Emulator |",
|
||||
"||||||||||||||||||||||||||||||||||||||||" };
|
||||
c_interface_print_submenu_centered(submenu[0], MAINHELP_SUBMENU_W, MAINHELP_SUBMENU_H);
|
||||
while ((ch = c_mygetch(1)) == -1)
|
||||
@ -1686,34 +1687,44 @@ void c_interface_keyboard_layout()
|
||||
{ "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| Apple //e US Keyboard Layout |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| | |",
|
||||
"|1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ dl| |",
|
||||
"| Q W E R T Y U I O P [{ ]} \\| | |",
|
||||
"|cp A S D F G H J K L ;: '\" CR | |",
|
||||
"|sh Z X C V B N M ,< .> /? sh | |",
|
||||
"|ctrl | |",
|
||||
"| | |",
|
||||
"| Where dl is DEL, cp is CAPS, CR is | |",
|
||||
"| RETURN, sh is SHIFT, ctrl is CONTROL.| |",
|
||||
"| Arrow keys are as is. | |",
|
||||
"| | |",
|
||||
"| | |",
|
||||
"| | |",
|
||||
"| Ctrl-PrntScrn/SysRq reboots emulator | |",
|
||||
"| Ctrl-Pause/Break is Apple reset | |",
|
||||
"| Pause/Break alone pauses emulation | |",
|
||||
"| Alt Left and Alt Right are Apple | |",
|
||||
"| Keys (Joystick buttons 0 & 1) | |",
|
||||
"| esc del RESET |",
|
||||
"| `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ backspace |",
|
||||
"| tab Q W E R T Y U I O P [{ ]} \\| |",
|
||||
"| caps A S D F G H J K L ;: '\" return @ |",
|
||||
"| shift Z X C V B N M ,< .> /? shift @ @ |",
|
||||
"| ctrl @ space @ ctrl @ |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| | Menus: |",
|
||||
"| Left Alt is @ (OpenApple) key (Joystick button 1) | F1: Disk Drive A |",
|
||||
"| Right Alt is @ (ClosedApple) key (Joystick button 2) | F2: Disk Drive B |",
|
||||
"| End is //e RESET key | F5: This Menu |",
|
||||
"| | F7: 6502 Debugger|",
|
||||
"| Ctrl-End triggers //e reset vector |F10: Options |",
|
||||
"| Ctrl-LeftAlt-End triggers //e reboot ||||||||||||||||||||",
|
||||
"| Ctrl-RightAlt-End triggers //e system test |",
|
||||
"| |",
|
||||
"| Pause/Break key pauses emulation |",
|
||||
"| |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
|
||||
"| (Press any key to exit) |",
|
||||
"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" };
|
||||
|
||||
// TODO : joystick emulation? and F-keys
|
||||
|
||||
int i;
|
||||
|
||||
video_setpage( 0 );
|
||||
|
||||
// arrows
|
||||
screen[ 6 ][ 68 ] = MOUSETEXT_BEGIN + 0x0b;
|
||||
screen[ 7 ][ 67 ] = MOUSETEXT_BEGIN + 0x08;
|
||||
screen[ 7 ][ 69 ] = MOUSETEXT_BEGIN + 0x15;
|
||||
screen[ 8 ][ 68 ] = MOUSETEXT_BEGIN + 0x0a;
|
||||
|
||||
// apple keys
|
||||
screen[ 8 ][ 25 ] = MOUSETEXT_BEGIN + 0x01;
|
||||
screen[ 8 ][ 47 ] = MOUSETEXT_BEGIN + 0x00;
|
||||
screen[ 11 ][ 14 ] = MOUSETEXT_BEGIN + 0x01;
|
||||
screen[ 12 ][ 15 ] = MOUSETEXT_BEGIN + 0x00;
|
||||
|
||||
c_interface_translate_screen(screen);
|
||||
c_interface_print_screen( screen );
|
||||
|
||||
|
45
src/keys.c
45
src/keys.c
@ -72,9 +72,9 @@ static int apple_ii_keymap_plain[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, -1, JB1, RST, kHOME, -1, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, -1, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, -1, kPGDN, JB2, -1, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kF4 /* (pause) */,/* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_ii_keymap_ctrl[128] =
|
||||
@ -90,9 +90,9 @@ static int apple_ii_keymap_ctrl[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, BOT, JB1, RST, kHOME, -1, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, -1, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, -1, kPGDN, JB2, -1, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, RST, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_ii_keymap_shifted[128] =
|
||||
@ -108,9 +108,9 @@ static int apple_ii_keymap_shifted[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, -1, JB1, RST, kHOME, -1, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, -1, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, -1, kPGDN, JB2, -1, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kF4 /* pause */, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
/* ----------------------------------------------------
|
||||
@ -129,9 +129,9 @@ static int apple_iie_keymap_plain[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, -1, JB1, RST, kHOME, 11, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, 11, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, 10, kPGDN, JB2, 127, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kF4 /* pause */, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_iie_keymap_ctrl[128] =
|
||||
@ -147,9 +147,9 @@ static int apple_iie_keymap_ctrl[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, BOT, JB1, RST, kHOME, 11, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, 11, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, 10, kPGDN, JB2, 127, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, RST, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_iie_keymap_shifted[128] =
|
||||
@ -165,9 +165,9 @@ static int apple_iie_keymap_shifted[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, -1, JB1, RST, kHOME, 11, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, 11, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, 10, kPGDN, JB2, 127, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kF4 /* pause */, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_iie_keymap_caps[128] =
|
||||
@ -183,9 +183,9 @@ static int apple_iie_keymap_caps[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, -1, JB1, RST, kHOME, 11, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, 11, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, 10, kPGDN, JB2, 127, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kF4 /* pause */, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static int apple_iie_keymap_shift_ctrl[128] =
|
||||
@ -201,9 +201,9 @@ static int apple_iie_keymap_shift_ctrl[128] =
|
||||
J_U, JUR, S_D, J_L, J_C, J_R, S_I, JDL, /* 72-79 */
|
||||
J_D, JDR, -1, -1, -1, kF11, kF12, -1, /* 80-87 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* 88-95 */
|
||||
-1, -1, -1, BOT, JB1, RST, kHOME, 11, /* 96-103 */
|
||||
-1, -1, -1, -1, JB1, -1, kHOME, 11, /* 96-103 */
|
||||
kPGUP, 8, 21, kEND, 10, kPGDN, JB2, 127, /* 104-111 */
|
||||
-1, -1, -1, -1, -1, -1, -1, RST, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, kPAUSE, /* 112-119 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1 }; /* 120-127 */
|
||||
|
||||
static char key_pressed[ 256 ];
|
||||
@ -234,12 +234,11 @@ void c_periodic_update(int dummysig) {
|
||||
{
|
||||
switch (current_key)
|
||||
{
|
||||
case RST:
|
||||
cpu65_interrupt(ResetSig);
|
||||
break;
|
||||
|
||||
case BOT:
|
||||
cpu65_interrupt(RebootSig);
|
||||
case kEND:
|
||||
if (key_pressed[ SCODE_L_CTRL ] || key_pressed[ SCODE_R_CTRL ])
|
||||
{
|
||||
cpu65_interrupt(ResetSig);
|
||||
}
|
||||
break;
|
||||
|
||||
case J_C:
|
||||
@ -263,7 +262,7 @@ void c_periodic_update(int dummysig) {
|
||||
pthread_mutex_unlock(&interface_mutex);
|
||||
break;
|
||||
|
||||
case kF4:
|
||||
case kPAUSE:
|
||||
pthread_mutex_lock(&interface_mutex);
|
||||
SoundSystemPause();
|
||||
while (c_mygetch(1) == -1)
|
||||
|
@ -42,8 +42,6 @@
|
||||
#define kF10 137
|
||||
#define kF11 138
|
||||
#define kF12 139
|
||||
#define kPRNT 140
|
||||
#define RST kPRNT
|
||||
|
||||
#define J_U 141
|
||||
#define J_D 142
|
||||
@ -62,7 +60,6 @@
|
||||
#define S_I 153
|
||||
#define J_C 154
|
||||
#define kPAUSE 155
|
||||
#define BOT kPAUSE
|
||||
|
||||
#define kLEFT 8 /* 157 */
|
||||
#define kRIGHT 21 /* 158 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user