Articles

Metasploit Framework Windows Tutorial
Remote Desktop Connection
Windows Processes That May Be Dangerous
How-To use NetCat a Tutorial
Common Linux Commands
Common Ports
Netcat Commands
HTTP Response Codes
War-Google Hack Terms
Wardriving
Avoiding Social Engineering and Phishing Attacks
Intrusion Detection on Linux
Linux Intrusion Detection
Penetration Testing Guide
Penetration Testing Tools
Social Engineering Fundamentals, Part I: Hacker Tactics
Social engineering (computer security)
The Psychology of Social Engineering

The Archives

General GSO
GovernmentSecurity.org News & Suggestions
In The News
Open Topic
General Security Information
Trash Can
Exploit & Vulnerability Mailing List Archives
Trial Member Forum
Product and Program Reviews GSO Tutorials
System Security
Windows Systems
Beginners Section
Linux & Unix Systems
File Downloads
Exploit Research & Discussion Trojan & Virus Errata
Networking Security / Firewall / IDS / VPN / Routers
System Hardening
E-Mail Security
Wifi Security
Trial Member Uploads
Upload discovered Trojans & Mal ware
GSO Programming Section
C , C++ , VC++
Visual Basic.NET
Perl /CGI
Java/Javascript
PHP/XML/ASP/HTML
Assembly + Other
The Cork Board
Network Security Consultant Directory
Network Security Jobs
The Archives
Encryption Information
General Network Security
Internet Anonymity
HTTP Protocol Security
Linux Security
MS IIS Information
Exploit Articles
Programming / Tool Design
GSO Software Projects
Public Downloads
Microsoft Security Questions and Papers

gman24
For some reason the movement is lagging one key behind. I thought it might be the rom call to _GetKey.
The exit program key, delete key, works immediately however.

I might have to resort to making my own pause and using direct input, if it's not somewhere else in the code.

Does anybody know of any lag problems with _GetKey rom routine on the ti-83+ with mirage OS.

It might be an arrow key lag. Dunno, inlcuded the code in case someone saw something. Most of the code is skeleton, im working on movment first. It works fine, except a lag.

CODE

#include "ti83plus.inc";General TI-83 Plus include file
#include "mirage.inc";MirageOS include file
#define pixlen 55;made both divisible by five, evenly
#define pixwidth 90

#define maxinventory 10
#define maxspells 10
#define maxskills 10
#define numweapons 3
#define maxstrlen 10
#define maxobjects 10
#define tilesize 5
#define charwidth 5;the character sprite width when walking;now must match tile size, used a differant method to save mem
#define charhieght 5;the character sprite width when walking;now must match tile size, used a differant method to save mem

.org $9d93;Origin (set back two to account for AsmPrgm)
.db $BB,$6D;Compiled AsmPrgm token
ret;So TIOS wont run the program
.db 1;Identifier as MirageOS program
.db %00000000,%00000000;15x15 button
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db %00000000,%00000000
.db "Nightblade",0;Zero terminated description
;Program code starts here
jp main

Leveldata:  .ds ((pixlen/tilesize)*(pixwidth/tilesize));stores leveldata by tile matrix for interaction
;objectdata:  .ds (pixlen*pixwidth);stores objectdata by pixel matrix for interaction
inventory:  .ds (maxinventory*2);one byte for the item number, one for the amount;inventory list
spelllist: .ds (maxspells*6);an array of 2words and 2 bytes for each spell, location 1.)spellname pointer(word),2.)spellproc pointer(word),3.)spellnum(byte) 4.)spellvl(byte)
skilllist: .ds (maxskills*6);an array of 2words and 2 bytes for each skill, location 1.)skillname pointer(word),2.)skillproc pointe(word)r,3.)skillnum (byte)4.)skilllvl(byte)
charlvl: .db 1;the characters lvl
weapon: .dw 0;pointer to the currently equipped weapon
armor: .dw 0;pointer to the currently equipped armor
acc: .dw 0;pointer to the currently equipped accessory
weaponlist: .ds (numweapons*(6+maxstrlen));weaponlist, position 1.)(byte)weaponnum 2.)(byte)damage 3.)(byte)effect 4.) (maxstrlen bytes+1)nameand null terminator
armorlist: .ds (numweapons*(6+maxstrlen));armorlist, position 1.)(byte)armornum 2.)(byte)save 3.)(byte)effect 4.)(maxstrlen bytes+1)nameand null terminator
cha: .db 2
str: .db 2
dex: .db 2
agi: .db 2
hp: .db 20
mp: .db 5
wis: .db 2
int: .db 2
worldpos: .ds 3;1.)x 2.)y 3.)z
lvly:   .db 5;matrix location
lvlx: .db 5;matrix location
lvlnum: .db 0
lvltype: .db 0
dynamicobjectlist: .ds (4*maxobjects);objects that can be taken or destroyed in the levelmap 1.)(byte)upper left corner x value 2.)(byte)upper left corner y value3.)(byte) lvlnum 4.)(byte)objectnum; a 0 in objectnum place indicates empty space  
mode: .db 0;0=normal,1=battle,2=message,3=storymode,4=shop;may not need this, let's see
generalbyte: .db 0;for any use
generalbyte2: .db 0;for any use
generalword: .dw 0;for any use


main:
call loadweapons
call loadarmor
ld a,10
ld (lvlx),a
 ld (lvly),a
 ld a,8
 call setupint
loop1:
call localredraw
bcall(_GrBufCpy)
call inputhandler
call randbattle



jr loop1


inputhandler:
push AF
push BC
push DE
push HL
 bcall(_RunIndicOff)    
       bcall(_GetKey)
  ;call directin
cp kDel
jr Z,quitpo
cp kLeft
jr Z,hitit
cp kUp
jr Z,hitit
cp kRight
jr Z,hitit
cp kDown
jr NZ,notarrow

hitit:
;<-24
;up25
;->26
;down 34
                 call Movement
jr endit

quitpo:
call quittoshell
notarrow:
;handle other input


endit:
pop HL
pop DE
pop BC
pop AF
   
RET

Movement:;key in accumilator
;if borders touch non-zero, take appropriate action
    LD L,A
     LD A,0
    LD (generalbyte), A;boolean
    LD A,L
   
cp kLeft
jr Z,moveleft
cp kUp
jp Z,moveup
cp kRight
jp Z,moveright
cp kDown
jr Z,movedown
moveleft:

cont:
   LD A,(lvly)
LD H,A
LD E, pixwidth/tilesize
call multhe
    LD B, H
    LD C, L
LD A,(lvlx)
DEC A
LD E,A
LD D,0
ADD HL,DE
    LD D, H
    LD E, L
LD HL,leveldata
ADD HL,DE
    LD D, H
    LD E, L
LD A,(DE)
cp 0
jr NZ,trueval

falseval:      
      jr mclear1
trueval: LD    (generalbyte), A
         jp doneit2

mclear1:
    LD A,(lvlx)
    cp 0
    jr Z,sm1
    DEC A
    LD (lvlx),A
sm1:
   
jp doneit

movedown:

cont2:
    LD A,(lvly)
   INC A
LD H,A
LD E, pixwidth/tilesize
call multhe
    LD B, H
    LD C, L
 LD A,(lvlx)
LD E,A
LD D,0
ADD HL,DE
    LD D, H
    LD E, L
LD HL,leveldata
ADD HL,DE
    LD D, H
    LD E, L
LD A,(DE)
cp 0
jr NZ,trueval2
falseval2:      
      jr mclear2
trueval2: LD    (generalbyte), A
         jp doneit2

mclear2:
    LD A,(lvly)
    cp pixlen/tilesize
        jr Z,sm2
    INC A
    LD (lvly),A
sm2:
   
   jp doneit

moveright:

cont3:
LD A,(lvly)
LD H,A
LD E, pixwidth/tilesize
call multhe
    LD B, H
    LD C, L
LD A,(lvlx)
INC A
LD E,A
LD D,0
ADD HL,DE
    LD D, H
    LD E, L
LD HL,leveldata
ADD HL,DE
    LD D, H
    LD E, L
LD A,(DE)
cp 0
jr NZ,trueval3
falseval3:      
      jr mclear3
trueval3: LD    (generalbyte), A
         jr doneit2

mclear3:
   LD A,(lvlx)
   cp pixwidth/tilesize
   jr Z,sm3
   INC A
   LD (lvlx),A
sm3:
   
jr doneit

moveup:
   
cont4:
    LD A,(lvly)
   DEC A
LD H,A
LD E, pixwidth/tilesize
call multhe
    LD B, H
    LD C, L
    LD A,(lvlx)
LD E,A
LD D,0
ADD HL,DE
    LD D, H
    LD E, L
LD HL,leveldata
ADD HL,DE
    LD D, H
    LD E, L
LD A,(DE)
cp 0
jr NZ,trueval4
falseval4:
      jr mclear4
trueval4: LD    (generalbyte), A
         jr doneit2

mclear4:
   LD A,(lvly)
cp 0
jr Z,sm4
   DEC A
   LD (lvly),A
sm4:
   
   jr doneit

doneit2:


doneit:

   
ret

redraw
;process  object matrix
call drawobject

ret

levelload:

ret



drawobject:;pass obj type and x,y position of upper left corner
;getsize
;drawsizew in leveldata
;drawobj

ret

localredraw:;pass x,y pos
;redraw immediate vicinity


;-----------box char for testing
   ld A,(lvlx)
   ld h,a
ld e,tilesize
call multhe
ld a,l
ld (generalbyte),a

   ld A,(lvly)
   ld h,a
ld e,tilesize
call multhe
ld a,l
ld (generalbyte2),a


   ld A,(generalbyte)
   ld h,a
   ld A,(generalbyte2)
   ld l,a

   ld A,h
   Add a,charwidth
   ld d,a
   ld e,l
   call fastlineb

   ld A,(generalbyte)
   ld h,a
   ld A,(generalbyte2)
   add a, charhieght
   ld l,a


   ld A,(generalbyte)
   Add a,charwidth
   ld d,a
   ld e,l

   call  fastlineb


   ld A,(generalbyte)
   ld h,a
   ld A,(generalbyte2)
   ld l,a


   ld d,h
   ld A,(generalbyte2)
   add a, charhieght
   ld e,a

   call  fastlineb

   ld A,(generalbyte)
   add a,charwidth
   ld h,a
   ld A,(generalbyte2)
   ld l,a


   ld d,h
   ld A,(generalbyte2)
   add a, charhieght
   ld e,a

   call  fastlineb
;-----------box char for testing
ret

msgbox:;pass message
;draw reectangle, fill inside white
;draw inner rectangle 5 pixel smaller

;g1
;display text till box full

;wait keypress
;if more goto g1

ret

loadweapons:

ret

loadarmor:

ret

randbattle


ret





.end



gman24
It was the _getkey rom call. I used a direct method to get the keys and it worked fine. That's wierd, the first time that has happened to me. Must be the interaction between Mirage OS and something else. Maybe the keyhooks that mirage has.
tibbar
just curious but why are you doing z80 asm?
B3T4
u can code cool games under the Texas ti 83 smile.gif

(not that i ever done it, only easy scripting for quick formula use)
gman24
QUOTE(tibbar @ Apr 28 2005, 02:26 AM)
just curious but why are you doing z80 asm?
*




It's challenging. Limited CPU power, limited memory. Not to mention fun.

I am making an RPG and am coming up with all sorts of algorithms optimized for speed and size. So far I have a basic engine done. It's only 1.5k and all aspects are expandable with very little byte usage. The actual engine takes up the most space, but the data savings in the long run is worth it. I will be able to make a huge game with little amount of memory.

Z80 asm is for the Ti graphing calculators (Although other things may have the z80 CPU). I went ahead and learned the machine code for it as well, so that I can dynamically change operations.

The code is over 20 pages though, I found out when I was going to print it for hardcopy. I decided not to print it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.