Tursi Posted February 10, 2015 Share Posted February 10, 2015 Just tried it in MESS ... Slymoids seems to be playable without IDLE (at least at first glance). Guardian is too fast without IDLE. Yeah, I didn't notice any problem in Classic99, either, whether I enabled it or not. I've never tried Guardian. As for the unpredictability, my intent in that statement was one crucial point -- you can not predict the hardware that your software will be executed on. (I went through the exercise too, years ago). Still, you're right, it would be cool to put an analyzer on the bus and see once and for all what happens. Sadly I don't have access to a console so I can't do it. Quote Link to comment Share on other sites More sharing options...
palmheads Posted February 12, 2015 Share Posted February 12, 2015 Yep, you upload the 8 sprite patterns to the VDP at the beginning of your code and then update the 3rd byte of the sprite attributes (the one that currently contains the value >84) to change the displayed pattern. You need to allocate a new register, e.g. R9, for holding the currently displayed animation frame. Instead of storing the actual attribute value (>8400, >8800, >8C00, etc) I think it would be easier to store a simple number 0, 1, 2 ... 7. Then you can use INC R9, and DEC R9 to rotate left or right followed by ANDI R9,7 to make sure you stay within the interval 0-7 and wrap around if you go outside. When you get to the point where you want to change the actual VDP byte you do something like this first: MOV R9,R1 ; We need the number in R1 SLA R1,2 ; Multiply by 4 AI R1,>84 ; Add base attribute value SWPB R1 ; Move into high byte Instead of waiting using an arbitrary loop you could also wait for vertical retrace (EDIT: you will probably need to turn off interrupts with LIMI 0 for this to work): CLR R12 VSYNC TB 2 ; Test CRU bit for VDP interrupt JEQ VSYNC MOVB @>8802,R0 ; Read the VDP status reg to reset interrupt bit Hey Rasmus - have implemented something that almost exactly matches your first suggestion above - won't post anything until I get all 8 sprites rotating (was testing with just two) - took a while to figure out howto change character code in sprite attribute table, but once figured that out was ok Will work in the 8 sprites next week & have a (hopefully) nice example to show cheers Daryn 3 Quote Link to comment Share on other sites More sharing options...
palmheads Posted February 15, 2015 Share Posted February 15, 2015 (edited) Hey Rasmus - have implemented something that almost exactly matches your first suggestion above - won't post anything until I get all 8 sprites rotating (was testing with just two) - took a while to figure out howto change character code in sprite attribute table, but once figured that out was ok Will work in the 8 sprites next week & have a (hopefully) nice example to show cheers Daryn Got something mostly working with sprite rotation. Not perfect, but can improve on it over time. Rotate Left: Z Rotate Right: C TI arrows keys up/down/left/right aorg >7d00 ;starting loc for mini mem lwpi >70b8 ;load registers li r0,>0420 li r1,df ;sprite 0 def starting sprite li r2,256 blwp @>6028 li r0,>0300 li r1,dt ;sprite 0 attr li r2,5 blwp @>6028 li r0,>01e2 ;sprite magnify 2 swpb r0 ;once interupts enabled, need this movb r0,@>83d4 ;and this because kscan is used swpb r0 ;and this, because r1 is used blwp @>6034 clr @>8374 ;clearing for keyscan li r7,>0000 ;record where sprite is li r13,00 lp limi 2 limi 0 ks blwp @>6020 ;keyscan clr r3 mov @>8374,r3 ;ascii key to r3 li r0,>0301 ;move along row clr r7 ;prepare r7 for row value blwp @>602c ;read row value movb r1,r7 ;move to left byte of r1 ci r3,83 ;s key jne $+10 ai r1,->0100 ;move left blwp @>6024 ;write to sprite attr ci r3,68 ;d key jne $+10 ai r1,>0100 ;move right blwp @>6024 ;write to sprite attr li r0,>0300 ;move along col blwp @>602c ;read col value swpb r1 ;move to right byte of r1 ci r3,69 ;e key jne $+10 ai r1,->0100 ;move up blwp @>6024 ;write to sprite attr ci r3,88 ;x key jne $+10 ai r1,>0100 ;move down blwp @>6024 ;write to sprite attr ci r3,90 ;z key - rotate jne $+8 jeq rl blwp @>6024 ;write to sprite attr ci r3,67 ;c key - rotate jne $+8 jeq rr blwp @>6024 ;write to sprite attr li r15,500 ;needed time delay dec r15 ;for sprite movement jne $-2 jmp lp ut li r0,>0302 mov r13,r1 sla r1,2 ai r1,>84 swpb r1 li r2,2 ;send 2 bytes blwp @>6024 ;write bytes back jmp ks rl inc r13 andi r13,7 li r15,8000 ;needed time delay dec r15 ;for sprite rotation jne $-2 jeq ut rr dec r13 andi r13,7 li r15,8000 ;needed time delay dec r15 ;for sprite rotation jne $-2 jeq ut df data >0102,>0204,>0408,>0810 ;sprite 0 - 4 cnrs data >1060,>8040,>2023,>1408 ;main thrust sprite data >0080,>8040,>4020,>2010 data >100c,>0204,>0888,>5020 data >3028,>2423,>2020,>2020 ;top left data >2020,>4080,>4132,>0A04 data >0000,>0000,>8040,>3804 data >0408,>0810,>D020,>0000 data >0000,>0000,>0106,>1860 ;left data >8060,>1806,>0100,>0000 data >0020,>504C,>8201,>0204 data >0404,>0201,>824C,>5020 data >0000,>0102,>0202,>0408 ;bottom left data >1010,>2040,>80FF,>0000 data >0000,>8060,>1804,>0808 data >0806,>0102,>04C4,>2810 data >040A,>1110,>2040,>3008 data >0804,>0402,>0201,>0100 ;sprite 1 data >1028,>C404,>0201,>0608 ;reverse main sprite data >0810,>1020,>2040,>4080 data >0000,>040B,>0810,>1020 ;bottom right data >201C,>0201,>0000,>0000 data >2050,>4C82,>0102,>0404 data >0404,>0404,>C424,>140C data >040A,>3241,>8040,>2020 ;right data >2040,>8041,>320A,>0400 data >0000,>0080,>6018,>0601 data >0618,>6080,>0000,>0000 data >0000,>0000,>0102,>1C20 ;top right data >2010,>1008,>0B04,>0000 data >0C14,>24C4,>0404,>0404 data >0404,>0201,>824C,>5020 dt data >0000,>8401,>d000 ;8401 - black aorg >701c data >7d1e data >7fe0 aorg >7fe0 text 'ROTATE' ;name of program data >7d00 ;starting location end I think I'II leave the physics elements of 'Thrust' until the end. Basics first! More knowledge in assembly needed before I tackle that complexity. Next thing I'II work on is too have my sprite collide with another sprite and maybe a wall! Small steps, but slowly getting the hang of it. cheers Daryn Edited February 15, 2015 by palmheads Quote Link to comment Share on other sites More sharing options...
palmheads Posted February 22, 2015 Share Posted February 22, 2015 I think I'II leave the physics elements of 'Thrust' until the end. Basics first! More knowledge in assembly needed before I tackle that complexity. Next thing I'II work on is too have my sprite collide with another sprite and maybe a wall! Small steps, but slowly getting the hang of it. cheers Daryn OK got some pretty basic collision detection working with sprite collision - demo just freezes (on purpose) when sprite my "Thrust" sprite hits the "Reactor" sprite aorg >7d00 ;starting loc for mini mem lwpi >70b8 ;load registers li r0,>0420 li r1,dataf ;sprite 0 def starting sprite li r2,288 blwp @>6028 li r0,>0300 li r1,datat ;sprite 0 attr li r2,9 blwp @>6028 li r0,>01e2 ;sprite magnify 3 swpb r0 ;once interupts enabled, need this movb r0,@>83d4 ;and this because kscan is used swpb r0 ;and this, because r1 is used blwp @>6034 clr @>8374 ;clearing for keyscan li r7,>0000 ;record where sprite is li r13,00 loop limi 2 limi 0 blwp @>6020 ;keyscan clr r3 mov @>8374,r3 ;ascii key to r3 li r0,>0300 ;move along col clr r7 ;prepare r7 for row value blwp @>602c ;read col value swpb r1 movb r1,r14 ;up and down keys ci r3,69 ;e key jne $+10 ai r1,->0100 ;move up blwp @>6024 ;write to sprite attr ci r3,88 ;x key jne $+10 ai r1,>0100 ;move down blwp @>6024 ;write to sprite attr li r0,>0301 ;move along row clr r7 ;prepare r7 for row value blwp @>602c ;read row value movb r1,r7 ;move to left byte of r1 ;left and right keys ci r3,83 ;s key jne $+10 ai r1,->0100 ;move left blwp @>6024 ;write to sprite attr ci r3,68 ;d key jne $+10 ai r1,>0100 ;move right blwp @>6024 ;write to sprite attr ;rotate keys ci r3,90 ;z key - rotate jne $+8 jeq rotl blwp @>6024 ;write to sprite attr ci r3,67 ;c key - rotate jne $+8 jeq rotr blwp @>6024 ;write to sprite attr li r15,500 ;needed time delay dec r15 ;for sprite movement jne $-2 ;possible crash clr r8 ;collision detection clr r10 movb r14,r8 swpb r8 clr r10 li r0,>0304 blwp @>602c movb r1,r10 swpb r10 s r10,r8 abs r8 ci r8,>000e jgt loop clr r8 movb r7,r8 swpb r8 clr r10 li r0,>0305 blwp @>602c movb r1,r10 swpb r10 s r10,r8 abs r8 ci r8,>000e jgt loop ;got a collision!!! jmp $ ;freeze screen updatat li r0,>0302 mov r13,r1 sla r1,2 ai r1,>84 swpb r1 li r2,2 ;send 2 bytes blwp @>6024 ;write bytes back jmp loop rotl inc r13 andi r13,7 li r15,8000 ;needed time delay dec r15 ;for sprite rotation jne $-2 jeq updatat rotr dec r13 andi r13,7 li r15,8000 ;needed time delay dec r15 ;for sprite rotation jne $-2 jeq updatat dataf data >0102,>0204,>0408,>0810 ;sprite 0 - 4 cnrs data >1060,>8040,>2023,>1408 ;main thrust sprite data >0080,>8040,>4020,>2010 data >100c,>0204,>0888,>5020 data >3028,>2423,>2020,>2020 ;top left data >2020,>4080,>4132,>0a04 data >0000,>0000,>8040,>3804 data >0408,>0810,>d020,>0000 data >0000,>0000,>0106,>1860 ;left data >8060,>1806,>0100,>0000 data >0020,>504c,>8201,>0204 data >0404,>0201,>824c,>5020 data >0000,>0102,>0202,>0408 ;bottom left data >1010,>2040,>80ff,>0000 data >0000,>8060,>1804,>0808 data >0806,>0102,>04c4,>2810 data >040a,>1110,>2040,>3008 data >0804,>0402,>0201,>0100 ;sprite 1 data >1028,>c404,>0201,>0608 ;reverse main sprite data >0810,>1020,>2040,>4080 data >0000,>040b,>0810,>1020 ;bottom right data >201c,>0201,>0000,>0000 data >2050,>4c82,>0102,>0404 data >0404,>0404,>c424,>140c data >040a,>3241,>8040,>2020 ;right data >2040,>8041,>320a,>0400 data >0000,>0080,>6018,>0601 data >0618,>6080,>0000,>0000 data >0000,>0000,>0102,>1c20 ;top right data >2010,>1008,>0b04,>0000 data >0c14,>24c4,>0404,>0404 data >0404,>0201,>824c,>5020 data >0007,>1820,>4040,>8080 ;reactor data >8040,>4020,>ff80,>b0b0 data >0c80,>6e1a,>0a0a,>0a0a data >0a0a,>0a0a,>fb01,>0101 datat data >0000,>8401,>5030,>a404,>d000 ;8401 - black aorg >701c data >7d1e data >7fe0 aorg >7fe0 text 'COLLID' ;name of program data >7d00 ;starting location end Next thing to work on - cavern wall detection! I guess for this you set an out of bounds error within the screen (i.e some sort of contraint) where the if the sprite hits the "wall" its a collision? Will give it a go! cheers Daryn 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.