Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Oct 05 20:53:05 <P_T> Mateo: can you help me a bit?
- Oct 05 20:55:21 <saxjax> [Cemetech] Michael2_3B entered the room
- Oct 05 20:55:38 <saxjax> [KryptonicDragon] I'm here if I cant help
- Oct 05 20:55:41 <saxjax> [KryptonicDragon] can*
- Oct 05 20:56:07 <P_T> I need to export the sprite to an appvar, but I can't get it working yet
- Oct 05 20:57:07 <saxjax> [KryptonicDragon] You talking about something you need to do in ICE?
- Oct 05 20:57:14 <P_T> No, I'm using ConvPNG now
- Oct 05 20:57:35 <MateoC> Sure what's up
- Oct 05 20:57:51 <MateoC> https://github.com/mateoconlechuga/convpng/tree/master/tests/appvars_asm
- Oct 05 20:57:56 * MichaelB (uid228033@id-228033.ealing.irccloud.com) has joined
- Oct 05 20:58:33 <P_T> Can't open all_gfx
- Oct 05 20:58:38 <MateoC> Did you decide on a format?
- Oct 05 20:58:47 <MateoC> all_gfx?
- Oct 05 20:58:49 <MateoC> Wat
- Oct 05 20:59:24 <P_T> Hmm I get something working now :P
- Oct 05 20:59:53 <P_T> Is the palette included in the appvar?
- Oct 05 21:00:07 <MateoC> That information is in the readme :P
- Oct 05 21:00:34 <P_T> Like, can I just use xlibc as a palette?
- Oct 05 21:00:43 <MateoC> But have you decided how you would like ICE to export appvars?
- Oct 05 21:00:52 <MateoC> Um what
- Oct 05 21:00:58 <P_T> The same as assembly, without palette
- Oct 05 21:01:13 <P_T> Just the raw data
- Oct 05 21:01:31 <MateoC> What do you mean exactly
- Oct 05 21:02:11 <MateoC> Also, how would you like the format for sprites in appvars?
- 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
- Oct 05 21:03:00 <MateoC> Sure; for tilemaps
- Oct 05 21:03:10 <MateoC> But don't you want to store sprites in appvars too?
- Oct 05 21:03:25 <MateoC> I mean; it's up to you :P
- Oct 05 21:03:35 <P_T> Hmm that sounds doable, but that would be exactly the same, just width, height, data
- Oct 05 21:03:36 <saxjax> [Cemetech] Jek entered the room
- Oct 05 21:03:41 <MateoC> Err wait
- Oct 05 21:03:50 <MateoC> I already programmed that lol
- Oct 05 21:03:55 <MateoC> Mateo++
- Oct 05 21:04:00 <P_T> >.<
- Oct 05 21:04:22 <MateoC> I mean; how would you like the export format to be for ICE?
- Oct 05 21:04:29 <MateoC> What should the user see?
- Oct 05 21:04:41 <saxjax> [Cemetech] _iPhoenix_ entered the room
- Oct 05 21:04:43 <P_T> Oh, let me see the arguments
- Oct 05 21:04:49 <saxjax> [Cemetech] _iPhoenix_ entered the room
- Oct 05 21:04:51 <MateoC> To what?
- Oct 05 21:05:14 <MateoC> Because right now you have to do AppvarASM, which is not AppvarICE :P
- 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"
- Oct 05 21:05:39 <P_T> Is that what you mean? :P
- Oct 05 21:05:46 <MateoC> No
- Oct 05 21:06:01 <MateoC> If you look at how convpng currently exports tilemaps:
- Oct 05 21:06:12 <MateoC> It is TILEWIDTH,TILEHEIGHT,TILEDATA
- Oct 05 21:06:40 <MateoC> You can set up TYPEWIDTH and TYPEHEIGHT with those
- Oct 05 21:06:40 <P_T> Oh, you mean which 'properties' should be in the appvar?
- Oct 05 21:06:45 <MateoC> Yes
- Oct 05 21:06:49 <P_T> Only the tiledata
- Oct 05 21:06:58 <MateoC> I can describe the current format
- Oct 05 21:07:03 <P_T> I will fetch them using tilewidth, tileheight
- Oct 05 21:07:05 <MateoC> Maybe you will like it better :P
- Oct 05 21:09:09 <MateoC> So right now offsets to sprite data is stored at the start of the appvar
- Oct 05 21:09:17 <P_T> I don't need that
- Oct 05 21:09:22 <P_T> That makes it even more complicated ;)
- Oct 05 21:09:24 <MateoC> Yes you do
- Oct 05 21:09:26 <MateoC> No it doesn't
- Oct 05 21:09:42 <MateoC> This allows you to not have to "Copy" sprites in
- Oct 05 21:10:22 <MateoC> Unless you want to force the user to specify the size of each image too?
- 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?
- Oct 05 21:10:37 <MateoC> No
- Oct 05 21:10:41 <MateoC> There's no copying
- Oct 05 21:10:48 <MateoC> Sprites are stored in the appvar
- Oct 05 21:10:55 <MateoC> You can just get pointers to them
- Oct 05 21:11:07 <MateoC> By using the offset table
- Oct 05 21:11:51 <P_T> Do I need to copy the appvar data to ICE, such that it becomes one program?
- Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> There's no copying
- Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> Sprites are stored in the appvar
- Oct 05 21:12:06 <MateoC> 12:10 PM <MateoC> You can just get pointers to them
- Oct 05 21:12:07 <MateoC> 12:11 PM <MateoC> By using the offset table
- Oct 05 21:13:18 <P_T> Either I get it wrong, or it doesn't work
- Oct 05 21:13:18 <MateoC> Sprites don't need to be allocated anywhere else if they already exist in an appvar
- Oct 05 21:13:43 <MateoC> You are doing something wrong; what does convpng.ini look like?
- Oct 05 21:13:59 <P_T> https://pastebin.com/M2xeH5q1
- Oct 05 21:14:27 <MateoC> Okay; so you didn't specify that it was a tileset P_T
- Oct 05 21:14:55 <MateoC> #Tilemap : 16,16,false
- Oct 05 21:14:59 <MateoC> Or somethign
- Oct 05 21:15:29 <MateoC> Hm I should make that take 2 arguments and default to false
- Oct 05 21:15:50 <P_T> Should ICE find the appvar or the output program?
- Oct 05 21:16:01 <MateoC> Also I'm not sure why you have IncludePalettes in there
- Oct 05 21:16:12 <P_T> Me neither, but that's probably because I do everything wrong
- Oct 05 21:16:17 <saxjax> [Cemetech] gilroy0 entered the room
- Oct 05 21:16:20 <MateoC> Um; the appvar should be specified by the user
- Oct 05 21:16:55 <MateoC> LoadData("APPVAR", 0)->A
- Oct 05 21:17:04 <MateoC> Would load the first pointer
- Oct 05 21:17:16 <MateoC> Into A
- Oct 05 21:17:21 <MateoC> Hm
- Oct 05 21:17:32 <P_T> How would DefineTilemap then look like?
- Oct 05 21:18:07 <MateoC> Tilemaps are just pointers to sprites
- Oct 05 21:18:16 <P_T> I know
- Oct 05 21:18:18 <P_T> But not offsets
- Oct 05 21:18:26 <MateoC> You can probably just make a function called LoadTilemap
- Oct 05 21:18:42 <MateoC> And then DefineTilemap will take the pointer that produces
- Oct 05 21:18:47 <saxjax> [Cemetech] gilroy0 entered the room
- Oct 05 21:18:48 <MateoC> P_T: You need offsets >.>
- 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?
- Oct 05 21:18:55 <P_T> Wat
- Oct 05 21:19:27 <MateoC> ICE should build the table; which is what LoadTilemap does
- Oct 05 21:19:52 <MateoC> DefineTilemap then can receive the pointer produced by LoadTilemap
- Oct 05 21:20:59 <saxjax> [Cemetech] Pieman7373 entered the room
- 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
- Oct 05 21:21:10 <MateoC> What
- Oct 05 21:21:24 <MateoC> ICE should build the table; which is what LoadTilemap does
- 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?
- Oct 05 21:22:06 <MateoC> No
- Oct 05 21:22:18 <saxjax> [Cemetech] Caleb_J entered the room
- Oct 05 21:22:19 <MateoC> The table would have to be built by ICE
- Oct 05 21:22:56 <P_T> That can't
- Oct 05 21:23:02 <MateoC> If you want I can write up a short description :P
- Oct 05 21:23:05 <MateoC> Yes it can
- Oct 05 21:23:08 <P_T> No it can't
- Oct 05 21:23:15 <P_T> Or it needs to copy the data in the appvar to ICE
- Oct 05 21:23:17 <MateoC> My gosh of course it can
- Oct 05 21:23:20 <MateoC> No
- 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 )
- Oct 05 21:23:29 <saxjax> [Caleb_J] Hello all
- Oct 05 21:23:31 <MateoC> I'll just write up how to do it :P
- Oct 05 21:24:05 <MateoC> Give me like 7.5 minutes :P
- Oct 05 21:24:15 <P_T> Almost, one sentence :P
- Oct 05 21:24:39 <saxjax> [Cemetech] _iPhoenix_ added a post in [List of things TI does to upset Mateo]( http://cemete.ch/p263868 )
- 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?
- 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 )
- Oct 05 21:25:11 <saxjax> [Cemetech] PT_ edited a post in [List of things TI does to upset Mateo]( http://cemete.ch/p263868 )
- Oct 05 21:25:18 <saxjax> [Caleb_J] Phoenix, stop trying to scare me. :D
- Oct 05 21:26:11 <saxjax> [Cemetech] Ivoah entered the room
- Oct 05 21:26:25 <MateoC> 5 minutes
- Oct 05 21:26:27 <P_T> :P
- Oct 05 21:26:37 <P_T> Krypto: that's why adding tilemaps is hard :P
- Oct 05 21:27:12 <saxjax> [KryptonicDragon] Heh. So is 2 days not reasonable?
- 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 )
- Oct 05 21:27:36 <P_T> I have to do it today and tomorrow, because this weekend I'm away
- 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 )
- 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 )
- 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 )
- Oct 05 21:29:06 <saxjax> [Cemetech] Caleb_J deleted a post in [Doors CE 9 (TI-84 Plus CE) Development thread]
- Oct 05 21:29:12 <saxjax> [Caleb_J] silly me
- Oct 05 21:29:21 <saxjax> [Caleb_J] not reading posts entirely
- Oct 05 21:29:30 <saxjax> [Caleb_J] will be my downfall
- Oct 05 21:31:13 <saxjax> [TheLastMillennial] oh, sorry sm84, I forgot to give you the syntax for the lines
- Oct 05 21:31:31 <MateoC> https://pastebin.com/e9hWqWNs
- Oct 05 21:31:35 <MateoC> There you go PT_
- Oct 05 21:31:41 <saxjax> [SM84CE] its fine, i found it inside of the loops, near the suggested lines
- Oct 05 21:32:01 <MateoC> Those are what the functions should look like for tilemaps
- Oct 05 21:32:13 <MateoC> You should also have a LoadSprite() function as well :P
- Oct 05 21:32:25 <MateoC> LoadSprite("APPVAR", OFFSET)->A
- Oct 05 21:32:38 * P_T sighs
- Oct 05 21:32:43 <saxjax> [Cemetech] MeepsCe entered the room
- 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?
- Oct 05 21:33:09 <MateoC> What "Table" are you talking about
- Oct 05 21:33:19 <P_T> The table with pointers to the sprites
- Oct 05 21:33:21 * SopaXorzT has quit (Remote host closed the connection)
- Oct 05 21:33:27 <MateoC> You have to build that
- Oct 05 21:33:30 <P_T> I know
- Oct 05 21:33:35 <MateoC> I mean I said it right there
- Oct 05 21:33:44 <saxjax> [Cemetech] Eightx84 entered the room
- 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.
- Oct 05 21:33:47 <MateoC> "
- Oct 05 21:34:28 <P_T> Oh, you mean that LoadTilemapSprites builds the sprite table, but in the output program?
- Oct 05 21:35:16 <MateoC> No; it allocates space for the table at compile time; and builds the actual table at runtime
- Oct 05 21:35:26 <MateoC> That's what LoadTilemapSprites is
- Oct 05 21:36:01 <saxjax> [SM84CE] with PHASM, i ran my passwors locking prgm, and when my calc exited the prgm, it crashed :(
- Oct 05 21:36:16 <P_T> Now I get it
- Oct 05 21:36:19 <P_T> I think
- 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
- Oct 05 21:37:19 <saxjax> [Cemetech] shkaboinka entered the room
- Oct 05 21:37:53 <MateoC> The offsets are not stored in the appvar
- Oct 05 21:38:03 <MateoC> The only offsets stored are offsets to the data
- Oct 05 21:38:19 <MateoC> ICE would build the table like this:
- Oct 05 21:38:19 <saxjax> [Cemetech] JWinslow23 entered the room
- Oct 05 21:39:08 <P_T> ICE builds the table with offsets, and at runtime the program will allocate these offsets?
- Oct 05 21:39:22 <MateoC> No; it allocates space for the table at compile time; and builds the actual table at runtime
- Oct 05 21:39:48 <P_T> How would the program during runtime know what the offsets are?
- Oct 05 21:39:59 <MateoC> Which offsets are we talking about
- Oct 05 21:40:11 <MateoC> There are offsets to sprite data and offsets to tilemap sprites
- Oct 05 21:40:25 <P_T> Tilemap sprites
- Oct 05 21:40:40 <MateoC> Okay; so first you would do a GetDataPtr
- Oct 05 21:41:04 <jacobly> needs more bss
- Oct 05 21:41:16 <MateoC> That's what I'm doing jacobly :P
- Oct 05 21:41:53 <saxjax> [Cemetech] CtrlEng entered the room
- Oct 05 21:42:05 <MateoC> ptr = GetDataPtr; ptr += OFFSET; ptr += *ptr;
- Oct 05 21:42:30 <MateoC> Then ptr now contains the pointer to the tilemap sprite data
- Oct 05 21:42:33 <MateoC> Then you do:
- Oct 05 21:43:14 <P_T> I don't get that
- Oct 05 21:43:26 <saxjax> [Cemetech] c4ooo entered the room
- Oct 05 21:43:50 <MateoC> for(i=0; i<SIZE/3; i++) { sprite_ptrs[i] = ptr; ptr += TILESIZE; }
- Oct 05 21:43:56 <MateoC> Then return sprite_ptrs
- Oct 05 21:44:02 <MateoC> What don't you get?
- Oct 05 21:44:12 <MateoC> jacobly; can you explain that better :P
- Oct 05 21:44:14 <P_T> What does the structure of the appvar look like?
- Oct 05 21:44:37 <MateoC> It contains offsets to sprite data at the start; like I've been saying :P
- Oct 05 21:44:57 <P_T> Offsets from the beginning of the appvar, or the start of the sprites?
- Oct 05 21:45:08 <P_T> Like offset #0, is that 0 or 128*3?
- Oct 05 21:45:14 <MateoC> From the begining of the appvar to whatever was specified in convpng
- Oct 05 21:45:36 <MateoC> It would be whatever the offset is to get the information stored for that sprite
- Oct 05 21:45:42 <P_T> What is OFFSET in LoadTilemapSprites used for, then?
- Oct 05 21:45:44 <saxjax> [Cemetech] ShoesTaxi registered and activated a new account
- Oct 05 21:45:59 <MateoC> Did you read the pastebin
- Oct 05 21:46:08 <MateoC> https://pastebin.com/e9hWqWNs
- Oct 05 21:46:13 <P_T> "which will represent 2 and the size in bytes "
- Oct 05 21:46:16 <saxjax> [Cemetech] YelloTrout entered the room
- Oct 05 21:46:23 <MateoC> So OFFSET would be 2
- Oct 05 21:46:30 <MateoC> Because tilemap_sprites is index 2
- Oct 05 21:46:33 <MateoC> In the appvar
- Oct 05 21:46:40 <MateoC> Because sprite_1 = 0 and sprite_2 = 1
- Oct 05 21:46:45 <MateoC> So tilemap_sprites = 2
- Oct 05 21:47:12 <P_T> You wanna load multiple tilemap sprites at the same time?
- Oct 05 21:47:17 <jacobly> OFFSET is clearly the offset between offsets :P
- Oct 05 21:47:17 <MateoC> What
- Oct 05 21:47:27 <MateoC> What jacobly said
- Oct 05 21:47:37 <saxjax> [Caleb_J] Gotta get going. Bye everybody!
- Oct 05 21:47:38 <jacobly> aka the size of each offset
- Oct 05 21:47:39 <MateoC> It's the index of the data in the appvar
- Oct 05 21:47:44 <saxjax> [Cemetech] ShoesTaxi entered the room
- Oct 05 21:47:45 <Cemetech> ShoesTaxi, welcome to Cemetech! Please introduce yourself in this topic: http://cemete.ch/t4925
- Oct 05 21:47:55 <jacobly> though that could be computed from sprite sizes, etc >.>
- Oct 05 21:48:14 <MateoC> It could; but that would require scanning of the whole appvar :P
- Oct 05 21:48:23 <jacobly> so?
- Oct 05 21:48:35 <jacobly> you read the same number of things
- Oct 05 21:48:54 <MateoC> Seems easier to just store an offset table :P
- Oct 05 21:49:00 <MateoC> Then it's easier for the user
- Oct 05 21:49:19 <jacobly> but then why bother computing one
- Oct 05 21:49:43 <jacobly> you should do one or the other, not both :P
- Oct 05 21:49:50 <jacobly> as an option
- Oct 05 21:49:55 <nikkybot> dunno
- Oct 05 21:49:58 <nikkybot> because he hates us all?
- Oct 05 21:50:00 * P_T is confused
- Oct 05 21:50:21 <MateoC> jacobly: But it is pointer to the data; not individual sprites
- Oct 05 21:50:32 <P_T> What's the point of OFFSET? LoadTilemapSprites just loads one tilemap with several sprites, right?
- Oct 05 21:50:54 <MateoC> 12:46 PM <MateoC> Because sprite_1 = 0 and sprite_2 = 1
- Oct 05 21:50:54 <MateoC> 12:46 PM <MateoC> So tilemap_sprites = 2
- Oct 05 21:51:05 <P_T> Yes, but what does that change?
- Oct 05 21:51:09 <P_T> What happens if I make that 1?
- Oct 05 21:51:17 <MateoC> It wouldn't work?
- Oct 05 21:51:31 <MateoC> Does no one understand how cool this is >.>
- Oct 05 21:51:34 <P_T> No
- Oct 05 21:51:37 <MateoC> Aw
- Oct 05 21:52:04 <P_T> tilemap_sprites, sprite_1 and sprite_2 will be in one appvar?
- Oct 05 21:52:09 <MateoC> Of course
- Oct 05 21:52:15 <MateoC> In the order they are defined
- Oct 05 21:52:27 <MateoC> Well; at least what the offset table in the appvar says
- Oct 05 21:52:39 <P_T> If we assume all the 3 PNG's are 1 tile
- Oct 05 21:52:44 <MateoC> What
- Oct 05 21:52:55 <MateoC> Why are you stuck on tilemaps
- Oct 05 21:53:08 <MateoC> You can store sprites, tilemaps, palettes to appvars
- 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>,...
- Oct 05 21:53:56 <P_T> Or not?
- Oct 05 21:54:18 <MateoC> Appvar structure looks like this:
- 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>
- Oct 05 21:55:27 <MateoC> Just how it was defined in convpng
- Oct 05 21:55:39 <MateoC> So index 2 means the <offset to tilemap_sprites>
- Oct 05 21:56:15 <P_T> What are the sizes of <offset to sprite_1 data>...?
- Oct 05 21:56:21 <MateoC> 3 bytes
- Oct 05 21:56:34 <MateoC> It's the offset from the start of the appvar to the data
- Oct 05 21:57:18 <MateoC> Err
- Oct 05 21:57:29 <MateoC> offsets after the offset table apparently
- Oct 05 21:57:39 <saxjax> [SM84CE] is it possible to get the character for the Alpha lock cursor into a string?
- Oct 05 21:58:09 <MateoC> jacobly: Huh; you could just use the size as the offset huh
- Oct 05 21:58:43 <MateoC> But less intuitive
- Oct 05 21:59:35 <MateoC> P_T: Does that make more sense?
- Oct 05 21:59:57 <P_T> Now I get what OFFSET is, I think
- Oct 05 22:00:07 <P_T> I just need to multiply that with 3
- Oct 05 22:00:14 <MateoC> Yes
- Oct 05 22:00:35 <P_T> Can <offset to tilemap_sprites> be more than 3 bytes?
- Oct 05 22:00:50 <MateoC> Technically it can't be larger than 2 bytes
- Oct 05 22:01:00 <MateoC> Because appvars can only be 64K
- Oct 05 22:01:10 <P_T> Where is the offset table for <tilemap_sprites data> stored, then?
- Oct 05 22:01:14 <MateoC> Nowhere
- Oct 05 22:01:25 <MateoC> That is easily computable
- 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.
- Oct 05 22:02:11 <MateoC> When that command runs; it computes all the offsets for the sprites
- 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
- Oct 05 22:02:32 * commandz (~commandbl@h246.168.48.24.cable.angl.cmaaccess.com) has joined
- Oct 05 22:02:48 <MateoC> Not exactly
- Oct 05 22:02:58 <MateoC> It adds about 3 lines?
- Oct 05 22:03:32 <MateoC> To compute the offsets; you can just use the sprites themselves
- Oct 05 22:03:37 <P_T> I thought that building the sprite table at compile time was more fun <_<
- Oct 05 22:03:44 <MateoC> You can't do that
- Oct 05 22:03:52 <P_T> If I move the data to ICE, yes
- Oct 05 22:03:56 <MateoC> You can allocate it
- Oct 05 22:04:02 <MateoC> But not define it
- Oct 05 22:05:03 <P_T> How would I get the tile size from LoadTilemapSprites?
- Oct 05 22:05:27 <MateoC> You understand how to get a pointer to the tilemap data right?
- Oct 05 22:05:31 <P_T> Yes
- Oct 05 22:05:54 <MateoC> So once you do that; the tile size is the first two bytes
- Oct 05 22:05:57 <P_T> Ah
- Oct 05 22:05:59 <MateoC> multiplied together
- Oct 05 22:06:23 <MateoC> Then you can just loop for the size of the pointer table / 3
- 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?
- Oct 05 22:06:30 <P_T> Oh
- Oct 05 22:06:32 * P_T hides
- Oct 05 22:06:49 <MateoC> for(i=0; i<SIZE/3; i++) { sprite_ptrs[i] = ptr; ptr += TILESIZE; }
- Oct 05 22:06:55 <MateoC> Does that line make more sense now? :P
- Oct 05 22:07:05 <P_T> Yes, but I already understood that :P
- Oct 05 22:07:36 <P_T> Let me write an ASM snippet, and you can check if I did it right :P
- Oct 05 22:09:36 <MateoC> Hm
- Oct 05 22:09:53 * commandz has quit (Read error: Operation timed out)
- Oct 05 22:10:21 <MateoC> I guess the only issue is you don't know how many offsets are stored in the table
- Oct 05 22:11:08 <P_T> https://pastebin.com/JBt63Twe is this right?
- 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
- Oct 05 22:11:53 <P_T> Oh, need to increment HL 3 times right after the ld (hl), de
- Oct 05 22:12:29 <MateoC> Yeah; that's what I mean about calculate offsets from the start of the appvar rather
- Oct 05 22:13:07 <MateoC> You need to also inc bc \ inc bc
- Oct 05 22:13:14 <P_T> Ah ofc
- Oct 05 22:13:29 <MateoC> But other than that looks good :)
- Oct 05 22:13:34 <P_T> Heh. Finally
- Oct 05 22:13:43 <MateoC> So ICE format should calculate offsets from the beginning of the appvar?
- Oct 05 22:13:46 <P_T> Still complicated, and I don't really like it, but meh
- Oct 05 22:13:47 <P_T> Yes
- Oct 05 22:13:51 <MateoC> Okay can do
- Oct 05 22:13:54 <MateoC> Heh
- Oct 05 22:14:16 <P_T> Just put the entire tilemap in a seperate appvar, and you don't get all the struggles
- Oct 05 22:14:25 <MateoC> It's complicated but now users can store all their sprites in appvars too :P
- Oct 05 22:14:46 <MateoC> And palette data
- Oct 05 22:14:53 <MateoC> Also hum
- Oct 05 22:15:14 <saxjax> [KryptonicDragon] What does mlt do in assembly?
- Oct 05 22:15:16 <MateoC> Can you do: "APPVAR"->Str1
- Oct 05 22:15:20 <P_T> Yes
- Oct 05 22:15:32 <P_T> mlt hl : HL = H*L
- Oct 05 22:15:38 <MateoC> LoadTilemapSprite(Str1, 2, 128)->A
- Oct 05 22:15:38 <MateoC> ?
- Oct 05 22:15:39 <saxjax> [KryptonicDragon] Ah
- Oct 05 22:15:46 <P_T> That would work too
- Oct 05 22:15:49 <MateoC> Cool
- Oct 05 22:16:32 <MateoC> But yeah; the third argument would just allocate in saferam or something
- Oct 05 22:16:37 <MateoC> And put that in A
- 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
- Oct 05 22:18:09 <MateoC> You could also check if it is 3 :)
- Oct 05 22:18:15 <MateoC> Then you can store a pointer to it too
- Oct 05 22:18:19 <saxjax> [Cemetech] jonbush entered the room
- Oct 05 22:18:45 <MateoC> Just make it like LoadSprite("APPVAR", OFFSET, ALLOC_SIZE)
- Oct 05 22:19:14 <MateoC> convpng will export ALLOC_SIZE, which can just be allocated in the saferam for storage
- 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
- Oct 05 22:19:36 <MateoC> Yes it will just be an index
- Oct 05 22:19:40 <P_T> Or... it will be just 3 bytes directly :|
- Oct 05 22:19:49 <P_T> "ld hl, 9 \ add hl, de" heh
- Oct 05 22:20:07 <MateoC> It could also be multiplied by three :P
- Oct 05 22:20:26 <P_T> No, "ld hl, 9" is faster
- Oct 05 22:20:32 <MateoC> Got it
- Oct 05 22:20:56 <MateoC> So 0,3 would select the first sprite, 3,3 the second sprite, and 6,X the tilemap
- Oct 05 22:21:07 <P_T> Yes
- 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
- Oct 05 22:22:02 <MateoC> Well, convpng will output "APPVAR", OFFSET, ALLOC_SIZE
- Oct 05 22:22:18 <P_T> Yeah, but convpng.ini is rather important as well
- Oct 05 22:22:23 <MateoC> Good point :P
- 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
- Oct 05 22:23:50 <P_T> Data("APPVAR",OFFSET,SIZE->A
- Oct 05 22:24:49 <MateoC> I think that might get confusing but it's up to you :)
- Oct 05 22:25:37 <saxjax> [Cemetech] _iPhoenix_ entered the room
- Oct 05 22:26:18 <P_T> That was 90 minutes confusion <_< xD
- Oct 05 22:26:34 <MateoC> Sorry :P
- 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
- Oct 05 22:27:17 <MateoC> Um you just list them in convpng :P
- Oct 05 22:27:23 <MateoC> "// the ordering here is the order of the offsets and storage of sprites"
- Oct 05 22:27:27 <MateoC> https://pastebin.com/e9hWqWNs
- Oct 05 22:27:47 <MateoC> btw you can use // for comments in convpng
- Oct 05 22:27:53 <P_T> Yes, but not all the sprites/tilemaps have equal size
- Oct 05 22:28:09 <MateoC> Equal size?
- Oct 05 22:28:15 <MateoC> That's what the offset table is for
- Oct 05 22:28:25 <P_T> And using "#Tilemap : 16,16,false" splits all the PNG's to 16x16 chunks, right?
- Oct 05 22:28:32 <P_T> Oh nvm, I'm stupid
- Oct 05 22:28:43 <MateoC> 16x16 sprites :P
- Oct 05 22:28:57 <MateoC> Oooh
- Oct 05 22:28:59 <MateoC> I'm dump
- Oct 05 22:29:02 <MateoC> *dumb
- 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
- Oct 05 22:29:11 <MateoC> Those should be two different groups
- Oct 05 22:29:19 <P_T> Yeah
- Oct 05 22:29:33 <MateoC> No wonder it was confusing
- 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
- Oct 05 22:30:12 <MateoC> https://pastebin.com/afz7UQSD
- Oct 05 22:30:15 <MateoC> There is that better?
- Oct 05 22:30:22 <P_T> Yep! :D
- Oct 05 22:31:19 <MateoC> If you want to define a palette across all of them you can use #GroupPalette
- Oct 05 22:31:27 <P_T> Yeah
- Oct 05 22:31:43 <P_T> Now we spam 30/38 messages, instead of 28/38 :P
- Oct 05 22:31:48 <MateoC> Hehe
- Oct 05 22:32:38 <P_T> Almost the entire #cemetech (500 lines) is us talking :P
- Oct 05 22:32:58 <MateoC> Where did everyone go
- Oct 05 22:33:08 <P_T> They found it too complicated hehe
- 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
- Oct 05 22:34:36 <P_T> Nah, it's fine now
- Oct 05 22:34:44 <MateoC> Or you can just store 0
- Oct 05 22:34:44 <P_T> I don't wanna make it more complicated :P
- Oct 05 22:34:54 <MateoC> Well you need to do that at some point :P
- Oct 05 22:35:13 <P_T> Why? The user can just fill in the arguments, like MAP_WIDTH or whatever
- 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
- Oct 05 22:35:25 <MateoC> DefineTilemap(WIDTH, HEIGHT, DRAW_WIDTH, DRAW_HEIGHT, Y_LOC, X_LOC, A, "tilemap data")->B
- Oct 05 22:35:51 <P_T> Yes, but the user can just put that in the function
- Oct 05 22:36:20 <MateoC> Very well :P
- 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)?
- Oct 05 22:41:06 <saxjax> [Cemetech] (G) *gCn virtual hub 'BotWeb' has new calculator 0A3613C041 from Spark7373
- Oct 05 22:41:31 <saxjax> [Cemetech] (G) *gCn virtual hub 'BotWeb' has new calculator 0A3613C041 from Spark7373
- Oct 05 22:42:02 <MateoC> add hl,de at the end
- Oct 05 22:42:27 <P_T> Oops, sure
- Oct 05 22:42:53 <MateoC> But yep once I fix convpng that's what it will be :)
- Oct 05 22:43:11 <MateoC> Also need to make sure the appvar isn't in the archive
- Oct 05 22:43:20 <P_T> Well, then there's no change I can fully support tilemaps before next week
- Oct 05 22:43:33 <MateoC> ?
- Oct 05 22:43:46 <P_T> Tomorrow I'm going away for some days :P
- Oct 05 22:44:04 <saxjax> [Cemetech] c4ooo entered the room
- Oct 05 22:44:56 <P_T> Unless you are really fast :P
- Oct 05 22:46:33 <MateoC> Oh I'm already done
- Oct 05 22:46:38 <MateoC> Let me just test and push
- Oct 05 22:46:44 <saxjax> [Cemetech] xMarminq_ entered the room
- Oct 05 22:48:12 <saxjax> [Cemetech] xMarminq_ added a post in [Oiram Issues]( http://cemete.ch/p263873 )
- Oct 05 22:49:23 <P_T> >.<
- Oct 05 22:49:30 <P_T> That is quick
- Oct 05 22:50:33 <P_T> Okay, how should I call the new token?
- Oct 05 22:52:25 <saxjax> [Cemetech] Stardust49 entered the room
- 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?
- Oct 05 22:54:55 <P_T> Maybe. It's rather complicated to calculate that all, because ICE optimize things on the flow
- Oct 05 22:55:25 <P_T> Like: expression < 3 depends heavily on expression
- 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."
- 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?)
- Oct 05 22:56:25 <P_T> det(7,X,Y)<3 isn't the same size as det(79,X,Y)
- Oct 05 22:56:29 <P_T> <3
- Oct 05 22:56:47 <P_T> (that is smaller than 3, not a heart :P)_
- Oct 05 22:57:06 <P_T> Nah. Even det(10) varies in speed, because it needs to wait for an interrupt IIRC
- Oct 05 22:57:11 <saxjax> [Cemetech] Stardust49 added a post in [Candid Photos]( http://cemete.ch/p263874 )
- Oct 05 22:57:23 <saxjax> [Cemetech] Stardust49 deleted a post in [Candid Photos]
- Oct 05 22:57:56 <P_T> See https://github.com/CE-Programming/toolchain/blob/master/src/graphx/graphx.asm#L921
- Oct 05 22:58:11 <saxjax> [Cemetech] Stardust49 added a post in [Candid Photos]( http://cemete.ch/p263875 )
- Oct 05 22:59:31 * Greg_ (~GregsASta@47.196.162.67) has joined
- 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."
- Oct 05 23:00:54 <P_T> I *can* make exact tables, but that is rather complicated
- Oct 05 23:01:08 <saxjax> [KryptonicDragon] Just give estimates then, if that's easier.
- Oct 05 23:01:39 <saxjax> [KryptonicDragon] Or just not include cycle count at all if that's too hard.
- 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))
- Oct 05 23:02:13 <P_T> "If not(sum(7,X,Y))"
- Oct 05 23:02:26 <saxjax> [Cemetech] Michael2_3B entered the room
- Oct 05 23:02:36 <saxjax> [Cemetech] FreshBoar13 entered the room
- Oct 05 23:03:57 <saxjax> [KryptonicDragon] Uh, in ez80 assembly, is the $ or % for a hex number?
- Oct 05 23:04:02 <P_T> $
- Oct 05 23:04:07 <P_T> % is binary
- Oct 05 23:04:28 <saxjax> [KryptonicDragon] Thanks, I switch those two a lot.
- 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.
- Oct 05 23:07:00 <P_T> Hah that's a nice one
- Oct 05 23:07:03 <saxjax> [Cemetech] Botboy3000 entered the room
- Oct 05 23:07:34 <P_T> PIEMAN
- Oct 05 23:07:38 <P_T> HAPPY BIRTYDAY!!! :D
- Oct 05 23:07:52 <saxjax> [Stardust49] thanks!
- Oct 05 23:08:05 <P_T> ?
- Oct 05 23:09:44 <saxjax> *KryptonicDragon is confused and doesnt know who pieman is
- Oct 05 23:09:56 * You've invited Tari to #cemetech-staff (irc.mzima.net)
- Oct 05 23:09:57 * [Tari] is away ("AFK, or something.")
- Oct 05 23:10:03 <P_T> Pieman7373
- Oct 05 23:10:07 <saxjax> [Cemetech] deuteriumoxide entered the room
- Oct 05 23:10:07 <P_T> A rather active user
- Oct 05 23:10:19 <saxjax> [Stardust49] oh okay
- Oct 05 23:10:33 <P_T> Although he isn't much on lately
- Oct 05 23:10:52 <saxjax> [Stardust49] that sucks
- Oct 05 23:10:52 <saxjax> [_iPhoenix_] KryptonicDragon: the percent sign actually originated from one hundred, a clearly decimal number ;P
- Oct 05 23:11:31 <saxjax> [Stardust49] cool
- Oct 05 23:11:37 <saxjax> [Stardust49] interesting factoid thank you
- Oct 05 23:11:54 <saxjax> [Cemetech] Alvajoy123 entered the room
- Oct 05 23:12:03 <saxjax> [KryptonicDragon] 100 can be binary for 4.
- Oct 05 23:12:25 <saxjax> [Stardust49] not that it can,
- Oct 05 23:12:27 <saxjax> [Stardust49] it is
- Oct 05 23:13:01 <P_T> No, 100 = 1100100 :P
- 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?
- Oct 05 23:13:14 <nikkybot> Well, suck a dick anyway
- Oct 05 23:13:14 <P_T> Yes
- Oct 05 23:13:16 <saxjax> [Cemetech] Alvajoy123 added a post in [ICE Compiler]( http://cemete.ch/p263876 )
- Oct 05 23:13:39 <saxjax> [KryptonicDragon] Awesome!
- 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?
- Oct 05 23:13:55 <saxjax> [Stardust49] yes, but 100 = 4
- Oct 05 23:13:59 <saxjax> [Stardust49] 1
- Oct 05 23:14:04 <saxjax> [Stardust49] 10
- Oct 05 23:14:05 <saxjax> [Stardust49] 11
- Oct 05 23:14:08 <saxjax> [Stardust49] 101
- Oct 05 23:14:13 <saxjax> [Stardust49] nevermind
- Oct 05 23:14:27 <saxjax> [Alvajoy123] Stop spaming
- Oct 05 23:14:28 <saxjax> [Stardust49] i don't know what you were getting at
- Oct 05 23:14:28 <P_T> Stardust: most of the people here know how to count in binary ;)
- Oct 05 23:14:30 <saxjax> [Stardust49] 110
- Oct 05 23:14:31 <saxjax> [Stardust49] 111
- Oct 05 23:14:39 <saxjax> [Stardust49] yep
- Oct 05 23:14:42 <saxjax> [Stardust49] 1000
- Oct 05 23:14:54 <saxjax> [Stardust49] 10000
- 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.
- 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
- Oct 05 23:15:59 <saxjax> [Alvajoy123] Hello everyone
- 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
- Oct 05 23:16:09 <P_T> Halvajoy!
- 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
- Oct 05 23:16:28 <saxjax> [KryptonicDragon] Hello alva
- Oct 05 23:16:29 <saxjax> [Stardust49] lol yeah
- Oct 05 23:16:31 <P_T> I memorized 2^25: 33 55 44 32 :P
- Oct 05 23:16:42 <saxjax> [Alvajoy123] So u said I should close all slots then make a appvars
- Oct 05 23:16:45 <MateoC> P_T: It's on the repo
- Oct 05 23:16:55 <P_T> Alvajoy: yes
- Oct 05 23:16:58 <P_T> Mateo++ :)
- Oct 05 23:16:59 <MateoC> I haven't built it yet; but you should be able to build
- Oct 05 23:17:03 <P_T> True
- Oct 05 23:17:06 <saxjax> [Alvajoy123] Ok
- Oct 05 23:17:07 <saxjax> [Cemetech] SM84CE entered the room
- Oct 05 23:17:23 <saxjax> [Alvajoy123] The what open slots for
- Oct 05 23:17:39 <saxjax> [Alvajoy123] Then I mean
- Oct 05 23:18:04 <MateoC> Open("NAME","w");
- Oct 05 23:18:29 <saxjax> [Alvajoy123] Oh ok thank you guys
- Oct 05 23:18:51 <saxjax> [Alvajoy123] Bye i am out
- Oct 05 23:19:15 <saxjax> [Alvajoy123] I will be back if it does not work
- Oct 05 23:19:25 <P_T> That sounds scary
- Oct 05 23:19:26 <saxjax> [SM84CE] crud... I missed the AppVar discussion...
- Oct 05 23:19:39 <P_T> Be happy
- Oct 05 23:19:42 <MateoC> It's all in the logs :P
- Oct 05 23:19:53 <P_T> 600 lines of messages, is that enough?
- Oct 05 23:19:56 <P_T> Probably even more
- Oct 05 23:20:10 <saxjax> [Cemetech] Battlesquid entered the room
- Oct 05 23:20:25 <saxjax> [KryptonicDragon] Well I'm off for about 30 mins, cya then!
- Oct 05 23:20:30 <P_T> Cya!
- Oct 05 23:21:06 <P_T> Mateo: mingw32 gives a bunch of warnings when building ConvPNG :P
- Oct 05 23:21:14 <saxjax> [SM84CE] how do i get the logs?
- Oct 05 23:21:16 <saxjax> [SM84CE] ~logs
- Oct 05 23:21:27 <saxjax> [SM84CE] nope
Add Comment
Please, Sign In to add comment