change hotkeys, updated builds

This commit is contained in:
franchiopin 2024-05-19 12:41:06 +01:00
parent 7675355d17
commit 54e3df2ecf
2 changed files with 28 additions and 14 deletions

View File

@ -25,9 +25,8 @@ Game controls:
Shift = Start Shift = Start
Emulator controls: Emulator controls:
3 - Save State (doesnt write to file)
4 - Load State (doesnt write to file) (1-6) = Set frameskip
1,2,5,6 = Set frameskip
* = Fast-forward * = Fast-forward
B = Reverse border color B = Reverse border color
P = Pause (Many NES games have their own pause feature, but it will P = Pause (Many NES games have their own pause feature, but it will
@ -37,7 +36,9 @@ Emulator controls:
R = Reverse colors R = Reverse colors
S = Write save file (Only applicable to games which actually have S = Write save file (Only applicable to games which actually have
battery-backed save memory; e.g. Zelda, Final Fantasy; Doesn't battery-backed save memory; e.g. Zelda, Final Fantasy; Doesn't
write the State) write the State)
^ = Save State (doesnt write to file)
x² = Load State (doesnt write to file)
[ Known Issues ] [ Known Issues ]

View File

@ -10,7 +10,7 @@ main:
sub sp, sp, #s_SIZE sub sp, sp, #s_SIZE
bic sp, sp, #s_ALIGN - 1 bic sp, sp, #s_ALIGN - 1
mov r9, sp mov r9, sp
sub sp, sp, #s_SIZE // Reserve space for state ADDED sub sp, sp, #s_SIZE // Reserve space for state ADDED
mov r4, #0 mov r4, #0
mov r6, #s_SIZE mov r6, #s_SIZE
@ -176,7 +176,7 @@ newframe:
mov r8, #0 mov r8, #0
pause_loop: pause_loop:
#define num_command_keys 12 #define num_command_keys 14
@ Scan keypad @ Scan keypad
ldr r3, [r9, #s_hw_keypad_invert] ldr r3, [r9, #s_hw_keypad_invert]
mov r4, #0 mov r4, #0
@ -198,10 +198,8 @@ pause_loop:
tst r5, #1 << 0; movne r10, #1 tst r5, #1 << 0; movne r10, #1
tst r5, #1 << 1; movne r10, #2 tst r5, #1 << 1; movne r10, #2
//tst r5, #1 << 2; movne r10, #3 tst r5, #1 << 2; movne r10, #3
tst r5, #1 << 2; blne save_state tst r5, #1 << 3; movne r10, #4
//tst r5, #1 << 3; movne r10, #4
tst r5, #1 << 3; blne load_state
tst r5, #1 << 4; movne r10, #5 tst r5, #1 << 4; movne r10, #5
tst r5, #1 << 5; movne r10, #6 tst r5, #1 << 5; movne r10, #6
@ -211,6 +209,10 @@ pause_loop:
tst r5, #1 << 9; blne invert_colors @ R (Reverse) tst r5, #1 << 9; blne invert_colors @ R (Reverse)
tst r5, #1 << 10; blne sram_save @ S (Save SRAM) tst r5, #1 << 10; blne sram_save @ S (Save SRAM)
tst r4, #1 << 11; bne fast_forward @ * tst r4, #1 << 11; bne fast_forward @ *
tst r5, #1 << 12; blne save_state
tst r5, #1 << 13; blne load_state
@ Keep looping until the frame timer reaches 5/300 (1/60) of a second @ Keep looping until the frame timer reaches 5/300 (1/60) of a second
ldrb r0, [r9, #s_frame_timer] ldrb r0, [r9, #s_frame_timer]
@ -278,21 +280,32 @@ touchpad_info_page:
touchpad_main_page: touchpad_main_page:
.byte 0x04 .byte 0x04
@ 1 2 3 4 5 6 B P Q R S * @ 1 2 3 4 5 6 B P Q R S * ^ x^2
clickpad_command_map: clickpad_command_map:
.byte 0x17,0x15,0x13,0x27,0x25,0x23,0x64,0x28,0x26,0x24,0x22,0x31 .byte 0x17,0x15,0x13,0x27,0x25,0x23,0x64,0x28,0x26,0x24,0x22,0x31,0x49,0x39
touchpad_command_map: touchpad_command_map:
.byte 0x17,0x64,0x13,0x27,0x56,0x23,0x45,0x22,0x21,0x20,0x16,0x48 .byte 0x17,0x64,0x13,0x27,0x56,0x23,0x45,0x22,0x21,0x20,0x16,0x48,0x49,0x29
.align 4 .align 4
clickpad_read_input: clickpad_read_input:
@ r2 = 0xFFFFFF00
mvn r2, #0xFF mvn r2, #0xFF
@Load keypad state
@ loads address into r0
@ Each bit in the 900E0010-900E001F registers represents a key. Only bits 0 to 10 are used in each halfword. The mapping depends on the currently used keypad.
ldr r0, =0x900E0000 ldr r0, =0x900E0000
ldrd r0, [r0, #0x18] @ loads double word in (adress + 0x18) into r0
ldrd r0, [r0, #0x18]
@invert
ldr r3, [r9, #s_hw_keypad_invert] ldr r3, [r9, #s_hw_keypad_invert]
eor r0, r3 eor r0, r3
eor r1, r3 eor r1, r3
@key mapping
tst r0, #1 << 25; orrne r2, r2, #0x08 @ Caps (Start) tst r0, #1 << 25; orrne r2, r2, #0x08 @ Caps (Start)
tst r1, #1 << 7; orrne r2, r2, #0x01 @ Esc (A) tst r1, #1 << 7; orrne r2, r2, #0x01 @ Esc (A)
tst r1, #1 << 9; orrne r2, r2, #0x02 @ Tab (B) tst r1, #1 << 9; orrne r2, r2, #0x02 @ Tab (B)