Author Topic: Reign of Ejaran Main  (Read 15780 times)

0 Members and 1 Guest are viewing this topic.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Reign of Ejaran Main
« Reply #15 on: October 31, 2006, 02:40:00 am »
Sweet, walking engines are always the funnest to make :)smile.gif.

Spelli has taken over, possessed everyone cept me! Prolly cause my nick mesmerizes him! :)smile.gif.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Reign of Ejaran Main
« Reply #16 on: October 31, 2006, 03:13:00 am »
i cant wait to see the demo!

and tr1p rules :Dbiggrin.gif his nick didnt got possessed!

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #17 on: October 31, 2006, 03:46:00 pm »
@tr1p: Yes walking engines are the funnest to make and this was the first one that I made

But all that fun will end when I finish the demo cause then it is back to the sprites, sprites, and more sprites :(sad.gif
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #18 on: November 01, 2006, 07:17:00 am »
I'm running into some interesting problems with my very first 16x16 RPG because I have the person moving on a 8x8 grid so that it is a more walking feel but at sometimes the person is in 2 matrix positions at once and it is hard to make a fast checking routine for this because it is not linear checking if you know what I mean
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #19 on: November 05, 2006, 07:18:00 am »
Yea sorry if you don't think this is moving forward at a good rate or is dead but it is not because I am trying to learn Assembly and will be trying to develop this in ASM instead of TI-BASIC so I can have more features and also SPEEEEED
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
Reign of Ejaran Main
« Reply #20 on: November 05, 2006, 11:21:00 am »
It's probably going to take a while to port this into assembly (assembly usually takes a while to get really good at), so don't plan on porting this to assembly within the next month or so.  It's nice that you're learning assembly though.  It's also fine if there isn't any progress in a while, or maybe if you just don't have the time to post the progress.  Although Omnimaga - The RPG isn't dead, I haven't made much progress on it in a while.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #21 on: November 05, 2006, 03:25:00 pm »
Yea I don't plan on doing it in the next month maybe next year or two cause it is very hard I have one question to ask you though if you can help me but how do you get the adress of a label like my_label:
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
Reign of Ejaran Main
« Reply #22 on: November 05, 2006, 04:24:00 pm »
ld hl,my_label

Makes hl point to the address of my_label (and loads hl with the address my_label).  If you wanted to display that address, then after doing ld hl,my_label you could do:

bcall(_DispHL) (or BCALL _DispHL or whatever you use...)

If you're trying to go to that label, then you would do:

jr my_label

Does that help?

Liazon

  • Guest
Reign of Ejaran Main
« Reply #23 on: November 06, 2006, 09:01:00 am »
my_label is the address.  When the assembler assembles, it goes through line by line, and at the same time totals up how many bytes have been used by the program so far.  A label simply tells the assembler to remember how many bytes the label is from the beginning, and then translate it into an actual address when the assembler starts converting everything into raw binary/hex.  You don't have to worry about it yourself

however:
;header goes here
progstart: ;beginning of program, 0 bytes from $9d95 <-ASM program starting point
.db 0,0,0,0,0,0 ;define some bytes
my_label: ;label
 inc a ; command

Relative to progstart, what is the RELATIVE address of my_label?
answer:
7

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #24 on: November 06, 2006, 10:31:00 am »
Yes bfr that helps and that is what I neeeded Liazon I don't quite get yours cause all that I wanted was the hex position it is at like 8000h or 4050h
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Reign of Ejaran Main
« Reply #25 on: November 06, 2006, 12:07:00 pm »
I guess to sum it up, all I'm saying is that the actual value of the memory address is never actually needed.  You just need the name of the label and the assembler takes care of everything else for you.  However, it can be useful to take advantage of labels when you want to do self modifying code.  More on that later.

sorry if that was a bit complicated

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #26 on: November 06, 2006, 12:55:00 pm »
Yes I need the actual value of the table for a lookup table I am using and just one more ASM question and then I am done but what parameters does Iline use and also how do I multitask because I made a program and when the person moves the AI doesn't and when the person doesn't move the AI does so how do I like thread these two things together??
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Reign of Ejaran Main
« Reply #27 on: November 06, 2006, 05:30:00 pm »
http://nwps.ws/~dragonfire/Asmin28/lesson/day13.html#vct once again has a very nice explanation of vector tables (what you want), look up tables, and jump tables.

Keep in mind that if your table is stored in RAM (saferams for example), you can also change the values stored in the table.  This form of self modifying code is useful, but you can shoot yourself in the foot if you're not careful.  in general, SMC is frowned down upon, but it can definitely save size and speed in RAM programs.

As for your speed issues, there is no multithreading atm for z80 calcs.  You must design your code to deal w/ that.  Basically, if the person moves, just move them a bit, go check on the AI, and then loop everything from teh beginning again.  The speed of the z80 + ASM will allow you to cycle through the player and AI rather quickly, provided you make sure the event handlers are not too complicated.  If you end up doing too much during one key press, you don't have time to get to the AI.

#1 tip:  don't use bcalls!  they are generally bulkier because they are a part of the TIOS, and are designed to handle events w/ many possible cases.  Write your own or borrow someone else's code, provided you understand how it works, relatively well.

Also Iline:

http://www.geocities.com/calcul831415/help/83psysroutines.zip is the official TI system routines guide for 83+ series calcs.  It has basically all the bcalls you'll want.  It explains what they do, as well as inputs, outputs, and registers destroyed.  A bit of warning though, iirc, some of the routines have incorrect info, but it'd probably appear obvious if the emu crashed.

my suggestion is that if you're only drawing horizontal and vertical lines, write your own routine that only does those.  It will be much faster because it doesn't have to check for clipping, calculate slope, mess around too much with pointer arithmetic, etc.  It'd probably be faster than iline.  Otherwise, look for a line routine on TI calc.

btw, questions are always good.  I don't mind pointing you in the right direction, and eventually you'll figure out where to look for answers, and you probably won't need to ask questions

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Reign of Ejaran Main
« Reply #28 on: November 07, 2006, 09:50:00 am »
Yeah thanks that helps a lot and also how does MirageOS recognizes the ret / .db 1 at the start of programs like how would I be able to put detection for that in a program and also you suggest making my own bcall macros, where would I store the code for them and like where would I store the code if I wanted to make a routine like Iline or something like that??
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Reign of Ejaran Main
« Reply #29 on: November 07, 2006, 11:58:00 am »
Any routine is simply a section of code that you call or jump too, but it can also find away back.  When you use a bcall, you basically jump to the code stored in ROM, and at the bottom there is a way for the rom call to return back to the place where it was code and continue running from there.

Routines and data are generally put after the main routine.  The main routine should typically be a closed loop.  The main function will control entry and exit of the program.  In between, it directs how your subroutines(bcalls, functions, what ever you want to call them) will be used to achieve the goal.  Sometimes data should be put w/ code, provided there's no way for the calc to proceed to the data and treat it as executable.

Typically:

lable_routine_name:
;some code here
;typically you use the registers and do something w/ them, assuming the program put in the right inputs
ret

And in your main program:

;load inputs into registers
call lable_routine_name
;when the routine is done, it comes back here and does next command

It's as simple as that.

if you read the instruction set provided in ASMin28, it will explain how call simply means push pc <-program counter/address of current command, jp lable_routine_name

ret <- pop "some register pair", jump there.  It'd not exactly what those two do, but that's the gist of it.