CPCWiki forum

General Category => Games => Topic started by: rexbeng on 17:11, 12 October 20

Title: CORSAIR_Trainer
Post by: rexbeng on 17:11, 12 October 20
Hello folks!
Here (https://www.assembly.org/online20/gamedev-compo-entries-are-published) you can find the new game by Bitplane Technomantes, which is released at Assembly Online 2020 as part of the Gamedev Competition, as well as the other games participating in the compo. As stated, the compo is to be screened Wednesday at 20:30 CET.
The game is an arcade vertical shooter which you may play on a pure 64k Amstrad. The link in the Assembly page features a dsk image, but a tap is to be released in the following days.
Code Axelay, graphics rexbeng, music&fx McKlain.

Enjoy!
Title: Re: CORSAIR_Trainer
Post by: XeNoMoRPH on 19:42, 12 October 20
Very nice game !!, i like it !!!

https://youtu.be/kDHpCKfYk6E
Title: Re: CORSAIR_Trainer
Post by: villain on 19:52, 12 October 20
Sorry guys, but you forgot to implement the easy-mode!  8)

Three levels are more than enough for me... Awesome scrolling, btw.
Title: Re: CORSAIR_Trainer
Post by: DanyPPC on 07:07, 13 October 20
Great game !
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 07:32, 13 October 20
Oh wow this looks awesome from the vid! Must play it tonight...

Also, such a great job on the logo/title!!!
Title: Re: CORSAIR_Trainer
Post by: kawickboy on 08:06, 13 October 20
Amazing scrolling indeed.
Title: Re: CORSAIR_Trainer
Post by: trocoloco on 09:38, 13 October 20
It looks silky smooth, great in every department and even playable in 64k machines. Hats off to Axelay, Rexbeng and McKlain.
Title: Re: CORSAIR_Trainer
Post by: Carnivius on 10:04, 13 October 20
Very cool. Just had a play of it and yep very smooth!  Looking forward to the full game. :)
And that's a dream team combo of CPC talent, Axelay, rexbeng and McKlain.  All top tier quality creators. :)
Title: Re: CORSAIR_Trainer
Post by: TotO on 10:17, 13 October 20
Great sound and graphics. Nice 50Hz vertical scrolling with sprites moving at pixel accuracy. Sure, we are in 2020 !!!  8)
Now, the trainer content is so empty... Nice for a contest, but I really hope because unfinished and not because 64K only.

GOOD LUCK!
Title: Re: CORSAIR_Trainer
Post by: ervin on 11:36, 13 October 20
Holy cow that's impressive!!!
It is indeed a dream team of CPC talent - these people are amazing!
Title: Re: CORSAIR_Trainer
Post by: TomEtJerry on 07:19, 14 October 20
Oh oh oh ! Another stumbling game from Axelay ! 2020 is not a lost year for CPC after all :-).

As usual, everything is very polished and the game is... hard.

Some wishes for the final version :

- smart bombs
- specific sound jingle or little animation when you destroy a full wave of flying vessels (to motivate the corsair :-) ).
- pause mode

Ingame music is really nice (two voices !).
Title: Re: CORSAIR_Trainer
Post by: rexbeng on 11:25, 15 October 20
Thanks for the comments and feedback!
The game is posted at pouet (https://www.pouet.net/prod.php?which=87065).
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 11:29, 15 October 20
Damn it's been on my mind to play this but still haven't got the time, aaaaargh!!!
Title: Re: CORSAIR_Trainer
Post by: Axelay on 14:24, 15 October 20
Thanks for the comments!


Here is the tape image of the 64k version.
Title: Re: CORSAIR_Trainer
Post by: GUNHED on 14:27, 15 October 20
Nice little game. Thanks for sharing!  :)
Title: Re: CORSAIR_Trainer
Post by: shaymanjohn on 14:48, 15 October 20
Quote from: Axelay on 14:24, 15 October 20
Thanks for the comments!


Here is the tape image of the 64k version.


Hi Axelay, will you be releasing the source code for this? Once I've finished off atic-atac I'm thinking about having a go at a vertical scroller, or at least doing a small demo to see how it all works - would like to understand how the smooth scrolling / rupture thing works (anybody ever done a commando style game with this technique on the cpc?)


No worries if you're not planning to release it though - question for the group, is there a good working example of this kind of technique (something that builds and lets me play about with things) - I've found various discussions, but nothing that seems like a good starter project...


Lovely game by the way (as usual!)

Title: Re: CORSAIR_Trainer
Post by: GUNHED on 15:34, 15 October 20
Smooth scrolling on CPC is simple, there are lots of examples at inofficial Amstrad ressources. Google it.
Title: Re: CORSAIR_Trainer
Post by: trocoloco on 09:11, 16 October 20
Quote from: shaymanjohn on 14:48, 15 October 20I'm thinking about having a go at a vertical scroller, or at least doing a small demo to see how it all works - would like to understand how the smooth scrolling / rupture thing works (anybody ever done a commando style game with twww.cpcwiki.euhis technique on the cpc?)

Hi @shaymanjohn (https://www.cpcwiki.eu/forum/index.php?action=profile;u=996) firstable, congrats for the nice conversion of atic-atac :) . Check this thread, it has a many example codes of vertical hardware scrolling including the mission genocide routine.   https://www.cpcwiki.eu/forum/games/uridium-on-the-cpc-with-hardwarescrolling/ (https://www.cpcwiki.eu/forum/games/uridium-on-the-cpc-with-hardwarescrolling/)

Hope this helps.
Title: Re: CORSAIR_Trainer
Post by: shaymanjohn on 09:15, 16 October 20
Quote from: trocoloco on 09:11, 16 October 20
Hi @shaymanjohn (https://www.cpcwiki.eu/forum/index.php?action=profile;u=996) firstable, congrats for the nice conversion of atic-atac :) . Check this thread, it has a many example codes of vertical hardware scrolling including the mission genocide routine.   https://www.cpcwiki.eu/forum/games/uridium-on-the-cpc-with-hardwarescrolling/ (https://www.cpcwiki.eu/forum/games/uridium-on-the-cpc-with-hardwarescrolling/)

Hope this helps.


Thanks for this - much appreciated!
Title: Re: CORSAIR_Trainer
Post by: Axelay on 15:33, 16 October 20

Quote from: shaymanjohn on 14:48, 15 October 20Hi Axelay, will you be releasing the source code for this? Once I've finished off atic-atac I'm thinking about having a go at a vertical scroller, or at least doing a small demo to see how it all works - would like to understand how the smooth scrolling / rupture thing works (anybody ever done a commando style game with this technique on the cpc?)


That's not something I usually do unless it's a competition that requires it, sorry.  There is the source to Dragon Attack included with the game download here  (http://cpcretrodev.byterealms.com/2016/11/cpcretrodev-2016-results-and-games/)which would have some similarities in a few aspects, but it doesn't scroll.  Technically, I did post the prototype scroll code for Corsair a little while ago here (https://www.cpcwiki.eu/forum/programming/horizontal-scrolling-scoreboards-and-crtc-(solved)/msg21687/#msg21687).  But I'd be surprised if that contained anything you didn't learn from those examples by arnoldemu.
Title: Re: CORSAIR_Trainer
Post by: shaymanjohn on 15:46, 16 October 20
Hey, no worries at all.


Looks like the link to the corsair prototype is broken (well, links to eBay).


Will take a look at the other link, thanks for that  :)
Title: Re: CORSAIR_Trainer
Post by: Axelay on 02:18, 17 October 20
Quote from: shaymanjohn on 15:46, 16 October 20Looks like the link to the corsair prototype is broken (well, links to eBay).
Weird.  Didn't even visit ebay to get a link from, and it was linking to the cpcwiki page on kc compact just then.  I've set that link correctly now, but I'm pretty sure it was correct the first time I set it up.  Seems like something odd happened to it.
Title: Re: CORSAIR_Trainer
Post by: sigh on 20:00, 17 October 20
Man...this game is hard!

I own Radiant Silvergun, Battle Garegga on my Sega Saturn and Ketsui and Esp.Rade on my PS3 and PS4. All of these are tricky games and Corsair Trainer has now joined them in the difficulty ranks :D .
Congrats to the team for producing an excellent game. Wonderful coding by Axelay as usual. Rexbeng - wonderful job on the artwork and McKlain's solid sound engineering completes this package.
Well done!

Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 00:19, 19 October 20
Quote from: Axelay on 15:33, 16 October 20

That's not something I usually do unless it's a competition that requires it, sorry.  There is the source to Dragon Attack included with the game download here  (http://cpcretrodev.byterealms.com/2016/11/cpcretrodev-2016-results-and-games/)which would have some similarities in a few aspects, but it doesn't scroll.  Technically, I did post the prototype scroll code for Corsair a little while ago here (https://www.cpcwiki.eu/forum/programming/horizontal-scrolling-scoreboards-and-crtc-(solved)/msg21687/#msg21687).  But I'd be surprised if that contained anything you didn't learn from those examples by arnoldemu.
For some reason your link keeps changing to crap sites? However i managed to get your link working from my mobile when i tried it.
The code and guide arnoldemu provided and additionally your code have provided is a holy grail for the CPC i have been looking for for the past 2 years( this code for me is beautiful ).
I can program the Z80( maybe not great :) ) but i always considered it a waste of time if scrolling had to be performed on the z80 vs Hardware.


Do you think it would be possible to update your code to hide the redraw at the top of the screen? I want to try my hand at an arcade game, im ok with Z80 code,i would just like a routine that works. The mode 2 proposal with colour change where both colours are the same seems like a good fix but can it be interrupt driven or does it need specific timing( which sux :) )


I started programming on the CPC as a kid ~ age 10 and it is the machine which made me choose that i want to be a professional software developer, and that worked out :)


However i really want to create a game on the CPC, ive really been held back by trying to get HW stuff working on the CPC( i have a nice horizontal scroll routine working with tiles but i have no interest in a horizontal scrolling game at the moment simply because i have a passion for a vertical scroller), 2-3 years ago i wanted to work on a vertical shooter for the CPC and started learning Z80 programming etc and tutorials( ive done 68000 and 8086 assembly in the past ), however this is the first time ive seen decent code for a HW vertical scroll on the CPC, this is sublime and has me really excited :) ).

Also i really would appreciate if @Gryzor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1) can sticky the Info on vertical( and horizontal ) scroll assembly info, ive been looking for this for years and it really is a shame that its been hidden in threads.


My view on the CPC is that all HW scrolling examples should be easily available so the focus can be on the game rather than most of the crap software scrolling we had slowing down games.


It is really weird, for the Amiga( my second machine ) most of the optimization info/tricks are freely available but not in the CPC world?


@Axelay (https://www.cpcwiki.eu/forum/index.php?action=profile;u=84) - if i share a prototype of my impl, do you think you could help me sort out the vertical redraw at the top?


I really love the CPC and really want to do something good on it.
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 07:31, 19 October 20
Quote from: lmimmfn on 00:19, 19 October 20Also i really would appreciate if @Gryzor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1) can sticky the Info on vertical( and horizontal ) scroll assembly info, ive been looking for this for years and it really is a shame that its been hidden in threads.

Which page are you referring to?
Title: Re: CORSAIR_Trainer
Post by: Axelay on 14:24, 19 October 20
Quote from: sigh on 20:00, 17 October 20
Man...this game is hard!

I own Radiant Silvergun, Battle Garegga on my Sega Saturn and Ketsui and Esp.Rade on my PS3 and PS4. All of these are tricky games and Corsair Trainer has now joined them in the difficulty ranks :D .
Congrats to the team for producing an excellent game. Wonderful coding by Axelay as usual. Rexbeng - wonderful job on the artwork and McKlain's solid sound engineering completes this package.
Well done!


Can't say I had those games in mind when I was thinking of the difficulty, but thanks for the comparison.  :)


Quote from: lmimmfn on 00:19, 19 October 20Do you think it would be possible to update your code to hide the redraw at the top of the screen? I want to try my hand at an arcade game, im ok with Z80 code,i would just like a routine that works. The mode 2 proposal with colour change where both colours are the same seems like a good fix but can it be interrupt driven or does it need specific timing( which sux :) )



Here you go.  Bear in mind this is that old prototype with the screen movement at the top hidden.  No update of the comments, nor updating with whatever changes I might have subsequently made to the current code base for Corsair.  It waits during the first interrupt for quite some time to show the highest possible line of the screen.  If you don't want to find stable code to put there in the interrupt and not waste cpu time, you can remove the delay and move the second mode/colour change to the second interrupt, but you'll lose 2 characters from the top of the screen.





org &4000
nolist
run start


start:
;; standard screen is 39 chars tall and vsync at 30
;; with 25 chars displayed
;;
;; we want to change this to 26 chars displayed with vsync at 31
;;
;; Char Lines to end of screen: 39-31 = 8
;; Scan Lines to end of screen: 8*8 = 64
;; Interrupt occurs two lines after VSYNC, so lines until end of screen when interrupt occurs: 64-2 = 62
;;
;; If we then wait for one interrupt, we will be 10 (62-52 = 10) lines into the next screen.
;;
;; Then interrupts are:
;; 10, 62, 114, 166, 218
;;
;; And we will then be 10 lines into second screen.




di
ld bc,&7f10
out (c),c
ld bc,&7f54
out (c),c


; narrow the screen
ld bc,&bc01
out (c),c
ld bc,&bd00+32
out (c),c
; and centre it
ld bc,&bc02
out (c),c
ld bc,&bd00+42
out (c),c




;; set new vsync we want
ld bc,&bc07
out (c),c
ld bc,&bd00+31+4
out (c),c


;; wait for 2 vsyncs to allow it to stabalise and so that we can sync with that
ld e,2
wait_two_vsyncs:
ld b,&f5
wait_vsync_end:
in a,(c)
rra
jr c,wait_vsync_end
wait_vsync_start:
in a,(c)
rra
jr nc,wait_vsync_start
dec e
jp nz,wait_two_vsyncs


;; synchronised with start of vsync and we are synchronised with CRTC too, and we have the
;; same number of lines to next screen as we want.


;; set initial interrupt routine
ld hl,int_rout1
ld (int_rout_ptr+1),hl


;; set interrupt
ld a,&c3
ld hl,int_start
ld (&0038),a
ld (&0039),hl
;; enable
ei


main_loop:
ld b,&f5
vsync:
in a,(c)
rra
jr nc,vsync


halt


halt


call scroll_down


jp main_loop


;;---------


int_start:
push bc
push hl
push af
int_rout_ptr:
jp int_rout1




;;---------
;; first interrupt after vsync
int_rout1:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f4b
;;out (c),c


;; set vsync position to turn it off
ld bc,&bc07
out (c),c
ld bc,&bdff
out (c),c


;; screen address for main part of screen
;; will not trigger until screen restarts
ld hl,(scroll_offset)
ld a,&30
or a,h
ld bc,&bc0c
out (c),c
inc b
out (c),a
ld bc,&bc0d
out (c),c
inc b
out (c),l


;; set height of main part of screen
;; since we are already past the end of the previous screen
;; this will take no effect.
ld bc,&bc06
out (c),c
ld bc,&bd00+25+4
out (c),c


ld bc,&bc05         ;; select vertical adjust register of CRTC
out (c),c
inc b
ld a,(scroll_fine_next)
out (c),a
ld (scroll_fine),a


; mask movement of screen top
;set mode 2
  ld bc,&7F8e
  out (c),c
; set colours to border
  ld bc,&7f00
  out (c),c
  ld a,&54
  out (c),a ; background to match border
  inc c
  out (c),c
  out (c),a ; ink 1 to match border


; wait until at lowest point of screen top
  ld b,246
.int1delaylp
  defs 5 ; some nops
  djnz int1delaylp
;set mode 1
  ld bc,&7F8d
  out (c),c
; set colours to standard mode 1
  ld bc,&7f00
  out (c),c
  ld a,&44
  out (c),a ; background to dark blue
  inc c
  out (c),c
  ld a,&4a
  out (c),a ; ink 1 to yellow


ld hl,int_rout2
jp int_end


;;---------
int_rout2:
;; 10 lines until end of screen
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f43
;;out (c),c


ld hl,int_rout3
jp int_end


;;---------
int_rout3:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f42
;;out (c),c


;; now at line 42.
ld bc,&bc04
out (c),c
ld bc,&bd00+25-1+4-1 ; less 1 because of R5 offset
out (c),c




ld hl,int_rout4
jp int_end


;;---------
int_rout4:


;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f40
;;out (c),c




ld hl,int_rout5
jp int_end


;;---------
int_rout5:


;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f49
;;out (c),c




ld bc,&bc0c
out (c),c
ld bc,&bd00+&18
out (c),c
ld bc,&bc0d
out (c),c
ld bc,&bd00
out (c),c


ld bc,&bc05         ;; select vertical adjust register of CRTC
out (c),c
inc b
ld a,(scroll_fine)
xor a,7
inc a
out (c),a


ld hl,int_rout6
jp int_end


;;---------
int_rout6:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f53
;;out (c),c


;; 2 lines before end of screen


;; 128 cycles
ld b,42-1 ; need one less after addition of push af
int_delay:
djnz int_delay


;; set display height of screen
ld bc,&bc06
out (c),c
ld bc,&bd00+1+3
out (c),c


;; set height of screen
ld bc,&bc04
out (c),c
ld bc,&bd00+14-1-4
out (c),c


;; set vsync position
ld bc,&bc07
out (c),c
ld bc,&bd00+6
out (c),c


ld hl,int_rout1
jp int_end


int_end:
ld (int_rout_ptr+1),hl
pop af
pop hl
pop bc
ei
ret


;;end start


.scroll_down
;; check fine value first
    ld a,(scroll_fine_next)
    inc a
    and 7
    ld (scroll_fine_next),a
    or a
    ret nz


;; get the current scroll offset
    ld hl,(scroll_offset)
    ld bc,32
    or a
    sbc hl,bc


;; ensure scroll offset is in range &000-&3ff
    ld a,h
    and &3
    ld h,a


;; store new scroll offset. It is now ready to be written to the CRTC.
    ld (scroll_offset),hl
    ret


;; the scroll offset in CRTC character units
.scroll_offset
    defw 0
;; offset for fine scroll
.scroll_fine
    defb 0
.scroll_fine_next
    defb 0
Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 20:32, 19 October 20
Quote from: Gryzor on 07:31, 19 October 20
Which page are you referring to?
Ignore this
Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 20:38, 19 October 20
Thanks very much Axelay, will give it a whirl tonight.


@Gryzor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1), ignore my previous post, can you Sticky Axelays vertical scrolling routine above in the programming section?
Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 00:12, 20 October 20
Quote from: Axelay on 14:24, 19 October 20

Can't say I had those games in mind when I was thinking of the difficulty, but thanks for the comparison.  :)




Here you go.  Bear in mind this is that old prototype with the screen movement at the top hidden.  No update of the comments, nor updating with whatever changes I might have subsequently made to the current code base for Corsair.  It waits during the first interrupt for quite some time to show the highest possible line of the screen.  If you don't want to find stable code to put there in the interrupt and not waste cpu time, you can remove the delay and move the second mode/colour change to the second interrupt, but you'll lose 2 characters from the top of the screen.





org &4000
nolist
run start


start:
;; standard screen is 39 chars tall and vsync at 30
;; with 25 chars displayed
;;
;; we want to change this to 26 chars displayed with vsync at 31
;;
;; Char Lines to end of screen: 39-31 = 8
;; Scan Lines to end of screen: 8*8 = 64
;; Interrupt occurs two lines after VSYNC, so lines until end of screen when interrupt occurs: 64-2 = 62
;;
;; If we then wait for one interrupt, we will be 10 (62-52 = 10) lines into the next screen.
;;
;; Then interrupts are:
;; 10, 62, 114, 166, 218
;;
;; And we will then be 10 lines into second screen.




di
ld bc,&7f10
out (c),c
ld bc,&7f54
out (c),c


; narrow the screen
ld bc,&bc01
out (c),c
ld bc,&bd00+32
out (c),c
; and centre it
ld bc,&bc02
out (c),c
ld bc,&bd00+42
out (c),c




;; set new vsync we want
ld bc,&bc07
out (c),c
ld bc,&bd00+31+4
out (c),c


;; wait for 2 vsyncs to allow it to stabalise and so that we can sync with that
ld e,2
wait_two_vsyncs:
ld b,&f5
wait_vsync_end:
in a,(c)
rra
jr c,wait_vsync_end
wait_vsync_start:
in a,(c)
rra
jr nc,wait_vsync_start
dec e
jp nz,wait_two_vsyncs


;; synchronised with start of vsync and we are synchronised with CRTC too, and we have the
;; same number of lines to next screen as we want.


;; set initial interrupt routine
ld hl,int_rout1
ld (int_rout_ptr+1),hl


;; set interrupt
ld a,&c3
ld hl,int_start
ld (&0038),a
ld (&0039),hl
;; enable
ei


main_loop:
ld b,&f5
vsync:
in a,(c)
rra
jr nc,vsync


halt


halt


call scroll_down


jp main_loop


;;---------


int_start:
push bc
push hl
push af
int_rout_ptr:
jp int_rout1




;;---------
;; first interrupt after vsync
int_rout1:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f4b
;;out (c),c


;; set vsync position to turn it off
ld bc,&bc07
out (c),c
ld bc,&bdff
out (c),c


;; screen address for main part of screen
;; will not trigger until screen restarts
ld hl,(scroll_offset)
ld a,&30
or a,h
ld bc,&bc0c
out (c),c
inc b
out (c),a
ld bc,&bc0d
out (c),c
inc b
out (c),l


;; set height of main part of screen
;; since we are already past the end of the previous screen
;; this will take no effect.
ld bc,&bc06
out (c),c
ld bc,&bd00+25+4
out (c),c


ld bc,&bc05         ;; select vertical adjust register of CRTC
out (c),c
inc b
ld a,(scroll_fine_next)
out (c),a
ld (scroll_fine),a


; mask movement of screen top
;set mode 2
  ld bc,&7F8e
  out (c),c
; set colours to border
  ld bc,&7f00
  out (c),c
  ld a,&54
  out (c),a ; background to match border
  inc c
  out (c),c
  out (c),a ; ink 1 to match border


; wait until at lowest point of screen top
  ld b,246
.int1delaylp
  defs 5 ; some nops
  djnz int1delaylp
;set mode 1
  ld bc,&7F8d
  out (c),c
; set colours to standard mode 1
  ld bc,&7f00
  out (c),c
  ld a,&44
  out (c),a ; background to dark blue
  inc c
  out (c),c
  ld a,&4a
  out (c),a ; ink 1 to yellow


ld hl,int_rout2
jp int_end


;;---------
int_rout2:
;; 10 lines until end of screen
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f43
;;out (c),c


ld hl,int_rout3
jp int_end


;;---------
int_rout3:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f42
;;out (c),c


;; now at line 42.
ld bc,&bc04
out (c),c
ld bc,&bd00+25-1+4-1 ; less 1 because of R5 offset
out (c),c




ld hl,int_rout4
jp int_end


;;---------
int_rout4:


;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f40
;;out (c),c




ld hl,int_rout5
jp int_end


;;---------
int_rout5:


;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f49
;;out (c),c




ld bc,&bc0c
out (c),c
ld bc,&bd00+&18
out (c),c
ld bc,&bc0d
out (c),c
ld bc,&bd00
out (c),c


ld bc,&bc05         ;; select vertical adjust register of CRTC
out (c),c
inc b
ld a,(scroll_fine)
xor a,7
inc a
out (c),a


ld hl,int_rout6
jp int_end


;;---------
int_rout6:
;;ld bc,&7f10
;;out (c),c
;;ld bc,&7f53
;;out (c),c


;; 2 lines before end of screen


;; 128 cycles
ld b,42-1 ; need one less after addition of push af
int_delay:
djnz int_delay


;; set display height of screen
ld bc,&bc06
out (c),c
ld bc,&bd00+1+3
out (c),c


;; set height of screen
ld bc,&bc04
out (c),c
ld bc,&bd00+14-1-4
out (c),c


;; set vsync position
ld bc,&bc07
out (c),c
ld bc,&bd00+6
out (c),c


ld hl,int_rout1
jp int_end


int_end:
ld (int_rout_ptr+1),hl
pop af
pop hl
pop bc
ei
ret


;;end start


.scroll_down
;; check fine value first
    ld a,(scroll_fine_next)
    inc a
    and 7
    ld (scroll_fine_next),a
    or a
    ret nz


;; get the current scroll offset
    ld hl,(scroll_offset)
    ld bc,32
    or a
    sbc hl,bc


;; ensure scroll offset is in range &000-&3ff
    ld a,h
    and &3
    ld h,a


;; store new scroll offset. It is now ready to be written to the CRTC.
    ld (scroll_offset),hl
    ret


;; the scroll offset in CRTC character units
.scroll_offset
    defw 0
;; offset for fine scroll
.scroll_fine
    defb 0
.scroll_fine_next
    defb 0

This is beautiful, thank you so much.
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 07:28, 20 October 20
Quote from: lmimmfn on 20:38, 19 October 20
Thanks very much Axelay, will give it a whirl tonight.


@Gryzor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1), ignore my previous post, can you Sticky Axelays vertical scrolling routine above in the programming section?

It must be a separate post to be pinned, I can't just take a text snippet... Feel free anyone to create a new post in that forum and notify me to pin it :)
Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 19:30, 20 October 20
Quote from: Gryzor on 07:28, 20 October 20
It must be a separate post to be pinned, I can't just take a text snippet... Feel free anyone to create a new post in that forum and notify me to pin it :)
No problem, i can create a thread tomorrow with Axelay's code, linking related threads and of course attributing the work to those involved and ping you afterwards.

Title: Re: CORSAIR_Trainer
Post by: Gryzor on 19:35, 20 October 20
Sounds great! Perhaps a wiki article would be better suited, but whatever people want 😁
Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 21:18, 20 October 20
Quote from: Gryzor on 19:35, 20 October 20
Sounds great! Perhaps a wiki article would be better suited, but whatever people want 😁
Actually you're correct, wiki would be better, will take longer so will do that at the weekend.
Thanks!
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 09:53, 21 October 20
No problem :) If you need any help let me know :)
Title: Re: CORSAIR_Trainer
Post by: fgbrain on 18:16, 21 October 20
QuoteIt is really weird, for the Amiga( my second machine ) most of the optimization info/tricks are freely available but not in the CPC world?


About vertical pixel perfect hw scrolling,  Pict from Logon System did an article in A 100% back in May 1993.
Can be found now at: https://cpcrulez.fr/coding_logon48-scroll_vertical.htm

Title: Re: CORSAIR_Trainer
Post by: lmimmfn on 22:38, 21 October 20
Quote from: fgbrain on 18:16, 21 October 20


About vertical pixel perfect hw scrolling,  Pict from Logon System did an article in A 100% back in May 1993.

Can be found now at: https://cpcrulez.fr/coding_logon48-scroll_vertical.htm (https://cpcrulez.fr/coding_logon48-scroll_vertical.htm)


Thanks, i did read this before and article is great but running the logon 48 demo, it wouldnt work unless playing with vsynch in WinApe, but when i update the wiki ill add this also.
Title: Re: CORSAIR_Trainer
Post by: TotO on 13:24, 25 October 20
Congratulation for the first place! 8)
Title: Re: CORSAIR_Trainer
Post by: rexbeng on 22:05, 25 October 20
Quote from: TotO on 13:24, 25 October 20
Congratulation for the first place! 8)
Thanks, but it proved to be not much of a competition after all. Still it was nice that more people than the usual got at least a glimpse of what the CPC can do.
We are so sorry that you dont find the game very pleasant to play though!  ;D
Title: Re: CORSAIR_Trainer
Post by: TotO on 22:12, 25 October 20
Quote from: rexbeng on 22:05, 25 October 20
Thanks, but it proved to be not much of a competition after all. Still it was nice that more people than the usual got at least a glimpse of what the CPC can do.
We are so sorry that you dont find the game very pleasant to play though!  ;D
OK. So, congratulation to have won the attention of peoples around the CPC.
And don't worry, may be I will prefer the final release... ;D
Title: Re: CORSAIR_Trainer
Post by: rexbeng on 22:17, 25 October 20
 ;D
Title: Re: CORSAIR_Trainer
Post by: Gryzor on 08:32, 26 October 20
Well first place is first place, and the title is really good on its own, so... congratulations :)
Title: Re: CORSAIR_Trainer
Post by: Axelay on 12:36, 27 October 20
@TotO (https://www.cpcwiki.eu/forum/index.php?action=profile;u=290) , @Gryzor (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1) - Thanks!

Title: Re: CORSAIR_Trainer
Post by: Axel on 23:14, 09 March 24
Was there ever a full version of this? It looks so elegant.


Title: Re: CORSAIR_Trainer
Post by: rexbeng on 08:38, 10 March 24
@Axel. Nope!
Powered by SMFPacks Menu Editor Mod