jum Posted July 1 Share Posted July 1 (edited) I've been learning 6502 / Lynx assembler programming by writing the attached simple game project (WIP), using Lyxass assembler. It's been more fun and less painful than I thought It might be some use to those just starting or thinking about starting Lynx assembler programming. I would also appreciate some feedback from experienced 6502 ASM programmers on what I'm doing wrong/badly, or suggestions for improving the code. The latest runnable is "para.lnx" attached. Update 2024-07-22: Added title screen, more sound effects, more animation, game over sequence. Update 2024-08-05: More sound effects, more animation, hi-score, difficulty curve, bomber appears when score > 170, some fixes. paratroopers.zip para_090.lnx Edited August 5 by jum update latest version (again) 8 1 Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted July 1 Share Posted July 1 I'm so glad somebody did this! (A riff on the old Apple II game Sabotage!) 1 Quote Link to comment Share on other sites More sharing options...
+bhall408 Posted July 1 Share Posted July 1 Question to everyone -- doing this on Lynx opens up the possbility of doing it portrait (Tate) rather than landscape. Would that be better, or just different? Quote Link to comment Share on other sites More sharing options...
42bs Posted July 1 Share Posted July 1 3 minutes ago, jum said: I've been learning 6502 / Lynx assembler programming by writing the attached simple game project (WIP), using Lyxass assembler. It's been more fun and less painful than I thought It might be some use to those just starting or thinking about starting Lynx assembler programming. I would also appreciate some feedback from experienced 6502 ASM programmers on what I'm doing wrong/badly, or suggestions for improving the code. The runnable is "para.o" in the zip. paratroopers.zip 46.98 kB · 0 downloads Some note: Withing BEGIN_ZP/END_ZP only the location counter will be advanced. So BEGIN_ZP dc.b 10 END_ZP is the same as BEGIN_ZP ds 1 END_ZP So the value "10" will not be stored. SPRSYS cannot be read, instead you need to use the shadow register: ; Enable collision (SPRSYS ($FC92) &= $df) LDA SPRSYS AND #$DF STA SPRSYS Should be ; Enable collision (SPRSYS ($FC92) &= $df) LDA _SPRSYS AND #$DF STA SPRSYS STA _SPRSYS (See INITSUZY macro). Rather use "BIT" instead of "AND" LDA JOYPAD STA joypadValue AND #JOY_LEFT ; Sets Z flag if result = 0 BEQ .checkRight ; branch if Z = 1 (set by AND) ; Rotate anticlockwise ... .checkRight LDA joypadValue ; in case A altered above AND #JOY_RIGHT BEQ .updateSprite ; AND result = 0 ; Rotate clockwise => LDA JOYPAD STA joypadValue BIT #JOY_LEFT ; Sets Z flag if result = 0 BEQ .checkRight ; branch if Z = 1 (set by AND) ; Rotate anticlockwise ... .checkRight ;;; LDA joypadValue ; in case A altered above BIT #JOY_RIGHT BEQ .updateSprite ; AND result = 0 ; Rotate clockwise 1 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted July 1 Share Posted July 1 Next on tables: If possible split tables into lo and hi table. No need to multiply by 2 and incremt index: LDA playerAngle ; 0 -> 32 LSR LSR ; divide by 4 (range 0 -> 8) ASL ; multi by 2 for table word offset TAY LDA playerSprPtrs,y STA playerSCB + scbFieldImage iNY LDA playerSprPtrs,y STA playerSCB + scbFieldImage + 1 => LDA playerAngle ; 0 -> 32 LSR LSR ; divide by 4 (range 0 -> 8) TAY LDA playerSprPtrs_lo,y STA playerSCB + scbFieldImage LDA playerSprPtrs_hi,y STA playerSCB + scbFieldImage + 1 "LDA #0, STA .." => "STZ " (unless A is used later) 1 1 Quote Link to comment Share on other sites More sharing options...
jum Posted July 1 Author Share Posted July 1 Thank you 42bs, that's awesome feedback ! 👍 The things you mention (except the SPRSYS thing) are all things I actually wondered about at the time. I know about STZ being 65C02 instruction, but I need to study the other differences to "plain" 6502 opcodes. As a C and C++ programmer, it's hard for me to think in terms of tables instead of structs and arrays and maths operations. Quote Link to comment Share on other sites More sharing options...
jum Posted July 1 Author Share Posted July 1 32 minutes ago, bhall408 said: I'm so glad somebody did this! (A riff on the old Apple II game Sabotage!) I have good memories of playing this on an Appie II in 1982 1 Quote Link to comment Share on other sites More sharing options...
+ZeroPage Homebrew Posted July 2 Share Posted July 2 ZeroPage Homebrew is playing Paratroopers on today's ZPH stream LIVE on Twitch! Hope you can join us! Tue Jul 2, 2024 | LIVE @ 6PM PT | 9PM ET | 1AM GMT+1Day WATCH LIVE: https://twitch.tv/zeropagehomebrew/ WATCH LATER: https://youtube.com/zeropagehomebrew/ Games: Fury (2024 Final | Lynx) by Brek Martin @Brek Martin Powernoid (2024 WIP | Lynx) by Brek Martin @Brek Martin Bubbler (2024 WIP | Lynx) by KanedaFr @KanedaFr Paratroopers (2024 WIP | Lynx) by James Higgs @jum 1 Quote Link to comment Share on other sites More sharing options...
Brek Martin Posted July 6 Share Posted July 6 (edited) You should keep going and polish this. I get some weird screen artefacts on handy emu, but Felix is fine. Edited July 6 by Brek Martin 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted July 6 Share Posted July 6 Forget about Handy, Felix is the Gold Standard now for Lynx emulation. If it works on real HW and on Felix, it is fine. 3 1 Quote Link to comment Share on other sites More sharing options...
jum Posted July 14 Author Share Posted July 14 Latest version: - Some sound - Fragments from heli and base explosion - Troopers attack base and blow it up when 4 or more land on either side of the base - other things for you to find out para.o 3 Quote Link to comment Share on other sites More sharing options...
Brek Martin Posted July 15 Share Posted July 15 Thanks. I guess you just add the 64 byte header to make a lnx file out of it. I'll have a go today. Quote Link to comment Share on other sites More sharing options...
42bs Posted July 15 Share Posted July 15 (edited) 1 hour ago, Brek Martin said: Thanks. I guess you just add the 64 byte header to make a lnx file out of it. I'll have a go today. No, it is a .o file not a .lyx file. It needs a loader to become a ROM file: https://github.com/42Bastian/new_bll/blob/master/uloader/readme.md But at least lynxGD can load it directly. Or use serial upload via uBLL or BLL loader. Edited July 15 by 42bs Quote Link to comment Share on other sites More sharing options...
42bs Posted July 15 Share Posted July 15 (edited) cat $BLL_ROOT/uloader/bll.enc para.o > para.lyx make_lnx para.lyx -b0 256k Edit: Order of parameters fixed. Attached result. para.lnx Edited July 17 by 42bs 3 Quote Link to comment Share on other sites More sharing options...
Brek Martin Posted July 15 Share Posted July 15 2 hours ago, 42bs said: cat $BLL_ROOT/uloader/bll.enc para.o > para.lyx make_lnx -b0 256k para.lyx Attached result. para.lnx 256.06 kB · 2 downloads Thanks, it just seems neater. But I don't want to encourage tate mode, which can be defined in that header! I'm still liking it on real Lynx, but I die before long, overrun by the troops on the ground. Quote Link to comment Share on other sites More sharing options...
jum Posted July 17 Author Share Posted July 17 Another update (see para.o file in first post). It is now a complete "game", however it starts off on max difficulty. IN future I will add increasing difficulty. Also note I spent a few minutes trying to produce a .lnx cartridge image, but no luck. This is what I was trying (Windows 11 cmd line): copy /b bll.enc + para.o para.lyx make_lnx -b0 256K para.lyx ERROR: Unrecognised argument (256K) make_lnx para.lyx ERROR: Could not determine page size, please set via command line ERROR: (Your file is not of the correct length, it may be corrupted) Which seems to indicate that the copy is not producing the right thing. Quote Link to comment Share on other sites More sharing options...
42bs Posted July 17 Share Posted July 17 (edited) Sorry, it is make_lnx para.lyx -b0 256K USAGE: make_lnx <infile> (Optional params) -o Output filename (Default=<infile>.lnx) -m Manufacturer (Default=Atari) -r Left/Right (Default=No rotate) -g Game name (Default=<infile>.lnx) -b0 Bank0 size (Default=Autocalc, options 0K,64K,128K,256K,512K) -b1 Bank1 size (Default=0K, options 0K,64K,128K,256K,512K) Edited July 17 by 42bs 1 Quote Link to comment Share on other sites More sharing options...
jum Posted July 22 Author Share Posted July 22 Update 2024-07-22: Added title screen, more sound effects, more animation, game over sequence. Still need to add increasing difficulty. 1 Quote Link to comment Share on other sites More sharing options...
jum Posted August 5 Author Share Posted August 5 Update 2024-08-05: More sound effects, more animation, hi-score, difficulty curve, bomber appears when score > 170, some fixes. It is now a fully playable game. See "para_090.lnx" in the first post. 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted August 5 Share Posted August 5 (edited) 26 minutes ago, jum said: Update 2024-08-05: More sound effects, more animation, hi-score, difficulty curve, bomber appears when score > 170, some fixes. It is now a fully playable game. See "para_090.lnx" in the first post. Not played yet, but how about saving hiscore? And nice blue sky with rasters. Edited August 5 by 42bs 1 Quote Link to comment Share on other sites More sharing options...
jum Posted August 5 Author Share Posted August 5 1 hour ago, 42bs said: Not played yet, but how about saving hiscore? And nice blue sky with rasters. Could possibly add hiscore save to EEPROM. HBL interrupt is already used to do the "background" sky and ground, I need to find a nice sky gradient. Don't want to move to far from the Apple II version "feel". Quote Link to comment Share on other sites More sharing options...
+ZeroPage Homebrew Posted Tuesday at 07:11 PM Share Posted Tuesday at 07:11 PM ZeroPage Homebrew is playing Paratroopers on today's ZPH stream LIVE on Twitch! Hope you can join us! Tue Sep 3, 2024 | LIVE @ 6PM PT | 9PM ET | 1AM GMT+1Day WATCH LIVE: https://twitch.tv/zeropagehomebrew/ WATCH LATER: https://youtube.com/zeropagehomebrew/ Games: Star Blader (2024 Exclusive WIP Update) by RetroGuru / Gisberto Rondinella @Nop90 (Code) / Simon Butler (Graphics) / Michał Szpilowski @miker (Music) Gotcha Gun (WIP | Lynx) by Oceo Team / Gisberto Rondinella @Nop90 (Code) / Martial Daviaud @marss (Graphics) / Michał Szpilowski @miker (Music) Fruit'Y (2024 Final | Lynx) by RetroGuru / Gisberto Rondinella @Nop90 (Code) / Michał Szpilowski @miker (Music Conversion) / Jonathan 'Dulcahn' Dodd (Graphics Conversion) / Shahzad Sahaib @Kojote Paratroopers (2024 WIP | Lynx) by James Higgs @jum 1 Quote Link to comment Share on other sites More sharing options...
obschan Posted Wednesday at 12:42 AM Share Posted Wednesday at 12:42 AM It could be nice to have a unique sticky to gather all the ZPH updates rather than posting on each separate threads. Quote Link to comment Share on other sites More sharing options...
Songbird Posted Wednesday at 02:00 AM Share Posted Wednesday at 02:00 AM Nice demo, James! I would also recommend EEPROM save for high score, and a gradient background would be neat too. 1 Quote Link to comment Share on other sites More sharing options...
+ZeroPage Homebrew Posted Wednesday at 03:59 AM Share Posted Wednesday at 03:59 AM 3 hours ago, obschan said: It could be nice to have a unique sticky to gather all the ZPH updates rather than posting on each separate threads. You bet! You can check out every single past show and upcoming show on my ZPH Schedule. I post on these threads so that the developer and fans of the games are alerted I'm playing their game and when. Usually this results in the developers jump into the chat and answer questions during the live broadcast like Nop90 did for his three games I featured tonight. Plus it alerts people to exclusive updates of games they won't see anywhere else like I had for Star Blader! 🙂 Also, @jum while I was playing tonight I wrapped the score past 255 and it started at 0 again with the easy level. I'm sure you're already aware but I thought I'd let you know. It's super fun and looking forward to more updates! - James 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.