8-Bit BTCS - 6502 Reverse Engineering Project

Any developer realated stuff
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

Thanks, that did it. I ran through it, and it was really cool to look at. You do have to count the cursor spaces, when you are in open areas, to figure out where you are. The color scheme would be the only part that would be a little user hostile at this point. Well done.
When in doubt, kick your neighbors dog!
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Chaney wrote:Thanks, that did it. I ran through it, and it was really cool to look at. You do have to count the cursor spaces, when you are in open areas, to figure out where you are. The color scheme would be the only part that would be a little user hostile at this point. Well done.
Which colours do you recommend I switch to?
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

Would the cursor show up better if the background was white? I don't know the dynamics involved in making changes like that. Why doesn't the cursor color show up in the areas without walls? The cursor is yellow.
When in doubt, kick your neighbors dog!
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Chaney wrote:Would the cursor show up better if the background was white? I don't know the dynamics involved in making changes like that. Why doesn't the cursor color show up in the areas without walls? The cursor is yellow.
If the background was white I think it would hurt the eyes too much. Cyan was chosen because blue is easiest on the eyes plus it's bright enough so you can see what's going on.

The reason why the cursor doesn't show up on blank tiles is because there's nothing to highlight. A blank square has a value of zero, meaning no pixels are lit up. I thought about making it so that it shows a solid square instead perhaps.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Good grief, I found a few wrongly rendered squares.

I don't suppose anyone else here knows exactly what I'm doing and can help me write this thing?
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

I wish I could. It sounds interesting to do.
When in doubt, kick your neighbors dog!
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Chaney wrote:I wish I could. It sounds interesting to do.
Actually, it's kind of morphed into one of those springtime projects I've been dreading, right up there with cleaning out the car. :?

But fear not, I will see this thing through. Eventually. :?

:?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

You've written a ton of code already.

I haven't programmed in C64 basic since... 1986, I think. But it's not a very feature rich language, so I should be able to help out when I find time.
Death and drek? WTF?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Horpner wrote:You've written a ton of code already.

I haven't programmed in C64 basic since... 1986, I think. But it's not a very feature rich language, so I should be able to help out when I find time.
I'm useless at assembly language. :?

Feel free to examine what I have distributed and make any changes you see fit.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Vision For The Project

Post by Darendor »

Here's an outline of basically what I envision the end result of this project being.


I imagine a shell system booted up that presents the person with the following options:

(A) Edit Wilderness map
(B) Edit Cities
(C) Edit Dungeons


WILDERNESS EDITOR

The Wilderness would of course be simply re-arranged from the default layout of BTII - trees, building faces, city wall faces, entry points for cities as well as putting in "specials".
Wandering monsters would be edited: monster tables; monster names, levels, pictures, experience, gold, item tables, special attacks, monster types (illusionary? mage [for MAGM]?), starting range...

An example of specials in the Wilderness:
- The Sage
- Kazdek's hut
- Fanskar's Fortress
- Grey Crypt


Consider Kazdek's Hut. It is a special contained within a building located at 19N, 25E on the Wilderness map. Upon kicking in the door, it loads up picture # (whatever represents the picture), followed by the caption underneath the picture, followed by the text:

Code: Select all

A stone man is here.  He says, "Welcome friends.  My home is, of course, your home.  You may stay as long as you like." he then falls asleep.  You can:
  (S)peak to him
  (E)xit
If "S" is selected, it prompts the keyboard for an input string.
- If "KAZDEK" and noone has 'Item of K' in inventory:

Code: Select all

"Yes?  Oh you need something of mine."  He pulls something from nowhere and gives it to you.
- Else:

Code: Select all

He does not awake.
If "E" is selected, the party is moved back into the Wilderness 1 square backwards...


Of course, you could put text strings on empty squares in the Wilderness too. Suppose you wanted the party to notice a particular tree that actually housed a dungeon entrance at 18N, 14E. At 17N, 14E you might place text:

Code: Select all

There is a strange looking tree to the north.  Shall you inspect?
 (Y)es
 (N)
If YES:

Code: Select all

Who will inspect? [0-6]
If an elven Hunter inspects:

Code: Select all

_______ has detected a trapdoor hidden amongst the roots of this tree.  Shall you enter?
    (Y)es
    (N)o
If NO, end special.
If other party member inspects:

Code: Select all

As peculiar as this tree seems, _______ found nothing particularly unusual about it.
And so forth...



CITY EDITOR

As we know, the APAR spell labels the six cities with a number value (APAR to city +1 is Tangramaybe, +2 for Ephesus, and so on). A person could simple rename the city in slot #1 and possibly create more than just six cities (suppose selecting +7 teleports the party to Los Angeles, +8 to London, +9 to Helsinki, and so forth).
The following would be editable:
- city's name
- building faces (e.g. there's orange, blue, white, brown "faces")
- iron gates
- locations of the usual features (Bank, Guild, Garth's, Roscoe's, Review Board, etc)
- Taverns and tavern names, along with the "gossip table" - at specific ranges of gold given two text strings are given at random; these ought to be customizable
- each square in a city not occupied by a building needs a street name attached to it; unnamed squares would be named "an alleyway" by default.
- a "special" detailing an entrance into a dungeon...
- monster tables; monster names, levels, pictures, experience, gold, item tables, special attacks, monster types (illusionary? mage [for MAGM]?), starting range...

For specials leading to dungeons, these would have to refer to a dungeon disk name (suppose "Dungeon Disk E") and the track #, sector # and position for each half of the physical layout, the traps layout and the dungeon special layout....



DUNGEON EDITOR

Woo, my favourite. :?

The dungeon editor, well, for those of you who have been keeping up with me, will be an advanced version of what I've hammered out so far.
It would have to be broken up into five sub-modules:
- physical layout editor (walls/doors/secret doors) as well as denoting whether the dungeon is shielded as well as the dungeon name (appearing under the window)
- the wall types; e.g. the Tombs vs The Destiny Stone vs Maze of Dread
- traps/darkness/antimagic zones/silence zones/leech zones/spinners/"Odd"/stairs & portals
- specials themselves; i.e. magic mouths, Keymasters, boss encounters, weird & wonderful items
- monster tables; monster names, levels, pictures, experience, gold, item tables, special attacks, monster types (illusionary? mage [for MAGM]?), starting range...



That's my prospectus for the 8BBK Project. Am I missing anything? Probably.
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

Darendor wrote:
Horpner wrote:You've written a ton of code already.

I haven't programmed in C64 basic since... 1986, I think. But it's not a very feature rich language, so I should be able to help out when I find time.
I'm useless at assembly language. :?
Well... me too, actually. But I predict this project is going to require at least some machine language hacking or it won't fit into memory, or it'll be ridiculously slow. I've always wanted to learn to do some assembly, and applying skills to a real project is the best way to learn anything, in my experience.

CBM Basic's simplicity is actually a strong point of the language. If we end up needing to do all of it in basic, and it gets too big, we can probably break it up into modules.
Death and drek? WTF?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

I've made some excellent progress on deciphering the specials. They seem to be stored in lists of coordinates, different lists for different types of specials.

The ones I've deciphered start at fc20.

There's one "special" special, the spider god statue, on the 2nd level of the cellars, and its coordinates are stored at fc20: 0904, or 9N, 4E.

Teleporter coordinates are at fc60: 06 0b, or 6N, 11E. The destination for the teleporters are right below that at fc70: 10 0c, or 16N, 12E. You'll recognize those coordinates from your map of the sewers, no doubt. This means that, at least on the C64, there's a limit of eight "normal" teleporters per level. If more are desired, then a more complicated special would have to be used. I'm guessing there's a hard limit of eight on most types of specials.

From the first level of the cellars, the coordinates of spinners seems to start at fc80: 0b 0a, or 11N, 10E.

Staying with the first level of the cellars, normal message text coordinates are stored starting at location fce0: 01 01 0a 12 0c 11, or 1N, 1E; 10N, 18E; and finally 12N, 17E. Those coordinates ought to seem familiar, too.

The coordinates of normal messages for the 2nd level of the sewers is also stored at fce0: 12 07 15 09 09 00 09 0d 07 11 0a 13 04 07 00 0e. That translates into the decimal coordinates of the normal messages that are in memory. The coordinates are stored in the same order as the messages are in memory, so the game's using another parallel array arrangement.

12 07: 18N, 7E (You are in the sewers under Skara Brae. The shallow water holds unknown terrors. Be careful!)
15 09: 21N, 9E (An inscription on the wall reads: Pass the light at night...)
09 00: 9N, 0E (There is something strange going on...)
09 0d: 9N, 14E (The sewer water seems very warm here...)
07 11: 7N, 17E (An inscription on the wall reads: IRKM DESMET DAEM.)
0a 13: 10N, 19E (A giant spider has been etched into the north wall.)
04 07: 4N, 7E (There is a great deal of slime on the walls here.)

At fcf0 there seems to be stored the coordinates of special monsters.

15 06: 21N, 6E (6 Spiders)
13 11: 19N, 17E (5 Spiders)
10 08: 16N, 8E (7 Spiders)
0d 00: 13N, 0E (3 Black widows)
0a 15: 10N, 21E (5 Black widows)
08 0b: 8N, 12E (8 Spiders)
04 11: 4N, 17E (3 Black widows)
01 0d: 1N, 13E (4 Black widows)

The actual list of special monsters is just below that, at fd00.

0c 06: Spiders, 6
0c 05: Spiders, 5
0c 07: Spiders, 7
1a 03: Black widows, 3
1a 05: Black widows, 5
0c 08: Spiders, 8
1a 03: Black widows, 3
1a 04: Black widows, 4

Obviously I deduced the monsters codes from the above listing.

Next comes some data I don't understand. Yet.

000fd10: 20fd 7dfd bafd e1fd 09fe 45fe 79fe adfe

And right after that is the normal message texts, in BTSCII, with dc as separator.

There's also some stuff before the dungeon name that's confusing. Most likely the shieldedness of a dungeon is stored somewhere in there, and possibly the wall-type that the dungeon uses. Maybe how many levels from the entry stairs, too.

Can I get a woohoo? :D
Death and drek? WTF?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Right, I've updated my D64 project disk image.
http://www.mediafire.com/?sharekey=2273 ... f6e8ebb871

The program "KY.PRG" completely translates Kylearan's Tower. Additionally, the program "MANG2.PRG" loads in Mangar's Tower, Level 2 (missing some translation squares).

Progress, I say! Progress! 8)


An interesting note is that the dungeons appear to be universally split across two sectors. The first half of each dungeon appears to be at byte #4 of the first sector (i.e. position 4) and the 2nd half on byte #2 of the second sector. The sectors appear to always be located within the same track.

If the above made no sense to you, ignore it. :?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Horpner wrote:I've made some excellent progress on deciphering the specials. They seem to be stored in lists of coordinates, different lists for different types of specials.

The ones I've deciphered start at fc20.

There's one "special" special, the spider god statue, on the 2nd level of the cellars, and its coordinates are stored at fc20: 0904, or 9N, 4E.

Teleporter coordinates are at fc60: 06 0b, or 6N, 11E. The destination for the teleporters are right below that at fc70: 10 0c, or 16N, 12E. You'll recognize those coordinates from your map of the sewers, no doubt. This means that, at least on the C64, there's a limit of eight "normal" teleporters per level. If more are desired, then a more complicated special would have to be used. I'm guessing there's a hard limit of eight on most types of specials.

From the first level of the cellars, the coordinates of spinners seems to start at fc80: 0b 0a, or 11N, 10E.

Staying with the first level of the cellars, normal message text coordinates are stored starting at location fce0: 01 01 0a 12 0c 11, or 1N, 1E; 10N, 18E; and finally 12N, 17E. Those coordinates ought to seem familiar, too.

The coordinates of normal messages for the 2nd level of the sewers is also stored at fce0: 12 07 15 09 09 00 09 0d 07 11 0a 13 04 07 00 0e. That translates into the decimal coordinates of the normal messages that are in memory. The coordinates are stored in the same order as the messages are in memory, so the game's using another parallel array arrangement.

12 07: 18N, 7E (You are in the sewers under Skara Brae. The shallow water holds unknown terrors. Be careful!)
15 09: 21N, 9E (An inscription on the wall reads: Pass the light at night...)
09 00: 9N, 0E (There is something strange going on...)
09 0d: 9N, 14E (The sewer water seems very warm here...)
07 11: 7N, 17E (An inscription on the wall reads: IRKM DESMET DAEM.)
0a 13: 10N, 19E (A giant spider has been etched into the north wall.)
04 07: 4N, 7E (There is a great deal of slime on the walls here.)

At fcf0 there seems to be stored the coordinates of special monsters.

15 06: 21N, 6E (6 Spiders)
13 11: 19N, 17E (5 Spiders)
10 08: 16N, 8E (7 Spiders)
0d 00: 13N, 0E (3 Black widows)
0a 15: 10N, 21E (5 Black widows)
08 0b: 8N, 12E (8 Spiders)
04 11: 4N, 17E (3 Black widows)
01 0d: 1N, 13E (4 Black widows)

The actual list of special monsters is just below that, at fd00.

0c 06: Spiders, 6
0c 05: Spiders, 5
0c 07: Spiders, 7
1a 03: Black widows, 3
1a 05: Black widows, 5
0c 08: Spiders, 8
1a 03: Black widows, 3
1a 04: Black widows, 4

Obviously I deduced the monsters codes from the above listing.

Next comes some data I don't understand. Yet.

000fd10: 20fd 7dfd bafd e1fd 09fe 45fe 79fe adfe

And right after that is the normal message texts, in BTSCII, with dc as separator.

There's also some stuff before the dungeon name that's confusing. Most likely the shieldedness of a dungeon is stored somewhere in there, and possibly the wall-type that the dungeon uses. Maybe how many levels from the entry stairs, too.

Can I get a woohoo? :D
That's pretty amazing work. You get a raise.

Still, how does the game know when the party has stepped on a special?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

And are those locations on disk, or in memory?
Post Reply