News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_redbox

Using the ASIC for Pallete and Split Screen

Started by redbox, 01:27, 18 January 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GOB


fgbrain

no, I dont want them to be erased totally.

I just want part of sprite to appear in the main screen and not in the other split screen below!!
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

arnoldemu

#27
Quote from: fgbrain on 13:09, 25 February 14
no, I dont want them to be erased totally.

I just want part of sprite to appear in the main screen and not in the other split screen below!!

setup a raster interrupt to happen at the same line as your screen split.
Now disable the sprites. Either write the mag value that turns them off, OR write a X or Y value that moves them to a position that is not seen (e.g. a previous Y value such as 0 - this would work because your panel is say, at line 200, and you can't display the sprites here if they are at line 0).

Then after the panel, another interrupt to either reset the mag, or to set their correct positions.

Setting mag is faster and easier than setting X or Y position.


I assume your screen split is using plus screen split and not crtc classic split?


if you used a crtc classic split the sprites would automatically repeat in the panel if they were near the top of the main screen, this is because sprite coordinates are computed from crtc values.


This will work and the sprites will appear to be cut by the panel.

EDIT: Attached source for an example that does exactly this.

It shows:
1. screen split
2. sprites cut using mag

You can see how the sprites are cut, and then later you can see them enabled again (this happens because I disable where split is - but this needs to be tweaked to make it accurate and hide in the border for example), and my later int to re-enable them again happens just after the panel at the bottom so you can see it enabling them again.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

another way that could work:

put border between main area and panel.

setup a raster interrupt to happen at end of main screen.
setup standard screen split.

use r1 to set width to 0 - this causes border to appear for a short time.
then re-enable r1 a few lines later for the panel at the bottom.

never move your sprites too far down the screen so that they go past this border.

Sprites are hidden by the border.

it may take less cpu time compared to disabling the sprites using mag.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Example attached which shows the second idea.
You can see how the sprite is cut by the border.

The code is much more simple.

In this example the sprites cover the panel, so in your program you would need to limit them so they don't go this far down.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

fgbrain

thanks for all examples.  :D

I believe I see an ASIC limitation now. If you use ovescan (max 312 lines vertically) screen
the raster interrupt and split screen cannot occur after 255 line (8 bit register), correct ??
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

TFM

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Quote from: fgbrain on 13:09, 25 February 14
no, I dont want them to be erased totally.

I just want part of sprite to appear in the main screen and not in the other split screen below!!


Sprites have a ranking, so one will always overlap the other, depending on their 'number[size=78%]'[/size]
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

#33
Quote from: fgbrain on 19:51, 25 February 14
thanks for all examples.  :D

I believe I see an ASIC limitation now. If you use ovescan (max 312 lines vertically) screen
the raster interrupt and split screen cannot occur after 255 line (8 bit register), correct ??
I have one more example I thought up, but I would have to check it on a real plus.

The idea being to add extra lines with R5. You also put a split here. Now this may or may not work depending on how the CRTC in the Plus performs during this time, it may stop counting, can't remember.
But potentially you could split a sprite using this method, but then also the screen split may not work.

You are correct there is a limit in the screen split. it repeats after line 255. So you must set it to 0 after you are done to ensure it doesn't do this. In the official docs it mentions the extreme case where the repeat happens at line 1 again.


EDIT: The raster interrupt doesn't repeat and it seems like they made an error with the screen split because it too should have been driven off the same comparison mechanism.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: TFM on 20:58, 25 February 14

Sprites have a ranking, so one will always overlap the other, depending on their 'number[size=78%]'[/size]
this *could* be possible to hide a sprite with another of higher ranking. The problem is you can't extend the sprite over the whole width of the screen. Vertically yes you could and hide stuff on the left/right side.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

fgbrain

This is weird..

I am trying to set up a vertical scrolling screen 32x30 char. (I say 30 char. lines because 32x8=256 is impossible I guess)
using ASIC split and soft scroll. The rest of screen is left for a panel.

The problem is that it seems impossible for the second split to remain stable. Although the screen mode changes fine, the soft scroll appears to affect whole screen.

And why do I need an interrupt since I splitted the screen fine using the ASIC registers ?
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

fano

You meant you didn't reset scroll offset after the first screen  ? (the one that scrolls)
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

arnoldemu

Quote from: fgbrain on 08:33, 28 February 14
This is weird..

I am trying to set up a vertical scrolling screen 32x30 char. (I say 30 char. lines because 32x8=256 is impossible I guess)
using ASIC split and soft scroll. The rest of screen is left for a panel.

The problem is that it seems impossible for the second split to remain stable. Although the screen mode changes fine, the soft scroll appears to affect whole screen.

And why do I need an interrupt since I splitted the screen fine using the ASIC registers ?

fano is correct. You need to reset the scroll for the panel.

So you need an interrupt here to set a zero scroll.

EDIT: Internally all the split does is to reload the CRTC R12/R13 registers at the line after the value you program into the split.
It doesn't reset the scroll which acts independent.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

#39
Quote from: fgbrain on 08:33, 28 February 14
This is weird..

I am trying to set up a vertical scrolling screen 32x30 char. (I say 30 char. lines because 32x8=256 is impossible I guess)
using ASIC split and soft scroll. The rest of screen is left for a panel.

The problem is that it seems impossible for the second split to remain stable. Although the screen mode changes fine, the soft scroll appears to affect whole screen.

And why do I need an interrupt since I splitted the screen fine using the ASIC registers ?
Taller is possible, but you must set your split line (e.g. to 32 (256+32)), then set it back to 0 after, otherwise you get the bug.

EDIT: Although setting up a raster interrupt after this point would be part because it doesn't repeat from what I can tell.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

fgbrain

#40
Perhaps I was not clear.. Of course I reset the soft scroll when the panel is displayed. But still it doesnt remain stable...
Maybe it is a synchronization issue ?

EDIT:

I think I did it !! I should check on real hardware now
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

Powered by SMFPacks Menu Editor Mod