Author Topic: Supersonic Ball  (Read 15836 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: DJ's platformer with parralax scrolling
« Reply #15 on: July 01, 2010, 01:03:26 am »
This thing would be awesome once finished, with all the enemies and all, I love this parralax scrolling thing :P

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #16 on: July 01, 2010, 12:27:55 pm »
This is really cool!  I hope you finish it DJ!  Also, you really underestimate yourself.  I'm looking at that and I have no idea how you made it.  Excellent job!  I can't wait to try this.  Wow! ;D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: DJ's platformer with parralax scrolling
« Reply #17 on: July 01, 2010, 05:18:25 pm »
Well the hardest part was really the physics. I never realised how hard such thing would be. Even harder thing is dealing with negative values in If conditions. I had to work around this and do some other stuff. I had to rewrite my code 3 times. The 2nd time I almost lost all hope. SirCmpwn and Builderboy helped me figure out some tricks and when I removed some pressure from my shoulders recently, I got motivation to code again. The level creation isn't too hard either, except I had troubles at first for a while
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: DJ's platformer with parralax scrolling
« Reply #18 on: July 03, 2010, 02:43:13 am »
Ok so I fixed a bug that caused the beginning of the track to not be connected with the rest when setting a level to change the random values every two frame or higher. I also applied a small optimization by Quigibo with the way I do the parallax scrolling (thanks Quigibo) and I think I noticed a slight speed increase (and obviously a decrease in size).

Now I need to code the end of levels, timer and scoring (which depend of the remaining time left). Timer may use interrupts, altough I am not decided yet.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #19 on: July 03, 2010, 03:33:01 am »
Keep in mind that although interrupts are convenient, they are much slower, larger, and require more control than just calling the routine from your main loop.  Not to mention, they prevent you from using certain commands like the OS getkey or mirage's [on] break.  You should only use interrupts when it can't be done easily any other way or when exact timing is extremely important.
« Last Edit: July 03, 2010, 03:33:29 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #20 on: July 03, 2010, 04:38:05 am »
Can't you fix OS _GetKey by jumping to 0038H at the end of the interrupt?

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #21 on: July 03, 2010, 10:28:29 am »
Or rather $006C, because otherwise the OS would switch the shadow regs w/the regular regs again, messing all the registers up. (You could do an "exx \ ex af,af'" before a "jp $0038", which would be a total of 5 bytes, or two bytes more, and that's not as good.)
We just need a way in Axe to chain the normal IM 1 interrupt to the program's custom IM 2 interrupt.
Edit: Changed info to reflect that it should be "jp $0038" rather than "rst 38h"
« Last Edit: July 03, 2010, 11:46:55 am by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #22 on: July 03, 2010, 10:30:50 am »
Can't you fix OS _GetKey by jumping to 0038H at the end of the interrupt?
Or rather $006C, because otherwise the OS would switch the shadow regs w/the regular regs again, messing all the registers up.
Or rather 003Ah.  That skips the shadow reg switch also. ;D

Quigibo, we *need* Mode 1 and Mode 2 at the same time. :D
« Last Edit: July 03, 2010, 10:31:02 am by ztrumpet »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #23 on: July 03, 2010, 10:45:54 am »
ztrumpet: yes, but by going directly to $003A rather than $006C, you're skipping other things (Probably unimportant, and 84+(SE) only IIRC, but still). I can post a short disassembly...
^++ yes, chaining would be so very useful (but definitely as an option, not a requirement :P)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #24 on: July 03, 2010, 10:51:35 am »
From Day 23 of Asm in 28 Days:
Quote
TSRs
TSRs are Terminate and Stay Resident programs. If you change the RET and exchange instructions in your interrupt to JP $003A, then you'll process the calculator's system interrupt as well as your own.

Whoa, whoa, wait a minute. Why are we jumping to $003A? Isn't the system routine at $0038??

Well, yes, the Mode 1 interrupt does jump to $0038. What we are doing is swapping the shadow registers when our interrupt is run, and we want them to stay swapped when the system interrupt is running. A section of the code at $0038 looks like

    0038: JR    $006A
    003A: IN    A, (4)
    .
    .
    006A: EX    AF, AF'
    006B: EXX
    006C: JR    $003A

Yes this is completely redundant, but by jumping to $003A the exchanges get skipped over.

This is useful if you still want GetKey and GetCSC and other Mode 1 features to work while you're in Mode 2.
Is there more stuff there on 84s? :)
« Last Edit: July 03, 2010, 10:52:38 am by ztrumpet »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #25 on: July 03, 2010, 10:55:10 am »
Yeah, there is :(
Wabbit screenie attached.
Note that there is even more than is shown. Again, I am unsure what this actually does, but it may just be better to run it anyway (by either method I mentioned)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #26 on: July 03, 2010, 10:56:58 am »
Oh. :(

Thanks for mentioning this, but why isn't it in Asm in 28? :)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #27 on: July 03, 2010, 11:00:08 am »
Probably because it was written before the 84's or the author only had an 83+.
Well, if for the normal 83+ it's just a jump back, then it should still work on all OS's (jp $006C, that is)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #28 on: July 03, 2010, 11:25:05 am »
JP 0038H will also jump to that area. (there's a small chain of jp's in the interrupt, but I forgot the details)

The calculator executes a rst 38H instruction every n microseconds, but the space in that area was limited for some reason, so the main interrupt code was moved to 006AH

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: DJ's platformer with parralax scrolling
« Reply #29 on: July 03, 2010, 11:45:05 am »
Various OS markers and whatnot cause the lack of space.
The problem with just executing jp $0038 is this:
When you start an interrupt, one of the first things you do is switch to the shadow registers in order to avoid messing with the program's register contents. But when you go to $0038, they are switched again, and now the OS is messing w/the program's register contents, which is not good. You can switch them back before jping to $0038, but it's much simpler just to jump to $006C
« Last Edit: July 03, 2010, 11:45:22 am by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.