assembly programming and the vga_512x384_bitmap obj
tonyp12
Posts: 1,951
UPDATE: further down is a TEXT SCROLLER.
A short little routine that does a good job, and is·helpful to learn from.
Just had the propeller for a few days.
I'm skipping Spin and go directly to pasm.
Here is·my first·VGA test, it's simple so it's easy to learn from.
1: Fills the color blocks with red/dark_blue
2: put in 16 columns, 64 pixels high.
3: rotate them in sync with monitor display.
Any veterans that have inputs what should have been done in better way?
Post Edited (tonyp12) : 5/24/2009 11:43:24 PM GMT
A short little routine that does a good job, and is·helpful to learn from.
Just had the propeller for a few days.
I'm skipping Spin and go directly to pasm.
Here is·my first·VGA test, it's simple so it's easy to learn from.
1: Fills the color blocks with red/dark_blue
2: put in 16 columns, 64 pixels high.
3: rotate them in sync with monitor display.
Any veterans that have inputs what should have been done in better way?
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 tiles = vga#xtiles * vga#ytiles tiles32 = tiles * 32 OBJ vga : "vga_512x384_bitmap" VAR long sync, pixels[noparse][[/noparse]tiles32] word colors[noparse][[/noparse]tiles] PUB start | h, i, j, k, x, y 'start vga vga.start(16, @colors, @pixels, @sync) 'implant pointers and launch assembly program into COG asm_colors := @colors asm_pixels := @pixels asm_sync := @sync cognew(@asm_entry, 0) DAT ' ' ' Assembly program ' org asm_entry mov counter, #192 '192 words to write :loop wrword palette,asm_colors 'write to hub ram, one time setup rutine. add asm_colors, #2 'move forward 2 bytes djnz counter, #:loop main mov counter, #16 '16 longs wide is one horisontal line shl counter, #6 'multiply with 64 mov asm_pixpntr,asm_pixels 'buffer the asm_pixels pointer :loop wrlong pix_data, asm_pixpntr 'write long for 32 pixels. add asm_pixpntr, #4 'move forward 4 bytes djnz counter, #:loop :waitforsync rdlong sync_clear, asm_sync wz 'read long from hub ram and do a zero flag check if_z jmp #:waitforsync 'if zero, test again. mov sync_clear, #0 'reset it, wrlong sync_clear,asm_sync 'write long to hub ram rol pix_data, #1 'rotate pixel dat left, as lsb is first it will look ror jmp #main asm_colors long 0 'pixel base (set at runtime) asm_pixels long 0 'pixel base (set at runtime) asm_sync long 0 'sync (set at runtime) asm_pixpntr long 0 'buffer for asm_pixels pointer palette long %100000 <<10 + %000001 <<2 'RrGgBbxx + RrGgBbxx (forground and background colors) pix_data long $000000ff sync_clear res 1 counter res 1
Post Edited (tonyp12) : 5/24/2009 11:43:24 PM GMT
Comments
I don't know if it is of interest for you. Just my $.02...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
I posted it on youtube
[url=mhtml:{4C6317E7-E7BB-490B-92C7-AF4FA83717C3}mid://00000001/!x-usc:http://www.youtube.com/watch?v=GWViWCxK_SM][/url]
I can NOT find a 4 color bitmap driver on the OBJ exchange?
And one have·source for that?
preferable just a modified version of·the vga_512x384_bitmap obj
320 pixels/8*2· *240 pixels =··19kb for pixel data
Post Edited (tonyp12) : 5/20/2009 7:58:12 PM GMT
Reads a letter in cog ram, finds the corresponding font bitmap in ROM.
Get rid of the interleaving.
the result: http://www.youtube.com/watch?v=dtahz8WwBm0
A Text Scroller.
In a·clever way it uses RCR for both shifting and insertion of font bits.
The result: http://www.youtube.com/watch?v=dZZMfN2loAg
Post Edited (tonyp12) : 5/25/2009 1:24:16 AM GMT