[A83] Re: porting help


[Prev][Next][Index][Thread]

[A83] Re: porting help




> 
> I've been trying to covert this z80 asm routine to work with ion and am 
> having trouble. Could someone please help me? Here is the routine:
> ; ZMouse Sprite Routine v1.1 by TI Wizard (Bjay J. Jeon), 5/01/99
> ; ZMouse is a freeware! =)
> 
.NOLIST

#define equ .equ
#define EQU .equ
#define end .end
#define END .end

> .include "ti83asm.inc"
> .include "tokens.inc"
> .include "83asm.inc"

.include "ti83plus.inc" ;probably

.LIST

coord = statvars 

> .org 9327h

.org 9D93h              ;afaik

        xor     a
        jr      start
        .dw     0
        .dw     info

info:

        .db "ZMOUSE v1.1 by Bjay Jeon",0

start:

        bcall(_clrlcdfull)             ;call clrfullscrn
                                       ;call    gbufclr
        ld      hl,$0000
        ld      (coord),hl

set_screen1:

        ld      hl,plotsscreen
        ld      de,plotsscreen+1
        ld      (hl),0FFh
        ld      bc,383
        ldir
        ld      hl,plotsscreen
        ld      de,savesscreen
        ld      bc,768
        ldir

main_loop:

        call    sp_put
        bcall(_GRBUFCPY_V)  ;or _grbufcpy, just look around in ti83plus.inc
        call    reset_screen
        ld a,0fdh
        out (1),a
        in a,(1)
        cp 191
        jp z,quit
        ld      a,0ffh
        out     (01h),a
        dec     a
        out     (01h),a
        in      a,(01h)
        bit     0,a
        call    z,Down
        bit     1,a
        call    z,Left
        bit     2,a
        call    z,Right
        bit     3,a
        call    z,Up
        ld      a,0FFh
        out     (01h),a
        jp      main_loop

Down:

        ld      hl,coord+1
        ld      e,a
        ld      a,(hl)
        cp      56
        jp      z,reset
        inc     (hl)
        jp      reset

UP:

        ld      hl,coord+1
        ld      e,a
        ld      a,(hl)
        cp      0
        jp      z,reset
        dec     (hl)
        jp      reset

Right:

        ld      hl,coord
        ld      e,a
        ld      a,(hl)
        cp      88
        jp      z,reset
        inc     (hl)
        jp      reset

Left:

        ld      hl,coord
        ld      e,a
        ld      a,(hl)
        cp      0
        jp      z,reset
        dec     (hl)

reset:

        ld      a,e
        ret


sp_put:

        ld      bc,(coord)
        ld      IX,PIC

;Partial Sprite Routine from AN PLUTO's
;Most are modified for speed and control purposes.
;Thanks AN PLUTO for this wonderful routine!

XORSPR:

        ld      a,05h
        ld      h,a
        add     a,b
        add     a,a
        add     a,b
        ld      l,a
        add     hl,hl
        inc     l
        add     hl,hl
        ld      b,7Ah
        ld      a,c
        srl     c
        srl     c
        srl     c
        add     hl,bc
        and     00000111b
        ld      c,a
        neg
        add     a,7
        ld      c,a
        add     a,a
        add     a,c
        ld      (Spr_Op+1),a
        ld      de,000Dh
        ld      b,8

Spr_Loop:

        ld      c,(IX+00h)
        xor     a

Spr_Op:

        jr      Spr_Op
        srl     c
        rra
        srl     c
        rra
        srl     c
        rra
        srl     c
        rra
        srl     c
        rra
        srl     c
        rra
        srl     c
        rra
        xor     (hl)
        ld      (hl),a
        ld      a,c
        dec     hl
        xor     (hl)
        ld      (hl),a
        add     hl,de
        inc     IX
        djnz    SPR_Loop
        ret

Reset_Screen:

        ld      hl,savesscreen
        ld      de,plotsscreen
        ld      bc,768
        ldir
        ret

quit:

        ;call    gbufclr
        ;call    clrscrn
        ;call    clrtxt
        ;call    clrfullscrn
        bcall(_ClrLCDFull)
        ret

PIC:

    .db %01000000
    .db %01100000
    .db %01110000
    .db %01111000
    .db %01111100
    .db %01111000
    .db %01111100
    .db %01011000

;this should work.

.end

-- 
    Ronald Teune @School
    http://www.zeekoe.cjb.net
    http://ti.zeekoe.cjb.net
    Anything that's good&useful is made of chocolats

Sent through GMX FreeMail - http://www.gmx.net




Follow-Ups: References: