Jump to content
IGNORED

Best way to get Tiled maps to 7800basic with palettes- and retaining pokechar- capabiliy?


Recommended Posts

Hi guys! What could be the best way to get Tiled maps to 7800basic with palettes- and retaining pokechar- capability? I'm just asking so I don't go re-inventing the wheel unnecessarily if someone already has got an easy/smart way of doing it.

Plotmapfile is easy to use and draws everything in one call with pallettes and all, but even if I memcpy the map to ram I can't use pokechar afterwards to pick up stuff (coins or fruits etc). I guess I could use sprites for collectables, but that seems a bit wasteful.

Then I got this idea that perhaps I could copy the map into "regular data" and loop through it and plot every char individually. But then I realised that I can't do _My_Data[variable] in a loop, so I can't use the loop increment variable (and I'm not sure if plotchars is viable anyway as an alternative to plot the whole tilemap tile by tile either).

So my solution is now to incmapfile my tmx file, then memcpy it to ram, and after that use plotmap commands to get the correct palette on everything. Now I can also use pokechar to pick up stuff, and everything is working fine.

 

The only issue is that it's a lot of slow work to sit and manually count tiles, calculate x positions and put in parameters into plotmap commands. As a next step I was going to write some program in C that would spit out a string of plotmap statements from the Tiled array map data, but perhaps someone already has made such a script and wants to share? : > Or perhaps I'm complicating things in my mind and missing something obvious / some much easier solution?
 

Edited by Turbo Laser Lynx
Link to comment
Share on other sites

5 hours ago, Turbo Laser Lynx said:

if I memcpy the map to ram I can't use pokechar afterwards to pick up stuff

I believe you can, I do something similar to this in EXO to determine collisions with between the "front" of the playfield while ignoring the "deep background" tiles.

 

I also use pokechar to RAM to animate a few things from tiles like the little tv screens in EXO.

 

I might be wrong but I don't see any reason why you couldn't use tiles for collectables.

 

[edit] - I'm also using Tiled for all of my screens.

  • Like 2
Link to comment
Share on other sites

Woohoo I got it working! Thanks Muddy! Now I realised why it didn't work earlier.
 

I was doing:

dim tilemap = $2200
incmapfile gfx/myplotmapfile.tmx
memcpy tilemap myplotmapfile 240
plotmapfile gfx/myplotmapfile.tmx myplotmapfile 0 0 20 12   

Although I should've been doing:

dim tilemap = $2200
incmapfile gfx/myplotmapfile.tmx
memcpy tilemap myplotmapfile 240
plotmapfile gfx/myplotmapfile.tmx tilemap 0 0 20 12

Oh, the joys of programming! I was probably trying to solve this for a week or two and I got a ridiculous bug earlier too with the platform collission that probably took 3-4 evenings to solve! :grin: Well, great feeling to have the basics of a simple static room platformer down now, done in a good/"standard" way.

Edited by Turbo Laser Lynx
Link to comment
Share on other sites

good stuff  :)

 

You are quite right, the syntax is that you use to plotmapfile has to reference the file and the location in memory where you memcopy'd it to.

 

If you are using a bankswitching scheme - the nice thing with this approach is that you can plotmap from a different bank and go back to the bank where the actual tiles are stored to draw the screen, meaning you don't have to try to cram all of your maps into one bank.

 

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Lillapojkenpåön said:

Do the samples come with atari dev studio to? I can't find them

I'm not sure since it's a bit difficult to figure out where ADS installs these things. I'd just download the standalone 7800basic and get the samples from there. 

Link to comment
Share on other sites

3 hours ago, Lillapojkenpåön said:

Do the samples come with atari dev studio to? I can't find them

To minimise the installation I currently remove them.  I'm thinking whether I might be a good idea to add a sample viewer which could (probably copy them to a chosen location as required) provide some access for users...  I'll add that to my list.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

@mksmith I know this is an older thread, but could we think about having a standard directory with the atascii font(s) in the repo? I'm thinking examples of the complete Atari ASCII, alphachars only, numbers only, etc. in one place with a README file that would explain the different options and how to use? I would gladly write up the details and even compile them, if it helps. Anything to give back to this group and help you guys out.
 

Edited by saxmeister
Link to comment
Share on other sites

4 hours ago, saxmeister said:

@mksmith I know this is an older thread, but could we think about having a standard directory with the atascii font(s) in the repo? I'm thinking examples of the complete Atari ASCII, alphachars only, numbers only, etc. in one place with a README file that would explain the different options and how to use? I would gladly write up the details and even compile them, if it helps. Anything to give back to this group and help you guys out.
 

I'd love to write a sidebar or window in VSCode to allow proper access to the examples so people can get easy access and/or create a project from them.  Just need a little bit of time to do that but I need to get back into ADS very soon to clean up a few things so will do then.

  • Like 3
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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