-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
IMMORTAL: Add initial game engine #4634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…itmasks have enum
….gs, and logic.gs
…a couple of statements
…tes, misc, and cycle
…ficate() and miscinit())
…ated level.cpp revised
|
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? |
engines/immortal/compression.cpp
Outdated
|
|
||
| link = hash >> 1; | ||
|
|
||
| ptk[prev] = (link << 8) | (ptk[prev] & kMaskLow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace
engines/immortal/compression.cpp
Outdated
| //start[prev] = ((link >> 4) & kMaskLast) | start[prev]; // Yikes this statement is gross | ||
| start[prev] |= (link >> 4) & kMaskLast; |
There was a problem hiding this comment.
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. | ||
| */ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)
No, this is what we were discussing for a while, to let @Quote58 continue his work right in-tree. |
engines/immortal/definitions.h
Outdated
|
|
||
| } // namespace immortal | ||
|
|
||
| #endif No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End line is missing
There was a problem hiding this 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
engines/immortal/bullet.cpp
Outdated
|
|
||
|
|
||
|
|
||
| } // namespace immortal No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End line is missing.
engines/immortal/compression.cpp
Outdated
| code = getInputCode(carry, src, srcLen, evenOdd); // Get the next code | ||
| if (carry == true) { | ||
|
|
||
| index = code << 1; |
There was a problem hiding this comment.
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.
engines/immortal/detection.cpp
Outdated
| #include "immortal/detection.h" | ||
| #include "immortal/detection_tables.h" | ||
|
|
||
| const DebugChannelDef ImmortalMetaEngineDetection::debugFlagList[] = { |
There was a problem hiding this comment.
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
engines/immortal/disk.h
Outdated
| void printInfo(); | ||
|
|
||
| private: | ||
| char _name[16]; |
There was a problem hiding this comment.
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;
engines/immortal/door.cpp
Outdated
| void ImmortalEngine::doorInit() {} | ||
| void ImmortalEngine::doorClrLock() {} | ||
|
|
||
| } // namespace immortal No newline at end of file |
There was a problem hiding this comment.
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.
engines/immortal/kernal.cpp
Outdated
| 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()); |
There was a problem hiding this comment.
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());
engines/immortal/kernal.cpp
Outdated
| d.open("IMMORTAL.dsk"); | ||
|
|
||
| d.seek(kPaletteOffset); | ||
| d.read(_palDefault, 32); |
There was a problem hiding this comment.
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.
engines/immortal/kernal.cpp
Outdated
|
|
||
| // This is a nasty bit of code isn't it? It's accurate to the source though :D | ||
| switch (_playing) { | ||
| case kSongText: |
There was a problem hiding this comment.
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
engines/immortal/kernal.cpp
Outdated
| musicUnPause(_themeID); | ||
| break; | ||
| } | ||
| default: |
There was a problem hiding this comment.
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
engines/immortal/kernal.cpp
Outdated
| musicUnPause(_combatID); | ||
| break; | ||
| } | ||
| default: |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Version currently supported: Apple IIGS
Implemented:
To do: