Author Topic: Using the ASIC for Pallete and Split Screen  (Read 6519 times)

0 Members and 1 Guest are viewing this topic.

Offline GOB

  • Supporter
  • CPC6128
  • *
  • Posts: 179
  • Country: fr
  • Liked: 179
  • Likes Given: 142
Re: Using the ASIC for Pallete and Split Screen
« Reply #25 on: 14:03, 25 February 14 »
Just Move them or change zoom to 0...

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 242
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 149
  • Likes Given: 316
Re: Using the ASIC for Pallete and Split Screen
« Reply #26 on: 14: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!!
_____

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.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #27 on: 15:03, 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.

« Last Edit: 15:25, 25 February 14 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #28 on: 15:31, 25 February 14 »
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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #29 on: 20:10, 25 February 14 »
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

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 242
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 149
  • Likes Given: 316
Re: Using the ASIC for Pallete and Split Screen
« Reply #30 on: 20: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 ??
_____

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.

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1983
  • Likes Given: 4650
Re: Using the ASIC for Pallete and Split Screen
« Reply #31 on: 21:55, 25 February 14 »
Or it occurs twice? Can't check here.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1983
  • Likes Given: 4650
Re: Using the ASIC for Pallete and Split Screen
« Reply #32 on: 21:58, 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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #33 on: 11:01, 26 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.
« Last Edit: 11:15, 26 February 14 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #34 on: 11:02, 26 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

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1983
  • Likes Given: 4650
Re: Using the ASIC for Pallete and Split Screen
« Reply #35 on: 20:59, 26 February 14 »
Ah, I got your point.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 242
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 149
  • Likes Given: 316
Re: Using the ASIC for Pallete and Split Screen
« Reply #36 on: 09: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 ?
_____

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.

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 614
Re: Using the ASIC for Pallete and Split Screen
« Reply #37 on: 10:12, 28 February 14 »
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 !

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #38 on: 10:55, 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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Using the ASIC for Pallete and Split Screen
« Reply #39 on: 10:56, 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.
« Last Edit: 11:09, 28 February 14 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 242
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 149
  • Likes Given: 316
Re: Using the ASIC for Pallete and Split Screen
« Reply #40 on: 12:19, 28 February 14 »
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
« Last Edit: 00:35, 01 March 14 by fgbrain »
_____

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.