Quark-85 Demo Kube - 184 x 240 VGA with 8 Colors and Sound on an Tiny85!!

Go To Last Post
438 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is fascinating, but far beyond my experience.

Just throw in...

The ADC is itself a crude timer - if 1/13 (?) of it's pre-scaler is any use. I know not.

The ADC works fine in my experience with a 1Mhz clock. Even unto 10bit, although that is with a clean external reference.

With 2 signals in the Mhz, you could obtain audio with a crude ring modulator (diodes) if you can create a difference frequency in the audio range. Both signals the same should be silence?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

the biggest challenge for many of the games will the 512 bytes of RAM.

 

Make that 319 Bytes.

The Video Driver is using 192 bytes of the available 512 bytes.

 

But it can be done!

That Alien game I made on the old version only had 75 bytes for the main loop, and it was done in C!

This just makes it all the more fun.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While I was doing some plumbing, it occurred to me how I could get rid of that ugly transistor and keep the design to only a few passives!

A water line and tap actually has 3 states...

 

1) Tap On with water flowing.

2) Tap Off with no water flowing.

3) No pressure in the line.

 

So I did this with my RGB bits!

 

Instead of sending color bits as ones or zeros, I now alter the data Direction Registers in the pixel rendering loop.

RGB are on pins B.0, B.1, and B.3, so I just write the value of 7 to set all bit high before the loop.

In the loop, I send data to DDRB, and this does the same thing as sending ones or zeros.

 

But this also allows me a 3rd state (zero while pin enabled), which I use to drive the sound.

 

Hardware is MUCH simpler....

 

From the color pin, I have a diode forward feeding the resistor that drives the color pin on the monitor.

A second diode is then reversed to the audio output, which is pulled up by a 1 meg resistor.

 

Sound is actually better than the transistor job, and now I can have REAL stereo and 4 voices again!

 

I was not happy with the transistor, as it kind of polluted the idea of a single chip system.

Things are looking good again!

 

Now my last choice will be between making this a Game System or Demo Station.

 

As a demo system, there is no joystick port, just a single button for "press any key" kind of control. Simpler hardware.

As a game system, another connector and some hardware will be required, but then games can be made.

 

What do you freaks think?

If I was to publish this one, and possible put a few board out there,  which one would be more popular?

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Sun. Dec 13, 2015 - 08:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't have any 85s on hand, but I've been wondering if I could take an xMega32E8 and go through this thread.... Oh, just what I need, something else to do

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:

Don't have any 85s on hand, but I've been wondering if I could take an xMega32E8 and go through this thread.... Oh, just what I need, something else to do

 

Funny you should ask!

Although only partially complete, the XMega version of this Video Engine pushes 432x240 with 256 colors!

It's so fast that the Main Game Loop is programmed in C. Also works on any XMega.

 

It's on my TODO list, but not until Quark-85 is done!

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Mon. Dec 14, 2015 - 02:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi there fellow freaks!

 

Absolutely amazing stuff, AtomicZombie! Hats off.

 

This is actually my first post on AVRFreaks, but caught my attention as I have Attiny85 VGA project of my own too. I started it this July and sort of finalized the code about a week ago...

 

I didn't know anything about VGA signal timings before I started this project and I'm still considering myself n00b what comes to electronics - been programming for decades, also for embedded, but only started creating electronics "more seriously" early last year.  What I couldn't quite figure out was the trickery of driving RGB and HSYNC + VSYNC with 4 pins, I'm very interested of hearing more about that!

 

When I saw this post my first impression was that "Wowzee, my VGA implementation is pure crap", but thinking a bit more I thought to share insights about my implementation with you too, as the goal of my implementation seems to be quite different from this VGA.

 

Originally the whole idea started as a challenge from a colleague to get ANY kind of VGA out from Attiny85... that proved to be not too hard, so I did set myself a goal to make usable text-mode VGA with external input (to be used for example with other microcontroller, arduino etc...) with UART. The original goal was 16 x 8 characters on screen. Also one important aspect of the goal was NOT to overclock the Attiny and NOT disable the reset-pin :)

 

The current implementation now has 32x14 characters on screen (448 characters!), it listens to UART @9600 bps and parses (small subset of) ANSI-escape codes (cursor move, clear screen, change color, scroll row left, scroll whole screen left, enable/disable wrap...). The font is 6x8 pixels and the nominal resolution is 192 x 112 pixels. "Of course", my single Attiny85 only does B/W because I'm already memory-deprived because I wanted so many characters on screen - 448 bytes of RAM is used for screen textbuffer, the rest 64 bytes is used by two 32-byte buffers: horizontal line currently being drawn and next horizontal line being precalculated so I don't get any gaps on screen.

 

After a while I started to think of getting also color-output and did it the easy way: I wired together 3 attinys, each one drawing it's own color :D They all run in sync and in true-parallel mode, the clock is daisy-chained from attiny to another.

 

I'm hoping not to "hijack" this thread, but just wanted to show what I'm working on, maybe someone would be interested in the implementation details too.

 

My plan was to write a blog-post about VGA in general and the implementation, the source code and schematics are already public in https://github.com/Jartza/octapentaveega

 

My OctaPentaVeega, running simple ansitester

Scrolling full screen left.

 

Picture of the board I designed for it: https://drive.google.com/file/d/...

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Welcome to AVRFreaks Jari.

 

Cheers,

 

Ross

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pleased to meet you, Jari. Sounds like a cool project.

 

The Atomic Zombie regularly boggles the whole bunch of us.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Welcome to this amazing AVR community!

You have a great project going there. I looked at your source, and it is nicely done!
 

I often thought about parallel AVRs, but didn't try as I figured there would be syncing issues.

If you drive from a single external OSC, do all AVRs truly sync, or is there a random nanosecond shift?

Since you did this, perhaps you could offer insight into the results of parallel AVR processing (clock shift)...

 

1) Is the slight shift stable between AVRs? If so, you may see a slight banding on the edge of a pixel as each AVR outputs the color data. It would be very slight.

 

2) Is the shift random? If so, there would be a slight color jitter, much like an interrupt that is not "jitter fixed".

 

Anyhow, great to see another ATiny standing tall and doing the implausible!

 

Cheers.

Brad

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Brad!

 

You have a great project going there. I looked at your source, and it is nicely done!

Thanks :)

 

> I often thought about parallel AVRs, but didn't try as I figured there would be syncing issues.

> If you drive from a single external OSC, do all AVRs truly sync, or is there a random nanosecond shift?

> Since you did this, perhaps you could offer insight into the results of parallel AVR processing (clock shift)...

> 1) Is the slight shift stable between AVRs? If so, you may see a slight banding on the edge of a pixel as each AVR outputs the color data. It would be very slight.

 

You are absolutely right, there is slight shift when daisy-chaining the clock through AVR. The banding is visible on bigger monitors, but with 17-19" displays it's barely visible. Still good enough for me :)

 

> 2) Is the shift random? If so, there would be a slight color jitter, much like an interrupt that is not "jitter fixed".

 

Fortunately no, it's very uniform so it doesn't really bother that much as jitter would.

 

To the technical point, if I had more memory (heh) left I could also try driving at least 4 colors from single attiny, but that would basically require me to push less characters on screen (as I'm using the whole 512 bytes of RAM for buffers, CPU registers + one GPIOR for variables) to store the color-information of characters (at least 2 extra bits per character).

 

If you noticed, I found out that USI can be used nicely to draw the pixels and the characters can be drawn side-by-side unlike many atmega-project I saw.

 

I was going to post my OctaPentaVeega to Hackaday when the blog post is done, but now finding this I'm a bit hesitant... or maybe there's place for two different-goal-VGA implementations there? :D

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

> 1) Is the slight shift stable between AVRs? If so, you may see a slight banding on the edge of a pixel as each AVR outputs the color data. It would be very slight.

 

You are absolutely right, there is slight shift when daisy-chaining the clock through AVR. The banding is visible on bigger monitors, but with 17-19" displays it's barely visible. Still good enough for me :)

 

> 2) Is the shift random? If so, there would be a slight color jitter, much like an interrupt that is not "jitter fixed".

 

Fortunately no, it's very uniform so it doesn't really bother that much as jitter would.

I would expect the delay to be jitter free, but where I'd expect possible issues is around Reset release.

 

You drive one AVR from a External Osc and then use OscOut to drive 2 more, right ?

That means they all exit reset, and some delay, would have the slaves simply wait for their clock.

 

Did you measure the phase difference between master and 2 slaves ?

 

An alternative would be to use SYNC as a lock, and clock all the same, but that would hope the sampling point was in a safe zone.

Last Edited: Mon. Dec 14, 2015 - 08:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:

I would expect the delay to be jitter free, but where I'd expect possible issues is around Reset release.

 

You drive one AVR from a External Osc and then use OscOut to drive 2 more, right ?

That means they all exit reset, and some delay, would have the slaves simply wait for their clock.

 

Did you measure the phase difference between master and 2 slaves ?

 

An alternative would be to use SYNC as a lock, and clock all the same, but that would hope the sampling point was in a safe zone.

 

Hi,

 

I did measure the phase difference, but I can't remember exactly... somewhere < 10ns range anyway.

 

And yes, external oscillator is fed to CLKI and to next chip from CLKO. The "master" (RED) only drives the VSYNC & HSYNC, slaves (BLUE & GREEN) only draw pixels so I connected the VSYNCs together and the slaves listen to VSYNC to sync their timers.

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Had a few minutes to test my new dual voice stereo sound routine, and it seems to be working great.

Tried the project on 5 various monitors, and it works across the board, showing 640x480@60Hz as the mode.

It's also nice to get that ugly transistor off the board and get back to the purity of only a few passive components.

Can't believe I was actually considering a transistor on a one chip project. I should be slapped with a PIC for that!

 

 

Video showing Sound and Joystick working...

https://youtu.be/AjL2fFsBR48

 

 

Sorry for the crudeness of my joystick test demo, it was a lunch-hour hack!!

Rainbow paddle is programmatically drawn in real-time because I was too lazy to draw a Sprite!

 

That horrific sound is the X and Y values of the Ball being sent to the Right and Left channel to test Stereo.

 

I think this Engine is just about ready now, so I will start on a real game.

Perhaps a colorful version of Omega Race with a lot more action that the original?

 

So to Recap, here are the multiple external functions that an ATTiny with 512 Bytes of RAM and 4.5 IO Pins can handle...

 

1) Horizontal Sync Pulse

2) Vertical Sync Pulse

3) Analog Red Signal

4) Analog Green Signal

5) Analog Blue Signal

6) Analog Left Audio

7) Analog Right Audio

8) Analog Joystick POT

9) Digital Joystick Buttons

 

The part count is...

 

1 x ATTiny85

1 x 36MHz Can Clock

2 x Ceramic Caps

6 x Resistors

4 x Diodes

 

Did I mention that AVR kicks ass?

... yeah, I think I did!

 

Cheers!

Brad

 

 

 

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 15, 2015 - 01:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

AtomicZombie wrote:

Had a few minutes to test my new dual voice stereo sound routine, and it seems to be working great.

Tried the project on 5 various monitors, and it works across the board, showing 640x480@60Hz as the mode.

It's also nice to get that ugly transistor off the board and get back to the purity of only a few passive components.

Can't believe I was actually considering a transistor on a one chip project. I should be slapped with a PIC for that!

 

Hehe. I can slap you with PIC32 if it helps? laugh

 

AtomicZombie wrote:

Video showing Sound and Joystick working...

https://youtu.be/AjL2fFsBR48

 

That's just very nice and smooth and amazing. You're the champ!

 

AtomicZombie wrote:

I think this Engine is just about ready now, so I will start on a real game.

 

I thought my engine was ready too, but now I feel it might need some more oomph :D

 

AtomicZombie wrote:

So to Recap, here are the multiple external functions that an ATTiny with 512 Bytes of RAM and 4.5 IO Pins can handle...

...

 

I still would like to see more detailed explanation how this all happens, like with schematic and small story... might be a learning experience!

 

AtomicZombie wrote:

Did I mention that AVR kicks ass?

... yeah, I think I did!

 

We can join you in that song wink

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Pic32... with all those bits, no doubt it would hurt!

Not to get too far off topic, but I dabbled in moving to 32bit last year and found that Pic32 was more Friendly than AVR32 actually.

That thing called "FLIP"... I mean, what the hell???! You have a great IDE and then have to drop into DOS???? Yikes.

No doubt, you can probably program in AS7 and then write directly to the chip now, but at the time it was a REAL turn off.

Ok, back to the topic!

 

No Engine is EVER done... I hear you loud and clear on that one.

Every time I think I have stretched the fabric of reality to the point of tearing, I think of another way to pull it another inch.

This time, perhaps the ATTiny is pushing the limits, so I am going to "wrap it up" and publish.

I will post a schematic today so you can have a look. Joystick will be included later, as I am finalizing some tests.

 

The trick to getting all of these functions on such limited IO is to consider 3 states : Hi / Lo / Z

Since most of the functions on VGA with 1 bit color are digital, you can often run two from a single Pin.

Tie a line Hi, and you can use Lo to control it, and the Hi state of the IO Pin for something else.

A few carefully placed diodes allow you to control 2 digital functions from a single Pin.

 

Once again, thanks for all of the positive feedback dudes!

The hardware deserves all of the credit, as it does all the heavy lifting.

I was just the Freak that told it what to do!

 

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 15, 2015 - 01:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Brad!

 

AtomicZombie wrote:

No Engine is EVER done... I hear you loud and clear on that one.

Every time I think I have stretched the fabric of reality to the point of tearing, I think of another way to pull it another inch.

This time, perhaps the ATTiny is pushing the limits, so I am going to "wrap it up" and publish.

I will post a schematic today so you can have a look. Joystick will be included later, as I am finalizing some tests.

 

I hear that fabric being taut and strained and making squeaking noises while watching your video. Can't wait to see the schematics (and code, if you're releasing that too?)

 

AtomicZombie wrote:

The trick to getting all of these functions on such limited IO is to consider 3 states : Hi / Lo / Z

Since most of the functions on VGA with 1 bit color are digital, you can often run two from a single Pin.

Tie a line Hi, and you can use Lo to control it, and the Hi state of the IO Pin for something else.

A few carefully placed diodes allow you to control 2 digital functions from a single Pin.

 

Ahh. Thanks! I think I get it... wish I knew about that trick earlier... 

 

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is the Schematic for Quark-85, showing how each IO Pin is able to handle more than one task...

 

 

 

The two Joystick Buttons are not yet shown.

Also note that internally, RED, GREEN, and BLUE are pulled down via 75ohm resistor.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 15, 2015 - 05:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Here is the Schematic for Quark-85, showing how each IO Pin is able to handle more than one task...

 

 

 

The two Joystick Buttons are not yet shown.

Also note that internally, RED, GREEN, and BLUE are pulled down via 75ohm resistor.

 

Brad

 

Hi Brad!

 

Thanks a lot. Figured out something like that playing with resistors and diodes to test that "three states" from single pin, but this helps! Neat trick!

 

What's with the Sync, there's only one sync-pin? How does that work? I've been living under impression that you always need Hsync and Vsync for VGA surprise

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

What's with the Sync, there's only one sync-pin? How does that work? I've been living under impression that you always need Hsync and Vsync for VGA surprise

 

 

I used to think that as well until one day I found out by accident, that you only need one IO do do sync.

After noticing that one of my projects was still working after forgetting a wire, I looked into this more and found out...

 

- HSync and VSync is actually XORed internally by the monitor.

- All monitors support "Composite Sync", which is HS and VS mixed externally.

- Composite Sync is sent through the Horizontal Sync Pin. Leave VS unconnected.

 

This is why I am not using a timer to do Sync. Using PWM makes it impossible to mix properly.

In short, HS is inverted during VS, and I have not made this work with PWM successfully yet.

 

I have over a dozen monitors in my lab, some as old as 1990, and this works on all of them.

So, now you have an extra IO Pin... worth as much as gold on an ATTiny!

 

As for assembly logic, it is easy. Just use a "flag" to determine VS (inverted state), and set HS...

 

// HORIZONTAL SYNC ON (7)
lds r0,AVRC_HVS ;2
clr r16 ;1
sbrc r0,0 ;1/2
ldi r16,16 ;1
out PORTB,r16 ;2

If bit 0 of R0 is set, then sync is inverted. 5 Cycles to make Composite Sync!

 

Or if you need single bit control of the port...

 

// HORIZONTAL SYNC ON (7)
lds r0,AVRC_HVS ;2
sbrs r0,0 ;1/2
sbi PORTB,4 ;2
sbrc r0,0 ;1/2
cbi PORTB,4 ;2	

 

 

 

Brad

 

 

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 15, 2015 - 05:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

I used to think that as well until one day I found out by accident, that you only need one IO do do sync.

After noticing that one of my projects was still working after forgetting a wire, I looked into this more and found out...

 

- HSync and VSync is actually XORed internally by the monitor.

- All monitors support "Composite Sync", which is HS and VS mixed externally.

- Composite Sync is sent through the Horizontal Sync Pin. Leave VS unconnected.

 

This is why I am not using a timer to do Sync. Using PWM makes it impossible to mix properly.

In short, HS is inverted during VS, and I have not made this work with PWM successfully yet.

 

I have over a dozen monitors in my lab, some as old as 1990, and this works on all of them.

So, now you have an extra IO Pin... worth as much as gold on an ATTiny!

 

Wow!

 

Indeed, that finding IS worth of extra golden pin :) This has been very educative thread!

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a bit more reading.

A good diagram of the HS and VS being mixed (inverted)...

 

http://what-when-how.com/display-interfaces/standards-for-analog-video-part-ii-the-personal-computer-display-interfaces-part-2/

 

Cheers!

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Brad,

 

Quick question as I'm a bit baffled. The diodes are connected together on both ends? How does that give what we need :D I made a simple test-circuit on breadboard but can't really quite get what I want :(

 

What diodes and resistor values are you using? I seem to have 1n4148 and some generic schottkys (bat85 etc.)

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

Quick question as I'm a bit baffled. The diodes are connected together on both ends?

 

That's just a circuit typo, that needs fixing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Like I said, nothing is ever really complete, especially when it's just wrong!

Corrected...

 

 

Thanks for the QC.

 

Cheers!

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 15, 2015 - 08:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Like I said, nothing is ever really complete, especially when it's just wrong!

Corrected...

 

Thanks for the QC.

 

Cheers!

Brad

 

Ohh! So it just wasn't my imagination when I thought that we now really have some kind of tearing in the cosmos. Phew.

 

Still, amazing stuff, thanks for all the information. Downside is, I now have too much ideas in my head for my own VGA.... darned :D

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

While I was doing some plumbing, it occurred to me how I could get rid of that ugly transistor and keep the design to only a few passives!

A water line and tap actually has 3 states...

 

Brad

Hey Ross!

What did you say about plumbing again? :D

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Jartza wrote:
AtomicZombie wrote:

While I was doing some plumbing, it occurred to me how I could get rid of that ugly transistor and keep the design to only a few passives!

A water line and tap actually has 3 states...

 

Brad

Hey Ross! What did you say about plumbing again? :D Cheers,

 

cheeky Well who would have "thunk it"? For those not watching the hackvana irc, a couple of days ago I suggested that Jari join AVRFreaks and talk with Brad about his VGA efforts. Comparisons were made and I commented that Jari, a former plumber, was probably a better plumber than Brad. And now we learn that Brad does plumbing also!

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ross you or I should not be talking about "plumbing", it makes my eyes teary.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

- HSync and VSync is actually XORed internally by the monitor.

- All monitors support "Composite Sync", which is HS and VS mixed externally.

- Composite Sync is sent through the Horizontal Sync Pin. Leave VS unconnected.

 

This is why I am not using a timer to do Sync. Using PWM makes it impossible to mix properly.

In short, HS is inverted during VS, and I have not made this work with PWM successfully yet.

 

...

 

Brad

 

Hi Brad,

 

Just a thought, looking at the link you provided and understanding composite sync, shouldn't it be possible to run that with PWM, just set PWM to reverse mode when VSYNC should be active and back to normal when VSYNC pulse has passed? This way HSYNC is still handled totally by PWM.

 

No, I haven't tried this yet but planning to give it a go.

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

 

Hi Brad,

 

 

Just a thought, looking at the link you provided and understanding composite sync, shouldn't it be possible to run that with PWM, just set PWM to reverse mode when VSYNC should be active and back to normal when VSYNC pulse has passed? This way HSYNC is still handled totally by PWM.

 

No, I haven't tried this yet but planning to give it a go.

 

Cheers,

 

Yes, on your configuration, that would certainly work.

Not sure if it would fly on mine though, due to the way I have pins configured.

I think PWM forces a pin as an output? If so, that's a no-go on my system then.

 

I run all pins as inputs, pulled up.

When a pin needs to output a zero, I send a zero to the pin, and then set the data direction register.

 

This is necessary due to the way I run most pins as dual function, such as RED / Left Audio and BLUE / Right Audio.

Another reason for using DDRB as the output is so that I don't have to mask bits in my Active Pixel Loop.

Having the Sync Pin in high impedance state tied High means that I can spew any value to the Port without crashing the video driver.

 

Does that make any sense? It seems logical enough when I look at my code!

 

Having to worry about only setting Port Bits 0,1, and 2 for color would mean either careful Main Loop programming, or an ANDI in the Video Loop.

For optimal speed, a Pixel is an 8 bit value as well, rather than having to Read, Change, and Save Nibbles, which would be very slow.

 

Yeah... under the hood, my Audio / Video Driver is absolutely insane, but programming in the "Main Loop" is fairly easy.

Even the Interrupt is all over the place, calling different cycle-counted loops depending on the position of the "beam".

The driver even includes a "Visual" Free Cycle mode that overlays a transparent pattern directly on the live screen to show how many cycles are left for the programmer.

Funny... I have built some Video Systems with considerably "large" hardware, but all in all, Quark-85 is my most "complex" project yet.

Probably why it may also be may favorite, right next to the other one I am working on that now sports over 200 ICs on a breadboard I cannot begin to describe.

 

What a fun hobby though! Forget watching TV... more fun to build TV!

So, if you can make PWM work on a pin set as an input, then indeed... I would be very interested in trying this out.

 

Cheers!

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Wed. Dec 16, 2015 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Yes, on your configuration, that would certainly work.

Not sure if it would fly on mine though, due to the way I have pins configured.

I think PWM forces a pin as an output? If so, that's a no-go on my system then.

 

Well, I tried reversing the PWM, while doing that I noticed that Attiny85 also suffers from the same bug that errata mentions has been in Attiny45, COM1B0 and COM1B1 bits have no effect unless you also set COM1A0 and COM1A1 bits to the same mode sad

 

Unfortunately, reversing the PWM seems to only take action after timer reaches OCR1C and zeroes the calculation, which means losing two hsync pulses. Image as demonstration:

 

 

Gray is the "combined" sync with PWM inversing, brown is the original VSYNC pulse.... Not quite right.

 

 

 

AtomicZombie wrote:

Yeah... under the hood, my Audio / Video Driver is absolutely insane, but programming in the "Main Loop" is fairly easy.

Even the Interrupt is all over the place, calling different cycle-counted loops depending on the position of the "beam".

The driver even includes a "Visual" Free Cycle mode that overlays a transparent pattern directly on the live screen to show how many cycles are left for the programmer.

Funny... I have built some Video Systems with considerably "large" hardware, but all in all, Quark-85 is my most "complex" project yet.

Probably why it may also be may favorite, right next to the other one I am working on that now sports over 200 ICs on a breadboard I cannot begin to describe.

 

What a fun hobby though! Forget watching TV... more fun to build TV!

So, if you can make PWM work on a pin set as an input, then indeed... I would be very interested in trying this out.

 

Cheers!

Brad

 

I'm pretty sure the engine is insane, looking at the result :)

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

No Engine is EVER done... I hear you loud and clear on that one.

Every time I think I have stretched the fabric of reality to the point of tearing, I think of another way to pull it another inch.

 

Brad

 

Hi Brad,

 

Very true, I already started rethinking my code and I'm now trying to push it to 32x16 characters on screen (yes, using the ENTIRE 512 bytes to screen buffer) without overclocking... because I have an idea :D

 

Let's see how that goes.

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you don't overclock perhaps you can use the EEPROM for some rare changed variables.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

If you don't overclock perhaps you can use the EEPROM for some rare changed variables.

 

Heh, there's really no such thing as "rare changed variable" when doing VGA on Attiny85 :)

 

I actually had a plan to use EEPROM for "startup-screen", so you could take a snapshot of what's currently on screen with escape command and store the current screen to EEPROM and every time on boot that screen would be restored (or with other escape-command).

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Brad,

 

Seems this already got featured on Hackaday, but for some reason they seem to call you Lucas... cheeky

 

Also quite missing on the technical details...

 

http://hackaday.com/2015/12/17/a...

 

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was more thinking of sprites for a game!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

I was more thinking of sprites for a game!

 

Ahh, my VGA-implementation doesn't have sprites nor it's really meant to be a game-platform (unless "drawing chars"-games count), I'm trying just to push as much text on screen as I can :)

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

Hi Brad,

 

Seems this already got featured on Hackaday, but for some reason they seem to call you Lucas... cheeky

 

Also quite missing on the technical details...

 

http://hackaday.com/2015/12/17/a...

 

 

Cheers,

 

Odd, I wonder how they found it? I only ever posted it here.

I corrected them on the Lucas bit... thanks, I would have never seen that post on Hackaday.

 

I think your full SRAM to SCREEN video will work.

Just a matter of utilizing all registers.

Use r16-r31 when you need compares, and use r0-r15 when you don't.

CLR and SER are your friend on the lower registers as well!

 

Good luck!

Brad aka Lucas?

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Fri. Dec 18, 2015 - 01:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

I think your full SRAM to SCREEN video will work.

Just a matter of utilizing all registers.

Use r16-r31 when you need compares, and use r0-r15 when you don't.

CLR and SER are your friend on the lower registers as well!

 

Good luck!

Brad aka Lucas?

 

Hi Lucas ;)

 

I'm still very hesitant in overclocking the Attiny for this project, you know, you gotta keep up with your principles ;)

 

I've been already using registers for variables, because 448 bytes is used for character buffer and 64 bytes has been used for draw/predraw-buffer, so the only thing I'm now trying to get rid of is the draw-buffer and use the whole SRAM for character buffer.

 

Doing a quick test I can barely push out the 192 pixels needed for 32 characters on row:

 

That gray line is the HSYNC pulse, brown line is pixel output, in this capture I draw 32 characters worth of "full white" to see the timings... I'm barely within specs :D But I think it's doable.

 

The only downside is that in my 6x8 character font, the last of the 6 pixels is reaaaaallly wide, I'm not sure if that's a problem, because my normal font doesn't use that pixel, only those "line drawing" characters. Another downside is that currently I draw each horizontal line just 4 times (making the vertical pixels essentially 4 "VGA pixels" high) but I can't do that if I have 16 rows, so I need some kind of alternating pixel height, maybe 4,4,3,4,4,3,4,4 horizontal lines per character pixels...

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You will find a way, no doubt about it!

 

I do have a 20MHz version that can do 170x240, but it does squeeze the main loop a bit too much.

Here is a VGA timing calc I made that might help you tweak the line a bit...

 

Screen capture...

 

Download the program here...

http://avrcade.com/temp/vga.exe

 

Just a quick way to see what timings will work, and the values needed to keep to the standards exactly.

The program is a quick hack, sorry.... I am improving this one soon as well!

 

Cheers!

Lucas.... I mean Brad.... damn, even I am doing it now!

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So the Atomic Zombie is really Lucas in disguise

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, that was odd.

The name Lucas isn't even in this thread.

Perhaps the Hackaday dude was thinking about StarWars when he was writing the entry!

 

It's too bad it was posted so soon. The Video Engine is so much better than what I have shown.

Oh well... it's not about fame for me, it's about making it work.

No more answering posts on Hackaday until Quark-85 is REALLY ready to show off!

 

I will let the Hackaday post stew now, as well as the guy that claims this must be fake.

That really made my day! Just wait until this latest game is done, then the disbelief will increase!

 

In an an effort to keep the argument "HOT", here is part of the Video Driver code...

 

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// AVRCADE.COM - QUARK-85 VGA GAME SYTSEM
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// TARGET : ATTINY-85 @ 36 MHZ / VGA @ 640 X 480
////////// HARDWARE AND CODING BY RADICAL BRAD
////////// VERSION DATE : NOV 05 2015
////////////////////////////////////////////////////////////////////////////////////////////////////////

// [36 MHZ HORIZONTAL CLOCK TIMING FOR VGA @ 640 X 480]
// HSP : 135 FROM 0000 TO 0134
// HBP : 067 FROM 0135 TO 0201
// HPX : 920 FROM 0202 TO 1121
// HFP : 022 FROM 1122 TO 1143
// TOT : 1144

// [STANDARD VERTICAL LINE TIMING FOR VGA @ 640 X 480]
// VLN : 480 FROM 000 TO 479
// VFP : 011 FROM 480 TO 490
// VSP : 002 FROM 491 TO 492
// VBP : 032 FROM 493 TO 524
// TOT : 525

// [ATINY-85 PORT PINS]
// PORT B.0 / PIN 5 = RED COLOR / LEFT SOUND
// PORT B.1 / PIN 6 = GREEN COLOR
// PORT B.2 / PIN 7 = BLUE COLOR / RIGHT SOUND
// PORT B.4 / PIN 3 = COMPOSITE SYNC
// PORT B.5 / PIN 1 = JOYSTICK ADC INPUT

// [DEDICATED INTERNAL REGISTERS]
// R10: COMPOSITE SYNC FLAG
// R09: LINE COUNTER HI
// R08: LINE COUNTER LO
// R07: SOUND COUNTER 1
// R06: SOUND COUNTER 2

// [DEDICATED SHARED REGISTERS]
// R25 : HORIZONTAL LINE
// R15 : JOYSTICK POSITION
// R11 : JOYSTICK BUTTONS
// R14 : BACKGROUND COLOR
// R13 : RIGHT SOUND FREQUENCY
// R12 : LEFT SOUND FREQUENCY

// [DEFINE SHARED REGISTER NAMES]
#define HLINE R25
#define	JOYPOS R15
#define	JOYBUT R11
#define	BCOLOR R14
#define	SOUND1 R13
#define	SOUND2 R12

// [3 BIT COLOR PALLETTE]
// 0 = BLACK
// 1 = RED
// 2 = GREEN
// 3 = YELLOW
// 4 = BLUE
// 5 = MAGENTA
// 6 = CYAN
// 7 = WHITE

// [DEFINE COLOR NAMES]
#define	BLACK 0
#define	RED 1
#define	GREEN 2
#define	YELLOW 3
#define	BLUE 4
#define	MAGENTA 5
#define	CYAN 6
#define	WHITE 7

// [GCC APPLICATION BINARY INTERFACE RULES]
// ALWAYS SAVE : R1-R17, R28(YL) ,R29(YH)

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// QUARK-85 DRIVER INITIALIZATION ROUTINE
////////////////////////////////////////////////////////////////////////////////////////////////////////

// ATTINY-85 INCLUDES
#define __SFR_OFFSET 0
#include <avr/io.h>

// STARTUP ROUTINE
.global AVRC_RUN
AVRC_RUN:

// SETUP JOYSTICK ADC
ldi r18,31
out DIDR0,r18
ldi r18,0x20
out ADMUX,r18
ldi r18,229
out ADCSRA,r18
ldi r18,88
out ADCSRB,r18

// SETUP TIMER 0 : VIDEO INTERRUPT @ 1144 CYCLES / 8 = 143
ldi r18,143
out OCR0A,r18
ldi r18,2
out TCCR0A,r18
out TCCR0B,r18
ldi r18,16
out TIMSK,r18

// SETUP TIMER 1 : LATENCY EQUALIZER TIMER @ 4 CYCLES
ldi r18,129
out TCCR1,r18
ldi r18,3
out OCR1C,r18

// SYNCHRONIZE LATENCY TIMER
ldi r18,0
out TCNT0,r18
ldi r18,2
out TCNT1,r18

// INCLUDE USER CODE
#include "User_Code.s"

// ENABLE VIDEO DRIVER
STARTUP:
sei

// RUN LOGIC LOOP
rjmp AVRC_LOGIC

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// HORIZONTAL SYNC PULSE  = 135 CYCLES
////////////////////////////////////////////////////////////////////////////////////////////////////////

// VIDEO INTERRUPT ENTRY POINT (4)
.global TIM0_COMPA_vect
TIM0_COMPA_vect: ;4

// SAVE STATUS REGISTER (5)
push r16 ;2
in r16,SREG ;1
push r16 ;2

// LATENCY EQUALIZER (7/10)
in r16,TCNT1 ;1
cpi r16,1 ;1
brlo AVRC_FIX1 ;1/2
AVRC_FIX1:
cpi r16,2 ;1
brlo AVRC_FIX2 ;1/2
AVRC_FIX2:
cpi r16,3 ;1
brlo AVRC_FIX3 ;1/2
AVRC_FIX3:

// SAVE REGISTERS (12)
push r0 ;2
push r1 ;2
push r16 ;2
push r17 ;2
push YL ;2
push YH ;2

// HORIZONTAL SYNC ON (5)
 sbrs r0,0 ;1/2
clr r16 ;1
sbrc r10,0 ;1/2
ldi r16,16 ;1
out PORTB,r16 ;2

// LEFT CHANNEL SOUND GENERATOR (18)
cbi PORTB,0 ;2
mov r16,r6 ;1
mov r17,r12 ;1
cpi r17,0 ;1
breq AVRC_V11 ;1/2
inc r16 ;1
cp r16,r17 ;1
brne AVRC_V12 ;1/2
clr r16 ;1
AVRC_V12:
brne AVRC_V13 ;1/2
sbi DDRB,0 ;2
AVRC_V13:
breq AVRC_V14 ;1/2
nop ;1
nop ;1
AVRC_V14:
rjmp AVRC_V15 ;2
AVRC_V11:
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
AVRC_V15:
mov r6,r16 ;1

// RIGHT CHANNEL SOUND GENERATOR (18)
cbi PORTB,2 ;2
mov r16,r7 ;1
mov r17,r13 ;1
cpi r17,0 ;1
breq AVRC_V21 ;1/2
inc r16 ;1
cp r16,r17 ;1
brne AVRC_V22 ;1/2
clr r16 ;1
AVRC_V22:
brne AVRC_V23 ;1/2
sbi DDRB,2 ;2
AVRC_V23:
breq AVRC_V24 ;1/2
nop ;1
nop ;1
AVRC_V24:
rjmp AVRC_V25 ;2
AVRC_V21:
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
nop ;1
AVRC_V25:
mov r7,r16 ;1

// LINE COUNTER WRAP AT 525 (11)
movw YL,r8 ;1
adiw YL,1 ;2
ldi r16,hi8(525) ;1
cpi YL,lo8(525) ;1
cpc YH,r16 ;1
brne AVRC_LWL ;1/2
clr YL ;1
AVRC_LWL:
brne AVRC_LWH ;1/2
clr YH ;1
AVRC_LWH:
movw r8,YL ;1

// HORIZONTAL SYNC OFF (5)
 sbrs r0,0 ;1/2
clr r16 ;1
sbrs r10,0 ;1/2
ldi r16,16 ;1
out PORTB,r16 ;2

// VERTICAL SYNC ON AT 491 (5)
ldi r16,1 ;1
cpi YL,lo8(491) ;1
cpc YH,r16 ;1
brne AVRC_HSL1 ;1/2
mov r10,r16 ;1
AVRC_HSL1:

// VERTICAL SYNC OFF AT 493 (4)
cpi YL,lo8(493) ;1
cpc YH,r16 ;1
brne AVRC_HSH1 ;1/2
clr r10 ;1
AVRC_HSH1:

// SOUND BLANKING (2)
ldi r17,16 ;1
out DDRB,r17 ;1

// DELAY (38)
ldi r17,12 ;1
AVRC_HSD:
dec r17 ;1
brne AVRC_HSD ;1/2
nop ;1
nop ;1

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// HORIZONTAL BACK PORCH = 67 CYCLES
////////////////////////////////////////////////////////////////////////////////////////////////////////

// EXIT DURING VERTICAL BLANKING (4)
cpi YL,lo8(480) ;1
cpc YH,r16 ;1
brcs AVRC_ACT ;1/2
rjmp AVRC_EXIT ;2
AVRC_ACT:

// SET HORIZONTAL LINE VALUE = R25 (4)
mov r25,YL ;1
lsr r25 ;1
sbrc YH,0 ;1/2
subi r25,128 ;1

// READ JOYSTICK ADC = R24 (4)
mov r1,r15 ;1
in r17,ADCH ;1
com r17 ;1
clr r16 ;1

// CHECK LEFT BUTTON (3)
cpi r17,10 ;1
brsh AVRC_JB1 ;1/2
ldi r16,2 ;1
AVRC_JB1:

// CHECK RIGHT BUTTON (3)
cpi r17,0 ;1
brne AVRC_JB2 ;1/2
ldi r16,1 ;1
AVRC_JB2:

// SAVE JOYSTICK VALUES (7)
cpse r9,0 ;1
mov r11,r16 ;1
mov r15,r17 ;1
cpse r25,0 ;1
mov r15,r1 ;1
cpse r16,0 ;1/2
mov r15,r1 ;1

... and a whole lot more cycle counted code!!!

 

... ha ha ha... now watch the argument heat up when someone notices I did post some code.

Sure is a LOT of work to fake it... more effort than simply doing it. I must really need the attention!

 

The doubtful Frenchman has now even posted math trying to prove that this is impossible... too much!!!

Quote... "I added a comment above with the math. The math tell the truth."

 

I promise that the words "The math tell the truth" will be going on my website when I detail this project. Priceless!

Damn, if I was stuck in his shoes, I would never push the boundary and learn anything new.

 

The Amiga Boing Demo don't even push 10% of the Main Loop free cycle time.

Quark can also play music and digital sound effects. Even 4 note chords!

 

And no... I don't like indented code or feel the need to use a 20:1 comments to instructions ratio!

 

Anyhow, enough of this diversion, it's back to the breadboard and code, where my attention belongs.

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Fri. Dec 18, 2015 - 03:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hah!

 

Here's some math to prove it!

 

42 / 7 = 6

 

wow! must be fake!

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

42 / 7 = 6

 

wow! must be fake!

Cheers,

 

Indeed!

42/7 is actually 9.... in HEX!

Jack posts his "proof" in terms of uS rather than Cycles, which is where he flops.

But hey, we can all learn something, so hopefully he have that "aha" moment soon.

If I thought any differently, I would never improve my game either.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Fri. Dec 18, 2015 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Indeed!

42/7 is actually 9.... in HEX!

Jack posts his "proof" in terms of uS rather than Cycles, which is where he flops.

But hey, we can all learn something, so hopefully he have that "aha" moment soon.

If I thought any differently, I would never improve my game either.

 

Brad

 

Yep, and 42/7 is 4, in octal :)

 

Any day one learns something new is a good day, and you're never too old to learn some new tricks. I don't believe what they say about old dogs.

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hiya,

 

 

Seems I can draw those pixels fine and dandy without any predrawing buffer. Even 32x20 lines of text, although the last 4 lines are just repeating the first 4 because all of the memory is used :)

 

Just a thought, how about using 2+2 rows from top and bottom to "static" data, which could be stored in EEPROM? :) Like some kind of statusbar or whatever :P

 

And one more thing, maybe I should create a totally new thread for my OctaPentaVeega instead of hijacking this one?

 

Cheers,

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Nicely done... congrats!

What would the Frenchman say????

 

Funny you should mention EEPROM... I was using it to store a "pointer" and some characters on my lower speed systems.

In this one, reading EEPROM might not work at that speed.

I do however, read EEPROM to auto-calibrate the joystick ADC on startup, and then switch over to the external clock.

 

I think your project certainly deserves a full thread, but never worry about "HiJacking"... just a couple of hackers talking!

Quark-85 also uses the same size font. I made a few different ones (5x5 and 6x6). Feel free to try them out...

 

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// 5x5 CHARACTER SET BY RADICAL BRAD
////////////////////////////////////////////////////////////////////////////////////////////////////////

CHARSET:
.dc.b 0,0,0,0,0      ; ASCII: 32 / CHAR:  
.dc.b 4,4,4,0,4      ; ASCII: 33 / CHAR: !
.dc.b 10,10,0,0,0    ; ASCII: 34 / CHAR: "
.dc.b 10,31,10,31,10 ; ASCII: 35 / CHAR: #
.dc.b 31,5,31,20,31  ; ASCII: 36 / CHAR: $
.dc.b 17,8,4,2,17    ; ASCII: 37 / CHAR: %
.dc.b 6,1,22,9,22    ; ASCII: 38 / CHAR: &
.dc.b 4,4,0,0,0      ; ASCII: 39 / CHAR: '
.dc.b 8,4,4,4,8      ; ASCII: 40 / CHAR: (
.dc.b 2,4,4,4,2      ; ASCII: 41 / CHAR: )
.dc.b 2,7,2,0,0      ; ASCII: 42 / CHAR: *
.dc.b 4,4,31,4,4     ; ASCII: 43 / CHAR: +
.dc.b 0,0,4,4,0      ; ASCII: 44 / CHAR: ,
.dc.b 0,0,31,0,0     ; ASCII: 45 / CHAR: -
.dc.b 0,0,0,0,2      ; ASCII: 46 / CHAR: .
.dc.b 8,8,4,2,2      ; ASCII: 47 / CHAR: /
.dc.b 31,25,21,19,31 ; ASCII: 48 / CHAR: 0
.dc.b 4,6,4,4,14     ; ASCII: 49 / CHAR: 1
.dc.b 15,16,14,1,31  ; ASCII: 50 / CHAR: 2
.dc.b 31,16,14,16,31 ; ASCII: 51 / CHAR: 3
.dc.b 1,1,5,31,4     ; ASCII: 52 / CHAR: 4
.dc.b 31,1,15,16,15  ; ASCII: 53 / CHAR: 5
.dc.b 31,1,31,17,31  ; ASCII: 54 / CHAR: 6
.dc.b 31,16,8,4,4    ; ASCII: 55 / CHAR: 7
.dc.b 31,17,31,17,31 ; ASCII: 56 / CHAR: 8
.dc.b 31,17,31,16,31 ; ASCII: 57 / CHAR: 9
.dc.b 4,0,0,0,4      ; ASCII: 58 / CHAR: :
.dc.b 4,0,0,4,4      ; ASCII: 59 / CHAR: ;
.dc.b 8,4,2,4,8      ; ASCII: 60 / CHAR: <
.dc.b 0,31,0,31,0    ; ASCII: 61 / CHAR: =
.dc.b 2,4,8,4,2      ; ASCII: 62 / CHAR: >
.dc.b 6,9,4,0,4      ; ASCII: 63 / CHAR: ?
.dc.b 31,17,29,1,31  ; ASCII: 64 / CHAR: @
.dc.b 31,17,17,31,17 ; ASCII: 65 / CHAR: A
.dc.b 31,17,15,17,31 ; ASCII: 66 / CHAR: B
.dc.b 31,1,1,1,31    ; ASCII: 67 / CHAR: C
.dc.b 15,17,17,17,15 ; ASCII: 68 / CHAR: D
.dc.b 31,1,15,1,31   ; ASCII: 69 / CHAR: E
.dc.b 31,1,15,1,1    ; ASCII: 70 / CHAR: F
.dc.b 31,1,25,17,31  ; ASCII: 71 / CHAR: G
.dc.b 17,17,31,17,17 ; ASCII: 72 / CHAR: H
.dc.b 31,4,4,4,31    ; ASCII: 73 / CHAR: I
.dc.b 24,16,16,17,31 ; ASCII: 74 / CHAR: J
.dc.b 17,9,7,9,17    ; ASCII: 75 / CHAR: K
.dc.b 1,1,1,1,31     ; ASCII: 76 / CHAR: L
.dc.b 17,27,21,17,17 ; ASCII: 77 / CHAR: M
.dc.b 17,19,21,25,17 ; ASCII: 78 / CHAR: N
.dc.b 14,17,17,17,14 ; ASCII: 79 / CHAR: O
.dc.b 15,17,15,1,1   ; ASCII: 80 / CHAR: P
.dc.b 31,17,17,31,4  ; ASCII: 81 / CHAR: Q
.dc.b 15,17,15,17,17 ; ASCII: 82 / CHAR: R
.dc.b 31,1,31,16,31  ; ASCII: 83 / CHAR: S
.dc.b 31,4,4,4,4     ; ASCII: 84 / CHAR: T
.dc.b 17,17,17,17,31 ; ASCII: 85 / CHAR: U
.dc.b 17,17,10,10,4  ; ASCII: 86 / CHAR: V
.dc.b 17,17,21,21,10 ; ASCII: 87 / CHAR: W
.dc.b 17,10,4,10,17  ; ASCII: 88 / CHAR: X
.dc.b 17,17,10,4,4   ; ASCII: 89 / CHAR: Y
.dc.b 31,8,4,2,31    ; ASCII: 90 / CHAR: Z
.dc.b 6,2,2,2,6      ; ASCII: 91 / CHAR: [
.dc.b 2,2,4,8,8      ; ASCII: 92 / CHAR: \
.dc.b 6,4,4,4,6      ; ASCII: 93 / CHAR: ]
.dc.b 0,4,10,0,0     ; ASCII: 94 / CHAR: ^
.dc.b 0,0,0,0,31     ; ASCII: 95 / CHAR: _
.dc.b 0,2,4,0,0      ; ASCII: 96 / CHAR: `
.dc.b 31,31,31,31,31 ; ASCII: 97 / CHAR: a

 

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// 6x6 CHARACTER SET BY RADICAL BRAD
////////////////////////////////////////////////////////////////////////////////////////////////////////

CHARSET:
.dc.b 0,0,0,0,0,0 ; ASCII:32 / CHAR: 
.dc.b 0,6,47,6,0,0 ; ASCII:33 / CHAR:!
.dc.b 0,6,0,6,0,0 ; ASCII:34 / CHAR:"
.dc.b 20,62,20,62,20,0 ; ASCII:35 / CHAR:#
.dc.b 46,42,63,42,58,0 ; ASCII:36 / CHAR:$
.dc.b 38,22,8,52,50,0 ; ASCII:37 / CHAR:%
.dc.b 52,42,60,24,40,0 ; ASCII:38 / CHAR:&
.dc.b 0,6,0,0,0,0 ; ASCII:39 / CHAR:'
.dc.b 0,0,28,54,34,0 ; ASCII:40 / CHAR:(
.dc.b 34,54,28,0,0,0 ; ASCII:41 / CHAR:)
.dc.b 36,24,14,24,36,0 ; ASCII:42 / CHAR:*
.dc.b 8,8,62,8,8,0 ; ASCII:43 / CHAR:+
.dc.b 32,48,0,0,0,0 ; ASCII:44 / CHAR:,
.dc.b 8,8,8,8,8,0 ; ASCII:45 / CHAR:-
.dc.b 32,0,0,0,0,0 ; ASCII:46 / CHAR:.
.dc.b 48,24,12,6,0,0 ; ASCII:47 / CHAR:/
.dc.b 0,28,34,34,28,0 ; ASCII:48 / CHAR:0
.dc.b 0,36,62,32,0,0 ; ASCII:49 / CHAR:1
.dc.b 58,42,42,42,46,0 ; ASCII:50 / CHAR:2
.dc.b 34,42,42,42,62,0 ; ASCII:51 / CHAR:3
.dc.b 14,8,8,62,8,0 ; ASCII:52 / CHAR:4
.dc.b 46,42,42,42,58,0 ; ASCII:53 / CHAR:5
.dc.b 62,42,42,42,58,0 ; ASCII:54 / CHAR:6
.dc.b 34,18,10,6,2,0 ; ASCII:55 / CHAR:7
.dc.b 62,42,42,42,62,0 ; ASCII:56 / CHAR:8
.dc.b 0,46,42,42,62,0 ; ASCII:57 / CHAR:9
.dc.b 0,0,20,0,0,0 ; ASCII:58 / CHAR::
.dc.b 0,32,20,0,0,0 ; ASCII:59 / CHAR:;
.dc.b 0,0,8,20,34,0 ; ASCII:60 / CHAR:<
.dc.b 20,20,20,20,20,0 ; ASCII:61 / CHAR:=
.dc.b 34,20,8,0,0,0 ; ASCII:62 / CHAR:>
.dc.b 6,1,45,6,0,0 ; ASCII:63 / CHAR:?
.dc.b 30,35,25,53,62,0 ; ASCII:64 / CHAR:@
.dc.b 60,10,10,10,60,0 ; ASCII:65 / CHAR:A
.dc.b 62,42,42,42,28,0 ; ASCII:66 / CHAR:B
.dc.b 28,34,34,34,34,0 ; ASCII:67 / CHAR:C
.dc.b 62,34,34,34,28,0 ; ASCII:68 / CHAR:D
.dc.b 62,42,42,42,34,0 ; ASCII:69 / CHAR:E
.dc.b 62,10,10,10,2,0 ; ASCII:70 / CHAR:F
.dc.b 28,34,42,42,24,0 ; ASCII:71 / CHAR:G
.dc.b 62,8,8,8,62,0 ; ASCII:72 / CHAR:H
.dc.b 34,34,62,34,34,0 ; ASCII:73 / CHAR:I
.dc.b 16,34,34,30,2,0 ; ASCII:74 / CHAR:J
.dc.b 62,8,20,34,0,0 ; ASCII:75 / CHAR:K
.dc.b 0,62,32,32,32,0 ; ASCII:76 / CHAR:L
.dc.b 62,4,8,4,62,0 ; ASCII:77 / CHAR:M
.dc.b 60,2,2,2,60,0 ; ASCII:78 / CHAR:N
.dc.b 28,34,34,34,28,0 ; ASCII:79 / CHAR:O
.dc.b 62,10,10,4,0,0 ; ASCII:80 / CHAR:P
.dc.b 28,34,50,60,32,0 ; ASCII:81 / CHAR:Q
.dc.b 62,10,10,26,36,0 ; ASCII:82 / CHAR:R
.dc.b 36,42,42,42,18,0 ; ASCII:83 / CHAR:S
.dc.b 2,2,62,2,2,0 ; ASCII:84 / CHAR:T
.dc.b 30,32,32,32,30,0 ; ASCII:85 / CHAR:U
.dc.b 6,24,32,24,6,0 ; ASCII:86 / CHAR:V
.dc.b 14,48,24,48,14,0 ; ASCII:87 / CHAR:W
.dc.b 34,20,8,20,34,0 ; ASCII:88 / CHAR:X
.dc.b 2,4,56,4,2,0 ; ASCII:89 / CHAR:Y
.dc.b 34,50,42,38,34,0 ; ASCII:90 / CHAR:Z
.dc.b 0,0,0,62,34,0 ; ASCII:91 / CHAR:[
.dc.b 6,12,24,48,0,0 ; ASCII:92 / CHAR:\
.dc.b 34,62,0,0,0,0 ; ASCII:93 / CHAR:]
.dc.b 0,4,2,2,4,0 ; ASCII:94 / CHAR:^
.dc.b 32,32,32,32,32,0 ; ASCII:95 / CHAR:_
.dc.b 0,0,4,8,0,0 ; ASCII:96 / CHAR:`
.dc.b 24,36,20,56,0,0 ; ASCII:97 / CHAR:a
.dc.b 30,40,40,16,0,0 ; ASCII:98 / CHAR:b
.dc.b 24,36,36,0,0,0 ; ASCII:99 / CHAR:c
.dc.b 16,40,40,30,0,0 ; ASCII:100 / CHAR:d
.dc.b 24,44,44,8,0,0 ; ASCII:101 / CHAR:e
.dc.b 0,60,18,4,0,0 ; ASCII:102 / CHAR:f
.dc.b 36,42,30,0,0,0 ; ASCII:103 / CHAR:g
.dc.b 62,8,48,0,0,0 ; ASCII:104 / CHAR:h
.dc.b 0,58,0,0,0,0 ; ASCII:105 / CHAR:i
.dc.b 16,32,26,0,0,0 ; ASCII:106 / CHAR:j
.dc.b 62,16,44,32,0,0 ; ASCII:107 / CHAR:k
.dc.b 0,62,0,0,0,0 ; ASCII:108 / CHAR:l
.dc.b 56,8,24,8,48,0 ; ASCII:109 / CHAR:m
.dc.b 48,8,8,48,0,0 ; ASCII:110 / CHAR:n
.dc.b 16,40,40,16,0,0 ; ASCII:111 / CHAR:o
.dc.b 56,20,20,8,0,0 ; ASCII:112 / CHAR:p
.dc.b 8,20,20,56,0,0 ; ASCII:113 / CHAR:q
.dc.b 60,8,4,0,0,0 ; ASCII:114 / CHAR:r
.dc.b 44,52,0,0,0,0 ; ASCII:115 / CHAR:s
.dc.b 8,60,40,0,0,0 ; ASCII:116 / CHAR:t
.dc.b 24,32,32,24,0,0 ; ASCII:117 / CHAR:u
.dc.b 8,16,32,16,8,0 ; ASCII:118 / CHAR:v
.dc.b 24,32,16,32,24,0 ; ASCII:119 / CHAR:w
.dc.b 40,16,40,0,0,0 ; ASCII:120 / CHAR:x
.dc.b 44,48,28,0,0,0 ; ASCII:121 / CHAR:y
.dc.b 36,52,44,36,0,0 ; ASCII:122 / CHAR:z
.dc.b 0,0,8,62,34,0 ; ASCII:123 / CHAR:{
.dc.b 0,0,62,0,0,0 ; ASCII:124 / CHAR:|
.dc.b 34,62,8,0,0,0 ; ASCII:125 / CHAR:}
.dc.b 16,8,24,16,8,0 ; ASCII:126 / CHAR:~

 

The 5x5 set has only the minimal needed for things like game instructions and high scores.

This is what I used in Quarl-85 to keep memory use as low as possible.

 

Cheers!

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Fri. Dec 18, 2015 - 05:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Nicely done... congrats!

What would the Frenchman say????

 

I think your project certainly deserves a full thread, but never worry about "HiJacking"... just a couple of hackers talking!

Quark-85 also uses the same size font. I made a few different ones (5x5 and 6x6). Feel free to try them out...

 

The 5x5 set has only the minimal needed for things like game instructions and high scores.

This is what I used in Quarl-85 to keep memory use as low as possible.

 

Cheers!

Brad

 

Hi,

 

I've made nice python generating my fonts (can be found from OctaPentaVeega git too) and I was planning to make 6x10 pixel font for my VGA as it would make it nicely even with the screen resolution (each vertical pixel drawn 3 times = 16 * 3 * 10 = 480) :)

 

My biggest problem is now again clock deprivation because drawing pixels "live" is slower than precalculating and just pushing data through... and because I can't buffer UART I need to handle that "immediately" (not to mention the problem of sampling UART @ 9600 bps within 31.45kHz vertical refresh loop).... between drawing each horizontal line I seem to have ~127 clock cycles for UART sampling, ANSI parsing and screen scrolling.

 

UART and ANSI parsing works, but scrolling is the hardest part... still working on that

 

Cheers,

 

//Jartza
Jari Tulilahti

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jartza wrote:

The only downside is that in my 6x8 character font, the last of the 6 pixels is reaaaaallly wide, I'm not sure if that's a problem, because my normal font doesn't use that pixel, only those "line drawing" characters.

How wide exactly is " reaaaaallly wide " ?

eg if it is ~2 pixels, You can always use that 'last pixel' as a part of the font, just implicit background.

 

Jartza wrote:

 Even 32x20 lines of text, although the last 4 lines are just repeating the first 4 because all of the memory is used :)

 

Maybe it is time to bump to a larger part ? ;)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:

How wide exactly is " reaaaaallly wide " ?

eg if it is ~2 pixels, You can always use that 'last pixel' as a part of the font, just implicit background.

 

Well, it's wide. But it's no problem for normal characters and special characters I can always redraw to take that in account...

 

Who-me wrote:

Maybe it is time to bump to a larger part ? ;)

 

 

What, bigger part? why on earth? :D

 

https://drive.google.com/file/d/...

//Jartza
Jari Tulilahti

Pages