Author Topic: RAM required for Jim E's fast tilemapper  (Read 4790 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
RAM required for Jim E's fast tilemapper
« on: November 13, 2012, 06:06:11 am »
How much scrap RAM is needed to use Jim E's tilemapper?  Does it make a difference if I simply redraw the map every time?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #1 on: November 13, 2012, 08:05:10 am »
Hmm, what is "Jim E's Tilemapper" ?

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #2 on: November 13, 2012, 08:41:44 am »
It's the tilemapper Jim e wrote, it's fast and can handle large jumps (from 1 pixel to... i dunno how many, maybe 255?). Hot_Dog, i was under the impression that it redrew the map every time, i dunno how else he would've done the parallax scrolling demo with all the animations. I've never actually used it and it's been ages since i looked at it, do you have a link to it somewhere?

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #3 on: November 13, 2012, 10:52:11 am »
It's the tilemapper Jim e wrote, it's fast and can handle large jumps (from 1 pixel to... i dunno how many, maybe 255?). Hot_Dog, i was under the impression that it redrew the map every time, i dunno how else he would've done the parallax scrolling demo with all the animations. I've never actually used it and it's been ages since i looked at it, do you have a link to it somewhere?

Unfortunately I don't.  I do know that you can redraw the map every time or simply have it scroll (because it uses a buffer)

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #4 on: November 13, 2012, 12:15:16 pm »
Jim's mapper uses a buffer for the sides, right? (to scroll in from left/right) I assume that means you need gbuf + an extra 64 bytes (8x8) or 128 bytes (16x16). It's probably all contiguous though.

Btw, i found this:
http://web.archive.org/web/20061010131750/http://www.revsoft.org/phpBB2/viewtopic.php?t=423&postdays=0&postorder=asc&start=75

I don't know if that's how the final version was handled but it seems like animated tiles are redrawn every frame but everything else is left alone. I think redrawing the entire map every frame would give you a more even frame rate and would still leave you with a nice speed, but i dunno.

Btw, i also found this quote:
Quote from: Jim e
When I want to scroll my code calls certain functions like this depending on the number of pixels to move

1: Scroll_Left_1
2: Scroll_Left_1,Scroll_Left_1
3: Scroll_Left_4,Scroll_Right_1
4: Scroll_Left_4,
5: Scroll_Left_4,Scroll_Left_1
6: Scroll_Left_4,Scroll_Left_1,Scroll_Left_1
7: Shift_Bytes_Left,Scroll_Right_1

Any value greater than 8, I simply shift the bytes. Scrolling 4 bytes I make use of the RRD and RLD opcodes.

The data in the blank areas is then filled with an optimized tile drawer.
EDIT: Grammar
« Last Edit: November 13, 2012, 12:16:02 pm by chickendude »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #5 on: November 15, 2012, 11:08:39 pm »
From what i recall Jim's mapper prerotates the tileset for speed. It would require RAM proportional to how many tiles you had in this case.

Im sure i have it at home, ill look when i finish work.

It works on the same principal as DWedit's mapper, but Jim added layers etc.

EDIT - Didnt calc84maniac write a layered mapper as well?

In the past ive used a 2KB LUT to save on having to rotate each tile byte, basically each combination of 0-255 prerotated. Then just mask out the bits you dont need when copying. You could save on the masking with a 4KB LUT but that might be overkill for the benefit.
« Last Edit: November 15, 2012, 11:12:07 pm by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: RAM required for Jim E's fast tilemapper
« Reply #6 on: November 15, 2012, 11:18:30 pm »
Was it a tilemapper using the Revsoft grayscale package?

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #7 on: November 20, 2012, 05:54:31 am »
tr1p1ea, how do you get a LUT of 2kb? If each tile is 8x8, 256*8=2048, and that's just the basic tiles, non-rotated... CrASH's mapper did something similar, too, i believe (prerotating the tileset).

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: RAM required for Jim E's fast tilemapper
« Reply #8 on: November 20, 2012, 10:36:39 am »
I think he's prerotating all possible values from 0-255, not the tileset itself.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #9 on: November 20, 2012, 11:01:30 am »
Ahhh that makes much more sense. That's clever :)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: RAM required for Jim E's fast tilemapper
« Reply #10 on: November 20, 2012, 01:17:35 pm »
What I usually do, which saves a bunch of memory, is use SMC to generate a rotation of A by an arbitrary amount. The amount of rotation doesn't change for the entire frame, assuming the map is a multiple of 8 pixels wide. Basically I reserve 4 bytes and copy a 4-byte chunk from RRCA \ RRCA \ RRCA \ RRCA \ NOP \ NOP \ NOP \ NOP \ RLCA \ RLCA \ RLCA, which covers any rotation amount in 16 clock cycles.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #11 on: November 20, 2012, 03:42:57 pm »
Thats how my sprite routines usually work (if its a project that doesnt use a LUT).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: RAM required for Jim E's fast tilemapper
« Reply #12 on: November 21, 2012, 01:15:30 am »
That's exactly what i do, too :) I rotate the screen in my fastcopy routine, so my main mapper is really small/simple since it's always drawing aligned tiles. It makes layers pretty easy, but i guess parallax scrolling isn't really possible with my mapper.