2013-12-12

2013-12-12 Benchmarking Doom

I have put some benchmarking code into the Doom engine to count the number of ticks (each tick being 1/100th of a second currently) that it takes to render 20 frames and then writes it to the stdout.  It provides me with a way of getting a good FPS reading without needing to worry about floating point arithmetic.  Even though the screen is running in mode 0x12, I have wired up the kernel stdout to Bochs' "Port 0xE9 Hack" so that any text written by the kernel also appears in Bochs' separate console window.  This provides console output that works alongside the graphical output of Doom so I can get the benchmarks out without affecting the render code.

At Rich's suggestion, I also tested running Doom without the Parrot Dithering in the VGA driver, the results are:

Average with dithering is 158 ticks per frame = 1.58 seconds per frame = 0.6 FPS
Average without dithering is 115 ticks per frame = 0.87 FPS.

In order to try to work out where I can save time, I have tested a function which just pushes data into the VGA memory as fast as it can so I can see how fast this part can be (bearing in mind that it's a planar Mode 0x12 screen).  Using 32-bit writes (which may not work on all hardware) seems to allow me to paint all the planes in under one tick, so that's reasonable.

Moving on from this, I've created a planar back buffer in memory to store the data ready to be pushed to the VGA memory.  The plot and drawing routines now write to this buffer (which is faster because it can access all the planes without having to change any registers), and I've added a function to update the front buffer (the VGA hardware) from the back buffer.

All of these changes, and Doom now runs at a blistering ... 0.95 FPS ... Oh :(

It may be that the VGA card is not the slowdown here, I'll have to do some proper benchmarking ... maybe after Christmas.

2013-12-03

2013-12-03 DoomVideo

A quick screen capture video to show just how bad the frame rate is (still awesome to watch though).

The intro screen lasts for about 40 seconds, so you may want to skip past it.


I'm searching through my copy of Programmer's Guide to the EGA, VGA, and Super VGA Cards by Richard F. Ferraro (very good book) to find a better way to get the data into the VGA memory.

I tested writing all of each plane at a time using 32-bit writes, and that filled the screen in under 1/100th of a second, so fast enough for double-buffering, which is what I'm investigating.

2013-12-01

The Biggest Letters in the Whole Wide World

So, I was watching TV with my daughter the other day and a character in one of the kids programs said they were trying to make "the biggest '9' in the whole wide world".  This got me to thinking, where is the biggest '9' in the world?  For that matter, what about all the other letters?

I'd say the only ground rules are that the letter has to be a physical structure, and that the structure was intended to represent that letter (so an American Football goalpost doesn't count as a 'Y').  For the moment, I'll restrict this to the Latin alphabet

I guess most of them are going to be found on buildings or perhaps ships.  The "HOLLYWOOD" sign might scoop six of the letters, but where are the others?  Some of them may actually be quite small.  Suggestions in the comments ...


  • A
    • "READYMIX[5] 240 metres tall.
    • "BISMARK[10] 87 metres tall (estimated).
    • "CASAS BAHIA 1[7] 71 metres tall (estimated).
    • "Coca Cola[3] 15.5 metres tall (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
  • B
    • "BISMARK" [10] 87 metres tall (estimated).
    • "CASAS BAHIA 1" [7] 71 metres tall (estimated).
  • C
    • "LUECKE[4] 950 metres tall (estimated).
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "Coca Cola" [3] 32 metres tall (estimated)
  • D
    • "READYMIX[5] 240 metres tall.
    • "GOD'S WISDOM[9] 28 metres tall (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
    • "HOLLYWOOD[2] 14 metres tall.
  • E
    • "LUECKE[4] 950 metres tall (estimated).
    • "READYMIX[5] 240 metres tall.
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
  • F
    • "FOWL[11] 55 metres tall (estimated).
  • G
    • "GOD'S WISDOM[9] 28 metres tall (estimated).
  • H
    • "CASAS BAHIA 1[7] 71 metres tall (estimated).
    • "HOLLYWOOD[2] 14 metres tall.
    • Pink suggested a Helipad somewhere?
  • I
    • "READYMIX[5] 240 metres tall.
    • "BISMARK[10] 87 metres tall (estimated).
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "CASAS BAHIA 1[7] 71 metres tall (estimated).
  • J
    • "JOSTWINE.COM" [6] 75 metres (estimated).
  • K
    • "LUECKE[4] 950 metres tall (estimated).
    • "BISMARK[10] 87 metres tall (estimated).
    • "FOWL[11] 55 metres tall (estimated).
  • L
    • "LUECKE[4] 950 metres tall (estimated).
    • "Coca Cola[3] 32 metres tall (estimated).
    • "HOLLYWOOD[2] - 14 metres tall.
  • M
    • "READYMIX[5] 240 metres tall.
    • "BISMARK[10] 87 metres tall (estimated).
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "Platte Mound M" - 73 metres tall.
  • N
    • "JOSTWINE.COM[6] 75 metres (estimated).
  • O
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "FOWL[11] 55 metres tall (estimated).
    • "GOD'S WISDOM[9] 28 metres tall (estimated).
    • "Coca Cola[3] 15.5 metres tall (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
    • "HOLLYWOOD[2] 14 metres tall.
  • P
    • "PADDY POWER" [1] 15.2 metres tall.
    • "PLAZA MAYOR[8] 14 metres tall (estimated).
    • "P&O" Cruise Ships 8 metres tall (estimated)
  • Q
  • R
    • "READYMIX[5] 240 metres tall.
    • "BISMARK[10] 87 metres tall (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
    • "PLAZA MAYOR[8] 14 metres tall (estimated).
  • S
    • "BISMARK[10] 87 metres tall (estimated).
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "GOD'S WISDOM[9] 28 metres tall (estimated).
  • T
    • "JOSTWINE.COM[6] 75 metres (estimated).
  • U
    • "LUECKE[4] 950 metres tall (estimated).
    • "Block U" 30 metres tall.
  • V
  • W
    • "JOSTWINE.COM[6] 75 metres (estimated).
    • "FOWL[11] 55 metres tall (estimated).
    • "GOD'S WISDOM[9] 28 metres tall (estimated).
    • "PADDY POWER[1] 15.2 metres tall.
    • "HOLLYWOOD[2] 14 metres tall.
  • X
    • "READYMIX" [5] 240 metres tall.
  • Y
    • "READYMIX[5] 240 metres tall.
    • "PADDY POWER[1] 15.2 metres tall.
    • "HOLLYWOOD[2] 14 metres tall.
    • "PLAZA MAYOR[8] 14 metres tall (estimated).
  • Z
    • "PLAZA MAYOR[8] 14 metres tall (estimated).
  • 0
  • 1
    • "CASAS BAHIA 1[7] 71 metres tall (estimated).
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9



  • [1]  "PADDY POWER" http://www.telegraph.co.uk/advertising/news/7465528/Worlds-biggest-advertising-sign-built-overlooking-Cheltenham-Racecourse.html

    [2]  "HOLLYWOOD" https://maps.google.com/maps?ll=34.134029,-118.321611&spn=0.001039,0.002064&sll=34.092809,-118.328661&sspn=0.06653,0.132093&t=h&z=20

    [3]  "Coca Cola" https://maps.google.co.uk/maps?ll=-18.529371,-70.249503&spn=0.00238,0.004128&sll=-18.481898,-70.250197&sspn=0.019049,0.033023&t=h&z=19

    [4]  "LUECKE" https://maps.google.co.uk/maps?ll=30.081684,-97.140995&spn=0.00869,0.016512&sll=52.8382,-2.327815&sspn=12.439947,33.815918&t=h&z=20

    [5]  "READYMIX" https://maps.google.co.uk/maps?ll=-32.21714,125.361149&spn=0.016992,0.033023&sll=52.8382,-2.327815&sspn=12.439947,33.815918&t=h&z=16

    [6]  "JOSTWINE.COM" https://maps.google.co.uk/maps?ll=45.800234,-63.381817&spn=0.003501,0.008256&sll=52.8382,-2.327815&sspn=12.439947,33.815918&t=h&z=18

    [7]  "CASAS BAHIA 1" https://maps.google.com/maps?ll=-23.23482,-46.862687&spn=0.004614,0.008256&t=h&z=18

    [8]  "PLAZA MAYOR" https://maps.google.com/maps?ll=36.655336,-4.47956&spn=0.001007,0.002064&sll=36.655314,-4.479591&sspn=0.001007,0.002064&t=h&z=20

    [9]  "GOD'S WISDOM" https://maps.google.com/maps?ll=42.46578,-72.08783&spn=0.001852,0.004128&sll=42.465956,-72.089957&sspn=0.014816,0.033023&t=h&z=19

    [10]  "BISMARK" https://maps.google.com/maps?ll=46.815614,-100.722774&spn=0.001718,0.004128&sll=46.81627,-100.720757&sspn=0.003436,0.008256&t=h&z=19

    [11]  "FOWL" https://maps.google.com/maps?ll=44.829679,-87.905474&spn=0.00178,0.004128&t=h&z=19