Jump to content

Photo

VBXE - programming, examples, programming queries


132 replies to this topic

#1 Rybags ONLINE  

Rybags

    Quadrunner

  • 14,901 posts
  • Location:Australia

Posted Sat Nov 21, 2009 8:49 PM

Just started this thread to help keep the other VBXE threads free.

I started playing about last night - a lot to get a grasp on.

Initial playing about has been with the memory control and colour map features via XDLs. Of course you need to know the memory control stuff before you can do anything useful with the other features of VBXE.

Here's my first example program in BASIC. It creates an XDL which sets up a colour map which covers the top part of the screen. The program takes a minute or so to run - the loop which sets the attributes is a bit slow. Once the program has run once you can change line 176 so the GOTO is executed to skip that part.

Colormap eg 1.jpg

Downloadable BASIC program (unzip to a directory mounted as an APE ImageDrive): Attached File  colmap2.zip   955bytes   265 downloads

10 V=214*256
 20 MEMCONTROL=V+94
 30 MEMBANK=V+95
 40 POKE MEMCONTROL,128+8:REM $8000, 4K, CPU ACCESS
 50 POKE MEMBANK,128+0:REM BANK 0
 60 XDL=32768
 70 POKE XDL,40:REM COLORMAP ON, REPEAT
 80 POKE XDL+1,14:REM SET MAP ADR/STEP, SET MAP PARAMETERS, SET ATTRIBUTES
 90 POKE XDL+2,7:REM REPEAT 7 MORE
 100 POKE XDL+3,0:POKE XDL+4,16:POKE XDL+5,0:REM ADR $4000 IN VBXE FOR COLORMAP
 110 POKE XDL+6,160:POKE XDL+7,0:REM STEP BY 160 BYTES
 115 POKE XDL+8,0:POKE XDL+9,0:POKE XDL+10,7:POKE XDL+11,7:REM H/VSCROL, MAP CELL SIZE
 117 POKE XDL+12,2:POKE XDL+13,255:REM NORMAL WIDTH, OVERLAY PRIORITY>GTIA
 120 FOR A=XDL+14 TO XDL+14+3*10 STEP 3
 130 POKE A,40:REM COLORMAP/REPEAT
 140 POKE A+1,0:POKE A+2,7:REM REPEAT 7
 150 NEXT A
 160 POKE A,0:POKE A+1,128:REM JVB
 170 POKE MEMBANK,128+1:REM BANK 1
 175 BC=0
 176 REM GOTO 300
 180 FOR Y=0 TO 12:CS=32768+Y*160:LUM=6:LS=1
 185 FOR X=0 TO 39
 190 C=CS+X*4
 200 POKE C,0:REM PF0
 210 POKE C+1,LUM:REM PF1
 215 LUM=LUM+LS:IF LUM=15 OR LUM=6 THEN LS=-LS
 220 POKE C+2,BC:BC=BC+16:IF BC>255 THEN BC=BC-255
 225 POKE C+3,0
 230 NEXT X
 240 NEXT Y
 300 POKE V+65,0:POKE V+66,0:POKE V+67,0:REM SET XDL ADDRESS
 310 POKE V+64,3:REM ENABLE XDL, EXT COLOR

Quick hint - when playing around, it's fairly easy to get a screen that's near unreadable. Rather than pressing RESET to clear everything up, just set VIDEO_CONTROL to 00 or 02 to disable XLD processing. Value 02 disables XDL, but retains the extended colour ability, e.g. independant PF1/PF2 colours in hires.

#2 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sat Nov 21, 2009 9:07 PM

Memory Control and BASIC (and other programming languages for that matter)

One of the problems existing since the 130XE came out is that in standard BASIC, using the RAM window from $4000-$7FFF is problematic in that if your program happens to grow such that it enters that window, then using bank-switching is hazardous at best.

In the example above, I've used MEMAC_A. VBXE retains the legacy feature of windowing it's RAM via MEMAC_B which performs banking in a similar fashion to the 130XE, ie the window is fixed at $4000-$7FFF and you can select 16K to view at a time.

MEMAC_A is much more versatile. In the example program, I've defined a 4K window which exists at $8000-$9000.
That allows scope for a large(ish) Basic program to exist, and also not have any problems with the Antic screen RAM being compromised.
Of course, a hires bitmap mode would be compromised.
The other thing is - we can set CPU and/or ANTIC access to be to main memory or VBXE RAM. But still the consideration exists that the CPU still needs acccess to main memory to draw to the screen.
Obviously the solution is that we should only switch on our window to VBXE RAM when we need to.

MEMAC_CONTROL resides at $D65E (for this discussion, assume we have VBXE using Page $D6)
The top 4 bits control the start address of the window, so any $1000 byte boundary is valid here - of course taking into account that any ROM or other RAM expansion will take precedence.
Bits 3 and 2 control whether the CPU and ANTIC access normal or VBXE RAM within the defined window.
Bits 1 and 0 control the window size, which can be 4, 8, 16 or 32K

As per the docs, it is best to setup MEMAC_CONTROL early on, then leave it and use MEMAC_BANK_SEL for controlling the window one set up.

MEMAC_BANK_SEL ($D65F) controls which area within VBXE RAM our window is accessing. The high bit should be set to enable the VBXE Memory Access. Once set, CPU and ANTIC access will be as per the bitsettings (3,2) of MEMAC_CONTROL.

The bank number we are accessing at any given time is stored right-justified in bits 6-0.

#3 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Sat Nov 21, 2009 9:25 PM

to make it fully compatible with vbxe you should extend it by vbxe detection
this could be done using VBXE_BASE variable and simple peek and poke check

as for quickly restoring default screen colors you need to write any value above standard GTIA registers
ie poke 53310,0 should be pretty universal ($D01E + $20 - HITCLR shadow) - this will reset fx core registers to their default values
remember that altering default palette (pallette 0) cannot be undone - you need to reload it by hand, or reload core accessing VBXE controller, but this is beyond scope of this thread

#4 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sat Nov 21, 2009 10:55 PM

OK... first tryout of a fullscreen bitmap overlay. These are easy to setup, only a 10 byte XDL needed for this one.

Some corruption at top of pic... looks like I didn't strip the bitmap from the file quite right. Also strange blue bits in the trees, don't know how I managed that.

Oh well, nice and all. This stuff really shows up the weakness of the default disk drive speed.

Next up, might try a massive pic and do some scrolling around it.

eg1.jpg

Original source I used - a photo I took of the Australian Museum (from about 400 metres higher up). Colours are somewhat dull... it was a cloudy day.

Attached File  eg1.bmp   76.05KB   198 downloads

#5 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sat Nov 21, 2009 11:39 PM

Attached File  #VBXE 1.zip   58.17KB   276 downloads

Zipped ATR with the program for that picture (LOAD "D:SHOWPIC.BAS") - corruption included... fix it later.

Change the filespec in line 20 to point to the disk drive you're using before running the program.

It loads the palette a little slowly, but burst reads the picture, so the thing doesn't take too long.

It also has PF1 with higher priority, so once the program has run the picture will behave like wallpaper.

#6 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

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

Posted Sun Nov 22, 2009 3:02 AM

cool stuff... need to get mine sorted with Candle.

#7 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sun Nov 22, 2009 4:20 AM

Normal
MFalcon normal 1 compact.jpg

Interlaced
MFalcon interlaced 1 compact.jpg

First examples of full-fledged Interlaced VBXE pic. Camera shot doesn't really show the difference accurately, but trust me that those jaggies are substantially reduced compared to normal 240 pixel high rez.

So, we effectively have here a 320h x 480v display in 256 colours.

No executable yet... I knocked this together as a rough & ready thing. Picture data on it's own would be ~ 153K if it was a full 320x480.

I might try doing a multi-stage loader then run it through the compressor... something like 50-70K for such big pics would be much more acceptable than 150K+

#8 pps OFFLINE  

pps

    Dragonstomper

  • 765 posts
  • Location:Berlin, Germany

Posted Sun Nov 22, 2009 5:13 AM

Looking at this - I have to hurry to install my VBXE as soon as possible ;)

#9 mimo OFFLINE  

mimo

    Preppie!

  • 6,802 posts
  • It's easy living in a bubble

Posted Sun Nov 22, 2009 5:24 AM

*sings to the tune of money for nothing*
I want my vbxe

#10 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Sun Nov 22, 2009 5:38 AM

Gary: You definitly need a hard disk ;) Then compressing thing will mean literally slowing things down, but You could read Simonl blog entry, there is a VBXE graphics format proposal that is verry elastics and can accept up to 1024 simultanously on screen ;)
oh, btw - try to get some focus out of your 1084 ;) i would replace CRT unit with VGA one (0.27mm pitch per pixel compater to 0.85mm pitch of original CRT) but this is a bit complicated ;)
Anyways, if You open it, there are two knobs on black thing with thick red wire comming to the CRT glass, its called flyback transformer
lower knob is for Screen (overall brightness) and shouldn't be touched (up to 450V there)
higher is Focus - up to 2.5kV there, so use flat head scewdriver to set it
it pretty safe if everything is in good shape, but i would always undertake some precautions to avoid zapping :) not a pleasant experience ;)

Haeven: I'll send Your Atari in monday (tomorrow), we settle the shipment cost later

Mimo: soon ;)

#11 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sun Nov 22, 2009 6:04 AM

I'm fairly happy with the 1084 display... kinda missed the soft-focus of CRTs as I've been using LCD on the main machine for probably 5 years now.

I'm banging up the loader code for this Millenium Falcon pic - I don't think I'll have it finished until this time tomorrow at least - gotta try to sleep in 2 hours or so, then probably will only get a few hours playtime tomorrow.

With luck the compression utility might shrink the thing down somewhat... I guess in time we'll have a format worked out that's compact and reasonably quick.

If you talk with Simonl, just be sure to mention to cater for the double-sized pictures.

With VBXE anyway, it's just so much easier. Just toggle between 2 XDLs of about 10 bytes each, rather than the old way of needing huge amounts of LMS DList instructions if you wanted your interlaced picture stored in linear fashion.

XDL - just set the skip to 640 bytes, and offset the screen origin by 320 on the second field.

#12 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sun Nov 22, 2009 7:43 AM

Was just thinking earlier on... the colourmap function could produce some awesome zoom effects.
Has anyone done a demo as such yet?

#13 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Sun Nov 22, 2009 7:45 AM

elaborate a bit on this ;)
how you could use color map for zoom?
there is plasma based on cmap, but thats it for now
TeBe is using cmap for most of his work, but for zoom?

#14 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • 12,350 posts
  • Location:United Kingdom

Posted Sun Nov 22, 2009 7:48 AM

This is a great thread - something I've wanted to see for ages. :)

#15 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Sun Nov 22, 2009 7:50 AM

Since we have control over cell size (h/v pixels per cell), and other stuff like scrolling and step rate per row, it should mean you could just use it to represent an image, then zoom by changing size from 8x8 7x7 etc down to 2x2 then 1x1.

#16 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Sun Nov 22, 2009 7:54 AM

sure, but still no fixed point accuracy, it goes the same for blitter, although some fixed point tricks are possible, just memory consuming :(

#17 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • 12,350 posts
  • Location:United Kingdom

Posted Sun Nov 22, 2009 10:45 AM

Just tried the 80 column notepad with Atari++ with VBXE support - no VBXE core detected. Is there an emulator available which emulates the newer core?

#18 Tezz OFFLINE  

Tezz

    River Patroller

  • 2,260 posts
  • Location:Manchester, England

Posted Sun Nov 22, 2009 10:49 AM

Unfortunately the latest core hasn't yet been implemented.

#19 Thelen OFFLINE  

Thelen

    Dragonstomper

  • 546 posts
  • Location:Holland

Posted Sun Nov 22, 2009 12:51 PM

My attempt... see this youtube link :

Despitefully youtube's compression makes everything blurry.... :roll: the cars you see on display are the vbxe overlay :)

#20 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Sun Nov 22, 2009 12:58 PM

:D
example you say ;)

#21 Beetle OFFLINE  

Beetle

    Dragonstomper

  • 513 posts
  • Atarian at 8, 16, 32 and 64 Bits
  • Location:north west in Germany

Posted Sun Nov 22, 2009 6:08 PM

Rybags: Nice you got the 320x480i res working, looking forward to check it out here!

Thelen: Thats a cool 'attempt' (its already more than an attempt!), i hope it gets a complete game!

Candle: Kudos to the man who made VBXE2 available to the public a8 scene!Posted Image


Have fun,
Beetle

#22 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Mon Nov 23, 2009 12:35 AM

Just wondering... is there a way to easily generate the default Palette via a formula so it can easily be restored?

Done part of my Interlaced Pic loader... doubt I'll get finished today.

Really want to start playing with this zoomer... it'll be expensive on the RAM usage though as colourmap is 4 times that of a normal display if doing 1x1 pixels.
But I reckon it'll be able to do good effects, even from BASIC.

#23 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Mon Nov 23, 2009 2:27 AM

you have 4 pallete files inside FX core, why would you need to modify a default one? ;)

#24 Rybags ONLINE  

Rybags

    Quadrunner

  • Topic Starter
  • 14,901 posts
  • Location:Australia

Posted Mon Nov 23, 2009 2:45 AM

I don't.

But, you should have the assumption that something/someone has messed it up before you, so it would be handy to be able to quickly restore it.

#25 candle OFFLINE  

candle

    River Patroller

  • 2,793 posts
  • Location:Lublin, Poland

Posted Mon Nov 23, 2009 2:51 AM

palette is included in vbxe pack source files, so you could always write small utility to reset it
but fastes way would be to cycle the power ;)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users