Jump to content
IGNORED

Mostest proudest bit of code


Andrew Davie

Recommended Posts

Just curious if any '2600 programmers would like to share short bits of code or algorithms which they happen to be proudest of, and perhaps why the code is special to them. Could be something that saved a few cycles, or something that did the impossible -- or was 'clever' or perhaps achieved some effect that was surprising. Just curious if there's anything 'out there' that people are proud of. So, opening the field to everyone -- it may not be the most sophisticated bit of programming, but if YOU are proud of it, perhaps you might like to share it and explain why. Open to Bb and assembler...

  • Like 1
Link to comment
Share on other sites

8bit * 8bit, high byte as result:

;$0 = number 1
;$1 = number 2
;result in A

      LDA #0
.LOOP
      ROL $0
      BCC .dontAdd
      LSR $1
      ADC $1
      jmp .LOOP
.dontAdd
      LSR $1
      BNE .LOOP
end

 

I'm proud because I invented it myself and turned out to be peasant or 'russian multiplication', Also beacuse it's small and compact and unreadable :D. But it is a bit slow...

 

In kernel bresenham used in ballblazer:

      LDA value
      SBC position
      BCS *+2
      STA value

 

This is what made the checkerboard kernel possible. It slowsdown the processor once every few lines, depending on 'position'. I should continue my work on that game...

 

I have some more on my other pc. Like a self-modifying-self-modifying kernel (for drawing solid colored tiles). and multiple cycle-constant kernels (without sta wsync), which are a pain since the last loop of a cycle-constant kernel is 75 cycles instead of 76 cycles, which causes the next kernel to happen one cycle too early. But maybe this 'problem' is already solved :)

Edited by roland p
Link to comment
Share on other sites

I think I am most proud of the graphics extension I once developed for the C64 and then ported and improved for the Borland Graphics Library. Especially the ultra fast, pattern flood fill was really challenging.

 

I remember how my code and a Tseng ET4000 beat the first hardware accelerated S3 graphics carts my friends were so proud of. :)

Link to comment
Share on other sites

I wrote a bitblitted 'sprite' routine for my Atari ST game, 'Hero III'. It was in 68k assembler, which I at first knew next to nothing about, and was integrated into the rest of the game, which was in compiled GFA basic. I 'invented' a bit masking scheme to keep a black/transparent outline on each sprite to make it stand out...which I thought was pretty cool, plus it sped up the game to the point where it was really playable.

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...