Author Topic: Trio and Niko assembly help  (Read 9116 times)

0 Members and 1 Guest are viewing this topic.

Ashbad

  • Guest
Re: Trio and Niko assembly help
« Reply #15 on: December 20, 2010, 04:07:11 pm »
it doesn't have anything like that, and since it's an app I can't use anything to do with a shell like DCS7

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Trio and Niko assembly help
« Reply #16 on: December 20, 2010, 04:10:30 pm »
it doesn't have anything like that, and since it's an app I can't use anything to do with a shell like DCS7

Yes, I really can't get why nobody helps you with this :S

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Trio and Niko assembly help
« Reply #17 on: December 20, 2010, 04:22:48 pm »
Does anybody know of a good gray scale rendering routine, like Dispgraphrr in Axe (and besides the source for that, it doesn't work on it's own)

it would really help me a ton.
Wait, why wouldn't that routine work on its own?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Ashbad

  • Guest
Re: Trio and Niko assembly help
« Reply #18 on: December 20, 2010, 04:34:26 pm »
It seems that on wabbit it doesn't display sprites in the right positions (even with a sprite routine from ion) and on mimas, it shows garbage

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Trio and Niko assembly help
« Reply #19 on: December 20, 2010, 04:46:36 pm »
Well, you can't just use a normal sprite routine for grayscale. You have to draw a sprite to each buffer (and did you clear both buffers first?)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Ashbad

  • Guest
Re: Trio and Niko assembly help
« Reply #20 on: December 20, 2010, 05:59:33 pm »
yeah, I cleared both buffers, and I modified the ion one to output the same stuff to both buffers.

EDIT: it gets the byte at flags+asm_flag2 near the beginning; I wonder if a command uses that earlier to set something?

Code: (Disp4 routine) [Select]
Disp4
ld a,i
push af
di
ld (OP2+2),sp
ld a,$80
out ($10),a
ld sp,appbackupscreen - plotSScreen
ld e,(plotSScreen-appbackupscreen+12)&$ff
ld c,-$0C
ex af,af'
ld a,%11011011
ld hl,flags+asm_flag2
inc (hl)
jr z,__Disp4Lvlskip
add a,a
ld b,(hl)
inc b
jr z,__Disp4Lvlskip
rlca
ld (hl),-2
__Disp4Lvlskip
ld l,plotSScreen&$ff-1
ex af,af'
__Disp4Lvlentry
ld a,c
add a,$2C
ld h,plotSScreen>>8
inc l
ld b,64
out ($10),a
__Disp4Lvlloop
ld a,(hl)
add hl,sp
xor (hl)
ex af,af'
cp e
rra
ld d,a
ex af,af'
and d
xor (hl)
out ($11),a
ld d,(plotSScreen-appbackupscreen+12)>>8
add hl,de
djnz __Disp4Lvlloop
inc c
jr nz,__Disp4Lvlentry
__Disp4LvlDone
ld sp,(OP2+2)
pop af
ret po
ei
ret
__Disp4LvlEnd

Code: (clrdraw routine) [Select]
Clrscrn
ld bc,768
ld hl,plotSScreen
ld de,appbackupscreen
sub a
__Clrscrnloop
ld (hl),a
ldi
jp pe,__Clrscrnloop
ret

Code: (draw aligned tile in 4 level gray) [Select]
Drawtilebuffer

    ld    e,l
    ld    h,$00
    ld    d,h
    add    hl,de
    add    hl,de
    add    hl,hl
    add    hl,hl               ;Find the Y displacement offset
    ld    e,a
    and    $07               ;Find the bit number
    ld    c,a
    srl    e
    srl    e
    srl    e
    add    hl,de             ;Find the X displacement offset
    ld    de,plotSScreen
    add    hl,de
putSpriteLoop1:
sl1:    ld    d,(ix)             ;loads image byte into D
    ld    e,$00
    ld    a,c
    or    a
    jr    z,putSpriteSkip1
putSpriteLoop2:
    srl    d                  ;rotate to give out smooth moving
    rr    e
    dec    a
    jr    nz,putSpriteLoop2
putSpriteSkip1:
    ld    a,(hl)
    xor    d
    ld    (hl),a
    inc    hl
    ld    a,(hl)
    xor    e
    ld    (hl),a              ;copy to buffer using XOR logic
    ld    de,$0B
    add    hl,de
    inc    ix                   ;Set for next byte of image
    djnz    putSpriteLoop1
    ret



Drawtilebackbuffer

    ld    e,l
    ld    h,$00
    ld    d,h
    add    hl,de
    add    hl,de
    add    hl,hl
    add    hl,hl               ;Find the Y displacement offset
    ld    e,a
    and    $07               ;Find the bit number
    ld    c,a
    srl    e
    srl    e
    srl    e
    add    hl,de             ;Find the X displacement offset
    ld    de,appbackupscreen
    add    hl,de
putSpriteLoop1:
sl1:    ld    d,(ix)             ;loads image byte into D
    ld    e,$00
    ld    a,c
    or    a
    jr    z,putSpriteSkip1
putSpriteLoop2:
    srl    d                  ;rotate to give out smooth moving
    rr    e
    dec    a
    jr    nz,putSpriteLoop2
putSpriteSkip1:
    ld    a,(hl)
    xor    d
    ld    (hl),a
    inc    hl
    ld    a,(hl)
    xor    e
    ld    (hl),a              ;copy to buffer using XOR logic
    ld    de,$0B
    add    hl,de
    inc    ix                   ;Set for next byte of image
    djnz    putSpriteLoop1
    ret

Tilemap
« Last Edit: December 20, 2010, 06:02:11 pm by Ashbad »