Jump to content
IGNORED

Flashback Portable: Needed Controller Hacks


doctorclu

Recommended Posts

  • 1 month later...

Arcade Pong (FB2):

For some odd reason, the programmer called an HMOVE 21 cycles into a scanline. Removing that, the ball reacts properly now. I also trimmed the program size down from 3k to 2k and corrected the scanline count to 262.

Love it! Now I can play a one player round of Pong!!! Thanks Nukey!

Link to comment
Share on other sites

  • 2 months later...

http://atariage.com/forums/topic/259166-flashback-portable-needed-controller-hacks/page-8?do=findComment&comment=3677232

Yes, that matches behavior in Stella. Game screens that DO migrate downward have been pretty obvious so far.

 

Directional controller hack to Beat'Em & Eat'Em:

 

Are there any joystick directional controller hack for Philly Flasher?

Edited by doctorclu
Link to comment
Share on other sites

  • 4 weeks later...

Can Threshold be fixed for FBP?

 

Games Hacked to work on the Atari Flashback Portable.

 

Star Raiders 2600 - (By Nukey Shay)

Tapper - (By Nukey Shay)

BudTapper - (By Nukey Shay)

Acid Drop - (By Thomas Jentzsch)

Custer (portable) - (By Nukey Shay)
Enduro (portable) - (By Nukey Shay)
Jawbreaker (portable) - (By Nukey Shay)
Lochjaw (portable) - (By Nukey Shay)
Marauder (portable) - (By Nukey Shay)
Sharkattack (portable) - (By Nukey Shay)
Squeezebox (portable) - (By Nukey Shay)
Wordsattack (portable) - (By Nukey Shay)

Man-4K pac 1_3 - (By Debro)

Defender 2 - (By Nukey Shay)

Fix It Felix - (By Cybearg)

Raiders of the Lost Ark - (By Nukey Shay)

Circus (Circus Atari w/ a Joystick) - (By Zellers (Company)

Bloody Human Freeway - (By Nukey Shay)

Freeway - (By Nukey Shay) (first two player game on the AFP!)

Nackgammon (portable) - (By Nukey Shay)

Defender arcade (portable) - (By Nukey Shay)

Asteroids (alternate control) - (By Nukey Shay)

Spyhunter (portable) - (By Nukey Shay)

Star Trek (portable) - (By Nukey Shay)

Beamrider (portable) - (By Nukey Shay)

Beat'em and eat'em (portable) - (By Nukey Shay)

Spy Hunter (Black) - (By Nukey Shay with color mod by KevinMos3)

Spy Hunter (Gray) - (By Nukey Shay with color mod by KevinMos3)

Berzerk - (opening screen modified for Flashback by KevinMos3 w/Nukey Shay fix)

Berzerk (fixed for Portable) - (By Nukey Shay)

Berzerk 2player (portable) - (By Nukey Shay)

Bumperbash (portable) - (By Nukey Shay)

Towering Inferno (portable) - (By Nukey Shay)

Wizard of Wor (controller order change) - (By Nukey Shay)

Gauntlet (other buttons hack) - (By Nukey Shay)

DarkChambers (Other buttons hack) - (By KevinMos3)

Wizard of Wor 16K [includes CBS version by pushing up on dpad at startup] - (By Nukey Shay)

Yahtzee (portable) - (By Nukey Shay)

DK VCS (portable) - (By Nukey Shay)

WestWorld (portable) - (w/ Berzerk fix by Nukey Shay and graphical hack by KevinMos3)

WestWorld Turbo - (w/ Berzerk fix by Nukey Shay and graphical hack by KevinMos3)

Berzerk Turbo (portable) - (w/ Berzerk fix by Nukey Shay and graphical hack by KevinMos3)

Yahtzee with big dice - (By Nukey Shay)

Shieldshifter (portable) - (By Nukey Shay)

Stripoff (portable) - (By Nukey Shay)

Adventures of Tron - (By Nukey Shay)

Surround (portable) - (By Nukey Shay)

Elevator action (portable) - (By Nukey Shay)

Aardvark (portable) - (By Nanochess)

Tacscan(portable)- (By Nukey Shay) (mostly works)

Cxb8 Millipede (no grey)- (By Cats)

PressureCooker(AFPv1)- (By Nukey Shay)

PressureCooker(AFPv2)- (By Nukey Shay)

PressureCooker(AFPv3)- (By Nukey Shay)

RallyX- (By Nukey Shay)

Commandoraid- (By Nukey Shay)

Commandoraid-Paddle- (By Nukey Shay)

Commandoraid-Joystick- (By Nukey Shay)

Arcade Pong- (By Nukey Shay)

 

Games already made useful on the FBP through controller hacks (and my inspiration for this thread)

* Big Bird's Egg Catch - from kid's controller to joystick. - (By OmegaMatrix)

* Holey Moley - from kid's controller to joystick. - (By OmegaMatrix)

* Cookie Monster Munch - from kid's controller to joystick. (By OmegaMatrix)

* Omega Race joystick hack - (By Thomas Jentzsch)

 

 

(THE ORIGINAL PITCH THAT STARTED THIS MESSAGE THREAD)

-------------------------------------------------------------------------------------------------

attachicon.gifpost-4709-0-45339500-1479338060.jpg

 

Even though the Flashback Portable (with the SD card support) is not out in stores till early next month, some of us have ordered one online and are seeing which games work on the little handheld.

 

As a list of hundreds of games are being tested and the results listed, some games break due to special hardware tricks, but most of the non-working games are from the D-pad design and emulation problems. But this thread is not about that...yet. :)

 

This thread is making some adjustments to games to help them work better with an Atari system with only one dpad controller and no other controller options.

 

For those up for a challenge or just showing off, here are some games that could use a slight adjustment to make an awesome game on the Flashback Portable (FBP)

 

1) Wizard of Wor: reassigning controller 2 to controller 1. It was wild how they made that game making the first player use the second joystick. At the moment you have to select a two player game to get this to work so that player two gets the FBP's only controller. Re-assigning player one to joystick 1 instead of the second joystick will just make this experience better.

 

attachicon.gifAtari 2600 Star Raiders Overlay.jpg

 

2) Star Raiders : Brought this one up, was sad that there was not a keyboard controller. Then I played Star Master and was inspired on how they brought up a galactic map with the select switch.

 

On the FBP they give you six buttons. So you have fire of course, then L and R difficulty (two buttons that I know can use used during gameplay), the TV option switch (not sure if anyone has ever used this switch during gameplay) and the select switch (which we know Star Master used.)

 

If someone is up for a challenge, or walking me through a challenge but I'll admit it would be a bit of walking :P what if we used difficulty L (on) for shield on Difficulty L (off) for shield off [since this was a two position switch. R Difficult on for Fore View, R Difficulty off for Galactic Map, and then select of the TV select switch for hyperspace? (The sixth button is the pause button which would probably not help us in this case being more hardware/emulator effect than a in game effect.)

Link to comment
Share on other sites

Got a question for SpiceWare tonight. I would like to change the definitions of the difficulty switches in a game so that A is B and visa versa.

 

What was written below was the most informative on the difficulty switches as it would work in an assembly decompile...

 

 


All of those switches are read via the same register, SWCHB.
attachicon.gifScreen Shot 2016-11-24 at 9.28.21 AM.png

While the programming documentation shows difficulty switch positions as amateur (B) and pro (A), I refer to them as beginner (B) and advanced (A).

I didn't use the difficulty switches in Collect, but you'll find that they're typically checked using the BIT instruction because it moves bit 6 into V (overflow flag) and bit 7 into N/S which makes it very easy to check them. N/S = negative/sign - some documentation uses N for negative, other documentation uses S for sign. They both mean exactly the same thing, it's just something to be aware of - Stella uses N:
attachicon.gifScreen Shot 2016-11-24 at 9.24.20 AM.png

CheckLeftDifficulty:
    bit SWCHB
    bvs LeftDifficultyA
LeftDifficultyB:
    ; do left difficulty B here
    jmp DoneLeftDifficulty
LeftDifficultyA:
    ; do left difficulty A here
DoneLeftDifficulty:
 
CheckRightDifficulty:
    bit SWCHB
    bmi RightDifficultyA
RightDifficultyB:
    ; do right difficulty B here
    jmp DoneRightDifficulty
RightDifficultyA:
    ; do right difficulty A here
DoneRightDifficulty:



The branch can also be done the other way:
CheckLeftDifficulty:
    bit SWCHB
    bvc LeftDifficultyB
LeftDifficultyA:
    ; do left difficulty A here
    jmp DoneLeftDifficulty
LeftDifficultyB:
    ; do left difficulty B here
DoneLeftDifficulty:
 
CheckRightDifficulty:
    bit SWCHB
    bpl RightDifficultyB
RightDifficultyA:
    ; do right difficulty A here
    jmp DoneRightDifficulty
RightDifficultyB:
    ; do right difficulty B here
DoneRightDifficulty:



When reviewing the Stella Programmer's Guide you may notice the TIA read registers are also wired up to use bits 6 and 7, which was done so they could easily be tested via the BIT instruction.
attachicon.gifScreen Shot 2016-11-24 at 9.38.42 AM.png

 

Great stuff. :D

 

So if I read this right this comes down to SWCHB and if it registers as bit 6 or 7. How could I switch the definitions for 6 and 7 and what exactly is "6" and "7" in the decompiled code?

 

Tonight I did try a few other things to switch the definitions. I replaced bmi (RightDifficultyA) with bpl (RightDifficultyB) and the reverse. Also tried replacing bvs (LeftDifficultyA) with bvc (LeftDifficultyB) and visa versa.

 

Another thing I tried was the definition of a "BIT" which seems to be either SWCHB or $80. Seems to be two conditions. Possible one or off? Swapped those two with spectacular fails as well. :D

 

As always, any help you can give will be appreciated.

bsg.asm

Link to comment
Share on other sites

Well, that got a "bit" muddled...didn't it? :P

 

BIT (used as a program instruction) tests a memory location without affecting the A, X, or Y registers. The result of this test is plunked down into the status register. There's only 6 possible branch conditions that can follow...3 if the status register flag was set, and the complementary 3 if the status register flag was not set.

 

The BMI/BPL pair is used for bit7 (the highest bit). If you are familiar with how the instruction AND #$80 works, it's basically the same principle...checking if the leftmost bit is turned on. The advantage to using BIT is that it does not alter the value sitting in the A register - it's only flipping the flag in the status register.

 

The BVS/BVC pair is used to check bit6 (the next highest bit). Bit6 in the status register is actually an overflow flag, but it has an effect like an AND #$40 just fine (again, without corrupting the value of A).

 

The last pair is BEQ/BNE...whether the memory location is zero, or if it holds any non-zero value. Basically doing a CMP #$00 without the legwork.

 

The value in SWCHB is preset to use the console difficulty switch positions as bit7 and bit6 when you read a value from there (although this function can be overridden via SWBCNT, I won't go into that).

 

Consider the following code:

 

  LDA SWCHB
  AND #$80
  BEQ LF100

A is given the value of the current console switches. AND #$80 checks the status of the leftmost bit now sitting in A...which corresponds to the Left difficulty switch in SWCHB. The following branch to LF100 is taken if that bit was turned OFF (i.e. if AND #$80 resulted in zero)...If left difficulty is B, the branch is taken.

 

That small test can be shortened as:

 

  LDA SWCHB
  BPL LF100

Notice the change there? A is still being loaded with the value of SWCHB, but there's no AND instruction altering that value. It's just directly checking if the leftmost bit was turned off to do the branch.

 

The BIT instruction goes one step further...

 

  BIT SWCHB
  BPL LF100

Pretty much the same as the one above...except now it's not even altering whatever value you currently have sitting in A. All in all, a handy shortcut.

 

 

 

SWCHB is also preset to hold the current status of the other 3 console switches. Game Reset is bit0 (the rightmost bit), Game Select is bit1 (the one just left of that), and color/b&w is bit3. However, the BIT opcode shortcut can't be used for those switches for reasons which should be obvious if you understand the above.

  • Like 3
Link to comment
Share on other sites

Now, you can forget all that if you are only interested in making an existing game do the opposite when you flip the difficulty switches. Just look though the code for spots that are reading SWCHB; via LDA, BIT, or whatever; and alter the following branch(es) to be their complement. BMI would become BPL, BVS would become BVC, BEQ becomes BNE. The only snags here is if the program is saving the value of SWCHB to a ram location (if which case, you'd have to track the use of that ram location in later areas), or if it was pushing bit states into the carry flag via ASL, LSR, ROR, OR ROL (carry flag status can remain unchanged until something else comes along which affects it). I noticed in the above assembly:

 

  LDA SWCHB
  LSR ;(nothing)
  BCS LF0D5
  JMP LF000

 

"Nothing" is an incorrect description of what is happening there. A is loaded with SWCHB, LSR moves the rightmost bit (Game Reset) into the carry status. The branch is taken if the switch is NOT currently held. Otherwise, the program does a jump to LF000 to start over from scratch.

 

There's also this mess:

 

LFB61: LDA T1024T
  BPL LFB66 ;RightDifficultyB
LFB66: STA WSYNC
  LDA T1024T
  BPL LFB66 ;RightDifficultyB

 

T1024T is one of the write-only locations to set the hardware timer, and has nothing to do with difficulty switches.

  • Like 2
Link to comment
Share on other sites

The value in SWCHB is preset to use the console difficulty switch positions as bit7 and bit6 when you read a value from there (although this function can be overridden via SWBCNT, I won't go into that).

 

....

 

SWCHB is also preset to hold the current status of the other 3 console switches. Game Reset is bit0 (the rightmost bit), Game Select is bit1 (the one just left of that), and color/b&w is bit3. However, the BIT opcode shortcut can't be used for those switches for reasons which should be obvious if you understand the above.

 

A very good run through of how SWHB works and still trying to completely wrap my head around it all.

 

For fun I see bits 0,1,3,6, and 7 are assigned for SWCHB. What were 2, 4, and 5 used for?

Link to comment
Share on other sites

As I mentioned earlier, I wasn't going to go into SWBCNT (the "data direction register" for SWCHB @ $0283). But since you're asking:

 

By default, data direction for both A (controller) and B (console) ports are set at zero (i.e. "read-only" for all bits in both registers). Since those 3 stray bits in SWCHB are not configured for anything used by the hardware, you can store value $34 (%00110100) to SWBCNT and be able to use them in SWCHB for whatever you want. Similarly...if your program only requires a single joystick, for example, you can reset DDR on portA (SWACNT @ $0281) for 4 additional bits of R/W memory there too. Not much, but it can help if you are really scraping for memory.

 

EDIT: I should mention that Atarivox/Savekey already relies on portA's DDR to function. It might be best to leave SWACNT alone, or face an ugly mob if highscores get wiped :D

Edited by Nukey Shay
  • Like 1
Link to comment
Share on other sites

As I mentioned earlier, I wasn't going to go into SWBCNT (the "data direction register" for SWCHB @ $0283). But since you're asking:

 

By default, data direction for both A (controller) and B (console) ports are set at zero (i.e. "read-only" for all bits in both registers). Since those 3 stray bits in SWCHB are not configured for anything used by the hardware, you can store value $34 (%00110100) to SWBCNT and be able to use them in SWCHB for whatever you want. Similarly...if your program only requires a single joystick, for example, you can reset DDR on portA (SWACNT @ $0281) for 4 additional bits of R/W memory there too. Not much, but it can help if you are really scraping for memory.

 

*EDIT: I should mention that Atarivox/Savekey already relies on portA's DDR to function. It might be best to leave SWACNT alone, or face an ugly mob if highscores get wiped :D

 

*Omegamatrix Trak-Ball add to Millipede uses the 4 bytes of portA. Millipede's console RAM and Sara chip RAM were fully used and it was always said "couldn't be done".

I remember asking but don't remember a reply if any RAM was free due to rewriting code and if the controller port is (or is not) still used as RAM.

Link to comment
Share on other sites

  • 2 months later...

Hello all,

I've seen that the Imagic Game "Riddle of The Sphinx" is playable, but I thought you needed a second controller to cycle through your items that you find, or am I wrong?

Thanks in advance....

 

gmjenkster

 

That is correct. Unfortunately, since the color/bw switch and the difficulty switches are used for the game, that only leaves the select button free for remapping. I'm not sure how it could be worked around offhand.

 

https://gamefaqs.gamespot.com/atari2600/563252-riddle-of-the-sphinx/faqs/8942

Link to comment
Share on other sites

  • 3 weeks later...

If someone has hacked Cosmic Ark, then I missed it. In case it's useful, here is a version of Cosmic Ark without the starfield effect (and therefore no weird lines on the AFP).

 

attachicon.gifCosmicArk(portable).bin

awesome hack! Thanks!! (added it to the "List" and possible AFP ROM pack update this Christmas too)

Link to comment
Share on other sites

  • 4 months later...

Radar Lock

Game select (S) used to switch weapons. First version, since I'd eventually like to include the T button for the 3rd weapon (FBP has its own dedicated pause switch) in order to have each of them fire their own weapon. Disassembly needs more work first.

Radarlock(portable_v1).bin

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Scratch that idea...

 

Using T to change weapons instead. If held down, the afterburners are used. Includes stage-select hack from the console version now (stage 6 = trainer mode: infinite weapons, infinite fuel).

 

The game looks to be a little glitchy when using the afterburners here (?)

Radarlock(portable_v2).bin

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

This one was tough to figure out...

The Pacman8k hack (of Atari's original game) was never executing anything in a unique way...just a standard program using the F8 scheme, no advanced hardware tricks used...and no undocumented 6502 opcodes used, either.  Worked on everything -except- the portable.

 

Had a random thought just now...what if the portable is misidentifying the game as using the F8SC (8k Superchip) scheme?  Well, all of the bankswitches are located on the first page, so those would be mapped to be Ram and the game would not load.

 

Fortunately, there is a couple of pages of unused Romspace in each of the banks...so I filled the first pages with garbage as you'd do to MAKE a F8SC program compatible.  And it WORKED :)

 

Got an extra 128 bytes of Ram in it now, but who cares?

 

Pacman8k(portable).bin

  • Like 3
  • Haha 1
Link to comment
Share on other sites

14 hours ago, Nukey Shay said:

This one was tough to figure out...

The Pacman8k hack (of Atari's original game) was never executing anything in a unique way...just a standard program using the F8 scheme, no advanced hardware tricks used...and no undocumented 6502 opcodes used, either.  Worked on everything -except- the portable.

 

Had a random thought just now...what if the portable is misidentifying the game as using the F8SC (8k Superchip) scheme?  Well, all of the bankswitches are located on the first page, so those would be mapped to be Ram and the game would not load.

 

Fortunately, there is a couple of pages of unused Romspace in each of the banks...so I filled the first pages with garbage as you'd do to MAKE a F8SC program compatible.  And it WORKED :)

 

Got an extra 128 bytes of Ram in it now, but who cares?

 

Pacman8k(portable).bin 8 kB · 9 downloads

Oooo, thanks!  Can't wait to try it!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...