Jump to content
Opry99er

Assembly->XB link project

Recommended Posts

Hey Owen, would it help to have a routine that returns you the tile number for an x,y location in the map? Like GCHAR? However, this would be in the entire map, all 56x72 tiles, not just a current page. Let me know. I suspect you could really use that for "valid move" determination.

Share this post


Link to post
Share on other sites

Ha!!! I was discussing that with Tursi last night. ;). I actually started writing one but didn't get too far. The premise was to take PX,PY and convert it into a single number between 1 and 768, pass it to assembly where the routine would read the ASCII code of the needed tile and do a series of compares to determine whether the move was legal or not... Then pass a "1" or "0" back to XB as an indicator as to whether or not the move is legal. I didn't really get it thought through 100%, but I had a premise. It is definitely something I want to do with assembly, the only problem is that the "legal" tile are spread out over 4 character sets and are not in a "range". In assembly, that isn't as big of a deal as in XB, where it slows my code down DRASTICALLY. :) So, yes... I would love to learn how to write the code for a GCHAR-like routine. My initial premise might not be the best one--- but I was actually going to post something about this when my map got a bit furthe along. You're on top of it!! :)

Share this post


Link to post
Share on other sites

I actually think you're talking about something else entirely, after re-reading your post... Please expound on how you plan to accomplish such a thing. It's intriguing. :)

Share this post


Link to post
Share on other sites

Yeah, your map is in the low 8K, and what is in the map is what you see on the screen. You don't need to get the data "back" from VRAM, you *put* it there in the first place. Remember what I said about treating VRAM and the screen as an output only device. The routine I'm proposing would read the map data directly in the low 8K and would be a billion times faster than GCHAR or reading VRAM (which is unnecessary.)

Share this post


Link to post
Share on other sites

Absolutely... I was thinking about such a thing when I re-read your post.... Similarly to how the Beryl scroller went--- when I wrote my version, I checked VDP for boundaries, when you wrote yours, you used CPU. :) It made so much more sense, but I am continuously in that XB mentality--- working out of it now. :) Thanks

Share this post


Link to post
Share on other sites

Even in XB you can apply the same rules, just not as efficiently. I'll hack something up in a little while. The input will be two value, x and y in the 56x72 map, and the result will be legal to move there or not. Give me a list of the tile names (ie. numbers) that are "ok" to walk on. I suspect that list might be linear and/or smaller than the illegal list. Actually, give me the smaller of the two lists.

Share this post


Link to post
Share on other sites

I'll do that as soon as I get home. The legal list (so far) includes the two tiles I use to make up the "path" and the grass. I am planning on adding water and bridges as well, so the bridges will also be navigable. The shrubbery, trees, mountains, hills, items are all off limits. :) I'll get you the ASCII codes as soon as I'm sitting at my computer with Magellan open.

Share this post


Link to post
Share on other sites

At the current time, here are the legal tiles:

 

ASCII 136, 102, 103

 

The bridges will also be navigable, they will be 118 and 119. Haven't implemented them yet, but they will be in there. I'll also be adding the water back in and I'll be doing an ISR-hook-based "animation" of the water tiles. I still have charset #10 totally unused and I'll be using it for the water tiles. =)

 

 

Share this post


Link to post
Share on other sites

I have not had time to code anything yet, but here is the plan (maybe you can work out some code before me):

 

1. Get two values from XB, probably in the MSB and LSB of PARM1. Or in the LSB of PARM1 and PARM2

 

2. Adjust the input values to be zero-based and do: offset = y * rowsize + x

 

3. Get the map byte at the offset

 

4. Compare the map byte to each byte in the "legal list"

 

5. Set PARM1 to 0 or 1 based on step 4

 

6. Return

Share this post


Link to post
Share on other sites

I'm in Georgia playing this week. Absolutely no Internet access whatsoever. I'm sitting in front of a McDonalds for a minute trying to catch up here. ;). Hopefully Christmas brings a bit of down time so I can work on this project. :).

Share this post


Link to post
Share on other sites

I'm in Georgia playing this week. Absolutely no Internet access whatsoever. I'm sitting in front of a McDonalds for a minute trying to catch up here. ;). Hopefully Christmas brings a bit of down time so I can work on this project. :).

 

McGriddles (Sausage, Egg, & Cheese only, McD's bacon is suck) are the bomb!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   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...