Raspberry Pi in the cartridge from NES

Hello! This is a retro game console based on Raspberry Pi. In the cartridge from the game console NES. For the game, an integrated screen can be used. When displaying the same video for HDMI, it shows the image of the game cover, as well as the core temperature, see the photo. I suggest a little ponastalgirovat and read about the assembly and configuration of such a device. Be careful, then a lot of traffic and photos.
part of hits that time. Then the whole court was going to play with my friend in Sega (Sega Mega Drive), in such hits as Sonic, Ultimate Mortal Combat ? Contra Hard Corps and other . And when Play Station came out, I must say, it did not reach us immediately, then the Resident Evil series caused some really frightening delight.

I was helped to brush off the tear of nostalgia this picture. I must say, I'm not the first one who came up with the idea to insert Raspberry Pi into the case from the NES cartridge. Yes, this is not my device. And this cartridge is suitable for this purpose is almost perfect, it is small and beautiful. And inside a lot of space. Judge for yourself.

Inside the Raspberry Pi Zero, USB hub, and a pair of extension cords. All the sticks are planted on
Assembling
I wanted to collect something the same or similar. The same cartridge from NES was chosen. Other options are either very small, or they do not look very good. As a fiery heart of a retro-car made Raspberry Pi 3B. Alim, also, USB connectors with convenient leads for soldering were purchased. This is it.

Oh, yes, you will repeat this project, do not take hit cartridges. There are so few of them left. Take something more common or less known. There is also an option to take a cartridge with Ali, but the original, it heats the soul. My 1986 year of release.
You will also need a special screwdriver nes screwdriver , if the cartridge is screwed onto three screws. There are also early versions of cartridges with five screws, they are unscrewed with a conventional flat-blade screwdriver. At me just such.
From the cartridge with a clerical knife and a saw blade from a hacksaw, all the interfering parts are cut and cut off.

With the Raspberry Pi, the connectors were welded together. Experts say that you can do without a soldering station, if you first carefully disassemble the connectors with clippers, and then evaporate one foot. All glued to hot melt. Between the USB connectors and malinkoy paved insulator made of non-melting plastic. Do not forget to connect the GND Raspberry Pi and the case of the USB connector (not shown in the picture above). Otherwise, some joysticks will not work.

The last was installed on the malinku. Retropie . At first there was Recalbox , but I refused it, since it does not support the vibration of joysticks on the Playstation 1 consoles. But I must say, Recalbox is slightly more convenient, in terms of what works out of the box and there is nothing to adjust. In Retropie a bunch of settings, you can configure infinitely. This he liked me.
That's what happened. Any joysticks with xinput are connected.

The screen
Appetite comes with eating. How about to integrate the screen into the cartridge? To play or output the image of the game cover. Was ordered such a screen . It's a 800 * ??? inch screen with a parallel DPI interface that uses almost all GPIO Raspberry Pi. At me it works in a mode 120 Hz (but the renderer all the same in 60 Hz), the response instant. The only negative is a 6-bit matrix. Total 26?144 colors. Although, in general, this is not particularly noticeable, judge for yourself.

All the legs from the screen and Raspberry Pi were soldered. The screen was soldered by two plumes with a torn old IDE cable. Under the screen are installed mortgages in 5mm, it does not touch the bottom wall of the cartridge. On the perimeter of the display tape is glued, so that there are no side lights. All glued to hot melt. On the top lid I cut a window and pasted a 2mm thick glass.

In order to launch the output of the image on this screen, you need to correct the config /boot/config.txt . I recommend for Windows owners the program WinSCP , which connects with Raspberry Pi on SSH, gives the representation of files as in Total commander'e. Very comfortably. Especially if you run it in mode. shell sudo su - , which gives access to all files.
Unfortunately, when the DPI screen is on, video output for HDMI does not work. So I created the folder /boot / two configs, one config_hdmi.txt , the second is config_dpi.txt . In the config config_hdmi.txt the resolution is 1080p60Hz and removed overscan. config_dpi.txt contains DPI screen settings.
config_dpi.txt [/b]
# uncomment if you get no picture on HDMI for a default "safe" mode
# hdmi_safe = 1
disable_overscan = 1
# uncomment to force a specific HDMI mode (this will force VGA)
# hdmi_group = 1
# hdmi_mode = 1
# Sound output. Set to 0 or comment for autodetect, 1 for DVI, 2 to force HDMI.
# hdmi_drive = 2
# Using /etc /modules is deprecated and no longer supported on 4.4 kernel
# So manually enable audio
dtparam = audio = on
config_hdmi_boost = 0
# force hdmi while the tv can take time before sending the signal on the hdmi output
hdmi_force_hotplug = 1
# uncomment for composite PAL
# sdtv_mode = 2
# uncomment for lirc-rpi
# dtoverlay = lirc-rpi
# 3.5 HD tft screen 800x480
dtoverlay = dpi24
overscan_left = 0
overscan_right = 0
overscan_top = 0
overscan_bottom = 0
#Banggood
framebuffer_width = 800
framebuffer_height = 480
dtparam = spi = off
dtparam = i2c_arm = off
enable_dpi_lcd = 1
display_default_lcd = 1
dpi_output_format = 0x6f015
dpi_group = 2
dpi_mode = 87
hdmi_timings = ??? ??? ??? ??? ??? ???r3r31398. display_rotate = 3
# if you plug your tv at the same time as your rpi and that the rpi switches from the hdmi or give a low resolution because tv had no enough time to initialize it
boot_delay = 3
# uncomment if you do not want the rainbow at startup
# disable_splash = 1
# default CEC name
# cec_osd_name = recalbox
dtparam = spi = off
# Overclock
gpu_mem_256 = 128
gpu_mem_512 = 256
gpu_mem_1024 = 256
overscan_scale = 1
gpu_mem = 256
start_x = 0
enable_uart = 0
avoid_safe_mode = 1
kernel = zImage
config_hdmi.txt [/b]
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See the link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
# hdmi_safe = 1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan = 1
# uncomment the following to adjust overscan. Use positive numbers if console
# off screen, and negative if there is too much border.
# overscan_left = 16
# overscan_right = 16
# overscan_top = 16
# overscan_bottom = 16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
# framebuffer_width = 1280
# framebuffer_height = 720
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug = 1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group = 1
# 1080p60fps
hdmi_mode = 16
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
# hdmi_drive = 2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
# config_hdmi_boost = 4
# uncomment for composite PAL
# sdtv_mode = 2
#uncomment to overclock the arm. 700 MHz is the default.
# arm_freq = 800
3) Uncomment of some or all of these to enable the optional hardware interfaces
# dtparam = i2c_arm = on
# dtparam = i2s = on
dtparam = spi = off
# Uncomment this to enable the lirc-rpi module
# dtoverlay = lirc-rpi
# Additional overlays and parameters are documented /boot /overlays /README
# Enable audio (loads snd_bcm2835)
dtparam = audio = on
gpu_mem_256 = 128
gpu_mem_512 = 256
gpu_mem_1024 = 256
overscan_scale = 1
gpu_mem = 256
start_x = 0
enable_uart = 0
Switch configs will be our autoscript which is available on the network
???.x.xxxconfigsallautostart.sh or in the folder on your device /opt/retropie/configs/all/autostart.sh
autostart.sh [/b]
# Check to see if display is not connected
_NOHDMI = $ (tvservice -n) || true
# Check to make sure it's not already in LCD mode
_ISLCD = $ (tvservice -s | grep "LCD") || true
# HDMI is connected - turn off backlight LCD
_HDMI = $ (tvservice -s | grep "0x12000a") || true
if[-z "$_NOHDMI" ]; then
if["$_ISLCD" ]; then
printf "NO HDMI connected, LCD DPI display config already active"
#do nothing
else
printf "NO HDMI connected, Switching to LCD DPI displayn"
#change config to Hyperpixel and reboot since no display detected
sudo cp /boot/config_dpi.txt /boot/config.txt
sudo reboot now
fi
elif["$_NOHDMI" ]; then
if["$_ISLCD" ]; then
printf "HDMI is connected, but LCD DPI config is being usedn"
#we need to switch to HDMI display config and reboot
sudo cp /boot/config_hdmi.txt /boot/config.txt
sudo reboot now
elif["$_HDMI" ]; then
printf "HDMI is connected, HDMI config detected, so turning off LCD BLn"
#we need to shut off the backlight on the Hyperpixel display
# do not panic, a reboot automatically resets this - it is not a persistent value
#also to do this the config.txt file needs to load the backlight module on startup
#to control it, even if you are not. loading the overlay driver for the display
# this comment
#echo 1 | sudo tee /sys /class /backlight /rpi_backlight /bl_power
else
#debugging catchall - should not happen since we expect 0x12000a - but you never know
printf "HDMI is connected, HDMI config detected, your tv might not like 1920x1080 resolutionn"
fi
else
#do nothing - based on previous if statements - you either have HDMI or you do not have it
printf "Debug catchall point - sorry I can not help you out - I have not run into the error state yet! n"
fi
emulationstation #auto
The script was also written. switchscreen.sh , which must be put in /home /pi /RetroPie /retropiemenu / . This script switches configs manually and is accessible from the main menu of Retropie settings. It is necessary after its launch to pull out the HDMI cable, and then after reboot everything will switch back automatically. Do not forget to write the script
chmod + x /home/pi/RetroPie/retropiemenu/switchscreen.sh
switchscreen.sh [/b]
#! /bin /bash
# Check to see if display is dpi
_DPI = $ (grep dpi /boot/config.txt) || true
if["$_DPI" ]; then
printf "Switch to HDMIn"
sudo cp /boot/config_hdmi.txt /boot/config.txt
sudo reboot now
else
printf "Switch to DPI LCDn"
sudo cp /boot/config_dpi.txt /boot/config.txt
sudo reboot now
fi
exit 0
In autostart.sh Traces of code that disable the DPI backlight are visible when HDMI is turned on. This script I copied on the Internet, so it does not work on our screen. It would be possible to confuse with transistors to turn off the power of the screen, but why, if we need to display the cover image at the moment the game is running. You just need to figure out what DPI is.
Parallel Display Interface (DPI)
DPI, as mentioned, is a parallel interface for screens. Information on this interface times , two and he considered . Well, now it will be here, in Russian.
All attempts to include DPI console commands during the operation of HDMI results did not. Maybe I did something wrong. Plan B was adopted for implementation: output the image to a small screen, pulling the software by the feet of the GPIO.
DPI is characterized by the fact that one pixel is transmitted to the display in one clock cycle. Since we have a 6-bit matrix, there are 18 pins for three colors, and also displays display enable (indicates a valid date), h_sync (sets the zero address of the horizontal line in the display controller), v_sync (sets the zero address of the vertical line in the display controller ). Data snapping occurs at the falling edge of the clock signal. This is known if we decode the line "dpi_output_format = 0x6f015" from our config_dpi.txt according to this terminology.
dpi_output_format [/b]
output_format = (dpi_output_format 0) & 0xf;
rgb_order = (dpi_output_format 4) & 0xf;
output_enable_mode = (dpi_output_format 8) & 0x1;
invert_pixel_clock = (dpi_output_format 9) & 0x1;
hsync_disable = (dpi_output_format 12) & 0x1;
vsync_disable = (dpi_output_format 13) & 0x1;
output_enable_disable = (dpi_output_format 14) & 0x1;
hsync_polarity = (dpi_output_format 16) & 0x1;
vsync_polarity = (dpi_output_format 17) & 0x1;
output_enable_polarity = (dpi_output_format 18) & 0x1;
hsync_phase = (dpi_output_format 20) & 0x1;
vsync_phase = (dpi_output_format 21) & 0x1;
output_enable_phase = (dpi_output_format 22) & 0x1;
output_format:
1: DPI_OUTPUT_FORMAT_9BIT_666
2: DPI_OUTPUT_FORMAT_16BIT_565_CFG1
3: DPI_OUTPUT_FORMAT_16BIT_565_CFG2
4: DPI_OUTPUT_FORMAT_16BIT_565_CFG3
5: DPI_OUTPUT_FORMAT_18BIT_666_CFG1
6: DPI_OUTPUT_FORMAT_18BIT_666_CFG2
7: DPI_OUTPUT_FORMAT_24BIT_888
rgb_order:
1: DPI_RGB_ORDER_RGB
2: DPI_RGB_ORDER_BGR
3: DPI_RGB_ORDER_GRB
4: DPI_RGB_ORDER_BRG
output_enable_mode:
0: DPI_OUTPUT_ENABLE_MODE_DATA_VALID
1: DPI_OUTPUT_ENABLE_MODE_COMBINED_SYNCS
invert_pixel_clock:
0: RGB Data changes on rising edge and stable at falling edge
1: RGB Data changes on falling edge and is stable at rising edge.
hsync /vsync /output_enable_polarity:
0: default for HDMI mode
1: inverted
hsync /vsync /oe phases:
0: DPI_PHASE_POSEDGE
1: DPI_PHASE_NEGEDGE

The sequence of bits is shown in the figure above. For each line starting with VSYNC, you have to complete the cycle of the strokes of the HSYNC line. This is one frame. Back and Front porch are the so-called indentations on the display, which are in the controller's memory, but they are not on the screen.
Now we decode the string "hdmi_timings = ??? ??? ??? ??? ??? 46080000 6" from our config_dpi.txt. There is nothing complicated, just write the parameters in order.

What GPIO legs are used for color delivery, shown in this picture. At us Mode 5. Attention, it not legs in order, namely designations GPIO! The remaining signals Clock - GPIO ? DE - GPIO ? VSYNC - GPIO ? HSYNC - GPIO 3.

Quickly, a python was installed, the GPIO library needed and a hello script was written, at least coloring the screen in blue. I also had a cognitive dissonance when Notepad ++ on Windows did not show indentation, where they were in nano, while doing line breaks, it did tabs rather than blanks. By the way, VSCode is the same sin, how to fix it, did not find it.
Python script [/b]
from gpiozero import LED
from time import sleep
sleep_time = ???r3r31398.
clock = LED (0)
de = LED (1)
vsync = LED (2)
hsync = LED (3)
red2 = LED (16)
red3 = LED (17)
red4 = LED (18)
red5 = LED (19)
red6 = LED (20)
red7 = LED (21)
green2 = LED (10)
green3 = LED (11)
green4 = LED (12)
green5 = LED (13)
green6 = LED (14)
green7 = LED (15)
blue2 = LED (4)
blue3 = LED (5)
blue4 = LED (6)
blue5 = LED (7)
blue6 = LED (8)
blue7 = LED (9)
def v_sync (frame):
vsync.on ()
for n in range (frame):
clock.on ()
#sleep (sleep_time)
clock.off ()
#sleep (sleep_time)
#print ("vsync")
vsync.off ()
pass
def h_sync (frame):
hsync.on ()
for n in range (frame):
clock.on ()
#sleep (sleep_time)
clock.off ()
#sleep (sleep_time)
#print ("hsync")
hsync.off ()
pass
def clc (frame):
for n in range (frame):
clock.on ()
#sleep (sleep_time)
clock.off ()
#sleep (sleep_time)
pass
red2.off ()
red3.off ()
red4.off ()
red5.off ()
red6.off ()
red7.off ()
green2.off ()
green3.off ()
green4.off ()
green5.off ()
green6.off ()
green7.off ()
blue2.on ()
blue3.on ()
blue4.on ()
blue5.on ()
blue6.on ()
blue7.on ()
clock.off ()
de.off ()
# de.on ()
sleep (sleep_time)
v_sync (2)
clc (2)
for row in range (5):
v_sync (2)
# v_back_porch (2)
clc (2)
for column in range (800):
h_sync (16)
# h_back_porch (16)
clc (16)
# LCD column
de.on ()
clc (480)
de.off ()
# h_front_porch (24)
clc (24)
# v_front_porch (4)
clc (4)
de.off ()
red2.off ()
red3.off ()
red4.off ()
red5.off ()
red6.off ()
red7.off ()
green2.off ()
green3.off ()
green4.off ()
green5.off ()
green6.off ()
green7.off ()
blue2.off ()
blue3.off ()
blue4.off ()
blue5.off ()
blue6.off ()
blue7.off ()

Too-me-too-slow, Python. For me, it was a surprise that the already painted pixels disappear. Although, what I was waiting for, this is obvious.
It's decided to rewrite everything in C. It works faster, about a few frames per second. The screen ripples like old CRT monitors or radar. That's what you need. Retro! The code posted on GitHub .

Access to the GPIO is carried out directly, through the SoC registers of the BCM2837 chip. Code samples took here .
It all started with a very tiny program, but nowThe display shows still CPU and memory usage in the form of small scroll bars. The temperature of the processor is drawn here in this font.

To run the code, you need to copy the contents of the repository to the /home /pi /lcd_screen /directory (Who knows how to write C in nix with respect to the binary, not the working directory? So far, only this folder) and execute the following commands.
gt; chmod + x ./lcd_screen/lcd
Either download the binaries from the releases at once. To start, you need to type the following. SUDO is required to access the GPIO.
sudo ./lcd_screen/lcd path /file.bmp usec_per_frame
Where "path /file.bmp" is the path to the image file, it works only with the BMP format, "usec_per_frame" is the delay between frames in microseconds, so as not to load the processor in vain.
We automate the launch of our lcd program so that it displays the desired cover when the game is started. Of course, for downloading covers in Retropie uses a built-in scrapper.
Install the image converter. It will convert all formats to bmp, supported by the program. At the same time and change the size so that the images are on the whole screen.
sudo apt-get install imagemagick
In the directory /opt /retropie /configs /all / create two files: runcommand-onstart.sh and runcommand-onend.sh . These scripts Retropie automatically performs when loading /terminating any game. Do not forget to assign chmod + x to each file.
runcommand-onstart.sh [/b]
#! /bin /sh
system = "$ 1"
emulator = "$ 2"
romname = "$ 3" #with path
#echo $ system
# LCD programm here:
#find current config: dpi or hdmi
_DPI = $ (grep dpi /boot/config.txt) || true
if!["$_DPI" ]; #if hdmi
then
sudo killall lcd
# remove path
filename = $ (basename "$ romname")
# remove extension
filename = "$ {filename%. *}"
# add image path
file_png = "/home /pi /.emulationstation /downloaded_images /$ system /$ filename-image.png"
file_jpg = "/home /pi /.emulationstation /downloaded_images /$ system /$ filename-image.jpg"
#if system snes and n64 then rotate image 270 degree
if["$system" = "snes" ]||["$system" = "n64" ]
then
if test -f "$ file_png"; #fing file
then
convert "$ file_png" -resize '800x480' -type TrueColor -alpha Remove -rotate 270 /home/pi/lcd_screen/work.bmp
elif test -f "$ file_jpg";
then
convert "$ file_jpg" -resize '800x480' -type TrueColor -alpha Remove -rotate 270 /home/pi/lcd_screen/work.bmp
else
convert "/opt/retropie/configs/$system/launching.png" -resize '480x800' -type TrueColor -alpha Remove -rotate 180 /home/pi/lcd_screen/work.bmp
fi
else
if test -f "$ file_png";
then
convert "$ file_png" -resize '480x800' -type TrueColor -alpha Remove -rotate 180 /home/pi/lcd_screen/work.bmp
elif test -f "$ file_jpg";
then
convert "$ file_jpg" -resize '480x800' -type TrueColor -alpha Remove -rotate 180 /home/pi/lcd_screen/work.bmp
else
convert "/opt/retropie/configs/$system/launching.png" -resize '480x800' -type TrueColor -alpha Remove -rotate 180 /home/pi/lcd_screen/work.bmp
fi
fi
#launch my lcd project
sudo /home /pi /lcd_screen /lcd /home/pi/lcd_screen/work.bmp 400000 &
fi
runcommand-onend.sh [/b]
#! /bin /sh
_DPI = $ (sudo grep dpi /boot/config.txt) || true
if!["$_DPI" ];
then
sudo killall lcd
sudo /home /pi /lcd_screen /lcd /home/pi/lcd_screen/retropie.bmp 50000 &
# cp /home/pi/lcd_screen/retropie.bmp/home/pi/lcd_screen/work.bmp
fi
In the startup script, the presence of the DPI connection is checked first, then the image with the jpeg or png formats is searched, rotated to the desired angle, its size is changed and converted to bmp format, then my program starts with the necessary parameters.
Cooling
Raspberry Pi 3B is more powerful than Zero, and it needs good cooling. Especially in such a closed case. With a small heatsink visible in the photo, after half an hour of playing on any emulator the core temperature reached 80 degrees and the trotting began.

A centrifugal fan 40 * 30 * 10 mm was ordered, but until he arrived, I just tried to saw out a 3 mm aluminum plate with a small plate, measuring 80 * 30 mm. By that time, all the GPIO pins I drank, so they no longer interfered with the installation of the plate. In addition, he sawed a piece of 20 * 10mm for contact with the chip and made a sandwich from the plates. This surpassed all my expectations, a maximum of 65 degrees on the core.

So it looks inside.

In the end, that
How is it played? Excellent! With shouts, beat of gamepads, mutual reproaches. Just like once.
No delays and lags were observed.
The screen, of course, is too small, only three and a half inches. We were spoiled by smartphones with five inches, but you can play. The text is readable, even small. I prefer HDMI.
You can come to a friend, play, portability allows. Accompanying accessories: trails, cables, joysticks, charging take up more space than the console itself.
Sound
Unfortunately, the regular sound of Raspberry Pi leaves much to be desired. As a sound system, PWM modulation with passive filtering is used. Therefore, a USB DAC was purchased for PCM2704. Mainly because of its size.
There is a lack of sound output when playing on a small LCD screen, so the micro-amplifier 3W on the NS8002 was purchased, and the speaker from the tablet was cut to 8 ohms.
USB DAC and NS8002 [/b] 

All this will fit under the LCD screen. Will come, I will put.
The assembly is finished. Next, I will give some of the less interesting for reading entertainment features settings Retropie.


All this will fit under the LCD screen. Will come, I will put.
We file Retropie
The assembly is finished. Next, I will give some of the less interesting for reading entertainment features settings Retropie.
Shaders [/b]
Most consoles that can emulate Raspberry Pi, gives a resolution of 320x240 pixels. By today's standards, this is very small. All games acquire a pronounced pixelization on modern screens.

The creators of Retroarch, which is part of Retropie, took care of this issue and added support for shaders. For example, I really like the preinstalled xbr-lv1-noblend.glslp . He, literally, draws the details out of the picture. See below.
Screenshot from the game Castlevania: Symphony of the Night, I advise you to play it
To set the shader, go to the menu Retropie -> Configuration editor . Select Configure basic libretro emulator options , then select Configure default options for all libretro emulators . Then set Video Shader Enable in "true" and Video Shader File to the desired shader. Also install Video Smoth in "false", since it only smears the picture. You can even choose something like scanline shader, which emits the work of CRT TVs. But this is an amateur.

The rendering of shaders is quite a costly operation. When the resolution is equal to and above 720p on the RPi 3B, rather noticeable jumps appear. Therefore, in the same menu, select Render resolution "800x600". Do not worry if you have previously made changes to the file /boot/config.txt , as in this article above just above, then the screen resolution on the HDMI cable will be 1080p, but the emulator will render the picture at 800x600 and stretch it to the full screen. And he does it not badly. At least with a shader better than without it, and rendering in 1080p is useless, because the video data of the game is still drawn for resolution 320x240.

The creators of Retroarch, which is part of Retropie, took care of this issue and added support for shaders. For example, I really like the preinstalled xbr-lv1-noblend.glslp . He, literally, draws the details out of the picture. See below.

To set the shader, go to the menu Retropie -> Configuration editor . Select Configure basic libretro emulator options , then select Configure default options for all libretro emulators . Then set Video Shader Enable in "true" and Video Shader File to the desired shader. Also install Video Smoth in "false", since it only smears the picture. You can even choose something like scanline shader, which emits the work of CRT TVs. But this is an amateur.

The rendering of shaders is quite a costly operation. When the resolution is equal to and above 720p on the RPi 3B, rather noticeable jumps appear. Therefore, in the same menu, select Render resolution "800x600". Do not worry if you have previously made changes to the file /boot/config.txt , as in this article above just above, then the screen resolution on the HDMI cable will be 1080p, but the emulator will render the picture at 800x600 and stretch it to the full screen. And he does it not badly. At least with a shader better than without it, and rendering in 1080p is useless, because the video data of the game is still drawn for resolution 320x240.
Joystick setting [/b]
If you have any xinput gamepad (standard Micro $ oft), it will do. It is configured when the first start of Retropie, or through the start button - Configure Input. But here there is a headache. Creepy overseas children, in order not to fall for patent lawsuits changed the buttons with A and B, X and Y.

If you have a gamepad from xbox or similar, then you need to adjust with the buttons turned upside down, like on NES. Then go to Retropie -> Retropie Setup , select Configuration /tools , then emulationstation , put in Swap A /B Buttons in ES "Swapped". Then reconfigure the joystick.
Also, I do not like how the developers of Retropie ordered a button-based fund. Where is the combination of buttons to make a screenshot? Why do I need a reset button, if I hit it every time? Where are the rewind and acceleration buttons?
To fix this, you need to edit the file with the name of your joystick in /opt /retropie /configs /all /retroarch-joypads / . It is also available on the network
???.x.xxxconfigsallretroarch-joypads . After each update of Retropie through the update, the binding numbering flies, so I will not upload the entire config. I'll write that I changed only these buttons. They are executed when pressed simultaneously with the Hotkey, usually this is a button with a logo, in the middle of the joystick.
Here the screenshots button is assigned instead of reset. Fast forvard and rewind (rewind) are set to the cross buttons: forward and backward. Cross buttons up and down change the save slot.
Rewind should be included in the config /opt/retropie/configs/all/retroarch.cfg . Just do not turn on Rewind on the psx emulator, it all starts to wildly slow down. Rewind, by default, is disabled in the psx config file.
I also want to add about Bluetooth. I myself do not like wireless joysticks and I always play with cable. Old school yet. For lovers of wireless joysticks, you need to purchase a Bluetooth dongle and insert it into a USB port. So it will be better and no problems will be. I did not check it myself, but knowledgeable people write.
But that's not all. In Retropie Setup in the package manager you can put various ports, for example Openttd, Doom or even DOS DOS emulator. But you can not manage the joystick in them. Only the keyboard and mouse. To fix this, you need to install the xboxdrv driver in the package manager, which can simulate keystrokes. Just put from the source, auto-start do not need, it does not fit all joysticks.
We'll write the launch script ourselves under our gamepad. Add to /opt/retropie/configs/all/runcommand-onstart.sh The following lines are at the end of the file.
Here, $ 1 is our target system, which runs xboxdrv. You can add by analogy. The lines --evdev-absmap --evdev-keymap are responsible for binding the axes and buttons to your joystick. The script above is given for the Xbox One S controller. To find out which axis and button correspond to the number or name of your joystick, you need to type in the console. evtest . At the same time, you can see what event corresponds to our joystick. At me it /dev /input /event0 which costs in parameter --evdev.
Parameters --ui-axismap emulate the mouse axis, and --ui-buttonmap the keyboard buttons. In this example, the hammers are the mouse buttons, the left stick is the mouse, the right stick is the cursor keys. Start, select - enter and esc, respectively. The remaining keys are assigned to the keypad digits. Unfortunately, it was not possible to use the cross for the buttons of the keyboard. For some reason, the joystick Xbox One S refuses to work.
With such a config, strategies like Theme Hospital, OpenTTD, etc. are very well played. Sliders are a little worse, but you can create similar startup scripts for shooters in the same file, changing the $ 1 parameter there.
To ensure the normal operation of the joystick in the emulationstation, you need to complete xboxdrv after quitting the game. For this, at the end of the file is /opt/retropie/configs/all/runcommand-onend.sh we add the following.

If you have a gamepad from xbox or similar, then you need to adjust with the buttons turned upside down, like on NES. Then go to Retropie -> Retropie Setup , select Configuration /tools , then emulationstation , put in Swap A /B Buttons in ES "Swapped". Then reconfigure the joystick.
Also, I do not like how the developers of Retropie ordered a button-based fund. Where is the combination of buttons to make a screenshot? Why do I need a reset button, if I hit it every time? Where are the rewind and acceleration buttons?
To fix this, you need to edit the file with the name of your joystick in /opt /retropie /configs /all /retroarch-joypads / . It is also available on the network
???.x.xxxconfigsallretroarch-joypads . After each update of Retropie through the update, the binding numbering flies, so I will not upload the entire config. I'll write that I changed only these buttons. They are executed when pressed simultaneously with the Hotkey, usually this is a button with a logo, in the middle of the joystick.
Button config [/b]
input_screenshot_btn = "0"
input_rewind_btn = "h0left"
input_hold_fast_forward_btn = "h0right"
input_state_slot_increase_btn = "h0up"
input_state_slot_decrease_btn = "h0down"
Here the screenshots button is assigned instead of reset. Fast forvard and rewind (rewind) are set to the cross buttons: forward and backward. Cross buttons up and down change the save slot.
Rewind should be included in the config /opt/retropie/configs/all/retroarch.cfg . Just do not turn on Rewind on the psx emulator, it all starts to wildly slow down. Rewind, by default, is disabled in the psx config file.
I also want to add about Bluetooth. I myself do not like wireless joysticks and I always play with cable. Old school yet. For lovers of wireless joysticks, you need to purchase a Bluetooth dongle and insert it into a USB port. So it will be better and no problems will be. I did not check it myself, but knowledgeable people write.
Xboxdrv
But that's not all. In Retropie Setup in the package manager you can put various ports, for example Openttd, Doom or even DOS DOS emulator. But you can not manage the joystick in them. Only the keyboard and mouse. To fix this, you need to install the xboxdrv driver in the package manager, which can simulate keystrokes. Just put from the source, auto-start do not need, it does not fit all joysticks.
We'll write the launch script ourselves under our gamepad. Add to /opt/retropie/configs/all/runcommand-onstart.sh The following lines are at the end of the file.
runcommand-onstart.sh [/b]
# xboxdrv
sudo killall> /dev /null 2> & 1 xboxdrv
if["$1" = "pc" ]||["$1" = "openttd" ]||["$1" = "doom" ]||["$1" = "kodi" ];
then
sudo /opt /retropie /supplementary /xboxdrv /bin /xboxdrv> /dev/shm/runcommand.log 2> & 1
--evdev /dev /input /event0
--silent
--detach-kernel-driver
--force-feedback
--mimic-xpad
--trigger-as-button
--evdev-no-grab
--evdev-absmap ABS_X = x? ABS_Y = y? ABS_RX = x? ABS_RY = y? ABS_HAT0X = dpad_x, ABS_HAT0Y = dpad_y
--evdev-keymap KEY_ # 304 = a, KEY_ # 305 = b, KEY_ # 307 = x, KEY_ # 308 = y, KEY_ # 312 = lt, KEY_ # 313 = rt, KEY_ # 310 = lb, KEY_ # 311 = rb, KEY_ # 317 = tl, KEY_ # 318 = tr, KEY_ # 314 = back, KEY_ # 315 = start, KEY_ # 316 = guide
--axismap -Y1 ^ deadzone: 3000 = Y? -Y2 ^ deadzone: 3000 = Y2
--ui-axismap x2 ^ deadzone: 3000 = KEY_LEFT: KEY_RIGHT, y2 = KEY_UP: KEY_DOWN
--ui-axismap x1 ^ deadzone: 3000 = REL_X: 0? y1 = REL_Y: 06
--ui-axismap dpad_x ^ deadzone: 0 = KEY_LEFT: KEY_RIGHT, dpad_y ^ deadzone: 0 = KEY_UP: KEY_DOWN
--ui-buttonmap rt = BTN_LEFT, lt = BTN_RIGHT, start = KEY_ENTER, back = KEY_ESC, tl = KEY_? tr = KEY_? lb = KEY_? rb = KEY_? a = KEY_SPACE, b = KEY_M, x = KEY_? y = KEY_LEFTCTRL, guide = KEY_Y
&
fi
Here, $ 1 is our target system, which runs xboxdrv. You can add by analogy. The lines --evdev-absmap --evdev-keymap are responsible for binding the axes and buttons to your joystick. The script above is given for the Xbox One S controller. To find out which axis and button correspond to the number or name of your joystick, you need to type in the console. evtest . At the same time, you can see what event corresponds to our joystick. At me it /dev /input /event0 which costs in parameter --evdev.
Parameters --ui-axismap emulate the mouse axis, and --ui-buttonmap the keyboard buttons. In this example, the hammers are the mouse buttons, the left stick is the mouse, the right stick is the cursor keys. Start, select - enter and esc, respectively. The remaining keys are assigned to the keypad digits. Unfortunately, it was not possible to use the cross for the buttons of the keyboard. For some reason, the joystick Xbox One S refuses to work.
With such a config, strategies like Theme Hospital, OpenTTD, etc. are very well played. Sliders are a little worse, but you can create similar startup scripts for shooters in the same file, changing the $ 1 parameter there.
To ensure the normal operation of the joystick in the emulationstation, you need to complete xboxdrv after quitting the game. For this, at the end of the file is /opt/retropie/configs/all/runcommand-onend.sh we add the following.
runcommand-onend.sh [/b]
sudo killall> /dev /null 2> & 1 xboxdrv
If something went wrong when updating Retropie [/b]
Once, I launched the update Retropie and when unpacking the kernel, the built-in Wi-Fi fell off. The device was booted, but did not respond to any buttons, including the connected keyboard. SSH not, because there is no Wi-Fi, does not respond to the keyboard, and SD card does not reach
I noticed that the keyboard works at boot time. Pushed many times ctrl + c and, oh, console! But how now to restore Wi-Fi? The interface wlan0 was missing from the word at all. Running the updater did not help, because it pulls files from the Internet.
The first thing in /opt/retropie/configs/all/autostart.sh commented out the start of the emulationstation and rebooted. After restarting, the console is loaded, the keyboard is working. Further google, how to return wlan gave this here. The command reconfigures all installed packages. It helped.
I noticed that the keyboard works at boot time. Pushed many times ctrl + c and, oh, console! But how now to restore Wi-Fi? The interface wlan0 was missing from the word at all. Running the updater did not help, because it pulls files from the Internet.
The first thing in /opt/retropie/configs/all/autostart.sh commented out the start of the emulationstation and rebooted. After restarting, the console is loaded, the keyboard is working. Further google, how to return wlan gave this here. The command reconfigures all installed packages. It helped.
sudo dpkg --configure -a
To Retropie did not look like Linux station [/b]
When I download the console, I do not want to look at the Linux boot log. It spoils the whole spirit of consoles of the nineties.
To remove the Linux boot log [/b]
To remove the Linux boot log, you need to bring the file /boot/cmdline.txt to such a species. All in one line.
Briefly, the config removes the logo, displays messages to another console, removes the flashing cursor.
Then we remove all the text in motd.
Remove the autologin text.
It is necessary to change the line
in this file.
At

Also in Retropie is installed runcommand, which, when the game starts, displays the console cut with the suggestion of keystroke. This screen can be replaced with cute pictures of game consoles.

Detailed instructions on how to do this are written here .
You can improve infinitely. I'll give you a couple of links on what can be done. Write some more interesting pieces that you can add. Thank you for attention.
Install dosbox and various ports .
Set a different topic of emulationstation.
Share the folder of screenshots.
Install the web browser.
Install the web manager Retropie
Connect Raspberry Pi from the main computer's Steam.
Install Brutal Doom, finally.
It's worth it.
cmdline.txt [/b]
dwc_otg.lpm_enable = 0 console = tty3 root = PARTUUID = f2d3cb4f-02 rootfstype = ext4 elevator = deadline fsck.repair = yes rootwait loglevel = 3 consoleblank = 0 plymouth.enable = 0 quiet vt.global_cursor_default = 0 plymouth.enable = 0 plymouth .ignore-serial-consoles splash
Briefly, the config removes the logo, displays messages to another console, removes the flashing cursor.
Then we remove all the text in motd.
nano /etc /motd
Remove the autologin text.
sudo nano /etc/systemd/system/[email protected]
It is necessary to change the line
in this file.
ExecStart = - /sbin /agetty --autologin pi --noclear% I $ TERM
At
ExecStart = - /sbin /agetty --skip-login --noclear --noissue --login-options "-f pi"% I $ TERM
More details about this written here .
Also, when you boot the system, you can display your own photo - splashscreen. It is possible and several, they will change each other with time. You need to put your pictures in the folder on the network ???.x.xxxsplashscreens, and select them in the Retropie menu -> SPLASH SCREEN -> Append Splashscreen to list .
For example, I like this picture very much.

Also in Retropie is installed runcommand, which, when the game starts, displays the console cut with the suggestion of keystroke. This screen can be replaced with cute pictures of game consoles.

Detailed instructions on how to do this are written here .
What else can you do
You can improve infinitely. I'll give you a couple of links on what can be done. Write some more interesting pieces that you can add. Thank you for attention.
Install dosbox and various ports .
Set a different topic of emulationstation.
Share the folder of screenshots.
Install the web browser.
Install the web manager Retropie
Connect Raspberry Pi from the main computer's Steam.
Install Brutal Doom, finally.
It's worth it.
It may be interesting
This publication has no comments.
weber
Author13-09-2018, 20:23
Publication DateDevelopment / Programming
Category- Comments: 0
- Views: 910
Comments
The Daily Reports is the reliable and authentic news and blog publisher. Visit The Daily Reports for up-to-date US news, international news and policy analysis. Check out: International Politics News
nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! https://l23movies.club/
Extremely helpful post. This is my first time i visit here. I discovered such a large number of intriguing stuff in your blog particularly its exchange. Truly its extraordinary article. Keep it up.먹튀검증사이트
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. pigmentvlekken verwijderen - dermasensation.nl
Bangalore Escorts provides escort call girls by the escort agency in Bangalore. We have selected the best high profile call girls in Bangalore. Visit us www.piyagupta.com/
South Bangalore Escorts || Marathahalli Escorts || Electronic City Escorts || Hebbal Escorts || Mg road Escorts || Ulsoor Escorts || Ub city Escorts || Nandi hills Escorts || Malleswaram Escorts || Commercial street Escorts || Indira nagar Escorts || Hsr layout Escorts