From e895649c992f3758f5b29157fa24e70dd8f53b17 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2021 10:48:21 +0200 Subject: [PATCH] launcher, history changes --- launcher/script.lua | 137 +++++++++++++++++++++++--------------- makes/Cave.mak | 66 ++++++++++++++++++ src/psp/pspmain.c | 4 +- utilities/historymaker.py | 40 +++++++++++ 4 files changed, 191 insertions(+), 56 deletions(-) create mode 100644 makes/Cave.mak create mode 100644 utilities/historymaker.py diff --git a/launcher/script.lua b/launcher/script.lua index 1cb269b..b43b865 100644 --- a/launcher/script.lua +++ b/launcher/script.lua @@ -3,40 +3,38 @@ ---Cargando imagenes--- seleccion = Image.load("./img/selector.png") - -menuPage01 = Image.load("./img/menu01.png") -menuPage02 = Image.load("./img/menu02.png") +menu = Image.load("./img/menu.png") current = 1; makerListPage01 = { - "CAPCOM", --1 - "CPS1", --2 - "DECO", --3 - "DYNAX", --4 - "IREM", --5 - "KONAMI", --6 - "KONAMI2", --7 - "NAMCO", --8 - "NAMCO2", --9 - "NICHIBUTSU", --10 - "NINTENDO", --11 - "SEGA", --12 + "CAPCOM", + "CAVE", + "CPS1", + "DECO", + "DYNAX", + "IREM", + "KONAMI", + "KONAMI2", + "NAMCO", + "NAMCO2", + "NICHIBUTSU", + "NINTENDO", } makerListPage02 = { - "SEGA2", --1 - "SEGA3", --2 - "SNK", --3 - "TAITO", --4 - "TAITO2", --5 - "TECHNOS", --6 - "UNIVERSAL", --7 - "UPL", --8 - "PLACEHOLDER", --9 - "PLACEHOLDER", --10 - "PLACEHOLDER", --11 - "PLACEHOLDER", --12 + "SEGA", + "SEGA2", + "SEGA3", + "SNK", + "TAITO", + "TAITO2", + "TECHNOS", + "UNIVERSAL", + "UPL", + "PLACEHOLDER", + "PLACEHOLDER", + "PLACEHOLDER", } fontColor = Color.new(255,255,0,0) @@ -60,76 +58,107 @@ for i=1,12,3 do end -- assign content from page 1 -local menu = menuPage01 local makerList = makerListPage01 - --Bucle principal-- -while true do +-- get vendor logo paths for page 1 or page 2 +function fetchVendorIcons() + vendor = {} + for i=1,12,1 do + -- must fit inside the selector (90x57) + vendor[i] = Image.load("./img/" .. makerList[i] .. ".png") + end +end + +-- reload all screen elements if any button pressed +function screenRefresh() screen:clear() - pad = Controls.read() screen:blit(3,0, menu) + screen:print(20, 260, "<- L trigger", fontColor) screen:print(370, 260, "R trigger ->", fontColor) screen:print(90, 230, - "Press X to launch the " .. makerList[current] .. " build", fontColor) + "Press O to launch the " .. makerList[current] .. " build", fontColor) + + -- draw each of the 12 vendor logos + -- offset is selector icon offset + 7 + for i=1,12,1 do + screen:blit((selectorPosX[i] + 7), (selectorPosY[i] + 7), vendor[i]) + end + + -- selector icon + screen:blit(selectorPosX[current], selectorPosY[current], seleccion) + + screen.flip() + screen.waitVblankStart() +end + +-- make sure selector doesn't go out of range +function getCurrent(current, change) + if (current + change) < 1 then + current = 12 + elseif (current + change) > 12 then + current = 1 + else + current = current + change + end + return current +end + +fetchVendorIcons() +screenRefresh() + + --Bucle principal-- +while true do + pad = Controls.read() ---Moviendo el pad arriba y abajo--- if pad:down() then - current = current + 1 + current = getCurrent(current, 1) + screenRefresh() System.sleep(200)-- pone una pausa de 200 milisegundos para que al pulsar no baje muy rapido la seleccion-- end if pad:up() then - current = current - 1 + current = getCurrent(current, -1) + screenRefresh() System.sleep(200) end ---Moviendo el pad arriba y abajo--- if pad:right() then - current = current + 3 + current = getCurrent(current, 3) + screenRefresh() System.sleep(200) end if pad:left() then - current = current - 3 + current = getCurrent(current, -3) + screenRefresh() System.sleep(200) end - ---Aqui depende de la cantidades de opciones yo tengo 12--- - if current < 1 then---aqui dice XD current es menor a 1--- - current = 12 - end - - if current > 12 then -- aqui dice current es mayor a 12--- - current = 1 - end - -- get page 2 / back to page 1 if pad:r() then - menu = menuPage02 makerList = makerListPage02 current = 1 + fetchVendorIcons() + screenRefresh() System.sleep(200) end if pad:l() then - menu = menuPage01 makerList = makerListPage01 current = 1 + fetchVendorIcons() + screenRefresh() System.sleep(200) end - - ---Opciones del menu y para que ponga tu imagen de seleccion en una de las opciones a elejir--- - screen:blit(selectorPosX[current], selectorPosY[current], seleccion) ---Ejecutando las aplicaciones--- - if pad:cross() then + if pad:circle() then -- concatenate eboot path local ebootPath = "ms0:/PSP/GAME/pspMAME/" .. makerList[current] .. ".PBP" print("running ", ebootPath) System.runeboot(ebootPath) end - - screen.flip() - screen.waitVblankStart() end diff --git a/makes/Cave.mak b/makes/Cave.mak new file mode 100644 index 0000000..dd8babb --- /dev/null +++ b/makes/Cave.mak @@ -0,0 +1,66 @@ +# a tiny compile is without Neogeo games +COREDEFS += -DTINY_COMPILE=1 +COREDEFS += -DTINY_NAME="driver_pwrinst2, driver_mazinger, driver_donpachi, driver_donpachj, driver_donpachk, driver_metmqstr, driver_nmaster, driver_sailormn, driver_sailormo, driver_agallet, driver_hotdogst, driver_ddonpach, driver_ddonpchj, driver_dfeveron, driver_feversos, driver_esprade, driver_espradej, driver_espradeo, driver_uopoko, driver_guwange, driver_gaia" + +COREDEFS += -DTINY_POINTER="&driver_pwrinst2, &driver_mazinger, &driver_donpachi, &driver_donpachj, &driver_donpachk, &driver_metmqstr, &driver_nmaster, &driver_sailormn, &driver_sailormo, &driver_agallet, &driver_hotdogst, &driver_ddonpach, &driver_ddonpchj, &driver_dfeveron, &driver_feversos, &driver_esprade, &driver_espradej, &driver_espradeo, &driver_uopoko, &driver_guwange, &driver_gaia" + +# cpuintrf.c cpuintrf.h cheat.c audit.c memory.c info.c sndintrf.c sndintrf.h usrintrf.c psp/fronthlp.c + +# uses these CPUs +CPUS+=Z80@ +CPUS+=M68000@ + +# uses these SOUNDs +SOUNDS+=YM2203@ +SOUNDS+=YM2151@ +SOUNDS+=OKIM6295@ +SOUNDS+=YMZ280B@ + + + +DRVLIBS = \ + obj/drivers/pacman.a obj/drivers/epos.a obj/drivers/nichibut.a \ + obj/drivers/phoenix.a obj/drivers/namco.a obj/drivers/univers.a obj/drivers/nintendo.a \ + obj/drivers/midw8080.a obj/drivers/meadows.a obj/drivers/cvs.a obj/drivers/midway.a \ + obj/drivers/irem.a obj/drivers/gottlieb.a obj/drivers/taito.a obj/drivers/toaplan.a obj/drivers/cave.a \ + obj/drivers/kyugo.a obj/drivers/williams.a obj/drivers/gremlin.a obj/drivers/vicdual.a \ + obj/drivers/capcom.a obj/drivers/itech.a obj/drivers/leland.a obj/drivers/sega.a \ + obj/drivers/dataeast.a obj/drivers/tehkan.a obj/drivers/konami.a \ + obj/drivers/exidy.a obj/drivers/atari.a obj/drivers/snk.a obj/drivers/alpha.a obj/drivers/technos.a \ + obj/drivers/stern.a obj/drivers/gameplan.a obj/drivers/zaccaria.a \ + obj/drivers/upl.a obj/drivers/nmk.a obj/drivers/cinemar.a obj/drivers/cinemav.a \ + obj/drivers/thepit.a obj/drivers/valadon.a obj/drivers/seibu.a obj/drivers/tad.a obj/drivers/jaleco.a \ + obj/drivers/vsystem.a obj/drivers/psikyo.a obj/drivers/orca.a obj/drivers/gaelco.a \ + obj/drivers/kaneko.a obj/drivers/seta.a obj/drivers/atlus.a \ + obj/drivers/sun.a obj/drivers/suna.a obj/drivers/dooyong.a obj/drivers/tong.a \ + obj/drivers/comad.a obj/drivers/playmark.a obj/drivers/pacific.a obj/drivers/tecfri.a \ + obj/drivers/metro.a obj/drivers/venture.a obj/drivers/yunsung.a obj/drivers/zilec.a \ + obj/drivers/fuuki.a obj/drivers/unico.a obj/drivers/dynax.a \ + obj/drivers/sigma.a obj/drivers/igs.a obj/drivers/ramtek.a obj/drivers/omori.a obj/drivers/tch.a \ + obj/drivers/usgames.a obj/drivers/sanritsu.a obj/drivers/rare.a \ + obj/drivers/alba.a obj/drivers/homedata.a obj/drivers/artmagic.a \ + obj/drivers/taiyo.a obj/drivers/edevices.a obj/drivers/other.a obj/drivers/excelent.a obj/drivers/nix.a \ + obj/drivers/arcadia.a obj/drivers/othertrv.a obj/drivers/other68k.a obj/drivers/otherz80.a \ + obj/drivers/neogeo.a $(OBJ)/shared.a \ + +$(OBJ)/shared.a: \ + $(OBJ)/machine/segacrpt.o \ + $(OBJ)/machine/tmp68301.o \ + $(OBJ)/machine/6532riot.o \ + $(OBJ)/machine/z80fmly.o \ + $(OBJ)/machine/6821pia.o \ + $(OBJ)/machine/8255ppi.o \ + $(OBJ)/machine/6522via.o \ + $(OBJ)/machine/7474.o \ + $(OBJ)/machine/idectrl.o \ + $(OBJ)/machine/ticket.o \ + $(OBJ)/machine/random.o \ + $(OBJ)/machine/adc083x.o \ + $(OBJ)/vidhrdw/crtc6845.o \ + $(OBJ)/vidhrdw/avgdvg.o \ + $(OBJ)/vidhrdw/poly.o \ + $(OBJ)/vidhrdw/tlc34076.o \ + $(OBJ)/vidhrdw/res_net.o \ + +# MAME specific core objs +COREOBJS += $(OBJ)/tiny.o $(OBJ)/cheat.o diff --git a/src/psp/pspmain.c b/src/psp/pspmain.c index 8d84694..01cf67a 100644 --- a/src/psp/pspmain.c +++ b/src/psp/pspmain.c @@ -186,8 +186,8 @@ int main(int argc, char *argv[]) // create nonexisting dirs // bad file descriptor workaround - char needed_dirs[4][256] = { "roms", "cfg", "nvram", "sta", "hist" }; - for (int i = 0; i < 4; i++) { + char needed_dirs[5][256] = { "roms", "cfg", "nvram", "sta", "hist" }; + for (int i = 0; i < 5; i++) { if(sceIoDopen(needed_dirs[i]) < 0) { sceIoMkdir(needed_dirs[i], 0777); } diff --git a/utilities/historymaker.py b/utilities/historymaker.py new file mode 100644 index 0000000..a636e16 --- /dev/null +++ b/utilities/historymaker.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +import re +import csv +import os +import time + +# # # use me with the history.dat from https://www.arcade-history.com/ (old format) + +build_name = "capcom" + +hitlist = "driver_pc_1942,driver_1942,driver_1942a,driver_1942b,driver_1943kai,driver_1943j,driver_1943,driver_hatena,driver_lwingsjp,driver_avengers,driver_avenger2,driver_bionicc,driver_bionicc2,driver_blkdrgon,driver_blktiger,driver_blockj,driver_blocka,driver_block,driver_bbros,driver_cbasebal,driver_cworld,driver_pc_rrngr,driver_commandu,driver_commando,driver_dokaben,driver_exedexes,driver_f1dream,driver_gngt,driver_gng,driver_gnga,driver_mt_gng,driver_gunsmokj,driver_gunsmoku,driver_gunsmoka,driver_gunsmoke,driver_buraiken,driver_lastduel,driver_lstduela,driver_ledstorm,driver_lwings,driver_lwings2,driver_madgearj,driver_madgear,driver_makaimuc,driver_makaimug,driver_makaimur,driver_pc_mman3,driver_higemaru,driver_qsangoku,driver_qtono1,driver_rushcrsh,driver_savgbees,driver_sectionz,driver_sctionza,driver_commandj,driver_sidearjp,driver_sidearmr,driver_sidearms,driver_slipstrm,driver_sonson,driver_sonsonj,driver_sinvasn,driver_sfjp,driver_sfp,driver_sfus,driver_sf,driver_sftm110,driver_sftm111,driver_sftm,driver_sftmj,driver_trojanj,driver_srumbler,driver_srumblr2,driver_tigeroad,driver_topsecrt,driver_toramich,driver_pc_trjan,driver_trojanr,driver_trojan,driver_vulgusj,driver_vulgus,driver_vulgus2,driver_pc_ynoid" + +abspath = os.path.abspath(__file__) +os.chdir(os.path.dirname(abspath)) + +output = "" +copied_drivers = [] + +hitlist_purified = hitlist.replace("driver_", "").replace(" ", "").split(",") + +history = open("history.dat", "r", encoding='ansi') + +regex = r'\$info=([^\n]+)([^]+?)\$end' +allmatches = re.findall(regex, history.read() ) + +for match in allmatches: + drivers = (match[0]) + entry = (match[1]) + for hit in hitlist_purified: + if hit in drivers: + if drivers in copied_drivers: + continue + output = output + r'$info=' + drivers + entry + r'$end' + "\n\n" + copied_drivers.append(drivers) + +print(output) + +outputdat = open(build_name + "-history.dat", "w", encoding="ansi") +outputdat.write(output) +outputdat.close