* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Using OS Pic Variables  (Read 178 times)

0 Members and 1 Guest are viewing this topic.

Offline Switchblade

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 38
  • Post Rating Ratio: +1/-0
Using OS Pic Variables
« on: June 27, 2017, 01:35:21 am »
How can I display a user pic variable, i.e. Pic1, in Axe? I know you need to use [Pic1r] -> Pointer, but when I try to display it using Copy(Pointer,L6) the screen is filled with junk. Can someone give me some example code? Thanks :)



Offline mazhat

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 143
  • Post Rating Ratio: +6/-0
    • /u/Mazhat
    • Mazhat(?)
    • @Mazhat
    • MOS
  • Gender: Female
Re: Using OS Pic Variables
« Reply #1 on: June 27, 2017, 02:20:59 am »
Pic1 stores a sprite 8*8 in size.
Or 1*8 bytes.

e.x. for a smiley face:
[7E81A581A599817E]->Pic1 ;store into user space
ptOff(X,Y,Pic1) ;to display the sprite without any bitwise-arithmetic


For a picture that would fill the entire screen
you must use the keyword "Bitmap(".
This is 96*64 pixels in size,
or 12*64 bytes in size.

Edit: Perhaps Pic1 can be used to hold a bitmap in it. I haven't had a chance to use Bitmap( that way yet.
« Last Edit: June 27, 2017, 02:25:30 am by mazhat »
  • Calculators owned: TI-83Plus, TI-84Plus
  • Consoles, mobile devices and vintage computers owned: Samsung TAB A (Cheap), DSI, Rasperry PI 3

Offline c4ooo

  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 968
  • Post Rating Ratio: +12/-4
  • Advanced forumer
  • Gender: Male
Re: Using OS Pic Variables
« Reply #2 on: June 27, 2017, 02:26:23 am »
Pic1 stores a sprite 8*8 in size.
Or 1*8 bytes.

e.x. for a smiley face:
[7E81A581A599817E]->Pic1


For a picture that would fill the entire screen
you must use the keyword "Bitmap(".
This is 96*64 pixels in size,
or 12*64 bytes in size.
This is wrong. ;)
"PicN" is just a constant that points to some data, just like "StrN". You could do [7E81A581A599817E]->Str1 or "Hello World"->Pic1 and axe wouldn't care. You could even do 5->Pic1 , and then Pic1*2 would return 10.
Putting Pic1 in square brackets (this also works with other data types) just tells the compiler to copy the data from that OS variable into your program, and returns a pointer to that data.

Offline mazhat

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 143
  • Post Rating Ratio: +6/-0
    • /u/Mazhat
    • Mazhat(?)
    • @Mazhat
    • MOS
  • Gender: Female
Re: Using OS Pic Variables
« Reply #3 on: June 27, 2017, 02:28:37 am »
@c4ooo I pre-corrected myself with an edit.
Don't worry, I know that it's "generic".
I have a standard practice, sometime I forget things are possible.

Edit:
Sorry, Switchblade. I must have sounded very patronising and pretentious.
Switchblade is actually a smart boy, he makes arcade game ports and such and it's pretty cool.
« Last Edit: June 27, 2017, 03:08:15 am by mazhat »
  • Calculators owned: TI-83Plus, TI-84Plus
  • Consoles, mobile devices and vintage computers owned: Samsung TAB A (Cheap), DSI, Rasperry PI 3

Offline ben_g

  • Full User
  • Safe-haven access
  • Join Date: Dec 2014
  • Location:
  • Posts: 164
  • Post Rating Ratio: +12/-0
Re: Using OS Pic Variables
« Reply #4 on: June 27, 2017, 12:26:42 pm »
...[Pic1r] ->Pointer...
...Copy(Pointer,L6)...
[Pic1r] -> pointer will store the OS pic variable in 8x8 chunks that can then be drawn using the Pt-on( command (or at least that's how I understand it from the command list). It has to move some bytes around for that since OS Pic variables aren't stored in 8x8 chunks. Copying that directly to the screen will then show what's basically a scrambled version of your image.

If you just write it as [Pic1] -> pointer then it should add the OS Pic variable in the program memory as-is, and using it with Copy(Pointer,L6) should show it on the screen. The bottom row may still look weird though, Pic variables store only 63 rows while the screen is 64 pixels tall. Copying it to the screen will also copy the 12 bytes of data after that to the screen. A simple workaround is to add that last row manually, like this:

Code: [Select]
:[Pic1]->Pointer
:[000000000000000000000000]
Which will store an extra white row at the bottom. Use F instead of 0 if you want a black row instead.

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games