KEMBAR78
IMMORTAL: Add initial game engine by Quote58 · Pull Request #4634 · scummvm/scummvm · GitHub
Skip to content

Conversation

@Quote58
Copy link
Contributor

@Quote58 Quote58 commented Jan 17, 2023

Version currently supported: Apple IIGS

Implemented:

  • Support for ProDOS file format with Common::Archive
  • Decompression routine
  • Main engine and subsystem skeletons
  • Palette processing functions
  • 'Story' subsystem
  • Cycles subsystem
  • Flamesets (torches)
  • Sprite loading and rendering
  • Text parsing and printing
  • Hit gauge
  • Initial loading of level assets
  • Many functions for Kernal, Logic, Level, Room, and Sprites

To do:

  • Finish implementing the extracting and deciphering of assets from .UNV and .CNM file types so that mazes can be drawn
  • Implement an input layer through ScummVM to connect with the 'actions' referenced in the code
  • Object and Monster subsystems
  • Music and sound implementation
  • Fill out the remaining static and dynamic story entries
  • Fill out the remaining functions in kernal.cpp, logic.cpp, level.cpp, and room.cpp
  • Implement motives, pickups, and other object/enemy structures and their related functions

@bluegr
Copy link
Member

bluegr commented Jan 17, 2023

Nice work! However, after checking the status and the TODOs, the dungeon is not drawn, and enemies are not yet handled sufficiently. Perhaps it's a bit early to ask for this engine to be merged?


link = hash >> 1;

ptk[prev] = (link << 8) | (ptk[prev] & kMaskLow);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

Comment on lines 254 to 255
//start[prev] = ((link >> 4) & kMaskLast) | start[prev]; // Yikes this statement is gross
start[prev] |= (link >> 4) & kMaskLast;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, why has the second line replaced the first one?

* It does *not* handle sparse files at the moment. If a sparse file exists, it may not
* be read correctly. It also does not do anything with Pascal files, but those should not
* matter for game engines anyway.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move this into common, under e.g. common/prodos.* ?



int ImmortalEngine::findDoorTop(int x, int y) {
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these aren't implemented, please add a TODO, so that it won't be forgotten during development (same goes for all the door related functions below)

@sev-
Copy link
Member

sev- commented Jan 18, 2023

Nice work! However, after checking the status and the TODOs, the dungeon is not drawn, and enemies are not yet handled sufficiently. Perhaps it's a bit early to ask for this engine to be merged?

No, this is what we were discussing for a while, to let @Quote58 continue his work right in-tree.


} // namespace immortal

#endif No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End line is missing

Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a cursory review till the file logic.cpp




} // namespace immortal No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End line is missing.

code = getInputCode(carry, src, srcLen, evenOdd); // Get the next code
if (carry == true) {

index = code << 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is all off here. We align code by left edge, not by the assignment operators.

#include "immortal/detection.h"
#include "immortal/detection_tables.h"

const DebugChannelDef ImmortalMetaEngineDetection::debugFlagList[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, since this one is a stub, it could be safely removed, unless you have plans for implementing debug console functionality

void printInfo();

private:
char _name[16];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is not correct here. If you want to align variable names, do it like this:

char   _name[16];
uint8  _type;
uint16 _blocskPtr;

void ImmortalEngine::doorInit() {}
void ImmortalEngine::doorClrLock() {}

} // namespace immortal No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing end line at the end of the file. Please check all files.

debug("Size of maze CNM: %ld", mazeCNM->size());

// The logical CNM contains the contents of mazeN.CNM, with every entry being bitshifted left once
_logicalCNM = (uint16 *) malloc(mazeCNM->size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect formatting" _logicalCNM = (uint16 *)malloc(mazeCNM->size());

d.open("IMMORTAL.dsk");

d.seek(kPaletteOffset);
d.read(_palDefault, 32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not portable. Those values are uint16, so you must read them with:

for (int i = 0; i < 16; i++) {
    _paletteDefault[i] = d.readUint16LE();
}

and in the same way for all the palettes below.


// This is a nasty bit of code isn't it? It's accurate to the source though :D
switch (_playing) {
case kSongText:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect switch/case indentation. Please review all switches everywhere

musicUnPause(_themeID);
break;
}
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the break is intentionally missing here, please add a comment // fall through

musicUnPause(_combatID);
break;
}
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing about the missing break

* We want to do 320 bytes per scanline, at location (0,0), with a
* size of 320x200.
*/
_mainSurface->copyRectToSurface(_screenBuff, kResH, 0, 0, kResH, kResV);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're copying the whole screen every time, I'd suggest using Dirty rectangles.

copyToScreen();
}

// These functions are not yet implemented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is worth adding TODO or STUB

MODULE := engines/immortal

MODULE_OBJS = \
metaengine.o \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have to be sorted alphabetically. I'll do it after the merge

kTileTopLower75,
kTileLower3,
kTileLower5,
kTileCeilingTile = 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a strange duplicate. Please recheck

@sev- sev- merged commit 878fbe4 into scummvm:master Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants