English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 10 September 2021, 23:41   #181
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
A lot of recent activity here has been about the audio.

Audio is kind of boring sometimes; we like the flashy graphics and colors.
When I return in a week, I'm going to re-focus energies and (perhaps, if there's time) start a YT series about porting Black Tiger to the Amiga.

The big TODOs at this point seem to be:

Graphics/Game
=============
Maps--How Black Tiger's coordinates work in terms of tile placement
Tiles -- Find all positions/placements and configurations (some tiles are 16x8; others are 8x16)
Tiles -- Figure out what is done to cycle the palettes (which colors/etc) in the levels where the tile walls glow (like Level 3)
Sprites (characters)--Encode the animation sequences (as they are in the reversed code) into flowcharts showing frames/decisions/actions. (This is how Black Tiger does it; getting a high-level understanding of each and every move all the characters make is important)
Game logic--When is the player poisioned;and a few other things.There may be hidden events happening. Find all of those and describe them.

The player sprite is straightforward in terms of the animation frames. The clay pots are just positions in a map. (Already been reversed).

There will be things from the arcade game that I won't implement, such as the test screens and the coin/credit handling. I probably (99% sure) I also won't implement the Continue feature. (won't go into "why" yet; but perhaps later when I can wax philosophical for about 6 hours :P)

In terms of the audio, it's closer to being implemented on the Amiga than the graphics are.

TODOs there include seeing how the various YM2203 "emulators" produce sound so we can also do it on the Amiga; some of the multiplication routines were pretty ingenius in the Black Tiger arcade source code. I may be able to use similar techniques to speed up FM synthesis.

Bamboo Tracker plays YM2203 tunes--and it also has full source code I can look at. Additionally, I can simply script all of the BT audio data into MML or some other input format for Bamboo Tracker and see if I have the sounds exactly right. That would be a very important step--to make sure that if I intend to reproduce what Bamboo is doing on the Amiga, that Bamboo actually acurately reproduces all of Black Tiger's sounds.

salmon69 has begun a different approach to sound involving samples. I don't think we'll have the space for that--but it may be necessary in the future. However, seeing the innovative approach others are taking with both graphics and sounds in current projects (like mcgeezer's Kung Fu remaster)... I'm optimistic I could code an efficient YM2203 FM synthesis engine on the Amiga. Hopefully that will leave plenty of system resources (on a .5MB expanded Amiga) to let us code the rest of the game

Anyway, have a great weekend. I'll be here until Sunday and then we're on the road.
chadderack is offline  
Old 10 September 2021, 23:55   #182
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,516
Keep in mind am working thinking Black tiger port target is the A500 with 512k RAM expansion, hence the max size i might use should be 100k probably and am already a bit above
saimon69 is offline  
Old 11 September 2021, 00:10   #183
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
I love Black Tiger (arcade!) and I don't want to sound pessimistic or daunting, but the sound is only one aspect of the game. Probably the one that you would add last when the rest is beginning to work (see McGeezer kungfu master dev process, also what I did with pacman modest remake: first graphics & animations THEN sounds)

mcgeezer also "subcontracted" the sound part (to DjMetune or J.M.D./Saimon69 so it was GREAT) and focused on gameplay/graphics/animations for all of this games.

Amiga port of Ghosts N Goblins also followed that process (proof: there's one leaked preview version without sound at all)

You sound very good in the reverse engineering domain. But this is going to take forever if you don't start coding on the miggy, with sprites/bobs moving, etc..

Just some friendly/non-patronizing advice. I've seen so many projects stopping before they really started. Perfect sound is good but you have to show visuals too...

Last edited by jotd; 11 September 2021 at 00:15.
jotd is offline  
Old 11 September 2021, 00:17   #184
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Quote:
Originally Posted by saimon69 View Post
Keep in mind am working thinking Black tiger port target is the A500 with 512k RAM expansion, hence the max size i might use should be 100k probably and am already a bit above
Sounds good.

Quote:
Originally Posted by jotd View Post
I love Black Tiger (arcade!) and I don't want to sound pessimistic or daunting, but the sound is only one aspect of the game. Probably the one that you would add last when the rest is beginning to work (see McGeezer kungfu master dev process, also what I did with pacman modest remake: first graphics & animations THEN sounds)

Amiga port of Ghosts N Goblins also followed that process (proof: there's one leaked preview version without sound at all)

You sound very good as reverse engineering. But this is going to take forever if you don't start coding on the miggy, with sprites/bobs moving, etc..

Just some friendly/non-patronizing advice. I've seen so many projects stopping before they really started. Perfect sound is good but you have to show visuals too...
Agreed. I'm finding that the audio is mostly figured out. I'm going to be doing some play testing in MAME with the debugger using savestates to figure out some of the trickier stuff. I have savestates starting at the start point of each level; mostly I need savestates involving interactions with each character. Right as you start fighting an orc, for instance, I'd like to create a savestate for that. Anyone wanting to use MAME's savestates for BT, they're in my source project. (I just need to create more).

Getting animations to work is fairly straightforward; I've done that in other projects (not on the Amiga however).

I love Black Tiger too. I'll get stuck in to this a little more properly in about a week. Thank you for the advice and cautionary tales.

I will probably proceed as you suggest though, graphics first then sounds. mcgeezer, you and others have done very well following that approach.
chadderack is offline  
Old 11 September 2021, 00:27   #185
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
I ready your previous post about animations and all. Great findings too.

Do you know if you'll end up using Scorpion Engine, or C/C++ (Bartman Visual Studio) or assembler? or blitz or AMOS or whatever?

If you're targetting A500 you'll have less choices: C/C++ or asm to be sure to get the best framerate.
jotd is offline  
Old 11 September 2021, 00:29   #186
lmimmfn
Registered User
 
Join Date: May 2018
Location: Ireland
Posts: 672
Yeah, ill agree with jotd here, the most important part is the gameplay loop, even if sprites and ledged are boxes and background is empty. Thats the hardest to nail, nice gfx and sound can follow later.
Anyways and most importantly, enjoy the vacation
lmimmfn is offline  
Old 11 September 2021, 00:39   #187
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Quote:
Originally Posted by jotd View Post
I ready your previous post about animations and all. Great findings too.

Do you know if you'll end up using Scorpion Engine, or C/C++ (Bartman Visual Studio) or assembler? or blitz or AMOS or whatever?

If you're targetting A500 you'll have less choices: C/C++ or asm to be sure to get the best framerate.
Probably pure ASM. I like mcgeezer's toolchain and will probably set something up like that, although the integration of Visual Studio Code and Win-UAE seems amazing. I might have to try that as well.

You've convinced me to start the actual coding when I return. So it will be a mix of reversing source and coding--now that I'm fairly certain I can get everything from the arcade game code I need. Thank you!

Quote:
Originally Posted by lmimmfn View Post
Yeah, ill agree with jotd here, the most important part is the gameplay loop, even if sprites and ledged are boxes and background is empty. Thats the hardest to nail, nice gfx and sound can follow later.
Anyways and most importantly, enjoy the vacation
Thanks. Yeah, no game without graphics of course I wanted to make sure I had a good handle on the audio stuff, though, because the music and sounds are amazing.
chadderack is offline  
Old 11 September 2021, 11:40   #188
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
Quote:
You've convinced me to start the actual coding when I return. So it will be a mix of reversing source and coding--now that I'm fairly certain I can get everything from the arcade game code I need. Thank you!
I'm certainly glad I did

I almost completed Pacman in less than 1,5 month now, that was way easier than your project, but I first gathered the graphics and some information (which is available easily, with speeds, timings and all so no need to disassemble), then I started coding the basics (pacman movement, maze detection) then I started the A.I. then read the info again and again for the small details until it was right (with a lot of debugging in between ).

That allows to see the project progress and change activities from coding the A.I to the intro sequences (which need less thinking) and reading the info again... not focusing on one single item at a time until it's 100%.

well that's my method. I wish you good luck, I sucked at that game, but I loved the atmosphere.
jotd is offline  
Old 21 September 2021, 18:15   #189
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
So I'm back... and sort of back in business.

Currently trying to build MAME so I can run it in the Visual Studio debugger. This is so I can discover the scheme that Black Tiger uses for tiles.

Tiles are an interesting animal, because Black Tiger does re-use several tiles, only it will change the palette. The problem is that the encoding is not straightforward--the bytes in the raw "bitmap" data for all the tiles seem to get combined somehow with the palette value .... and I'm not sure how that is accomplished.

What it means is that if I can't work out the scheme, the Amiga port will have to (unnecessarily) duplicate many (if not most) of the tiles, just with the different palettes. Why is this a problem? Because Black Tiger itself only has one copy of each tile on the gfx2 ROM, and that data is 256K by itself.

You can imagine how many tiles might have to be duplicated if I have to create each of those for 16 palettes (max of 256K * 16!!)

So, working out the encoding will need to be done if this is going to be done efficiently.

There's another approach (which I DON'T favor) which would be to figure out only the tiles that are used by each level, and then create a smaller set of data (not 256K * 16) that accommodates each level. It's still a lot of wasted space. A worse approach would be to simply create my own palette for each level and disregard what the game actually looks like.

I've almost got MAME building (with CLANG/LVVM)... just running into a few issues.

I COULD just create a build with the command line--forgetting about the debugger--that would write data to a log, but I'm not sure how MAME handles custom logging.

So... I've got a few options. Just keeping you guys in the loop.
As soon as I have the scheme worked out, I can roll forward.

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

tl;dr: In order to start the Amiga project, I'm going to work on the tile maps first. To do that, I need the bitmap encoding scheme. The only way I can get that relatively painlessly is by running MAME in a debugger.
chadderack is offline  
Old 22 September 2021, 15:38   #190
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
So I'm able to debug MAME in Visual Studio now, and have discovered the raw-data-to-tile mapping scheme. It seems each pixel in each tile is created by combining the 4 bitplanes, none of which seem to be in contiguous memory.

It's pretty convoluted, but I'm trying to make sense of it.

The data for the two topmost bitplanes of every tile are in the first half of the data in the gfx2 rom chip (0x00000 - 0x1ffff) and the data for the two bottommost bitplanes of every tile are in the second half of the data (0x20000-0x3ffff). They seem to be combined in a strange way:

Bitplane 0 (lowest) => lower nybble
Bitplane 1 => upper nybble
Bitplane 2 => lower nybble
Bitplane 3 => upper nybble

and the colors are sorted by priority:

0x0 - 0x1 => 3 (highest)
0x2 - 0x3 => 2
0x4 - 0x5 => 1
0x6 - 0xf => 0

I'll need to run a few experiments to see if I'm getting that right... or just start doing this and maybe this

But I'll get 'er done.
chadderack is offline  
Old 22 September 2021, 17:06   #191
dlfrsilver
CaptainM68K-SPS France
 
dlfrsilver's Avatar
 
Join Date: Dec 2004
Location: Melun nearby Paris/France
Age: 46
Posts: 10,412
Send a message via MSN to dlfrsilver
Quote:
Originally Posted by chadderack View Post
So I'm able to debug MAME in Visual Studio now, and have discovered the raw-data-to-tile mapping scheme. It seems each pixel in each tile is created by combining the 4 bitplanes, none of which seem to be in contiguous memory.

It's pretty convoluted, but I'm trying to make sense of it.

The data for the two topmost bitplanes of every tile are in the first half of the data in the gfx2 rom chip (0x00000 - 0x1ffff) and the data for the two bottommost bitplanes of every tile are in the second half of the data (0x20000-0x3ffff). They seem to be combined in a strange way:

Bitplane 0 (lowest) => lower nybble
Bitplane 1 => upper nybble
Bitplane 2 => lower nybble
Bitplane 3 => upper nybble

and the colors are sorted by priority:

0x0 - 0x1 => 3 (highest)
0x2 - 0x3 => 2
0x4 - 0x5 => 1
0x6 - 0xf => 0

I'll need to run a few experiments to see if I'm getting that right... or just start doing this and maybe this

But I'll get 'er done.
It's a sort of encoding..... and yes, it seems easy through mame, but it's not in fact.....
dlfrsilver is offline  
Old 22 September 2021, 19:48   #192
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Quote:
Originally Posted by dlfrsilver View Post
It's a sort of encoding..... and yes, it seems easy through mame, but it's not in fact.....
Well, let's see if I'm close

Here's a rough example. Let's say that the raw bitmap data for a tile is stored on the ROM gfx2 chip at location 0x1000.

Here's how that is decoded:

Code:
EXAMPLE: RAW BYTES START AT LOCATION 0x1000
16x16 tile decode from bitmap--4 bitplanes

(BITPLANES 0 and 1 are offset by 20000h in the source gfx2 chip)
(each value in the tables represents a byte memory location in the raw tile bitmap)

BITPLANE 0: (PIXELS)

         x POS <=========================================================================================>

    READ:  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7
y           0     1     2     3     4     5     6     7     8     9     A     B     C     D     E     F
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
P     0  |21000|21000|21000|21000|21001|21001|21001|21001|21020|21020|21020|21020|21021|21021|21021|21021|
O        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
S     1  |21002|21002|21002|21002|21003|21003|21003|21003|21022|21022|21022|21022|21023|21023|21023|21023|
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
^     2  |21004|21004|21004|21004|21005|21005|21005|21005|21024|21024|21024|21024|21025|21025|21025|21025|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     3  |21006|21006|21006|21006|21007|21007|21007|21007|21026|21026|21026|21026|21027|21027|21027|21027|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     4  |21008|21008|21008|21008|21009|21009|21009|21009|21028|21028|21028|21028|21029|21029|21029|21029|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     5  |2100A|2100A|2100A|2100A|2100B|2100B|2100B|2100B|2102A|2102A|2102A|2102A|2102B|2102B|2102B|2102B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     6  |2100C|2100C|2100C|2100C|2100D|2100D|2100D|2100D|2102C|2102C|2102C|2102C|2102D|2102D|2102D|2102D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     7  |2100E|2100E|2100E|2100E|2100F|2100F|2100F|2100F|2102E|2102E|2102E|2102E|2102F|2102F|2102F|2102F|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     8  |21010|21010|21010|21010|21011|21011|21011|21011|21030|21030|21030|21030|21031|21031|21031|21031|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     9  |21012|21012|21012|21012|21013|21013|21013|21013|21032|21032|21032|21032|21033|21033|21033|21033|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     A  |21014|21014|21014|21014|21015|21015|21015|21015|21034|21034|21034|21034|21035|21035|21035|21035|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     B  |21016|21016|21016|21016|21017|21017|21017|21017|21036|21036|21036|21036|21037|21037|21037|21037|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     C  |21018|21018|21018|21018|21019|21019|21019|21019|21038|21038|21038|21038|21039|21039|21039|21039|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     D  |2101A|2101A|2101A|2101A|2101B|2101B|2101B|2101B|2103A|2103A|2103A|2103A|2103B|2103B|2103B|2103B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     E  |2101C|2101C|2101C|2101C|2101D|2101D|2101D|2101D|2103C|2103C|2103C|2103C|2103D|2103D|2103D|2103D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     F  |2101E|2101E|2101E|2101E|2101F|2101F|2101F|2101F|2103E|2103E|2103E|2103E|2103F|2103F|2103F|2103F|
V        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|


BITPLANE 1: (PIXELS)

         x POS <=========================================================================================>

    READ:  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3
y           0     1     2     3     4     5     6     7     8     9     A     B     C     D     E     F
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
P     0  |21000|21000|21000|21000|21001|21001|21001|21001|21020|21020|21020|21020|21021|21021|21021|21021|
O        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
S     1  |21002|21002|21002|21002|21003|21003|21003|21003|21022|21022|21022|21022|21023|21023|21023|21023|
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
^     2  |21004|21004|21004|21004|21005|21005|21005|21005|21024|21024|21024|21024|21025|21025|21025|21025|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     3  |21006|21006|21006|21006|21007|21007|21007|21007|21026|21026|21026|21026|21027|21027|21027|21027|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     4  |21008|21008|21008|21008|21009|21009|21009|21009|21028|21028|21028|21028|21029|21029|21029|21029|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     5  |2100A|2100A|2100A|2100A|2100B|2100B|2100B|2100B|2102A|2102A|2102A|2102A|2102B|2102B|2102B|2102B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     6  |2100C|2100C|2100C|2100C|2100D|2100D|2100D|2100D|2102C|2102C|2102C|2102C|2102D|2102D|2102D|2102D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     7  |2100E|2100E|2100E|2100E|2100F|2100F|2100F|2100F|2102E|2102E|2102E|2102E|2102F|2102F|2102F|2102F|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     8  |21010|21010|21010|21010|21011|21011|21011|21011|21030|21030|21030|21030|21031|21031|21031|21031|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     9  |21012|21012|21012|21012|21013|21013|21013|21013|21032|21032|21032|21032|21033|21033|21033|21033|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     A  |21014|21014|21014|21014|21015|21015|21015|21015|21034|21034|21034|21034|21035|21035|21035|21035|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     B  |21016|21016|21016|21016|21017|21017|21017|21017|21036|21036|21036|21036|21037|21037|21037|21037|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     C  |21018|21018|21018|21018|21019|21019|21019|21019|21038|21038|21038|21038|21039|21039|21039|21039|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     D  |2101A|2101A|2101A|2101A|2101B|2101B|2101B|2101B|2103A|2103A|2103A|2103A|2103B|2103B|2103B|2103B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     E  |2101C|2101C|2101C|2101C|2101D|2101D|2101D|2101D|2103C|2103C|2103C|2103C|2103D|2103D|2103D|2103D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     F  |2101E|2101E|2101E|2101E|2101F|2101F|2101F|2101F|2103E|2103E|2103E|2103E|2103F|2103F|2103F|2103F|
V        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|


BITPLANE 2: (PIXELS)

         x POS <=========================================================================================>

    READ:  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7  BIT4  BIT5  BIT6  BIT7
y           0     1     2     3     4     5     6     7     8     9     A     B     C     D     E     F
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
P     0  | 1000| 1000| 1000| 1000| 1001| 1001| 1001| 1001| 1020| 1020| 1020| 1020| 1021| 1021| 1021| 1021|
O        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
S     1  | 1002| 1002| 1002| 1002| 1003| 1003| 1003| 1003| 1022| 1022| 1022| 1022| 1023| 1023| 1023| 1023|
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
^     2  | 1004| 1004| 1004| 1004| 1005| 1005| 1005| 1005| 1024| 1024| 1024| 1024| 1025| 1025| 1025| 1025|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     3  | 1006| 1006| 1006| 1006| 1007| 1007| 1007| 1007| 1026| 1026| 1026| 1026| 1027| 1027| 1027| 1027|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     4  | 1008| 1008| 1008| 1008| 1009| 1009| 1009| 1009| 1028| 1028| 1028| 1028| 1029| 1029| 1029| 1029|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     5  | 100A| 100A| 100A| 100A| 100B| 100B| 100B| 100B| 102A| 102A| 102A| 102A| 102B| 102B| 102B| 102B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     6  | 100C| 100C| 100C| 100C| 100D| 100D| 100D| 100D| 102C| 102C| 102C| 102C| 102D| 102D| 102D| 102D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     7  | 100E| 100E| 100E| 100E| 100F| 100F| 100F| 100F| 102E| 102E| 102E| 102E| 102F| 102F| 102F| 102F|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     8  | 1010| 1010| 1010| 1010| 1011| 1011| 1011| 1011| 1030| 1030| 1030| 1030| 1031| 1031| 1031| 1031|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     9  | 1012| 1012| 1012| 1012| 1013| 1013| 1013| 1013| 1032| 1032| 1032| 1032| 1033| 1033| 1033| 1033|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     A  | 1014| 1014| 1014| 1014| 1015| 1015| 1015| 1015| 1034| 1034| 1034| 1034| 1035| 1035| 1035| 1035|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     B  | 1016| 1016| 1016| 1016| 1017| 1017| 1017| 1017| 1036| 1036| 1036| 1036| 1037| 1037| 1037| 1037|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     C  | 1018| 1018| 1018| 1018| 1019| 1019| 1019| 1019| 1038| 1038| 1038| 1038| 1039| 1039| 1039| 1039|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     D  | 101A| 101A| 101A| 101A| 101B| 101B| 101B| 101B| 103A| 103A| 103A| 103A| 103B| 103B| 103B| 103B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     E  | 101C| 101C| 101C| 101C| 101D| 101D| 101D| 101D| 103C| 103C| 103C| 103C| 103D| 103D| 103D| 103D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     F  | 101E| 101E| 101E| 101E| 101F| 101F| 101F| 101F| 103E| 103E| 103E| 103E| 103F| 103F| 103F| 103F|
V        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|


BITPLANE 3: (PIXELS)

         x POS <=========================================================================================>

    READ:  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3  BIT0  BIT1  BIT2  BIT3
y           0     1     2     3     4     5     6     7     8     9     A     B     C     D     E     F
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
P     0  | 1000| 1000| 1000| 1000| 1001| 1001| 1001| 1001| 1020| 1020| 1020| 1020| 1021| 1021| 1021| 1021|
O        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
S     1  | 1002| 1002| 1002| 1002| 1003| 1003| 1003| 1003| 1022| 1022| 1022| 1022| 1023| 1023| 1023| 1023|
         |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
^     2  | 1004| 1004| 1004| 1004| 1005| 1005| 1005| 1005| 1024| 1024| 1024| 1024| 1025| 1025| 1025| 1025|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     3  | 1006| 1006| 1006| 1006| 1007| 1007| 1007| 1007| 1026| 1026| 1026| 1026| 1027| 1027| 1027| 1027|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     4  | 1008| 1008| 1008| 1008| 1009| 1009| 1009| 1009| 1028| 1028| 1028| 1028| 1029| 1029| 1029| 1029|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     5  | 100A| 100A| 100A| 100A| 100B| 100B| 100B| 100B| 102A| 102A| 102A| 102A| 102B| 102B| 102B| 102B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     6  | 100C| 100C| 100C| 100C| 100D| 100D| 100D| 100D| 102C| 102C| 102C| 102C| 102D| 102D| 102D| 102D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     7  | 100E| 100E| 100E| 100E| 100F| 100F| 100F| 100F| 102E| 102E| 102E| 102E| 102F| 102F| 102F| 102F|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     8  | 1010| 1010| 1010| 1010| 1011| 1011| 1011| 1011| 1030| 1030| 1030| 1030| 1031| 1031| 1031| 1031|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     9  | 1012| 1012| 1012| 1012| 1013| 1013| 1013| 1013| 1032| 1032| 1032| 1032| 1033| 1033| 1033| 1033|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     A  | 1014| 1014| 1014| 1014| 1015| 1015| 1015| 1015| 1034| 1034| 1034| 1034| 1035| 1035| 1035| 1035|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     B  | 1016| 1016| 1016| 1016| 1017| 1017| 1017| 1017| 1036| 1036| 1036| 1036| 1037| 1037| 1037| 1037|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     C  | 1018| 1018| 1018| 1018| 1019| 1019| 1019| 1019| 1038| 1038| 1038| 1038| 1039| 1039| 1039| 1039|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     D  | 101A| 101A| 101A| 101A| 101B| 101B| 101B| 101B| 103A| 103A| 103A| 103A| 103B| 103B| 103B| 103B|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     E  | 101C| 101C| 101C| 101C| 101D| 101D| 101D| 101D| 103C| 103C| 103C| 103C| 103D| 103D| 103D| 103D|
|        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|     F  | 101E| 101E| 101E| 101E| 101F| 101F| 101F| 101F| 103E| 103E| 103E| 103E| 103F| 103F| 103F| 103F|
V        |-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
The tables represent rows and columns of PIXELS, not tiles. This is to translate the pixel data.

The first row of pixels comes from the first two bytes at 0x1000 and the first two bytes at 0x21000. The next row comes from 0x1002 and 0x21002 and so on.

Bitplanes 0 & 2 use the bits in the upper nybble of the source byte; bitplanes 1 & 3 use the bits in the lower nybble of the source byte.

Now some of the colors are marked as transparent... and I haven't quite gotten that figured out. I think the color is ANDed somehow.

But this should be a pretty good start as to understanding where the base bits are for the tile bitmap.
chadderack is offline  
Old 22 September 2021, 21:02   #193
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Tests are good!

So I wanted to see if that scheme worked... and apparently it did.
Here's the example decoding of a tile (tile # 0x011) from the big tile bitmap.
This is it here:



Here's the manual decoding example (you can find this in my notes in source control)

Code:
EXAMPLE TILE: Index 0x011 (of 0x000-0x7ff)

BITPLANES 02/3 (RAW DATA FROM gfx2 chip)

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FA FE 2D F4 AD F4 AD 7C BD 7C BD FC DF FC FF FE
FF FB FF 3D FF 3D FF BD FF BD FF BD FF FF FF FF

=>

converted to rows:
                  BITPLANE 2      BITPLANE 3
FF FF FA FE =>    F  F  F  F      F  F  A  E
FF FF 2D F4 =>    F  F  2  F      F  F  D  4
FF FF AD F4 =>    F  F  A  F      F  F  D  4
FF FF AD 7C =>    F  F  A  7      F  F  D  C
FF FF BD 7C =>    F  F  B  7      F  F  D  C
FF FF BD FC =>    F  F  B  F      F  F  D  C
FF FF DF FC =>    F  F  D  F      F  F  F  C
FF FF FF FE =>    F  F  F  F      F  F  F  E
FF FF FF FB =>    F  F  F  F      F  F  F  B
FF FF FF 3D =>    F  F  F  3      F  F  F  D
FF FF FF 3D =>    F  F  F  3      F  F  F  D
FF FF FF BD =>    F  F  F  B      F  F  F  D
FF FF FF BD =>    F  F  F  B      F  F  F  D
FF FF FF BD =>    F  F  F  B      F  F  F  D
FF FF FF FF =>    F  F  F  F      F  F  F  F
FF FF FF FF =>    F  F  F  F      F  F  F  F

converted to columns

BITPLANE 2        0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  2  F   =>   x    x    x    x    x    x    x    x         x              x    x    x    x
F  F  A  F   =>   x    x    x    x    x    x    x    x         x         x    x    x    x    x
F  F  A  7   =>   x    x    x    x    x    x    x    x         x         x    x    x    x
F  F  B  7   =>   x    x    x    x    x    x    x    x    x    x         x    x    x    x
F  F  B  F   =>   x    x    x    x    x    x    x    x    x    x         x    x    x    x    x
F  F  D  F   =>   x    x    x    x    x    x    x    x    x         x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  3   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  3   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  B   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x         x
F  F  F  B   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x         x
F  F  F  B   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x         x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x


BITPLANE 3        0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
F  F  A  E   =>   x    x    x    x    x    x    x    x         x         x         x    x    x
F  F  D  4   =>   x    x    x    x    x    x    x    x    x         x    x              x
F  F  D  4   =>   x    x    x    x    x    x    x    x    x         x    x              x
F  F  D  C   =>   x    x    x    x    x    x    x    x    x         x    x              x    x
F  F  D  C   =>   x    x    x    x    x    x    x    x    x         x    x              x    x
F  F  D  C   =>   x    x    x    x    x    x    x    x    x         x    x              x    x
F  F  F  C   =>   x    x    x    x    x    x    x    x    x    x    x    x              x    x
F  F  F  E   =>   x    x    x    x    x    x    x    x    x    x    x    x         x    x    x
F  F  F  B   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x         x
F  F  F  D   =>   x    x    x    x    x    x    x    x    x    x    x    x    x         x    x
F  F  F  D   =>   x    x    x    x    x    x    x    x    x    x    x    x    x         x    x
F  F  F  D   =>   x    x    x    x    x    x    x    x    x    x    x    x    x         x    x
F  F  F  D   =>   x    x    x    x    x    x    x    x    x    x    x    x    x         x    x
F  F  F  D   =>   x    x    x    x    x    x    x    x    x    x    x    x    x         x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x



BITPLANES 00/1 (RAW DATA FROM gfx2 chip)
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FA FE F0 F4 F8 F4 F8 F4 F9 F4 F9 FC FD FC FF FE
FF FB FF F1 FF F1 FF F9 FF F9 FF F9 FF FF FF FF

=>

converted to rows:
                  BITPLANE 0      BITPLANE 1
FF FF FA FE =>    F  F  F  F      F  F  A  E
FF FF F0 F4 =>    F  F  F  F      F  F  0  4
FF FF F8 F4 =>    F  F  F  F      F  F  8  4
FF FF F8 F4 =>    F  F  F  F      F  F  8  4
FF FF F9 F4 =>    F  F  F  F      F  F  9  4
FF FF F9 FC =>    F  F  F  F      F  F  9  C
FF FF FD FC =>    F  F  F  F      F  F  D  C
FF FF FF FE =>    F  F  F  F      F  F  F  E
FF FF FF FB =>    F  F  F  F      F  F  F  B
FF FF FF F1 =>    F  F  F  F      F  F  F  1
FF FF FF F1 =>    F  F  F  F      F  F  F  1
FF FF FF F9 =>    F  F  F  F      F  F  F  9
FF FF FF F9 =>    F  F  F  F      F  F  F  9
FF FF FF F9 =>    F  F  F  F      F  F  F  9
FF FF FF FF =>    F  F  F  F      F  F  F  F
FF FF FF FF =>    F  F  F  F      F  F  F  F

converted to columns

BITPLANE 0        0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x


BITPLANE 1        0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
F  F  A  E   =>   x    x    x    x    x    x    x    x         x         x         x    x    x
F  F  0  4   =>   x    x    x    x    x    x    x    x                                  x
F  F  8  4   =>   x    x    x    x    x    x    x    x                   x              x
F  F  8  4   =>   x    x    x    x    x    x    x    x                   x              x
F  F  9  4   =>   x    x    x    x    x    x    x    x    x              x              x
F  F  9  C   =>   x    x    x    x    x    x    x    x    x              x              x    x
F  F  D  C   =>   x    x    x    x    x    x    x    x    x         x    x              x    x
F  F  F  E   =>   x    x    x    x    x    x    x    x    x    x    x    x         x    x    x
F  F  F  B   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x         x 
F  F  F  1   =>   x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  1   =>   x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  9   =>   x    x    x    x    x    x    x    x    x    x    x    x    x              x
F  F  F  9   =>   x    x    x    x    x    x    x    x    x    x    x    x    x              x
F  F  F  9   =>   x    x    x    x    x    x    x    x    x    x    x    x    x              x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
F  F  F  F   =>   x    x    x    x    x    x    x    x    x    x    x    x    x    x    x    x
And the results are these, which you can compare with the tile itself. (I may have flipped a few nybbles accidentally. I did this by hand)
You can see that this is definitely the right tile.

Code:
BITPLANE 0   0 1 2 3 4 5 6 7 8 9 A B C D E F
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x

BITPLANE 1   0 1 2 3 4 5 6 7 8 9 A B C D E F
             x x x x x x x x   x   x   x x x
             x x x x x x x x             x
             x x x x x x x x       x     x
             x x x x x x x x       x     x
             x x x x x x x x x     x     x
             x x x x x x x x x     x     x x
             x x x x x x x x x   x x     x x
             x x x x x x x x x x x x   x x x
             x x x x x x x x x x x x x x   x
             x x x x x x x x x x x x x
             x x x x x x x x x x x x x
             x x x x x x x x x x x x x     x
             x x x x x x x x x x x x x     x
             x x x x x x x x x x x x x     x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x

BITPLANE 2   0 1 2 3 4 5 6 7 8 9 A B C D E F
             x x x x x x x x x x x x x x x x
             x x x x x x x x   x     x x x x
             x x x x x x x x   x   x x x x x
             x x x x x x x x   x   x x x x
             x x x x x x x x x x   x x x x
             x x x x x x x x x x   x x x x x
             x x x x x x x x x   x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x   x
             x x x x x x x x x x x x x x   x
             x x x x x x x x x x x x x x   x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x

BITPLANE 3   0 1 2 3 4 5 6 7 8 9 A B C D E F
             x x x x x x x x   x   x   x x x
             x x x x x x x x x   x x     x
             x x x x x x x x x   x x     x
             x x x x x x x x x   x x     x x
             x x x x x x x x x   x x     x x
             x x x x x x x x x   x x     x x
             x x x x x x x x x x x x     x x
             x x x x x x x x x x x x   x x x
             x x x x x x x x x x x x x x   x
             x x x x x x x x x x x x x   x x
             x x x x x x x x x x x x x   x x
             x x x x x x x x x x x x x   x x
             x x x x x x x x x x x x x   x x
             x x x x x x x x x x x x x   x x
             x x x x x x x x x x x x x x x x
             x x x x x x x x x x x x x x x x


Now all that's really left to do is figure out how transparency masks and palettes work with those... as well as how the bitmaps are combined... and I'll be set.

Certain bitplanes are masked in the background and shown in the foreground. Have to work out all those picky details.

....

I'm going to set up my Amiga toolchain this week sometime and will do a video recording (if there's time) to do a series on YouTube for the port project.
Attached Thumbnails
Click image for larger version

Name:	which_tile.png
Views:	379
Size:	80.2 KB
ID:	73290   Click image for larger version

Name:	example_tile_0x11.png
Views:	373
Size:	7.6 KB
ID:	73291  
chadderack is offline  
Old 22 September 2021, 21:21   #194
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,516
I wonder if, with a smart palette color placement, simply adding or subtracting bitplanes can change colors as you like
saimon69 is offline  
Old 23 September 2021, 13:03   #195
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Ok, turns out I was almost right.

After combining the bit planes into a graphic, it was obvious I had flipped each nybble the wrong way.

After correcting the booboo, this is what we see. (Each bitplane pixel is represented by a digit from that bitplane)



As you can see, there's definitely a scheme here. Looks like bitplanes simply combine to form a color index from the palette. That's something I can work with

Quote:
Originally Posted by saimon69 View Post
I wonder if, with a smart palette color placement, simply adding or subtracting bitplanes can change colors as you like
Interesting question; one I'm sure will come up when implementing the map code. Guess I'll discover the answer. This is sort of what Black Tiger does already--replacing palettes and re-using tiles.

....

Last night I set up a toolchain as suggested by mcgeezer on youtube:
[ Show youtube player ]

It was easy and relatively painless. I'm going to attempt to do a youtube series on this port. It won't mention much about the code reversing process, but it will focus more on the Amiga development.

As mentioned before, I have an Amiga 500 and I just found out that a long time friend has a 2500... so there should be plenty of real test machines for this.
Attached Thumbnails
Click image for larger version

Name:	tile_compare.jpg
Views:	353
Size:	397.5 KB
ID:	73297  

Last edited by chadderack; 23 September 2021 at 13:41.
chadderack is offline  
Old 23 September 2021, 18:42   #196
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
For the benefit for those who "think in code," here's a couple of snippets from a utility console program I just whipped up in C# that decodes the entire tile bitmap and spits it out. I wrote the utility to verify that all tiles are being decoded correctly. You can see the dump of all the tiles for yourself in the source control file "map_tile_notes.txt" under TILE DECODING.

Now, I can just reuse the logic (in the C# code provided) to decode the bitmap directly in the Amiga code.
...

This code contains the logic that shows how to decode the tile bitmap as well as the entire sprite sheet, which also uses 16x16 tiles.

WORKHORSE METHOD
Code:
            var output = new List<string>();
            var sheet = new List<SixteenBySixteenTile>();
            var bytes = new List<byte>();
            var sheetRows = 0x80;
            var sheetColumns = 16;

            var lowerBitplanesOffset = 0x20000;

            foreach (var file in list)
            {
                bytes = File.ReadAllBytes(file).ToList();
            }

            int sourceRowOffset = 0;
            for(int sheetRow = 0; sheetRow < sheetRows; sheetRow++)
            {
                for (int sheetCol = 0; sheetCol < sheetColumns; sheetCol++)
                {
                    var tile = new SixteenBySixteenTile();

                    // Now, we need to iterate over the rows and columns of BITS
                    for(int sourceRowIndex = 0; sourceRowIndex < 0x40; sourceRowIndex += 2)
                    {
                        var pxOffset = sourceRowIndex < 0x20 ? 0 : 0x8;
                        var zeroAndOneByte1 = bytes[lowerBitplanesOffset + sourceRowOffset + sourceRowIndex];
                        var zeroAndOneByte2 = bytes[lowerBitplanesOffset + sourceRowOffset + sourceRowIndex + 1];
                        var twoAndThreeByte1 = bytes[sourceRowIndex + sourceRowOffset];
                        var twoAndThreeByte2 = bytes[sourceRowIndex + sourceRowOffset + 1];

                        //Bitplane 01 - lower nybble
                        uint contribution = 8;
                        tile.AddNybble(sourceRowIndex / 2, 0 + pxOffset, zeroAndOneByte1, 0x1, contribution);
                        tile.AddNybble(sourceRowIndex / 2, 4 + pxOffset, zeroAndOneByte2, 0x1, contribution);

                        //Bitplane 00 - upper nybble
                        contribution /= 2;
                        tile.AddNybble(sourceRowIndex / 2, 0 + pxOffset, zeroAndOneByte1, 0x10, contribution);
                        tile.AddNybble(sourceRowIndex / 2, 4 + pxOffset, zeroAndOneByte2, 0x10, contribution);

                        //Bitplane 03 - lower nybble
                        contribution /= 2;
                        tile.AddNybble(sourceRowIndex / 2, 0 + pxOffset, twoAndThreeByte1, 0x1, contribution);
                        tile.AddNybble(sourceRowIndex / 2, 4 + pxOffset, twoAndThreeByte2, 0x1, contribution);

                        //Bitplane 02 - upper nybble
                        contribution /= 2;
                        tile.AddNybble(sourceRowIndex / 2, 0 + pxOffset, twoAndThreeByte1, 0x10, contribution);
                        tile.AddNybble(sourceRowIndex / 2, 4 + pxOffset, twoAndThreeByte2, 0x10, contribution);
                    }

                    sheet.Add(tile);
                    sourceRowOffset += 0x40;
                }         
            }
And the snippet in the C# class "SixteenBySixteenTile" for adding the nybble
Code:
        public void AddNybble(int rowIndex, int pxOffset, byte val, byte startMask, uint contribution)
        {
            var index = (rowIndex % 16) * 16;
            var pxchange = 0x3;
            for (uint i = startMask; i < startMask*0x10; i*=2, pxchange--)
            {
                if ((val & i) > 0)
                {
                    if (Values.Count <= index + pxOffset + pxchange)
                    {
                        Values[index + pxOffset + pxchange] = contribution;
                    }

                    else Values[index + pxOffset + pxchange] |= contribution;
                }
            }
        }
chadderack is offline  
Old 23 September 2021, 18:44   #197
dlfrsilver
CaptainM68K-SPS France
 
dlfrsilver's Avatar
 
Join Date: Dec 2004
Location: Melun nearby Paris/France
Age: 46
Posts: 10,412
Send a message via MSN to dlfrsilver
excellent. What a job. Let's hope it will open the gates for other games
dlfrsilver is offline  
Old 23 September 2021, 19:55   #198
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Quote:
Originally Posted by dlfrsilver View Post
excellent. What a job. Let's hope it will open the gates for other games
Absolutely

All right, guys. Here we go

Note to admins/mods: Maybe you could split this thread into a new one titled "[port] Black Tiger is coming to the Amiga!" or something. Not sure at which post you'd want to split the thread, but maybe post #48 or this very post. And if you do so please place the thread in the place where such threads go Thank you!

....

Here's my current list for today and beyond. Hope this gets you excited

*****************************************************************************************
* TODOS: *
*****************************************************************************************

Get initial project code set up.
  1. Figure out steps needed
    1. Get starter (boilerplate) code from Photon or mcgeezer's work
  2. Refactor those steps until satisfied
  3. Script a video for just those steps
  4. Record a video of doing the work
  5. Edit video

Amiga Project
  1. Implement Level Map(s)
    1. Load
      1. Include/Add binary with raw tile data directly from arcade source
        1. Potentially RLE encode to save space
    2. Display
      1. Implement tile decoding logic
    3. Scroll (8 way)
      1. Discover scroll "extents" in Black Tiger Arcade source (imaginary box player can move around in before scrolling starts)
chadderack is offline  
Old 25 September 2021, 17:44   #199
chadderack
Registered User
 
chadderack's Avatar
 
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
Happy to report that the Amiga port for Black Tiger is underway!

I have some good boilerplate code compiling / building / running, and things are going well.

I did record an intro video, but am not very happy with it. Might just scrap the whole YouTube idea, since I don't want to spend 5 hours editing a 15 minute video.

Anyway.... hope to have a little surprise by the end of the day
chadderack is offline  
Old 25 September 2021, 18:34   #200
vulture
Registered User
 
Join Date: Oct 2007
Location: Athens , Greece
Posts: 1,840
wow dude! thx for your efforts man!
vulture is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Black Tiger anata project.Maptapper 1 19 September 2013 07:24
Mace vs. Black Tiger Kodoichi Nostalgia & memories 35 13 April 2011 13:32
Black Tiger Uncle Micko support.Games 6 07 October 2007 03:13
Black Tiger NES NfernalNfluence Retrogaming General Discussion 3 08 May 2007 15:48
[Fixed] Black Tiger dev. haynor666 HOL data problems 2 08 July 2003 08:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11322 seconds with 16 queries