Synthpopalooza Posted August 9, 2017 Share Posted August 9, 2017 (edited) So then, would it be possible to swap out charactersets every display ... first frame has the characters as character set #1 and second frame as character set #2? The purpose of this is to use frame blending so I can get 10 colors in the plotmap. It may be cheating a little bit but I was thinking about experimenting with this anyway. Edited August 9, 2017 by Synthpopalooza Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 9, 2017 Author Share Posted August 9, 2017 Sure, but it's going to flicker at ~30Hz. (or ~25Hz, in the case of PAL) Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 9, 2017 Share Posted August 9, 2017 I Think I might be able to get away with it. The majority of the characters will be the three non-flickered palette colors, and I will only use the blended colors for shading and accents. I might even be able to get away with using only one palette in 160A and leaving more DMA for screen objects. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 10, 2017 Share Posted August 10, 2017 So, I came up with this code: cflip=1-cflip if cflip=1 then characterset level1_160A_tileset_a:goto doneflip characterset level1_160A_tileset_b doneflip Where would be the best place to put this in my code so that the characters on the screen will flip between the two frames every cycle? Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 10, 2017 Author Share Posted August 10, 2017 There's a few places you could put it, but probably right after you plot things, and right before your drawscreen would be fine. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 10, 2017 Share Posted August 10, 2017 OK, so I tried that ... here's the code and .a78 file. Doesn't seem to be working ... maybe I am missing a step. The dark characters at the top are the ones which should be changing between frames.. Maybe I am missing something crucial ... Also attaching the two pngs representing the two charactersets I am trying to flip. The third block character is the one which should change between frames. It should make a solid dithered color in the center instead of a checkerboard. ramcharmap4.bas ramcharmap4.bas.a78 Quote Link to comment Share on other sites More sharing options...
+frankodragon Posted August 10, 2017 Share Posted August 10, 2017 What I usually do is make a "__" as suggested by RT for the labels. I don't know if this would work but you could rewrite as: if cflip=1 then goto __flipping else goto __doneflip if cflip<>1 then characterset level1_160A_tileset_b:goto __doneflip __flipping cflip=1-cflip if cflip=1 then characterset level1_160A_tileset_a goto __doneflip __doneflip Quote Link to comment Share on other sites More sharing options...
+frankodragon Posted August 10, 2017 Share Posted August 10, 2017 I just edited some of the code so make sure you reload the page. Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 10, 2017 Author Share Posted August 10, 2017 You've included those graphics together in the same graphics block. So they're part of the same character set, but use different character indexes. Try putting them both at the beginning of 2 different "newblock" commands, so they're different character sets, and using the same character indexes. Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 16, 2017 Share Posted August 16, 2017 I don't know if this has been covered before but when using the Tiled editor with plotmapfile, it seems like it is necessary to "embed" the tilesets in Tiled. I've found that if I don't embed them, I always get a compile error that says something like, "plotmapfile cannot find a palette for palette0." Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 17, 2017 Author Share Posted August 17, 2017 Hmmm, I haven't had to embed images before, or do anything special. If the graphic names differ between 7800basic and tiled, then it can be a problem; that may not be the direct cause, but in your example error 7800basic does seem to be looking for an image named "palette", which it can't find. Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 17, 2017 Share Posted August 17, 2017 Hmmm, I haven't had to embed images before, or do anything special. If the graphic names differ between 7800basic and tiled, then it can be a problem; that may not be the direct cause, but in your example error 7800basic does seem to be looking for an image named "palette", which it can't find. Here is an example of the failed compilation message before I embed the images in Tiled and then again immediately after and then it works. The .bas and .A78 files and images are in the attached zip file too. GhostsnGoblins.zip 1 Quote Link to comment Share on other sites More sharing options...
Jinks Posted August 17, 2017 Share Posted August 17, 2017 Ok so are you finished your gng game?! Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 18, 2017 Share Posted August 18, 2017 Ok so are you finished your gng game?! Heh. No, it's just a title screen for fun. That would be awesome though. Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 18, 2017 Author Share Posted August 18, 2017 Here is an example of the failed compilation message before I embed the images in Tiled and then again immediately after and then it works. The .bas and .A78 files and images are in the attached zip file too. I recreated your map from scratch, and didn't need to embed. I'm thinking this might be an issue with a differing Tiled version. I'm using Tiled 0.14.2. What's your version? Either way, great that there's a work-around. Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 18, 2017 Share Posted August 18, 2017 I recreated your map from scratch, and didn't need to embed. I'm thinking this might be an issue with a differing Tiled version. I'm using Tiled 0.14.2. What's your version? Either way, great that there's a work-around. 1.0.2 Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 18, 2017 Author Share Posted August 18, 2017 I'll take a look how the default xml from 1.0.2 differs from the older version. I'm thinking this "embedded" mode used to be the default, and now isn't. If so, this will wind up being a documentation change, rather than a code change. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 20, 2017 Share Posted August 20, 2017 So, another question about character flipping: I've decided that I want to have a second palette, which will be palette 4, (of palettes 0 through 7) ... I want to use the Tiled editor method, but keep the character flip ... if I put both incgraphics for each palette in the same graphics block, at the same place, and have the other frame in the following block, will the character flip method still work? I am not going to use any more than those 2 palettes for character blocks as I don't want to stretch the DMA any more than I have to. Second question: I want to use multiple graphics, changing the structure block design for each level. Is there anyway to use charset to dynamically reference a character set by its actual memory location instead of by it's name? That way I can increment it by each level if I choose. And also will my characterflip method still work in this case? Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 20, 2017 Author Share Posted August 20, 2017 I've decided that I want to have a second palette, which will be palette 4, (of palettes 0 through 7) ... I want to use the Tiled editor method, but keep the character flip ... if I put both incgraphics for each palette in the same graphics block, at the same place, and have the other frame in the following block, will the character flip method still work? I am not going to use any more than those 2 palettes for character blocks as I don't want to stretch the DMA any more than I have to.Yes, the method will work the same with tiled map files. Second question: I want to use multiple graphics, changing the structure block design for each level. Is there anyway to use charset to dynamically reference a character set by its actual memory location instead of by it's name? That way I can increment it by each level if I choose. And also will my characterflip method still work in this case? In theory, sure, but it's pretty much under the hood work, and since graphics can easily shift around when you add more, I wouldn't recommend it. If you look at the assembly code generated from the "characterset" command, you can likely figure a method that works for your application. Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 28, 2017 Share Posted August 28, 2017 While experimenting with plotmapfile, I've noticed that if I make a large enough graphic, like for a title screen, and portions of the graphics data goes into GFX Block #1, that those parts aren't displayed at all, and only the ones in GFX Block #0 get displayed (both as they were supposed to and also as a substitute for the others). I've tried this several times with the same result, both in 160A and 320B modes. I don't know if it is a limitation of the plotmapfile command, the 7800 itself (don't think so), or the way Tiled encodes the data in XML or what. Any ideas anyone? shantae.zip Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 28, 2017 Author Share Posted August 28, 2017 You're importing graphics to the point you're exceeding 256 characters, and since character indexes are from 0-255, the graphics past the 256th character can't be displayed. I guess you could say this is a 7800 limitation, but it's more like a limitation of most (all?) machines of this era. The incbanner command can be used to import a tall png image, which you can plot with plotbanner. These commands use large sprites, rather than characters, to avoid this very problem. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 28, 2017 Share Posted August 28, 2017 OK, needing help ... My latest Sky Scraper demo is in this thread here: http://atariage.com/forums/topic/223121-work-in-progress-sky-scraper-2115/?p=3836032 I have the first 27 levels in, but I am running out of ROM space, so I am having to look into bankswitching. Right now, I want to try 128K ... How would I go about placing my 27 existing levels in the extra banks, and calling them into the program as needed? I have a total of 39 levels that I ultimately want to include. Quote Link to comment Share on other sites More sharing options...
+sgrddy Posted August 28, 2017 Share Posted August 28, 2017 You're importing graphics to the point you're exceeding 256 characters, and since character indexes are from 0-255, the graphics past the 256th character can't be displayed. I guess you could say this is a 7800 limitation, but it's more like a limitation of most (all?) machines of this era. The incbanner command can be used to import a tall png image, which you can plot with plotbanner. These commands use large sprites, rather than characters, to avoid this very problem. Thanks. I thought it might have something to do with that. I had also noticed this when using a single, 16-pixel tall .png file that was longer than 256 8-pixel blocks that I might be running into that problem. I didn't know if splitting it up into multiple .png files would help or not, but obviously it doesn't. I've only tried plotbanner once or twice. Thanks for the info. 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 28, 2017 Author Share Posted August 28, 2017 I have the first 27 levels in, but I am running out of ROM space, so I am having to look into bankswitching. Right now, I want to try 128K ... How would I go about placing my 27 existing levels in the extra banks, and calling them into the program as needed? I have a total of 39 levels that I ultimately want to include. Each game is structured differently, according to it's needs, so I can only give a few principles to keep in mind. The last bank is the one that stays in place permanently, while the others banks disappear whenever you goto/gosub to another bank. So any graphics or routines that need be available all the time should go in the last bank. Similarly, data statements in non-permanent banks should be used in the same bank they're in. If you use 144k, the first bank will also be permanent, but this precludes you from using POKEY@4k or RAM@4k, which may or may not be a concern. If you use graphics in a non-permanent bank, you'll need to ensure that bank is active while the screen is drawn (see drawwait) which usually winds up wasting a lot of otherwise useful cycles. There's nothing to be done about this. Hopefully some of that helps. Quote Link to comment Share on other sites More sharing options...
Mord Posted August 28, 2017 Share Posted August 28, 2017 Additionally if you're not in need of additional graphics but just need the space for level data and code, you can just make sure the graphics in each non-permanent bank is identical. At that point you can switch between the banks freely without corrupting the graphics being drawn. Another potential trick, if you're going to go with ram at 4k, is to try to compress the level data in the rom. Then when the level is loaded, you decompress the data and put it into the ram area. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.