CPCWiki forum

General Category => Programming => Topic started by: freemac on 11:10, 17 December 20

Title: rupture CPCtelera
Post by: freemac on 11:10, 17 December 20
Following https://www.cpcwiki.eu/forum/programming/rupture/ and https://amstradplus.forumforever.com/t319-Programmez-vos-ruptures-facilement.htm

I realise my first rupture using CPCtelera, at top &4000, and at bottom &C000 :
[attach=1]

https://github.com/renaudhelias/CPCtelera-schtroumpfs/releases/tag/CPCtelera-schtroumpfs_v0.1
hellorenaud.dsk => run"launch

txt_scroll.c
unsigned int vblPosition=0;

/**
* Après un VSYNC qui met à 0 le compteur 6tics d'interruption.
*/
void killVBL() {
__asm
       ld bc,#0xbc07 ; Kill VBL
       ld a,#0x7f
       out (c),c
       inc b
       out (c),a
__endasm;
vblPosition=37;
}

void restoreVBL() {
__asm
       ld bc,#0xbc07 ; On repositionne la VBL
       ld a,(_vblPosition)
       out (c),c
       inc b
       out (c),a
__endasm;
}

/**
* nbCharLigne 39 max
**/
void rupture(unsigned char nbCharLigne) {
__asm
       ld bc,#0xbc04 ; Rupture 1
       ;;ld a,(_nbCharLigne)
ld hl, #2+0
add hl, sp
ld a, (hl)
       dec a
       out (c),c
       inc b
       out (c),a
__endasm;
vblPosition=vblPosition-nbCharLigne;
}


main.c

u8 intCounter=0;
void myInterruptHandler() {
   intCounter=intCounter+1;
   if (intCounter == 6) intCounter=0;

   if (intCounter == 2) {
cpct_setBorder(2);
   } else {
cpct_setBorder(3);
   }
if (intCounter==5) {
calqueC000();
killVBL();
rupture(19-1);
}
if (intCounter==2) {
calque4000();
restoreVBL();
rupture(39-19+1);
}
}
...
cpct_setInterruptHandler(myInterruptHandler);
while (1) {
      vsync();
      intCounter=0;
      //killVBL();
      //rupture(39);
      //restoreVBL();
   }
Title: Re: rupture CPCtelera
Post by: freemac on 11:29, 17 December 20
 [attach=1]
Title: Re: rupture CPCtelera
Post by: freemac on 11:40, 17 December 20
The disk with FOND.SCR at &4000, and LAUNCH.BAS loading FOND.SCR
Title: Re: rupture CPCtelera
Post by: SRS on 21:21, 17 December 20
Memory Full in 37 ...
if I REM Line 37 it seems to work well
Title: Re: rupture CPCtelera
Post by: freemac on 09:57, 18 December 20
Quote from: SRS on 21:21, 17 December 20
Memory Full in 37 ...
if I REM Line 37 it seems to work well
My bad  :-\
Title: Re: rupture CPCtelera
Post by: Ast on 12:28, 18 December 20
@freemac (https://www.cpcwiki.eu/forum/index.php?action=profile;u=470) : do you already tried :  Amstrad Plus :: *****Programmez vos Ruptures encore plus facilement (forumforever.com) (https://amstradplus.forumforever.com/t550-Programmez-vos-Ruptures-encore-plus-facilement.htm) ???
Powered by SMFPacks Menu Editor Mod