Jump to content
IGNORED

Feature Request: 7800 detect with bB


Recommended Posts

It would be cool if the next version of bB could detect whether or not the program was running in a 7800 or a 2600 (see here: http://www.atariage.com/forums/index.php?s...t&p=1148175 for code). Since more folks are putting bB games on carts, this would be a useful option to have that would require minimal extra code.

 

I know that jbanes, at least, was looking for something like that (follow link).

Edited by vdub_bobby
Link to comment
https://forums.atariage.com/topic/94576-feature-request-7800-detect-with-bb/
Share on other sites

And here I was just working out how to do exactly that! :lol:

 

It shouldn't be too tough for those who like to customize. You just need to rework the bBASIC startup.asm routines a bit. The only downside is that you need a variable in which to store the value. The current revision of bBASIC completely uses up all available memory. If you use custom routines, you can place the flag in one of the 26 scratch variables. If it becomes a standard routine, then you'd need to give something up. For example, using player1 colors costs missile1, so the variable is reassigned to the handle the colors.

It would be cool if the next version of bB could detect whether or not the program was running in a 7800 or a 2600 (see here: http://www.atariage.com/forums/index.php?s...t&p=1148175 for code). Since more folks are putting bB games on carts, this would be a useful option to have that would require minimal extra code.

 

I know that jbanes, at least, was looking for something like that (follow link).

Good idea! Here's an updated startup.asm file with relevant code. When your bB code begins, temp1 will contain 0 if it's a 2600, or 255 if it's a 7800. It's up to the programmer to copy it to memory somewhere else before temp1 gets overwritten by a routine or the kernel.

startup.zip

It would be cool if the next version of bB could detect whether or not the program was running in a 7800 or a 2600

Good idea! Here's an updated startup.asm file with relevant code.

By the way, Fred, I never emailed you anything about the Superchip, but I posted some modified includes for it in this forum, and I figured you could probably figure most of it out from there. The only other thing-- besides adding a "set" command so there's no need for the "dim superchip" workaround-- is to change the way the bB compiler handles the extra bankswitching code that it places at the end of every bank. Basically, when you add the extra bankswitching code at the end of a bank, followed by the "ORG" and "RORG" for the next bank, you need to fill the first 256 bytes of the new bank with "$FF" (easiest way is to just include the "fill_256.asm" file at that point). This will reserve the first 256 bytes of each bank for the Superchip, and filling those bytes with "$FF" should help the emulators auto-detect the cartridge format (at least, z26 auto-detects it correctly, although Stella seems to have a problem auto-detecting the 8KSC format). If you add official support for the Superchip, it's up to you whether to restrict it to bankswitching. My original modifications ignored the Superchip stuff if the game didn't use bankswitching, but after you posted your idea of doubling up a 4K-Superchip ROM so the emulators can handle it, I decided to allow the Superchip to be included in 4K games as well, on the assumption that CPUWIZ can make 4KSC boards for anyone who wants to design a 4KSC homebrew game and sell it.

 

MR

If it becomes a standard routine, then you'd need to give something up.

 

Ooooor, you could just use a variable that's obliterated after the first drawscreen. :ponder:

 

When your bB code begins, temp1 will contain 0 if it's a 2600, or 255 if it's a 7800. It's up to the programmer to copy it to memory somewhere else before temp1 gets overwritten by a routine or the kernel.

 

:lol:

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...