A89: Direct Input and Other Questions


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

A89: Direct Input and Other Questions




Hello,
    I've been trying to learn 68k by working on this game.  I finally got
the direct input working, but I really don't think it is in any way
"optomized."  For one thing, if I don't have a huge delay in there, enter
will exit as well as escape.

    Secondly, and more importantly, if I add a call at the top of the loop,
let's say bsr MoveSprite, that Moves the sprite up one pixel, I either get
an address error or the sprite would not move.. Could this be because of the
way grayscale works that I have to do something special or what?

Here is my KeyLoop thing.. Any suggestions on improving this?  Any help?
Thanks in advance,

;keyboard matrix rows
mask0 equ %11111110     ;(up\2nd\down...)
mask1 equ %11111101     ;(Enter\clear...)
mask2 equ %11111011     ;( <- )
mask3 equ %11110111     ;(catalog...)
mask4 equ %11101111     ;(Mode...)
mask5 equ %11011111     ;(Home...)
mask6 equ %10111111     ;(ESC...)

_main:
	bsr Initialize
	bsr DrawCatcher
	bsr DrawShooter

KeyLoop:
	move.w #mask0,d0
        bsr get_key
        btst #3,d0
        beq MoveRight
        btst #1,d0
        beq MoveLeft
	btst #4,d0
	beq Fire

	bsr delay

	move.w #mask6,d0
        bsr get_key
        btst #0,d0
	bne KeyLoop
Exit:
	jsr graphlib::gray2
	rts

delay   move.w #100,d0
\loopa  move.w #100,d1
\loopc  dbra d1,\loopc
        dbra d0,\loopa
        rts

get_key move.w  d0,$600018
        move.w #50,d0
delay_c dbra d0,delay_c
        move.b $60001b,d0
	rts


Ahmed El-Helw <ahmed@ticalc.org>
   Program Ideas and Upcoming Programs
   the ticalc.org project - http://www.ticalc.org/
_______________________________________
http://hail.icestorm.com/asm/
ICQ: 3350394

________________________________________________________
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at
http://www.netzero.net/download.html