In questo post (in costante w.i.p.) cercherò di approfondire un mondo davvero interessante, che gira intorno ad una serie di hardware basati su FPGA, che permettono, quindi una "emulazione" (o meglio, "riproduzione") perfetta al 100% di una console, pcb arcade o di un personal computer.
Roberto Lari, autore di una monografia sull'argomento, mi ha appena dato l'ok per pubblicare il suo pdf sul forum. Per il momento non può partecipare attivamente, ma spero in un suo intervento diretto futuro.
Cercherò di trattare le informazioni e di aggiornarle, approfondirle, perché è un mondo in continua evoluzione, un mondo a me parzialmente sconosciuto, ma credo fermamente che scrivere qui sia utilissimo, come metodo di studio e ricerca, per imparare (io in primis) e per condividere informazioni con chi è interessato a questo argomento.
Quindi il post sarà in continuo aggiornamento, una sorta di diario, promemoria, con tutte le informazioni che servono a comprendere e utilizzare hardware basati su FPGA.
Il mio intento sarà, ovviamente quello di passare dalla teoria (tanta, che mi han detto che all'inizio è un po' complicatuccio, vedremo) alla pratica, acquistando ciò che occorre per avere questa santa emulazione/riproduzione hardware perfetta.
FPGA: di cosa si tratta?
Vediamo di capire cosa si intende per FPGA e quali sono le differenze rispetto all'emulazione "classica" di un arcade, console etc.
FPGA è l'acronimo di Field Programmable Gate Array.
Cerchiamo di approfondire il significato di ciò.
Potrebbe venire tradutto in Sistema basato su matrice con porte programmabili.
E quindi possiamo ulteriormente tradurre questo concetto dicendo che ciò che compone hardware FPGA sono unità logiche e circuiti integrati programmabili, quindi "vuoti", ma pronti a "trasformarsi" in ciò che desideriamo.
Questo significa che se "istruiamo" FPGA a diventare un C64, lui, dal punto di vista hardware, senza software o emulatori, farà girare in maniera hardware nativa giochi e programmi in maniera perfetta.
Sono già usciti diversi prodotti basati su FPGA, tempo fa vidi un pc engine che poteva persino leggere le hucard. Infatti il vantaggio di FPGA è che, basandosi sulla riproduzione dell'hardware originale, non ha alcun limite nel leggere periferiche ed interfacce originali del sistema "replicato".
Hardware FPGA: MiSTer
Esistono diverse piattaforme hardware basate su FPGA, ma MiSTer è quella attualmente più utilixzata in ambito videoludico. Evoluzione del MiST, progetto che serviva per far girare l'Atari ST, negli ultimi anni si è evoluto diventando il punto di riferimento per giocare.
Va detta subito una cosa: per usufruire di un'scita video/audio analogica va acquistata a parte una board. Altrimenti di serie si va di hdmi.
La board principale si basa su una Altera/Terasic DE 10 Nano.
La DE 10 Nano è basata su chip arm e la si può trovare qui
https://www.terasic.com.tw/cgi-bin/page ... 67&No=1046 a circa 170 dollari.
Perché espandere la ram?
Dalle info trovate in rete tutti dicono che è consigliabile aggiungere sdram per poter giocare con i tutti i core.
Nello specifico ho trovato qualcosa che riguarda il Neo Geo e che riporto testualmente:
"Neo Geo uses very large ROMs. About 84% of the library will fit onto a 32 megabyte SDRAM module. Another 12% will fit onto a 64 megabyte SDRAM module. The remaining 8 games require a 128 megabyte module"
Core
I core vengono programmati a basso livello con specifici linguaggi (Verilog, etc.) e contengono le "istruzioni" per far funzionare il MiSTer e trasformarlo in ciò che desideriamo.
Quindi, nel caso di una console avremo il core del NES e poi i vari giochi, diciamo le rom da caricare, mentre lato arcade avremo il core del gioco che riproduce pcb e relativa rom, oppure il sistema hardware su cui si basano molti arcade, quindi ad esempio Irem M92, Sega System 1 etc.
I core appena rilasciati, di solito subiscono un processo di perfezionamento nel tempo, prima di raggiungere quel livello di perfezione definito con lo status di SuperStar.
Qui una lista di core arcade attualmente supportati, tra giochi singoli e sistemi che raggruppano più giochi (es. Rampage lo trovate sotto Bally Midway MCR- monoboard)
Codice: Seleziona tutto
Arkanoid
Asteroids
Asteroids Deluxe
Atari Tetris
Bagman / Le Bagnard Inc:
Botanic
Pickin' Super Bagman
Squash
Bally Midway Astrocade / Bally Midway Arcade Inc:
The Adventures of Robby Roto!
Extra Bases
Gorf
Sea Wolf II
Space Zap
Wizard of Wor
Bally Midway MCR-1 Inc:
Kick-Man
Kick
Solar Fox
Bally Midway MCR-2 Inc:
Domino Man
Kozmik Krooz'r
Satan's Hollow
Tron
Two Tigers
Wacko
Bally Midway MCR-3 Inc:
Discs of Tron
Journey
Tapper
Timber
Bally Midway MCR-Monoboard Inc:
Demolition Derby
Max RPM
Power Drive
Rampage
Sarge
Star Guards
Bally Midway MCR-Scroll Inc:
Crater Rider, Spy Hunter, Turbo Tag
Berzerk
Black Widow Inc: Gravitar, Lunar Battle
Bomb Jack
Breakout
Burger Time
Burnin' Rubber / Car Action
Canyon Bomber
Cave: Inc:
DoDonPachi
Centipede
Computer Space
Crazy Balloon
Crazy Climber
Crazy Kong Inc:
Crazy Kong Part II
Defender Inc:
Colony 7
Jin
Mayday
Dig Dug
Dominos
Donkey Kong Inc:
Radar Scope, Pest Place, Donkey Kong 3 (bootleg)
Donkey Kong 3
Donkey Kong Junior / Donkey Kong Jr.
Dottori-Kun Inc: Dottori-Man Jr
Food Fight
Frenzy
Galaga
Galaxian Inc:
Azurian Attack, Black Hole, Catacomb, Clean Sweep, Devil Fish, King And Balloon, Lucky Today, Moon Cresta, Mr. Do's Nightmare, Omega, Orbitron, Pisces, UniWar S, Victory, War of the Bugs
Gaplus / Galaga 3
Gauntlet Inc:
Gauntlet
Gauntlet II
Vindicators II
Gyruss
Irem M62 Inc:
The Battle-Road, Horizon, Kid Niki: Radical Ninja / Kaiketsu Yanchamaru, Kung-Fu Master / Spartan X, Lode Runner, Lode Runner II: The Bungling Strikes Back, Lode Runner III: Golden Labyrinth / Majin No Fukkatsu, Lode Runner IV: Teikoku Karano Dasshutsu, Lot Lot, Spelunker, Spelunker II, Youjyuden
Iron Horse
Jackal
Lady Bug Inc : Lady Bug, Snap Jack, Dorodon, Cosmic Avenger
Lunar Lander
Mario Bros
Moon Patrol
Mr. Do!
Ninja-Kun: Majō no Bōken
Pac-Man / Puck Man Inc: Alibaba and 40 Thieves, Birdiy, Crush Roller, Dream Shopper, Eeekk!, Eggor, Eyes, Gorkans, Jump Shot, Lizard Wizard, Mr. TNT, Ms. Pac-Man, Pac-Man Club, Pac-Man Plus, Pac Manic Miner Man, Ponpoko, Super Glob, Van-Van Car, Woodpecker
Pengo
Phoenix
Pleiads
PolyPlay
Pong
Pooyan
Popeye Inc: Sky Skipper
QBert
River Patrol
Rally-X Inc: New Rally-X
Robotron 2084 Inc: Alien Arena, Bubbles, Joust, Playball, Sinistar, Splat, Stargate
Rush'n Attack / Green Beret Inc: Mr. Goemon
Scramble Inc: Amidar, Anteater, Armored Car, Battle of Atlantis, Calipso, Dark Planet, The End, Frogger, Lost Tomb, Mars, Mighty Monkey, Minefield, Moon War, Rescue, Speed Coin, Strategy X, Super Cobra, Tazz-Mania, Turtles
Sega System 1 Inc: 4-D Warriors, Block Gal, Bullfight, Flicky, I'm Sorry, Mister Viking, My Hero, Pitfall II, Rafflesia, Regulus, Sega Ninja, Spatter, Star Jacker, Swat, TeddyBoy Blues, Up'n Down, Water Match, Wonder Boy
Silver Land
Solomon's Key / Solomon no Kagi
Space Invaders Inc: 280Z ZZAp, Amazing Maze, Attack Force, Balloon Bomber, Blue Shark, Boot Hill, Clowns, Cosmo, Galaxy Wars, Gun Fight, Laguna Racer, Lunar Rescue, Lupin III, Sea Wolf, Space Encounters, Space Invaders II, Space Invaders Part II, Vortex
Space Race
Sprint 1
Sprint 2
Super Breakout
Tecmo: Inc: Arugosu no Senshi: Legendary Warrior / Rygar: Legendary Warrior, Gemini Wing, Silkworm
TIA-MC1: Inc: Billiard, Gorodki, Konek Gorbunok, Kot-Rybolov, Snezhnaja Koroleva, SOS
Time Pilot
Time Pilot '84
The Tower of Druaga Inc: Dig Dug II, Mappy, Motos, Super Pacman, Pac & Pal, Pac-Man & Chomp Chomp, Grobda
Traverse USA / MotoRace USA / Zippy Race / Mototour: Inc: Shot Rider
Ultra Tank
Universal Cosmic games Inc. Space Panic, Cosmic Alien, Magical Spot
VBall
Xevious
Zaxxon Inc: Super Zaxxon, Future Spy
Zig Zag
Le board di espansione, che potete trovare, ad esempio, qui https://misterfpga.co.uk/ sono fondamentali per poter equipaggiare al meglio il proprio hardware MiSTer.
Ci sono porte aggiuntive per controller vari, board per l'input su jack audio in stile C64, board per I/O su Vga etc.
Tra i moduli di espansione, la sdram sembra essere una dei requisiti necessari altrimenti, da quanto ho capito, si avrebbe difficoltà con determinati core che richiedono un tot di ram.
Controller
Oltre ai classici controller che si basano su usb possiamo utizzare delle snac board che permettono di collegare i controller originali di console come Nes, Snes, Atari, Pc Engine, Sega Master System etc.
Il tutto a zero lag.
FPGA e pixel perfect
Qui voglio subito interessarmi all'argomento, fondamentale per i puristi del pixel perfect "vero".
MiSTer supporta l'integer scaling, ma anche, pare, la gestione delle modeline.
Quindi inizio raccogliendo informazioni sparpagliate nella rete, per ricomporre una sorta di "puzzle" su questo argomento e non fare impazzire nessuno.
L'integer scaling permette risoluzioni "scalate" in pixel di tipo proporzionale, senza aggiunta di pixel che rendono l'immagine mirbida, sfumata o che danno quel terribile effetto antialiasing ai pixel.
Quindi è come se 1 pixel lo andassi a creare più grande (2x2 pixel, 3x3, 4x4 etc) in una griglia di una certa risoluzione.
Il vantaggio di questa tecnica è che posso utilizzare una risoluzione video per mostrarne una più piccola ma scalata a video, mantenendo i pixelloni dello schermo contrastati e nitidi.
Lo svantaggio di questa tecnica è che le aree che non possono essere coperte da una risoluzione perfettamente scalata proporzionalmente fullscreen saranno nere. (mi ricorda le super resolution, i famosi tot pixel neri).
Ma questa cosa può essere facilmente risolta trimmando sul crt sull'ampiezza verticale oppure orizzontale, oppure da service menu, oppure scalando a livello software, se magari si utilizza un lcd.
Per utilizzare, invece, la modeline "pura" bisogna utilizzare l' Analog I/O.
MiSTer gestisce l'output video contemporaneamente su HDMI e porta analogica.
Vediamo qualche setting per abilitare l'uscita video corretta per un segnale con modeline a 15khz.
mister.ini:
direct_video=0 - Abilita hdmi direct video output dal core
vga_scaler=0 - Disabilita lo scaler sulla porta vga
Nei setting del core disabilitare Scandoubler FX
MiSTer.ini
Come al solito è presente qualcosa a noi tutti conosciuto, un file.ini dove andare a configurare diverse opzioni, la maggior parte riguardanti l'output video.
Qui un sito https://ini.misterkun.io/ che permette di generare il mister.ini in maniera più user friendly.
Qui invece il mister.ini con la descrizione delle opzioni.
Codice: Seleziona tutto
key_menu_as_rgui=0 ; set to 1 to make the MENU key map to RGUI in Minimig (e.g. for Right Amiga)
forced_scandoubler=0 ; set to 1 to run scandoubler on VGA output always (depends on core).
ypbpr=0 ; set to 1 for YPbPr on VGA output.
composite_sync=0 ; set to 1 for composite sync on HSync signal of VGA output.
vga_scaler=0 ; set to 1 to connect VGA to scaler output.
hdmi_audio_96k=0 ; set to 1 for 96khz/16bit HDMI audio (48khz/16bit otherwise)
keyrah_mode=0x18d80002 ; VIDPID of keyrah for special code translation (0x23418037 for Arduino Micro)
vscale_mode=0 ; 0 - scale to fit the screen height.
; 1 - use integer scale only.
; 2 - use 0.5 steps of scale.
; 3 - use 0.25 steps of scale.
vscale_border=0 ; set vertical border for TVs cutting the upper/bottom parts of screen (1-399)
;bootscreen=0 ; uncomment to disable boot screen of some cores like Minimig.
;mouse_throttle=10 ; 1-100 mouse speed divider. Useful for very sensitive mice
rbf_hide_datecode=0 ; 1 - hides datecodes from rbf file names. Press F2 for quick temporary toggle
menu_pal=0 ; 1 - PAL mode for menu core
hdmi_limited=0 ; 1 - use limited (16..235) color range over HDMI
; 2 - use limited (16..255) color range over HDMI, for VGA converters.
direct_video=0 ; 1 - enable core video timing over HDMI, use only with VGA converters.
fb_size=0 ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.
fb_terminal=1 ; 1 - enabled (default), 0 - disabled
osd_timeout=30 ; 5-3600 timeout (in seconds) for OSD to disappear in Menu core. 30 seconds if not set.
; Background picture will get darker after double timeout
osd_rotate=0 ; Display OSD menu rotated, 0 - no rotation, 1 - rotate right (+90°), 2 - rotate left (-90°)
; 1 - enables the recent file loaded/mounted.
; WARNING: This option will enable write to SD card on every load/mount which may wear the SD card after many writes to the same place
; There is also higher chance to corrupt the File System if MiSTer will be reset or powered off while writing.
recents=0
; lastcore - Autoboot the last loaded core (corename autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; lastexactcore - Autoboot the last loaded exact core (corename_yyyymmdd.rbf autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; corename - Autoboot first corename_*.rbf found on the SD/USB
; corename_yyyymmdd.rbf - Autoboot first corename_yyyymmdd.rbf found on the SD/USB
;bootcore=lastcore ; uncomment to autoboot a core, as the last loaded core.
; 10-30 timeout before autoboot, comment for autoboot without timeout.
bootcore_timeout=10
; Option to load the custom font. Format is plain bitmap 8x8.
; Supported sizes of font:
; 768 bytes - chars 32-127 (only alpha + numeric)
; 1024 bytes - chars 0-127
; 1136 bytes - chars 0-141
; up to 2048 - only chars 0-141 will be used.
; if first 32 chars are empty (for sizes 1024 bytes and more) then they are skipped.
font=font/myfont.pf
; USER button emulation by keybaord. Usually it's reset button.
; 0 - lctrl+lalt+ralt (lctrl+lgui+rgui on keyrah)
; 1 - lctrl+lgui+rgui
; 2 - lctrl+lalt+del
; 3 - same as 0 (lctrl+lalt+ralt on keyrah)
reset_combo=0
; set to 1 for DVI mode. Audio won't be transmitted through HDMI in DVI mode.
dvi_mode=0
; 0 - 1280x720@60
; 1 - 1024x768@60
; 2 - 720x480@60
; 3 - 720x576@50
; 4 - 1280x1024@60
; 5 - 800x600@60
; 6 - 640x480@60
; 7 - 1280x720@50
; 8 - 1920x1080@60
; 9 - 1920x1080@50
;10 - 1366x768@60
;11 - 1024x600@60
;12 - 1920x1440@60
;13 - 2048x1536@60
;
; custom mode: hact,hfp,hs,hbp,vact,vfp,vs,vbp,Fpix_in_KHz
; video_mode=1280,110,40,220,720,5,5,20,74250
video_mode=0
; set to 1-10 (seconds) to display video info on startup/change
video_info=0
; Set to 1 for automatic HDMI VSync rate adjust to match original VSync.
; Set to 2 for low latency mode (single buffer).
; This option makes video butter smooth like on original emulated system.
; Adjusting is done by changing pixel clock. Not every display supports variable pixel clock.
; For proper adjusting and to reduce possible out of range pixel clock, use 60Hz HDMI video
; modes as a base even for 50Hz systems.
vsync_adjust=0
; If you monitor doesn't support either very low (NTSC monitors may not support PAL) or
; very high (PAL monitors may not support NTSC) then you can set refresh_min and/or refresh_max
; parameters, so vsync_adjust won't be applied for refreshes outside specified.
; These parameters are valid only when vsync_adjust is non-zero.
refresh_min=0
refresh_max=0
; These parameters have the same format as video_mode.
; You need to supply both PAL and NTSC modes if you want vsync_adjust to switch between
; predefined modes as a base. This will reduce the range of pixel clock.
;video_mode_ntsc=0
;video_mode_pal=7
; 1-10 (seconds) to display controller's button map upon first time key press
; 0 - disable
controller_info=6
; JammaSD/J-PAC/I-PAC keys to joysticks translation
; You have to provide correct VID and PID of your input device
; Examples: Legacy J-PAC with Mini-USB or USB capable I-PAC with PS/2 connectors VID=0xD209/PID=0x0301
; USB Capable J-PAC with only PS/2 connectors VID=0x04B4/PID=0x0101
; JammaSD: VID=0x04D8/PID=0xF3AD
jamma_vid=0x04D8
jamma_pid=0xF3AD
; Disable merging input devices. Use if only player 1 works.
; Leave no_merge_pid empty to apply this to all devices with the same VID.
;no_merge_vid=0x045E
;no_merge_pid=0x028E
; Same as above but can add multiple devices (one entry per VIDPID). Format is VIDPID in hex number
;no_merge_vidpid=0x12345678
;no_merge_vidpid=0x11112222
; Speeds in sniper/non-sniper modes of mouse emulation by joystick
; 0 - (default) - faster move in non-sniper mode, slower move in sniper mode.
; 1 - movement speeds are swapped.
sniper_mode=0
; Uncomment following option if you don't want to see a second line for long file names in listing.
;browse_expand=0
; 0 - disable MiSTer logo in Menu core
logo=1
; Custom shared folder for core supporting this feature (currently minimig and ao486 only)
; Can be relative to core's home dir or absolute path.
; Path must exist before core start to use it, or it will fail.
; Make sure USB device is mounted before use shared folder on USB!
shared_folder=
; Custom aspect ratio
;custom_aspect_ratio_1=16:10
;custom_aspect_ratio_2=1:1
; use specific (VID/PID) mouse X movement as a spinner and paddle. Use VID=0xFFFF/PID=0xFFFF to use all mice as spinners.
;spinner_vid=0x1BCF
;spinner_pid=0x0005
; spinner_throttle with base value 100 gives one spinner step per one tick. Higher value makes spinner slower.
; Lower than 100 makes spinner faster. Negative value gives opposite direction.
;spinner_throttle=-50
; 0 - X axis, 1 - Y axis.
;spinner_axis=1
; Default filters for video scaler and audio. Paths must be relative to scaler/audio filter folder without leading slash.
;vfilter_default=LCD Effects/LCD_Effect_07.txt
;afilter_default=LPF2000_3tap.txt
; Defines internal joypad mapping from virtual SNES mapping in main to core mapping
; Set to 0 for name mapping (jn) (e.g. A button in SNES core = A button on controller regardless of position on pad)
; Set to 1 for positional mapping (jp) (e.g. A button in SNES core = East button on controller regardless of button name)
gamepad_defaults=0
; Write out file name under the cursor in browser for external integration
; External application or script may parse the info and do some additional actions and/or send info to 3rd party server.
; Warning: it may slowdown the system or add lag while browsing the files in OSD depending on external app/script.
log_file_entry=0