21Fermer23
XedaELe 26/02/2013 à 17:41
Attention: Je suis une américaine et je ne parle pas bien le français. Je suis désolé en avance pour ma grammaire .___.

D: Je suis désolé, je pensais que j'ai déjà posté. Il y a été deux jours depuis je "l'ai posté" XD

J'ai crée ces codes:

Un Hook: .db 83h or a jr z,$+4 ExitHook3: cp a ret ld hl,(OP1) ld bc,2305h or a sbc hl,bc jr nz,ExitHook3 ld hl,(nextParseByte) ld a,5Fh cp (hl) jr nz,ExitHook3 ld de,OP1+1 ld b,8 CopyNameLoop: inc hl ld a,(hl) cp 30h jr c,FinishCopyLoop cp 3A jr nc,FinishCopyLoop cp 41h jr c,FinishCopyLoop cp 5Ch jr nc,FinishCopyLoop ld (de),a inc de djnz CopyNameLoop FinishCopyLoop: xor a ld (de),a bcall(_ChkFindSym) jr c,ProgNotFound ld a,b or a ex de,hl jr z,DataAtAHL ld b,0 ;BC = name size add hl,bc ld c,10 add hl,bc bit 7,h jr z,$+7 inc a set 6,h res 7,h DataAtAHL: push hl push af ld bc,8 ld de,OP2 bcall(_FlashToRAM2) pop af pop hl ;Now OP2 has the first 8 bytes of data (first two bytes are the size of the var) ;A is the flash page the the size bytes start on ;HL points to to the size bytes
Utilisez le 8 octets pour le taille de la programme et le premier 6 octets de la programme pour le "header."


- routine qui copie un buffer de 768 octets au milieu de l'écran (ou 1 bit = 1 pixel)


Voila smile : Define96x64Window: ld hl,$10B8 ; BGR mode, increment order ld a,$03 call SetLCDRegister ld hl,0 ;coord start ld a,20h ;set y coord = 0 call SetLCDRegister+2 ;A incremented to 21h call SetLCDRegister+2 ;set x coord = 0 ld a,50h ;horizontal call SetLCDRegister+2 ;set y coord = 0 ld hl,63 call SetLCDRegister+2 ;set y coord = 63 ld hl,0 call SetLCDRegister+2 ;set x coord = 0 ld hl,95 call SetLCDRegister+2 ;set x coord = 95 BWImage: ;Inputs: ; HL points to the data ; the window is already defined ;Outputs: ; B,D,E are all 0 ; A is either $00 or $FF ; C is the last byte of the buffer ld de,3 ;10 10 BWLoop: ; ld b,8 ;7 7*768 ld a,(hl) ;7 7*768 cpl ;4 4*768 ld c,a ;4 4*768 BWLoop2: ; rlc c ;8 8*6144 sbc a,a ;4 4*6144 out (11h),a ;11 11*6144 out (11h),a ;11 11*6144 djnz BWLoop ;13|8 768(13*8-5) dec d ;4 4*768 jr nz,BWLoop ;12|7 12*768-15 dec e ;4 4*3 jr nz,BWLoop ;12|7 12*3-5 ret ;10 10 ;Total time: ;314160 t-states. SetLCDRegister: ld c,$11 out ($10),a \ out ($10),a out (c),h out (c),l inc a ret

- dessin de rectangle pleins/vides, cercles, lignes

Dessiner un rectangle sur l'écran: Rectangle: ;Inputs: ; DE = color ; 4 pushes to the stack in order: ; push <width> ; push <right coordinate> ; push <height> ; push <upper coordinate> ;RAM: needs 2 bytes of RAM: ; (TempWord1) is two bytes ld hl,$10B8 ; BGR mode, increment order ld a,$03 call SetLCDRegister pop hl \ ex (sp),hl ld a,20h ;set upper coordinate call SetLCDRegister+2 ;A incremented to 21h ld a,50h ;horizontal call SetLCDRegister+2 ; ld b,h ld c,l pop hl \ ex (sp),hl ld (TempWord1),hl add hl,bc call SetLCDRegister+2 ;set lower coordinate pop hl \ ex (sp),hl ld a,21h call SetLCDRegister+2 ld a,52h call SetLCDRegister+2 ;set right coordinate ld b,h ld c,l pop hl \ ex (sp),hl push hl add hl,bc call SetLCDRegister+2 ;set left coordinate pop hl ;width ld a,(TempWord1) ; ld b,a ;b is height ;DE is color ;C is 11h ;B is the height ;HL is the width dec hl inc h inc l push hl FillRectLoop: out (c),d out (c),e dec l jr nz,FillRectLoop dec h jr nz,FillRectLoop pop hl djnz FillRectLoop-1 ret

Et je créerai le code pour les cercles, aussi grin