Jump to content
IGNORED

160B Banners


Muddyfunster

Recommended Posts

I've been experimenting with the sample programs and putting simple banners on the screen.

 

I made a simple 160B banner which is 80x96, indexed png with 13 colour (per the various tutorials and useful threads that I managed to find).

 

When I load the banner using

 

incbanner gfx/lr1.png 160B  

 

and then display it with plotbanner, I only get the leftmost 20% or so of the image.

 

Displaymode is set to 160B and palettes 0,1,2,3 are set to random colours. 

 

I've been beating my head against this one for a couple of hours, any suggestions on what I'm doing wrong would be appreciated!

 

 

Link to comment
Share on other sites

10 minutes ago, RevEng said:

If you're displaying that banner over some kind of background, you're probably running out of DMA time. Maria can only render so much.

 

If that's not the case, maybe paste your source and images, so we can investigate?

Thanks RevEng, source is below.

 

I'm also running into issues with colour indexing but that's more to do with how the images are saved and is a problem for another day :)

 

source is attached

 

Test ping is the png banner, capture is the output im getting

 

 

test.png

Capture.PNG

bannerexample.bas

Link to comment
Share on other sites

Ok, there's an undocumented limitation. plotbanner uses sprites to display, which are max 32 bytes in width. If you crop your banner to 64 pixels (32 bytes) wide it works as expected.

 

I'll update the docs and see if I can get a warning spit out in the compiler to make it obvious when that limit is exceeded.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I can't seem to recreate any vertical clipping using your example. I added a few pixels on the bottom-most row, and they showed up for me.

 

The palettes changing between manually trimmed down bits of the banner, are caused by your png generation. The drawing program either sees certain color indexes not being used and drops them, or used in a different order and doesn't it bother to sort them like gimp does.

Link to comment
Share on other sites

1 hour ago, DEBRO said:

Hi there,

I would have thought the title was done with tiles.

Hey Debro - no just a couple of pngs split using the banner feature in 7800basic. Did the same with the ship in the intro but I did chunk that into 5-6 pieces to reduce the wasted memory space.  I hadn't actually thought of using tiles instead... ???

Link to comment
Share on other sites

2 hours ago, Muddyfunster said:

@RevEng splitting the banner worked great, but I noticed that I also got some vertical clipping with the bottom couple of rows being snipped. I ended up experimenting with quartering the banner and that worked fine, other than palette funkyness.

 

 

I think you need to run with the 8 or 16 height boundaries you've chosen for displaying images ie. If you have chosen 8 then heights should be 8, 16, 24, 32, 40 etc.

Link to comment
Share on other sites

2 hours ago, RevEng said:

I can't seem to recreate any vertical clipping using your example. I added a few pixels on the bottom-most row, and they showed up for me.

 

The palettes changing between manually trimmed down bits of the banner, are caused by your png generation. The drawing program either sees certain color indexes not being used and drops them, or used in a different order and doesn't it bother to sort them like gimp does.

I recreated it but i think it's an export issue. I'm using gimp and exporting the image as a 4 colour indexed png.

 

The bottom 5th of the image just gets binned and I get blank space instead. No amount of messing with the indexes in my program will make the missing area show up.

 

Going to try with paint.net

 

 

  • Like 1
Link to comment
Share on other sites

50 minutes ago, mksmith said:

I hadn't actually thought of using tiles instead... ???

I can't put my finger on the thread, but someone was making title screen mock-ups with 7800basic using tiles, and they ran out of characters. It's not hard to do in 160A, let alone less expansive modes, if your image doesn't have a lot of repeat characters. It's one of the reasons that plotbanner uses sprites instead of characters.

 

  • Like 1
Link to comment
Share on other sites

22 minutes ago, RevEng said:

I can't put my finger on the thread, but someone was making title screen mock-ups with 7800basic using tiles, and they ran out of characters. It's not hard to do in 160A, let alone less expansive modes, if your image doesn't have a lot of repeat characters. It's one of the reasons that plotbanner uses sprites instead of characters.

 

Was thinking I could save a little bit of space around the pointy edges but your probably right there - also need to take into account the extra font characters.  The balancing act!  Still my main issue is trying to fit these floating objects in as I have no bank space ATM - the other stuff like the titles are in other banks so not really a worry for me. 

  • Like 1
Link to comment
Share on other sites

@RevEngI have replicated the issue i'm seeing with clipping.

 

This is a 160A 4 colour indexed png banner, code and png attached below.

 

looks like it's clipping the bottom 4 rows (png is 40x36). Is the 36 pixel height the issue? 

 

The width of 40 is inside the 64 pixel limit, is there a vertical limit or should the png be cut at 8 or 16 pixel boundaries?

 

I tried an 11 pixel high banner and the compiler rejected that too (just as a test while fiddling about).

 

 

 

testban.png

code output.PNG

banner_clipping.bas

Link to comment
Share on other sites

7 minutes ago, RevEng said:

Yes, Matt had mentioned that above. I though it was in the manual, but I don't see it. Definitely the banners need to be a multiple of the zone height. I'll update the docs.

ah sorry I missed that, thanks @RevEng . Every day is a school day for me with 7800Basic right now :)

  • Like 1
Link to comment
Share on other sites

17 hours ago, mksmith said:

Keep working at it mate - it's such a lovely language once you get past this bit!!

Thanks, I think i've got it now I'm sizing banners correctly and respecting the zone height boundary and I'm making progress with the colour indexing.

 

My next thought is on palettes...

 

if I run with 160B for my title screen, can I revert to 160A later for objects and can I redefine the the 160B palette (ie palette 0 to 3) later to have "game colours" instead of "titlepage" colours, so in effect, I have a title palette and a game palette? Sorry if this is covered already, I've searched and found some interesting threads but I didn't see anything definitive.

 

I'm trying to see how much palette flexibility I have and whether to structure my palettes, sprites and graphics in 3+1 or 12+1 sets. I won't have tons of sprites so the overhead of 160B for extra colours (in a sprite) is a good trade off for me if I understand things correctly.

 

 

Link to comment
Share on other sites

You can freely change the colours in your palettes any time you want by writing new values to the p#c# variables. You can't read back what's in those variables so you can't do something like p0c1 = p0c1 + 1 though so if you want to do that you'll need to use your own variables to keep a copy of the values.

 

You can freely mix 160A and 160B graphics on screen at the same time as long as you tell 7800BASIC which mode to use when you import your graphics. The graphics modes on the 7800 kind of work in pairs so you can 160A and 160B, 320A and 320C, or 320B and 320D, but the 160 modes are a bit more practical.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Muddyfunster said:

Thanks, I think i've got it now I'm sizing banners correctly and respecting the zone height boundary and I'm making progress with the colour indexing.

 

My next thought is on palettes...

 

if I run with 160B for my title screen, can I revert to 160A later for objects and can I redefine the the 160B palette (ie palette 0 to 3) later to have "game colours" instead of "titlepage" colours, so in effect, I have a title palette and a game palette? Sorry if this is covered already, I've searched and found some interesting threads but I didn't see anything definitive.

 

I'm trying to see how much palette flexibility I have and whether to structure my palettes, sprites and graphics in 3+1 or 12+1 sets. I won't have tons of sprites so the overhead of 160B for extra colours (in a sprite) is a good trade off for me if I understand things correctly.

 

 

As @SmittyB noted definitely! In Arkanoid I have multiple palettes for various states such as the title, intro/outro, in game etc. I also update the palette for the background on each level and the DOH level is totally different from the main levels. Also the Vaus and DOH head graphics are all 160B and everything else 160A.

  • Like 1
  • Thanks 1
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...