If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!
This article has a talk page!

Proto:Donkey Kong (Atari 8-bit family)

From The Cutting Room Floor
Jump to navigation Jump to search

This page details one or more prototype versions of Donkey Kong (Atari 8-bit family).

This article is a work in progress.
...Well, all the articles here are, in a way. But this one moreso, and the article may contain incomplete information and editor's notes.

Files and source code for a prototype build were released by Curt Vendel to AtariAge on August 29, 2008.


Elementary, my dear Cactus.
This needs some investigation.
Discuss ideas and findings on the talk page.
Specifically: Binaries are different, further differences in-game need a closer look. Additionally, the source code has not yet been compiled.


The file A.OUT seems to be a compiled ROM file of the game. It is only around 10 KB, compared to the final game's 16 KB. It has the flag "debug" set to true, and the ROM image even contains a build date:

21.MAR.83 13.42.46

Without even datamining the ROM, we can see prototype sprites for both Donkey Kong and Pauline in action. The only thing the player can do in the demo is play the intro cutscene, and before that the game shows DK on top of the second level.

Version Investigation

Elementary, my dear Cactus.
This needs some investigation.
Discuss ideas and findings on the talk page.
Specifically: It's in the header. Even the rough dates of most files are going to be difficult to identify. See the talk page.

According to AtariAge user Goochman and programmer Landon Dyer, this version of the source code may not all be final or retail:

Landon indicated the official release was not his final - the death sequence isnt perfect something about overlapping cells)

After careful observation by Dyer, here are what we know to be missing, according to him:

- A formatted comment near the gravity control stuff (label 'PtSVel') that explains the equations of motion.

- A piece of copy protection code that changes some zero-page values (in order to cause havoc). The JSR instruction is later checked to see if the stomper has been removed.

- The code in the file 'tr' that implements the Easter egg isn't integrated anywhere (should be near the code that draws the title screen).

If someone was mucking with the code to (say) do a port, I could seem them removing the latter two, but not the first comment. Maybe this is a mix of files.

The proof is in the pudding, however. If it builds (and I'm not even going to try...) and appears to work, then people will certainly find it useful. The only major bug that was fixed "late" was a situation where Mario could fall and fall forever; it was possible for his velocity to grow so that he wouldn't evern intersect with a girder, so he'd just loop around off the bottom of the screen and back to the top. I think I just noodled the collision rectangles to deal with this.

So I would characterize this as "mostly finished" with me probably just twiddling my thumbs and adding the above stuff during the two weeks at the end of the project while Q/A ran through it. [Yeah, things were kind of fast and loose that way; programmers could add stuff during final testing and get away with it.]

(Source: Goochman, Landon Dyer)

Development Credits

This build's dev credits are as follow:

Programming - Landon Dyer

Sound - Brad Fuller

Some Graphics - Mona Lundstrom
; Cartoon drivers
; Written by Vince Wu and Richard Harvey
;; Design, coding & screaming: Landon Dyer			     ;;
;; Firefighting and moral support: Vince Wu			     ;;
;; Graphics artwork: Mona Lundstrom				     ;;
;; Sound tables: Brad Fuller					     ;;

"The ‘cartoon’ sequences were given to another engineer, whose code I had to entirely replace (he originally wanted to do the job in FORTH, and didn’t understand that the game couldn’t afford to devote half the cartridge space to a FORTH interpreter just to make his life easier)."

(Source: Landon Dyer)

Joke Comments

In the file MAIN.PRN.txt, there is a sort of header box summarizing the development timeline. There are some identical and some older versions of this in other files.

;;                                                                   ;;
;;                          D O N K E Y                              ;;
;;                            K O N G                                ;;
;;                                                                   ;;
;;                                                                   ;;
;;Just when you thought it was safe to come back from the arcades....;;
;;                                                                   ;;
;;Perpetrator: Landon Dyer                                           ;;
;;                                                                   ;;
;;HISTORY:                                                           ;;
;;Nov '82 - IDS, initial coding                                      ;;
;;Dec '82 - more coding, hair pulling, general cruftiness            ;;
;;Jan '83 - schedule screaming, rampant insanity, accusations        ;;
;;Feb '83 - semi-winnage, accompanied by cries of anguish and threats;;
;;Mar '83 - Lucifer announces a cooling trend                        ;;
;;                                                                   ;;

In CMAIN, there is some more text under this header box:

; Q: What is black and white and can't turn around in an elevator?
; A: A nun with a javelin in her head.
; Q: What do you call a nun who has had a sex change operation?
; A: A transister.

Two quotes can be found below the header in the TMAIN file:

;		I have desired to go
;		  Where springs not fail,
;		To fields where flies no sharp and sided hail
;		  And a few lilies blow.
;		And I have asked to be
;		  Where no storms come,
;		Where the green swell is in the haven's dumb
;		  And out of the swing of the sea.
;			-- Gerard Manley Hopkins
;	Gotta admit, that I'm a little bit confused,
;	Sometimes it seems to me, like I'm just being used,
;	Got to stay awake, have to try and shake off,
;	This creeping malaise,
;	If I can't find my own ground, how can I find my way
;	   out of this maze?
;	Deaf, dumb and blind, you just keep on pretending,
;	That everyone's expendable, and no-one has a real friend,
;	And it seems to you the thing to do,
;	Would be to isolate the winner,
;	Everything's done under the sun,
;	And you believe in your heart that everyone's a HACKER...
;				- Pink Floyd
;				  Animals

The following is found in MAIN.PRN.txt:

Spring difficulty                                 

; How Hard Can You Get? [*sigh*]
; This table governs how often a spring is to be created.  The numbers
; here are in jiffies.

Dyer didn't know what to call the prizes, and he detailed his plight in the code found in MAIN.PRN.txt among other files:

; Prizes
                    ; These are shoved into players; left-bottom justified in 8x8
                    ; There's some confusion as to what to call the damn things....so I'm
                    ; gonna do what I like, here...
 >prizbas =       *
; the Umbrella
; The "Birthday Cake" [I think...]
; The Purse ["...omigosh...that's not a /Birthday Cake/???"]
; The Hat


  • Fireballs are inconsistently named. Names include FB, Fireballs, FF, Firefoxen, FThings, Fire-thingies, Firecreatures, and Firecritters.
  • Perhaps interestingly, there are no specific comments about the LMD Easter egg.
  • The source code has numerous hints at being written for compilation by the ATARI CAMAC Assembler Ver 1.0A.
  • The game has a 6×6 font of a near-complete English alphabet, with Q replaced by a question mark.
  • There are numerous small typos in the comments, like "gorrila", and "110" instead of "100".
  • Internally, Pauline is referred to several times both by the generic term "LADY", and by the name "Nell".
(Source: Landon Dyer)

Code-Based Game Details

"Kill Level"

There is a proclaimed "kill level". The word "level" here is indicative of the Y-level (height), and this just defines an invisible platform along the bottom of the screen that kills Mario. According to Dyer, "it's just an invisible platform with a "kill" bit set. Land on the platform and Mario dies. That's all." The other three screens have hex value FF stored here, corresponding to no death-plane.

db	$80+26,1			; lev 5 (deadly)
db	5				; killage level (bump Mario off if he ever gets here...)
(Source: Landon Dyer)

Mario's Jump Physics

According to Landon Dyer, "Mario’s jump moves are derived from basic physics of motion, and the calculus-based equations are in the source, nicely formatted so you can see where the magic equates just below came from."

; PtSvel and PtYacc are governed by the usual Newtonian equations of
; motion.  Note that PtSvel must never exceed $100, since the jump
; code can't handle it.  The code in PSFALL will, however, handle it
; (mainly 'cause it HAS to....)

PtSVel  =       -400            ; Jumpman start-jump velocity
PtYAcc  =       20              ; Gravity's acceleration, for every object
gravity =       ptyacc          ; just a synonym
PtMaxX  =       160-5           ; Jumpman max X-position
(Source: Landon Dyer)

Offscreen Hammers

There are actually hammers in the elevator screen (75m), but they are drawn offscreen. This is noted in the drawing hammers routine, and in the "lmap" area of the TABLES section/file.

; Draw hammers
; For the Elevators rack, which doesn't have any hammers, the position
; of the hammers must be off the screen, so they aren't drawn...
        db      nwide+1,nwide+1         ; x_pos is off screen
        db      nlines,nlines           ; and so is y_pos

Both hammers are defined to be at position x = "nwide+1", y = "nlines". The nwide value is always 160, and the nlines one is always 198.

; graphics
pmx     =       $30             ; player offset of left side of playfld
pmy     =       $20             ; player offset of original top of screen
gmode   =       $e              ; graphics mode
nlines  =       198             ; # of lines maintained in Playfield
vlines  =       198             ; # of lines visible at a time
nwide   =       160             ; # of pixels wide (std playfield)
bwide   =       40              ; # of bytes wide

The following images have been edited to show where the two hammers probably are. Additionally, the screen size would normally be 336×240, but its width has been increased to 348 to leave enough room to show the offscreen hammers. The area inside the white outline is what's rendered to the screen, in pixels this area is 320×197. The two out-of-bounds hammers are in the same position. In this mockup, the top-left pixel of the hammer is at pixel position (322,198). It can be seen in the lower-right corner of the second image.

PAL Differences

PAL systems may have used the same ROM image for the game. Apparently, it was a struggle to get everything working properly.

; Its a long story.  In order to get PAL compatibility, ALL of the
; following equates will have to be munged, twiddled, mutated and
; permuted.  Look here if something isn't moving as fast as it should,
; or as slow as it should, or if the color assignments are off.  The
; first table contains NTSC stuff, the second table contains PAL stuff.
; ["Stuff" in this context means anything used as a velocity or
; constant depending on something that is somehow different in PAL.]

Compile-Time Errors

There are a number of compile-time errors indicated in MAIN.PRN and MAIN.PRN.txt. These were probably fixed before the final build.

  38 ERRORs, 1169 Labels, $3F7F free.

 Last error occurred on Page 101

Hidden Credit

DK a8 hidden-signature-graphic.png

At the end of the FONTS file, there is a monochrome encoded graphic not seen during gameplay. It is named "hhfx5", indicating itself as the sixth frame of the explosion graphic, but it is actually a signature by programmer Landon Dyer. This graphic data cannot be found in the final game, likely because it took too much storage space.

Prototype Leftovers

Unimplemented SFX

Elementary, my dear Cactus.
This needs some investigation.
Discuss ideas and findings on the talk page.
Specifically: Is there an arcade equivalent of this?

The comment describing the SFX Driver lists a "warning" sound effect, which is apparently not implemented.

* sfx driver for donkey kong *
*           02/03/83         *
*                            *
*                            *
*                            *
* notes:                     *
*        VERSION             *
*                            *
*                            *
*         priorities         *
*                            *
*   increasing order of      *
*        priority            *
*                            *
*       ch1                  *
*                            *
*       walk                 *
*       jump                 *
*       srivet                *
*       rotate               *
*                            *
*                            *
*       ch2                  *
*                            *
*       march2               *
*       march1               *
*       attack               *
*       warning (not implemented)
*       hammer (in ch 2,3,4) *
*                            *
*       ch3                  *
*                            *
*       stamp                *
*       fall                 *
*       grin                 *
*       girl1 (in ch 3,4)    *
*                            *
*       ch4                  *
*                            *
*       spring               *
*       points               *
*                            *
*       music in ch 1 & 2    *
*                            *
*       howmuch              *
*       intro                *
*                            *
*                            *

Todo List

Elementary, my dear Cactus.
This needs some investigation.
Discuss ideas and findings on the talk page.
Specifically: What in this list still applies to the final version?

In the file TODO is a list of unimplemented features and bugs. The date this was last updated is unknown, and seemingly some (or potentially all) of the bugs on this page were fixed by release.

Unimplemented stuff
Smarter barrel movement strategy
	- Barrels look at joystick direction & Mario's state
	- Tend to "run away" from active hammers

Blue barrels

Moving ladders
	- State init
	- Update
	- Patches to Mario's ladder state handler

	- initial drawing
	- flame animation

DLI in Elevator rack to hack PL3 <- PL1 (so fireballs don't look bad.)

Punt PAL totally

Punt barrel inviso-state

Put yellow in fireball fonts

Bug fixes
	- sticks on ladders sometimes
	- Bogus jumpover on edges of screen
	- install new, non-transparent fonts

Collision detect loses when Mario doesn't touch the edge of an object's kill area.

Barrels go down adjacent to ladders

Floating scores get messed-up on top of ladders (so move 'em.)
Sequential floating-scores lose.

VDRAW doesn't clip very well to the left (garbage created in middle of the screen.)

Wierd things with Luser-abort.  Punt ABORTP() during cartoon sequences (only active during game play.)

Fireball leap doesn't look very good (and probably should be punted.)

Move 2nd hammer to the left on the Ramps rack.

Need better lettering on HOWHI screen, also "PLAYER 1/2" indicator.

Kong currently creates too many barrels (/really/ slowing down the animation on the Ramps rack.)

Kong is garbaged-up on the Elevators rack.

Not all spring fonts are being shown (so punt a couple of them.)

Copyright Message

A pre-final copyright message can be found in the file TIMAIN:

; This is the copyright message
copyrt	db	psxy,64,147
	db	1,9,8,3,10,11,30,11,28,19	; '1983 ATARI'
	db	psxy,48,160
	db	1,9,8,1,10,1,9,8,3,10		; '1981 1983 '
	db	24,19,24,30,15,24,14,25		; 'NINTENDO'
	db	psxy,56,147,psquote
	dw	copysym				; "(C)"
	db	psxy,40,160,psquote
	dw	copysym				; "(C)"
	db	eol

So the older copyright text would have had the top line say "1983 ATARI", rather than the final game's "BY NINTENDO".

Mockup Final
DK a8 title-screen-prototype-mockup.png Donkey Kong (Atari 400)-title.png

Early Sprites

To do:
There are probably more minor differences, ChainSwordCS is working on it!

Donkey Kong

The file KONG.FNT, despite seemingly being identical to be the final version, actually contains early graphics. Namely, Donkey Kong's final sprites were made symmetrical, and mirrored in almost every possible way. This was done as a way of saving cartridge space. The original bitmap artwork was done by Mona Lundstrom, and the conversion to assembly code and mirroring was done by Landon Dyer. He did manually, which may explain the errant blue pixel on Donkey Kong's grin.

(Source: Landon Dyer and The Spriters Resource.)
Prototype Final Notes
DK A400 DK Facing Left Proto.png DK A400 DK Facing Left Final.png Final sprite has one more light-brown pixel around the upper right area of the face, and a light-brown pixel around the upper right area of the arm.
DK A400 DK Facing Right Proto.png DK A400 DK Facing Right Final.png Final sprite has two less pixels around the bottom right area of the hand. The left and right-facing sprites were originally separate sprites, but were merged into one in the final game.
DK A400 DK Left Hand Up Proto.png DK A400 DK Left Hand Up Final.png Final sprite has a one-pixel wider chest, and some differences around the hips.
DK A400 DK Right Hand Up Proto.png DK A400 DK Right Hand Up Final.png Final sprite has a one-pixel wider chest, and some differences around the hips. The raised arm is not symmetrical to the other arm above, and the left-side fist is drawn a bit weird. There exist separate sprites for the arms, legs, and head. In KONG.FNT, the two legs are together, but in the final ROM the sprites are just one leg each, and use mirroring.
DK A400 DK Standing Proto.png DK A400 DK Standing Final.png Final sprite has a one-pixel wider chest, the hand on the left is now identical to the one on the right, and there are differences around the left-side foot and the waist, so as to be symmetrical.
(Source: Original TCRF research)


To do:
Verify whether the arcade version has the first two extra sprites, and their purpose.

The Lady, better known as Pauline, has different sprite-work compared to the original Arcade game. In the final version of this port she only ever appears as one sprite, definitely due to cartridge space restrictions. However, in prototype versions, she had many more sprites, some of which can each be found in MAIN.PRN.txt, LADY.FNT, and KICKDATA.FNT.

(Source: The Spriters Resource.)
Prototype Final Notes
DK A400 Pauline 2 Proto.png DK A400 Pauline Final.png The only sprite which managed to make its way into the final game, with all the ones found below being exclusive to the prototype versions. The bottom of Pauline's dress was redrawn and adjusted slightly, while the dimensions of the sprite itself were touched-up.
Early Prototype Late Prototype Notes
DK A400 Pauline 1 Proto.png Likely intended for when Pauline talks is crying for help.
DK A400 Pauline 3 Proto.png Likely intended for when Mario reaches the top of a level.
DK A400 Pauline DK-1 Proto.png DK A400 Pauline DK-1 Proto2.png In the arcade version, DK climbs up a ladder holding Pauline at the end of a level, but in this version he just makes his noise and grins while standing still. As for differences between the two prototype versions, the latter was clearly intended to be an independently-controlled PART of DK while he climbs. The proper DK body sprites for the rest of this do not seem to exist anywhere in the source code leftovers. Other than cropping, the early and late-prototype sprites are identical.
DK A400 Pauline DK-2 Proto.png DK A400 Pauline DK-2 Proto2.png
DK A400 Pauline DK-3 Proto.png DK A400 Pauline DK-3 Proto2.png
(Source: Original TCRF research)

Debug Code

Debug Flags

A number of debug flags are contained in the header (in HDR, MAIN.PRN.txt, and several other files). This specific text is taken from HDR:

debug	=	true		; turn on debugging code
rom	=	false		; true if generating code for ROM
runram	=	true		; turn off ROM protection code
invinc	=	true		; true if protagonist is invincible

Testing Code

The files TEST.BU and MAIN.PRN.txt (among others) contain debugging/testing code. The code in MAIN.PRN.txt is probably more up-to-date.

;;                                                      ;;
;;                      Testing code                    ;;
;;                                                      ;;

test    local
        lda     #1
        ldx     #1
        jsr     scrgen

rabbit  jsr     dconsw
        cmp     #7
        beq     rabbit

        jsr     icart2
        jmp     rabbit

Build Dates

There are several different build dates seen in the files. These mostly correspond to outdated versions of certain files, and are mostly compile-time dates. The mention of 1982 is likely a typo, based on the development timeline.

Build text Source File
Donkey Kong  Sat Jan 29, 1982
* sfx driver for donkey kong *
*           02/03/83         *
Donkey Kong  Thur Feb 24, 1983
Donkey Kong  Sun Mar 13, 1983
* Revision 19.MAR.83 23.03.22
ÞÉdbÞÉ'19.MAR.83 23.03.23'
* Revision 21.MAR.83 13.42.43
‰db‰'21.MAR.83 13.42.46'
21.MAR.83 13.42.46