Jump to content

Photo

bB, bankswitching and the Atari Flashback Portable


13 replies to this topic

#1 kdgarris ONLINE  

kdgarris

    Star Raider

  • 52 posts

Posted Thu Jun 15, 2017 7:30 AM

Thus far, I have not been able to get any games made with bB that use bankswitching to work on the AFP.  Even the simplest "hello world" using the standard kernel that works when compiled to 4K fails when it is changed to 8K.  The bankswitching example on RT's site also doesn't work on the portable.

 

I do know that some people have had their bankswitched bB games work on the portable, however, so I am trying to figure out the relevant factor.  Does anyone have any example bB code that uses multiple banks that DOES work on the portable?  If I had a working example, then maybe I could figure out what is different. 

 

Also, it has been suggested to me that perhaps it may be something that changed in more recent builds of bB.  I am using RevEng's latest build.  For those of you who have had success building for the portable, what version of bB were you using?



#2 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,656 posts

Posted Thu Jun 15, 2017 9:37 AM

Attached File  PortableTest.bin   4KB   4 downloads

 

kdgarris,

I was able to compile your game with the older version - this one works on the portable :)

Noticed a couple of strange issues though:

 

/* block SQL comments in the code have to be removed, these must be new */

 

Then the compiler complained about a normal variable name near the end, then about the "-" sign...

didn't look like normal errors might be too much padding I just removed the -

so the line became more like "if myvar > thisvar then" instead of "if myvar > thisvar - 8 then"

 

I used not the original bB release but the version patched for pfcolors.

 



#3 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Thu Jun 15, 2017 11:16 AM

That's very strange - I did the same thing ... tried compiling with the old 1.0 version, having to make the same kinds of changes to get it to compile.  The newer bB seems to be more forgiving of complex expressions.  I just broke some of these up using temp variables.  It also seems that my stripped down "game" behaves differently in Stella under this version as well.

 

None of that really matters though - it looks like whatever issue I'm having isn't related to bB version from my own testing.  To get 1.0 to work on my mac, I had to recompile the binaries, and even run the windows version of dasm through wine (since there was no sources for dasm in that bundle.  Still, same result on my end.

 

On what platform were you compiling?  One would think that wouldn't make a difference, but there must be something different since you got a different result than I did.



#4 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Thu Jun 15, 2017 12:52 PM

Here is an even more simplified example - an 8k "hello world" with filler data.  It fails on the portable when compiled with either version of bB.

Attached Files



#5 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,905 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Jun 15, 2017 1:22 PM

I didn't look at it closely, but it seems like data is trying to be accessed from another bank. Am I seeing that correctly? The bB page says "All data tables, regular or sequential, must be located in the same bank where they are read. If you try to access data in another bank, there will be no errors, but the data you get will certainly be incorrect."

 

In a program with more than one bank, I continue the main loop from bank to bank and read what needs to be read in each bank.



#6 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Thu Jun 15, 2017 1:43 PM

The data isn't read at all in this case.  It's only there to fill up the banks, since Mr SQL suggested that the portable might not detect banks that are mostly empty.  The only thing the code does is increment the score when fire is pressed.  I wanted to reduce the problem to the simplest case to help rule out issues with the code itself.  Also, to be clear, it only fails on the portable, which doesn't have the best emulator (but is still fun for many games).



#7 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,905 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Jun 15, 2017 3:14 PM

What happens if you put a dummy loop in the second bank along with the unused data?



#8 iesposta OFFLINE  

iesposta

    River Patroller

  • 3,270 posts
  • Retro-gaming w/my VCS
  • Location:Pennsylvania

Posted Thu Jun 15, 2017 3:51 PM

First thing I think of is Illegal Opcodes.

 

batari Basic may or may not use illegal opcodes.

The Flashback Portable may or may not handle illegal opcodes.

 

Maybe a large compiled batari Basic .asm source could be searched for common illegal opcodes?



#9 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,656 posts

Posted Fri Jun 16, 2017 5:24 AM

That's very strange - I did the same thing ... tried compiling with the old 1.0 version, having to make the same kinds of changes to get it to compile.  The newer bB seems to be more forgiving of complex expressions.  I just broke some of these up using temp variables.  It also seems that my stripped down "game" behaves differently in Stella under this version as well.

 

None of that really matters though - it looks like whatever issue I'm having isn't related to bB version from my own testing.  To get 1.0 to work on my mac, I had to recompile the binaries, and even run the windows version of dasm through wine (since there was no sources for dasm in that bundle.  Still, same result on my end.

 

On what platform were you compiling?  One would think that wouldn't make a difference, but there must be something different since you got a different result than I did.

 

I used a Windows XP system that I keep offline from 2002 to compile it. I haven't tried on Windows 10 or the mac.

You should be able to duplicate my results with the 1.0 download form batari's site plus the pfcolors update using wine or soft windows.

 

Oh, I edited the file in an editor and used the command line (run COMMAND or CMD to get there) to compile: "compile game.bas"



#10 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Fri Jun 16, 2017 8:32 AM

What happens if you put a dummy loop in the second bank along with the unused data?

 

No dice, but thanks for the suggestion.  For an 8K rom, the bB seems to put the kernel in the second bank, anyway, so both banks are getting used regardless.



#11 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Fri Jun 16, 2017 8:34 AM

I was able to compile your game with the older version - this one works on the portable :)

 

I only just noticed that the version you compiled is 4K.  I can make this and others work when I compile to 4K, too (both on the older version and the latest).  My problem is only specifically with bankswitched games compiled with bB not running on the portable.



#12 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,656 posts

Posted Fri Jun 16, 2017 7:49 PM

 

I only just noticed that the version you compiled is 4K.  I can make this and others work when I compile to 4K, too (both on the older version and the latest).  My problem is only specifically with bankswitched games compiled with bB not running on the portable.

Hmmm... I tried to compile the 8K HelloWorld and it freezes on the "loading..." screen, haven't seen that screen freeze before looks like a new kind of loading error, so far I would always see them load and then glitch but they get past the loading screen. Gives me a theory the portable doesn't like $FF as filler data since bitd that meant "unused" and it wants the RAM area to be unused/$FF but  wants that ROM area filled (Portable logic).

 

Trying with the $FF changed to different filler data ... got it :)

I relaced $FF with 55 no $ just 55 decimal and boom it works:

Attached File  Helloworld3.bin   8KB   5 downloads



#13 kdgarris ONLINE  

kdgarris

    Star Raider

  • Topic Starter
  • 52 posts

Posted Sat Jun 17, 2017 6:55 AM

Hmmm... I tried to compile the 8K HelloWorld and it freezes on the "loading..." screen, haven't seen that screen freeze before looks like a new kind of loading error, so far I would always see them load and then glitch but they get past the loading screen. Gives me a theory the portable doesn't like $FF as filler data since bitd that meant "unused" and it wants the RAM area to be unused/$FF but  wants that ROM area filled (Portable logic).

 

Trying with the $FF changed to different filler data ... got it :)

I relaced $FF with 55 no $ just 55 decimal and boom it works:

attachicon.gifHelloworld3.bin

 

Yes!  Success!  It also worked with the latest RevEng build on my larger WIP that I haven't posted yet (16K romsize).  Thanks so much for figuring this out!

 

I wish there were an automated way to generate this filler data as part of the build, but I'll definitely settle for filling it in myself (and it may not be necissary once my bankes become more filled with my own code and data.



#14 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,656 posts

Posted Sat Jun 17, 2017 9:28 AM

 

Yes!  Success!  It also worked with the latest RevEng build on my larger WIP that I haven't posted yet (16K romsize).  Thanks so much for figuring this out!

 

I wish there were an automated way to generate this filler data as part of the build, but I'll definitely settle for filling it in myself (and it may not be necissary once my bankes become more filled with my own code and data.

You're welcome! :)  Very cool it's working on the other build as well.

 

Looking forward to playing your game on the portable!  






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users