News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_freemac

rupture CPCtelera

Started by freemac, 11:10, 17 December 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freemac

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();
   }

freemac


freemac

The disk with FOND.SCR at &4000, and LAUNCH.BAS loading FOND.SCR

SRS

Memory Full in 37 ...
if I REM Line 37 it seems to work well

freemac

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  :-\

Ast

_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Powered by SMFPacks Menu Editor Mod