As soon as I can test on real hardware and there is more of a game, binaries will be available. There's not much going on besides a moveable, animated, multi-colour player sprite at the moment.
Posted Fri Sep 10, 2010 11:56 AM
Posted Fri Sep 10, 2010 3:29 PM
GroovyBee, on Fri Sep 10, 2010 11:56 AM, said:
Posted Fri Sep 10, 2010 3:34 PM
Posted Fri Sep 10, 2010 3:43 PM
cmart604, on Fri Sep 10, 2010 3:29 PM, said:
Posted Fri Sep 10, 2010 4:17 PM
GroovyBee, on Fri Sep 10, 2010 3:43 PM, said:
cmart604, on Fri Sep 10, 2010 3:29 PM, said:
Posted Fri Sep 10, 2010 4:29 PM
Posted Fri Sep 10, 2010 4:33 PM
Jess Ragan, on Fri Sep 10, 2010 4:29 PM, said:
Posted Fri Sep 10, 2010 6:16 PM
GroovyBee, on Fri Sep 10, 2010 11:56 AM, said:
GroovyBee, on Fri Sep 10, 2010 11:56 AM, said:
Posted Fri Sep 10, 2010 6:36 PM
intvnut, on Fri Sep 10, 2010 6:16 PM, said:
Quote
Posted Fri Sep 10, 2010 7:29 PM
Quote
Posted Fri Sep 10, 2010 7:39 PM
LS_Dracon, on Fri Sep 10, 2010 7:29 PM, said:
Quote
Posted Fri Sep 10, 2010 7:45 PM
Posted Fri Sep 10, 2010 9:00 PM
GroovyBee, on Fri Sep 10, 2010 6:36 PM, said:
intvnut, on Fri Sep 10, 2010 6:16 PM, said:
Quote
MACRO idx(x)
ASC('%x%',0)-32
ENDM
Posted Fri Sep 10, 2010 9:08 PM
intvnut, on Fri Sep 10, 2010 9:00 PM, said:
Posted Sat Sep 11, 2010 3:14 AM
intvnut, on Fri Sep 10, 2010 9:00 PM, said:
Quote
MACRO idx(x)
ASC('%x%',0)-32
ENDM
Quote
Posted Tue Sep 14, 2010 3:32 PM
castle_14_09_10.1.02.rom.bin 5.06K
94 downloadsPosted Wed Sep 15, 2010 7:49 AM
Posted Wed Sep 15, 2010 8:07 AM
catsfolly, on Wed Sep 15, 2010 7:49 AM, said:
Quote
Quote
Quote
Quote
Quote
Posted Wed Sep 15, 2010 8:42 AM
GroovyBee, on Wed Sep 15, 2010 8:07 AM, said:
GroovyBee, on Wed Sep 15, 2010 8:07 AM, said:
catsfolly, on Wed Sep 15, 2010 7:49 AM, said:
Quote
GroovyBee, on Wed Sep 15, 2010 8:07 AM, said:
Posted Wed Sep 15, 2010 8:55 AM
intvnut, on Wed Sep 15, 2010 8:42 AM, said:
Quote
Quote
Quote
Posted Wed Sep 15, 2010 9:35 AM
GroovyBee, on Wed Sep 15, 2010 8:55 AM, said:
intvnut, on Wed Sep 15, 2010 8:42 AM, said:
; assume velocity in R0, position in R1
ADDR R0, R1 ; seemingly normal 2s complement ADD
ADCR R1 ; end-around carry for 1s complement
The reason I used a rotated format like this is twofold. The first is that when I go to merge X/Y into the MOB registers, I can just do:
; assume rotated X is in R0, other X-register bits in R1
ANDI #$FF, R0
ADDR R0, R1
The second is that I can do "SIMD" bounding box checks for collisions. The SDBD prefix tells the CPU to read the LSBs of two bytes. When used with an incrementing pointer, it's a handy way to read X and Y packed into a single register, provided the X and Y positions are in the LSB.
; assume R4 points to X, and that X/Y stored adjacently
SDBD
MVI@ R4, R0 ; LSB holds X, MSB holds Y
Now with the packed X/Y, I can do a single subtract to see if the X/Y for the one object is greater than the X/Y for another. Here's a code excerpt from Space Patrol. In this excerpt, "GGB1" holds the already-packed Y/X upper-left coordinate of my bullet, and R4 points to the X/Y positions of a bad guy, and R3 points to a packed representation of the bad-guy's size, biased by the size of the bullet:
SDBD
MVI@ R4, R1 ; 8 Get Y/X coordinate of bad guy
MOVR R1, R2 ; 6 save it for comparing against the next bullet (GGB2)
SUB GGB1, R1 ; 10 Check the lower right corner
BNC @@out1 ; 7/9 If Y went -ve, bullet's to the right
SWAP R1, 1 ; 6
SWAP R1, 1 ; 6
BMI @@out1 ; 7/9 If X went -ve, bullet's below
;;------------------------------------------------------------------;;
;; At this point R1 contains our X distance to the right, ;;
;; and our Y distance to the right of the bullet's upper left ;;
;; corner vs. the lower right corner of the bad guy. So, if ;;
;; we subtract the bad buy's width and we still end up positive, ;;
;; we're to the left or above. (Note that we bias all bad-guy ;;
;; widths in our table by the width/height of the bullet.) ;;
;;------------------------------------------------------------------;;
SUB@ R3, R1 ; 8 Compare to bad-guy's size.
BPL @@out1 ; 7/9 If Y still +ve, bullet's to the left
SWAP R1, 2 ; 8
BPL @@out1 ; 7/9 If X still +ve, bullet's above
;;------------------------------------------------------------------;;
;; If we made it this far, it's a HIT. ;;
;; Disable bullet 1 and then process the hit. ;;
;;------------------------------------------------------------------;;
CLRR R1 ; 6
MVO R1, SPAT2+5 ; 11 disable the good-guy bullet #1
B @@hit ; 9
In SP, since I have 3 active tank bullets and 12 things they can hit, anything I can save on the bounding box compare is huge. Edited by intvnut, Wed Sep 15, 2010 9:38 AM.
0 members, 1 guests, 0 anonymous users