Jump to content
IGNORED

K.O. Cruiser - my first homebrew


Devin

Recommended Posts

Be sure to add King Hippo! No Punch Out! is complete without the King!

 

Bah! I created my initial set of characters before 'ole King Hippo was on the shelves. Besides, I have much cooler characters! :D

Link to comment
Share on other sites

Update!

 

I just finished the first playable WIP version of the game. The game is far from finished, but the basic format and behavior is complete.

 

The computer character's script is very simple at the moment. He doesn't have any special moves or behavior. For each loop - which contains a bob, flip gloves, etc... there is a 25% chance he will throw a punch. Each punch is extremely slow and is blockable. You can then hit the computer up to 3 times. This number is specified in the script. I can add more - even make it possible to hit the computer when he's just standing there. You can't currently hit the computer until he throws a punch. Otherwise, he will block.

 

Please note, that I still need to program the following:

  • Knock-down logic. Currently, if your health or the computer's goes to zero - nothing happens. Basically, all the characters are still in God Mode with Unlimited Ammo.
  • Sound. It will be more obvious when the computer blocks a punch with the appropriate sound effect.
  • Round logic. The timer will stop at 3 minutes in the final version. Right now it just keeps going and wraps around. I'm only using one byte for the time. Any guesses when it go to zero again? :)
  • Bank-switching. The final version will definitely require it. I plan to put all the kernal in Bank 1 and game logic in Bank 0. I plan to have 5 or 6 different opponents in the final version.
  • The color of your character will also change when you are in range - and being hit.
  • Your player will have a "my punch was blocked" image.

post-17256-1205246810_thumb.png

KO_Cruiser___WIP___2008_03_11.bin

Edited by Devin
Link to comment
Share on other sites

I'd really like to have this on cart too when it's done. Think you'll be able to add a ref? It would be funny if it was Pitfall Harry.

 

Hee hee. That would actually be funny. I might make a sequel where you can box against Atari classic characters. Pitfall Harry would be the champ!

 

I definitely want to put this on a cartridge.

Link to comment
Share on other sites

I can't seem to hit him even then. He blocks no matter when I punch.

 

I've attached a new version where the computer will be delayed 2 seconds after each punch - rather than 1 second as before. You can either block or dodge left or right before you counter-punch. To get more than one hit, step forward after each punch. If you get him on the ropes, you can deliver your deadly combo without advancing.

 

I'll probably have to do some work in this area to perfect the gameplay.

 

I also updated the "in range" flags for both the left and right punch - the math was a little off in the last version.

KO_Cruiser_WIP_2008_03_13.bin

Link to comment
Share on other sites

Thanks! Now comes the "fun" part - bank-switching! (insert scream sound here)

 

Looks great so far. Here is a template for 8K (F8) bankswitching. It assumes that the main code is in bank 2, and bank 1 is called as a subroutine:

 

  PROCESSOR 6502
 SEG.U VARS
 ORG $80

; Variables Here (accessible from both banks)

 SEG BANK1
 ORG $0000
 RORG $F000

Exit
 nop $FFF9
Bank1Code

; Bank 1 Code Goes Here
; jmp Exit to go back to Bank 2

 ORG	 $0FF8
 RORG	$FFF8
 DC.B	0,0
 DC.W	$FFF9, $FFF9, $FFF9

 SEG	 BANK2
 ORG	 $1000
 RORG	$F000

Switch
 nop $FFF8
 rts
Start

; Bank 2 Code Goes Here
; jsr Switch to go to Bank 1

 ORG	 $1FF8
 RORG	$FFF8   
 DC.B	0,0 
 DC.W	Start,Start,Start

Edited by cd-w
Link to comment
Share on other sites

Looks great so far. Here is a template for 8K (F8) bankswitching. It assumes that the main code is in bank 2, and bank 1 is called as a subroutine:

 

Thank you! This looks like an incredibly easy template to use. I have a few quick questions.

 

  • The NOP $FFF9 statement is a tad odd. Is this a valid 6502 command or an assembler hack. I would imagine that a no-op wouldn't have an argument.
  • Does DC.B = .byte and DC.W = .word. I would imagine so, but I'm not 100% sure.

 

Thanks again for the code and a "thank you" to everyone for their help!

Link to comment
Share on other sites

Thank you! This looks like an incredibly easy template to use. I have a few quick questions.

 

  • The NOP $FFF9 statement is a tad odd. Is this a valid 6502 command or an assembler hack. I would imagine that a no-op wouldn't have an argument.
  • Does DC.B = .byte and DC.W = .word. I would imagine so, but I'm not 100% sure.

Thanks again for the code and a "thank you" to everyone for their help!

 

The NOP here uses an undocumented addressing mode. If you prefer, you can use CMP or BIT instead, but these will affect the status flags. The bankswitch howto used LDA, but this will also affect the accumulator. The important part is that the bankswitching address is accessed somehow. I prefer the NOP method as this allows the code to continue executing in the new bank as if nothing had happened.

 

From the DASM manual, the valid syntax is DC[.BWL], where .B is a byte (8-bit), .W is a word (16 bit), and .L is a long (32 bit). If no extension is given then the default is a byte. BYTE, WORD and LONG can also be used.

 

Chris

Edited by cd-w
Link to comment
Share on other sites

The NOP here uses an undocumented addressing mode. If you prefer, you can use CMP or BIT instead, but these will affect the status flags. The bankswitch howto used LDA, but this will also affect the accumulator. The important part is that the bankswitching address is accessed somehow. I prefer the NOP method as this allows the code to continue executing in the new bank as if nothing had happened.

 

From the DASM manual, the valid syntax is DC[.BWL], where .B is a byte (8-bit), .W is a word (16 bit), and .L is a long (32 bit). If no extension is given then the default is a byte. BYTE, WORD and LONG can also be used.

 

Chris

 

The template worked like a charm! I now have 8k of ROM. Now the biggest challenge - what to do with all this space?! :) Thanks again.

Link to comment
Share on other sites

The template worked like a charm! I now have 8k of ROM. Now the biggest challenge - what to do with all this space?! :) Thanks again.

 

Excellent - I'm sure you will fill it in no time and need to move to 16K (F4 bankswitching)!

I'm looking forward to seeing this game progress as it is looking great so far.

 

Chris

Link to comment
Share on other sites

The NOP here uses an undocumented addressing mode.

 

To clarify, the 6502 uses certain bits of the opcode to decide what memory operand (if any) to fetch; the 6502 can make that decision before it has determined what to do with the value it receives. There are some opcodes which will result in a memory fetch being performed, but which will then not actually do anything with the value fetched. These opcodes are collectively referred to as "NOP" even though they do perform an operation (the memory fetch) which in some cases may be meaningful in and of itself.

Link to comment
Share on other sites

To clarify, the 6502 uses certain bits of the opcode to decide what memory operand (if any) to fetch; the 6502 can make that decision before it has determined what to do with the value it receives. There are some opcodes which will result in a memory fetch being performed, but which will then not actually do anything with the value fetched. These opcodes are collectively referred to as "NOP" even though they do perform an operation (the memory fetch) which in some cases may be meaningful in and of itself.

 

So, is there any advantage to using

 

NOP  $FFF8

rather than

 

LDA  $1FF8

other than preserving the value of the accumulator?

Link to comment
Share on other sites

So, is there any advantage to using

 

NOP  $FFF8

rather than

 

LDA  $1FF8

other than preserving the value of the accumulator?

 

For people who are familiar with the NOP abs opcode, using it makes explicit that the purpose of the instruction is to cause a read, rather than to do anything else. Note that a more popular non-standard addressing of the NOP opcode is NOP zp, which is a three-cycle instruction that does nothing except read the specified operand. The SLEEP macro uses NOP 0 when delaying an odd number of cycles. With most bank-switching schemes, it can be regarded as a three-cycle NOP. Do be aware that because it does a zero-page memory fetch, bank-switch schemes that are strobed by such fetches may get triggered accidentally.

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