Jump to content
  • entries
    20
  • comments
    16
  • views
    8,643

dungeon code progressing well


Shawn Jefferson

293 views

I've been working hard on porting the dungeon code, and have four 8k banks ported over so far, which is the main dungeon, character move, light routines and some miscellaneous dungeon routines (go_up_stairs, go_down_stairs, etc...) I should have another demo soon that will let you walk around Moria on the Atari 8-bit. I also have fixed a few more bugs and have done some basic optimization by creating some lookup tables. There's still quite a bit of optimization to be done of course.

 

Almost all the code is in cartridge banks of an Atarimax 8Mb cartridge, so all banked in at $A000-BFFF. That's pretty straight-forward. The crazy thing is that I'm using the ability of the VBXE to bank in memory at $4000 as well. Moria has many data structures, the cave, treasure list, monster list, spell lists, store structures, assorted player structures. All these are banked in at $4000, and only one can be in at a time. Moria was coded for a machine with a lot more memory, so the code assumes that all these structures are available in memory at once.

 

For instance, code to look up an item in the treasure list from the cave looks something like this:

c = t_list[cave[y][x].tptr].tchar;

I have to change this code something like this:

vbxe_bank(VBXE_CAVBANK);tptr = cave[y][x].tptr; vbxe_bank(VBXE_OBJBANK);c = t_list[tptr].tchar;

This code is looking up the treasure item from the cave in the treasure list and returning the character to display. Those are in two different memory banks, so this type of code needs to be refactored for the Atari 8-bit. There's quite a bit of this kind of thing, and keeping straight in my head what is in memory, and what needs to be in memory can be frustrating sometimes. Still, it seems to be coming together and it seems more possible that this port will be completed every day.

 

I thought I would also talk a little bit about what I've changed, or even taken out:

  • made the cave size slightly smaller (132 x 44), which equates to almost 24k since each cave location is 4 bytes. This was necessary to get it to fit between $4000 and $9FFF (it currently ends at $9AC0.)
  • shrunk the previous message storage down to 10 old messages (saves some precious memory. Hopefully 10 saved messages is enough!
  • modified the inventory displays from right justified to left justified using the entire line (this saved quite a bit of memory since to right justify the inventory display you need to store every line so you can get the layout correct.)
  • monster memories are currently not implemented... they were taking tons of memory, I may implement them near the end however, since they are pretty cool.
  • all the unix-isms are gone (like signals, opening a shell, etc..., but this probably won't be noticed by players anyway.)
  • there is no cursor. I don't think a cursor is necessary, but I may implement something if players are confused that they need to enter input

Of course, I've added color, but plan on adding a few other things too, like loading screens, joystick control (maybe?), music if possible, enhanced graphics (maybe!).

 

 

  • Like 1

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...