Page 4 of 4
Posted: Thu Feb 05, 2009 1:42 am
by TmEE co.(TM)
I have always forgotten to tell the results of testing...
it works always, but on first run, it has screen location issues... after reset, things are fine again. in A button screen, doing something results in CRAM DMAd every line and reset will not help to get out of it (something is bad...). all else works fine.
PS: I've done fair bit of testing on the undocumented VDP ports. the most interesting thing is seeing sprites pushed onto right overcan, with Y value being functional only. I'll try to take some pics of that

Posted: Thu Feb 05, 2009 5:42 am
by TascoDLX
TmEE co.(TM) wrote:it works always, but on first run, it has screen location issues... after reset, things are fine again.
Flag uninitialized.
In the VINT routine:
(I don't have the source but here's the pseudo)
Code: Select all
if flagbyte != 0
write scroll value to VSRAM 0002
flagbyte = 0
Naturally, the scroll value is uninitialized too.
The whole upper half of base RAM is never cleared so you must watch out for uninitialized stuff.

Posted: Thu Feb 05, 2009 1:11 pm
by Jorge Nuno
Thanks for the input
Don't bother with 'A', I'm only looking onto that after 'C' (should be 2D rotation, lool), but first I need to code the ArcTangent function, and I'm not sure if I should use the commented method* (heavy on MULS, DIVS and lots of regs) or some kind of LUT + linear interpolation.
The entire variable section (E0FE00~E0FFFF) is cleared now.
Changed src compression to RAR and now the screen 'A' mapping is generated and decompressed on loading (saved ~12kB)
Reupped bin and JorgeSrc.zip (It was very outdated)
*
Code: Select all
;ArcTg: Gives the angle, 0~FF, both catets in d2(yyyy:xxxx), adjacent is in lower word;
; Must be signed values to give out correct angle
; Theta = ArcTg(Y/X), Z = Y/X
;
; { (609Z+164Z³) / (15+9Z²) , Z & [-1,1]
;ArcTg(Z) ~= { 64 - ArcTg(1/Z) , Z > 1
; { -64 - ArcTg(1/Z) , Z < -1
;
;(binary angle: 0=0º; 64=90º; 128=180º; 255=359º)
EDIT: Little update 8/02/2k09 (fixed some bugs in the rotation code, but it doesn't revolve around properly yet

)