Author Topic: xLIB 84C Edition  (Read 50972 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #30 on: June 20, 2013, 01:50:35 am »
This looks kinda nice actually, but when we draw text in the first half, is it copied over the second half automatically or do we need to draw it twice using the Text commands?

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #31 on: June 20, 2013, 02:20:15 am »
Flipping the LCD is pretty much like doing a fastcopy in old xLIB. So you will need to draw text twice if there is stuff moving in the background.

To further explain the getkey function:

if you just want to get the key in Ans then you can do:

real(2,0

And the key will be in Ans, the same was as its always worked.

The demo however takes advantage of the extra functionality of getkey. Namely that it can update USERVARIABLES depending on what keys are pressed:

real(2,4,4,1,-8,1,1,8,2,0,-8,3,0,8

Will add or 8 or -8 to user variables 0 or 1 depending on if up/down/left/right are pressed.

Here is a breakdown:

real(2,4,4,1,-8,1,1,8,2,0,-8,3,0,8

real( = xLIB token (for now)
2 = getkey function number
4 = number of keys to test

4 = keycode for UP
1 = USERVARIABLE 1, being used to hold playerY
-8 = value to add to USERVARIABLE 1 (playerY)

1 = keycode for DOWN
1 = userVARIABLE 1, being used to hold playerY
8 = value to add to USERVARIABLE 1 (playerY)

2 = keycode for LEFT
0 = USERVARIABLE 0, being used to hold playerX
-8 = value to add to USERVARIABLE 1 (playerX)

3 = keycode for RIGHT
0 = userVARIABLE 0, being used to hold playerX
8 = value to add to USERVARIABLE 1 (playerX)

This way you can do 4 key tests and update the variable appropriately in 1 real( statement. The reason for this is key handling was possibly the biggest reason for slowdown in BASIC games.

Currently it only supports addition, but that can be expanded. That said you would probably have your movement work like this and if you have menu keys you can process them seperately. That said the way it has always worked hasnt been taken away so the standard way to handle keys is still there.

I should mention that the lib will require very different coding techniques over previous xLIBs or other ASM libs. This is unavoidable due to the speed limitations of the platform. Here is the code for the sprite demo:

Code: [Select]
:real(1,1,0,0
:real(1,1,1,0
:real(1,1,2,0
:real(1,1,3,0
:real(1,1,4,127
:real(1,1,5,0
:real(1,1,6,0
:real(1,1,7,64
:real(0,1,0
:real(3,0,5,6,7,0,0,1
:real(3,0,5,6,7,0,0,0
:real(1,1,8,real(3,1,0,1,7
:Repeat real(2,0)=15
:real(4,0,1,8,8,0,4,239,1
:real(4,2,3,8,8,0,8,1,0
:real(1,1,8,real(3,1,0,1,7
:real(1,1,2,real(1,0,0
:real(1,1,3,real(1,0,1
:real(2,4,4,1,‾8,1,1,8,2,0,‾8,3,0,8
:End
:real(0,1,1
« Last Edit: June 20, 2013, 02:49:22 am by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #32 on: June 20, 2013, 02:34:41 am »
I see. I think that might be a problem for games with HUDs, although I guess one could just make sure that nothing else needs to be drawn when displaying text or if he's making an ARPG he could just make sure that not too many text have to be updated on the screen when killing enemies.

By the way, will we be able to set the text background color via xLIB? In BASIC it's impossible but I think if it's changed in ASM, then it doesn't get changed again until you use the BASIC command TextColor()

As for the getkey commands, could you maybe explain it in a visual manner, perhaps with code example inside a loop and a screenshot (even if glitched up for reasons mentionned earlier)? Because I will never understand it if it's explained the 83pa28d way instead of Hot_Dog-Z80-Guide way. >.< Else I'll most likely end up just sticking with the TI-BASIC command.

EDIT After reading your EDIT, I understand more now. What kinda confused me was the variables part, since I saw numbers instead of A-Z/Theta, but I also got confused because I had no clue what was the breakdown. Thanks :)

As for the different coding techniques, could you cite some examples?
« Last Edit: June 20, 2013, 02:53:28 am by DJ Omnimaga »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: xLIB 84C Edition
« Reply #33 on: June 20, 2013, 03:29:19 am »
Oh, that key thing can come in handy!
And that is an interesting way on how to make two buffers.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #34 on: June 20, 2013, 05:00:01 am »
Off-topic: Why was this topic locked? I assume it was a mistake by tr1p1ea (since members can lock their own topics) or a staff? ???

(Thanks juju for unlocking it btw)
« Last Edit: June 20, 2013, 05:00:44 am by DJ Omnimaga »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #35 on: June 20, 2013, 06:43:41 am »
Opps i was on my phone, must have hit lock topic when trying to change pages :S.

Also the reason people use Link's Awakening is because they are 16x16 tiles im pretty sure where most other Zelda games have a higher resolution (Aside from NES etc).
« Last Edit: June 20, 2013, 07:12:32 am by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: xLIB 84C Edition
« Reply #36 on: June 20, 2013, 09:10:38 am »
Hmm, so what is actually going on in that screen? Is it that half of it is displayed to the user while the other half is some kind of backup?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: xLIB 84C Edition
« Reply #37 on: June 20, 2013, 10:18:19 am »
I think it's like the graph buffer on monochrome calcs but it's in GRAM to save actual RAM and also a lot of speed. :D

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #38 on: June 20, 2013, 05:39:18 pm »
Thats correct, since in 160x240 mode only half of GRAM is needed (and you set which portion of GRAM is visible) i use the non-active half as a buffer, then switch it in when drawing is done.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: xLIB 84C Edition
« Reply #39 on: June 20, 2013, 09:41:25 pm »
It's a good idea, because drawing in another RAM area then copying it over the GRAM when done would have really been slow on this calc. On older models it was fast only because the screen contained much less data.

As for LA sprites lol I remember when DarkAuron ranted on Maxcoderz about how overused they are, but I think it's fine because no Zelda using them ever got finished anyway.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #40 on: June 20, 2013, 11:34:19 pm »
You know that is a fair point! I think the only released Zelda ive seen that used them is the demo that came with Duck's Grayscale Programming Package? There are likely other demos though.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #41 on: June 21, 2013, 04:53:42 am »
Well I really meant finished Zelda games. So far the only two that ever got finished (ironically both within one month span) are Dark Link Quest and Hero of Hyrule. The first is ASCII and the 2nd uses custom graphics that looks very close to Link's Awakening, but scaled down, and it isn't as much of a Zelda game as DLQ. But yeah among unfinished ones, I never saw any using anything else than ASCII graphics or LA sprites/derivatives. I guess that maybe people just found the NES graphics too bland but found the SNES/GBA Zelda ones too complex to be converted to 4 shades of gray.

I personally would probably re-use LA graphics, but I'm not planning to do a Zelda game in xLIB (probably a 84C exclusive RPG or something). I am already making a Zelda in BASIC which is intended to be as small as possible and graphical while staying as TI-BASIC as possible, and I'll probably leave other Zelda projects to ASM/Axe coders, while I try to work on new original stuff. :P

« Last Edit: June 21, 2013, 04:54:36 am by DJ Omnimaga »

Offline JamesV

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 276
  • Rating: +77/-0
    • View Profile
    • James V's TI-Calculator page
Re: xLIB 84C Edition
« Reply #42 on: June 21, 2013, 07:37:05 am »
I'd really like to make Golvellius for the TI-84+CSE (which was Sega's SMS version of Zelda) - hopefully I'll get around to it!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #43 on: June 21, 2013, 02:02:10 pm »
I didn't hear much about that game but I think you were working on a calc remake back in the days, right? I need to check that stuff out at one point. :)

Offline JamesV

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 276
  • Rating: +77/-0
    • View Profile
    • James V's TI-Calculator page
Re: xLIB 84C Edition
« Reply #44 on: June 21, 2013, 05:14:24 pm »
I didn't hear much about that game but I think you were working on a calc remake back in the days, right? I need to check that stuff out at one point. :)

Yeah, I tried making it for the TI-86 around 11-12 years ago, but A) I bit off more than I could chew, I wasn't ready for such a large project, and B) the ~10K code limit on the 86 was a big issue. If I do attempt it on the 84+CSE, it would be a multi-page app :)