EmOneGarand, on Mon Aug 13, 2007 9:22 AM, said:
sorry if I'm not quite getting this hah hah.. but you mention that the registers are in octals, thats a step up from hex right? So I have 3 aliens I want to designate, the table says that reg0 -reg31 are general purpose so are these what I have at my disposal for everything else? the problem I have is how do I designate the x & y position values to a register for each alien (like how you guys assigned a bunch of them for the ghosts) Not quite sure how it works.. particularly how Octal 43 = Reg35
Octal is a number system that has eight values only: 0-7, decimal has 10: 0-9 and hexadecimal has 16: 0-F.
You have registers 0 - 63 to play with, the lower registers can be addressed and played with without the need to go via the ISAR. These lower registers are usually used in different routines, as they can be used quicker (not having to deal with ISAR). Examples are the plot, blit, delay etc. etc.
Here's the table we use in Pac-man to permanently store information about the ghosts,
octal numbers written with three digits (all start with 0) and the decimal equivalence after #:
GHOST_0_X_REG = 040 ; #32
GHOST_0_Y_REG = 041 ; #33
GHOST_0_DIR_REG = 042 ; #34
GHOST_0_ANIM_REG = 043 ; #35
GHOST_1_X_REG = 044 ; #36
GHOST_1_Y_REG = 045 ; #37
GHOST_1_DIR_REG = 046 ; #38
GHOST_1_ANIM_REG = 047 ; #39
GHOST_2_X_REG = 050 ; #40
GHOST_2_Y_REG = 051 ; #41
GHOST_2_DIR_REG = 052 ; #42
GHOST_2_ANIM_REG = 053 ; #43
GHOST_3_X_REG = 054 ; #44
GHOST_3_Y_REG = 055 ; #45
GHOST_3_DIR_REG = 056 ; #46
GHOST_3_ANIM_REG = 057 ; #47
There's also a temporary register to hold the values of the current ghost being manipulated:
GHOST_TMP_X_REG = 034; #28
GHOST_TMP_Y_REG = 035; #29
GHOST_TMP_DIR_REG = 036; #30
GHOST_TMP_ANIM_REG = 037; #31
Then we have a cycle that copies ghost 0 information to the temporary registers, change that accordingly, copies it back, copies next ghost, change, copies back etc...
That way we can use the same routine for all the ghosts, I don't know if this is the best way, but that's how Blackbird solved it - if looking for speed it's probably better to have one routine for each ghost, not copying back and forth between a temporary register.
You should really take a look at these pdf:s if you haven't already, I uploaded all of them into my personal webspace except for the circuit schematics of the Fairchild unit:
Best one:
http://w5.nuinternet.com/s660100106/files/...Programming.pdf
Others:
http://w5.nuinternet...nnelf/f3850.pdf
http://w5.nuinternet.com/s660100106/files/...lf/f3851_56.pdf
http://w5.nuinternet.com/s660100106/files/...lf/f3852_53.pdf
http://w5.nuinternet.com/s660100106/files/...eneral_info.pdf
http://w5.nuinternet.com/s660100106/files/...hoff_(1979).pdf
I recommend printing the F8_Guide_to_Programming.pdf and definately the instruction-table from f8_info_'16_bit_%B5P_architecture',_Terry_Polhoff_(1979).pdf to more easily see what commands are available, what they do and how slow they are. As you can see in that table a PI takes 6.5 cycles to complete, so if you're using a routine a lot you'll save time if you are able to reach it without using a subroutine call.
Happy programming!
Edited by e5frog, Mon Aug 13, 2007 6:50 AM.