Jump to content
IGNORED

I disassembled Donkey Kong 16k


Recommended Posts

I am digging deeply on this one, I know it has been a fan request.

When I looked at the other source code I worked on, it was the 24k version and in 2022.
So, I decided to work on the 16k which has the Pascal entries removed.

If someone can fill me in, did the 24k have a hidden level or was that just the Super Game version?


So far, I have seriously broken this thing down.
I have the scoring, timer, Objects, Sound Table, NPC Movement table, screen setup, NMI.

So far I thing Centipede is my best work, this may top it.

My beef with it now is that I want to release in a way that if you change anything around that it will still run after assembling.

Right now, 98% is done and as soon as it is I will release the code.


This is how a portion of the Elevator Object looks like.

               dw ELEVATOR_PATTERNS
                dw ELEVATOR_01
                dw ELEVATOR_02
                dw ELEVATOR_03
                dw ELEVATOR_04
                dw ELEVATOR_05
                dw ELEVATOR_06
                dw ELEVATOR_07
                dw ELEVATOR_08
                dw ELEVATOR_09
                dw ELEVATOR_10
                dw ELEVATOR_11
                dw ELEVATOR_12
                dw ELEVATOR_13
ELEVATOR_01:                       ; 2X WIDE 2X HEIGHT 4 PATTERNS

                db 002,002
                db  49h, 4Eh
                db  6Ch, 6Ch
ELEVATOR_02:

                db 002,002
                db  6Dh, 6Eh
                db  6Fh, 70h
ELEVATOR_03:

                db 002,002
                db  71h, 72h
                db  73h, 74h
ELEVATOR_04:

                db 002,002
                db  75h, 76h
                db  77h, 78h
ELEVATOR_05:

               db 002,002
                db  6Ch, 6Ch
                db  49h, 4Eh
ELEVATOR_06:                           ; 2X WIDE 1X HEIGHT 2 PATTERNS

                db 002,001
                db  6Ch, 6Ch
ELEVATOR_07:

                db 002,001
                db  75h, 76h
ELEVATOR_08:

                db 002,001
                db  71h, 72h
ELEVATOR_09:

                db 002,001
                db  6Dh, 6Eh
ELEVATOR_10:

               db 002,001
                db  6Fh, 70h
ELEVATOR_11:

                db 002,001
                db  73h, 74h
ELEVATOR_12:

                db 002,001
                db  77h, 78h
ELEVATOR_13:

                db 002,001
                db  49h, 4Eh

 

 

As you can see by the comment.

An object table is set up with how wide in patterns by the height in patterns

Then the pattern themselves points to the relevant pattern in the VRAM

As in a row of 1x6 A's would look like db 65,65,65,65,65,65

Like anyone else, I have always done this manually.
But, using the BIOS routines, once you have the tables set up then you should be able to place the patterns anywhere on screen.

When I did this with my pattern examples I had to do all that work by hand as well as explain to the system how and where to display it.
We will see if the BIOS is better but once we figure out how to do this I hope it can finally be entered into the official record because I can find zero examples of how to do any of this very well.

 

 

Here is the Donkey Kong table

 

 

                 db  1Fh       ;  Something I omitted in the Elevator object.
                 db  18h

                dw DONKEY_KONG_PATTERNS
                dw D_KONG_CENTER
                dw D_KONG_LEFT
                dw D_KONG_RIGHT
D_KONG_CENTER:

                db 006,004
                db  1Fh, 20h, 21h, 22h, 23h, 1Fh
                db  24h, 25h, 26h, 27h, 28h, 29h
                db  1Fh, 2Ah, 2Bh, 2Ch, 2Dh, 1Fh
                db  2Eh, 2Fh, 30h, 31h, 32h, 33h
D_KONG_LEFT:

                db 006,004
                db  34h, 35h, 36h, 37h, 1Fh, 1Fh
                db  38h, 39h, 3Ah, 3Bh, 1Fh, 1Fh
                db  3Ch, 3Dh, 3Eh, 3Fh, 40h, 1Fh
                db  41h, 42h, 43h, 44h, 45h, 1Fh
D_KONG_RIGHT:

                db 006,004
                db  7Bh, 7Bh, 93h, 92h, 91h, 90h
                db  7Bh, 7Bh, 97h, 96h, 95h, 94h
                db  7Bh, 9Ch, 9Bh, 9Ah, 99h, 98h

 

The first two numbers, 1fh,18h, is the address where the object is placed on the screen

The object routine automatically wraps the next line directly under the last for alignment.

 

 


03 Cozmos

Edited by Captain Cozmos
  • Like 2
Link to comment
Share on other sites

On 9/14/2023 at 7:52 PM, Captain Cozmos said:

I am digging deeply on this one, I know it has been a fan request.

When I looked at the other source code I worked on, it was the 24k version and in 2022.
So, I decided to work on the 16k which has the Pascal entries removed.

If someone can fill me in, did the 24k have a hidden level or was that just the Super Game version?


So far, I have seriously broken this thing down.
I have the scoring, timer, Objects, Sound Table, NPC Movement table, screen setup, NMI.

So far I thing Centipede is my best work, this may top it.

My beef with it now is that I want to release in a way that if you change anything around that it will still run after assembling.

Right now, 98% is done and as soon as it is I will release the code.


This is how a portion of the Elevator Object looks like.

               dw ELEVATOR_PATTERNS
                dw ELEVATOR_01
                dw ELEVATOR_02
                dw ELEVATOR_03
                dw ELEVATOR_04
                dw ELEVATOR_05
                dw ELEVATOR_06
                dw ELEVATOR_07
                dw ELEVATOR_08
                dw ELEVATOR_09
                dw ELEVATOR_10
                dw ELEVATOR_11
                dw ELEVATOR_12
                dw ELEVATOR_13
ELEVATOR_01:                       ; 2X WIDE 2X HEIGHT 4 PATTERNS

                db 002,002
                db  49h, 4Eh
                db  6Ch, 6Ch
ELEVATOR_02:

                db 002,002
                db  6Dh, 6Eh
                db  6Fh, 70h
ELEVATOR_03:

                db 002,002
                db  71h, 72h
                db  73h, 74h
ELEVATOR_04:

                db 002,002
                db  75h, 76h
                db  77h, 78h
ELEVATOR_05:

               db 002,002
                db  6Ch, 6Ch
                db  49h, 4Eh
ELEVATOR_06:                           ; 2X WIDE 1X HEIGHT 2 PATTERNS

                db 002,001
                db  6Ch, 6Ch
ELEVATOR_07:

                db 002,001
                db  75h, 76h
ELEVATOR_08:

                db 002,001
                db  71h, 72h
ELEVATOR_09:

                db 002,001
                db  6Dh, 6Eh
ELEVATOR_10:

               db 002,001
                db  6Fh, 70h
ELEVATOR_11:

                db 002,001
                db  73h, 74h
ELEVATOR_12:

                db 002,001
                db  77h, 78h
ELEVATOR_13:

                db 002,001
                db  49h, 4Eh

 

 

As you can see by the comment.

An object table is set up with how wide in patterns by the height in patterns

Then the pattern themselves points to the relevant pattern in the VRAM

As in a row of 1x6 A's would look like db 65,65,65,65,65,65

Like anyone else, I have always done this manually.
But, using the BIOS routines, once you have the tables set up then you should be able to place the patterns anywhere on screen.

When I did this with my pattern examples I had to do all that work by hand as well as explain to the system how and where to display it.
We will see if the BIOS is better but once we figure out how to do this I hope it can finally be entered into the official record because I can find zero examples of how to do any of this very well.

 

 

Here is the Donkey Kong table

 

 

                 db  1Fh       ;  Something I omitted in the Elevator object.
                 db  18h

                dw DONKEY_KONG_PATTERNS
                dw D_KONG_CENTER
                dw D_KONG_LEFT
                dw D_KONG_RIGHT
D_KONG_CENTER:

                db 006,004
                db  1Fh, 20h, 21h, 22h, 23h, 1Fh
                db  24h, 25h, 26h, 27h, 28h, 29h
                db  1Fh, 2Ah, 2Bh, 2Ch, 2Dh, 1Fh
                db  2Eh, 2Fh, 30h, 31h, 32h, 33h
D_KONG_LEFT:

                db 006,004
                db  34h, 35h, 36h, 37h, 1Fh, 1Fh
                db  38h, 39h, 3Ah, 3Bh, 1Fh, 1Fh
                db  3Ch, 3Dh, 3Eh, 3Fh, 40h, 1Fh
                db  41h, 42h, 43h, 44h, 45h, 1Fh
D_KONG_RIGHT:

                db 006,004
                db  7Bh, 7Bh, 93h, 92h, 91h, 90h
                db  7Bh, 7Bh, 97h, 96h, 95h, 94h
                db  7Bh, 9Ch, 9Bh, 9Ah, 99h, 98h

 

The first two numbers, 1fh,18h, is the address where the object is placed on the screen

The object routine automatically wraps the next line directly under the last for alignment.

 

 


03 Cozmos

For those who aren't following, I am also working on researching the OS7 Graphics package.

 

@Captain Cozmos, can you please send me what you have in the disassembly? I am trying to debug mobile object handling (I have semi-mobile object handling working, as I have been able to plot 10 pre-shifted targ riders across the screen with minimal effort)

 

-Thom

Link to comment
Share on other sites

56 minutes ago, Kamshaft said:

If you are intending to release your research to the public, let me know.  I'll post the code on my site for everyone to learn.

 

And if you do intend on releasing the code, do you have comments added in there?

 

Good work!

You can see the os7lib here in github, for z88dk: https://github.com/tschak909/os7lib

 

-Thom

Link to comment
Share on other sites

I have been going through Frenzy and DK to correspond parts of the manual.

The goal is to document the routine and the Data and show exactly how the routine works as a guide.

I have run into a snag because Frenzy uses Mode 1 according to what I can tell.
All the documentation out there says there is an error using the PUT_MOBILE routine in Mode 1
It then gives instruction to use part of the routine in your program and gives a listing to put in your code.

In the case of Frenzy, that code is not present in it's listing so I am suspecting that they discovered the error "after" Frenzy was written and released.
If that is the case then how did they get around the bug.

Mystery's, Mystery's, Mystery's

  • Sad 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...