PT_

Untitled

PT_
Oct 5th, 2017
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.45 KB | None | 0 0
  1. Oct 05 20:53:05 <P_T> Mateo: can you help me a bit?
  2. Oct 05 20:55:21 <saxjax> [Cemetech] Michael2_3B entered the room
  3. Oct 05 20:55:38 <saxjax> [KryptonicDragon] I'm here if I cant help
  4. Oct 05 20:55:41 <saxjax> [KryptonicDragon] can*
  5. Oct 05 20:56:07 <P_T> I need to export the sprite to an appvar, but I can't get it working yet
  6. Oct 05 20:57:07 <saxjax> [KryptonicDragon] You talking about something you need to do in ICE?
  7. Oct 05 20:57:14 <P_T> No, I'm using ConvPNG now
  8. Oct 05 20:57:35 <MateoC> Sure what's up
  9. Oct 05 20:57:51 <MateoC> https://github.com/mateoconlechuga/convpng/tree/master/tests/appvars_asm
  10. Oct 05 20:57:56 * MichaelB (uid228033@id-228033.ealing.irccloud.com) has joined
  11. Oct 05 20:58:33 <P_T> Can't open all_gfx
  12. Oct 05 20:58:38 <MateoC> Did you decide on a format?
  13. Oct 05 20:58:47 <MateoC> all_gfx?
  14. Oct 05 20:58:49 <MateoC> Wat
  15. Oct 05 20:59:24 <P_T> Hmm I get something working now :P
  16. Oct 05 20:59:53 <P_T> Is the palette included in the appvar?
  17. Oct 05 21:00:07 <MateoC> That information is in the readme :P
  18. Oct 05 21:00:34 <P_T> Like, can I just use xlibc as a palette?
  19. Oct 05 21:00:43 <MateoC> But have you decided how you would like ICE to export appvars?
  20. Oct 05 21:00:52 <MateoC> Um what
  21. Oct 05 21:00:58 <P_T> The same as assembly, without palette
  22. Oct 05 21:01:13 <P_T> Just the raw data
  23. Oct 05 21:01:31 <MateoC> What do you mean exactly
  24. Oct 05 21:02:11 <MateoC> Also, how would you like the format for sprites in appvars?
  25. Oct 05 21:02:36 <P_T> I thought it was very simple, like <width>,<height>,<data> and that for all the sprites in the tilemap
  26. Oct 05 21:03:00 <MateoC> Sure; for tilemaps
  27. Oct 05 21:03:10 <MateoC> But don't you want to store sprites in appvars too?
  28. Oct 05 21:03:25 <MateoC> I mean; it's up to you :P
  29. Oct 05 21:03:35 <P_T> Hmm that sounds doable, but that would be exactly the same, just width, height, data
  30. Oct 05 21:03:36 <saxjax> [Cemetech] Jek entered the room
  31. Oct 05 21:03:41 <MateoC> Err wait
  32. Oct 05 21:03:50 <MateoC> I already programmed that lol
  33. Oct 05 21:03:55 <MateoC> Mateo++
  34. Oct 05 21:04:00 <P_T> >.<
  35. Oct 05 21:04:22 <MateoC> I mean; how would you like the export format to be for ICE?
  36. Oct 05 21:04:29 <MateoC> What should the user see?
  37. Oct 05 21:04:41 <saxjax> [Cemetech] _iPhoenix_ entered the room
  38. Oct 05 21:04:43 <P_T> Oh, let me see the arguments
  39. Oct 05 21:04:49 <saxjax> [Cemetech] _iPhoenix_ entered the room
  40. Oct 05 21:04:51 <MateoC> To what?
  41. Oct 05 21:05:14 <MateoC> Because right now you have to do AppvarASM, which is not AppvarICE :P
  42. Oct 05 21:05:27 <P_T> DefineTilemap(TILE_HEIGHT, TILE_WIDTH, DRAW_HEIGHT, DRAW_WIDTH, TPE_WIDTH, TYPE_HEIGHT, HEIGHT, WIDTH, Y_LOC, X_LOC, "tiles/sprites", "tilemap data"
  43. Oct 05 21:05:39 <P_T> Is that what you mean? :P
  44. Oct 05 21:05:46 <MateoC> No
  45. Oct 05 21:06:01 <MateoC> If you look at how convpng currently exports tilemaps:
  46. Oct 05 21:06:12 <MateoC> It is TILEWIDTH,TILEHEIGHT,TILEDATA
  47. Oct 05 21:06:40 <MateoC> You can set up TYPEWIDTH and TYPEHEIGHT with those
  48. Oct 05 21:06:40 <P_T> Oh, you mean which 'properties' should be in the appvar?
  49. Oct 05 21:06:45 <MateoC> Yes
  50. Oct 05 21:06:49 <P_T> Only the tiledata
  51. Oct 05 21:06:58 <MateoC> I can describe the current format
  52. Oct 05 21:07:03 <P_T> I will fetch them using tilewidth, tileheight
  53. Oct 05 21:07:05 <MateoC> Maybe you will like it better :P
  54. Oct 05 21:09:09 <MateoC> So right now offsets to sprite data is stored at the start of the appvar
  55. Oct 05 21:09:17 <P_T> I don't need that
  56. Oct 05 21:09:22 <P_T> That makes it even more complicated ;)
  57. Oct 05 21:09:24 <MateoC> Yes you do
  58. Oct 05 21:09:26 <MateoC> No it doesn't
  59. Oct 05 21:09:42 <MateoC> This allows you to not have to "Copy" sprites in
  60. Oct 05 21:10:22 <MateoC> Unless you want to force the user to specify the size of each image too?
  61. Oct 05 21:10:30 <P_T> Oh, then I can just copy the entire appvar data to ICE data, and then just point to the table?
  62. Oct 05 21:10:37 <MateoC> No
  63. Oct 05 21:10:41 <MateoC> There's no copying
  64. Oct 05 21:10:48 <MateoC> Sprites are stored in the appvar
  65. Oct 05 21:10:55 <MateoC> You can just get pointers to them
  66. Oct 05 21:11:07 <MateoC> By using the offset table
  67. Oct 05 21:11:51 <P_T> Do I need to copy the appvar data to ICE, such that it becomes one program?
  68. Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> There's no copying
  69. Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> Sprites are stored in the appvar
  70. Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> You can just get pointers to them
  71. Oct 05 21:12:07 <MateoC> 12:11 PM <MateoC> By using the offset table
  72. Oct 05 21:13:18 <P_T> Either I get it wrong, or it doesn't work
  73. Oct 05 21:13:18 <MateoC> Sprites don't need to be allocated anywhere else if they already exist in an appvar
  74. Oct 05 21:13:43 <MateoC> You are doing something wrong; what does convpng.ini look like?
  75. Oct 05 21:13:59 <P_T> https://pastebin.com/M2xeH5q1
  76. Oct 05 21:14:27 <MateoC> Okay; so you didn't specify that it was a tileset P_T
  77. Oct 05 21:14:55 <MateoC> #Tilemap : 16,16,false
  78. Oct 05 21:14:59 <MateoC> Or somethign
  79. Oct 05 21:15:29 <MateoC> Hm I should make that take 2 arguments and default to false
  80. Oct 05 21:15:50 <P_T> Should ICE find the appvar or the output program?
  81. Oct 05 21:16:01 <MateoC> Also I'm not sure why you have IncludePalettes in there
  82. Oct 05 21:16:12 <P_T> Me neither, but that's probably because I do everything wrong
  83. Oct 05 21:16:17 <saxjax> [Cemetech] gilroy0 entered the room
  84. Oct 05 21:16:20 <MateoC> Um; the appvar should be specified by the user
  85. Oct 05 21:16:55 <MateoC> LoadData("APPVAR", 0)->A
  86. Oct 05 21:17:04 <MateoC> Would load the first pointer
  87. Oct 05 21:17:16 <MateoC> Into A
  88. Oct 05 21:17:21 <MateoC> Hm
  89. Oct 05 21:17:32 <P_T> How would DefineTilemap then look like?
  90. Oct 05 21:18:07 <MateoC> Tilemaps are just pointers to sprites
  91. Oct 05 21:18:16 <P_T> I know
  92. Oct 05 21:18:18 <P_T> But not offsets
  93. Oct 05 21:18:26 <MateoC> You can probably just make a function called LoadTilemap
  94. Oct 05 21:18:42 <MateoC> And then DefineTilemap will take the pointer that produces
  95. Oct 05 21:18:47 <saxjax> [Cemetech] gilroy0 entered the room
  96. Oct 05 21:18:48 <MateoC> P_T: You need offsets >.>
  97. Oct 05 21:18:49 <P_T> So basically my question is: when will the offsets be used to generate a table of pointers? During compiling, or should the user do that?
  98. Oct 05 21:18:55 <P_T> Wat
  99. Oct 05 21:19:27 <MateoC> ICE should build the table; which is what LoadTilemap does
  100. Oct 05 21:19:52 <MateoC> DefineTilemap then can receive the pointer produced by LoadTilemap
  101. Oct 05 21:20:59 <saxjax> [Cemetech] Pieman7373 entered the room
  102. Oct 05 21:21:03 <P_T> But then the compiled version should build the table, because ICE can't assume the appvar is at a constant address
  103. Oct 05 21:21:10 <MateoC> What
  104. Oct 05 21:21:24 <MateoC> ICE should build the table; which is what LoadTilemap does
  105. Oct 05 21:21:55 <P_T> The table is full of pointers to sprites. That pointers are all the start of the appvar + the offsets, right?
  106. Oct 05 21:22:06 <MateoC> No
  107. Oct 05 21:22:18 <saxjax> [Cemetech] Caleb_J entered the room
  108. Oct 05 21:22:19 <MateoC> The table would have to be built by ICE
  109. Oct 05 21:22:56 <P_T> That can't
  110. Oct 05 21:23:02 <MateoC> If you want I can write up a short description :P
  111. Oct 05 21:23:05 <MateoC> Yes it can
  112. Oct 05 21:23:08 <P_T> No it can't
  113. Oct 05 21:23:15 <P_T> Or it needs to copy the data in the appvar to ICE
  114. Oct 05 21:23:17 <MateoC> My gosh of course it can
  115. Oct 05 21:23:20 <MateoC> No
  116. Oct 05 21:23:20 <saxjax> [Cemetech] Caleb_J added a post in [List of things TI does to upset Mateo]( http://cemete.ch/p263867 )
  117. Oct 05 21:23:29 <saxjax> [Caleb_J] Hello all
  118. Oct 05 21:23:31 <MateoC> I'll just write up how to do it :P
  119. Oct 05 21:24:05 <MateoC> Give me like 7.5 minutes :P
  120. Oct 05 21:24:15 <P_T> Almost, one sentence :P
  121. Oct 05 21:24:39 <saxjax> [Cemetech] _iPhoenix_ added a post in [List of things TI does to upset Mateo]( http://cemete.ch/p263868 )
  122. Oct 05 21:24:43 <P_T> If the data is in an appvar, it's a seperate file. That appvar can float around in RAM, archive and whatever, so you don't know the address of it. If ICE doesn't copy the data to itself, it needs to get the address of that appvar, add the offsets, and there you have the pointers for the table. Right?
  123. Oct 05 21:24:43 <saxjax> [Cemetech] Caleb_J added a post in [Doors CE 9 (TI-84 Plus CE) Development thread]( http://cemete.ch/p263869 )
  124. Oct 05 21:25:11 <saxjax> [Cemetech] PT_ edited a post in [List of things TI does to upset Mateo]( http://cemete.ch/p263868 )
  125. Oct 05 21:25:18 <saxjax> [Caleb_J] Phoenix, stop trying to scare me. :D
  126. Oct 05 21:26:11 <saxjax> [Cemetech] Ivoah entered the room
  127. Oct 05 21:26:25 <MateoC> 5 minutes
  128. Oct 05 21:26:27 <P_T> :P
  129. Oct 05 21:26:37 <P_T> Krypto: that's why adding tilemaps is hard :P
  130. Oct 05 21:27:12 <saxjax> [KryptonicDragon] Heh. So is 2 days not reasonable?
  131. Oct 05 21:27:27 <saxjax> [Cemetech] SM84CE added a post in [Doors CE 9 (TI-84 Plus CE) Development thread]( http://cemete.ch/p263870 )
  132. Oct 05 21:27:36 <P_T> I have to do it today and tomorrow, because this weekend I'm away
  133. Oct 05 21:28:04 <saxjax> [Cemetech] TheLastMillennial added a post in [Doors CE 9 (TI-84 Plus CE) Development thread]( http://cemete.ch/p263871 )
  134. Oct 05 21:28:48 <saxjax> [Cemetech] TheLastMillennial edited a post in [Doors CE 9 (TI-84 Plus CE) Development thread]( http://cemete.ch/p263871 )
  135. Oct 05 21:28:51 <saxjax> [Cemetech] Caleb_J added a post in [Doors CE 9 (TI-84 Plus CE) Development thread]( http://cemete.ch/p263872 )
  136. Oct 05 21:29:06 <saxjax> [Cemetech] Caleb_J deleted a post in [Doors CE 9 (TI-84 Plus CE) Development thread]
  137. Oct 05 21:29:12 <saxjax> [Caleb_J] silly me
  138. Oct 05 21:29:21 <saxjax> [Caleb_J] not reading posts entirely
  139. Oct 05 21:29:30 <saxjax> [Caleb_J] will be my downfall
  140. Oct 05 21:31:13 <saxjax> [TheLastMillennial] oh, sorry sm84, I forgot to give you the syntax for the lines
  141. Oct 05 21:31:31 <MateoC> https://pastebin.com/e9hWqWNs
  142. Oct 05 21:31:35 <MateoC> There you go PT_
  143. Oct 05 21:31:41 <saxjax> [SM84CE] its fine, i found it inside of the loops, near the suggested lines
  144. Oct 05 21:32:01 <MateoC> Those are what the functions should look like for tilemaps
  145. Oct 05 21:32:13 <MateoC> You should also have a LoadSprite() function as well :P
  146. Oct 05 21:32:25 <MateoC> LoadSprite("APPVAR", OFFSET)->A
  147. Oct 05 21:32:38 * P_T sighs
  148. Oct 05 21:32:43 <saxjax> [Cemetech] MeepsCe entered the room
  149. Oct 05 21:32:43 <P_T> <P_T> If the data is in an appvar, it's a seperate file. That appvar can float around in RAM, archive and whatever, so you don't know the address of it. If ICE doesn't copy the data to itself, it needs to get the address of that appvar, add the offsets, and there you have the pointers for the table. Right?
  150. Oct 05 21:33:09 <MateoC> What "Table" are you talking about
  151. Oct 05 21:33:19 <P_T> The table with pointers to the sprites
  152. Oct 05 21:33:21 * SopaXorzT has quit (Remote host closed the connection)
  153. Oct 05 21:33:27 <MateoC> You have to build that
  154. Oct 05 21:33:30 <P_T> I know
  155. Oct 05 21:33:35 <MateoC> I mean I said it right there
  156. Oct 05 21:33:44 <saxjax> [Cemetech] Eightx84 entered the room
  157. Oct 05 21:33:47 <MateoC> "and the size in bytes to allocate for the sprite table. It returns a pointer to the allocated sprite table.
  158. Oct 05 21:33:47 <MateoC> "
  159. Oct 05 21:34:28 <P_T> Oh, you mean that LoadTilemapSprites builds the sprite table, but in the output program?
  160. Oct 05 21:35:16 <MateoC> No; it allocates space for the table at compile time; and builds the actual table at runtime
  161. Oct 05 21:35:26 <MateoC> That's what LoadTilemapSprites is
  162. Oct 05 21:36:01 <saxjax> [SM84CE] with PHASM, i ran my passwors locking prgm, and when my calc exited the prgm, it crashed :(
  163. Oct 05 21:36:16 <P_T> Now I get it
  164. Oct 05 21:36:19 <P_T> I think
  165. Oct 05 21:37:17 <P_T> So at runtime the program finds the appvar, gets the offsets and stores the offsets + the start of the appvar to the sprites table
  166. Oct 05 21:37:19 <saxjax> [Cemetech] shkaboinka entered the room
  167. Oct 05 21:37:53 <MateoC> The offsets are not stored in the appvar
  168. Oct 05 21:38:03 <MateoC> The only offsets stored are offsets to the data
  169. Oct 05 21:38:19 <MateoC> ICE would build the table like this:
  170. Oct 05 21:38:19 <saxjax> [Cemetech] JWinslow23 entered the room
  171. Oct 05 21:39:08 <P_T> ICE builds the table with offsets, and at runtime the program will allocate these offsets?
  172. Oct 05 21:39:22 <MateoC> No; it allocates space for the table at compile time; and builds the actual table at runtime
  173. Oct 05 21:39:48 <P_T> How would the program during runtime know what the offsets are?
  174. Oct 05 21:39:59 <MateoC> Which offsets are we talking about
  175. Oct 05 21:40:11 <MateoC> There are offsets to sprite data and offsets to tilemap sprites
  176. Oct 05 21:40:25 <P_T> Tilemap sprites
  177. Oct 05 21:40:40 <MateoC> Okay; so first you would do a GetDataPtr
  178. Oct 05 21:41:04 <jacobly> needs more bss
  179. Oct 05 21:41:16 <MateoC> That's what I'm doing jacobly :P
  180. Oct 05 21:41:53 <saxjax> [Cemetech] CtrlEng entered the room
  181. Oct 05 21:42:05 <MateoC> ptr = GetDataPtr; ptr += OFFSET; ptr += *ptr;
  182. Oct 05 21:42:30 <MateoC> Then ptr now contains the pointer to the tilemap sprite data
  183. Oct 05 21:42:33 <MateoC> Then you do:
  184. Oct 05 21:43:14 <P_T> I don't get that
  185. Oct 05 21:43:26 <saxjax> [Cemetech] c4ooo entered the room
  186. Oct 05 21:43:50 <MateoC> for(i=0; i<SIZE/3; i++) { sprite_ptrs[i] = ptr; ptr += TILESIZE; }
  187. Oct 05 21:43:56 <MateoC> Then return sprite_ptrs
  188. Oct 05 21:44:02 <MateoC> What don't you get?
  189. Oct 05 21:44:12 <MateoC> jacobly; can you explain that better :P
  190. Oct 05 21:44:14 <P_T> What does the structure of the appvar look like?
  191. Oct 05 21:44:37 <MateoC> It contains offsets to sprite data at the start; like I've been saying :P
  192. Oct 05 21:44:57 <P_T> Offsets from the beginning of the appvar, or the start of the sprites?
  193. Oct 05 21:45:08 <P_T> Like offset #0, is that 0 or 128*3?
  194. Oct 05 21:45:14 <MateoC> From the begining of the appvar to whatever was specified in convpng
  195. Oct 05 21:45:36 <MateoC> It would be whatever the offset is to get the information stored for that sprite
  196. Oct 05 21:45:42 <P_T> What is OFFSET in LoadTilemapSprites used for, then?
  197. Oct 05 21:45:44 <saxjax> [Cemetech] ShoesTaxi registered and activated a new account
  198. Oct 05 21:45:59 <MateoC> Did you read the pastebin
  199. Oct 05 21:46:08 <MateoC> https://pastebin.com/e9hWqWNs
  200. Oct 05 21:46:13 <P_T> "which will represent 2 and the size in bytes "
  201. Oct 05 21:46:16 <saxjax> [Cemetech] YelloTrout entered the room
  202. Oct 05 21:46:23 <MateoC> So OFFSET would be 2
  203. Oct 05 21:46:30 <MateoC> Because tilemap_sprites is index 2
  204. Oct 05 21:46:33 <MateoC> In the appvar
  205. Oct 05 21:46:40 <MateoC> Because sprite_1 = 0 and sprite_2 = 1
  206. Oct 05 21:46:45 <MateoC> So tilemap_sprites = 2
  207. Oct 05 21:47:12 <P_T> You wanna load multiple tilemap sprites at the same time?
  208. Oct 05 21:47:17 <jacobly> OFFSET is clearly the offset between offsets :P
  209. Oct 05 21:47:17 <MateoC> What
  210. Oct 05 21:47:27 <MateoC> What jacobly said
  211. Oct 05 21:47:37 <saxjax> [Caleb_J] Gotta get going. Bye everybody!
  212. Oct 05 21:47:38 <jacobly> aka the size of each offset
  213. Oct 05 21:47:39 <MateoC> It's the index of the data in the appvar
  214. Oct 05 21:47:44 <saxjax> [Cemetech] ShoesTaxi entered the room
  215. Oct 05 21:47:45 <Cemetech> ShoesTaxi, welcome to Cemetech! Please introduce yourself in this topic: http://cemete.ch/t4925
  216. Oct 05 21:47:55 <jacobly> though that could be computed from sprite sizes, etc >.>
  217. Oct 05 21:48:14 <MateoC> It could; but that would require scanning of the whole appvar :P
  218. Oct 05 21:48:23 <jacobly> so?
  219. Oct 05 21:48:35 <jacobly> you read the same number of things
  220. Oct 05 21:48:54 <MateoC> Seems easier to just store an offset table :P
  221. Oct 05 21:49:00 <MateoC> Then it's easier for the user
  222. Oct 05 21:49:19 <jacobly> but then why bother computing one
  223. Oct 05 21:49:43 <jacobly> you should do one or the other, not both :P
  224. Oct 05 21:49:50 <jacobly> as an option
  225. Oct 05 21:49:55 <nikkybot> dunno
  226. Oct 05 21:49:58 <nikkybot> because he hates us all?
  227. Oct 05 21:50:00 * P_T is confused
  228. Oct 05 21:50:21 <MateoC> jacobly: But it is pointer to the data; not individual sprites
  229. Oct 05 21:50:32 <P_T> What's the point of OFFSET? LoadTilemapSprites just loads one tilemap with several sprites, right?
  230. Oct 05 21:50:54 <MateoC> 12:46 PM <MateoC> Because sprite_1 = 0 and sprite_2 = 1
  231. Oct 05 21:50:54 <MateoC> 12:46 PM <MateoC> So tilemap_sprites = 2
  232. Oct 05 21:51:05 <P_T> Yes, but what does that change?
  233. Oct 05 21:51:09 <P_T> What happens if I make that 1?
  234. Oct 05 21:51:17 <MateoC> It wouldn't work?
  235. Oct 05 21:51:31 <MateoC> Does no one understand how cool this is >.>
  236. Oct 05 21:51:34 <P_T> No
  237. Oct 05 21:51:37 <MateoC> Aw
  238. Oct 05 21:52:04 <P_T> tilemap_sprites, sprite_1 and sprite_2 will be in one appvar?
  239. Oct 05 21:52:09 <MateoC> Of course
  240. Oct 05 21:52:15 <MateoC> In the order they are defined
  241. Oct 05 21:52:27 <MateoC> Well; at least what the offset table in the appvar says
  242. Oct 05 21:52:39 <P_T> If we assume all the 3 PNG's are 1 tile
  243. Oct 05 21:52:44 <MateoC> What
  244. Oct 05 21:52:55 <MateoC> Why are you stuck on tilemaps
  245. Oct 05 21:53:08 <MateoC> You can store sprites, tilemaps, palettes to appvars
  246. Oct 05 21:53:55 <P_T> Then the structure of the appvar would look like: <offset table for sprite_1>,<sprites for sprite_1>,<offset table for sprite_2>,<sprites for sprite_2>,...
  247. Oct 05 21:53:56 <P_T> Or not?
  248. Oct 05 21:54:18 <MateoC> Appvar structure looks like this:
  249. Oct 05 21:55:09 <MateoC> <offset to sprite_1 data>, <offset to sprite_2 data>, <offset to tilemap_sprites>, <sprite_1 data>, <sprite_2 data>, <tilemap_sprites data>
  250. Oct 05 21:55:27 <MateoC> Just how it was defined in convpng
  251. Oct 05 21:55:39 <MateoC> So index 2 means the <offset to tilemap_sprites>
  252. Oct 05 21:56:15 <P_T> What are the sizes of <offset to sprite_1 data>...?
  253. Oct 05 21:56:21 <MateoC> 3 bytes
  254. Oct 05 21:56:34 <MateoC> It's the offset from the start of the appvar to the data
  255. Oct 05 21:57:18 <MateoC> Err
  256. Oct 05 21:57:29 <MateoC> offsets after the offset table apparently
  257. Oct 05 21:57:39 <saxjax> [SM84CE] is it possible to get the character for the Alpha lock cursor into a string?
  258. Oct 05 21:58:09 <MateoC> jacobly: Huh; you could just use the size as the offset huh
  259. Oct 05 21:58:43 <MateoC> But less intuitive
  260. Oct 05 21:59:35 <MateoC> P_T: Does that make more sense?
  261. Oct 05 21:59:57 <P_T> Now I get what OFFSET is, I think
  262. Oct 05 22:00:07 <P_T> I just need to multiply that with 3
  263. Oct 05 22:00:14 <MateoC> Yes
  264. Oct 05 22:00:35 <P_T> Can <offset to tilemap_sprites> be more than 3 bytes?
  265. Oct 05 22:00:50 <MateoC> Technically it can't be larger than 2 bytes
  266. Oct 05 22:01:00 <MateoC> Because appvars can only be 64K
  267. Oct 05 22:01:10 <P_T> Where is the offset table for <tilemap_sprites data> stored, then?
  268. Oct 05 22:01:14 <MateoC> Nowhere
  269. Oct 05 22:01:25 <MateoC> That is easily computable
  270. Oct 05 22:01:46 <MateoC> LoadTilemapSprites("APPVAR", OFFSET, TABLESIZE)->A // Convpng will output the OFFSET and OFFSET which will represent 2 and the size in bytes to allocate for the sprite table. It returns a pointer to the allocated sprite table.
  271. Oct 05 22:02:11 <MateoC> When that command runs; it computes all the offsets for the sprites
  272. Oct 05 22:02:25 <P_T> Okay, I understand it now, but it's highly complicated to have more sprites/tilemaps in one appvar
  273. Oct 05 22:02:32 * commandz (~commandbl@h246.168.48.24.cable.angl.cmaaccess.com) has joined
  274. Oct 05 22:02:48 <MateoC> Not exactly
  275. Oct 05 22:02:58 <MateoC> It adds about 3 lines?
  276. Oct 05 22:03:32 <MateoC> To compute the offsets; you can just use the sprites themselves
  277. Oct 05 22:03:37 <P_T> I thought that building the sprite table at compile time was more fun <_<
  278. Oct 05 22:03:44 <MateoC> You can't do that
  279. Oct 05 22:03:52 <P_T> If I move the data to ICE, yes
  280. Oct 05 22:03:56 <MateoC> You can allocate it
  281. Oct 05 22:04:02 <MateoC> But not define it
  282. Oct 05 22:05:03 <P_T> How would I get the tile size from LoadTilemapSprites?
  283. Oct 05 22:05:27 <MateoC> You understand how to get a pointer to the tilemap data right?
  284. Oct 05 22:05:31 <P_T> Yes
  285. Oct 05 22:05:54 <MateoC> So once you do that; the tile size is the first two bytes
  286. Oct 05 22:05:57 <P_T> Ah
  287. Oct 05 22:05:59 <MateoC> multiplied together
  288. Oct 05 22:06:23 <MateoC> Then you can just loop for the size of the pointer table / 3
  289. Oct 05 22:06:24 <P_T> And what if the tilemap is NOT the last 'element' in the appvar, but you have a sprite stored afterwards. How do I know when to stop fetching pointers to sprites?
  290. Oct 05 22:06:30 <P_T> Oh
  291. Oct 05 22:06:32 * P_T hides
  292. Oct 05 22:06:49 <MateoC> for(i=0; i<SIZE/3; i++) { sprite_ptrs[i] = ptr; ptr += TILESIZE; }
  293. Oct 05 22:06:55 <MateoC> Does that line make more sense now? :P
  294. Oct 05 22:07:05 <P_T> Yes, but I already understood that :P
  295. Oct 05 22:07:36 <P_T> Let me write an ASM snippet, and you can check if I did it right :P
  296. Oct 05 22:09:36 <MateoC> Hm
  297. Oct 05 22:09:53 * commandz has quit (Read error: Operation timed out)
  298. Oct 05 22:10:21 <MateoC> I guess the only issue is you don't know how many offsets are stored in the table
  299. Oct 05 22:11:08 <P_T> https://pastebin.com/JBt63Twe is this right?
  300. Oct 05 22:11:17 <MateoC> You can tell me to calculate offsets from the start of the appvar rather than the end of the offset table if that is easier
  301. Oct 05 22:11:53 <P_T> Oh, need to increment HL 3 times right after the ld (hl), de
  302. Oct 05 22:12:29 <MateoC> Yeah; that's what I mean about calculate offsets from the start of the appvar rather
  303. Oct 05 22:13:07 <MateoC> You need to also inc bc \ inc bc
  304. Oct 05 22:13:14 <P_T> Ah ofc
  305. Oct 05 22:13:29 <MateoC> But other than that looks good :)
  306. Oct 05 22:13:34 <P_T> Heh. Finally
  307. Oct 05 22:13:43 <MateoC> So ICE format should calculate offsets from the beginning of the appvar?
  308. Oct 05 22:13:46 <P_T> Still complicated, and I don't really like it, but meh
  309. Oct 05 22:13:47 <P_T> Yes
  310. Oct 05 22:13:51 <MateoC> Okay can do
  311. Oct 05 22:13:54 <MateoC> Heh
  312. Oct 05 22:14:16 <P_T> Just put the entire tilemap in a seperate appvar, and you don't get all the struggles
  313. Oct 05 22:14:25 <MateoC> It's complicated but now users can store all their sprites in appvars too :P
  314. Oct 05 22:14:46 <MateoC> And palette data
  315. Oct 05 22:14:53 <MateoC> Also hum
  316. Oct 05 22:15:14 <saxjax> [KryptonicDragon] What does mlt do in assembly?
  317. Oct 05 22:15:16 <MateoC> Can you do: "APPVAR"->Str1
  318. Oct 05 22:15:20 <P_T> Yes
  319. Oct 05 22:15:32 <P_T> mlt hl : HL = H*L
  320. Oct 05 22:15:38 <MateoC> LoadTilemapSprite(Str1, 2, 128)->A
  321. Oct 05 22:15:38 <MateoC> ?
  322. Oct 05 22:15:39 <saxjax> [KryptonicDragon] Ah
  323. Oct 05 22:15:46 <P_T> That would work too
  324. Oct 05 22:15:49 <MateoC> Cool
  325. Oct 05 22:16:32 <MateoC> But yeah; the third argument would just allocate in saferam or something
  326. Oct 05 22:16:37 <MateoC> And put that in A
  327. Oct 05 22:17:42 <P_T> Then LoadData( works fine too, then I can check if TABLE_SIZE is 1, if yes, it's a sprite, and if not, it's a tilemap
  328. Oct 05 22:18:09 <MateoC> You could also check if it is 3 :)
  329. Oct 05 22:18:15 <MateoC> Then you can store a pointer to it too
  330. Oct 05 22:18:19 <saxjax> [Cemetech] jonbush entered the room
  331. Oct 05 22:18:45 <MateoC> Just make it like LoadSprite("APPVAR", OFFSET, ALLOC_SIZE)
  332. Oct 05 22:19:14 <MateoC> convpng will export ALLOC_SIZE, which can just be allocated in the saferam for storage
  333. Oct 05 22:19:22 <P_T> Can you make OFFSET such that I need to multiply it with 3? Then I can use the mlt hl trick :P
  334. Oct 05 22:19:36 <MateoC> Yes it will just be an index
  335. Oct 05 22:19:40 <P_T> Or... it will be just 3 bytes directly :|
  336. Oct 05 22:19:49 <P_T> "ld hl, 9 \ add hl, de" heh
  337. Oct 05 22:20:07 <MateoC> It could also be multiplied by three :P
  338. Oct 05 22:20:26 <P_T> No, "ld hl, 9" is faster
  339. Oct 05 22:20:32 <MateoC> Got it
  340. Oct 05 22:20:56 <MateoC> So 0,3 would select the first sprite, 3,3 the second sprite, and 6,X the tilemap
  341. Oct 05 22:21:07 <P_T> Yes
  342. Oct 05 22:21:40 <P_T> I should write a good tutorial how to load it all in the appvar, otherwise people will be as confused as I am :P
  343. Oct 05 22:22:02 <MateoC> Well, convpng will output "APPVAR", OFFSET, ALLOC_SIZE
  344. Oct 05 22:22:18 <P_T> Yeah, but convpng.ini is rather important as well
  345. Oct 05 22:22:23 <MateoC> Good point :P
  346. Oct 05 22:23:36 <P_T> Should I just merge it with Data(? That makes a bit sense, and then I don't need to create ANOTHER custom token
  347. Oct 05 22:23:50 <P_T> Data("APPVAR",OFFSET,SIZE->A
  348. Oct 05 22:24:49 <MateoC> I think that might get confusing but it's up to you :)
  349. Oct 05 22:25:37 <saxjax> [Cemetech] _iPhoenix_ entered the room
  350. Oct 05 22:26:18 <P_T> That was 90 minutes confusion <_< xD
  351. Oct 05 22:26:34 <MateoC> Sorry :P
  352. Oct 05 22:26:55 <P_T> I only need to figure out how to put sprites and tilemaps together in one appvar, but I can do that
  353. Oct 05 22:27:17 <MateoC> Um you just list them in convpng :P
  354. Oct 05 22:27:23 <MateoC> "// the ordering here is the order of the offsets and storage of sprites"
  355. Oct 05 22:27:27 <MateoC> https://pastebin.com/e9hWqWNs
  356. Oct 05 22:27:47 <MateoC> btw you can use // for comments in convpng
  357. Oct 05 22:27:53 <P_T> Yes, but not all the sprites/tilemaps have equal size
  358. Oct 05 22:28:09 <MateoC> Equal size?
  359. Oct 05 22:28:15 <MateoC> That's what the offset table is for
  360. Oct 05 22:28:25 <P_T> And using "#Tilemap : 16,16,false" splits all the PNG's to 16x16 chunks, right?
  361. Oct 05 22:28:32 <P_T> Oh nvm, I'm stupid
  362. Oct 05 22:28:43 <MateoC> 16x16 sprites :P
  363. Oct 05 22:28:57 <MateoC> Oooh
  364. Oct 05 22:28:59 <MateoC> I'm dump
  365. Oct 05 22:29:02 <MateoC> *dumb
  366. Oct 05 22:29:06 <P_T> I can just make 2 gfx files, one with the big tilemap, and the other with, say, the 2 other PNG's; then I can load them together in the appvar
  367. Oct 05 22:29:11 <MateoC> Those should be two different groups
  368. Oct 05 22:29:19 <P_T> Yeah
  369. Oct 05 22:29:33 <MateoC> No wonder it was confusing
  370. Oct 05 22:30:03 <P_T> So in fact https://pastebin.com/e9hWqWNs is wrong, because now it makes tilemaps from sprite_1 and sprite_2 :P
  371. Oct 05 22:30:12 <MateoC> https://pastebin.com/afz7UQSD
  372. Oct 05 22:30:15 <MateoC> There is that better?
  373. Oct 05 22:30:22 <P_T> Yep! :D
  374. Oct 05 22:31:19 <MateoC> If you want to define a palette across all of them you can use #GroupPalette
  375. Oct 05 22:31:27 <P_T> Yeah
  376. Oct 05 22:31:43 <P_T> Now we spam 30/38 messages, instead of 28/38 :P
  377. Oct 05 22:31:48 <MateoC> Hehe
  378. Oct 05 22:32:38 <P_T> Almost the entire #cemetech (500 lines) is us talking :P
  379. Oct 05 22:32:58 <MateoC> Where did everyone go
  380. Oct 05 22:33:08 <P_T> They found it too complicated hehe
  381. Oct 05 22:34:01 <MateoC> But you can also calculate items for the gfx_tilemap_t structure (type_width and type_height) from the tilewidth/tileheight
  382. Oct 05 22:34:36 <P_T> Nah, it's fine now
  383. Oct 05 22:34:44 <MateoC> Or you can just store 0
  384. Oct 05 22:34:44 <P_T> I don't wanna make it more complicated :P
  385. Oct 05 22:34:54 <MateoC> Well you need to do that at some point :P
  386. Oct 05 22:35:13 <P_T> Why? The user can just fill in the arguments, like MAP_WIDTH or whatever
  387. Oct 05 22:35:17 <MateoC> Since the routine would like to know if it can take a more optimal path if the sprites are powers of 2
  388. Oct 05 22:35:25 <MateoC> DefineTilemap(WIDTH, HEIGHT, DRAW_WIDTH, DRAW_HEIGHT, Y_LOC, X_LOC, A, "tilemap data")->B
  389. Oct 05 22:35:51 <P_T> Yes, but the user can just put that in the function
  390. Oct 05 22:36:20 <MateoC> Very well :P
  391. Oct 05 22:40:38 <P_T> So getting a sprite from the appvar is basically _ChkFindSym \ ld hl, OFFSET + 2 \ add hl, de \ ld hl, (hl)?
  392. Oct 05 22:41:06 <saxjax> [Cemetech] (G) *gCn virtual hub 'BotWeb' has new calculator 0A3613C041 from Spark7373
  393. Oct 05 22:41:31 <saxjax> [Cemetech] (G) *gCn virtual hub 'BotWeb' has new calculator 0A3613C041 from Spark7373
  394. Oct 05 22:42:02 <MateoC> add hl,de at the end
  395. Oct 05 22:42:27 <P_T> Oops, sure
  396. Oct 05 22:42:53 <MateoC> But yep once I fix convpng that's what it will be :)
  397. Oct 05 22:43:11 <MateoC> Also need to make sure the appvar isn't in the archive
  398. Oct 05 22:43:20 <P_T> Well, then there's no change I can fully support tilemaps before next week
  399. Oct 05 22:43:33 <MateoC> ?
  400. Oct 05 22:43:46 <P_T> Tomorrow I'm going away for some days :P
  401. Oct 05 22:44:04 <saxjax> [Cemetech] c4ooo entered the room
  402. Oct 05 22:44:56 <P_T> Unless you are really fast :P
  403. Oct 05 22:46:33 <MateoC> Oh I'm already done
  404. Oct 05 22:46:38 <MateoC> Let me just test and push
  405. Oct 05 22:46:44 <saxjax> [Cemetech] xMarminq_ entered the room
  406. Oct 05 22:48:12 <saxjax> [Cemetech] xMarminq_ added a post in [Oiram Issues]( http://cemete.ch/p263873 )
  407. Oct 05 22:49:23 <P_T> >.<
  408. Oct 05 22:49:30 <P_T> That is quick
  409. Oct 05 22:50:33 <P_T> Okay, how should I call the new token?
  410. Oct 05 22:52:25 <saxjax> [Cemetech] Stardust49 entered the room
  411. Oct 05 22:54:34 <saxjax> [KryptonicDragon] When you're done, is the documentation going to have the sizes and execution cycles count for most of the commands?
  412. Oct 05 22:54:55 <P_T> Maybe. It's rather complicated to calculate that all, because ICE optimize things on the flow
  413. Oct 05 22:55:25 <P_T> Like: expression < 3 depends heavily on expression
  414. Oct 05 22:55:30 <saxjax> [KryptonicDragon] Right, just put a disclaimer at the top of the doc "All sizes and cycle counts are estimates, results may vary."
  415. Oct 05 22:56:19 <saxjax> [KryptonicDragon] Some of them are non changing though, like det(10). that one never changes because it doesnt have any arguments/inputs/outputs. (right?)
  416. Oct 05 22:56:25 <P_T> det(7,X,Y)<3 isn't the same size as det(79,X,Y)
  417. Oct 05 22:56:29 <P_T> <3
  418. Oct 05 22:56:47 <P_T> (that is smaller than 3, not a heart :P)_
  419. Oct 05 22:57:06 <P_T> Nah. Even det(10) varies in speed, because it needs to wait for an interrupt IIRC
  420. Oct 05 22:57:11 <saxjax> [Cemetech] Stardust49 added a post in [Candid Photos]( http://cemete.ch/p263874 )
  421. Oct 05 22:57:23 <saxjax> [Cemetech] Stardust49 deleted a post in [Candid Photos]
  422. Oct 05 22:57:56 <P_T> See https://github.com/CE-Programming/toolchain/blob/master/src/graphx/graphx.asm#L921
  423. Oct 05 22:58:11 <saxjax> [Cemetech] Stardust49 added a post in [Candid Photos]( http://cemete.ch/p263875 )
  424. Oct 05 22:59:31 * Greg_ (~GregsASta@47.196.162.67) has joined
  425. Oct 05 22:59:32 <saxjax> [KryptonicDragon] Then you could just say the size is static, and say the amount of cycles it normally needs with a note saying "needs to wait for interrupt, cycles will likely be larger."
  426. Oct 05 23:00:54 <P_T> I *can* make exact tables, but that is rather complicated
  427. Oct 05 23:01:08 <saxjax> [KryptonicDragon] Just give estimates then, if that's easier.
  428. Oct 05 23:01:39 <saxjax> [KryptonicDragon] Or just not include cycle count at all if that's too hard.
  429. Oct 05 23:01:42 <P_T> If not(sum(7,X,Y)) in this case, the expression will be smaller than not(sum(7,X,Y))
  430. Oct 05 23:02:13 <P_T> "If not(sum(7,X,Y))"
  431. Oct 05 23:02:26 <saxjax> [Cemetech] Michael2_3B entered the room
  432. Oct 05 23:02:36 <saxjax> [Cemetech] FreshBoar13 entered the room
  433. Oct 05 23:03:57 <saxjax> [KryptonicDragon] Uh, in ez80 assembly, is the $ or % for a hex number?
  434. Oct 05 23:04:02 <P_T> $
  435. Oct 05 23:04:07 <P_T> % is binary
  436. Oct 05 23:04:28 <saxjax> [KryptonicDragon] Thanks, I switch those two a lot.
  437. Oct 05 23:06:48 <saxjax> [KryptonicDragon] I guess I could memorize it if I think of the little circles in the % sign as zeroes and the slash as a 1 for binary.
  438. Oct 05 23:07:00 <P_T> Hah that's a nice one
  439. Oct 05 23:07:03 <saxjax> [Cemetech] Botboy3000 entered the room
  440. Oct 05 23:07:34 <P_T> PIEMAN
  441. Oct 05 23:07:38 <P_T> HAPPY BIRTYDAY!!! :D
  442. Oct 05 23:07:52 <saxjax> [Stardust49] thanks!
  443. Oct 05 23:08:05 <P_T> ?
  444. Oct 05 23:09:44 <saxjax> *KryptonicDragon is confused and doesnt know who pieman is
  445. Oct 05 23:09:56 * You've invited Tari to #cemetech-staff (irc.mzima.net)
  446. Oct 05 23:09:57 * [Tari] is away ("AFK, or something.")
  447. Oct 05 23:10:03 <P_T> Pieman7373
  448. Oct 05 23:10:07 <saxjax> [Cemetech] deuteriumoxide entered the room
  449. Oct 05 23:10:07 <P_T> A rather active user
  450. Oct 05 23:10:19 <saxjax> [Stardust49] oh okay
  451. Oct 05 23:10:33 <P_T> Although he isn't much on lately
  452. Oct 05 23:10:52 <saxjax> [Stardust49] that sucks
  453. Oct 05 23:10:52 <saxjax> [_iPhoenix_] KryptonicDragon: the percent sign actually originated from one hundred, a clearly decimal number ;P
  454. Oct 05 23:11:31 <saxjax> [Stardust49] cool
  455. Oct 05 23:11:37 <saxjax> [Stardust49] interesting factoid thank you
  456. Oct 05 23:11:54 <saxjax> [Cemetech] Alvajoy123 entered the room
  457. Oct 05 23:12:03 <saxjax> [KryptonicDragon] 100 can be binary for 4.
  458. Oct 05 23:12:25 <saxjax> [Stardust49] not that it can,
  459. Oct 05 23:12:27 <saxjax> [Stardust49] it is
  460. Oct 05 23:13:01 <P_T> No, 100 = 1100100 :P
  461. Oct 05 23:13:08 <saxjax> [KryptonicDragon] PT: does recursion work in ICE? ; Can I have a part of a program CALL itself a bunch of times provided it eventually all hits returns?
  462. Oct 05 23:13:14 <nikkybot> Well, suck a dick anyway
  463. Oct 05 23:13:14 <P_T> Yes
  464. Oct 05 23:13:16 <saxjax> [Cemetech] Alvajoy123 added a post in [ICE Compiler]( http://cemete.ch/p263876 )
  465. Oct 05 23:13:39 <saxjax> [KryptonicDragon] Awesome!
  466. Oct 05 23:13:51 <P_T> Oh right, what do you think about a Stop token? That returns immediately to the OS no matter what?
  467. Oct 05 23:13:55 <saxjax> [Stardust49] yes, but 100 = 4
  468. Oct 05 23:13:59 <saxjax> [Stardust49] 1
  469. Oct 05 23:14:04 <saxjax> [Stardust49] 10
  470. Oct 05 23:14:05 <saxjax> [Stardust49] 11
  471. Oct 05 23:14:08 <saxjax> [Stardust49] 101
  472. Oct 05 23:14:13 <saxjax> [Stardust49] nevermind
  473. Oct 05 23:14:27 <saxjax> [Alvajoy123] Stop spaming
  474. Oct 05 23:14:28 <saxjax> [Stardust49] i don't know what you were getting at
  475. Oct 05 23:14:28 <P_T> Stardust: most of the people here know how to count in binary ;)
  476. Oct 05 23:14:30 <saxjax> [Stardust49] 110
  477. Oct 05 23:14:31 <saxjax> [Stardust49] 111
  478. Oct 05 23:14:39 <saxjax> [Stardust49] yep
  479. Oct 05 23:14:42 <saxjax> [Stardust49] 1000
  480. Oct 05 23:14:54 <saxjax> [Stardust49] 10000
  481. Oct 05 23:15:07 <saxjax> [KryptonicDragon] I memorized powers of 2 and 16 ages ago so I could more easily count in hex and bin.
  482. Oct 05 23:15:39 <P_T> You know that your are programming too much if you know all the powers from 2 upto 2^25 :P
  483. Oct 05 23:15:59 <saxjax> [Alvajoy123] Hello everyone
  484. Oct 05 23:16:05 <saxjax> [Stardust49] yeah well in some cases knowing hex is much more useful, in fact i do believe there are less applications in which it is imperative to have memorized binary than there are that require a general knowledge of Hex
  485. Oct 05 23:16:09 <P_T> Halvajoy!
  486. Oct 05 23:16:17 <saxjax> [KryptonicDragon] I know powers of 2 up to 8192 (the next one is 163XX, cant remember, unless I mentally calculate of course), and powers of 16 up to 16777216
  487. Oct 05 23:16:28 <saxjax> [KryptonicDragon] Hello alva
  488. Oct 05 23:16:29 <saxjax> [Stardust49] lol yeah
  489. Oct 05 23:16:31 <P_T> I memorized 2^25: 33 55 44 32 :P
  490. Oct 05 23:16:42 <saxjax> [Alvajoy123] So u said I should close all slots then make a appvars
  491. Oct 05 23:16:45 <MateoC> P_T: It's on the repo
  492. Oct 05 23:16:55 <P_T> Alvajoy: yes
  493. Oct 05 23:16:58 <P_T> Mateo++ :)
  494. Oct 05 23:16:59 <MateoC> I haven't built it yet; but you should be able to build
  495. Oct 05 23:17:03 <P_T> True
  496. Oct 05 23:17:06 <saxjax> [Alvajoy123] Ok
  497. Oct 05 23:17:07 <saxjax> [Cemetech] SM84CE entered the room
  498. Oct 05 23:17:23 <saxjax> [Alvajoy123] The what open slots for
  499. Oct 05 23:17:39 <saxjax> [Alvajoy123] Then I mean
  500. Oct 05 23:18:04 <MateoC> Open("NAME","w");
  501. Oct 05 23:18:29 <saxjax> [Alvajoy123] Oh ok thank you guys
  502. Oct 05 23:18:51 <saxjax> [Alvajoy123] Bye i am out
  503. Oct 05 23:19:15 <saxjax> [Alvajoy123] I will be back if it does not work
  504. Oct 05 23:19:25 <P_T> That sounds scary
  505. Oct 05 23:19:26 <saxjax> [SM84CE] crud... I missed the AppVar discussion...
  506. Oct 05 23:19:39 <P_T> Be happy
  507. Oct 05 23:19:42 <MateoC> It's all in the logs :P
  508. Oct 05 23:19:53 <P_T> 600 lines of messages, is that enough?
  509. Oct 05 23:19:56 <P_T> Probably even more
  510. Oct 05 23:20:10 <saxjax> [Cemetech] Battlesquid entered the room
  511. Oct 05 23:20:25 <saxjax> [KryptonicDragon] Well I'm off for about 30 mins, cya then!
  512. Oct 05 23:20:30 <P_T> Cya!
  513. Oct 05 23:21:06 <P_T> Mateo: mingw32 gives a bunch of warnings when building ConvPNG :P
  514. Oct 05 23:21:14 <saxjax> [SM84CE] how do i get the logs?
  515. Oct 05 23:21:16 <saxjax> [SM84CE] ~logs
  516. Oct 05 23:21:27 <saxjax> [SM84CE] nope
Add Comment
Please, Sign In to add comment