Garth Wilson wrote:- As far as the multiply instruction, how about a whole set of hyper-fast 16-bit math tables?
Thanks Garth. i like the sound of those look up tables. There is a fair amount of space on vectrex carts, so i could probably use something like that. Providing i am actually capable of making a game! Rotation is quite common in vecrex games because all the objects are drawn with lines, so i will probably need a look up table for sin and cosine as well. (unless there is already one in the bios routines)
Dr Jefyll wrote :- Hello again, Finn. I didn't know what a Vectrex was, so I just checked it out. I'm envious! What a delightful toy to code for!
yes vectrex is awesome, mine is actually in the process of breaking so i need a new one. It's really something special in real-life because there is really no way to recreate the vector display the same on emulators (I am using an emulator to program because i dont have a flash cart). It has a minimalist beauty
http://www.youtube.com/watch?v=TV-0AumPhhc
The Vectrex is all open source now too. You can also get source code for one of the best homebrew games, seen in teaser video above (Thrust - converted from the commodore 64 version) online. This is what i am using to help me code at the moment. If anyone wants to follow me into vectrex programming feel free.
Thrust (freeware) source code kindly made available by the author Ville Krumlinde:
http://www.emix8.org/static.php?page=Ve ... rustSource
Code: Select all
Dr Jefyll wrote :- The trick of using BIT # (or CMP #) to skip over a byte or so is directly transferable to 6809. But I hope that's not your idea of good assembly language programming! Granted; it demands skill and can uniquely solve a problem, but there are far more important things for a novice to learn.
haha yes i do like that stuff. Obviously i am not very skilled but i like to learn about the little tricks i could maybe use in future. I suspect i will struggle just to write a game, so maybe i will leave the tricks to later. They do seem part of the fun of learning assembly though. I learnt yesterday i will have 30,000 cycles per frame if i want my game to run at 50fps. which i do otherwise the vector display wont be stable, but that is quite lot of cycles i guess.
Thats intersting about the 6309 too. It has extra registers! i wish they had used that chip in the vectrex now, but maybe it wasnt available in 1982 anyway.
Thanks very much for taking the time to write me the program. yes that is much better than mine. having only one check. I like your commenting too. I might have to re-jig that program now because i noticed the display is off-centre (on my earlier program too) so i now think the vectrex-beam positioning function may work on relative coordinates rather than actual coordinates. The tutorial i was using was a bit confusing in that sense. (in general the Vectrex uses cartesian coordinates with 0,0 at the centre of the screen)
I had an idea for an optimised solution, but i'm not sure if it actually works. But maybe something can be worked with it by someone better than me.
It was if i knew the object would exactly hit the limit-boundaries and if the boundary was a power of 2. so in this case the boundaries of movement are -32 and 32 and Xv can be 1,2,4,8 or 16. (I figured because the two's complement represntation of any number of a power of 2 always ends in the same sequence of binary numbers as the positive version, you can detect it with one check?)
Code: Select all
loop:
LDA XMan ;add Xv to Xman
ADDA Xv
ANDA #$1F ; Check if Xman=32 or Xman=-32
BNE cont
NEG XV
cont:
STA XMan
BRA loop
EDIT: I think i have got that AND wrong. what should it be to detect 32 or -32? is this possible?
Thanks very much for welcome
BigED,thats a shame about your vectrex. It sounds like you know what you are doing though, i would have no idea how to hook mine up to anything! Maybe you should get a new one and get some of the new homebrew games out now. There is a great Defender clone called Protector, probably one of the best games on the system.