Cross blaim laser

By PingPong

Prophet (3521)

Аватар пользователя PingPong

24-04-2020, 03:10

This game have a yellow laser effect that is curious. It does appear made with sprites because it overlaps with background without the usual pattern mode artifacts: no blocky patters and no colour clash. However I do not think it was made with sprites. The laser is very long and exceed the sprite x scanline limit.
The only way I think it is made is by dinamically Redefine a block of tiles by merging the laser with the background and replacing the original ones with the modified ones containing the yellow line of the laser

Anyone have others ideas on how could be made on msx 1?

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By Victor

Champion (475)

Аватар пользователя Victor

24-04-2020, 05:26

PingPong wrote:

The only way I think it is made is by dinamically Redefine a block of tiles by merging the laser with the background and replacing the original ones with the modified ones containing the yellow line of the laser

I've taken a look at the game with openMSX and this is my small opinion:

You're right. Laser is not sprite.

The Pattern Name Table is: 00 to FF, The game redefines all patterns in scroll (in gameplay section of the secreen), for example.

When you shoot a Laser, the game redefine the Pattern Lines with FFh and redefine the colors in these lines.. That's all.

By PingPong

Prophet (3521)

Аватар пользователя PingPong

24-04-2020, 20:00

It is not enough to Redefine the pattern. If you do so other patterns around the screen gets modified with the yellow line. It is also mandatory that patterns modified are used only on the screen region where the laser should be.

By sdsnatcher73

Paladin (936)

Аватар пользователя sdsnatcher73

24-04-2020, 21:56

PingPong wrote:

It is not enough to Redefine the pattern. If you do so other patterns around the screen gets modified with the yellow line. It is also mandatory that patterns modified are used only on the screen region where the laser should be.

Not a programmer on MSX but in theory (as in in my head) the patterns could be changed just before the scanlines the laser should appear and then changed back.

By BitSquad

Expert (84)

Аватар пользователя BitSquad

28-04-2020, 06:41

I haven't programmed on MSX but I've done a lot of raster tricks for NES. I don't think that is it because it moves, pretty consistently, can be fired from different positions on the screen when you jump or duck, and there can be multiple ones on the screen. That kind of mid-line scanline trickery is pretty much unheard of, unless it's considerably more easy on the MSX. If you look at almost any NES game that uses a scanline IRQ for a scrollbar, the timing is pretty much always just a little bit off which causes artifacts. It's possible to fit a scroll change into vBlank, but they apparently didn't have the type of rapid prototyping needed during that period in order to really fine tune the timing. MSX games could probably have been compiled and put right onto the hardware with a floppy disk, so maybe they could have done trickier stuff. These multiple moving lasers though seem to me like a near impossibility to program that way. Maybe MSX allows for easy mid-scanline raster effects, but it seems unlikely that it would be possible to program something this complex with raster effects.

By Manuel

Ascended (16632)

Аватар пользователя Manuel

28-04-2020, 08:46

As msx1 does not have line interrupts, it is indeed very tricky to make raster effects mid screen, as far as I know this is only used in a few demos.

By BitSquad

Expert (84)

Аватар пользователя BitSquad

29-04-2020, 23:12

Without a scanline-based IRQ, you have to actually time out the number of cycles that it takes your code to execute. You have to do things like adding no operation opcodes to shorter branches to make them have equal cycle counts to your longest branch. There have been some geniuses who made some amazing stuff that way. Something that comes to mind is Rad Racer for NES, which had no scanline IRQ. (On NES, the hardware for a scanline based IRQ is in the cartridge itself, so earlier games and some later games don't have that option) Square hired Nasir because he was doing some impressive 3D effects on Apple II, and they promptly put him to work making clones of Sega games. Wink

These effects are always made to happen as close to hBlank as possible. (before I said vBlank but that was a mistake. vBlank is much longer and is between drawing entire screens, while hBlank is a very short blanking interval between scanlines) To have an effect occur in the MIDDLE of a scanline, and then to move consistently each frame, would likely be more difficult than what Nasir did with Rad Racer.

It MIGHT be possible, but that's a big might, and I would be super impressed if it was the case.

By Dolphin101546015

Champion (268)

Аватар пользователя Dolphin101546015

30-04-2020, 00:10

Game not redefine patterns for laser, only colors in a raw:

So let laser have 2 lines height, and you need 32 bytes memory buffer for keep old color values for long fire pressing
(not for every frame, for total!), coz from player pos to edge of screen you have 16 tiles.
And when you jumping, laser disapear from player (with restoring colors in that line),
and appear in new line (with storing new colors (old colors from new laser line) in that already free memory).

But for enemy bullets, game redefine everything:

By Victor

Champion (475)

Аватар пользователя Victor

30-04-2020, 05:07

Dolphin101546015 wrote:

Game not redefine patterns for laser, only colors in a raw:

Do a breakpoint in adress: 77CDh... First it writes in pattern table, then in color table