From 47c26d5d9daba6072bc580029e711292393d3158 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Mon, 15 Feb 2010 18:55:26 +0000 Subject: [PATCH] Added image filenames to ROM database, file flags. Will split these out soon. --- src/gui/filethread.cpp | 138 ++++++++++++++++++++------------------ src/gui/filethread.h | 3 + src/gui/imagedelegate.cpp | 28 ++++++-- 3 files changed, 100 insertions(+), 69 deletions(-) diff --git a/src/gui/filethread.cpp b/src/gui/filethread.cpp index a6ecd3f..11c11ad 100644 --- a/src/gui/filethread.cpp +++ b/src/gui/filethread.cpp @@ -24,75 +24,85 @@ struct RomIdentifier const uint32 crc32; const char name[128]; const char file[128]; + const uint32 flags; }; #endif +// Should have another flag for whether or not it requires DSP, BIOS, +// whether it's a .rom, it's a BIOS, etc... + RomIdentifier romList[] = { - { 0x0509C85E, "Raiden (World)", "" }, - { 0x08F15576, "Iron Soldier (World) (v1.04)", "" }, - { 0x0957A072, "Kasumi Ninja (World)", "" }, - { 0x0AC83D77, "NBA Jam T.E. (World)", "" }, - { 0x0EC5369D, "Evolution - Dino Dudes (World)", "" }, - { 0x0F6A1C2C, "Ultra Vortek (World)", "" }, - { 0x14915F20, "White Men Can't Jump (World)", "" }, - { 0x1660F070, "Power Drive Rally (World)", "" }, - { 0x1E451446, "Trevor McFur in the Crescent Galaxy (World)", "" }, - { 0x27594C6A, "Defender 2000 (World)", "" }, - { 0x2E17D5DA, "Bubsy in Fractured Furry Tales (World)", "" }, - { 0x348E6449, "Double Dragon V - The Shadow Falls (World)", "" }, - { 0x3615AF6A, "Fever Pitch Soccer (World) (En,Fr,De,Es,It)", "" }, - { 0x38A130ED, "Troy Aikman NFL Football (World)", "" }, - { 0x3C044941, "Skyhammer (World)", "" }, - { 0x42A13EC5, "Soccer Kid (World)", "" }, - { 0x47EBC158, "Theme Park (World)", "" }, - { 0x4899628F, "Hover Strike (World)", "" }, - { 0x53DF6440, "Space War 2000 (World)", "" }, - { 0x55A0669C, "[BIOS] Atari Jaguar Developer CD (World)", "" }, - { 0x58272540, "Syndicate (World)", "" }, - { 0x5A101212, "Sensible Soccer - International Edition (World)", "" }, - { 0x5B6BB205, "Ruiner Pinball (World)", "" }, - { 0x5CFF14AB, "Pinball Fantasies (World)", "" }, - { 0x5E2CDBC0, "Doom (World)", "" }, - { 0x61C7EEC0, "Zero 5 (World)", "" }, - { 0x67F9AB3A, "Battle Sphere Gold (World)", "" }, - { 0x687068D5, "[BIOS] Atari Jaguar CD (World)", "" }, - { 0x6B2B95AD, "Tempest 2000 (World)", "" }, - { 0x6EB774EB, "Worms (World)", "" }, - { 0x6F8B2547, "Super Burnout (World)", "" }, - { 0x817A2273, "Pitfall - The Mayan Adventure (World)", "" }, - { 0x8975F48B, "Zool 2 (World)", "" }, - { 0x8D15DBC6, "[BIOS] Atari Jaguar Stubulator '94 (World)", "" }, - { 0x8FEA5AB0, "Dragon - The Bruce Lee Story (World)", "" }, - { 0x97EB4651, "I-War (World)", "" }, - { 0xA27823D8, "Ultra Vortek (World) (v0.94) (Beta)", "" }, - { 0xA56D0798, "Protector - Special Edition (World)", "" }, - { 0xA9F8A00E, "Rayman (World)", "" }, - { 0xB14C4753, "Fight for Life (World)", "" }, - { 0xBCB1A4BF, "Brutal Sports Football (World)", "" }, - { 0xBDA405C6, "Cannon Fodder (World)", "" }, - { 0xBDE67498, "Cybermorph (World) (Rev 1)", "" }, - { 0xC5562581, "Zoop! (World)", "" }, - { 0xC654681B, "Total Carnage (World)", "" }, - { 0xC6C7BA62, "Fight for Life (World) (Alt)", "" }, - { 0xC9608717, "Val d'Isere Skiing and Snowboarding (World)", "" }, - { 0xCBFD822A, "Air Cars (World)", "" }, - { 0xCD5BF827, "Attack of the Mutant Penguins (World)", "" }, - { 0xD6C19E34, "Iron Soldier 2 (World)", "" }, - { 0xDA9C4162, "Missile Command 3D (World)", "" }, - { 0xDC187F82, "Alien vs Predator (World)", "" }, - { 0xDE55DCC7, "Flashback - The Quest for Identity (World) (En,Fr)", "" }, - { 0xE28756DE, "Atari Karts (World)", "" }, - { 0xE60277BB, "[BIOS] Atari Jaguar Stubulator '93 (World)", "" }, - { 0xE91BD644, "Wolfenstein 3D (World)", "" }, - { 0xEC22F572, "SuperCross 3D (World)", "" }, - { 0xECF854E7, "Cybermorph (World) (Rev 2)", "" }, - { 0xEEE8D61D, "Club Drive (World)", "" }, - { 0xF0360DB3, "Hyper Force (World)", "" }, - { 0xFA7775AE, "Checkered Flag (World)", "" }, - { 0xFAE31DD0, "Flip Out! (World)", "" }, - { 0xFB731AAA, "[BIOS] Atari Jaguar (World)", "" }, - { 0xFFFFFFFF, "***END***", "" } + { 0x0509C85E, "Raiden (World)", "raiden.jpg", 0 }, + { 0x08F15576, "Iron Soldier (World) (v1.04)", "iron-soldier.jpg", 0 }, + { 0x0957A072, "Kasumi Ninja (World)", "kasumi-ninja.jpg", 0 }, + { 0x0AC83D77, "NBA Jam T.E. (World)", "nba-jam.jpg", 0 }, + { 0x0EC5369D, "Evolution - Dino Dudes (World)", "dino-dudes.jpg", 0 }, + { 0x0F6A1C2C, "Ultra Vortek (World)", "ultra-vortek.jpg", 0 }, + { 0x14915F20, "White Men Can't Jump (World)", "white-men-can't-jump.jpg", 0 }, + { 0x1660F070, "Power Drive Rally (World)", "power-drive-rally.jpg", 0 }, + { 0x1E451446, "Trevor McFur in the Crescent Galaxy (World)", "trevor-mcfur.jpg", 0 }, + { 0x27594C6A, "Defender 2000 (World)", "defender-2000.jpg", 0 }, + { 0x2E17D5DA, "Bubsy in Fractured Furry Tales (World)", "bubsy.jpg", 0 }, + { 0x348E6449, "Double Dragon V - The Shadow Falls (World)", "double-dragon.jpg", 0 }, + { 0x3615AF6A, "Fever Pitch Soccer (World) (En,Fr,De,Es,It)", "fever-pitch-soccer.jpg", 0 }, + { 0x38A130ED, "Troy Aikman NFL Football (World)", "troy-aikman-football.jpg", 0 }, + { 0x3C044941, "Skyhammer (World)", "skyhammer.jpg", 0 }, + { 0x42A13EC5, "Soccer Kid (World)", "soccer-kid.jpg", 0 }, + { 0x47EBC158, "Theme Park (World)", "theme-park.jpg", 0 }, + { 0x4899628F, "Hover Strike (World)", "hover-strike.jpg", 0 }, + { 0x53DF6440, "Space War 2000 (World)", "", 0 }, + { 0x55A0669C, "[BIOS] Atari Jaguar Developer CD (World)", "", 0 }, + { 0x58272540, "Syndicate (World)", "syndicate.jpg", 0 }, + { 0x5A101212, "Sensible Soccer - International Edition (World)", "sensible-soccer.jpg", 0 }, + { 0x5B6BB205, "Ruiner Pinball (World)", "ruiner-pinball.jpg", 0 }, + { 0x5CFF14AB, "Pinball Fantasies (World)", "pinball-fantasies.jpg", 0 }, + { 0x5E2CDBC0, "Doom (World)", "doom.jpg", 0 }, + { 0x61C7EEC0, "Zero 5 (World)", "zero-5.jpg", 0 }, + { 0x67F9AB3A, "Battle Sphere Gold (World)", "", 0 }, + { 0x687068D5, "[BIOS] Atari Jaguar CD (World)", "", 0 }, + { 0x6B2B95AD, "Tempest 2000 (World)", "tempest-2000.jpg", 0 }, + { 0x6EB774EB, "Worms (World)", "worms.jpg", 0 }, + { 0x6F8B2547, "Super Burnout (World)", "super-burnout.jpg", 0 }, + { 0x817A2273, "Pitfall - The Mayan Adventure (World)", "pitfall.jpg", 0 }, + { 0x8975F48B, "Zool 2 (World)", "zool-2.jpg", 0 }, + { 0x8D15DBC6, "[BIOS] Atari Jaguar Stubulator '94 (World)", "", 0 }, + { 0x8FEA5AB0, "Dragon - The Bruce Lee Story (World)", "dragon.jpg", 0 }, + { 0x97EB4651, "I-War (World)", "i-war.jpg", 0 }, + { 0xA27823D8, "Ultra Vortek (World) (v0.94) (Beta)", "", 0 }, + { 0xA56D0798, "Protector - Special Edition (World)", "protector-se.jpg", 0 }, + { 0xA9F8A00E, "Rayman (World)", "rayman.jpg", 0 }, + { 0xB14C4753, "Fight for Life (World)", "fight-for-life.jpg", 0 }, + { 0xBCB1A4BF, "Brutal Sports Football (World)", "brutal-sports-football.jpg", 0 }, + { 0xBDA405C6, "Cannon Fodder (World)", "cannon-fodder.jpg", 0 }, + { 0xBDE67498, "Cybermorph (World) (Rev 1)", "cybermorph-2mb.jpg", 0 }, + { 0xC5562581, "Zoop! (World)", "zoop.jpg", 0 }, + { 0xC654681B, "Total Carnage (World)", "total-carnage.jpg", 0 }, + { 0xC6C7BA62, "Fight for Life (World) (Alt) [BOGUS DUMP]", "", 0 }, + { 0xC9608717, "Val d'Isere Skiing and Snowboarding (World)", "val-d'isere-skiing.jpg", 0 }, + { 0xCBFD822A, "Air Cars (World)", "air-cars.jpg", 0 }, + { 0xCD5BF827, "Attack of the Mutant Penguins (World)", "attack-of-the-mutant-pengiuns.jpg", 0 }, + { 0xD6C19E34, "Iron Soldier 2 (World)", "iron-soldier-2.jpg", 0 }, + { 0xDA9C4162, "Missile Command 3D (World)", "missile-command-3d.jpg", 0 }, + { 0xDC187F82, "Alien vs Predator (World)", "alien-vs-predator.jpg", 0 }, + { 0xDE55DCC7, "Flashback - The Quest for Identity (World) (En,Fr)", "flashback.jpg", 0 }, + { 0xE28756DE, "Atari Karts (World)", "atari-karts.jpg", 0 }, + { 0xE60277BB, "[BIOS] Atari Jaguar Stubulator '93 (World)", "", 0 }, + { 0xE91BD644, "Wolfenstein 3D (World)", "wolfenstein-3d.jpg", 0 }, + { 0xEC22F572, "SuperCross 3D (World)", "supercross-3d.jpg", 0 }, + { 0xECF854E7, "Cybermorph (World) (Rev 2)", "cybermorph.jpg", 0 }, + { 0xEEE8D61D, "Club Drive (World)", "club-drive.jpg", 0 }, + { 0xF0360DB3, "Hyper Force (World)", "hyper-force.jpg", 0 }, + { 0xFA7775AE, "Checkered Flag (World)", "checkered-flag.jpg", 0 }, + { 0xFAE31DD0, "Flip Out! (World)", "flip-out.jpg", 0 }, + { 0xFB731AAA, "[BIOS] Atari Jaguar (World)", "", 0 }, + { 0xFFFFFFFF, "***END***", "", 0 } }; +/* +breakout-2000.jpg +memory-track.jpg +protector.jpg +towers-2.jpg +*/ /* Our strategy here is like so: diff --git a/src/gui/filethread.h b/src/gui/filethread.h index 6690dc6..24f0c9d 100644 --- a/src/gui/filethread.h +++ b/src/gui/filethread.h @@ -35,11 +35,14 @@ class FileThread: public QThread bool abort; }; +enum FileFlags { FF_ROM=1, FF_ALPINE=2, FF_BIOS=4, FF_REQ_DSP=8, FF_REQ_BIOS=16, FF_NON_WORKING=32 }; + struct RomIdentifier { const uint32 crc32; const char name[128]; const char file[128]; + const uint32 flags; }; extern RomIdentifier romList[]; diff --git a/src/gui/imagedelegate.cpp b/src/gui/imagedelegate.cpp index 7087915..b5dc508 100644 --- a/src/gui/imagedelegate.cpp +++ b/src/gui/imagedelegate.cpp @@ -72,12 +72,29 @@ The foreground of the item (the circle representing a pixel) must be rendered us option.rect.y() + option.rect.height()/2 - radius, 2*radius, 2*radius)); #else // painter->drawPixmap(option.rect.x()+8, option.rect.y()+8, 200, 94, QPixmap(":/res/labels/rayman.jpg")); - painter->drawPixmap(option.rect.x(), option.rect.y(), 488/2, 395/2, QPixmap(":/res/cart-blank.png")); // painter->drawPixmap(option.rect.x()+13, option.rect.y()+51, 433/2, 203/2, QPixmap(":/res/labels/rayman.jpg")); - painter->drawPixmap(option.rect.x()+14, option.rect.y()+50, 433/2, 203/2, QPixmap(":/res/label-blank.png")); -//Need to query the model for the data we're supposed to draw here... +// painter->drawPixmap(option.rect.x(), option.rect.y(), 488/2, 395/2, QPixmap(":/res/cart-blank.png")); + painter->drawPixmap(option.rect.x(), option.rect.y(), 488/4, 395/4, QPixmap(":/res/cart-blank.png")); unsigned long i = index.model()->data(index, Qt::DisplayRole).toUInt(); - painter->drawText(17, 73, QString(romList[i].name)); + + if (romList[i].file[0] == 0) + { +// painter->drawPixmap(option.rect.x()+14, option.rect.y()+50, 433/2, 203/2, QPixmap(":/res/label-blank.png")); + painter->drawPixmap(option.rect.x()+7, option.rect.y()+25, 433/4, 203/4, QPixmap(":/res/label-blank.png")); +//Need to query the model for the data we're supposed to draw here... +// painter->drawText(17, 73, QString(romList[i].name)); +// painter->setPen(Qt::white); + painter->setPen(QColor(255, 128, 0, 255)); +// painter->drawText(QRect(option.rect.x()+20, option.rect.y()+73, 196, 70), Qt::TextWordWrap | Qt::AlignHCenter, QString(romList[i].name)); + painter->drawText(QRect(option.rect.x()+10, option.rect.y()+36, 196/2, 70/2), Qt::TextWordWrap | Qt::AlignHCenter, QString(romList[i].name)); + } + else + { + QString filename(romList[i].file); + filename.prepend("./label/"); + QImage img(filename); + painter->drawImage(QRect(option.rect.x()+7, option.rect.y()+25, 433/4, 203/4), img); + } //26x100 #endif painter->restore(); @@ -99,7 +116,8 @@ QSize ImageDelegate::sizeHint(const QStyleOptionViewItem & /* option */, const Q // 200x94 is shrunk dimension... // return QSize(100, 47); // return QSize(216, 110); - return QSize(488/2, 395/2); +// return QSize(488/2, 395/2); + return QSize(488/4, 395/4); } /* -- 2.37.2