The Great Escape disassembly

dptdpt
edited January 2015 in Announcements
Hi,

Over the past few months I've been steadily chipping away at reverse engineering Denton Designs' classic 48K title, The Great Escape.

I'm now a good 60% through the disassembly using SkoolKit, and have the beginnings of a reimplementation in C.

The current code is on GitHub: https://github.com/dpt/The-Great-Escape

D.
Post edited by dpt on
«1

Comments

  • edited April 2013
    Ooh, interesting. Straight away I learned something - not every sprite has a mask. All the animations for walking in one direction share the same mask. Great way to save memory.
    Joefish
    - IONIAN-GAMES.com -
  • edited April 2013
    Great stuff..!

    There's a lot of little titbits that I'm going to find quite useful.

    ...For example, saving 8 bytes by not bothering with the letter "O", and using "0" (zero) instead. Didn't think of that! :D
  • edited April 2013
    Morkin wrote: »
    ...For example, saving 8 bytes by not bothering with the letter "O", and using "0" (zero) instead. Didn't think of that! :D
    You'll regret that one, when the character order is no longer ASCII!
    (And everyone criticises your punctuation because you only have full stops). :D
    Joefish
    - IONIAN-GAMES.com -
  • edited April 2013
    joefish wrote: »
    You'll regret that one, when the character order is no longer ASCII!
    (And everyone criticises your punctuation because you only have full stops). :D

    :lol:

    Still - 8 bytes! You could save even more if your "1" looks like an "l"...
  • Morse code will save you even more!
  • fogfog
    edited April 2013
    funny you mention about using "none standard" chars.. the hall of the things on c64, I've been taking apart.. and they shift character to the PC ascii format due to it being done on basil etc.. (which is confusing for me, e.g. searching for a string) . is it the same with other speccy games that use cross asm / pds where the ascii is shifted?

    the game uses charsets *NO SPRITES* in-game for all the game characters, as well as the backgrounds. To me it's real oddity (and does look like a straight like-for-like speccy port) , as very few games don't utilise sprites (tetris is another one I recall)
  • edited April 2013
    Well, even on the Spectrum you'd be typing string data into an assembler in ASCII. You'd either need a look-up table in the program or a converter in your compiler tools to do otherwise.

    What you could do is have your print routine have two character sets, one for numbers and one for letters, then detect the ASCII codes and pick the right set at print time. If you also put in an exception for 0/o you'd waste nearly as many bytes as you'd save. But at least you'd skip all the punctuation between SPACE and the numbers, and between the numbers and the capital letters.

    Though I like a good set of punctuation marks, and I re-assigned some of the odd ones to symbols for the CAPS, SYMB, ENTER and SPACE keys, arrows, (C), etc. Then I just implemented characters 32-95 in the ASCII set. The trick is to pretend you have a full character set starting 256 bytes lower in memory. So when you come across a SPACE (Char 32) that comes off the start of where your font really is.
    Joefish
    - IONIAN-GAMES.com -
  • JmkJmk
    edited April 2013
    A Great Escape disassembly? Very nice, another game that needs 6809ed (along with Batman, Head Over Heels and Where Time Stood Still...) ;)

    Open disassembly efforts like this are a big help to those who convert between retro computers. So, thanks to those who do them.
  • edited April 2013
    Is this the z80 disassembly as well?

    Edit: sorry, yes - I saw the link on the Github page for the code.
    No one important.
  • jpjp
    edited April 2013
    dpt wrote: »
    Hi,

    Over the past few months I've been steadily chipping away at reverse engineering Denton Designs' classic 48K title, The Great Escape.

    I'm now a good 60% through the disassembly using SkoolKit, and have the beginnings of a reimplementation in C.

    The current code is on GitHub: https://github.com/dpt/The-Great-Escape

    D.

    Nice work! There's a thread about other Great Escape bugs here
  • edited April 2013
    Thanks! Very interesting.
  • dptdpt
    edited June 2013
    I've updated the disassembly:

    http://dpt.github.io/The-Great-Escape/

    It's getting there. Maybe 70% complete now. Still lots of stuff to figure out.

    Regards,
    Dave
  • edited June 2013
    Excellent work so far. :)
  • edited June 2013
    Congratulations! Keep it up!
  • edited June 2013
    I am at noob level with this but find it interesting,i notice the music and inputs are at a high address, is this the normal thing to do with all games by the nature of the Z80?
  • edited July 2013
    do you know what the main game loop looks like?
  • edited July 2013
    slenkar wrote: »
    do you know what the main game loop looks like?
    The main loop is at 9D7B.
    SkoolKit - disassemble a game today
    Pyskool - a remake of Skool Daze and Back to Skool
  • edited July 2013
    Probably a dumb question but maybe someone who looked at the disassembly knows the answer. Are there any areas of the map that were probably accessible but in the final code were made inaccessible?
  • dptdpt
    edited July 2013
    zxbruno wrote: »
    Probably a dumb question but maybe someone who looked at the disassembly knows the answer. Are there any areas of the map that were probably accessible but in the final code were made inaccessible?

    Secret rooms? :-) No, there's so little in the way of spare RAM that anything like that will have been removed to cram the game into 48K.

    There is some evidence of other rooms having existed in earlier development versions of the game. For example, rooms 6 and 8 share a room definition, but room 6 is not otherwise used. Also rooms 26 and 27 are allocated but not used.
  • edited July 2013
    Great job! ;)

    The Great Escape is one of my favorite games and now I can know about its programming.
    My blog (in Portuguese): Cantinho do TK90X.
  • dptdpt
    edited January 2014
    Having disassembled The Great Escape - to a point - the plan for phase 2 was to reimplement the game in portable C.

    After hacking away at it for many months now I'm happy enough with it to upload the current version of the C version to github:

    https://github.com/dpt/The-Great-Escape/tree/master/reimplement

    This is nowhere near complete yet, but it does contain all of the code from the original game, in some form, and does build, albeit with hods of warnings.

    The README on the linked page is extensive and I hope it will answer most questions. If not, please ask. :-)
  • JmkJmk
    edited January 2014
    Very nice! I like seeing this sort of thing.

    There was a time (long ago) when I used to get paid for reverse-engineering games and turning them into C. Sadly, they weren't Spectrum games.

    Keep it up. :)
  • edited January 2014
    dpt wrote: »
    Having disassembled The Great Escape - to a point - the plan for phase 2 was to reimplement the game in portable C.

    After hacking away at it for many months now I'm happy enough with it to upload the current version of the C version to github:

    https://github.com/dpt/The-Great-Escape/tree/master/reimplement

    This is nowhere near complete yet, but it does contain all of the code from the original game, in some form, and does build, albeit with hods of warnings.

    The README on the linked page is extensive and I hope it will answer most questions. If not, please ask. :-)

    Im gonna try building this for a laugh
  • dptdpt
    edited January 2015
    Just a quick post to mention some recent updates to The Great Escape disassembly project.
    • You can now turn the SkoolKit disassembly into assembly format with "make asm"
    • which you can then assemble with "make bin" (needs Pasmo installed)
    • and then turn it into a .tap with "make tap", which you can then load into your emulator, or machine, of choice.

    ("make tap" from scratch will build everything required).

    So you can now tweak the .ctl or .skool files then "make tap" to build your own modified version of The Great Escape! :cool:

    The main GitHub project URL is at https://github.com/dpt/The-Great-Escape


    New stuff in the generated disassembly:

    You can view the current state (it's still an ongoing task) of the disassembly at http://dpt.github.io/The-Great-Escape/index.html


    Meanwhile the the C reimplementation of the game has moved to its own repository at https://github.com/dpt/The-Great-Escape-in-C
  • edited January 2015
    This is quite something. I mean it wouldn't be the easiest to reverse engineer this particular game, or disassemble it.

    If I recall correctly it seemingly crashed once when I was playing it, back to BASIC, without me knowing what I'd done, and I was expecting the BASIC editor to lock up fairly soon, but it didn't - that's one way to complete it I guess :o

    Regarding the inaccessible bits of the map I doubt that this was possible but a few doors suggested other parts off-limits - in a way it added to the atmosphere not being able to access one or two places, and not knowing if a guard or the commandant would appear from one of those doors. That was part of the gameplay, lingering in a particular spot to see if it was patroled. There had to be one or two places were that would remain uncertain.

    To repeat this is quite something, and another reason we need a Potential Old Game Mod. [or call it what you will] subforum.

    Hasn't someone done an update of the loading screen too?


    Great film too

    Have you thought of 'bright-griding' the tile map to the size of the super tiles?
  • dptdpt
    edited January 2015
    This is quite something. I mean it wouldn't be the easiest to reverse engineer this particular game, or disassemble it.

    Yeah, it's a bit tricky.

    With the day job and two young kids (and moving house last year) it's been hard to dedicate the long stretches of time required to the task. I get to hack on it in the late evening hours when I'm bleary eyed and not much use.
    Regarding the inaccessible bits of the map I doubt that this was possible but a few doors suggested other parts off-limits - in a way it added to the atmosphere not being able to access one or two places, and not knowing if a guard or the commandant would appear from one of those doors. That was part of the gameplay, lingering in a particular spot to see if it was patroled. There had to be one or two places were that would remain uncertain.

    There are doors up high on the battlements where there are guards patrolling and another in the fenced off area. Neither are functional. Purely decorative.

    When I played TGE originally I never knew that the main gate can be utilised. Stand in front of the gate with the papers and the uniform on and 'use' the papers and you will be transported to the other side. Try it without the uniform however and you'll be sent to solitary.
    Hasn't someone done an update of the loading screen too?

    This one is brilliant.
    Have you thought of 'bright-griding' the tile map to the size of the super tiles?

    I assume you mean doing a checkerboard pattern with the BRIGHT bit? Should be straightforward.
  • I've recently added a couple of new pages to the disassembly:

    Rooms and tunnels http://dpt.github.io/The-Great-Escape/Rooms.html
    The game's rooms and tunnels are decoded from their definitions and shown as an image with various stats on the objects used in each room.

    Masks http://dpt.github.io/The-Great-Escape/Masks.html
    Masks are now decoded into images so we can now see how they look.

    There's loads of other bits and pieces too: I really must get better at doing a changelog.
  • edited November 2015
    Thanks for doing the disassembly, always fun to see how things like these work!

    I just found an oddity whilst playing through The Great Escape. I left some food (outside in line with the door to the canteen) in order to get arrested. I was put in solitary as intended but as I was escorted out and my character took the automatic walk out on the courtyard, I passed the food I had left and the guard that met me immediately put me back into solitary (before I had regained control) and that kept looping until my moral was zero.
    Post edited by Ersh on
  • Yeah that's weird because when you're in solitary the ITEM DISCOVERED stuff should run, 'finding' then resetting those objects to their original positions.

    There's a couple of weird things that turn up in the game, for instance when your character gets put in solitary he can sometimes go mad and start running towards the top of the screen flipping left/right. Bug or intentional? I suspect a bug but the disassembly can help us identify these things.
  • dpt wrote: »
    There's a couple of weird things that turn up in the game, for instance when your character gets put in solitary he can sometimes go mad and start running towards the top of the screen flipping left/right. Bug or intentional? I suspect a bug but the disassembly can help us identify these things.
    If it's anything like Papillion then I think getting put in solitary results in you eating bugs :)

    I like these disassemblies. I don't profess to understand much of what's going on, but I do like sifting through the gubbins and reading the comments.

    Post edited by Maroc's Other Projection on
    Cheeky Funster (53)
Sign In or Register to comment.