Close

Tile encoder

A project log for Unlimited tile world on a Commodore 64

Unfinished childhood project

lion-mclionheadlion mclionhead 07/14/2024 at 23:390 Comments

The more time gets sucked into this obsession & the more lions desire access to logic signals not possible with emulation, the more enticing a vintage commodore becomes.  The only thing currently produced which has the original logic signals is the EVO 64 & it has a $340 tag.

https://retrospective.shop/evo64-rev1-diy/

The bare board with no IC's is $285.  The problem with this is it surely has bugs because it's a much lower volume.  It doesn't have the RF modulator.  Lions still probably have ancient WinTV PCI boards which could capture RF video but nothing that supports PCI.

There are still commodores in unknown states of disrepair on fleebay for a lot less money.  The mane problem is various IC's are known to have perished & the peripherals are all dead.  They also take a lot more space than the bare board.  The cases could be discarded but lions are loathe to waste anything.  The lion kingdom would have to bodge a keyboard, disk drive, & joystick replacement, probably out of an arduino.

The fleebay offerings show how so much of the internet has become spectators.  There just aren't that many animals into buying retro artifacts.  If they buy the stuff they see on the tube at all, they're never using it.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Switching to bitmap mode increases the tile size to 2500 bytes.  The maximum world size drops to 68 tiles.  Fortunately, the current art can fit in 64 tiles.  The ocean sections would have to be chopped.  To get the maximum scrolling speed in bitmap mode, there aren't enough clockcycles for any significant decompression.  It can only service a serial port interrupt for the disk drive.  It almost needs some form of multitasking.  There could be reuse of tiles but that wouldn't meet the goal of unlimited tile worlds.

There could be RLE decompression on the fly, in the serial port interrupt.  A pure line segment world is coming in under 64 chars.  There could be codes to repeat the last char a certain number of times.  A simplified variable length coding could be a big win, where most commonly used characters have a 4 bit code & less commonly used characters have an 8 bit code.  Because the most repeated characters are also the most commonly used & clockcycles are limited, RLE might be the only useful route.

Character set optimization is a difficult problem.  It has to search all previous characters with all combinations of colors.  If it creates a new character, it has to delete all previous characters which the new character can replace with a color combination.

With RLE encoding, the test world had a theoretical maximum of 380 tiles or 19x19 tiles.  It's pretty low detail though. The largest tile was 652 bytes.  A table of contents pointing to the start of each tile has to go in the mane program.  The tiles have to be padded to multiples of 1 sector to make seeking practical.  Space could be further optimized by packing multiple tiles in a single sector & eating the extra read time.  Without padding, the world grows to 23x23 tiles.

It takes 2 seconds for an unoptimized 1541 to load 652 bytes at 400 bytes/sec.  It's expected to take 5 seconds to scroll 1 tile horizontally & 4 seconds to scroll 1 tile vertically.  It would need a fast loader capable of random sector access if the tiles got more detailed but testing doesn't require it. 

As far as lions know, no 1541 replacement today replicates the head seeking time.  We'll never know if the tile loading would have been fast enough.  In the day, the tiles would have had to be stored in the same relative positions on the disk as the world to minimize head seeking.  Neighboring tiles would need neighboring tracks & sectors.

Discussions