CODINGSOURCES ★ CODING Source &017 - OVERSCAN BIG SCROLL ★

Big Scroll en OverscanCoding Sources
Pour bien comprendre l'effet je ne mets pas le border a 0, ce source ce compile sans problème sous l'assembleur de WinAPE.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; EXEMPLE D'UN BIG SCROLL EN OVERSCAN
;;
;; https://cpcrulez.fr
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

org &1000
start: ld a, 1 ;
call &0BC0E ; MODE 1
xor a
ld b, a
ld c, b
call &0BC32
ld a, &3
ld b, &1A
ld c, b
call &0BC32
xor a
ld de, &20
ld hl, loc_5388
call &0BBAB
ld bc, &0BC01
out (c), c
ld bc, &0BD2E
out (c), c
ld bc, &0BC02
out (c), c
ld bc, &0BD31
out (c), c
ld bc, &0BC06
out (c), c
ld bc, &0BD08
out (c), c
ld bc, &0BC07
out (c), c
ld bc, &0BD18
out (c), c
loc_4053: ld b, &0F5 ; synchro écran
loc_408e: in a, (c)
rra
jr nc, loc_408E
;;; boucle principal, tu peu y foutre ta zik
call sub_4094
call sub_406D
call sub_41A8
call sub_4137
call sub_412C
call sub_409D
jr loc_4053
sub_406D: ld hl, (word_535F)
ld a, (hl)
cp &0FF
jr z, loc_4084
ld bc, &0BC05
out (c), c
ld b, &0BD
ld c, a
out (c), c
inc hl
ld (word_535F), hl
ret
loc_4084: ld hl, loc_5361
ld (word_535F), hl
jr sub_406D
sub_4094: call &0BC0B
inc hl
inc hl
call &0BC05
ret
sub_409D: call &0BB1B ; la touche espace ?
cp &20 ; ' '
ret nz
keypressed: ; finish
pop bc
ld de, &100
ld hl, loc_5388 ; recup la fonte system
call &0BBAB
ld bc, &0BC01
out (c), c
ld bc, &0BD28
out (c), c
ld bc, &0BC02
out (c), c
ld bc, &0BD2E
out (c), c
ld bc, &0BC06
out (c), c
ld bc, &0BD19
out (c), c
ld bc, &0BC05
out (c), c
ld bc, &0BD00
out (c), c
ld bc, &0BC07
out (c), c
ld bc, &0BD1E
out (c), c
call &0BCA7
ret

sub_412C: ld hl, (word_41E2)
ld b, &8
loc_4131: rlc (hl)
inc hl
djnz loc_4131
ret
sub_4137:
ld hl, (word_41DE)
call sub_4165
inc hl
inc hl
set &7, h
set &6, h
ld (word_41DE), hl
ld de, &5E
; sbc hl, de
set &7, h
set &6, h
call sub_4153
ret
sub_4153: ld b, &8
xor a
ld de, &7FF
loc_4159: ld (hl), a
inc hl
ld (hl), a
add hl, de
set &7, h
set &6, h
djnz loc_4159
pop bc
ret
sub_4165: push hl
ld b, &8
loc_4168:
push bc
push hl
xor a
ld hl, (word_41E0)
; bit &7, (hl)
jr z, loc_4174
ld a, &0FF
loc_4174: call sub_4192
ld hl, (word_41E0)
inc hl
ld (word_41E0), hl
pop hl
ld de, &5C
add hl, de
set &7, h
set &6, h
pop bc
djnz loc_4168
ld hl, (word_41E2)
ld (word_41E0), hl
pop hl
ret
sub_4192: pop bc
pop hl
push bc
ld b, &8
ld de, &7FF
loc_419A: ld (hl), a
inc hl
ld (hl), a
add hl, de
set &7, h
set &6, h
djnz loc_419A
pop bc
push hl
push bc
ret
sub_41A8: ld a, (byte_41DB)
dec a
jr z, loc_41B2
ld (byte_41DB), a
ret
loc_41B2: ld a, &8
ld (byte_41DB), a
ld hl, (word_41DC)
push hl
ld a, (hl)
cp &0FF
jr z, loc_41CF
call sub_41D7
ld (word_41E2), hl
ld (word_41E0), hl
pop hl
inc hl
ld (word_41DC), hl
ret
loc_41CF: pop hl ; fin du scroll
ld hl, textscroll ; boucle
ld (word_41DC), hl
ret

sub_41D7: call &0BBA5
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Les datas
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
byte_41DB: db &8
word_41DC: dw textscroll
word_41DE: dw &0C05C
word_41E0: dw loc_5388
word_41E2: dw loc_5388
textscroll db "CPC RULEZ LE SITE WEB CPC QUI VA BIEN COUSIN ;"
db &0FF
word_535F: dw loc_5361 ;
loc_5361: db &0 ; TABLE DECALAGE
db &0 ;
db &0 ;
db &1 ;
db &3 ;
db &5 ;
db &7 ;
db &9 ;
db &0B ;
db &0E ;
db &11 ;
db &14 ;
db &16 ;
db &18 ;
db &1A ;
db &1C ;
db &1D ;
db &1D ;
db &1D ;
db &1D ;
db &1D ;
db &1D ;
db &1C ;
db &1A ;
db &18 ;
db &16 ;
db &14 ;
db &11 ;
db &0E ;
db &0B ;
db &9 ;
db &7 ;
db &5 ;
db &3 ;
db &1 ;
db &0 ;
db &0 ;
db &0 ;
db &0FF ;
loc_5388: db 00

https://cpcrulez.fr

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » CPCRetroDev 2014 Sources pack collection
» Coding Src's » Side-scroll (Popular Computing Weekly)
» Coding Src's » Spirograph (Computing with the Amstrad)
» Coding Src's » Dump anything off the screen (Computing With the Amstrad)
» Coding Src's » The 3D World
» Coding Src's » Fast Text Routines for Mode 2 Screens (Jason Brooks)
Je participe au site:

» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop
Page créée en 531 millisecondes et consultée 2063 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.