Jump to content
IGNORED

[AQUARIUS] Machine Language Programming on the Aquarius


jaybird3rd

Recommended Posts

 

ZX Tune has ripper from Sound Tracker. I have decompiled ST player's source. some modifications in code and you have music.

Great work! If you decompiled ST already, couldn't you make a version which would be usable for the Aquarius? I mean that the music files are directly saved in a way, that would be instantly readable for an Aquarius! I am sure this would be greatly appreciated by the Aquarius community. ZXtunes, is a great site by the way! I heard a lot of cool tunes from some talented musicians.

Link to comment
Share on other sites

Here is decompiled source of player.

 

To use it:

ld hl,song;song is compiled Sound Tracker tune

call stc_init

 

each frame

call stc_play

 

About ST: it is not ready and also Sound Tracker Needs compiler. Maybe later?

 

You may use Vortex Tracker(source of player also available, but one need to modify code), VT read Sound Tracker songs and other format, but player takes more cycles.

 

what changed in code: ZX Spectrum ports replaced to Aquarius ports:

 

l7fe3: ld hl,l7c72
xor a
or (hl)
ld a,0dh
jr nz,l7ff1
sub 03h
dec hl
dec hl
dec hl
l7ff1: ld c,0fdh
l7ff3: ld b,0ffh
;#FFFD - address AY-3-8910
;#BFFD - data for reg AY-3-8910
out ($F7),a;;out ©,a
;;ld b,0bfh
push af
ld a,(hl):dec hl
out ($F6),a;;outd
pop af
dec a
jp p,l7ff3
ret
;;l7fe3: ld hl,l7c72
;; xor a
;; or (hl)
;; ld a,0dh
;; jr nz,l7ff1
;; sub 03h
;; dec hl
;; dec hl
;; dec hl
;;l7ff1: ld c,0fdh
;;l7ff3: ld b,0ffh
;; out ©,a
;; ld b,0bfh
;; outd
;; dec a
;; jp p,l7ff3
;; ret

stc_player.zip

  • Like 4
Link to comment
Share on other sites

Thanks for sharing this information and who knows maybe in future someone will make a fully functional soundtracker or other music tool for the Aquarius to play around with. :)

Anyway, I would love to see some more stuff from you for the humble Aquarius. Any projects you are planning to do in the near future?

Edited by Aquaman
Link to comment
Share on other sites

Here is decompiled source of player.

[...]

Thanks very much for sharing this! For quite some time, I've had my eye on the AY composition tools and players that have been developed for other platforms. It makes perfect sense that they should be adaptable to the Aquarius, since it uses the exact same AY-3-891X chip that those other platforms use (and, if I ever have time to follow through on my plans for the Mini Expander II, we'll have two of them to play with!). This is a very helpful beginning to bringing those tools to the Aquarius.

  • Like 1
Link to comment
Share on other sites

Thanks for sharing this information and who knows maybe in future someone will make a fully functional soundtracker or other music tool for the Aquarius to play around with. :)

Anyway, I would love to see some more stuff from you for the humble Aquarius. Any projects you are planning to do in the near future?

 

Not yet now.

Link to comment
Share on other sites

  • 11 months later...

I haven't investigated it yet but I have a question regarding the x=usr(0) function. Okay, two questions. Where is the parameter of the function call stored? And what is returned?

 

I'm thinking this might be useful in creating a library of useful routines that could be called from BASIC, especially for experimenting with machine language.

 

Thanks!

Link to comment
Share on other sites

I haven't investigated it yet but I have a question regarding the x=usr(0) function. Okay, two questions. Where is the parameter of the function call stored? And what is returned?

 

I'm thinking this might be useful in creating a library of useful routines that could be called from BASIC, especially for experimenting with machine language.

 

Thanks!

Maybe this will help you

http://www.vdsteenoven.com/aquarius/mempointer.html

Link to comment
Share on other sites

  • 1 year later...

Hi everyone!
I am the author of CROSS CHASE
https://github.com/Fabrizio-Caruso/CROSS-CHASE
which is a massively multi-platform 8-bit game that runs on about 100 different 8 bit systesms: (nearly) any 8-bit computer and console including of course the Aquarius

(for the +4k and +16k configurations).
I would like to know if it is possible to have my binary loaded with a single command (CLOAD?) instead of using a little BASIC loader first.

I am using Z88DK (together with CC65, CMOC and WinCMOC for other architectures). Z88DK produces two files: the BASIC loader and the binary containing the code.
This is fine but incovenient. Is there a better/simpler solution?

Fabrizio

  • Like 1
Link to comment
Share on other sites

I am using Z88DK (together with CC65, CMOC and WinCMOC for other architectures). Z88DK produces two files: the BASIC loader and the binary containing the code.

This is fine but incovenient. Is there a better/simpler solution?

I don't have used Aquarius so this is a blind shot.

 

But probably there is a way to embed the binary code in a REM statement like in the old ZX81, it would look like trash when listing it but probably the BASIC code is fixed at some point in Aquarius memory and it would be enough with jumping to the known location of the first byte of REM.

  • Like 1
Link to comment
Share on other sites

I haven't used Z88DK, but as I understand it, it compiles the code to a binary image that is intended to run from expanded RAM. The BASIC bootloader simply reads the compiled code from tape, copies it into RAM, and then jumps into it. It shouldn't be difficult to write an equivalent bootloader that runs from the cartridge, so that the same data can be copied into RAM from the cartridge instead. This would have the advantage of being easier to use and much faster than tape, but there is a code size restriction: the cartridge is limited to 16K, minus perhaps a few hundred bytes at most for the bootloader and cartridge signature. That restriction doesn't apply any longer on real hardware thanks to the SuperCart board, which allows bankswitched cartridge ROMs of up to 1MB, but bankswitching is not yet supported by any Aquarius emulator that I am aware of.

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...
On 8/19/2016 at 3:24 AM, slackmar said:

I haven't investigated it yet but I have a question regarding the x=usr(0) function. Okay, two questions. Where is the parameter of the function call stored? And what is returned?

 

I'm thinking this might be useful in creating a library of useful routines that could be called from BASIC, especially for experimenting with machine language.

 

Thanks!

Quite Late to the party but anyway...
Using CALL $0682 (1666decimal) then the value that is X in
A=USR(X)

is placed into the DE register (I think it's a16bit signed int, so 32767 is max value)
So you can have a jump table by
CALL $0682
XOR A
CP E
JP Z,$FUNC0 ; if 0 passed
INC A
CP E
JP Z,$FUNC1 ; if 1 passed
INC A
CP E
JP Z,$FUNC2 ; if 2 passed
.......
RET

These could then be called by
X=USR(0) ; for FUNC0
X=USR(1) ; for FUNC1
X=USR(2) ; for FUNC2

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

  • 1 year later...

I'm learning Z80 assembly and settled on the Aquarius as my test bed :)

 

Let me get this straight:
14340 and 14341 hold the low and high bytes (respectively) of the address at where your machine program starts? Then how do I go about using USR? 

 

 

Link to comment
Share on other sites

Good news!

Wrote a little six byte program that sticks a character in the Aquarius' border ($3000):

 

    ld a,$40
    ld ($3000),a
    ret

 

And POKE'd the decimal values of this into $4000 (using a 16K memory cart). After POKEing the decimal bytes of 00 and 64 ($00/$40) into 14340 and 14341 I called to it using USR and it worked! I guess what I didn't understand is the syntax of USR. Typing USR([some value]) doesn't work but either PRINTing it or setting to a variable does. Go figure. 

 

I know it would be far easier to compile a binary and make a cartridge but I enjoy this backwards approach through BASIC using an array. In fact, that's how some third party Aquarius tape games got loaded in. 

 

Thank you all for the help. I really enjoy the Aquarius. Limited, yes. But it offers more capability than similarly limited computers like the Timex Sinclair 1000 or Tandy MC-10. 

 

Link to comment
Share on other sites

USR tends to be a function, not a statement. It means it is supposed to be able to return a value which you can store into a variable or do calculation with. I don't know what the Aquarius does when it exits the subroutine, if it magically returns the last value used, perhaps the value of the accumulator?

 

Many other systems have SYS/CALL/EXEC but I suppose this one might not, so just like on the ZX Spectrum you have to go through USR. The people over there often combine RANDOMIZE with USR, but I suppose setting a random variable to a value might work just as well.

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