Added test for A2560K joystick
This commit is contained in:
parent
1d7e4a1a44
commit
a487d0bf4c
|
@ -19,3 +19,18 @@ assign CS_VICKY_MEM_B = ( Internal_Address[31:17] == 15'b1111_1110_1100_101 )
|
|||
assign FLASH0 = ( Internal_Address[31:21] == 11'b1111_1111_111 ) & ( SuperData | SuperProgram ); //$FFE0_0000
|
||||
VICKY_MASTER_REG[8] <= 32'h1008_1008; // FONT Manager - Font Container Size and FONT Size
|
||||
VICKY_MASTER_REG[9] <= 32'h0000_1E50; // FONT - Horizontal # of Character, Vertical # FONT Line
|
||||
|
||||
always @ (*)
|
||||
begin
|
||||
case(CPU_A_i[4:2])
|
||||
3'b000: begin CPU_D_o = {16'h0000, J0_BUTTON2_Input, J0_BUTTON1_Input, 1'b0, J0_BUTTON0_Input, J0_RIGHT_i, J0_LEFT_i, J0_DOWN_i, J0_UP_i, J1_BUTTON2_Input, J1_BUTTON1_Input, 1'b0, J1_BUTTON0_Input, J1_RIGHT_i, J1_LEFT_i, J1_DOWN_i, J1_UP_i}; end
|
||||
3'b001: begin CPU_D_o = {16'h0000, SNES_CTRL_REG[15:7], SampleIsDone, SNES_CTRL_REG[5:0] }; end
|
||||
3'b010: begin CPU_D_o = { SNES_PORT0_INPUT1, 4'b0000, SNES_PORT0_INPUT0, 4'b0000 }; end
|
||||
3'b011: begin CPU_D_o = { SNES_PORT0_INPUT3, 4'b0000, SNES_PORT0_INPUT2, 4'b0000 }; end
|
||||
3'b100: begin CPU_D_o = { SNES_PORT1_INPUT1, 4'b0000, SNES_PORT1_INPUT0, 4'b0000 }; end
|
||||
3'b101: begin CPU_D_o = { SNES_PORT1_INPUT3, 4'b0000, SNES_PORT1_INPUT2, 4'b0000 }; end
|
||||
3'b110: begin CPU_D_o = {6'b00_0000, F_SD_WP_i, F_SD_CD_i, 8'b0000_0000, 6'b00_0000, USER_i[1], USER_i[0], 6'b00_0000, BOOT_MODE_i[1], BOOT_MODE_i[0]}; end
|
||||
3'b111: begin CPU_D_o = 32'hAAAA_5555; end
|
||||
default: begin CPU_D_o = 32'hDEAF_B00B; end
|
||||
endcase
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cli.h"
|
||||
|
@ -57,6 +58,27 @@ typedef struct s_cli_test_feature {
|
|||
* Tests...
|
||||
*/
|
||||
|
||||
int cli_test_joystick(short channel, int argc, char * argv[]) {
|
||||
char message[80];
|
||||
volatile unsigned int * joystick_port = 0xFEC00500;
|
||||
unsigned int joy_state = 0, old_joy_state = 0xffffffff;
|
||||
unsigned short scancode = 0;
|
||||
|
||||
sprintf(message, "Plug a joystick into either port 0 or port 1... ESC to quit.\n");
|
||||
sys_chan_write(channel, message, strlen(message));
|
||||
|
||||
while (scancode != 0x01) {
|
||||
joy_state = *joystick_port;
|
||||
if (joy_state != old_joy_state) {
|
||||
old_joy_state = joy_state;
|
||||
sprintf(message, "Joystick: %08X\n", joy_state);
|
||||
sys_chan_write(channel, message, strlen(message));
|
||||
}
|
||||
|
||||
scancode = sys_kbd_scancode();
|
||||
}
|
||||
}
|
||||
|
||||
int cli_test_bitmap(short channel, int argc, char * argv[]) {
|
||||
int i,m,p;
|
||||
unsigned char j;
|
||||
|
@ -430,6 +452,7 @@ const t_cli_test_feature cli_test_features[] = {
|
|||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
{"FDC", "FDC: test reading the MBR from the floppy drive", cli_test_fdc},
|
||||
#endif
|
||||
{"JOY", "JOY: test the joystick", cli_test_joystick},
|
||||
{"LPT", "LPT: test the parallel port", cli_test_lpt},
|
||||
{"MEM", "MEM: test reading and writing memory", cli_mem_test},
|
||||
{"MIDILOOP", "MIDILOOP: perform a loopback test on the MIDI ports", midi_loop_test},
|
||||
|
|
1151
src/foenixmcp.s68
1151
src/foenixmcp.s68
File diff suppressed because it is too large
Load diff
3089
src/mapfile
3089
src/mapfile
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue