Jump to content

Photo

Load Data from disk in Assembly


10 replies to this topic

#1 peteym5 OFFLINE  

peteym5

    Stargunner

  • 1,839 posts
  • Location:Buffalo NY USA

Posted Sat Oct 7, 2017 12:07 PM

I am attempting to set up something that can set up something that can Save and Load data to and from disk in assembly for a new and upcoming game. I know its not too hard to do from Basic, but not sure how this works in assembly. This is what I figured out so far. Cannot find any good examples on how to set this up.

        LDA #CIO_READ
  	STA ICCOM,X
  	LDA # <FNAME_00 	; FILENAME IS D:Filename
  	STA ICBAL,X
  	LDA # >FNAME_00
  	STA ICBAH,X
  	LDA #0  	
  	STA ICAUX2,X



#2 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,802 posts
  • Location:United Kingdom

Posted Sat Oct 7, 2017 12:47 PM

This should tell you everything you need to know:

 

Atariki: Accessing Files



#3 pirx OFFLINE  

pirx

    Moonsweeper

  • 379 posts
  • Location:Poland

Posted Tue Oct 10, 2017 2:35 AM

the "battery" is really the "accumulator" :)))



#4 xxl OFFLINE  

xxl

    Dragonstomper

  • 999 posts
  • Location:Rabka-Zdrój /Poland

Posted Fri Oct 13, 2017 12:23 AM

 

I am attempting to set up something that can set up something that can Save and Load data to and from disk in assembly for a new and upcoming game.

 

answer is... xB:

1.

ldy     < fname
ldx     > fname
jsr     xBIOS_OPEN_FILE

fname .byte c'MYFILE COM'

-

ldy     < dest
ldx     > dest
jsr     xBIOS_LOAD_DATA

2.

ldy     < src
ldx     > src
jsr     xBIOS_WRITE_DATA



#5 snicklin OFFLINE  

snicklin

    River Patroller

  • 2,066 posts
  • Location:Australia

Posted Fri Oct 13, 2017 4:53 AM

Yes, xBIOS is a great way of doing this.

 

Pete, if you're looking for some instructions for xBIOS, you can find them here:

https://atariwiki.or....jsp?page=XBIOS

 

I translated some sources (well, Google did and I cleaned up the translation) and mixed together a few examples I found on the net. Let me know if there are any document problems.

 

I've read a few of your posts on here and I know that you work on cartridge software too. Just last night I was fiddling around and managed to get a cartridge program running together with xBIOS, so that it can save its progress to disk. At the moment I just got it reading from the disk, but from a cartridge program.



#6 peteym5 OFFLINE  

peteym5

    Stargunner

  • Topic Starter
  • 1,839 posts
  • Location:Buffalo NY USA

Posted Fri Oct 13, 2017 6:33 AM

I am planning on using xBIOS with the next Secretum Labyrinth. The other thing I am doing is making an updater for games on AtariMax cartridges that just re-flash the banks that need updating instead waiting to do the whole cartridge. It will even have a safety check to make sure the correct game is in the cartridge slot so it does not accidentally damage another game or a blank cartridge. I started running into problems re-flashing whole 1024K AtariMax cartridges that only need to reflash one or two 8K banks. It may be adapted to other cartridge types, but AtariMax is most commonly used for larger games that are 128K to 1024K right now.



#7 Stormtrooper of Death OFFLINE  

Stormtrooper of Death

    Moonsweeper

  • 398 posts
  • Location:The Netherlands

Posted Sat Oct 14, 2017 7:57 AM

I've never heard about xBIOS before. Anyhow, when I wrote the Phantasy demo, i just programmed disk IO using the standard memorylocations for drive communication. Is the purpose of xBIOS to help programmers who are not good enough to program their own device code ? No offense ment to anybody. Just wondering, because i dont know xBIOS.

 

Read the information, and liked the musicplay routine during loading. Never was able to program this myselve in the 80s.



#8 xxl OFFLINE  

xxl

    Dragonstomper

  • 999 posts
  • Location:Rabka-Zdrój /Poland

Posted Sat Oct 14, 2017 11:33 AM

Is the purpose of xBIOS to help programmers who are not good enough to program their own device code?

 

No, xBIOS is a 1KB library responsible for handling files and directories... without DOS 



#9 Heaven/TQA ONLINE  

Heaven/TQA

    Quadrunner

  • 10,383 posts
  • Location:Baden-Württemberg, Germany

Posted Mon Oct 16, 2017 10:27 AM

I've never heard about xBIOS before. Anyhow, when I wrote the Phantasy demo, i just programmed disk IO using the standard memorylocations for drive communication. Is the purpose of xBIOS to help programmers who are not good enough to program their own device code ? No offense ment to anybody. Just wondering, because i dont know xBIOS.
 
Read the information, and liked the musicplay routine during loading. Never was able to program this myselve in the 80s.


If you want to use file system you dont want to write your own IO. And esp when memory is tight and you dont want to load DOS....

#10 baktra OFFLINE  

baktra

    Moonsweeper

  • 387 posts
  • Location:Czech republic

Posted Tue Oct 17, 2017 1:04 AM

I would have two questions:

1) Is there any software using xBIOS with source code available? An example with xBIOS in RAM under ROM would be nice.

2) Does vanilla (without any extensions) xBIOS tolerate some disk drive enhancements - HAPPY, SPEEDY etc? Toleration = works perfectly with HAPPY and SPEEDY, but with default speed. 

 

Thanks.

I am asking because I would like to write a copier - DISK>MEMORY>TAPE and xBIOS would be a very good solution for reading from floppy residing under ROM. Currently I used xBIOS for the "Floppy disk of the lost miner" and it went well.


Edited by baktra, Tue Oct 17, 2017 1:08 AM.


#11 xxl OFFLINE  

xxl

    Dragonstomper

  • 999 posts
  • Location:Rabka-Zdrój /Poland

Posted Tue Oct 17, 2017 12:56 PM

1. easy way:

copy this: 43 58 41 55 54 4F 52 55 4E 20 20 20 D9 D8 E2 02 E0 02 00 00 00 00 FE 00 00 as xbios.cfg file

 

opt h-
.byte $43 ; for xB 4.3
.byte c’XAUTORUN ‚ ; autorun filename
.byte >$D900 ; xB adress
.byte >$D800 ; buffer adress
.word $02e2 ; INITAD adress
.word $02e0 ; RUNAD adress
.word $0000 ; I/O module adress – $0000 means xB build in SIO
.word $0000 ; I/O relocator adress - $0000 means xB build in
.byte $fe ; PORTB, without BASIC
.byte $00 ; NMIEN
.byte $00 ; IRQEN

 

and now xB is under ROM

 

my SlightSID Player use config like this (xB under ROM)

 

 

2. ofcourse :

 

https://atariwiki.or...ighSpeedDevices


Edited by xxl, Tue Oct 17, 2017 1:05 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users