Extending BASIC

Talk about programming CreatiVision (except games programming). Projects of homebrew hardware are also welcome.
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Sun Dec 29, 2013 9:07 am

Yeah :D thats exact the VDP-Range i think about. Very soon we have one of the best Basic and some people stop laugh :D
User avatar
@username@
Posts: 202
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Extending BASIC

Post by @username@ » Mon Dec 30, 2013 2:43 am

Some other VDP functions added.

VREG Register, Value - Use this to configure video registers. Be careful - do not change modes!
VSAVE - Store VRAM to tape.
VLOAD - Go on, guess :)

I've attached a sample video showing them in action. VREG 5,38 and VREG 6,1 reset to BASIC82/83 default SAT and SPT.

As always, latest binary, source etc is in first post.
You do not have the required permissions to view the files attached to this post.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Mon Dec 30, 2013 9:52 am

Yes! Again i found no words :o
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Mon Dec 30, 2013 11:29 am

I upload the video to youtube if someone don't want to download. Because is a must see!
I hope is okay for you.
http://youtu.be/uDh9X1DEEsc
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Mon Dec 30, 2013 12:12 pm

I also upload the Basic sprite demo video :D
http://youtu.be/rIDRjJEQNb0
User avatar
@username@
Posts: 202
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Extending BASIC

Post by @username@ » Thu Jan 02, 2014 6:19 pm

Happy New Year!

This update finally brings a function! Note that any new functions must be only 3 characters long, to fit in with the interpreter.

This is the final VDP function, VPK, short for VPeeK.

I've tried to automate it a little more too, so you'll notice b83p.exe and a patch.txt file. These are used to automatically update the program blocks when a new 'build' is performed.

Binary, source etc in first post.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Thu Jan 02, 2014 9:29 pm

Happy New Year!
And thanks again for your amazing great CV support.
User avatar
@username@
Posts: 202
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Extending BASIC

Post by @username@ » Fri Jan 03, 2014 1:33 pm

BASIC83H "Speedup" patches

The speed up in 83H is to simply STOP the interrupt!

Code: Select all

ROM:76BA                 CLI
ROM:76BB                 LDA     $C
ROM:76BD                 BPL     loc_76BF
ROM:76BF
ROM:76BF loc_76BF:
ROM:76BF                 SEI
ROM:76C0                 AND     #$7F
ROM:76C2                 STA     $C
ROM:76C4                 LDA     $10
ROM:76C6                 CMP     #$83
ROM:76C8                 BNE     sub_76D0
ROM:76CA                 JSR     sub_B380
ROM:76CD                 JMP     loc_7858
Normally, the code at 76BD would wait until a VBL has been notified with $C high bit being set. This will stop RND updates etc.
Fortunately, the JOY function re-enables the interrupt.

Code: Select all

ROM:AB0E loc_AB0E:              
ROM:AB0E                 CLI
ROM:AB0F                 LDA     $C
ROM:AB11                 BPL     loc_AB0E
Although, the need to set CLI each iteration is unusual :) This also dispatches keyboard reads too. The only other function affected is RND, which will not update $2/$3.
This does make BASIC slow to read - as it takes 2 VBLANKS to read a single JOY direction, then another 2 to read button state - you see the problem.

The final patch in BASIC83H is for a printer. Although probably not useful, it may be of interest if you've had trouble printing.
BASIC83H changes the initialisation to output $00 rather than $7F of other basics. This I believe will be printer dependent.

Code: Select all

ROM:7E3E                 LDA     $E800
ROM:7E41                 LDA     #0
ROM:7E43                 STA     $E800
ROM:7E46                 LDA     #$36 
ROM:7E48                 STA     $E801
ROM:7E4B                 LDA     #$3E 
ROM:7E4D                 STA     $E801
ROM:7E50                 RTS
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
Mobsie
Posts: 495
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Extending BASIC

Post by Mobsie » Fri Jan 03, 2014 2:02 pm

Thats very interesting, thanks for sharing. You able to fix this?
Post Reply