diff --git a/bios/Other/c64-emu/C64DTV/gtk3_sym.vkm b/bios/Other/c64-emu/C64DTV/gtk3_sym.vkm new file mode 100644 index 00000000..9af41dfd --- /dev/null +++ b/bios/Other/c64-emu/C64DTV/gtk3_sym.vkm @@ -0,0 +1,319 @@ +# VICE keyboard mapping file +# +# A Keyboard map is read in as patch to the current map. +# +# File format: +# - comment lines start with '#' +# - keyword lines start with '!keyword' +# - normal lines have 'keysym/scancode row column shiftflag' +# +# Keywords and their lines are: +# '!CLEAR' clear whole table +# '!INCLUDE filename' read file as mapping file +# '!LSHIFT row col' left shift keyboard row/column +# '!RSHIFT row col' right shift keyboard row/column +# '!VSHIFT shiftkey' virtual shift key (RSHIFT or LSHIFT) +# '!SHIFTL shiftkey' shift lock key (RSHIFT or LSHIFT) +# for emulated keyboards that have only one shift key, set both LSHIFT +# and RSHIFT to the same row/col and use RSHIFT for VSHIFT and SHIFTL. +# '!LCTRL row col' left control keyboard row/column +# '!VCTRL ctrlkey' virtual control key (LCTRL) +# '!LCBM row col' left CBM keyboard row/column +# '!VCBM cbmkey' virtual CBM key (LCBM) +# '!UNDEF keysym' remove keysym from table +# +# Shiftflag can have these values, flags can be ORed to combine them: +# 0x0000 0 key is not shifted for this keysym/scancode +# 0x0001 1 key is combined with shift for this keysym/scancode +# 0x0002 2 key is left shift on emulated machine +# 0x0004 4 key is right shift on emulated machine (use only this one +# for emulated keyboards that have only one shift key) +# 0x0008 8 key can be shifted or not with this keysym/scancode +# 0x0010 16 deshift key for this keysym/scancode +# 0x0020 32 another definition for this keysym/scancode follows +# 0x0040 64 key is shift-lock on emulated machine +# 0x0080 128 shift modifier required on host +# 0x0100 256 key is used for an alternative keyboard mapping, e.g. C64 mode in x128 +# 0x0200 512 alt-r (alt-gr) modifier required on host +# 0x0400 1024 ctrl modifier required on host +# 0x0800 2048 key is combined with cbm for this keysym/scancode +# 0x1000 4096 key is combined with ctrl for this keysym/scancode +# 0x2000 8192 key is (left) cbm on emulated machine +# 0x4000 16384 key is (left) ctrl on emulated machine +# +# Negative row values: +# 'keysym -1 n' joystick keymap A, direction n +# 'keysym -2 n' joystick keymap B, direction n +# 'keysym -3 0' first RESTORE key +# 'keysym -3 1' second RESTORE key +# 'keysym -4 0' 40/80 column key (x128) +# 'keysym -4 1' CAPS (ASCII/DIN) key (x128) +# 'keysym -5 n' joyport keypad, key n (not supported in x128) +# +# Joystick direction values: +# 0 Fire +# 1 South/West +# 2 South +# 3 South/East +# 4 West +# 5 East +# 6 North/West +# 7 North +# 8 North/East +# +# Joyport keypad key layout: +# -------------------------- +# | 0 | 1 | 2 | 3 | 4 | +# -------------------------- +# | 5 | 6 | 7 | 8 | 9 | +# -------------------------- +# | 10 | 11 | 12 | 13 | 14 | +# -------------------------- +# | 15 | 16 | 17 | 18 | 19 | +# -------------------------- +# +# When a bigger spaced key is used, +# it uses the upper left most key value. + +# Symbolic Mapping, US Layout, C64, GTK + +# C64 keyboard matrix: +# +# +-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 0|Bit 1|Bit 2|Bit 3|Bit 4|Bit 5|Bit 6|Bit 7| +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 0| DEL |Retrn|C_L/R| F7 | F1 | F3 | F5 |C_U/D| +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 2| 5 % | R | D | 6 & | C | F | T | X | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 3| 7 ' | Y | G | 8 ( | B | H | U | V | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 4| 9 ) | I | J | 0 | M | K | O | N | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 5| + | P | L | - | . > | : [ | @ | , < | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 6|POUND| * | ; ] | HOME| S_R | = | A_UP| / ? | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 7| 1 ! |A_LFT| CTRL| 2 " |SPACE| C= | Q | R/S | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ + +# C64 Keyboard layout: +# +# arrow 1! 2" 3# 4$ 5% 6& 7' 8( 9) 0 + - pound clr del f1/f2 +# ctrl q w e r t y u i o p @ * ^ restore f3/f4 +# r/s SL a s d f g h j k l :[ ;] = return f5/f6 +# CBM LS z x c v b n m ,< .> /? RS u/d l/r f7/f8 +# space + +!CLEAR +!LSHIFT 1 7 +!RSHIFT 6 4 +!VSHIFT RSHIFT +!SHIFTL LSHIFT +!LCBM 7 5 +!VCBM LCBM +!LCTRL 7 2 +!VCTRL LCTRL + +##################### +# |Bit 0| DEL |Retrn|C_L/R| F7 | F1 | F3 | F5 |C_U/D| + +BackSpace 0 0 8 +Delete 0 0 8 +Insert 0 0 1 +Return 0 1 8 +Right 0 2 8 +KP_F4 0 2 8 +Left 0 2 1 +F7 0 3 8 +F8 0 3 1 +F1 0 4 8 +KP_F1 0 4 8 +F2 0 4 1 +KP_F2 0 5 8 +F3 0 5 8 +F4 0 5 1 +F5 0 6 8 +KP_F3 0 6 8 +F6 0 6 1 +Down 0 7 8 +Up 0 7 1 + +##################### +# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L | + +numbersign 1 0 1 +dollar 1 3 1 +Shift_L 1 7 2 +# shift lock +Caps_Lock 1 7 64 + +##################### +# |Bit 2| 5 % | R | D | 6 & | C | F | T | X | + +percent 2 0 1 +ampersand 2 3 1 + +##################### +# |Bit 3| 7 ' | Y | G | 8 ( | B | H | U | V | + +apostrophe 3 0 1 +grave 3 0 1 +parenleft 3 3 1 + +##################### +# |Bit 4| 9 ) | I | J | 0 | M | K | O | N | + +parenright 4 0 1 + +##################### +# |Bit 5| + | P | L | - | . > | : [ | @ | , < | + +plus 5 0 16 +minus 5 3 0 +period 5 4 0 +greater 5 4 1 +colon 5 5 16 +bracketleft 5 5 1 +at 5 6 16 +# underscore -> underscore (@+cbm) +underscore 5 6 0x810 +comma 5 7 0 +less 5 7 1 + +##################### +# |Bit 6|POUND| * | ; ] | HOME| S_R | = | A_UP| / ? | + +sterling 6 0 0 +backslash 6 0 0 +bar 6 0 8 +asterisk 6 1 16 +semicolon 6 2 0 +bracketright 6 2 1 +Home 6 3 8 +Shift_R 6 4 4 +equal 6 5 0 +# Page down -> Arrow Up +asciicircum 6 6 16 +Page_Down 6 6 8 +slash 6 7 0 +question 6 7 1 + +##################### +# |Bit 7| 1 ! |A_LFT| CTRL| 2 " |SPACE| C= | Q | R/S | + +exclam 7 0 1 +# tilde -> arrow left +asciitilde 7 1 16 +End 7 1 0 +Control_L 7 2 16392 /* Control_L = CTRL */ +quotedbl 7 3 1 +space 7 4 8 +Tab 7 5 8200 /* Tab = CBM */ +ISO_Left_Tab 7 5 8200 /* Shift + Tab = CBM */ +Escape 7 7 8 + +##################### +# letters and numbers + +0 4 3 0 +1 7 0 0 +2 7 3 0 +3 1 0 0 +4 1 3 0 +5 2 0 0 +6 2 3 0 +7 3 0 0 +8 3 3 0 +9 4 0 0 + +A 1 2 8 +B 3 4 8 +C 2 4 8 +D 2 2 8 +E 1 6 8 +F 2 5 8 +G 3 2 8 +H 3 5 8 +I 4 1 8 +J 4 2 8 +K 4 5 8 +L 5 2 8 +M 4 4 8 +N 4 7 8 +O 4 6 8 +P 5 1 8 +Q 7 6 8 +R 2 1 8 +S 1 5 8 +T 2 6 8 +U 3 6 8 +V 3 7 8 +W 1 1 8 +X 2 7 8 +Y 3 1 8 +Z 1 4 8 +a 1 2 8 +b 3 4 8 +c 2 4 8 +d 2 2 8 +e 1 6 8 +f 2 5 8 +g 3 2 8 +h 3 5 8 +i 4 1 8 +j 4 2 8 +k 4 5 8 +l 5 2 8 +m 4 4 8 +n 4 7 8 +o 4 6 8 +p 5 1 8 +q 7 6 8 +r 2 1 8 +s 1 5 8 +t 2 6 8 +u 3 6 8 +v 3 7 8 +w 1 1 8 +x 2 7 8 +y 3 1 8 +z 1 4 8 + +# Restore key mappings +Page_Up -3 0 +Prior -3 1 + +# Dead keys support for those using US-International keyboard layout. +dead_acute 3 0 1 # ' +dead_grave 3 0 1 # ' +dead_circumflex 6 6 16 # A_UP +dead_tilde 6 6 16 # A_UP +dead_perispomeni 7 1 16 # Arrow Left +dead_diaeresis 7 3 1 # " + +# +# joyport attached keypad +# +Num_Lock -5 0 +KP_7 -5 1 +KP_8 -5 2 +KP_9 -5 3 +KP_Divide -5 4 +Scroll_Lock -5 5 +KP_4 -5 6 +KP_5 -5 7 +KP_6 -5 8 +KP_Multiply -5 9 +Sys_Req -5 10 +KP_1 -5 11 +KP_2 -5 12 +KP_3 -5 13 +KP_Subtract -5 14 +Print -5 15 +KP_0 -5 16 +KP_Delete -5 17 +KP_Enter -5 18 +KP_Add -5 19 diff --git a/bios/Other/c64-emu/CBM-II/pepto-pal.vpl b/bios/Other/c64-emu/CBM-II/pepto-pal.vpl new file mode 100644 index 00000000..484077e7 --- /dev/null +++ b/bios/Other/c64-emu/CBM-II/pepto-pal.vpl @@ -0,0 +1,58 @@ +# +# VICE Palette file +# +# Syntax: +# Red Green Blue +# +# TYPE:VICII +# NAME:Pepto (PAL) + +# this palette was calculated for PAL according to http://www.pepto.de/projects/colorvic/ + +# Black +00 00 00 + +# White +FF FF FF + +# Red +68 37 2b + +# Cyan +70 a4 b2 + +# Purple +6f 3d 86 + +# Green +58 8d 43 + +# Blue +35 28 79 + +# Yellow +b8 c7 6f + +# Orange +6f 4f 25 + +# Brown +43 39 00 + +# Light Red +9a 67 59 + +# Dark Gray +44 44 44 + +# Medium Gray +6c 6c 6c + +# Light Green +9a d2 84 + +# Light Blue +6c 5e b5 + +# Light Gray +95 95 95 diff --git a/bios/Other/c64-emu/SCPU64/gtk3_sym.vkm b/bios/Other/c64-emu/SCPU64/gtk3_sym.vkm new file mode 100644 index 00000000..9af41dfd --- /dev/null +++ b/bios/Other/c64-emu/SCPU64/gtk3_sym.vkm @@ -0,0 +1,319 @@ +# VICE keyboard mapping file +# +# A Keyboard map is read in as patch to the current map. +# +# File format: +# - comment lines start with '#' +# - keyword lines start with '!keyword' +# - normal lines have 'keysym/scancode row column shiftflag' +# +# Keywords and their lines are: +# '!CLEAR' clear whole table +# '!INCLUDE filename' read file as mapping file +# '!LSHIFT row col' left shift keyboard row/column +# '!RSHIFT row col' right shift keyboard row/column +# '!VSHIFT shiftkey' virtual shift key (RSHIFT or LSHIFT) +# '!SHIFTL shiftkey' shift lock key (RSHIFT or LSHIFT) +# for emulated keyboards that have only one shift key, set both LSHIFT +# and RSHIFT to the same row/col and use RSHIFT for VSHIFT and SHIFTL. +# '!LCTRL row col' left control keyboard row/column +# '!VCTRL ctrlkey' virtual control key (LCTRL) +# '!LCBM row col' left CBM keyboard row/column +# '!VCBM cbmkey' virtual CBM key (LCBM) +# '!UNDEF keysym' remove keysym from table +# +# Shiftflag can have these values, flags can be ORed to combine them: +# 0x0000 0 key is not shifted for this keysym/scancode +# 0x0001 1 key is combined with shift for this keysym/scancode +# 0x0002 2 key is left shift on emulated machine +# 0x0004 4 key is right shift on emulated machine (use only this one +# for emulated keyboards that have only one shift key) +# 0x0008 8 key can be shifted or not with this keysym/scancode +# 0x0010 16 deshift key for this keysym/scancode +# 0x0020 32 another definition for this keysym/scancode follows +# 0x0040 64 key is shift-lock on emulated machine +# 0x0080 128 shift modifier required on host +# 0x0100 256 key is used for an alternative keyboard mapping, e.g. C64 mode in x128 +# 0x0200 512 alt-r (alt-gr) modifier required on host +# 0x0400 1024 ctrl modifier required on host +# 0x0800 2048 key is combined with cbm for this keysym/scancode +# 0x1000 4096 key is combined with ctrl for this keysym/scancode +# 0x2000 8192 key is (left) cbm on emulated machine +# 0x4000 16384 key is (left) ctrl on emulated machine +# +# Negative row values: +# 'keysym -1 n' joystick keymap A, direction n +# 'keysym -2 n' joystick keymap B, direction n +# 'keysym -3 0' first RESTORE key +# 'keysym -3 1' second RESTORE key +# 'keysym -4 0' 40/80 column key (x128) +# 'keysym -4 1' CAPS (ASCII/DIN) key (x128) +# 'keysym -5 n' joyport keypad, key n (not supported in x128) +# +# Joystick direction values: +# 0 Fire +# 1 South/West +# 2 South +# 3 South/East +# 4 West +# 5 East +# 6 North/West +# 7 North +# 8 North/East +# +# Joyport keypad key layout: +# -------------------------- +# | 0 | 1 | 2 | 3 | 4 | +# -------------------------- +# | 5 | 6 | 7 | 8 | 9 | +# -------------------------- +# | 10 | 11 | 12 | 13 | 14 | +# -------------------------- +# | 15 | 16 | 17 | 18 | 19 | +# -------------------------- +# +# When a bigger spaced key is used, +# it uses the upper left most key value. + +# Symbolic Mapping, US Layout, C64, GTK + +# C64 keyboard matrix: +# +# +-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 0|Bit 1|Bit 2|Bit 3|Bit 4|Bit 5|Bit 6|Bit 7| +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 0| DEL |Retrn|C_L/R| F7 | F1 | F3 | F5 |C_U/D| +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 2| 5 % | R | D | 6 & | C | F | T | X | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 3| 7 ' | Y | G | 8 ( | B | H | U | V | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 4| 9 ) | I | J | 0 | M | K | O | N | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 5| + | P | L | - | . > | : [ | @ | , < | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 6|POUND| * | ; ] | HOME| S_R | = | A_UP| / ? | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ +# |Bit 7| 1 ! |A_LFT| CTRL| 2 " |SPACE| C= | Q | R/S | +# +-----+-----+-----+-----+-----+-----+-----+-----+-----+ + +# C64 Keyboard layout: +# +# arrow 1! 2" 3# 4$ 5% 6& 7' 8( 9) 0 + - pound clr del f1/f2 +# ctrl q w e r t y u i o p @ * ^ restore f3/f4 +# r/s SL a s d f g h j k l :[ ;] = return f5/f6 +# CBM LS z x c v b n m ,< .> /? RS u/d l/r f7/f8 +# space + +!CLEAR +!LSHIFT 1 7 +!RSHIFT 6 4 +!VSHIFT RSHIFT +!SHIFTL LSHIFT +!LCBM 7 5 +!VCBM LCBM +!LCTRL 7 2 +!VCTRL LCTRL + +##################### +# |Bit 0| DEL |Retrn|C_L/R| F7 | F1 | F3 | F5 |C_U/D| + +BackSpace 0 0 8 +Delete 0 0 8 +Insert 0 0 1 +Return 0 1 8 +Right 0 2 8 +KP_F4 0 2 8 +Left 0 2 1 +F7 0 3 8 +F8 0 3 1 +F1 0 4 8 +KP_F1 0 4 8 +F2 0 4 1 +KP_F2 0 5 8 +F3 0 5 8 +F4 0 5 1 +F5 0 6 8 +KP_F3 0 6 8 +F6 0 6 1 +Down 0 7 8 +Up 0 7 1 + +##################### +# |Bit 1| 3 # | W | A | 4 $ | Z | S | E | S_L | + +numbersign 1 0 1 +dollar 1 3 1 +Shift_L 1 7 2 +# shift lock +Caps_Lock 1 7 64 + +##################### +# |Bit 2| 5 % | R | D | 6 & | C | F | T | X | + +percent 2 0 1 +ampersand 2 3 1 + +##################### +# |Bit 3| 7 ' | Y | G | 8 ( | B | H | U | V | + +apostrophe 3 0 1 +grave 3 0 1 +parenleft 3 3 1 + +##################### +# |Bit 4| 9 ) | I | J | 0 | M | K | O | N | + +parenright 4 0 1 + +##################### +# |Bit 5| + | P | L | - | . > | : [ | @ | , < | + +plus 5 0 16 +minus 5 3 0 +period 5 4 0 +greater 5 4 1 +colon 5 5 16 +bracketleft 5 5 1 +at 5 6 16 +# underscore -> underscore (@+cbm) +underscore 5 6 0x810 +comma 5 7 0 +less 5 7 1 + +##################### +# |Bit 6|POUND| * | ; ] | HOME| S_R | = | A_UP| / ? | + +sterling 6 0 0 +backslash 6 0 0 +bar 6 0 8 +asterisk 6 1 16 +semicolon 6 2 0 +bracketright 6 2 1 +Home 6 3 8 +Shift_R 6 4 4 +equal 6 5 0 +# Page down -> Arrow Up +asciicircum 6 6 16 +Page_Down 6 6 8 +slash 6 7 0 +question 6 7 1 + +##################### +# |Bit 7| 1 ! |A_LFT| CTRL| 2 " |SPACE| C= | Q | R/S | + +exclam 7 0 1 +# tilde -> arrow left +asciitilde 7 1 16 +End 7 1 0 +Control_L 7 2 16392 /* Control_L = CTRL */ +quotedbl 7 3 1 +space 7 4 8 +Tab 7 5 8200 /* Tab = CBM */ +ISO_Left_Tab 7 5 8200 /* Shift + Tab = CBM */ +Escape 7 7 8 + +##################### +# letters and numbers + +0 4 3 0 +1 7 0 0 +2 7 3 0 +3 1 0 0 +4 1 3 0 +5 2 0 0 +6 2 3 0 +7 3 0 0 +8 3 3 0 +9 4 0 0 + +A 1 2 8 +B 3 4 8 +C 2 4 8 +D 2 2 8 +E 1 6 8 +F 2 5 8 +G 3 2 8 +H 3 5 8 +I 4 1 8 +J 4 2 8 +K 4 5 8 +L 5 2 8 +M 4 4 8 +N 4 7 8 +O 4 6 8 +P 5 1 8 +Q 7 6 8 +R 2 1 8 +S 1 5 8 +T 2 6 8 +U 3 6 8 +V 3 7 8 +W 1 1 8 +X 2 7 8 +Y 3 1 8 +Z 1 4 8 +a 1 2 8 +b 3 4 8 +c 2 4 8 +d 2 2 8 +e 1 6 8 +f 2 5 8 +g 3 2 8 +h 3 5 8 +i 4 1 8 +j 4 2 8 +k 4 5 8 +l 5 2 8 +m 4 4 8 +n 4 7 8 +o 4 6 8 +p 5 1 8 +q 7 6 8 +r 2 1 8 +s 1 5 8 +t 2 6 8 +u 3 6 8 +v 3 7 8 +w 1 1 8 +x 2 7 8 +y 3 1 8 +z 1 4 8 + +# Restore key mappings +Page_Up -3 0 +Prior -3 1 + +# Dead keys support for those using US-International keyboard layout. +dead_acute 3 0 1 # ' +dead_grave 3 0 1 # ' +dead_circumflex 6 6 16 # A_UP +dead_tilde 6 6 16 # A_UP +dead_perispomeni 7 1 16 # Arrow Left +dead_diaeresis 7 3 1 # " + +# +# joyport attached keypad +# +Num_Lock -5 0 +KP_7 -5 1 +KP_8 -5 2 +KP_9 -5 3 +KP_Divide -5 4 +Scroll_Lock -5 5 +KP_4 -5 6 +KP_5 -5 7 +KP_6 -5 8 +KP_Multiply -5 9 +Sys_Req -5 10 +KP_1 -5 11 +KP_2 -5 12 +KP_3 -5 13 +KP_Subtract -5 14 +Print -5 15 +KP_0 -5 16 +KP_Delete -5 17 +KP_Enter -5 18 +KP_Add -5 19 diff --git a/bios/Other/c64-emu/SCPU64/pepto-pal.vpl b/bios/Other/c64-emu/SCPU64/pepto-pal.vpl new file mode 100644 index 00000000..67cade15 --- /dev/null +++ b/bios/Other/c64-emu/SCPU64/pepto-pal.vpl @@ -0,0 +1,56 @@ +# +# VICE Palette file +# +# Syntax: +# Red Green Blue +# +# TYPE:VICII +# NAME:Pepto (PAL) + +# Black +00 00 00 + +# White +FF FF FF + +# Red +68 37 2b + +# Cyan +70 a4 b2 + +# Purple +6f 3d 86 + +# Green +58 8d 43 + +# Blue +35 28 79 + +# Yellow +b8 c7 6f + +# Orange +6f 4f 25 + +# Brown +43 39 00 + +# Light Red +9a 67 59 + +# Dark Gray +44 44 44 + +# Medium Gray +6c 6c 6c + +# Light Green +9a d2 84 + +# Light Blue +6c 5e b5 + +# Light Gray +95 95 95 diff --git a/emulators/cdogs.yml b/emulators/cdogs.yml index 24e457ca..197b2ebc 100644 --- a/emulators/cdogs.yml +++ b/emulators/cdogs.yml @@ -109,6 +109,7 @@ files: required: false bundled: true source_ref: "src/cdogs/joystick.c:43" + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" - name: "font.png" path: "graphics/font.png" diff --git a/emulators/gzdoom.yml b/emulators/gzdoom.yml index 9b5394fd..036fe926 100644 --- a/emulators/gzdoom.yml +++ b/emulators/gzdoom.yml @@ -56,21 +56,25 @@ files: required: false source_ref: "src/version.h:92, src/d_main.cpp:3794-3796, wadsrc_extra/CMakeLists.txt:1" note: "Per-game filters under static/filter/ (doom.id, strife, hexen, heretic, chex...)." + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" - name: "lights.pk3" category: game_data required: false source_ref: "src/d_main.cpp:2053-2058, wadsrc_lights/CMakeLists.txt:1" + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" - name: "brightmaps.pk3" category: game_data required: false source_ref: "src/d_main.cpp:2059-2064, wadsrc_bm/CMakeLists.txt:1" + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" - name: "game_widescreen_gfx.pk3" category: game_data required: false source_ref: "src/d_main.cpp:2065-2070, wadsrc_widepix/CMakeLists.txt:1" + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" - name: "gzdoom.sf2" category: game_data diff --git a/emulators/hurrican.yml b/emulators/hurrican.yml index c1730268..1ce9813e 100644 --- a/emulators/hurrican.yml +++ b/emulators/hurrican.yml @@ -104,3 +104,4 @@ files: required: false bundled: true source_ref: "Hurrican/src/DX8Input.cpp:97-99" + unsourceable: "ships inside the engine package; a same-named file of another program must not stand in" diff --git a/emulators/ioquake3.yml b/emulators/ioquake3.yml index 46d82c04..c4203f36 100644 --- a/emulators/ioquake3.yml +++ b/emulators/ioquake3.yml @@ -45,6 +45,7 @@ files: required: true source_ref: "code/qcommon/files.c:179 (pak_checksums[0]=1566731103u), 3568 (per-index checksum compare)" note: "Retail Quake III Arena base pak. Engine prints a warning on checksum mismatch, does not refuse the file." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak1.pk3" category: game_data @@ -52,6 +53,7 @@ files: path: "baseq3/pak1.pk3" required: false source_ref: "code/qcommon/files.c:180 (pak_checksums[1]=298122907u)" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak2.pk3" category: game_data @@ -59,6 +61,7 @@ files: path: "baseq3/pak2.pk3" required: false source_ref: "code/qcommon/files.c:181 (pak_checksums[2]=412165236u)" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak3.pk3" category: game_data @@ -115,6 +118,7 @@ files: required: false source_ref: "code/qcommon/files.c:192 (missionpak_checksums[0]=2430342401u)" note: "Team Arena base pak. Required only when launching +set fs_game missionpack." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak1.pk3" category: game_data @@ -122,6 +126,7 @@ files: path: "missionpack/pak1.pk3" required: false source_ref: "code/qcommon/files.c:193 (missionpak_checksums[1]=511014160u)" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak2.pk3" category: game_data @@ -129,6 +134,7 @@ files: path: "missionpack/pak2.pk3" required: false source_ref: "code/qcommon/files.c:194 (missionpak_checksums[2]=2662638993u)" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak3.pk3" category: game_data diff --git a/emulators/iortcw.yml b/emulators/iortcw.yml index bd513eec..d6b454fb 100644 --- a/emulators/iortcw.yml +++ b/emulators/iortcw.yml @@ -63,6 +63,7 @@ files: # ================================================================ # main/ - single-player point-release paks # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "sp_pak1.pk3" category: game_data @@ -155,6 +156,7 @@ files: required: false source_ref: "MP/code/qcommon/files.c:209, 1596-1613" note: "VM/binary pak, 1.4/1.41 retail. The client extracts game dlls only from paks whose checksum is listed." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "mp_bin0.pk3" category: game_data diff --git a/emulators/openmohaa.yml b/emulators/openmohaa.yml index d8f9b78c..7a29b74c 100644 --- a/emulators/openmohaa.yml +++ b/emulators/openmohaa.yml @@ -60,6 +60,7 @@ files: required: true source_ref: "code/qcommon/files.cpp:326 (fs_originalPaks_main[0]), 4108 (Couldn't load default.cfg)" note: "Carries default.cfg; without it FS_Startup aborts with ERR_FATAL." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "Pak1.pk3" category: game_data @@ -67,6 +68,7 @@ files: path: "main/Pak1.pk3" required: false source_ref: "code/qcommon/files.cpp:327 (fs_originalPaks_main[1])" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "Pak2.pk3" category: game_data @@ -74,6 +76,7 @@ files: path: "main/Pak2.pk3" required: false source_ref: "code/qcommon/files.cpp:328 (fs_originalPaks_main[2])" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "Pak3.pk3" category: game_data @@ -116,6 +119,7 @@ files: required: true source_ref: "code/qcommon/files.cpp:337 (fs_originalPaks_mainta[0]), 3200 (fs_basegame=mainta), 4108" note: "Spearhead default.cfg lives here; required when com_target_game=1." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak2.pk3" category: game_data @@ -123,6 +127,7 @@ files: path: "mainta/pak2.pk3" required: false source_ref: "code/qcommon/files.cpp:338 (fs_originalPaks_mainta[1])" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak3.pk3" category: game_data @@ -158,6 +163,7 @@ files: required: true source_ref: "code/qcommon/files.cpp:346 (fs_originalPaks_maintt[0]), 3227 (fs_basegame=maintt), 4108" note: "Breakthrough default.cfg lives here; required when com_target_game=2." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak2.pk3" category: game_data @@ -165,6 +171,7 @@ files: path: "maintt/pak2.pk3" required: false source_ref: "code/qcommon/files.cpp:347 (fs_originalPaks_maintt[1])" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak3.pk3" category: game_data diff --git a/emulators/xash3d_fwgs.yml b/emulators/xash3d_fwgs.yml index 46791b1c..8a1df726 100644 --- a/emulators/xash3d_fwgs.yml +++ b/emulators/xash3d_fwgs.yml @@ -59,6 +59,7 @@ files: required: true source_ref: "filesystem/pak.c (PAK loader), filesystem/searchpath.c:912 (valve fallback)" note: "Retail Half-Life base pak." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak1.pak" category: game_data @@ -91,6 +92,7 @@ files: # ================================================================ # Condition Zero (czero/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -109,6 +111,7 @@ files: # ================================================================ # Condition Zero: Deleted Scenes (czeror/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -127,6 +130,7 @@ files: # ================================================================ # Deathmatch Classic (dmc/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -145,6 +149,7 @@ files: # ================================================================ # Opposing Force (gearbox/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -165,6 +170,7 @@ files: # Blue Shift (bshift/) # Half-Life source dir still called "bshift" in Steam depot. # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -183,6 +189,7 @@ files: # ================================================================ # Ricochet (ricochet/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -201,6 +208,7 @@ files: # ================================================================ # Team Fortress Classic (tfc/) # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "liblist.gam" category: game_data @@ -215,3 +223,4 @@ files: path: "tfc/pak0.pak" required: false source_ref: "filesystem/pak.c" + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" diff --git a/emulators/yquake2.yml b/emulators/yquake2.yml index 8049c67a..e1d522ba 100644 --- a/emulators/yquake2.yml +++ b/emulators/yquake2.yml @@ -81,6 +81,7 @@ files: # Ground Zero (rogue/), official Mission Pack 2 # Separate yquake2 game library repo: yquake2/rogue. # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak0.pak" category: game_data @@ -94,6 +95,7 @@ files: # Three Wave Capture The Flag (ctf/), official free addon # Separate yquake2 game library repo: yquake2/ctf. # ================================================================ + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" - name: "pak0.pak" category: game_data @@ -102,3 +104,4 @@ files: required: false source_ref: "src/common/filesystem.c:1331 (first_mods[3]=ctf), 1688" note: "Three Wave CTF data. Loaded when `+set game ctf` is passed." + unsourceable: "retail data the collection does not hold; a same-named file of another game must not stand in" diff --git a/scripts/dedup.py b/scripts/dedup.py index d01d31a8..7b50b4ed 100644 --- a/scripts/dedup.py +++ b/scripts/dedup.py @@ -39,6 +39,10 @@ NODEDUP_DIRS = { # A zoneinfo tree is addressed by zone name and its aliases are equal # files by design: US/Samoa is Pacific/Midway. "tzdata", + # VICE data is addressed by machine directory: C64, C64DTV and SCPU64 + # share one keymap, C64 and CBM-II one palette. With the copies removed + # the name step served the C128 keymap to all of them. + "c64-emu", } diff --git a/tests/test_game_data_homonyms.py b/tests/test_game_data_homonyms.py new file mode 100644 index 00000000..fa2a7bed --- /dev/null +++ b/tests/test_game_data_homonyms.py @@ -0,0 +1,115 @@ +"""Game data laid out in a directory is not served by another game's file. + +Engines read generic names from their own tree: `pak0.pak` is Quake II's +under `baseq2/` and Half-Life's under `valve/`. The name step of the resolver +ignores directories, so once one of them is collected every other entry of +that name resolves to it and a pack ships the wrong game's bytes under the +right path. The collection stores such a file under the tail the engine +reads (`.../baseq2/pak0.pak`), which lets its own entry resolve by path; an +entry that only reaches the same file by its bare name is a homonym, and +carries `unsourceable:` until its own bytes are held. +""" + +from __future__ import annotations + +import os +import sys +import unittest +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(REPO_ROOT / "scripts")) + +from common import ( # noqa: E402 + build_zip_contents_index, + load_data_dir_registry, + load_database, + load_emulator_profiles, + resolve_local_file, +) + + +def homonyms(claims: list[tuple[str, str, str, str]]) -> list[tuple[str, str, str]]: + """(profile, destination, file) for name-only claims on a file that + another entry reaches by its path. + + claims: (profile, destination, status, local file). + """ + by_path = {local for _, _, status, local in claims if status == "path_exact"} + found = [] + for profile, dest, status, local in claims: + if status != "name_exact" or local not in by_path: + continue + if local.casefold().endswith("/" + dest.casefold()): + continue + if local.rsplit("/", 1)[-1].casefold() != dest.rsplit("/", 1)[-1].casefold(): + # Reached through an alias: the profile says the two are one file. + continue + found.append((profile, dest, local)) + return sorted(found) + + +class HomonymRule(unittest.TestCase): + def test_a_name_claim_on_a_file_another_entry_reaches_by_path_is_named(self): + claims = [ + ("quake2", "baseq2/pak0.pak", "path_exact", "bios/Q2/baseq2/pak0.pak"), + ("halflife", "valve/pak0.pak", "name_exact", "bios/Q2/baseq2/pak0.pak"), + ] + self.assertEqual( + homonyms(claims), [("halflife", "valve/pak0.pak", "bios/Q2/baseq2/pak0.pak")] + ) + + def test_a_file_only_ever_found_by_name_is_not_judged(self): + claims = [ + ("mame2003", "mame2003/cheat.dat", "name_exact", "bios/Arcade/cheat.dat"), + ("mame2010", "mame2010/cheat.dat", "name_exact", "bios/Arcade/cheat.dat"), + ] + self.assertEqual(homonyms(claims), []) + + def test_a_declared_alias_is_the_profile_speaking(self): + claims = [ + ("m", "crosshair/cross7.png", "path_exact", "bios/m/crosshair/cross7.png"), + ("m", "crosshair/cross8.png", "name_exact", "bios/m/crosshair/cross7.png"), + ] + self.assertEqual(homonyms(claims), []) + + def test_two_entries_sharing_a_path_agree(self): + claims = [ + ("a", "etmain/pak1.pk3", "path_exact", "bios/ET/etmain/pak1.pk3"), + ("b", "etmain/pak1.pk3", "path_exact", "bios/ET/etmain/pak1.pk3"), + ] + self.assertEqual(homonyms(claims), []) + + +class CollectionCarriesNoGameDataHomonym(unittest.TestCase): + def test_the_profiles_resolve_no_game_data_to_another_game(self): + database = REPO_ROOT / "database.json" + if not database.is_file(): + self.skipTest("no database.json") + previous = os.getcwd() + os.chdir(REPO_ROOT) + try: + db = load_database(str(database)) + profiles = load_emulator_profiles("emulators", skip_aliases=False) + zip_index = build_zip_contents_index(db) + registry = load_data_dir_registry("platforms") + claims = [] + for name, profile in sorted(profiles.items()): + for entry in profile.get("files") or []: + if entry.get("category") != "game_data" or entry.get("unsourceable"): + continue + dest = str(entry.get("path") or entry.get("name") or "") + if "/" not in dest.strip("/"): + continue + local, status = resolve_local_file( + entry, db, zip_index, dest_hint=dest, data_dir_registry=registry + ) + if local: + claims.append((name, dest, status, local)) + finally: + os.chdir(previous) + self.assertEqual(homonyms(claims), []) + + +if __name__ == "__main__": + unittest.main()