horsie Posted April 30, 2014 Share Posted April 30, 2014 Hi folks, I disassembled this game but with zero experience in this type of assembler I got nowhere. Hopefully an expert can at least give me an idea if this suggestion is feasible. The disassembled code is attached. Basically what I'd like to do is modify the Energy variable, which is limited to two digits, to allow values over 99 - say, up to 999. This is a good example of a game designed without an awareness of how good the player could get, thus limiting itself at the highest level of play. You can see how annoying this was. The Energy variable in question is the second one in the display: The purpose is that this would solve the problem of the energy rolling over past 99: Once you die, the game typically will credit you with 5 bonus energy points for hitting a 10,000 multiple in your score during that round. Unfortunately this rolls the energy over, leaving you on 4; and, after subtracting 5 Energy penalty for dying, drops you to ZERO = Game Over. The skilfull player can reach 99 when the game really gets going as shooting enemies builds your energy. Because 99 is the ceiling for energy in gameplay (not counting rollover bonus), if it went all the way up to 999 then you could really find out how good you are! Does this sound doable? Or, is it impossible to alter the binary to give an extra 'digit' in this way. Or would it just be very difficult to do so? I'm hoping it's just a matter of identifying where the variable is allocated and making a single change. If there's a keen person out there that can figure this out for me I'd really appreciate it. It's bugged us for years (this game goes way back for my family!) but I just thought I'd ask. Someone could even post the HEX sequence to search for & which changes to make I could look it up and make the alteration to my own binary. Alien Swarm info: http://www.atarimania.com/game-atari-400-800-xl-xe-alien-swarm_202.html Thanks for reading. P.S. I have a suggestion for a second hack: speed up the laborious "counting down bonus" at the end of round during which surplus energy (>20) is converted into points. This may be more difficult as it's due to timing? 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted April 30, 2014 Share Posted April 30, 2014 (edited) So you want to prevent the overflow "99" => "00", right? From the code there is a range check to do this, but I have to check by playing the game (can't do that now) ldx L2B78 sed lda L2B75,X clc adc #$01 cld bcc L1F72 lda #$99 L1F72 The delay for the counting is probably here: L2079 lda #$E1 // Cange to $FF sta RTCLOK+2 L207D lda RTCLOK+2 bne L207D Edited April 30, 2014 by JAC! 2 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted July 16, 2014 Share Posted July 16, 2014 (edited) Nice game. Didn't get far with keyboard control (I'm a joystick guy) but yesterday I felt like hacking, so here's a version with - fixed roll-over bug for energy when you score 10.000 points - higher speed in the level end sequence and bonus counting - faster sprite drawing - FIRE button to start in addition the the START button - Adapted title screen (flashing, positioning) Not sure if the 3 digit counter is still required now. If this version works, I could add it if required. Edited July 16, 2014 by JAC! 1 Quote Link to comment Share on other sites More sharing options...
Xuel Posted July 16, 2014 Share Posted July 16, 2014 Hi JAC! I'm getting some weird behavior from your version: Also, it crashed with this trace after a while: 4) T=02230|256, 54 A=1e X=00 Y=c8 S=ff P=30 ( 1B ) 15F7: D0 03 BNE $15FC 3) T=02230|256, 58 A=1e X=00 Y=c8 S=ff P=30 ( 1B ) 15FC: 20 8D 1B L15FC JSR $1B8D [$1B8D] = $AD 2) T=02230|256, 64 A=1e X=00 Y=c8 S=fd P=30 ( 1B ) 1B8D: AD D4 27 L1B8D LDA $27D4 [$27D4] = $11 1) T=02230|256, 68 A=11 X=00 Y=c8 S=fd P=30 ( 1B ) 1B90: C9 37 CMP #$37 0) T=02230|256, 70 A=11 X=00 Y=c8 S=fd P=b0 (N 1B ) 1B92: 00 09 BRK #$09 On screen at the time: Quote Link to comment Share on other sites More sharing options...
+JAC! Posted July 16, 2014 Share Posted July 16, 2014 (edited) This is madness. Just found that MADS has a bug there...from the list file: 00 137B L13AF 683 13C1 .proc l13f5 684 13C1 20 C1 13 jsr l13af so it totally messes up PROC labels somehow. I'll try an older MADS version... Same down to 1.9.2 and I can even make is issue "BRANCH TOO FAR" even though is not too far. I'll post in the MADS thread. Edited July 16, 2014 by JAC! Quote Link to comment Share on other sites More sharing options...
+JAC! Posted July 25, 2014 Share Posted July 25, 2014 (edited) Nex try with fixed compiler. Still have no joytick to play it longer (or at least half way correct), but I did not run into issues with this version. Please tell, if you find issues. Edited July 25, 2014 by JAC! 2 Quote Link to comment Share on other sites More sharing options...
horsie Posted August 2, 2014 Author Share Posted August 2, 2014 (edited) Hi JAC! Thanks for the great job you've done. I'm really impressed and it works just fine so far. There's one small "problem" in that the version I was used to play many years ago must have been a different one. In the version you're working on, at 70,000 points the snake behaviour changes in that there's no longer a pause - and accompanying sound effect - while it lays another 'Bug'.... it just keeps moving all the time. In the version I used to play this didn't happen; instead the snake grew shorter and shorter due to the pause and quicker laying of 'Bugs'. Would it possible for you to take out this conditional test on the score? As it stands it's not possible to rack up power points the same way. If you could remove this 70,000 point gameplay change I'd be super grateful. BTW, this makes me suspect this feature that makes the game harder is the way the game was originally designed and the version I played on was a hack of sorts. Edited August 2, 2014 by horsie Quote Link to comment Share on other sites More sharing options...
+JAC! Posted August 5, 2014 Share Posted August 5, 2014 In fact from what I've seen, two versions have been released comercially. V0.6 is the only you posted and which appears to be the later/more complete one. And yes, the features seem to be intended to make the game even harder at that stage. Version (unnamed): http://www.atarimania.com/game-atari-400-800-xl-xe-alien-swarm_21271.html Version 0.6: http://www.atarimania.com/game-atari-400-800-xl-xe-alien-swarm_202.html Looking at the binaries the unnamed version is lacking about 10% of the game logic, including that 70.000 points check. I think it's not unlikely other versions also floated around. Anyway, here a version which keeps the longer break beyond 70.000 points. Quote Link to comment Share on other sites More sharing options...
horsie Posted August 13, 2014 Author Share Posted August 13, 2014 Interesting. Thanks so much for this "fix". Do you think it is possible to change the power point counter from a two-digit number to a three digit one? As it is it levels off at 99. I don't want to cause extra work as you've already ensured it doesn't roll-over to zero with the 5 PP bonus upon dying then counting down 5 killing off the game... Quote Link to comment Share on other sites More sharing options...
+JAC! Posted August 31, 2014 Share Posted August 31, 2014 (edited) That was a hard one. Changing 8 bit BCD arithmetics to 16-bit BCD is hard in foreign code. This one now has 4 digit energy with maximum 9999. No idea if it works, I don't get anywhere near that by playing the game :-) Edited August 31, 2014 by JAC! 1 Quote Link to comment Share on other sites More sharing options...
horsie Posted September 6, 2014 Author Share Posted September 6, 2014 Thanks again! I tested it and it ticks over 99 just fine. Unfortunately when the bonus counts down it gets stuck at 100. I've attached a save state for you to test. You just need to fire once to use up the last amount of fuel, then the +5 bonus ticks it over 99. BTW, save state is from Altirra 2.50. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 6, 2014 Share Posted September 6, 2014 >I've attached a save state for you to test. No, you didn't :-) Quote Link to comment Share on other sites More sharing options...
horsie Posted September 11, 2014 Author Share Posted September 11, 2014 Lol, sorry. I selected it but forgot to 'Add to post'. 100.zip Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 12, 2014 Share Posted September 12, 2014 Crashes here in Altirra 2.50 final after reporting that the state uses a different OS ROM. Which exact configuration did you use? Quote Link to comment Share on other sites More sharing options...
horsie Posted September 13, 2014 Author Share Posted September 13, 2014 Hardware: 600xl/800xl Firmware: default Memory size: 320k (Rambo) Video: PAL These were probably the default settings. I don't think I've changed any other settings. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 15, 2014 Share Posted September 15, 2014 I can't get the altstate file to load. The first CIO call leads to a crash of the 6502. Do the file work for anybody here? Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 15, 2014 Share Posted September 15, 2014 (edited) @horsie: Can you PM me the OS ROM file you have used. In fact it looks like the crash results from a wrong ROM entry point. Edited September 15, 2014 by JAC! Quote Link to comment Share on other sites More sharing options...
horsie Posted September 18, 2014 Author Share Posted September 18, 2014 JAC, It seems I don't have any ROMs in the folder. Acccording to the help file under Default under Firmware Options: "Chooses either the OS-B ROM for 800 hardware or the XL ROM for 800XL hardware if available; otherwise, defaults to the built-in HLE kernel." [HLE=High-level emulation] Presumably if you remove any ROM files you've added then it should work! Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 18, 2014 Share Posted September 18, 2014 In fact that is the only way to make it work because the Rom choice "default" is also restored from the state Have a fix now plus one that Paul Lay found. Will upload it tomorrow. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 19, 2014 Share Posted September 19, 2014 Here's an update with fixes from Paul (thanks a ton!) included and some more: ; - XEX format and a load address of $4000, so it can be loaded from any regular Atari DOS ; - a 4 digit energy counter and display ; - a fix zero page corruption bug that was present in the original game when placing red saucers on the very bottom of the screen ; - support for ESC key to quit the game in addition to the INVERSE key I re-merged his 5200 port my my original back into a single source that can be compiled to both Atari 5200 ROM and Atari 800 XEX.The 5200 version still has flaw in my routine to read the controller, but I'll included once that's fixed. That may be the basis for the "how to convert and XL game to a 5200er game" tutorial that I never planned :-) Since my skill are faaar from getting to testing if the "100"s bug is fixed, please test for yourself. 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 19, 2014 Share Posted September 19, 2014 (edited) Paul just finished the code review and found 2 more places where the 4-digit logic was not correct and too much or too less energy will be counted when >100.. The amount of conditional code I kept in to be always able to "get back" step by step to the original, definitively requires 4 eyes principle. lda player_energy_lo,x .if .def JAC_ENERGY ora player_energy_hi,x .endif beq out_of_energy_l1fec .if .def JAC_ENERGY lda player_energy_lo,x .endif sed sec sbc #$01 .if .not .def JAC_ENERGY cld sta player_energy_lo,x .else sta player_energy_lo,x lda player_energy_hi,x sbc #0 sta player_energy_hi,x ora player_energy_lo,x cld .endif So stay tuned for the next update. Edited September 19, 2014 by JAC! Quote Link to comment Share on other sites More sharing options...
horsie Posted September 23, 2014 Author Share Posted September 23, 2014 Since my skill are faaar from getting to testing if the "100"s bug is fixed, please test for yourself. Unfortunately, the problem remains. Thanks as always for your efforts. 100+.zip Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 23, 2014 Share Posted September 23, 2014 (edited) Yeah, as mentioned my previous post, I still have to incorporate Paul's feedback. Edited September 23, 2014 by JAC! Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 23, 2014 Share Posted September 23, 2014 There you are. This now includes the (hopefully final) fixes for the 4-digit energy plus the 5200 port and the related sources. l learned a lot about the 5200 based on this and maybe one day there'll be a "How to convert to Atari 5200" video tutorial based on this. 2 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted September 23, 2014 Share Posted September 23, 2014 (edited) Isn't every version somehow "hopefully final" :-) My "chief source manager" Paul spotted a copy & paste error that I added when implementing the last fix. And he provided me with a simple way for testing. So finally I managed to verify that my fix works now and the countdown from >100 works. And isn't there a way to remove the old outdated attachments? I remember there was a way before the forum upgrade. AlienSwarm.zip Edited September 23, 2014 by JAC! 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.