dmsc / fastbasic

FastBasic - Fast BASIC interpreter for the Atari 8-bit computers
GNU General Public License v2.0
139 stars 20 forks source link

Question on virtual disk access #83

Closed drarem closed 6 months ago

drarem commented 7 months ago

When compiling an XEX file, is it possible to attach a 'virtual' ATR image so I only have to distribute a single .XEX? I want to be able to save and load in this same space as well. This will keep it simple for any users from having to create a blank disk and attaching to the emulator on their own.

dmsc commented 7 months ago

Hi!

I don't completely understand your question.

Are you using the PC compiler?

Do you want to generate an ATR image with the Atari executable inside?

Have Fun!

drarem commented 7 months ago

Yes I'm using the PC compiler and created a large map using fastbasic. Want to be able to load/save or just integrate it directly into program. Able to generate and use the ATR image without having to manually create one would be ideal, but i would settle for even a bunch of DATA statements I can use for the program/game.

dmsc commented 7 months ago

Hi!

To integrate data directly to the program, you can use the DATA FILE statement:

  DATA mydata() BYTEFILE "my-local-file.bin"

This will read the binary file "my-local-file.bin" into your program, as the mydata() byte array. You can also use "WORDFILE" for reading as a word array.

Note that this does not work in the Atari compiler, only using the PC compiler.

Is this what you need?

Have Fun!

drarem commented 7 months ago

Hi. Was wanting to edit in the same program save it and reload it. Would i need a D1 disk set up for an emulator to run it

On Mon, Apr 22, 2024, 8:34 PM dmsc @.***> wrote:

Hi!

To integrate data directly to the program, you can use the DATA FILE statement:

DATA mydata() BYTEFILE "my-local-file.bin"

This will read the binary file "my-local-file.bin" into your program, as the mydata() byte array. You can also use "WORDFILE" for reading as a word array.

Note that this does not work in the Atari compiler, only using the PC compiler.

Is this what you need?

Have Fun!

— Reply to this email directly, view it on GitHub https://github.com/dmsc/fastbasic/issues/83#issuecomment-2071174503, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSLJ2VUOU7HIY26SHPOTC3Y6WUCJAVCNFSM6AAAAABGSYLB4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZRGE3TINJQGM . You are receiving this because you authored the thread.Message ID: @.***>

dmsc commented 7 months ago

Hi!

You can run the XEX directly in the emulator, you don't need an ATR.

Or I still don't really understand your use case :(

Have Fun!

drarem commented 7 months ago

When i get back to my desk tomorrow ill try to describe more. I making a game with built in map editor. I want to be able to make a map, save it..exit relaunch the game reload the msp to edit some more

On Mon, Apr 22, 2024, 9:38 PM dmsc @.***> wrote:

Hi!

You can run the XEX directly in the emulator, you don't need an ATR.

Or I still don't really understand your use case :(

Have Fun!

— Reply to this email directly, view it on GitHub https://github.com/dmsc/fastbasic/issues/83#issuecomment-2071252145, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSLJ2VY63J47S2ZDHI73VLY6W3P3AVCNFSM6AAAAABGSYLB4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZRGI2TEMJUGU . You are receiving this because you authored the thread.Message ID: @.***>

dmsc commented 7 months ago

Hi!

I understand now, you want to test the game preserving the data in the disk image.

What I normally do is to activate the "H:" device in the emulator, and load/save the data from the H: device during development.

This way, I can load the emulator with my XEX and have it access all the data files in the H: device instantly, without the need for an ATR file. This also has the advantage that I can directly copy (and backup) the data files.

If you are using Altirra, you can load the emulator with Altirra /hdpathrw my_folder my_file.xex

Have Fun!

drarem commented 7 months ago

Thank you sounds like what i need to do

On Mon, Apr 22, 2024, 10:44 PM dmsc @.***> wrote:

Hi!

I understand now, you want to test the game preserving the data in the disk image.

What I normally do is to activate the "H:" device in the emulator, and load/save the data from the H: device during development.

This way, I can load the emulator with my XEX and have it access all the data files in the H: device instantly, without the need for an ATR file. This also has the advantage that I can directly copy (and backup) the data files.

If you are using Altirra, you can load the emulator with Altirra /hdpathrw my_folder my_file.xex

Have Fun!

— Reply to this email directly, view it on GitHub https://github.com/dmsc/fastbasic/issues/83#issuecomment-2071307554, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSLJ2S77PI4AOXM7L4YORDY6XDJLAVCNFSM6AAAAABGSYLB4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZRGMYDONJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

dmsc commented 6 months ago

Closing as seems resolved.