Jump to content
  • entries
    4,960
  • comments
    2,719
  • views
    1,810,470

Burgers on the fourth of July


atari2600land

222 views

Instead of grilling burgers, I'm programming them.

As it turns out,

wait:
  lda $D012    ; load 255 into A
wait2:
  cmp  #$FF   ; look if current rasterline equals 255
  bne wait2    ; if no, goto wait2
  rts         ; if yes, return from subroutine	

does not work. The burger just stands still.

 

I added a game over screen. Nothing fancy, just the words "GAME OVER" in blood red against a black background. I finally figured out how to put a space on the screen as just one character. I needed a PETSCII chart to do so though. You'd think 00 would be a space, but it's not. It's an @ for some reason.

 

I am still wondering whether I should keep the sky color as is or attempt to make it cyaner. I tried to add some skyscraper tops to the sky, but I failed, so it will just have to be all sky.

 

Happy fourth of july to those of us in the United States. And everywhere else. No fireworks for us. There haven't been any real loud booms yet. I guess the inflation even goes to fireworks.

 

3 Comments


Recommended Comments

You swapped #$FF and $D012 from the example I posted. The idea was to not having to load the accumulator for each loop, just do a comparison. Instead of loading a value from a memory address (I/O) and compare it to a fixed value, you can load the value first and compare against the memory address instead. The net effect is only 2 clock cycles (minus first loop) in this case though:

 

loop: LDA $D012 ; 4 cycles
CMP #$FF ; 2 cycles

BNE loop ; 2-3 cycles depending if you cross a page boundary

 

wait: LDA #$FF ; 2 cycles

loop: CMP $D012 ; 4 cycles

BNE loop ; 2-3 cycles

 

Also yes, both in PETSCII and ASCII, the space is 32. Other systems like e.g. the Intellivision has space at 0.

Link to comment

OK, I got that code working now.

I seem to want to have a bunch of little songs, so I was just wondering if there was a way to somehow change the .bin files I use for music. I'm using GoatTracker to make the songs, and it only let me save the values at $3000, $3400, $3800, $3C00 and so on. I bet I could fit my small songs in smaller increments, like $3000, $3200, $3400, $3600 and so on. For example, my death song is only 989 bytes. My title screen song is only 896 bytes, and the level 1 music is only 907 bytes.

Link to comment

Remember that each $100 equals 256 bytes so if the addresses are $400 apart, that is 1024 bytes. But yes, you will be able to merge multiple songs with one player to save quite a bit of space.

Link to comment
Guest
Add a comment...

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