CPCWiki forum

General Category => Programming => Topic started by: arnoldemu on 14:01, 13 October 15

Title: rupture
Post by: arnoldemu on 14:01, 13 October 15
I attempted to explain how the crtc registers work and what rupture is.

I think it's explained elsewhere too, but this document may help.

I'm going to add info about vertical h/w scrolling using R5 to it tomorrow.

Title: Re: rupture
Post by: VincentGR on 17:53, 13 October 15
Thank you.
Title: Re: rupture
Post by: Arnaud on 18:31, 13 October 15
Very interesting, and with a SDCC code sample it will better  :D
Title: Re: rupture
Post by: TFM on 19:30, 13 October 15
No, better ASM examples...I will contribut later. Mean while.... (C is too slow).


There is the sentence:


"When the start of the vertical sync is seen by the monitor it starts the next line. This means border is effectively split between top and bottom of the display."


Shouldn't it tell "page" instead of "line" ?


Title: Re: rupture
Post by: arnoldemu on 19:49, 13 October 15
@TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179): Thank you I will correct that.
Title: Re: rupture
Post by: TFM on 20:10, 13 October 15
My pleasure, great document!!! Thanks a lot!!!  :) :) :)
Title: Re: rupture
Post by: arnoldemu on 13:52, 14 October 15
Another update.

Added:
- changing HSYNC position and why the screen moves left/right
- changing VSYNC position and why the screen moves up/down
- overscan 32KB and what it looks like with hsync/vsync etc.
- smooth vertical R5 scrolling

Title: Re: rupture
Post by: arnoldemu on 18:00, 14 October 15
I'm hoping the diagrams are helping people to understand how the registers work.
Hopefully, some people are going "ah, now I understand".
Title: Re: rupture
Post by: majikeyric on 18:22, 14 October 15
Thanks you very much! It's great!
Title: Re: rupture
Post by: TFM on 19:40, 14 October 15
A question of probably general interest. How soon does a change in R5 get realized?


It's probably not immediately. Is it after the end of every rupture block and after a VSYNC?
Title: Re: rupture
Post by: arnoldemu on 19:47, 14 October 15
Quote from: TFM on 19:40, 14 October 15
A question of probably general interest. How soon does a change in R5 get realized?


It's probably not immediately. Is it after the end of every rupture block and after a VSYNC?
At the end of every rupture block only.

It is added to the end of the block if it's not set to 0.

You can write the register any time before the end of the block.
Title: Re: rupture
Post by: TFM on 20:35, 14 October 15
Cool! Thanks! So the best idea is probably the example you did show, using 3 blocks:

1. One small block
2. R5 change (X)
3. Big block - will be soft scrolled
4. R5 change (8-X)
5. One small block
6. VSYNC
7. start over at 1


Using two blocks makes them probably different, sad that.

Title: Re: rupture
Post by: arnoldemu on 14:52, 12 December 16
At the weekend I wondered when the first cpc game with rupture was made.

I found some interesting things (or maybe re-found) that could explain some things:

ACU, Jan 1988.
ZZKJ has an article about 32K screen. He mentions how to do rupture but I think he has experimented and doesn't fully know what is going on.

"..However, by sending an illegally large value to register 7 for the top frame the 6845 gets confused into omitting frame flyback, which gets rid of this band, and it just joins the top screen into the bottom if you position them correctly...

In a later ACU in july of that year there is an article for rim runner:

"
Although the Amstrad has a hardware scroll, it is useless here because it affects the whole screen. I needed to scroll different areas of the screen by different amounts, so what's the fastest software scroll?
Well, two articles in ACU, one by ZZKJ and one by Justin, suggested two possible approaches.
In his article on 32-row text screens on the Amstrad (January 1988), ZZKJ showed how to fool the 6845 video chip into displaying two separate screens together at once. OK, thought I, let's try giving different hardware offsets to the two screen sections. Then part of the screen will hardware scroll and the rest won't, right?
Wrong. This is one straw too many for the poor 6845, which promptly has a nervous breakdown. I couldn't find any combination of register values which worked consistently on one machine, let alone on different Amstrads. It meant giong back to the drawing board...
Justin's Scroll (June 1987) is the one I used. This employs the Z80 block move instruction to shunt all the screen data along, but uses a whole sequence of single LDI instructions (16 clock cycles per byte shifted) instead of a single LDIR (21 clocks per byte)."

There appear to be only two games that have rupture before 1988:

"Energy Warrior" which is not true rupture, the vsync happens twice.

"Mission Genocide" which is true rupture.

I wonder if the ACU article was the inspiration for people to try it. Does anyone know of any other articles in amstrad magazines that mention the rupture method?




Title: Re: rupture
Post by: roudoudou on 20:25, 12 December 16
...
Title: Re: rupture
Post by: AMSDOS on 01:13, 13 December 16

Quote from: arnoldemu on 14:52, 12 December 16
"Mission Genocide" which is true rupture.


Paul Shirley strikes again!


Quote from: arnoldemu
I wonder if the ACU article was the inspiration for people to try it. Does anyone know of any other articles in amstrad magazines that mention the rupture method?


AA ran a short 5 part series called "Naked Video", it began in AA51 and wrapping up in issue 59, with articles published in Issues 53,54 & 56, but I'm not sure if rupture was covered in that series. The last part in Issue 59 deals with splitting screen modes, but that's different to rupture isn't it?
Title: Re: rupture
Post by: andycadley on 08:16, 13 December 16

Quote from: AMSDOS on 01:13, 13 December 16
AA ran a short 5 part series called "Naked Video", it began in AA51 and wrapping up in issue 59, with articles published in Issues 53,54 & 56, but I'm not sure if rupture was covered in that series. The last part in Issue 59 deals with splitting screen modes, but that's different to rupture isn't it?
No, it's a nice intro to using some simple CRTC/GA effects but doesn't go deep enough to touch upon ideas like rupture splitting. Although weirdly it does have a box out in issue 55 on the interlace and skew register, which is probably the least usable due to how the effect varies between CRTC types (not something it ever mentions either).
Title: Re: rupture
Post by: AMSDOS on 10:01, 15 December 16
Quote from: andycadley on 08:16, 13 December 16
No, it's a nice intro to using some simple CRTC/GA effects but doesn't go deep enough to touch upon ideas like rupture splitting. Although weirdly it does have a box out in issue 55 on the interlace and skew register, which is probably the least usable due to how the effect varies between CRTC types (not something it ever mentions either).


Thanks. I should of realised that the Naked Video started Late '89 and into 1990, so by then more games would of been making use of the rupture effect I presume.
Title: Re: rupture
Post by: arnoldemu on 10:23, 15 December 16
More analysis and there does seem to be some use of rupture in 1987, so I'm wondering if there was something else that pushed it.

The Jan88 issue of ACU would have been available at least 1 month before publication to those who subscribed. So Dec 87.

It seems Firebird used it a lot.

Oh, and looking at some of their games, it seems the code is similar enough that I would say that it was derived.

http://www.cpc-power.com/index.php?page=detail&num=1953

The rupture code is close to Mission Genocide with some tweaks for a different sized panel.
The code is so close in places they either shared the code within Firebird, or they took the code and modified it for themselves.


Title: Re: rupture
Post by: AMSDOS on 11:28, 15 December 16
Quote from: arnoldemu on 10:23, 15 December 16
More analysis and there does seem to be some use of rupture in 1987, so I'm wondering if there was something else that pushed it.

The Jan88 issue of ACU would have been available at least 1 month before publication to those who subscribed. So Dec 87.

It seems Firebird used it a lot.

Oh, and looking at some of their games, it seems the code is similar enough that I would say that it was derived.

http://www.cpc-power.com/index.php?page=detail&num=1953 (http://www.cpc-power.com/index.php?page=detail&num=1953)

The rupture code is close to Mission Genocide with some tweaks for a different sized panel.
The code is so close in places they either shared the code within Firebird, or they took the code and modified it for themselves.


I guess it could be something as a Type-in, Splatch has some Raster effects, all written in Assembly though. Would a Rupture effect have to be coded though Assembly, or could BASIC access of Ports be able to create this effect?
Title: Re: rupture
Post by: AHack on 16:36, 18 March 19
I've implemented a rupture where I have a static section at the top, in the middle I have a scrolling section, and at the bottom I have a static section. This all works well after looking at an example asm file and working out what it all does and how it works.


But from what I have learnt, the very nature of doing overscan seems to remove top and bottom borders because you have to make each rupture add up to 312 lines to keep the timings happy to 50htz. So my question is what is the best way to add the borders back in?
Title: Re: rupture
Post by: Axelay on 02:44, 20 March 19
Hi @AHack (http://www.cpcwiki.eu/forum/index.php?action=profile;u=3051)


There was some discussion on screen splitting and R3 scrolling a while back here (http://www.cpcwiki.eu/forum/programming/horizontal-scrolling-scoreboards-and-crtc-(solved)/).  I don't know if there is a better discussion on it somewhere, but I remember that one because it's where my understanding really came together on screen splitting.


And in case you might be interested, there's also a game I did a while ago with a screen split and R3 scrolling with commented source code available, which you can find here (http://formatwar.net/view_article.php?art=collabortition_1).
Title: Re: rupture
Post by: AHack on 04:37, 20 March 19
Thanks Axelay,


That thread was useful to improve my understanding more.


When I initially tried coding the splits it was working fine for testing. Then I re-adjusted things to get what I wanted for my game idea and then it all went wrong. Then I worked out I needed to do a software delay to get r4 to work correctly on one of the INTS. I did that without really understanding why but that thread hepled bigtime for that.


I've decided to keep the overscan aspect of this technique in for my game for a little sacrifice to memory usage, so no borders top and bottom. My screen (mode 0) is 160 by the height of the monitor.


I have not bothered with interrupts to do this and instead I'm using the Halt way... the reason is because I need to race the beam and interrupts will complicate that. Anyway, all good fun playing around coding the Amstrad again :)
Title: Re: rupture
Post by: Ast on 18:24, 20 March 19
@AHack (http://www.cpcwiki.eu/forum/index.php?action=profile;u=3051)  You could also add http://amstradplus.forumforever.com/t319-Programmez-vos-ruptures-facilement.htm (http://amstradplus.forumforever.com/t319-Programmez-vos-ruptures-facilement.htm) in your bookmark !! This might help you...
Title: Re: rupture
Post by: AHack on 18:31, 20 March 19
Thank you! Another wealth of information. I'm having fun messing around with all this stuff again :)
Title: Re: rupture
Post by: keith56 on 13:04, 12 May 19
Thanks for all the useful information here!

There's also a simple Rupture splitscreen example here on CPC-Live which I don't think anyone's mentioned yet:

http://cpctech.cpc-live.com/source/split.html
Title: Re: rupture
Post by: AHack on 14:07, 12 May 19
Quote from: keith56 on 13:04, 12 May 19
Thanks for all the useful information here!

There's also a simple Rupture splitscreen example here on CPC-Live which I don't think anyone's mentioned yet:

http://cpctech.cpc-live.com/source/split.html (http://cpctech.cpc-live.com/source/split.html)


I used that to get started on ruptures but there are quite a few errors in it. The height of all combined ruptures (CRTC registor 4) should equal to 39 and the code does not do this and the timings are not 50FPS. But the upside is I learnt the fundementals from it so it's a good aid to get going.
Title: Re: rupture
Post by: GOB on 22:53, 18 June 19
The height+1 of combined ruptures should be equal to 39 !!!
Powered by SMFPacks Menu Editor Mod