Jump to content

Mind Field CC65 Sample


peteym5

Recommended Posts

https://github.com/peteym5/CC65_Mind_Field

I have completed my first game in C Programming Language. I am doing this for my own learning experience and sharing what I learn with others.

The game is simple as with the Pascal Version. The difference here is that I added an additional ML call to scan the screen around the character you control. The minds highlight in Blue.

This is one of my reserved games and this version is being kept as open source. I have considerations of a more enhanced version that will have a vertical scrolling screen with obstacles, shells,moving tanks, and bunkers with enemies shooting from them. It will be sort off a mini "Ikiri Warriors" type game.image.png.88abfe209f9bc55f1924a863200da978.png

Image may contain: night

Link to comment
Share on other sites

I am in the process of porting other games over to CC65 from Turbo Basic, Fast Basic, Basic XE. Something I did many older games is that I have many USR calls to machine language routins. Either copied from Compute! magazine or later I made some custom ML routines myself. One major difference is C ML calls do not use the 6502 stack like Basic does and it took me some time to figure it out going through pages and forum posts. CC65 puts values onto its own stack labels "sp". 

In Basic you Pull arguments passed to the ML from Basic like this....

PLA ;# of parameters, not needed in Fast Basic
PLA
PLA
STA arg01
PLA
STA arg02

in CC65 it needs to be something like this
LDY #2
LDA (sp),y
STA arg01
LDY #0
LDA (sp),y
STA arg00

LDA sp
CLC
ADC #4
STA sp
LDA sp+1
ADC #0
STA sp+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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...
×
×
  • Create New...