Jump to content
IGNORED

Using xBios to load data from floppy


Recommended Posts

Hi, I'm wanting to port "la secte noire", a amstrad cpc french game. With Point and click instead of text parser.

 

As the picture for each screen take some data space, I wish to load files from atr ingame.

I look for different solutions without DOS, and looks like xbios is a good way, but I can't make it work.

 

I download the xBios.atr file at http://xxl.atari.pl/ and use atadim windows tool to load file in atr.

I tried with XAUTORUN but have the same result. I have a little icon showing data is reading on floppy.

I want to open a file and read data to screen address with xbios_load_data. But the data don't change. I certainly miss something.

 

When I set $2000 as origin the emulator crash.

 

You can see my files in atr.

black_secte1.png.b8ec180e3f39405660a6c0105db9c899.png

 

 

	org $3000

screen = $4000	; Screen buffer
blank8 = $70	; 8 blank lines (overscan)
lms = $40		; Load Memory Scan
jvb = $41		; Jump While Vertical Blank

	jsr     xBIOS_SET_DEFAULT_DEVICE        ; no need AtariOS anymore
	
; Load display list
	lda #<dlist	; Low ; # Not Useful, recup adresse
	sta SDLSTL	; $0230
	lda #>dlist	; High
	sta	SDLSTL+1; $0231

	mva #$1E COLOR0 	; %01	Jaune
	mva #$b2 COLOR1  	; %10	green
	mva #$96 COLOR2		; %11 blue Couleur du texte 
	mva #$00 COLOR4		; 00 Couleur du fond
	
	ldy <fname
	ldx >fname
	JSR xBIOS_OPEN_FILE
	
	ldy <screen
	ldx >screen
	JSR xBIOS_LOAD_DATA
	
	jmp *

dlist
	.byte blank8, blank8, blank8		; Overscan Top
	.byte $2 + lms, <screen, >screen	; debut affichage et position buffer = 8 scanlines	
:80	.byte	$0D							; 80 * 2 scanlines
	.byte $42,<hello2, >hello2, 2, 2	; 3 * 8 scanlines
	.byte jvb, <dlist, >dlist			; command vbl + address new dlist (Low + High)

fname .byte c'village4bin'; 11 characters ATASCII (8.3 without the dot, space padded)
	
hello2
	.byte "VOIR  EXAMINER PRENDRE PARLER ATTENDRE  "
	.byte "ALLER UTILISER DONNER  INV    ACTIONNER "
	
	icl 'hardware.asm'
	icl 'xbios.asm'

	org screen
hello
	.byte "          LE BOURG D'ISSEGEAC      09H00"
	ins 'village2.bin'
	

 

 

Source + atr https://drive.google.com/file/d/1XS1UR6NdPKC-TIrL5njJIk-gzrH7sMgQ/view?usp=sharing

secte_noire_001.png

secte_noire_002.png

  • Like 3
Link to comment
Share on other sites

Well, as always, I found my error after posting. I need to put the file Name in UPPERCASE. I'm really dumb.

So with "fname .byte c'VILLAGE4BIN'" it's working. The picture is loaded on screen.

 

But I always have an error at the Org address of the program crashing at $2000, although nothing seems to be written at this address.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Not sure how the XBIOS routines work, but usually in Atari OS, strings all end with $9B

I would have thought that XBIOS would use the same terminator.

e.g.

hello2
	.byte "VOIR  EXAMINER PRENDRE PARLER ATTENDRE  ",$9b
	.byte "ALLER UTILISER DONNER  INV    ACTIONNER ",$9b
  • Like 1
Link to comment
Share on other sites

If this is from an Amstrad why do you think these village.bin files will execute on a different machine ? I would have thought you’d have to disassemble the original game and then write all the new Atari code. Or maybe you’ve done that already ?

  • Like 1
Link to comment
Share on other sites

46 minutes ago, Alfred said:

HELLO2 needs to be converted from Atascii to video, say with an .SBYTE directive.

He's using MADS, strings in double quotes are screen bytes, single quotes produce Atascii strings

Link to comment
Share on other sites

Posted (edited)
2 hours ago, TGB1718 said:

Not sure how the XBIOS routines work, but usually in Atari OS, strings all end with $9B

I would have thought that XBIOS would use the same terminator.

e.g.

hello2
	.byte "VOIR  EXAMINER PRENDRE PARLER ATTENDRE  ",$9b
	.byte "ALLER UTILISER DONNER  INV    ACTIONNER ",$9b

When I add ",$9b", it add ";" at the end. I think the display list in antic 2 only read 40 octets in memory by line.

Here i don't load data with a string function. It's just raw data.

1 hour ago, Alfred said:

If this is from an Amstrad why do you think these village.bin files will execute on a different machine ? I would have thought you’d have to disassemble the original game and then write all the new Atari code. Or maybe you’ve done that already ?

The bin files here is just screenshot picture i convert with my own tools to atari format.

secte_noire_003.png

Edited by tonma
Forget the picture
Link to comment
Share on other sites

perfect choice 🙂

Three things:
  - files can be recorded on the disk with lowercase letters and xBIOS will support them (in your case you need to change them to uppercase letters in the code)
- xBIOS from early versions does not start the loaded program from the beginning, but like DOS through vectors - this is because in the xBIOS configuration you can redefine these vectors to other addresses, e.g. to load the program from $0200 :D. In your case, add: RUN $2000 to the code
- if you want quick help with xB, write me a private message because I am in a different time zone than my personal moderator and you will have to wait for a response.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

If you are considering using the OS in your game, I can also suggest a version of xBIOS that uses the OS and has a built-in ZX0 decompressor for binaries and data - your images can be saved on disk in a compressed form, but your program will see them as unpacked. (It was supposed to be a version for 8bitUnity but I see it hasn't been publicly presented for a few years)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

15 hours ago, xxl said:

I am in a different time zone than my personal moderator and you will have to wait for a response.

did you mean a probation officer? :D 

 

and by the way, best regards - I haven't seen you for a long time :) 

Link to comment
Share on other sites

49 minutes ago, zbyti said:

did you mean a probation officer? :D 

 

and by the way, best regards - I haven't seen you for a long time :) 

 

in the commune it is the lead officer who upholds the righteousness with the party line.

 

Besides, If you troll less in random threads, you'll have more opportunities for meetings

  • Like 2
  • Thanks 1
  • Haha 2
Link to comment
Share on other sites

On 4/20/2024 at 3:42 PM, tonma said:

Hi, I'm wanting to port "la secte noire", a amstrad cpc french game. With Point and click instead of text parser.

That's really a good choice. Do you plan to translate the game to English? Which 2D-input device do you plan to support?

If your engine runs well, "La Crypte des Maudits" seems also be interesting...

 

A quick mock-up in which direction the visuals could go:

image.png.3635db3ea3d3d9fd8980fe5421e84b39.png

 

Edited by Irgendwer
  • Like 3
Link to comment
Share on other sites

15 hours ago, Irgendwer said:

That's really a good choice. Do you plan to translate the game to English? Which 2D-input device do you plan to support?

If your engine runs well, "La Crypte des Maudits" seems also be interesting...

 

I think i'll do an english version with sepratate files for dialogue. And certainly a game like "La crypte des maudits" is appealing too.

I'll use the joystick, since many user play with it.

 

I choose to use Words with inverted mode like lucasfilm games but why not an Icon version. I wish to test the game on limited ram, so I don't want to duplicate the Character set. It's faisable with an 16*8 pixels (2 chars).

 

I have a first version with multiple zone on screen to clik. I click on Zone 2 with the cursor on the water.

 

 

secte_noire_005 copie.png

  • Like 3
Link to comment
Share on other sites

6 hours ago, tonma said:

I'll use the joystick, since many user play with it.

Supporting the "Atari Touch Tablet" for input is not only resource friendly but also quite easy - and an adventure with 2D input a very thankful target.

 

 

onescape.png

(Actually a feature which I miss very much for "onEscape".)

  • Like 4
Link to comment
Share on other sites

For anyone reading this, either now, or twenty years in the future, I created an English xBios documentation page, which was a translation of the original instructions.

 

https://atariwiki.org/wiki/Wiki.jsp?page=XBIOS

 

Please note, I collated a lot of stuff and put it in the link above, in English, but I do not call myself an xBios expert, so please don't ask me questions on xBios as I cannot remember. I've done way too many other things in the meantime!!!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

The rumors that horrified patoscene turned out to be true.... an xBIOS with a decompressor for 8bitUnity has leaked.


On this occasion and in connection with the appointment of a new xBIOS Ambassador for systems reaching the zenith of their modesty (Atari 400 with 8KB Ram) Commissioner of the Executive Committee will conduct a training session in which byte by byte a new reality will be born.


We will start with functions that open the gates to the realm of acting on files and, in particular, we will look at CEX - Compressed EXecutables, we will move on to the apotheosis of sound - xSFX Engine level3 where tone will become speech, all in one being....

 

Participation in the training is not free, we require the greatest sacrifice on the altar of progress: time...

  • Like 1
  • Thanks 2
  • Haha 3
Link to comment
Share on other sites

  • 4 weeks later...
On 4/27/2024 at 5:35 AM, snicklin said:

For anyone reading this, either now, or twenty years in the future, I created an English xBios documentation page, which was a translation of the original instructions.

 

https://atariwiki.org/wiki/Wiki.jsp?page=XBIOS

 

Please note, I collated a lot of stuff and put it in the link above, in English, but I do not call myself an xBios expert, so please don't ask me questions on xBios as I cannot remember. I've done way too many other things in the meantime!!!

currently atariwiki is simply asking for name and password, there is not public access for myself for unknown reasons

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