Bill Lange Posted January 5, 2002 Share Posted January 5, 2002 I was bored at work today and wrote a few hundred lines of assembly code with the Atari Assembler/Editor cartridge that copies the "eyes" from the 2600 game Haunted House. Is anyone willing to look at the code and critic the Joystick routine and the code that changes the "eyes" bitmap data when the direction of the joystick is changed? Basically the joystick code reads the joystick and if its $F, it centers the eyes, if not, it JMPs to check to see if left ... then right ... then up ... then down. Seems like I should use a table indexed by the joystick position value or something more effiecient. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 6, 2002 Share Posted January 6, 2002 yes. karolj_nadj@web.de Quote Link to comment Share on other sites More sharing options...
Bill Lange Posted January 7, 2002 Author Share Posted January 7, 2002 Here is my joystick reading routine - Seems there should be a more effcient way of handling it. Also, since I change my bitmap depending on the JS direction, I need to check to see if the direction changed since the last time through ... if it hasn't, no need to re-image the bitmap. What do you think. 1390 ; READ JOYSTICK 1400 ; 1410 RDSTIK 1420 LDA #4 1430 ORA PACTL 1440 ; 1450 LDA STICK0 1460 CMP #$F; stick centered 1470 BNE JSRIGHT 1480 LDA #$0 1490 STA EYEOFS 1500 JSR DRAWPL 1510 JMP RETURN 1520 ; 1530 JSRIGHT 1540 CMP #$07 1550 BNE JSLEFT 1560 LDA #$14 1570 STA EYEOFS 1580 LDX HRZPTR 1590 INX 1600 STX HRZPTR 1610 STX HPOSP0 1620 JSR DRAWPL 1630 JMP RETURN 1640 ; 1650 JSLEFT 1660 CMP #$0B 1670 BNE JSDOWN 1680 LDA #$F 1690 STA EYEOFS 1700 LDX HRZPTR 1710 DEX 1720 STX HRZPTR 1730 STX HPOSP0 1740 JSR DRAWPL 1750 JMP RETURN 1760 ; 1770 JSDOWN 1780 CMP #$0D 1790 BNE JSUP 1800 LDA #$A 1810 STA EYEOFS 1820 INC VRTPTR 1830 JSR DRAWPL 1840 JMP RETURN 1850 ; 1860 JSUP 1870 CMP #$0E; 1880 BNE RETURN 1890 LDA #$5 1900 STA EYEOFS 1910 DEC VRTPTR 1920 JSR DRAWPL 1930 JMP RETURN Quote Link to comment Share on other sites More sharing options...
Bill Lange Posted January 7, 2002 Author Share Posted January 7, 2002 I guess this should be moved to the programming section .... 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.