Opened 10 years ago

Closed 10 years ago

Last modified 11 months ago

#9023 closed patch

GSOC: Draci Historie (BAR archives, engine stub)

Reported by: SF/dkasak13 Owned by: sev-
Priority: normal Component: Engine: Draci
Keywords: Cc:
Game: Dragon History

Description

I've cleaned up the engine stub, disabled compilation by default and made it properly detect the game. There's also an implementation of the BAR archive reader (nextghost's code served as a model as it was very well written). The engine prints the number of file streams inside INIT.DFW on startup (and does so correctly, yay!). Also, the engine was renamed to "Draci" to be more faithful to the original.

Ticket imported from: #2796171. Ticket imported from: patches/1128.

Attachments (2)

draci.patch (16.3 KB ) - added by SF/dkasak13 10 years ago.
engine stub and detection, BAR archiver
draci2.patch (17.8 KB ) - added by SF/dkasak13 10 years ago.
updated patch (see comments for details)

Download all attachments as: .zip

Change History (10)

by SF/dkasak13, 10 years ago

Attachment: draci.patch added

engine stub and detection, BAR archiver

comment:1 by SF/dkasak13, 10 years ago

Next stop will be implementing the DFW emulation layer for the archiver. While DFW files are no longer used in the engine, some parts rely on accessing the archives through the old interface. I'll take a look at the culprits tomorrow; perhaps rewriting those parts to use the new interface would be a better option.

comment:2 by lordhoto, 10 years ago

A little remark: The "MODULE_OBJS" list in module.mk should contain only one file per line. You might want to check out other module.mk files, like engines/scumm/module.mk for that. I also see you're using C style comments at the end of #endif blocks, we usually don't use comments at all there for the include guards, of course it's not bad, but I would personally prefer C++ style comments there, if you really decide to keep them.

Apart the patch looks fine to me.

comment:3 by lordhoto, 10 years ago

I just noticed some implementation specific thing, it seems you are keeping all files in memory when loading a BAR file. I don't know about the usual size of those files, but for systems with low memory, take for example the NDS with 4MB, it might be better to change the code to load them into memory only on demand.

comment:4 by sev-, 10 years ago

Owner: set to sev-

comment:5 by sev-, 10 years ago

A /really/ solid start, excellent!

Couple of the remarks:
- Please, use AD_ENTRY1s() macro in the detection entries, so it will be more readable.
- Try to divide logical blocks by empty lines. I.e. separate asserts, return statements, if() blocks, etc. Lumping them together lowers code readability.
- use debug(0, "") instead of printf() even for temporary output. debug functions take varargs too.

comment:6 by SF/dkasak13, 10 years ago

@lordhoto: I've fixed the formatting in module.mk and the C-style comments. I've also redesigned the archiver so it allocates memory only for those files that have already been accessed. Comments welcome. :-)

@sev: Ah, I knew I missed something! Added those AD_ENTRY1s() macros. I also fixed those other issues you brought up and elaborated a bit on the tests (it now prints the first ten bytes of each opened file).

In other news, I added a closeFile() function to the BAFile struct so individual files could be released without closing the archive. I also changed some of the unsigned int variables to uint32 and uint16. I don't know what the policy for those is but I've seen that lib functions return them. Further input is welcome.

by SF/dkasak13, 10 years ago

Attachment: draci2.patch added

updated patch (see comments for details)

comment:7 by SF/dkasak13, 10 years ago

Status: newclosed

comment:8 by digitall, 11 months ago

Component: Engine: Draci
Game: Dragon History
Note: See TracTickets for help on using tickets.