01 October 2021, 19:21 | #41 | ||
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Quote:
Quote:
|
||
01 October 2021, 22:24 | #42 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
...continuing reading Georg's scrolling tricks:
BITMAPWIDTH=352 (x=352,y=0) = (x=0,y=1) (MIND=BLOWN) It's simple realizations like that that will help quite a bit |
01 October 2021, 22:44 | #43 | ||
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
Quote:
I heard that but then how do they do plasma effects with smallest width than 8? Quote:
yes, looking at Turrican the A500 seems super powerful but it's because the coders are just mutants. |
||
01 October 2021, 22:45 | #44 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Believe me, I've implemented that algorithm in assembler and it was not easy (at least it wasn't for me anyway).
|
01 October 2021, 22:49 | #45 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
|
01 October 2021, 23:03 | #46 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
|
02 October 2021, 00:56 | #47 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
what about with only 1 bitplane DMA running? (sorry for hijacking the thread but I need to know)
|
02 October 2021, 01:03 | #48 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
|
02 October 2021, 01:24 | #49 | |
Registered User
Join Date: Jun 2020
Location: Brno
Posts: 90
|
Quote:
See diagram. Plasma effects usually combine color changes in copper-list with a clever use of bitmap data (plus various horizontal shifts, changing bitplane pointers to pre-computed gradients in bitmaps per line, etc.) |
|
02 October 2021, 12:33 | #50 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
Another couple of things to consider about Black Tiger....
Level 3 map wraps around in the X, so your scrolling/tiledraw system needs to handle that (as well as your object triggering system) There are also animated tiles (lava in level 4, Entrance/Exit signs for the dungeons amongst others) Most of the sprites appear throughout all the levels with distinct (and quite variable) palettes (eg.. purple orcs, green orcs etc..) |
02 October 2021, 15:05 | #51 | |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Quote:
When reversing the source code I did notice that Level 3 is 64x128 (tiles) unlike the other levels (128x64). Also did remember that the rock tiles are animated to look like they are glowing in level 4 (and IIRC there might be other places in other levels). I assume those tile palettes can be animated via copperlist (with some slots left open). .... Right now I've been implementing a test scroll in the main.asm source. (What follows is probably old hat to most of you, but I just want to see if I'm on the right track). Just to be quick I loaded the entire undecoded tile bitmap data from Black Tiger (gfx2) and decoded the Level 1 map into a 2048x1024 screen buffer. It scrolls, but not properly... basically because I decoded it into a 2048x1024 "bitmap" and set the bitplane pointers directly to that buffer, instead of setting up a separate screen buffer. Once the scroll (horizontal) gets past the first 320 pixels, the bitplane pointers aren't pointing at the correct data. I need to modify the test code to have a separate screen buffer, and then copy the first 352x256 pixels into it (352 to account for "extrawidth"). (I'm uncertain if that's right). When doing this properly, of course, we (you or me or whomever) would probably be using a re-encoded bitmap that is more Amiga friendly in terms of decoding (and palette)... but I just wanted to see part of the Level 1 map on screen. I'll add the screen buffer in my next code update and see if I can't get this working properly. The ScrollingTricks.lha algorithm--when blitting a tile during scroll-- seems to want to grab an already decoded tile from a block tile bitmap... but I don't have that yet. I'm guessing decoding tiles on the fly would be a performance hit. |
|
02 October 2021, 15:14 | #52 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Here's what the scroll looks like right now (as described in the post above)
https://www.dropbox.com/s/pe97ikall1...12-26.mp4?dl=0 |
02 October 2021, 18:13 | #53 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
All right, I guess I'll have to ask this here... since I'm getting stumped.
Consider that I want to copy all the bits from the source screen to the destination screen with a blit. I have 4 bitplanes, 320px wide and 256px high for the screen buffer. One would think you could get it done in a single blit... but apparently that is exactly the size limit of a single blit. For the "h" term of BLTSIZE... h=4*256*64 = $10000, or 65536... too large to fit into the word-size for BLTSIZE. So you figure... two blits? One for the top half of the screen, one for the bottom half? Doing that... I seem to run into an issue where if I blit a second time--even after moving BLTDPTH down by $5000 bytes (halfway down the screen)... what was apparently blitted to the top half of the screen is zeroed (blacked) out. I wouldn't think this would happen, since the BLTDPTH destination pointer changed... but ... here's the naughty/broken code. Probably something obvious I'm missing... Code:
lea DecodedGraphic,a3 lea Screen,a4 move.l a3,d3 move.l a4,d4 move.w #$09F0,BLTCON0(a6) ;use A and D. Op: D = A move.w #$0000,BLTCON1(a6) move.w #$FFFF,BLTAFWM(a6) move.w #$0000,BLTALWM(a6) move.w #0,BLTAMOD(a6) move.w #0,BLTDMOD(a6) move.l d3,BLTAPTH(a6) move.l d4,BLTDPTH(a6) move.w #(h*tile_bitplanes*64)/2,BLTSIZE(a6) ;first half of screen blitted add.l #$5000,d3 ;second half of source add.l #$5000,d4 ;second half of dest move.l d3,BLTAPTH(a6) move.l d4,BLTDPTH(a6) move.w #(h*tile_bitplanes*64)/2+screen_width/16,BLTSIZE(a6) |
02 October 2021, 18:19 | #54 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
02 October 2021, 18:22 | #55 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
|
02 October 2021, 19:07 | #56 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
BTW, thank you ross! (And everyone else so far ) It's fun, and a great challenge so far.
So the reason why you see the "torn-up" looking screen (in my current code) after the screen scrolls 1 tile to the left is that the bitplane pointers have moved 20 columns, or 40 bytes. That would put the bitplane pointer that started out pointing at bitplane 0 to the starting point for bitplane 1. (Or is it 3 and 2?) At any rate (after 20 columns), it goes something like: bplptr0 = bplptr1 bplptr1 = bplptr2 bplptr2 = bplptr3 bplptr3 = bplptr3+40 (or bplptr0 to the next vertical line in the graphic) Of course, none of those bitplanes are going to combine correctly once the pointers are out of sync. After 60 more columns scroll by, though, we get what "looks" like the bitplanes decoded correctly... but they are shifted down by an entire line (one pixel in the Y direction). ... So the problem is I've decoded the tile bitmap to suit a 320x256 screen instead of decoding it in a more natural 256x256x4 format. A 256x256x4 block is $8000--being that each bitplane takes only 32 bytes (16 columns of 16-pixel wide/high tiles)... 2 bytes per column. This divides Black Tiger's maps (except level 3) into 8 BIG tile blocks wide by 4 big tile blocks tall. (For level 3, it's 4 BIG blocks wide, and 8 BIG blocks high). ... To fix the bitplane "ripping" problem described above, I need to fix the decoding so that it arranges the data into chunks of 256x256x4, not 320x256x4... and then fix the pointers when copying the screen (and tiles) from the source bitmap. |
05 October 2021, 01:00 | #57 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Just about to spend the rest of the evening with my fine girlfriend...
...came by to say that I think I've worked out the maths for scrolling in my particular situation. I'll implement this and see what happens. Code:
HORIZONTAL SCROLLING-RIGHT; 4 BITPLANES DEST (SCREEN) BITMAP= 16+320(visible)+16 = 352px SOURCE BITMAP = 2048px SRC: DEST: (BITPLANE PTR OFFSETS) SRC DEST X-POS (PIXELS) ----------------------------------------- ----------------------------------------- PIXELS SCROLLED 1 $B0 $2C $160 $0 2 $10B0 $2EC $960 $160 3 $20B0 $5AC $1160 $2C0 4 $30B0 $86C $1960 $420 5 $40B0 $B2C $2160 $580 6 $50B0 $DEC $2960 $6E0 7 $60B0 $10AC $3160 $840 8 $70B0 $136C $3960 $9A0 9 $80B0 $162C $4160 $B00 A $90B0 $18EC $4960 $C60 B $A0B0 $1BAC $5160 $DC0 C $B0B0 $1E6C $5960 $F20 D $C0B0 $212C $6160 $1080 E $D0B0 $23EC $6960 $11E0 F $E0B0 $26AC $7160 $1340 |
05 October 2021, 03:24 | #58 |
CaptainM68K-SPS France
|
Great job !
|
23 February 2022, 15:04 | #60 |
Registered User
Join Date: Feb 2022
Location: Athens, Greece
Posts: 41
|
Given that in September 1986 Outrun was released, and in 1985 Hang on and Space Harrier was released, the above is an understatement... EDIT: The arcade board of Black Tiger used ...two Z80 CPUs (According to this: http://www.thepixelpump.com/blacktiger/specs.php). Yeap, a game with two Z80 CPUs used 1024 colors on screen and was much better than what the Amiga was doing at the time!!! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
F-18 interceptor alternating between 5 and 4 bitplanes | Rotareneg | Coders. General | 14 | 23 August 2020 22:45 |
bitplanes format | jarre | Coders. General | 3 | 19 January 2019 17:38 |
ECS EHB Vs AGA 6 bitplanes | redblade | Coders. Asm / Hardware | 1 | 08 November 2018 00:41 |
Using the Copper to mangle the bitplanes. | Andy_C | Coders. General | 7 | 16 March 2011 12:58 |
How to put the mask bitplane behind the other bitplanes?? | method | project.Sprites | 6 | 15 February 2006 02:53 |
|
|