Author Topic: [68k general] Map Scrolling  (Read 4041 times)

0 Members and 1 Guest are viewing this topic.

Offline mdjenkins86

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 235
  • Rating: +0/-0
    • View Profile
[68k general] Map Scrolling
« on: July 25, 2006, 04:07:00 am »
What is the best way to create a map scroller.  I mean. do you store the sprite in a list and then update the screen as the positon on the character reaches a certain point.  If so, how do you stop strolling when the charater reaches the edge of the map

Liazon

  • Guest
[68k general] Map Scrolling
« Reply #1 on: July 25, 2006, 07:29:00 am »
Well, to answer your second question, what I do is that I have a set of camera variables that follow the character so that the character is in the center of the screen, unless the camera coordinates are no longer on the map.  In that case, I just set it to the nearest value in the domain.

I use the tilemap engine that comes with Extgraph, but I don't think that's necessary unless you're doing hardcore stuff (stupid contest entry that won't work right) or greyscale.  It will update accordingly and you don't need to clear the screen before calling the drawplane routine again.  Drawplane will replace the previous screen contents.  The engine uses a buffer to draw out a section of the map that's bigger than the screen, and uses the map coordinates to figure out when to update, and what section to copy to LCD memory.

Offline mdjenkins86

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 235
  • Rating: +0/-0
    • View Profile
[68k general] Map Scrolling
« Reply #2 on: July 25, 2006, 10:13:00 am »
That last part is really interesting.  This can obviously only be done in C though...buffering a section of the map (which is bigger than the screen) in memory and updating the lcd memory...obiously I need to be mesing with Extgraph as you said before....*goes to do research*

Thanks again

Liazon

  • Guest
[68k general] Map Scrolling
« Reply #3 on: July 25, 2006, 01:12:00 pm »
no problem, if you ask me, Extgraph is an amazing jewel in the 68k community.  I think it harnesses a lot of power for TIGCC programmers to use to make really incredible games without 68k ASM knowledge.

btw, based on z80 experience (I've never written an ASM scrolling tilemapper) the tilemappers that I've seen others written on z80 calcs are all customized to fit the needs of their games.  One general purpose scrolling tilemapper will scroll all the tiles first, then display them on the screen.  This works really well if you have very few tiles in your tileset, because then the routine won't have to take 1000s of t-states to draw the buffer, but instead just buffer all the tiles.  However, if you have more than 96 tiles (about the # of 8x8 tiles that fit on an 83+) it becomes inefficient because the likeliness of all the tiles to appear on the screen is low.  

The other tilemapper I've seen at revsoft will do exactly as I described, buffer and copy, and then update the buffer when necessary.

crzyrbl

  • Guest
[68k general] Map Scrolling
« Reply #4 on: July 25, 2006, 06:49:00 pm »
the demo that came with xLib was a perfert example of how to do map scrolling...just had a speed problem because of all the gotos.  definitely look it up if you got a ti-8x+

Offline mdjenkins86

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 235
  • Rating: +0/-0
    • View Profile
[68k general] Map Scrolling
« Reply #5 on: July 26, 2006, 01:51:00 am »
I have never worked with z80.  Can C be complied for the 83/84 or is it just z80 ASM

Liazon

  • Guest
[68k general] Map Scrolling
« Reply #6 on: July 26, 2006, 02:16:00 am »
um... you'll have to ask some z80 ppl about that.  Last I heard, there was no good C compiler for z80 that produced code faster than basic.  But I'm sure a lot of people here keep real up to date with what's hot  for the next faster-than-basic-but-easier-than-ASM language.

if there is one, it will probably lack a lot of common C features that you'd find in TIGCC.

I SHOULD TRY TO MAKE ONE!!