Jump to content
IGNORED

Ok, before I hit google, I will ask here ...


CPUWIZ

Recommended Posts

Is there a PC based tool to convert .EXE files into .BIN files ? If not' date=' does anyone know what needs to be stripped off to make it a .BIN file ?[/quote']

 

I don't know of a PC tool and I assume you mean EXE files from a disk image.

 

The first 6 bytes would need to br stripped. Here are their meanings as I know them...

$FF $FF <----- header

word $xxxx <----- starting address of the program

word $xxxx <------ ending address of the program

 

Then you would need to add the following starting at location $BFFA

word cartridge starting address

byte $00

.byte xx <---D7 0=Not a Diagnostic Cart 1=Is a Diagnostic cart and control is given to cart before any OS is init.

D2 0=Init but Do not Start Cart 1=Init and Start Cart

D0 0=Do not boot disk 1=Boot Disk

 

word cartridge init address

 

I hope this helps

Link to comment
Share on other sites

You can only make cartridge ROM's if the program runs within $8000-BFFF (if so, it probably a cart to begin with - disk programs tend to start below $1000), otherwise it will have to be loaded into RAM. If it uses both low RAM and the area from $8000 up, this can get very tricky.

 

-Bry

Link to comment
Share on other sites

FYI, here's the 800 OS-B's cartridge startup procedure:

 

 

-First check for Diagnostic Cart:

-This is done in the first few cycles of operation

-To allow a diagnostic cart to take over before a flaky computer

-crashes.

 

Lda $BFFC

 

-If it's zero, then test to see if it's a ROM:

 

Bne - outta here

Inc $BFFC

Lda $BFFC

 

-If it's still zero, then it must be ROM!

 

Bne - outta here

 

-Is this a "Diagnostic" cart (runs before OS initializes)?

 

Lda $BFFD

 

-Bit 7 is the Flag

 

Bpl - outta here

Jmp ($BFFE)

 

-outta here: gets us to this point:

-Cartridge was not Diagnostic, so hardware init has now run

 

-RAM size is verified. Cartridges are only checked if RAM is not

-found in their space.

 

-Assuming RAM was not found in $8000-BFFF

-Locations $9FFC and $BFFC are checked for 0 values.

-If they are found, an Init routine in the cart is run. It is expected to end in an RTS.

 

lda $9FFC

bne - next test

jsr ($9FFE) - (actually a JSR to a IND-JMP)

 

-next test

 

lda $BFFC

bne - DOS test

jsr ($BFFE)

 

-DOS test

-Now DOS is loaded if the cartridge so desires.

 

-$BFFD and $9FFD are OR'ed (only cartridges that passed the above "zero" test are included). Bit 0 means Boot DOS.

 

And #$01

Beq - No boot!

 

-Otherwise, DOS is booted.

-Now, if Cart A is present (passed the "zero" test), it can be run if the RUN flag is set:

-No boot! Jumps to here

 

Lda $BFFD

And #$04

Beq -Try Cart B

Jmp ($BFFA)

 

-Try Cart B

-If Cart B passed the "zero" test, then see if it wants to RUN.

 

Lda $9FFD

And #$04

Beq -All Done

Jmp ($9FFA)

 

- All Done, OS continues...

 

 

Note that with a 16K cart ($8000-BFFF) a 0 value in $9FFC will cause an init routine to be run at $9FFE whether it exists or not! Make sure $9FFC is non-zero in a 16K image.

 

If a cartridge is marked as executable ($9FFC or $BFFC=0) the Init address (xFFE) is always taken. You can point this to an RTS instruction, and then run at (xFFA), or you can simply never return from the Init call, or you can run as a diagnostic cart if you don't need the OS at all.

 

$9FFA/BFFA - Run Address

$9FFC/BFFC - Zero if cart is executable/Nonzero cart is ignored

$9FFD/BFFD - Flags (if bit set) b7=Diagnostic, b2=Run, b0=Boot DOS

$9FFE/BFFE - Init Address/Diagnostic Run Address

 

Diagnostic cartridge is signalled at Cartridge A ($BFFD) only.

 

-Bry

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