Decompressing NES Screen Tool map

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
charlielaw1
Posts: 7
Joined: Sat Jun 13, 2020 12:57 pm
Location: Indiana

Decompressing NES Screen Tool map

Post by charlielaw1 » Sat Jun 13, 2020 4:08 pm

Hi everybody. I started following the Nerdy Nights tutorial last fall. I made it through the Pong lessons and was writing my own game along with some of the sample code portions. I got hung up when I couldn't find the advanced tutorial and didn't know how to add scrolling to my game. I found the advanced tutorial last month and have made some progress.

I am using NESASM3, because it was included with the Nerdy Nights tutorials files. From browsing around the forums here, it looks like I'll probably want to move on to NESASM6 at some point, I just haven't yet.

I've created a RLE packed map (32x30 tiles) with NESST, but I can't figure out how to get it decompressed. I know I can use an ".incbin" command in my "background" bank in the place of ".db" statements. I have tried using the same technique with the compressed map, adding an ".incbin" command for the rle.asm from NESST. Including rle.asm changes the tiles loaded in the nametable from what is loaded without including rle.asm, but still does not display the map I created. Although I saved the map with the nametable and attributes, all the tiles in the loaded nametable are a single palette.

I have also tried pasting the code from rle.asm into my game .asm file as a subroutine in place of my background loading code, but I don't get the results I want that way either. This method also results in my game constantly scrolling instead of scrolling based on controller input. Can anyone please tell me what I'm doing wrong or not understanding? Thanks

lidnariq
Posts: 9383
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Decompressing NES Screen Tool map

Post by lidnariq » Sat Jun 13, 2020 4:12 pm

charlielaw1 wrote:
Sat Jun 13, 2020 4:08 pm
adding an ".incbin" command for the rle.asm from NESST.
rle.asm is code; you need to include it as source code (using something like "include", or copying and pasting it as you've tried) instead of including it as a binary ("incBIN"). To upload the contents to the PPU, you should jsr unrle.

Because of how long it'll take to upload a full name table, you must disable rendering (write 0 to $2001) before you start, and you must reset scrolling and re-enable rendering after.

charlielaw1
Posts: 7
Joined: Sat Jun 13, 2020 12:57 pm
Location: Indiana

Re: Decompressing NES Screen Tool map

Post by charlielaw1 » Sun Jun 14, 2020 6:59 am

Aha! Success. I jumped to the unrle subroutine too soon, and forgot to set my pointers to the background data first. Thanks for the help, lidnariq.

sdm2
Posts: 12
Joined: Wed Feb 05, 2020 12:59 pm
Location: Poland

Re: Decompressing NES Screen Tool map

Post by sdm2 » Mon Jun 15, 2020 12:47 am

I have never used NES Screen Tool. An interesting program, but I can't figure out how to write NameTable compressed in RLE. I tried "Selection to the clipboard" and unfortunately nothing is copied to the clipboard (there is also a choice of C code + RLE, but it also doesn't work)

charlielaw1
Posts: 7
Joined: Sat Jun 13, 2020 12:57 pm
Location: Indiana

Re: Decompressing NES Screen Tool map

Post by charlielaw1 » Tue Jun 16, 2020 7:26 am

sdm2 wrote:
Mon Jun 15, 2020 12:47 am
I can't figure out how to write NameTable compressed in RLE. I tried "Selection to the clipboard" and unfortunately nothing is copied to the clipboard (there is also a choice of C code + RLE, but it also doesn't work)
My understanding from browsing the forums here is that to get the RLE compression, you have to make sure "+RLE Compression" is checked under the "Nametable" menu. Then click "All" at the top left menu and select "Save." It will ask you to save your CHR bank, but you can click "Cancel" to skip that if you want. Then it will ask you to save your nametable as binary. Make sure "RLE packed binary (.rle)" is selected in the "Save as type:" pull down menu and save. That's how I did it. I don't think the RLE compression is available at all if you select a nametable size other than standard 32x30 from the Nametable menu.

sdm2
Posts: 12
Joined: Wed Feb 05, 2020 12:59 pm
Location: Poland

Re: Decompressing NES Screen Tool map

Post by sdm2 » Tue Jun 16, 2020 10:44 am

I don't see this option anywhere.


EDIT: I have an older version, I didn't notice a newer version
Attachments
scre.jpg

charlielaw1
Posts: 7
Joined: Sat Jun 13, 2020 12:57 pm
Location: Indiana

Re: Decompressing NES Screen Tool map

Post by charlielaw1 » Thu Jun 18, 2020 9:07 am

Oh. It looks like I have a newer version of Screen Tool, 2.51

Post Reply