From 452501027397bd7442f024f57429a5b9720c0ca9 Mon Sep 17 00:00:00 2001 From: blondie7575 Date: Tue, 5 Sep 2017 12:07:33 -0700 Subject: [PATCH] Added shot power & fixed point multiply --- gscats.2mg | Bin 819264 -> 819264 bytes player.s | 6 +++--- projectile.s | 24 +++++++++++++++++++-- utility.s | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 5 deletions(-) diff --git a/gscats.2mg b/gscats.2mg index b8c1dfd0a17f4199dd8be6384e16c04af463f4e5..6adcf5e37ec901ebc61e7853ce28b5f650414e18 100644 GIT binary patch delta 1438 zcmZvbT}T{P6vyw(>NsxJx~r>>OIvReTUttCV$;?nNK8vwu|62mu5=3RwAAid#YYL0 z!Val6dFUi=ZUbGgt`!ngG7wnovRJFJ6n99a`(T0u3W<=|Afcma3dxH-cW1}?kb%Sf z-E+@5bN=^Z!Dv}9TCPHQ?LiXyoHXyR4H5DykvWL$nD|?!U3x|meC$LZn~|!zPYHjr zo}nXRc`WnY&}l(XSi?6T34@tq;T14Dqp_SK^T+$TdWjxJ*nNa)+Ykb;uown#(}{U`KDX?5zj&g=GbTwDmzf3^%q; z<;mlQs2Z{tNHE}^o*QHrZfra?s%LjpX6)ukAyKDEQsL3+hFPzzsS{*en5)wY)qmag z75@EJ(WX?hQ8Nyq?`5Y@je`6>v{-)H%`V<=|T@W6D;62bYY>wVb@Lc|t{Q)LF> zN)YJL4@do=j|RcmoDzsBf=)?|83w;u4@!KDmi;QhR=(X1#7uTe1 z$WoRvkOedA1~af_qDF0-1W$|;f`2pL{lH@E$MuGA5S&L;?6C7Bo|PU3n@3{|d4E*$hd*1oHbUB_p)>1np#QjY^YUC7UO3#( zJ@=e*&-dN?CT0Jm?7z-7ZrcOD9fOXJZ61JM!O1~X4~W0(J@%LEf6K*J_o1)z&py zfG4d%$zx1{ySZs>BA^c4slG6(e|?mmx%+_-_k`^B;^X^OWozi6Gz>Xm!V@ZPSzfRe z|4FojMkQr?NbW@6>$T!$oV-yf)eNvTqAGy}>iCBJxfjXry(JfJ+HM8lXjMy>}N>9d$V$7`vtEXLleP~#BP z{`UDWJUk_76X9JH325?F+tznAswJ5>ibo`wHpmQ+W9!X(YJe#Nj9--! zVUoi*ExJY7*7qY%Ghp}sqZ3R?n9+socKbKlt%Cz>Fi2VjY zarg6$w&nKtjVM<=Pvu7>eNtYPt5>*?5&QxuGu&&o{70;JCWIyP5f+$!(OYJ0-CI84 zJ<&EcgDua-ZUQN#VysZODO!-TV3&R9S?8lIgNOjVnMOj&FDU01?v61Ys+I_b({#@sGC;!vA?oVa>N&|IS`55B`3Iz^W#RM#6 z0%|e=C7FPdOh8E{pd=GeQXM+8sL6DpCKFJT38={g)MNr`;-I##Y=3!(jo^KaOmqjk zo?K=%yR_kl?qC>yCS{4Lmrk|o Op1 * Op2 (16 bits) +; Algorithm from https://apple2.gs/downloads/Programmanual.pdf +; Trashes X +; +mult16: + lda #0 ; Initialize result + +mult16L1: + ldx PARAML0 ; Get operand 1 + beq mult16Done ; If operand is zero, we're done + lsr PARAML0 ; Get low bit + bcc mult16L2 ; If clear, no additions to previous products + clc ; Otherwise add oeprand 2 to partial result + adc PARAML1 + +mult16L2: + asl PARAML1 ; Now shift operand 2 left for possible add next time + bra mult16L1 + +mult16Done: + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; mult88 +; +; PARAML0 = Operand 1 (8.8 fixed point) +; PARAML1 = Operand 2 (8.8 fixed point) +; A => Op1 * Op2 (8.8 fixed point) +; Substantial precision loss occurs here, but it's usually good enough +; +mult88: + lda PARAML0 ; Convert operands to 12.4 + lsr + lsr + lsr + lsr + sta PARAML0 + + lda PARAML1 + lsr + lsr + lsr + lsr + sta PARAML1 + + jsr mult16 ; Result is 8.8 + rts