A82: ASH HELP!!!


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

A82: ASH HELP!!!



This is my first code and it doesnt work.  Being my first I dont know why but
think it has to do with the Point_on and off.  I dont understand how to disp
a point on graph screen.  Well back to my code I was trying to make a code
that moves a 2 by 2 square left and right with the arrows.  But wont work, so
if someone could look at it and fix it or tell me a way to disp points
hopefully i will soon know how to make games.

here it is HELP PLEASE 
thanks Jawbreaker ,irc (Jawbreak)

#include "ti82.h"
#include "oldcall.h"
#include "keys.inc"

.org START_ADDR
.DB "BOX",0

boxx    = TEXT_MEM
boxy    = TEXT_MEM+1

Initgame:

        ROM_CALL(DISP_GRAPH)

        ld A,30
        ld (boxy),A
        ld A,45
        ld (boxx),A

Titlescreen:
	set 3,(IY+05)

	ld hl, $0001
	ld ($800C),hl
        ld hl, intro
	ROM_CALL(D_ZT_STR)
        ld hl, $0002
        ld ($800C),hl
        ld hl, blank1
        ROM_CALL(D_ZT_STR)

Waiting:
        CALL GET_KEY
        cp $09
        jr z, Start
        jr Waiting

Start:
        ROM_CALL(CLEARLCD)

Game:
        CALL_(Erasebox)
        CALL_(Keytest)
        CALL_(Drawbox)
        jr Game

Erasebox:

       ld A, (boxx)
       ld B,A
       ld A, (boxy)
       ld C,A

       CALL_(Point_off)
       inc B
       CALL_(Point_off)
       inc C
       CALL_(Point_off)
       inc B
       inc C
       CALL_(Point_off)

       ret

Keytest:
        ld a,0
        out (1),a
        in a,(1)
        cp 0
        ret z
        bit 6,a
        push af
        CALL_Z(QUIT)
        pop af
        bit 1,a
        push af
        CALL_Z(moveleft)
        pop af
        bit 2,a
        push af
        CALL_Z(moveright)
        pop af

        ret



Drawbox:
        ld A, (boxx)
        ld B,A
        ld A, (boxy)
        ld C,A


       CALL_(Point_on)
       inc B
       CALL_(Point_on)
       inc C
       CALL_(Point_on)
       inc B
       inc C
       CALL_(Point_on)

       ret

      
QUIT:
       ret


moveleft:
        ld A,(boxx)
        dec A
        dec A
        cp 96
        jr c,moveleftok
        ld a,94

moveleftok:
        ld (boxx),a
        ret


moveright:
        ld A,(boxx)
        inc A
        inc A
        cp 96
        jr c,moverightok
        ld a,1

moverightok:
        ld (boxx),a
        ret

Point_off:
	PUSH BC
        CALL FIND_PIXEL
        XOR $0FF            ; Invert mask
        LD B,A
        LD A,($8011)        ; Goto line
        CALL $7F3
        OUT ($10),A
        LD A,($800F)        ; Goto byte
        CALL $7F3
        OUT ($10),A
        CALL $7F3
	IN A,($11)          ; Get byte
        CALL $7F3
	IN A,($11)
        AND B
        LD B,A
        LD A,($8011)        ; Goto line
        CALL $7F3
        OUT ($10),A
        LD A,($800F)        ; Goto byte
        CALL $7F3
        OUT ($10),A
        LD A,B
        CALL $7F3
        OUT ($11),A
        POP BC
	RET

Point_on:
	PUSH BC
        CALL FIND_PIXEL
        LD B,A
        LD A,($8011)        ; Goto line
        CALL $7F3
        OUT ($10),A
        LD A,($800F)        ; Goto byte
        CALL 7F3h
        OUT ($10),A
        CALL $7F3
        IN A,($11)          ; Get byte
        CALL $7F3
	IN A,($11)
        OR B                ; Set pixel
        LD B,A
        LD A,($8011)        ; Goto line
        CALL $7F3
        OUT ($10),A
        LD A,($800F)        ; Goto byte
        CALL $7F3
        OUT ($10),A
        LD A,B
        CALL $7F3
        OUT ($11),A
        POP BC
	RET

intro:
.DB "BOX v.01b"

blank1:
.DB "by Jawbreaker"

.end


Follow-Ups: