1 ;;; Simple program to parse catver.ini
2 ;;; (http://www.progettosnaps.net/catver/) and filter the results.
3 ;;; 2019 Clinton Ebadi <clinton@unknownlamer.org>
4 ;;; CC0 To the extent possible under law, Clinton Ebadi has waived all
5 ;;; copyright and related or neighboring rights to MAME Category
8 (quicklisp:quickload
'(:parser.ini
:cl-ppcre
:alexandria
:arnesi
))
10 (import '(alexandria:read-file-into-string
))
12 ;; fixme: parser.ini doesn't handle DOS line endings so file has to be
13 ;; converted to unix line endings. manually open the stream instead
14 ;; after I remember how external formats work again.
16 ;; fixme: since I'm using an ad-hoc parser and put zero effort into this, you have to edit catver.ini and extract just the [Category] section
17 (defparameter *catver-source
* (pathname "/home/clinton/src/repos/local/scratch/mame-catver-filter/pS_CatVer_230/catver-only.ini"))
19 ;; parser.ini barfed on catver (ate all ram and then died...)
20 ;; (defparameter *parsed-catver*
21 ;; (let ((parser.ini:*value-terminating-whitespace-expression* #\Newline))
22 ;; (parser.ini:parse *catver-source* 'list)))
24 (defparameter *catver-hash
* (make-hash-table :test
'equal
))
26 (with-open-file (catver-stream *catver-source
* )
27 (arnesi:awhile
(read-line catver-stream nil nil
)
28 (cl-ppcre:register-groups-bind
(game category
)
29 ("([^=]+)=([^=]+)" arnesi
:it
)
30 (format t
"KEY ~A VALUE ~A~%" game category
)
31 (setf (gethash category
*catver-hash
*) (cons game
(gethash category
*catver-hash
*))))))
35 (maphash (lambda (key value
)
36 (format t
"~S~%" key
))
40 (defun filter-games (categories)
41 (mapcan (lambda (cat) (gethash cat
*catver-hash
*)) categories
))
43 (defun dump-games (filename categories
)
44 (with-open-file (outf filename
:direction
:output
:if-exists
:error
)
45 (mapc (lambda (x) (format outf
"~A~%" x
)) (filter-games categories
))))
48 ;; 2020-11-19: might want to review these for new categories, haven't checked since mame 0.214
49 (defparameter *filtered-cats
*
50 '("Maze / Shooter Small"
53 "Driving / Truck Guide"
54 "Shooter / Flying Vertical"
57 "Driving / 1st Person"
62 "Shooter / Flying Horizontal"
68 "Sports / Skateboarding"
69 "Shooter / Misc. Horizontal"
70 "Sports / Track & Field"
72 "Computer / Training Board"
74 "Shooter / Flying (chase view)"
77 "Driving / Race 1st Person"
79 "Platform / Shooter Scrolling"
80 "Maze / Change Surface"
81 "Driving / Race (chase view)"
82 "Shooter / Misc. Vertical"
84 "Shooter / Flying 1st Person"
87 "Platform / Fighter Scrolling"
89 "Platform / Run, Jump & Scrolling"
90 "Shooter / 1st Person"
91 "Maze / Shooter Large"
92 "Shooter / 3rd Person"
100 "Driving / Race Track"
101 "Climbing / Tree - Plant"
104 "Shooter / Driving (chase view)"
111 "Driving / Race (chase view) Bike"
112 "Ball & Paddle / Breakout"
113 "Sports / Horse Racing"
114 "Sports / Armwrestling"
119 "Shooter / Driving Vertical"
128 "Shooter / Driving Diagonal"
129 "Ball & Paddle / Pong"
130 "Maze / Collect & Put"
131 "Rhythm / Instruments"
136 "Shooter / Driving Horizontal"
138 "Sports / Bull Fighting"
139 "Shooter / Driving 1st Person"
141 "Puzzle / Reconstruction"
143 "Maze / Defeat Enemies"
144 "Ball & Paddle / Jump and Touch"
145 "Climbing / Building"
147 "Driving / Race Bike"
150 "Fighter / Compilation"
152 "Driving / Demolition Derby"
154 "Sports / Rugby Football"
155 "Fighter / Driving Vertical"
156 "Fighter / Versus Co-op"
160 "Maze / Move and Sort"
161 "Sports / Hang Gliding"
163 "Shooter / Flying Diagonal"
165 "Sports / Horseshoes"
169 "Driving / Motorbike (Motocross)"
170 "Driving / Guide and Collect"
171 "Sports / Volley - Soccer"
173 "Tabletop / Othello - Reversi"
175 "Music / Drum Machine"
176 "Maze / Marble Madness"
177 "Shooter / Submarine"
180 "Shooter / Motorbike"
182 "Misc. / Hot-air Balloon"
183 "Driving / Guide and Shoot"
185 "Climbing / Mountain - Wall"
186 "Shooter / Underwater"
187 "Sports / Shuffleboard"
188 "Ball & Paddle / Misc."
195 (defparameter *all-cats
*
196 '("Maze / Shooter Small"
198 "Slot Machine / Video Slot"
201 "Game Console / Home Videogame"
202 "Electromechanical / Misc."
203 "Driving / Truck Guide"
204 "Shooter / Flying Vertical"
205 "MultiGame / Compilation"
206 "Sports / Basketball"
207 "Tabletop / Multi-Games"
209 "Electromechanical / Pinball"
211 "Driving / 1st Person"
213 "Computer / Workstation - Server"
214 "Computer / Business - Terminal"
217 "Puzzle / Match * Mature *"
222 "Shooter / Flying Horizontal"
224 "Tabletop / Mahjong * Mature *"
226 "Driving / Motorbike"
229 "Computer / Single Board"
230 "Utilities / EPROM Programmer"
231 "Sports / Skateboarding"
232 "Handheld / Electronic Game"
234 "Shooter / Misc. Horizontal"
235 "Sports / Track & Field"
238 "Computer / Training Board"
240 "Computer / Home System"
241 "Computer / Portable Digital Teletype"
242 "Quiz / Questions in Japanese"
243 "Shooter / Flying (chase view)"
244 "Platform / Run Jump"
245 "Tabletop / Hanafuda * Mature *"
246 "Computer / Construction Kit"
247 "Slot Machine / Reels"
248 "Board Game / Chess Machine"
250 "Sports / Volleyball"
251 "Driving / Race 1st Person"
255 "Platform / Shooter Scrolling"
256 "Maze / Change Surface"
257 "Driving / Race (chase view)"
258 "Slot Machine / Video Slot * Mature *"
259 "Shooter / Misc. Vertical"
260 "Coin Pusher / Misc."
262 "Calculator / Pocket Computer"
263 "Computer / Development System"
265 "Shooter / Flying 1st Person"
268 "Platform / Fighter Scrolling"
269 "Computer / Microcomputer"
271 "Music / Synthesizer"
272 "Platform / Run, Jump & Scrolling"
273 "Medal Game / Action"
275 "Shooter / 1st Person"
276 "Maze / Shooter Large"
277 "Shooter / 3rd Person"
288 "Telephone / Car Phone"
289 "Driving / Race Track"
290 "Climbing / Tree - Plant"
292 "Whac-A-Mole / Hammer"
293 "Electromechanical / Redemption"
294 "Misc. / Bank-teller Terminal"
296 "Computer / Punched Car"
298 "Shooter / Driving (chase view)"
302 "Misc. / Coin Pusher"
307 "Misc. / Electronic Board Game"
308 "Driving / Race (chase view) Bike"
309 "Ball & Paddle / Breakout"
310 "Sports / Horse Racing"
311 "Sports / Armwrestling"
312 "Misc. / Laser Disk Simulator"
314 "Computer / Word-processing Machine"
317 "Calculator / Astrological Computer"
320 "Shooter / Driving Vertical"
322 "Handheld / Pocket Device - Pad - PDA"
326 "Electromechanical / Reels"
328 "Board Game / Backgammon"
330 "Handheld / Plug n' Play TV Game"
331 "Misc. / Document Processors"
333 "Puzzle / Drop * Mature *"
334 "Board Game / Bridge Machine"
335 "Quiz / Questions in English"
337 "Multiplay / Mini-Games"
342 "Quiz / Questions in English * Mature *"
343 "Sports / Pool * Mature *"
345 "Medal Game / Casino"
346 "MultiGame / Mini-Games"
347 "Handheld / Home Videogame Console"
348 "Platform / Run Jump * Mature *"
349 "Fighter / Versus * Mature *"
350 "Shooter / Driving Diagonal"
351 "Ball & Paddle / Breakout * Mature *"
352 "Ball & Paddle / Pong"
353 "Maze / Collect & Put"
354 "Rhythm / Instruments"
356 "Misc. / Spank * Mature *"
359 "Misc. / Device Programmer"
360 "Misc. / Cash Counter"
362 "Shooter / Driving Horizontal"
363 "Electromechanical / Bingo"
365 "Computer / Laptop - Notebook - Portable"
368 "Puzzle / Toss * Mature *"
369 "Sports / Bull Fighting"
370 "Shooter / Driving 1st Person"
371 "Casino / Cards * Mature *"
373 "Misc. / Electronic Typewriter"
374 "Puzzle / Reconstruction"
377 "Handheld / Child Computer"
378 "Maze / Defeat Enemies"
379 "Ball & Paddle / Jump and Touch"
380 "Computer / Cablenet Controller"
381 "Climbing / Building"
384 "Computer / Child Computer"
385 "Medical Equipment / Visual Field Screener"
387 "Board Game / Checker Machine"
388 "Misc. / Fingerprint Reader"
389 "Driving / Race Bike"
390 "Music / Audio Sequencer"
391 "Misc. / Jump and Bounce"
395 "Casino / Misc. * Mature *"
396 "Fighter / Compilation"
398 "Driving / Demolition Derby"
399 "Whac-A-Mole / Shooter"
401 "Sports / Rugby Football"
402 "Tabletop / Multiplay"
403 "Fighter / Driving Vertical"
404 "Fighter / Versus Co-op"
405 "Board Game / Dame Machine"
406 "Puzzle / Outline * Mature *"
408 "Misc. / Satellite Receiver"
409 "Tabletop / Othello - Reversi * Mature *"
410 "Misc. / Speech Synthesizer"
412 "Electromechanical / Utilities"
413 "Printer / Matrix Printer"
414 "Misc. / EPROM Programmer"
415 "Misc. / Engine Control Unit"
416 "Shooter / Gallery * Mature *"
418 "Medal Game / Timing"
420 "Game Console / Fitness Game"
421 "Maze / Move and Sort"
422 "Computer Graphic Workstation / Broadcast Television"
423 "Quiz / Questions in Korean"
424 "Medal Game / Adventure"
425 "Misc. / Graphics Display Controller"
426 "Driving / Ambulance Guide"
428 "Misc. / Electronic Game"
429 "Misc. / Wavetables Generator"
430 "Misc. / Car Voice Alert"
431 "Music / Instruments"
432 "Shooter / Flying * Mature *"
433 "Sports / Hang Gliding"
434 "Tabletop / Hanafuda"
435 "Puzzle / Reconstruction * Mature *"
436 "Quiz / Questions in Italian"
437 "Driving / FireTruck Guide"
438 "Utilities / Arcade System"
440 "Whac-A-Mole / Fighter"
441 "Quiz / Questions in German"
442 "Maze / Collect * Mature *"
443 "Shooter / Flying Diagonal"
444 "Misc. / Pinball * Mature *"
445 "Tabletop / Match * Mature *"
447 "Medal Game / Horse Racing"
451 "Utilities / Network Processor"
452 "Misc. / Similar Bowling Game"
455 "Utilities / Redemption Board"
456 "Sports / Horseshoes"
457 "Misc. / Digital MultiMeter (DMM)"
458 "Computer / Pocket PC"
459 "Misc. / Drum Machine"
461 "Quiz / Questions in Japanese * Mature *"
462 "Telephone / ComputerPhone"
464 "Telephone / Mobile Phone - Smartphone"
467 "Casino / Horse Racing"
468 "Driving / Motorbike (Motocross)"
469 "Misc. / Gambling Board"
470 "Driving / Guide and Collect"
472 "Misc. / Educational Game"
473 "Sports / Volley - Soccer"
475 "Tabletop / Othello - Reversi"
476 "Fighter / Multiplay"
477 "Misc. / Response Time"
479 "Misc. / DVD Reader-Writer"
481 "Maze / Escape * Mature *"
482 "Printer / Laser Printer"
483 "Misc. / In Circuit Emulator"
484 "Game Console / Home Videogame Console Expansion"
485 "MultiGame / Gambling"
486 "MultiGame / Gambling Board"
487 "Music / Drum Machine"
488 "Maze / Marble Madness"
489 "Quiz / Questions in Spanish"
490 "MultiGame / Compilation * Mature *"
491 "Printer / 3D Printer"
492 "Shooter / Submarine"
493 "Medical Equipment / ECG Unit"
494 "Computer / Video Production"
495 "Misc. / Time-Access Control TerminalTime and access control terminal"
497 "Printer / Thermal Printer"
498 "Multiplay / Compilation"
499 "Music / Tone Generator"
501 "Calculator / Math Game Learning"
502 "Shooter / Motorbike"
503 "Medal Game / Versus"
504 "Utilities / Test ROM"
505 "Printer / Barcode Printer"
507 "Puzzle / Paint * Mature *"
508 "Puzzle / Misc. * Mature *"
509 "Medal Game / Driving"
510 "Misc. / Virtual Environment"
512 "Medal Game / Compilation"
513 "Misc. / VTR Control"
514 "Misc. / Hot-air Balloon"
515 "Misc. / Shoot Photos"
516 "Puzzle / Sliding * Mature *"
517 "Maze / Blocks * Mature *"
518 "Quiz / Questions in Chinese"
519 "Driving / Guide and Shoot"
521 "Climbing / Mountain - Wall"
522 "Shooter / Outline * Mature *"
524 "Quiz / Questions in French"
526 "Misc. / Portable Media Player"
527 "Utilities / Weight Scale"
528 "Electromechanical / Change Money"
529 "Misc. / Graphic Tablet"
530 "Shooter / Flying Horizontal * Mature *"
531 "Misc. / Robot Control"
532 "Shooter / Underwater"
533 "Sports / Shuffleboard"
534 "Misc. / Temperature Controller"
535 "Misc. / Laserdisc Simulator"
536 "Casino / Multi-Games"
537 "Ball & Paddle / Misc."
538 "Utilities / Arcade Switcher"
539 "Shooter / Flying Vertical * Mature *"
540 "Calculator / Talking Calculator"
541 "Computer / Educational Game"
543 "Maze / Digging * Mature *"
544 "Whac-A-Mole / Footsteps"
545 "Handheld / E-Book Reading"
546 "Multiplay / Misc. * Mature *"
550 "Misc. / Dot-Matrix Display"
552 "Music / MIDI Player"
554 "Utilities / Electronic Digital Thermostat"
555 "Utilities / TV Test Pattern Generator"
556 "Misc. / Credit Card Terminal"
557 "Multiplay / Mini-Games * Mature *"
559 "Misc. / Laserdisc Player"
562 "Computer / Programming Machine"
564 "Handheld / Handpuppet Toy"))