Making a basic video signal

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
JRoatch
Posts: 108
Joined: Mon May 11, 2009 11:48 pm
Contact:

Making a basic video signal

Post by JRoatch »

I now got compiling working, and I am reading up on assembly. I got this idea for a video mode, and wanted to be a surprise, but I don't think I have the programing skills to pull it off.

Basically the whole mode is based off of different sized "pixels". Right now I'm trying to read the code to see how to make a basic video signal. Any pointers?

*to self*: Maybe I should try a bomberman clone first.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making a basic video signal

Post by uze6666 »

For sure, have a head start at an article I wrote on my site: http://belogic.com/uzebox/video_primer.htm

Then it's basically about trying to figure out how to fit as much logic in as little instructions as possible in the pre-defined video segments. And don't be afraid to ask questions, it's of value to everyone, as from now on I'm adding most of these to the WIKI.

-uze
User avatar
TonyD
Posts: 134
Joined: Mon Oct 27, 2008 2:23 pm
Location: Newcastle, UK
Contact:

Re: Making a basic video signal

Post by TonyD »

Uze's video primer is a great place to start and a couple more Video Signal Tutorials which might be of interest can be found at:

Maxim App No 734 - Video Basics
Maxim App No 1184 - Understanding Analog Video Signals
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making a basic video signal

Post by uze6666 »

There's also: http://www.ntsc-tv.com/. Quite a lot of info on the signals and the history of TV. Interesting stuff.

-uze
User avatar
JRoatch
Posts: 108
Joined: Mon May 11, 2009 11:48 pm
Contact:

Re: Making a basic video signal

Post by JRoatch »

How much of this is handled by the AD725 chip, and what do I need to program on the ATmega644?

P.S. I'm still working only on the emulator right now.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Making a basic video signal

Post by uze6666 »

The AD725 produces luminance & chrominance from the input RGB signals into a 1V p-to-p signal suitable for tv. The sync signal is generated by the Uzebox kernel and used by the AD725.

For programming check the WIKI: http://uzebox.org/wiki/index.php?title=AVR_Programming

-uze
User avatar
JRoatch
Posts: 108
Joined: Mon May 11, 2009 11:48 pm
Contact:

Re: Making a basic video signal

Post by JRoatch »

I'm trying out assembly language while reading the assembly of the kernel (probably the best way I'll learn it anyway), and I have a question.
Is it possible to load into a register a immediate value that is the high byte of an address?

My code currently looks like this and it probably wont do anything useful yet.

Code: Select all

.align 256
rel_step:
    nop
    ;insert 248 nop's here
    nop
    out    _SRF_IO_ADDR(DATA_PORT),r18    ;I probably will use a different register
    ld    r31,rel_step    ;I want to put the high byte of rel_step into Z here. <---
    ld    r30,X+    ;and the low byte of Z is loaded from sram
    ijmp    ;jump to Z
    nop
    nop
I didn't think I should start another thread for this. Perhaps I should start a thread documenting the progress of my programming like lightfoot256 has.
User avatar
pragma
Posts: 175
Joined: Sat Sep 20, 2008 2:16 am
Location: Washington, DC

Re: Making a basic video signal

Post by pragma »

JRoatch wrote:I'm trying out assembly language while reading assembly language (probably the best way I'll learn it anyway), and I have a question.
Is it possible to load into a register a immediate value that is the high byte of an address?

My code currently looks like this and it probably wont do anything useful yet.

Code: Select all

.align 256
rel_step:
    nop
    ;insert 248 nop's here
    nop
    out    _SRF_IO_ADDR(DATA_PORT),r18    ;I probably will use a different register
    ld    r31,rel_step    ;I want to put the high byte of rel_step into Z here. <---
    ld    r30,X+    ;and the low byte of Z is loaded from sram
    ijmp    ;jump to Z
    nop
    nop
I didn't think I should start another thread for this. Perhaps I should start a thread documenting the progress of my programming like lightfoot256 has.
That's easy. :) Just use the lo8() and hi8() built-ins. Just search through Uze's code, they're used all over the place.

Also the "ZL" and "ZH" aliases for r31 and r30 make your code a little easier to debug.

Code: Select all

ld ZH,hi8(rel_step)
ld ZL,X+
User avatar
JRoatch
Posts: 108
Joined: Mon May 11, 2009 11:48 pm
Contact:

Re: Making a basic video signal

Post by JRoatch »

I'll make a new thread of this when I have something working.

I just realized that there may be a difference between the opcode's address as numbered by the PC and the byte position of those opcodes.
I basically wanted to make it jump to different to position of the list of nop's, so that it will delay by the amount of a loaded value from ram.

I'm kind of confused to were ijmp will jump to after I load those values into Z like that.
Does the value of Z for ijmp work like the PC or does it work like Z in LPM (bytes instead opcodes)?

If it works like the PC. How would I align rel_step so that it's low byte is 0x00? Because I know .align align by bytes.
Post Reply