News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_freemac

Personal interruption vector while running BASIC programs

Started by freemac, 13:31, 03 December 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freemac

Hi,
I'm currently developping a BASIC game with a background music.For it I hacked PlayerAkgTester_CPC.asm from Arkos Tracker 2
https://github.com/renaudhelias/tron-pixel <= PlayerAkgTester_CPC.asm file + TRON-PIXEL.dsk

For that I :
- added 3 jumps at begin of asm, for calling them from BASIC (Start/call &4000, StartMusic/call &4003, StopMusic/call &4006) as done on BasicAkgTester_CPC.asm, and added (merge) btw "StopMusic" feature
- add a "ret" at end of main asm program (Start/call &4000)
- install during the Start the personalized instruction vector (asm label Sync) at #38/#39
- removed the VSYNC detection, and set a "compteur" variable counting from 5 downto 0, launching PLY_AKG_Play 1 time per 6.
- call the original BASIC interruption vector (jp #B941) at end of my personalized interruption vector

After a call to &4000, I return to BASIC, but music stop. And run back while launching instructions like "list" or "40 goto 40"/"goto 40".

So music does run quite fine while my BASIC program runs (that's cool), but has some latency.

I know that it is makable : at ReSeT#20, Chemin by Madram / Overlanders does return to BASIC if I press "ESC".

What do I miss  :picard2: ?

freemac

Finally I used LASER BASIC to compile all of that into a .BIN  ;D

Targhan

I don't really understand what your code is trying to achieve, but you can NOT have a safe Basic program along with a redirection of the #38 jump.
In Basic, simply use the firmware for it to call your asm code (music code, for example) every 50 or 300hz.
Check my answer here with links to a program that does that.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime


Targhan

Good! But what is the point in using compiled basic?
Just a quick note: &4000-1 = &3fff, not &3999 :).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

freemac

Quote from: Targhan on 15:30, 07 December 19
Good! But what is the point in using compiled basic?
I subscribed a dev challenge in Facebook group called "Amstrad CPC pour toujours and beyond !" (French/English/Spanish)

I'm currently developping a simple Tron game, using compiled basic the game is about 10 times faster (and then cool to play with)
My game got a special stuff, Tron does walk only if one of both player does move joystick. If one player does move its snake, the other snake does move also. If both does stop using joystick, snakes does stop.
Sound track is played after level loaded, until end of level.

https://github.com/renaudhelias/tron-pixel (wip)
I implemented 8 levels. I'm currently writing the sound track "Game of Thrones" on it (using StarKos v1.21 on my MiST-board). It's the first time I use a sound tracker by myself.

I show that CPC-Power did subscribe also, the challenge does end in march, I think you can subscribe until end of december something like that.

AMSDOS

Always sounds interesting to me what others can code in other languages.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Powered by SMFPacks Menu Editor Mod