Jump to content
IGNORED

bB and Starpath Supercharger?


Gemintronic

Recommended Posts

I recently came upon a trove of audio cassettes. Got me thinking of making a bB game release on the Supercharger.

 

I've found this utility to transfer games to cassette

http://www.romhackin.../utilities/712/

 

It says 2k-4k games MAY work. What does that mean? Has anyone tried to make a Supercharger game in bB? Can I use superchip memory?

 

UPDATE: Batari made a Supercharger game here:

http://www.atariage.com/forums/topic/108859-supercharger-banking-with-bb/#entry1316869

 

Sounds like 4k games are possible..

Link to comment
Share on other sites

It says 2k-4k games MAY work. What does that mean?

It refers to loading existing 2k and 4k roms: the supercharger has 6k of ram, divided into 3 2k banks and another 2k of rom containig the bios, so there are 4 banks in total. Address $FFF8 is the 'hotspot' used to swap banks.

When loading a game originally coded for a non bankswitched 2k or 4k cartridge, there's the risk that the program could access the hotspot, causing an unwanted bankswitch and therefore a crash.

So you can do a 2k/4k game which is also compatible with the supercharger by ensuring that the program never accesses the hotspot address.

Link to comment
Share on other sites

It refers to loading existing 2k and 4k roms: the supercharger has 6k of ram, divided into 3 2k banks and another 2k of rom containig the bios, so there are 4 banks in total. Address $FFF8 is the 'hotspot' used to swap banks.

When loading a game originally coded for a non bankswitched 2k or 4k cartridge, there's the risk that the program could access the hotspot, causing an unwanted bankswitch and therefore a crash.

So you can do a 2k/4k game which is also compatible with the supercharger by ensuring that the program never accesses the hotspot address.

 

Thank you for the info! It sounds like I may be out of luck. batari BASIC seems to make 4k games where the whole 4k is in one bank.

Link to comment
Share on other sites

Thank you for the info! It sounds like I may be out of luck. batari BASIC seems to make 4k games where the whole 4k is in one bank.

 

The only thing before the hotspots is the bB score font data. In a 4k bB rom the score font ends at $FFEC, so they should run fine with a supercharger.

 

I'm not sure if 2k roms need to be doubled-up to 4k to run with SC or not. In a 2k bB rom the score font ends at $F7FC, so if 2k roms load fine as-is, there will be no hotspot access for 2k bB roms. If 2k roms need to be doubled-up, then there will be unintended hotspot access.

 

Anybody with a supercharger care to share how to go about loading 2k roms? Do they need preparation?

Link to comment
Share on other sites

Thank you for the info! It sounds like I may be out of luck. batari BASIC seems to make 4k games where the whole 4k is in one bank.

Loon that shouldn't matter, it's only if you use the entire 4k; looks like the hotspot is 8 bytes away from the end of memory so make sure you have at least 8 bytes free.

 

I think it would be cool to see more 2600 games released on tape :)

  • Like 1
Link to comment
Share on other sites

Loon that shouldn't matter, it's only if you use the entire 4k; looks like the hotspot is 8 bytes away from the end of memory so make sure you have at least 8 bytes free.

 

The bB code can only fill up the area before the score font, which has a fixed position and ends just before the hotspots. (for 4k roms) Even if he uses every byte bB lets him use, it will still work.

Link to comment
Share on other sites

Loon that shouldn't matter, it's only if you use the entire 4k; looks like the hotspot is 8 bytes away from the end of memory so make sure you have at least 8 bytes free.

 

I think it would be cool to see more 2600 games released on tape :)

 

Do you have a Supercharger or is that key foreign to you Mr SQL?

 

@RevEng: Thanks for the clarification! It sounds like I may be buying a Starpath Supercharger soon..

Link to comment
Share on other sites

  • 7 months later...

Welp, I've converted Stranglehand using these settings in MAKEWAV

 

makewav -ts -d2 -f0 sland.bin

 

I've uploaded it to my PSP for later testing on my Supercharger. It's only 13 seconds so that worries me. Should a 4k game be that short?

 

I guess I'll have to test it out and see. If anyone else has better settings for batari BASIC 4k games and the SuperCharger let me know :)

Link to comment
Share on other sites

  • 1 month later...

Kind of a related question here:

 

Can bB allocate the RAM above 4k for more variables? Is it compatible enough with SARA memory that I could use bBs 4kSC option?

 

Loon,

here's a routine that should work to allow you to access an additional 30 variables using supercharger RAM from bB - it's still in the 4K though not above.

 

You could expand it to handle 256 variables if you can give up that much ROM.

 

WRITEPROTECT_DEST_ADRS = $FFF8

RAM = $F000

;using mytable as destination address

writesuperchargervariable

;-- arguments: temp1,temp2 : value to write, target variable (0-29)

lda $fff8 ; ----------------------------------

eor #%00000010 ; toggle the write protect notch

tax

CMP RAM,x; preps the value for the write

nop

CMP WRITEPROTECT_DEST_ADRS

;-----------------------------------

 

;write target value to RAM:

LDY temp1;#VALUE_TO_STORE

LDX temp2; target supercharger variable (0-29)

CMP RAM,y ; preps the value for the write

nop

CMP superchargervars,x; does the write

lda $fff8 ; ----------------------------------

eor #%00000010 ; toggle the write protect notch

tax

CMP RAM,x; preps the value for the write

nop

CMP WRITEPROTECT_DEST_ADRS

;-----------------------------------

rts

;----------------------------

jmp jmparoundvars

superchargervars ; can initialise them here:

.byte 0,0,3,3,4,1,0,0,3,1

.byte 0,0,3,3,4,1,0,0,3,1

.byte 0,0,3,3,4,1,0,0,3,1

jumparoundvars

readsuperchargervariable

;-- arguments: temp1 : target variable to read (0-29), returns value

; -- temp1 returns with the value of the target variable

ldy temp1

lda superchargervars,y

sta temp1

rts

;-----------------

 

Edited by Mr SQL
Link to comment
Share on other sites

  • 2 weeks later...

Loon,

the SuperCharger memory access routine in my last post had a bug - the hotspot can't be read only updated, so we have to know what it is ahead of time.

 

Here's a routine that will let a 4K bB program access the RAM in the extra RAM/ROM bank for additional variable space:

post-30777-0-65760800-1385920860_thumb.jpg

 

it works because only 1/2 of the address space is bank switched - the first 2K is always present so we don't have to add any custom headers or calculations to bankswitch for RAM access like we would to run code! :)

 

Here are examples calling the routines in asm or bB to load and set 100 supercharger vars (0-99) in the extra memory bank (you can call them from anywhere in your 4K code space):

 

; store the number 14 in supercharger variable 0:

lda #14
ldx #0
jsr writesuperchargervars

 

 

;retrieve supercharver variable 2:

lda #2
jsr readsuperchargervars

 

 

For bB, you would set temp variables to 14 and 0 prior to making the first call and load the temp vars into the a and x registers instead of the hard coded numbers.

 

; store the number 14 in supercharger variable 0:

lda temp1 ;temp1 is #14
ldx temp2 ; temp2 is #0
jsr writesuperchargervars

 

 

For the 2nd call you would set a temp variable to 2 and load the a register with it instead of the hard coded number, and then after the call load the temp variable with the a register (your return value):

 

;retrieve supercharver variable 2:

jsr writesuperchargervars

lda temp1 ; temp1 holds the target variable to retrieve (0-99)
jsr readsuperchargervars

sta temp1 ; return the value in temp1

 

These routines go near the top of your code to ensure they live in the first 2K of address space:

 

WRITEPROTECT_DEST_ADRS = $FFF8
RAM = $F000

writesuperchargervars
;---- args: registers a,x (value to write, target variable number (0-99))

;---- use 100 bytes of ROM for 100 variables in bank II
;----

;-- turn off write protect switch to bank2; yet we remain in bank 3!
ldy #%00011011;write protect off, bank2
cmp RAM,y
nop
cmp WRITEPROTECT_DEST_ADRS

;-- write value to RAM "ROM"
tay
cmp RAM,y ; prepare the value for the write
nop
cmp superchargervars,x ; update Virtual World Pixel
;sta ExtendedPlayfieldSCW,x

;-- turn write protect on switch back to bank1 (we're still in bank 3)
;--
ldy #%00001001
cmp RAM,y
nop
cmp WRITEPROTECT_DEST_ADRS
rts

 

;---------------------------------------------------------

readsuperchargervars
;---- args: accumulator (target variable number (0-99))
;---- returns variable in accumulator
;---- use 100 bytes of ROM as RAM for 100 variables in bank II
;----
;-- keep write protect on, switch to bank2; yet we remain in bank 3!
ldy #%00011001;write protect off, bank2
cmp RAM,y
nop
cmp WRITEPROTECT_DEST_ADRS

;-- write value to RAM "ROM"
tay
lda superchargervars,y ; update Virtual World Pixel

;-- turn write protect on switch back to bank1 (we're still in bank 3)
;--
ldy #%00001001
cmp RAM,y
nop
cmp WRITEPROTECT_DEST_ADRS
rts

;---------------------------------------------------------------------------------------------------

 

You can either place the label superchargervars at the start of the 2nd 2K of RAM or hard code it to point to that address; it could be anywhere in the 2nd 2K of RAM but putting it at the top avoids hitting a pagebreak which the SuperCharger can't write through. If it's at the top (or aligned to a page) you should be able to access a full 256 extra variables in supercharger RAM! :)

 

If bB inserts a label within 4K of contiguous address space denoting the start of the 2nd 2K, that could be used instead of superchargervars.

 

Note: I've assumed the default contiguous SuperCharger banks for a 4K ROM are 3 and 1, not 3 and 2.

 

 

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