00:00:00 --- log: started retro/12.12.15 00:52:00 --- quit: karswell_ (Remote host closed the connection) 01:02:14 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 01:11:22 --- quit: karswell_ (Remote host closed the connection) 01:21:37 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 02:30:54 --- join: Mat2 (~Claude@91-65-144-133-dynip.superkabel.de) joined #retro 02:31:00 hello 03:22:43 --- quit: karswell_ (Remote host closed the connection) 03:28:49 --- quit: Mat2 (Quit: Verlassend) 03:32:59 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 05:15:59 --- join: Mat2 (~Claude@91-65-144-133-dynip.superkabel.de) joined #retro 05:37:41 --- quit: karswell_ (Remote host closed the connection) 05:47:41 --- quit: Mat2 (Quit: Verlassend) 05:47:56 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 06:05:04 --- quit: beretta (Quit: Leaving) 06:05:49 --- quit: karswell_ (Remote host closed the connection) 06:16:05 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 06:46:43 morning all 06:46:47 --- nick: tangentsleep -> tangentstorm 06:58:48 --- join: Mat2 (~Claude@91-65-144-133-dynip.superkabel.de) joined #retro 06:58:57 hello 06:59:50 hey :) 07:00:28 hi tangentstorm ! 07:00:59 im build ZenGL here beside 07:01:14 me too 07:01:31 actually i just checked it out of svn and ran the demos in lazarus 07:02:31 I must work the next 3 hours and will begin porting my code in the afternoon 07:03:19 i'm going to try and get demo09 (the sprite engine demo) hooked up to retro 07:03:35 see you later today then :) 07:03:55 which way ? Do you reserve some port addresses ? 07:04:43 i still like the block of ram idea, but maybe also a port to say "okay, you can draw the scene" or something 07:05:07 i'm just going to experiment with it i guess 07:05:39 ok see you later this afternoon 07:05:40 do you have a preference? 07:05:53 port devices would fit best to the VDP code 07:06:28 so maybe messages that say "sprite# x y setxy" ? 07:06:35 exactly 07:06:44 i think that actually works better with zengl too 07:06:56 ok. i'll shoot for that then 07:07:04 fine, see you 07:07:08 seeya 07:07:09 --- quit: Mat2 (Quit: Verlassend) 07:07:44 grrr, almost got my vector class exposed to javascript :P 07:07:52 also, mornin' tangy 07:08:05 haha morning 07:20:57 --- join: kumul (~kumul@cvx-ppp-66-50-141-36.coqui.net) joined #retro 07:21:29 --- quit: karswell_ (Remote host closed the connection) 07:29:27 --- join: intothev01d (~intothev0@unaffiliated/intothev01d) joined #retro 07:31:43 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 07:33:24 crc's compiling up a storm :) 07:35:13 crc: i love the idea of multiple backends. i wanted to do at least js + pascal + retro. 07:36:13 my thought was to decouple the code generation from the syntax tree by using a template system 07:37:13 either stringtemplate in particular (specificically designed for syntax trees - it's part of ANTLR, and has a python port)... or jinja2 (really nice python template engine) 07:43:16 tangentstorm: templating would be nice for this 07:49:45 crc: so i guess we're shooting for a small sprite-driven game of some kind instead of a text adventure 07:50:33 the notes are here: https://docs.google.com/document/d/17tXStyPkBdfnIl0cu_PmQBaA4ipus-vmZ7yZE0XcyKM/edit 08:04:58 tangentstorm: http://sprunge.us/FQQG has a version of fiction' with an .onDraw field and a 'draws' word for attaching code to render something to a room/item 08:06:05 :) cool! 08:06:21 crc: do you have a google account so i can invite you to the doc? 08:06:35 i'll also add you to the github repo as soon as i check this demo in 08:06:41 charles.childers@gmail.com 08:11:10 sent 08:13:58 --- quit: karswell_ (Remote host closed the connection) 08:24:14 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 08:43:25 --- join: Mat2 (~Claude@91-65-144-133-dynip.superkabel.de) joined #retro 08:43:44 tangentstorm: How's work going ? 08:45:14 We have a little problem: As I see it ZenGL does not support raw keyboard input 08:47:40 only key detection 08:50:16 so you can check if a specific key code was pressed but have no routine for synchron key input (remember the problem with he key repeat rate?) 08:50:30 hmmm :/ 08:50:58 well 08:52:38 * tangentstorm looks at the input demo 08:53:15 --- quit: karswell_ (Remote host closed the connection) 08:53:32 Mat: not to worry. it looks like it's just poorly documented :) 08:53:54 zgl_keyboard contains key_Down, key_Up, key_Press... 08:54:07 oh... hrm 08:58:43 yes, you can test if a specific key was pressed 08:59:15 this would mean polling all characters for input 09:01:13 You actually want this in a game engine sometimes, but... hrm... 09:02:00 key_PPress : procedure( KeyCode : Byte ); 09:02:10 it's listed under "callback" 09:02:29 i'm wondering if you can register that to receive the events... 09:02:39 but i don't see where it's used yet 09:03:05 if it were the private thing getting data from the os, it shouldn't be in the interface 09:03:29 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 09:03:59 yeah 09:04:08 it's used in zgl_application 09:04:27 so if you assign a procedure to that variable, it'll call the procedure 09:04:42 and same for key_PRelease 09:05:37 ahm, and the key code is then returned in KeyCode ? 09:06:03 yep 09:06:22 right after it adds it to the array of booleans 09:07:06 in zgl_application.pas ... it's actually duplicated a couple times - once for each platform :/ 09:07:17 I take a look 09:07:41 messy, but i think it'll work :) 09:08:13 yeah, a lot of game engines do that so you can just put all your logic in one single "onFrame" handler 09:12:40 ok: 09:15:43 there is one internal variable 'key' which hold the UTF8 code of the last pressed key 09:16:19 beside the used xlib routine will only return ASCII characters 09:17:10 key_PInputChar : procedure( Symbol : UTF8String ); 09:17:26 we only care about that for typing text though 09:17:58 for controlling a sprite, we just want to know that a key has been pressed 09:18:13 like we just care about the scan code 09:18:18 not which character it produces 09:19:11 i'm kind of thinking we actually want a separate keyboard device for this 09:19:26 that works the way 09:19:28 er 09:19:39 the normal one for text input 09:19:51 and this one that treats the keyboard more like a set of "buttons" 09:20:30 your game code really does come out much cleaner if you just have everything happen on frame, rather than on each input event 09:20:42 I let the SDL keyscan routine in, it works beside the graphic initialisation 09:20:59 ok 09:21:09 do you have a github account? i'll ad you to the project 09:21:47 I must reactivate my old account 09:22:51 I think the sprite subsystem only need an OpenGL layer ? 09:23:57 in this case, I only need to init one from SDL and you can use the handle for your work 09:24:30 Mat2: i like zengl but there's no point having it slow us down :) 09:25:01 as long as we can agree on an interface, it doesn't matter what implements it on the backend 09:25:08 so... want to just use sdl then? 09:25:18 yes 09:25:40 okie doke. i'll come back to zengl when we don't have the time pressure :) 09:25:47 otherwise we using two graphic libraries 09:26:07 works for me 09:26:36 by the way, you have compiled an old version of the VDP code for win32 09:27:36 oh? I thought i grabbed the latest version before i compiled it. :/ 09:27:53 that was the reason for his display problem 09:28:33 the newest one works like a real display (and offered a centred display) 09:28:39 --- join: docl (~docl@ds4403.dreamservers.com) joined #retro 09:28:39 --- quit: docl (Changing host) 09:28:39 --- join: docl (~docl@unaffiliated/docl) joined #retro 09:32:48 well, we'll get it sorted out when we compile this one, then :) 09:33:40 okay. i moved the repo to here https://github.com/goldsmile/rpld25 and invited everybody who's told me their github name :) 09:34:31 I need to search for my old account one moment 09:34:36 Mat2: they need to install jedi-sdl separately, right? 09:34:56 --- quit: karswell_ (Read error: Connection reset by peer) 09:35:12 no, the lib should be included with Freepascal 2.6 09:35:35 at least for the linux install package i is 09:35:45 ^it 09:45:10 --- join: karswell_ (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 09:46:04 i'm going to break ngaro.pas into its own repository so we can include it as a submodule without all my other b4 junk 09:46:59 ok 09:47:32 --- quit: karswell_ (Remote host closed the connection) 09:52:20 https://github.com/tangentstorm/ngaro-pas 09:53:15 ah there we go 09:53:49 i need to set up the lib dir real quick before you'll be able to compile 09:59:23 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #retro 10:03:23 I'm back in one and a half hour 10:03:31 --- nick: Mat2 -> Mat2-afk 10:11:01 there's probably an easier way to give everybody access to everything than what i'm doing ... :/ 10:11:30 but i guess next time around it'll already be set up, and i can just add people to the team... 10:12:36 anyway, i've added team forks for xpl, ngaro-pas, and retro 10:26:05 okay... hopefully if you're on the team at github, you can just run the 3 commands listed here and be up and running: 10:26:08 https://github.com/goldsmile/rpld25 10:27:09 fuck yes 10:27:16 i solved that template instatiation shit 10:27:31 and now i can call Vector from javascript 10:37:25 anyway, tangy :P is there anything i can help with? :) 11:00:22 --- nick: Mat2-afk -> Mat2 11:00:47 you can help me porting he Lord Of Midnight Engine :D 11:02:01 to be precise because of the time restrictions we need every helping hand for map design, graphic stuff, coding ec. 11:05:04 i've got people here distracting me... should quiet down soon. be back shortly. 11:05:56 Mat2: i did everything except merge your changes into the ngaro-pas repo. you should have rights to edit it 11:06:16 carefish: what's your github username? 11:07:34 thanks 11:09:09 also you should be able to just check out the top level one, run make retro, and it'll fetch the others under the "lib" directory 11:10:54 I'm extending at current the canvas pot for interfacing font rom, char and attribute map 11:12:05 after this is finished, retro-pascal is able to blit graphics to screen regardless of the initiated mode, e.g. there will be displayed in text or graphic mode 11:12:27 :) cool 11:12:42 back in a few 11:12:45 ok 11:13:41 Mat2: okay, tell me what to do, where to find stuff, gotta add to this: i only know C#/C++, don't really know other languages 11:14:03 tangentstorm: not sure if i have a github, well.. i should have one, lemme find it 11:14:42 carefish is my github's username 11:24:15 at first you should compile retro from tangentstorms repro 11:25:38 here you find the sources for Lord Of Midnight: 11:25:41 http://www.icemark.com/downloads/ 11:26:24 the graphic engine is an 16 bit assembly file for the Intel 8086 architecure 11:28:06 we want to get some inspirations from the math behind it and render screens with fixed sights directly from a map array 11:29:02 which holds every object for the game (Trees, enemies, mountains) you get the idea 11:29:40 It would help me if you find a nice algorithm for constructing such a map 11:30:36 and some routines for accessing locations (array offsets) 11:31:01 fixed sights? 11:31:43 8 or 4 view positions 45° 11:32:04 well, that map is do-able, what i do in C# is have a globally acessable list and push new objects that derive from gameobject in that list in the ctor 11:32:06 so N,NW,W,SW,E 11:32:58 tree : Gameobject { tree() { Globals.DynamicGameObjects.Add(this); }} 11:33:10 ok, sadly I don't know C# but know C and C++ 11:33:14 tree is a bad example since that's a static object 11:33:34 so then i'd ust Globals.StaticGameObjects.Add(this); 11:33:39 I would prefer retro but find the language your comfortable with 11:33:51 i need lots of guidance when using retro 11:33:59 tried it out last night, it confused the crap out of m 11:34:00 e 11:34:02 that's not the problem 11:34:26 I will help you out 11:34:39 and when you say a 'fixed sights 11:35:18 it would still be one global list where you can have a variable (or enum if you prefer) that says what it's currently pointing at 11:35:50 and then in the render code only render the objects that have the proper N/W/E/etc flag by checking what the player currently is viewing 11:36:17 that is a good possibility, yes 11:36:51 also quite fast since you won't be rendering objects that have an incorrect flag 11:37:00 like, 3 seperate lists 11:37:21 CurrentlyRendering / AboutToRender / NotVisible 11:37:31 player is looking at N sight 11:37:43 abouttorender holds NE/NW sights 11:37:57 I have figured out the Lord Of Midnight engine just rendering every object by id which is stored in a fixed sized array-element of a fixed, two-dimensional map 11:38:16 i'm grabbing tangy's retro thingy now 11:38:28 fine 11:38:44 so the playmap holding only visible objects 11:38:56 yup, basically 11:40:04 https://github.com/goldsmile/retro-language <- this one? 11:40:56 https://github.com/goldsmile/rpld25 11:41:10 that's the link tangentstorm posted earlier 11:41:48 ok, I', working now on this special retro vm with basic blitting support (I love AMIGA inspired copper lists) 11:42:25 back 11:42:32 wb 11:43:11 I've got a basic API sketched out under "arcade device operations" 11:43:34 if I had know this earlier I had include the whole AGA chipset emulation from UAE 11:43:37 let me know if it'll work for you or what needs to change 11:43:44 I take a look 11:43:45 :) 11:44:03 carefish will working on the graphic engine 11:44:18 cool 11:44:28 okay, i've downloaded free pascal/rpld25 11:44:29 bu he need help with retro 11:44:45 what next? :D 11:44:54 get firm with retro :) 11:45:09 carefish: are you able to compile it? 11:45:15 on www.retroforth you find the documentation 11:45:50 i'm not sure how to compile it on windows :( 11:46:07 fpc comes with make 11:46:13 so just run make 11:46:21 make retro 11:46:22 make from the gitrepo? 11:46:25 yes 11:46:28 ok 11:46:30 I'm working on the ngaro vm yet and will be back in one hour or so (so concentrate on coding) 11:47:05 --- nick: Mat2 -> Mat2-speed-codin 11:47:26 i guess i will start making some kind of simple game then 11:47:41 i will start implementing this api on the retro side 11:47:57 C:\Projects\Git\rpld25>C:\FPC\2.6.0\bin\i386-win32\make retro 11:47:57 The syntax of the command is incorrect. 11:47:57 C:\FPC\2.6.0\bin\i386-win32\make: *** [init] Error 1 11:48:24 yuck 11:53:52 ok sprite engine is fine 11:54:00 for me 11:55:30 cool 11:55:44 carefish: did you install lazarus? 11:55:58 it's got to do with UAC 11:56:39 oh 11:56:58 i simply downloaded the fpc installer, and bashed next->next->next/etc 11:57:59 well you can compile ngaro with the "fp" IDE that comes with freepascal 11:58:15 it's the old console-mode IDE 11:58:25 or use fpcmake 11:58:42 downloading lazarus 11:59:16 i've got to do this too because i only have graphics on windows :) 12:00:39 installing lazarus 12:02:26 and now what? load up the retro.pas ? 12:03:31 yeah.. see if you can get it to compile... i'm trying the same on my end here 12:03:51 or you can just wait a few minutes... i'll get it set up :) 12:04:13 what folder do i need to look at? 12:04:32 rpld25/lib/retro? 12:04:44 lib/ngaro-pas ? 12:04:46 lib/ngaro-pas 12:04:52 that's the one we're working on 12:04:55 ah 12:05:07 lib/retro is there so we can get the retro libraries 12:05:31 well, it's opened, can i can press the play button and no errors? 12:05:39 try it 12:05:53 an empty form shows up 12:06:27 ok give me a minute then... i've only been using the command line up until now. 12:06:32 i've used lazarus, just not with this 12:06:34 okay :) 12:06:52 pascal doesn't seem too difficult to get a hang off 12:07:15 nah, it's a lot like java or c# 12:07:34 in fact the guy who desigend c# previously worked for many years on delphi 12:07:55 (which is what they called turbo pascal for windows) 12:10:55 oh, nice fun fact to know :) 12:11:01 tangentstorm has written a pascal-subset to retro compiler you can use 12:12:39 (you can also create your own working language in retro if you will, that's possible) 12:12:41 carefish: do you actually have files under lib? because my windows make didn't even get that far 12:13:09 C:\Projects\Git\rpld25\lib 12:13:17 if not, run "git submodule init; git submodule update" 12:13:25 that folder contains 3 folders ngaro-pas / xpl / retro 12:15:42 yeah.. they should have files inside.. run the two git commands i just posted 12:18:29 those folders do have files in them 12:19:54 and uhh.. i have the visual client of git 12:20:17 i used some git.exe in AppData\etc\etc\git 12:21:12 * Mat2-speed-codin windows makes the world go round... 12:21:51 ok cool 12:22:26 like, i didn't get compile/run errors in lazarus, so i should be fine right? 12:22:47 * Mat2-speed-codin accessing char and attribute map, vsync control and internal register access should now work 12:22:49 http://img.is1337.eu/9d7dc8b0.png 12:22:49 is there a retro.exe? 12:23:12 no, there is a project1.exe in some temp folder 12:23:50 i think lazarus made you a new empty program 12:23:56 that's why it's showing the form1 thing 12:24:00 quite possibly. 12:24:36 ok to brute force it, you can copy xpl/code/stacks.pas to your ngaro-pas/src directory 12:24:51 and then just run fpc retro.pas from the command line 12:25:08 no hang on 12:29:31 okay i just added a batch file to the top level directory until i can get make sorted out 12:29:49 this will build the pascal version of retro 12:30:19 ok, it works so far 12:30:35 carefish: mkdir gen first if it's not there 12:30:45 mkdir gen where? 12:30:53 ngaro-pas? 12:30:56 from the rpld25 directory 12:31:06 okay, done 12:31:19 git pull to get the batch file, and then run it 12:31:25 it should make gen\retro.exe 12:31:34 then you need retroImage from lib\retro in the same directory 12:31:40 what batch file? 12:31:47 git pull 12:31:52 there's only one batch file 12:32:45 hang on it didn't push when i said push :/ 12:33:09 it built retro.exe 12:33:11 there it is. https://github.com/goldsmile/rpld25/blob/master/build.bat 12:33:44 okay, i have a retro terminal/cmd window 12:33:50 cool :) 12:34:16 and now what? :) 12:34:23 tangentstorm: we have two possibilities now: I can build the shape routines from the char map (that's the way the ti9918 VDP chip handles bitmap displays). This have he true retro effect of allowing only two colours from 256 for each 8x8 attribute box or I can blit the shapes directly (every point can be of any 256 colours). The first way have one advantage: We can reuse the graphics from LOM 12:35:14 I mean directly from the sources 12:35:18 yeah 12:35:58 what are our preferences ? 12:36:23 so: my long term goal here is to make a reusable game engine with full-color graphics and all that... that's why i'm looking an zengl and trying to get this to run on js too... 12:36:43 so then the latter option is handier? 12:36:52 but right now this is just a prototype, so i'm fine with whatever you want to do 12:36:57 i wouldn't know how hard it would be to create LOM graphics ? 12:37:11 if you want to reuse LOM and tie it in to the blitter you already have, let's go for it :) 12:37:23 then we can focus 100% on the engine and not worry about graphics 12:37:31 http://www.youtube.com/watch?v=ilDgNSIhW5M 12:37:35 that are the game graphics 12:38:04 carefish: lords of midnight. it's a really old game but it did some cool stuff with arranging 2d graphics to simulate a 3d scene 12:38:21 i saw the gameplay yt vids yesterday 12:39:19 carefish: it's not easy because the shapes are designed to be build to a complete screen so there must fit well together 12:39:34 Mat2-speed-codin: as long as we're controlling sprites from retro i'm happy. let's do it that way 12:39:45 i think that fits in better with what you want to make in general too, right? 12:41:14 somewhat because I don't need to reserve a third buffer in graphic mem for the bitmap data 12:41:35 so tangentstorm, you had a pascal2retro compiler made? 12:41:58 because i think i can't get the hang of retro fast enough to actually be helpful, and i think i can manage that in pascal 12:42:26 carefish: pl/0 ;) 12:43:13 https://github.com/tangentstorm/PL0-Language-Tools 12:43:58 okay... so let's regroup here... we're basically talking about porting the LOM engine to pascal from the old assembly language? 12:44:14 or PL/0 + retro, rather 12:44:47 and then making some new game with tha engine? 12:44:53 that 12:45:45 okay, so how do i use that repo? 12:46:29 well, if that's what we're doing then you need python too 12:47:02 you just run python pl0_to_retro.py < tests/whatever.pl0 > whatever.rx 12:48:04 I have an idea: Carefish, if this would not problematic for you, you can write your code in pascal and I include the result as device into ngaro 12:48:51 this way we can use retro for scripting (tangentstorm can use his pl/0 compiler for example) and concentrate complete on the game design 12:49:19 (ngaro is the vm on which retro is build) 12:49:22 Mat2-speed-codin: can you post the LOM source code link again? 12:50:39 un moment 12:51:06 http://www.icemark.com/downloads/ 12:51:16 thanks 12:51:24 hmm, so i'll open up a new pascal project in lazarus, try to figure out how draw pic to screen and then build from there for the fixed sight/etc? 12:52:24 yes, because ngaro itself is written in pascal I can include your code as device so retro can access your interface 12:52:31 oh, awesome 12:52:36 well, i'll get to it 12:53:04 that site isn't loading for me 12:53:23 in lazarus, when making a new project, what should i select? 12:53:37 tangentstorm: I have no problem accessing it 12:53:56 app/program/console app/library/instantfpc/fpcunit console test app/fpcunit test app? 12:54:38 probably just program 12:55:09 let's have a looksy at a few pascal thingies 12:56:18 carefish: a good start would be to merge Mat2's existing SDL backend into the ngaro-pas directory 12:56:21 https://www.assembla.com/code/avm/git/nodes/master/metro/backport 12:56:34 I suggest you should use SDL for drawing because the documentation is good and the interface will be familiar to you 12:57:24 but please wait a minute before access my repro I will upload the actual state soon 12:58:38 tangentstorm: I get an error with your data.pop routine, it accept only two parameters instead of one ?!??? 13:00:52 that doesn't make sense :) looking... 13:01:56 stack.pop is a function ... it doesn't take any parameters 13:02:09 ups, sorry 13:02:13 stack.pop1( x ) will take the parameter 13:02:32 stack.pop2( t, n ) will get tos and nos into t and n 13:03:01 ok, have overread something :( 13:03:35 no worries :) 13:04:06 i still can't see the site from home but i got the source code through my server. downloading now 13:04:42 hmm, that is remarkable 13:05:03 seems like the IP address is not global accessible 13:05:03 do you want me to just clone your avm repo? 13:06:23 import romVDP.pas, romFont.pas, ng.pas and ng.ports.pas, this should work 13:06:39 ok 13:08:58 so sources are updated 13:09:38 VDP control must be wrapped into a word set for retro though 13:09:53 and I bet here are some errors ... somewhere 13:10:08 but it works at current 13:10:39 I'm now meditate about implementing the shape functionality 13:10:40 5,003 lines of assembly :) 13:11:36 oh, git has also merged my current JIT sources :) 13:11:52 :) 13:12:18 i look forward to reading them after this thing is over :) 13:14:58 it would help carefish if you update your repro soon so he can get reuse the VDP sources and test things out 13:15:22 ok.. doing now 13:15:45 you guys actually all have write access to everything already, btw 13:16:00 but i'll do this one. hang on. 13:20:34 crc: I was free to reserve some port addresses for an interface to a video-display processor (ports 9-20) 13:20:56 okay, so this was my take on their 'fixed sight' idea 13:21:36 you have a 2d array, array[8][sort-ofvariablelengthbecauseitholdswhatneedstoberendered] 13:21:45 crc: by the way how can I access ports from retro without compiling ngaro instructions ? 13:21:47 and the first array, the 8, are the directions 13:22:14 so you simply cycle through those and each holds all the sprites needed, and will be updated if the level changes/room changes 13:22:26 ok 13:22:34 that's simple 13:22:58 i have no idea how to show images on the screen using pascal to show this concept 13:23:03 googling now though :p 13:23:28 take a look at my sources in the file: romVDP.pas 13:24:19 SDL is a very basic library so you must program some routines for plotting graphic data to screen 13:24:42 don't worry about double buffering etc, this is handled already 13:25:17 i use SDL in C++ :o does sdl have pascal bindings? 13:25:55 yes 13:26:23 there should already be installed with fpc 13:26:39 and it's a 'simple' uses clause? 13:26:41 i need a few minutes here... i need to merge the changes 13:26:52 carefish: google freepascal meets sdl 13:27:01 right just: use SDL; 13:27:04 that's it 13:27:27 http://img.is1337.eu/a78ad6d3.png 13:27:29 ^ like that? 13:28:07 ouch. my eyes bleed from that website, not only that i feel like ive travelled back in time 13:28:25 yes. (pascal have a real module concept, you can compile each unit independent and don' need to worry about library paths) 13:29:05 oh, I feel familiar because learned programming with UCSD pascal in school 13:29:06 yeah, and you can delete all that cthreads stuff 13:29:53 (ok, a this time my main language was already 6502 assembly and basic) 13:29:59 ^at 13:30:00 this is amazing 13:30:13 i knew it was worth it to learn SDL instead of SFML/allegro 13:30:35 I have some bad experiences with allegro 13:31:00 not with the library per se but with its building 13:32:56 well, when i decided to never ever touch AS3 again, i did some research on what to pick next: C# XNA and C++/SDL w/ opengl came out of that research 13:34:07 I think functional programming is important in future because of the trend to multicore envirionments 13:34:35 what does ^ mean in pascal? 13:34:53 well, i don't study comp sci or stuff like that 13:35:10 so I'm working on a functional retro dialect which autoparallelisation support 13:35:18 pointer^ dereferences the pointer 13:35:29 i'm on a gamedevelopment course that only cares about a finished product.. so i barely know anything about programming and what i do know is what i've taught myself :P 13:35:34 it's also used to mean control when talking about the characters... ^A, ^B, ^C.. 13:35:44 yeah tangentstorm, the second i asked that question i realized what it must've meant 13:36:16 the pSDL stuff was ovbious: create an SDL_SURFACE that holds a pointer 13:37:19 the := is weird to get used to 13:38:04 not really, it is simple the mathematic standart notation 13:38:40 (no one teaches at school) 13:39:57 haha, i don't get linear algebra/algebra/whatever 13:40:08 they don't teach me that at school i mean, it's a community college 13:40:29 so most things that i know about vector math is also selftaught :P 13:40:39 by the way UPN notation was used in Poland as alternative to it and partly in Germany 13:41:24 what is the status of a community college ? 13:41:40 not university 13:41:42 not college 13:41:46 uhh 13:42:07 you have school for 5 ~ 12 y/o, from 12 to 16, and from 16 to 27 13:42:33 i'm in the latter, because the educational system fucked me over and i didn't get any degrees/diploma's on the 12 to 16 school :P 13:42:46 (don't know the proper terminology for school systems in my country in english) 13:43:25 where do you live ? 13:44:18 the short version: middleschool/highschool they (the gov't) changed the requirements to be allowed to the the final exam, and i was in my last year that year, so i couldn't do the final exam because i didn't fit the requirements (as did all of my other classmates) 13:44:23 Netherlands, Amsterdam 13:45:37 h, het land aan de Noordzee 13:46:42 ja, dat land ja 13:47:12 Mijn zus spreekt Nederduits 13:48:10 Ah, dan ken je 't fenomeen MBO wel, ik zit nu vast op een kut MBO school die geen wiskunde B/wiskunde at all geeft, ook geen programmeer lessen op een paar trucjes in Flash na, dus moet ik meeste mezelf aanleren xD 13:48:25 also, i'm having fun with pascal.. i think i'll keep on using it on the side :) 13:48:37 good :) 13:49:10 du sprecht Deutsch? 13:49:20 ich spreche ein bisschen Deutsch haha 13:49:33 (not nederduits though.) 13:50:04 I'm german but living in a multi-language family 13:51:34 mat2 : you sure those are the only files you changed? 13:51:51 have you problems compiling retro ? 13:51:56 otherwise I'm sure 13:51:58 :) 13:52:08 no problems compiling, but it doesn't work when i run it 13:52:15 uh ok 13:52:26 ah, that's cool Mat2-speed-codin :) i've always loved languages, i can speak a few 13:52:37 i hand merged your changes.. maybe i missed something 13:52:53 dutch/english/hebrew/german (i used to be quite good at german too... although haven't used it actively in years) 13:53:43 most germans can understand dutch more or less, it's not a so different language 13:54:13 amgentstorm: I take a look 13:55:44 hang on i skipped something 13:56:27 http://img.is1337.eu/8d2f2d7b.png ? what am i doing wrong? 13:57:06 the const directive: 13:57:16 look at the first definaion and hen the others 13:57:22 ^definations 13:57:43 you must define a constant with CONST name = 13:57:48 a variable with 13:57:58 VAR name: 13:58:08 sorry CONS name = ; 13:58:35 so write: 13:58:48 CONST totalsprites = 256; 13:59:05 VAR direction ... 13:59:41 hm, i'm getting debugger error messages 14:00:04 what errors ? 14:00:11 http://img.is1337.eu/233f689d.png 14:01:06 your code seems to compile but without debug informations. This couses the debugger to crash 14:01:18 that's a bummer 14:03:37 ok! 14:03:55 so retro starts ? 14:04:05 carefish: git submodule update ; ./build.bat 14:04:16 hmm, even when copy/pasta'ing the example from sdl meets pascal, and making sure the director for the image existed... it still won't run 14:04:27 LOLO 14:04:35 yep. with nice green letters on purple background. just like barney and friends :) 14:04:36 it didn't place sdl.dll in the proper place 14:04:50 well, place being: i should've placed it there 14:05:28 ahh.. yeah' that sdl thing is annoying on windows. dll management is really clunky in fpc on windows 14:05:30 that wa the problem 14:06:01 corefish: sorry I don't have a Windows system for testing but bet that is one example of the feared DLL hell 14:06:07 yeah, that's why i used static sdl libs 14:06:24 im gonna have fun w/ pascal 14:06:30 loving this ludum dare already :D 14:06:35 carefish: from the command line, fpc -gl adds the debug trace 14:06:48 :) 14:07:19 can i enable that so lazarus does that by default? 14:07:26 you should try to copy all DLL's into the home directory of Lazarus (where ever this directory exist) 14:07:45 yes, just edit the compiler flags 14:08:07 for your project 14:08:11 carefish: yeah, under project options 14:09:57 carefish: the best place for DLL's is the WINDOOF, sorry WINDOWS directory (or it's virtual representation under Win Vista+7) 14:10:26 Mat2-speed-codin: i disagree with that :) i always provide the proper .dlls in the .exe's working dir 14:10:39 to be absolutely sure it works on every windows pc 14:11:36 although i like my current solution alot more: statically linked, so all i have to give is a .exe :) 14:12:46 and my lil' bro is awesome, just came home w/ a bag o' grass :D 14:12:54 that don' work for some librarys like OpenGL drivers of some prominent cpu coorporaions because there had embedded a fixed pah into there libarary files 14:13:05 ^corporaions 14:13:30 or cooporations, or corporations ??? 14:13:33 however 14:14:18 how to do a bit of OOPness in pascal? 14:14:27 corporations 14:14:39 TYPE tName = OBJECT 14:14:47 and for OpenGL it's fine to statically link SDL 14:14:53 ... 14:15:03 14:15:06 END; 14:15:06 same for DirectX, haven't tried dx10/11 though. 14:15:54 as written, some drivers have hardcoded a path 14:16:18 oh :o haven't encountered that so far 14:16:53 that's one reason for the so called DLL hell 14:17:16 yeah, i did have some issues w/ dll's a few months back 14:17:24 but that was trying to mix static/shared libs 14:17:39 back then i didn't know it wasn't possible, and got errors all over the place 14:18:00 specially old drivers which are needed for some obscure applications suffered from this behaviour 14:19:12 thanks again for introducing me to pascal haha 14:19:22 it's funny how much easier pascal is compared to C++ 14:19:34 specially Delphi 14:20:21 which is used heavily in Germany for game development (in it's NET variant) 14:21:18 i'll have a look after ld25 14:21:29 does pascal have linked lists? or do i need to make my own? 14:21:57 I think there exist a good class in the library for that 14:22:25 but linked lists are very easy to implement in pascal 14:22:59 TYPE pList = ^tList 14:23:09 tList = RECORD 14:23:34 priour: ^tList; 14:23:45 sorry 14:23:59 priour: pList; 14:24:04 next: pList; 14:24:21 cell: 14:24:24 END; 14:24:38 lib/xpl/ll.pas has a fully generic linked list 14:24:42 do you have a sample file w/ some OOPness? 14:24:44 that works exactly that way 14:25:06 great! i'll browse around for samples in the ld25 dir 14:25:10 whoops lib/xpl/code/ll.pas 14:26:11 some of what you'll find is code i wrote as a 16-year old. but i've been working slowly to bring it up to date 14:26:41 haha, how old are you now? i'm 23 years old :P 14:26:51 tangentstorm: I have found the reason for the colour clash, it's just that I forgot to remap the colour values to the hardware dependent RGB values 14:27:20 <- 36 14:27:32 haha 14:27:45 so you've been programming for 20+ years? 14:28:10 i started w/ C++ about 6-ish months ago, C# about a year ago 14:29:15 I've started as teenager with basic and assembly 14:30:14 but soon I've converted to forth :D 14:30:54 (and later lisp) 14:31:28 and my school taught me the basics of AS3, which got me curious about other languages and when i popped a few veins due to debugging hell with as3 i switched to C#/C++ :P 14:32:26 there teach Actionscript ??? 14:32:43 the course used to be called Game Artist 14:33:14 which split up into: Game Artist / Media Development, and now they're going to split up Media Development into Webdev and gamedev 14:33:32 that's the ruin of civiliation 14:34:46 thanks tangentstorm, ll.pas shows a bit of OOPness i can use to learn from 14:35:03 well, more like structure 14:35:05 but it's okay 14:37:23 what's the difference between procedure and function? they seemingly do the same 14:37:57 a function return a value (or pointer, or reference) o a caller 14:38:20 ah yeah, now i see 14:38:25 function list.is_empty : boolean; 14:38:30 procedure list.drop; 14:38:35 shouldve seen that one 14:38:55 so procedure is a void ? 14:39:42 yes, because in C all routine definations are functions 14:40:50 the differentiation into procedures and functions is useful, because the compiler can optimizate the calling overhead away without problems for most procedures 14:41:10 and to add ll.pas to uses, i would need to do what? USES ll; ? 14:41:50 is ll.pas a unit ? 14:41:54 optimize btw ;) 14:42:02 how can i know if it is? 14:42:06 thanks 14:42:10 it says so at top of the file 14:42:28 unit ll; { linked list support } 14:42:28 interface uses xpc; 14:43:06 ok, then you can compile it (fpc ll.pas) and afer that you have a automatical registered library which can be inluded with USES 14:43:28 so just write USES ..., ll; 14:43:51 i don't need to place the resulting binary in my project dir? 14:43:57 no 14:44:22 ok, I don't know he behaviour in Windows 14:45:21 the compiler must only know the path to your binary somehow 14:45:51 http://img.is1337.eu/99f01160.png 14:46:09 i'll just place it in lazarus's folder 14:46:39 C:\FPC\lazarus\fpc\2.6.0\units\i386-win32 14:46:45 there is where i'll put it 14:47:45 please paste line 20-26 of your ll.pas file 14:48:12 public 14:48:12 constructor create( lis : tlist ); 14:48:12 function movenext : boolean; 14:48:12 property current : T read _value; 14:48:12 end; 14:48:12 listaction = procedure( var n : T ); 14:48:12 predicate = function( n : T ) : Boolean; 14:49:55 ok, paste the whole code for the object defination 14:50:50 the error seem to be these public statement 14:51:39 ah ok, you have a public constructor 14:51:48 carefish: the very first line in a pascal file is either "unit", "library" (for making dll's) or "program" 14:52:09 it's not my code :) it's tangentstorm's code 14:52:51 .... 14:53:08 somehow it's conflicting with tlist from the classes unit, but that shouldn't be in scope 14:53:19 my bad. 14:53:24 i could be doing something wrong too though 14:53:43 just search and replace tlist and change it to "ts" or something 14:53:58 hmmm... 14:54:43 replaced all tlist w/ ts 14:54:46 still same error 14:54:52 hang on 14:55:07 and thanks for the crash course pascal :P 14:57:26 it's the illegal expression that's causing the problem. 15:00:30 carefish: okay... so that ts is specializing list but it's also /inside/ list 15:00:41 turns out this is not supported by fpc 2.6.0 15:00:49 i'm using the fpc trunk 15:00:56 2.7.1 15:01:16 can i still use it then when it's compiled using 2.7.1? 15:01:22 so... you can either compile the trunk ( which is easy but annoying ) 15:01:49 or you can use TList from the classes unit ( which is not generic, so you'll have to explicitly cast everything back from TObject ) 15:02:23 if you like this pascal stuff: check out the compiler and just compile the latest version 15:02:35 ( you use 2.6.0 to compile 2.7.1 ) 15:02:52 ( fpc is written in itself ) 15:03:05 the same as retro :D 15:04:08 oh, how does that work? 'written in itself'? 15:04:46 carefish: the fpc team uses svn , but there's an actively maintained git mirror here if you prefer: https://github.com/graemeg/freepascal 15:05:11 like i just said: each stable version of the compiler is used to compile the source for the next version :) 15:05:22 i suppose originally it was written in turbo pascal or delphi 15:05:43 tangentstorm: can you please pack a zip file with your win32 retro build (and all needed libraries) so I can test out SDL for these os ? 15:06:06 nice :) 15:10:08 Mat2-speed-codin: sure thing... i'm afk for a bit but will do so as soon as i get back. 15:10:13 --- nick: tangentstorm -> tangentaway 15:13:09 back in a half hour 15:13:15 --- nick: Mat2-speed-codin -> Mat2-afk 15:20:53 so it's perfectly possible to create dll's to be used by C++ code inpascal? 15:29:05 (and vice versa?) 16:33:06 --- nick: tangentaway -> tangentstorm 16:33:21 carefish: yep 16:33:46 one of the first things i tried was packaging up a python module in pascal. worked like a charm. 16:40:28 carefish: did the graphical retro terminal build for you? 16:42:45 --- nick: Mat2-afk -> Mat2 16:43:27 I get some sleep 16:43:34 see you 16:43:44 --- quit: Mat2 (Quit: Verlassend) 16:46:55 seeya 16:47:11 wait.. mat2 : did you check your code in? 16:47:19 oh he's gone :/ 16:49:28 and didn't check the code in... 16:50:53 well maybe the latest version is what's already in ng_ports.pas ... we'll work from there. 16:58:16 ------------------ 16:58:42 hey guys... intothev01d's helping out with getting the sped-up js version of ngaro under test here 16:59:43 intothev01d: https://github.com/tangentstorm/ngaro-js/blob/master/src/ngaro.js#L663 16:59:50 this is the main routine that we need to expose 16:59:58 processOpcode() 17:00:05 well... 17:00:18 that's the main routine, but it only does one opcode 17:00:45 by default javascript shares a thread with the browser, unless we use these new html5 web worker things 17:01:08 without those, you have to break the processing down into little chunks 17:01:25 or else it'll lock up the whole browser :/ 17:02:08 so it also now needs to run those functions on a separate thread then huh 17:02:24 https://github.com/tangentstorm/ngaro-js/blob/master/src/ngaro.js#L924 17:02:34 rxProcessImage() is scheduled to run periodically 17:02:58 the WAITING state means that ngaro is waiting for you to do something (press a key, etc) 17:03:02 so there's nothing to process 17:03:32 the RUNNING means that the previous instance hasn't finished... i suppose in a single-thread environment that shouldn't ever actualy happen 17:04:10 but if either of those things are true, it exits, and otherwise it runs for however many cycles are defined in the "cycles" constant 17:04:42 so it's actually this rxProcessImage that we need to expose 17:05:24 [ we're talking about wrapping up ngaro.js as a module so we can "require" it from a command-line oriented retro.js file to be run from node ] 17:05:33 so then from my understanding you would add like exports.rxProcessImage and then require it in the server.. I think 17:05:44 yep 17:05:54 but server's not a good word for whatever it is :) 17:06:21 the... repl? listener? 17:06:55 app? :) i don't know 17:07:28 i just meant currently you run node server.js to get it going so that is where you would have to put the required modules and call them it seems 17:08:06 no, forget about server.js :) 17:08:14 that's *only* there to be a web server 17:08:15 k. forgotten 17:08:59 so you would run node app.js that would then require elements from ngaro.js and retro.js 17:09:19 well i was actually thinging retro.js would be the app 17:09:22 and then you can pass in arguments via that 17:09:25 oh ok 17:09:26 because we have retro.c, retro.py, etc 17:09:42 so it just needs to access some elements of ngaro.js 17:09:45 or all? 17:09:58 the idea is you should be able to ssh in to a machine that has node on it and run ./retro.js and it'll run and say "Retro 11.5 ok" 17:10:10 and then you'd be able to type just like anything else 17:10:14 like any of the others i mean 17:10:28 ah ok 17:10:29 i see 17:10:49 it needs the core vm, and then at the end, it needs to be able to do the dup f 17:10:55 to do the state dump 17:11:08 which requires access to data, address, and image 17:11:31 although it's totally fine to put the dump routine inside the module and just expose that 17:11:55 intothev01d: do you know what a singleton is? 17:12:06 eh sort of 17:12:07 like in object oriented programming terms 17:12:19 it just means that there's only one instance of the class ever 17:12:19 yea only one instance can be created throughout basically right? 17:12:24 yeah exactly 17:12:47 so in languages that have modules, they perform some of the same functions as singletons 17:13:09 they encapsulate state and hide information just like an object 17:13:27 oh ok 17:13:31 but there's only one of them... and no constructor so you can't make any more 17:14:17 so it would be good design to only expose three "methods" (functions) from the module for what we're doing: 17:15:04 setImage( img:array of int ); // though just making "image" public is fine too 17:15:28 rxRunImage() 17:15:49 and rxDump() : string 17:16:00 rxDumpState() maybe 17:16:35 so then you'd say var ngaro = require("ngaro.js"); or whatever 17:16:42 and you'd have those three methods 17:17:12 so from the test runner / command line point of view that's all we need 17:18:03 well to actually run the prompt we'll need to make a new device like ngterm but for the console, but that's not important right now 17:18:33 the tests *only* look at the opcodes 17:18:41 and the effects on the stack 17:19:10 nice 17:19:30 the tests for retro itself cover the ports, but i already know the ports work because i haven't changed them :D 17:19:36 I'll try to get that running then 17:20:02 do you want me to take one side of the interface and you do the other? 17:20:37 ( just an offer. if not, i'll go work on something else here... ) 17:23:38 well i think i can work on the exports part of it and getting it to run in command line as a node app or whatever. if I get stuck I'll let you know 17:24:17 but I'll start on it in a few. gtg but I'll be back 17:52:28 awesome! just finished watchin' a movie, back to readin 'bout pascal 18:00:07 still looking at your linked list tangentstorm, so if i understand correctly, you first type out what it's supposed to do, and then later on you can fill them in, sort-of like C++ header/cpp? 18:01:09 anything below implementation is 'actual' code? 18:01:30 carefish: yeah exactly... except it's usually in one file, with the INTERFACE section at the top, followed by the IMPLEMENTATION 18:01:39 yeah, i saw that 18:01:41 that's neat 18:01:49 you can also have an INITIALIZATION if there's stuff to set up when the module first loads 18:02:06 and also FINALIZATION 18:02:06 got one in the xpl folder? 18:02:12 like, where you use that? 18:02:26 probably i would have called it BEGIN 18:02:43 oh.. you can redefine keywords? 18:02:49 no, but before they added finalization it was just begin 18:02:56 ooh 18:03:19 and if you leave it empty? 18:03:22 i learned this language in 1992... and it's evolved considerably... a lot of my code is out of date 18:03:26 seems that loadImage in ngaro.js doesn't take arguments? https://github.com/intothev01d/ngaro-js/blob/master/src/ngaro.js#L554 18:03:29 like, in ll.pas i see initialization 18:03:29 end. 18:03:46 does that tell pascal to init it right away when used? 18:04:02 intothev01d: oh that's for loading from a browser's local cache 18:04:13 alright, is there one to pass to? 18:04:29 nope. 18:04:32 rxLoadCleanImage below it maybe? 18:04:36 it takes a url ... 18:04:40 ... 18:04:56 yeah but it's going to want to do an http request... 18:05:11 so i need to make one for process.argv that will take the arguments and load it 18:05:11 what i was picturing was really more like setImage(img) 18:05:32 carefish: it doesn't do anything. you have to actually put code in there to run something. 18:05:39 brb, gonna grab a bite to eat 18:06:08 ah, nice, do you happen to have a good tutorial website about pascal? so i needn't to bother asking stuff :P 18:06:46 intothev01d: well, probably it would just be better to have all the filesystem-related stuff in retro.js... and then we should move the web-specific stuff out to its own file too 18:07:03 there is a pdf that seems nice... i've not read all of it 18:07:04 hang on 18:07:15 but also i don't mind you asking questions :) 18:07:29 i really wish i had found out about pascal earlier 18:07:38 seems like a fun language 18:07:42 like C# 18:07:48 well, not at all like it obviously 18:07:57 http://freepascalanswers.wordpress.com/2012/09/02/freepascallazarus-book-startprog/ 18:08:18 it's got a lot of nice things in it... like the SET type. 18:08:19 but i have lots of fun with C# too, nice and easy (also having fun with C++, but that tends to give a headache or two once in a while) 18:08:32 also, btw... i read the scrollback.. for your linked list... you don't actually need a linked list. 18:08:43 you can use a variable sized array for what you want to do 18:09:00 just say var x : array of int; and then you can use setlength( x, 100 ) or whatever you want. 18:09:06 oh, how do i do that? 18:09:10 oh wow 18:09:22 nice :) 18:09:39 can i have the first element be of an int/char/not an image? 18:10:08 everything in an arry has to be the same type 18:10:15 but you can make a record with an array inside of it 18:10:16 wanted to use the first index (or the last, doesn't matter that much) to determine what view the player is currently seeing 18:10:59 type direction = ( NN, NE, NW, WW, SW, SS, SE, EE, NE ); 18:11:18 like: direction[0][0] through [0][whatever] with 0 being N/1 being NW/etc 18:11:41 type whatyouwant = array[ direction ] of whatever; 18:12:00 then you can say 18:12:04 array[ NW ] = .... 18:12:08 well 18:12:17 stuff : whatyouwant; 18:12:21 = anotherarrayholdingthesprites 18:12:23 stuff[ NW ] = ... 18:12:44 yeah so you want array[ direction ] of array of sprites; 18:12:50 yeah 18:12:59 sprite; 18:13:06 haha, yeah 18:13:36 you'd call the type sprite (or "TSprite" if you like the borland convention, which dominates the pascal world now) 18:13:49 i learned on the version of pascal right before they introduced it and i don't like it :) 18:13:55 would it be wise to learn such a convention when starting out? 18:14:02 btw, if you didn't notice already, pascal is case-insensitive 18:14:11 like, i like the idea behind the hungarian notation 18:14:18 but the practical use nowadays is kinda moot 18:14:45 i've got intellisense telling me what the var is, and if it's unclear due to weird casting stuff i'm probably doing it wrong 18:14:53 well, *because* pascal is case-insensitive, you sometimes have to use prefixes or whatever to distinguish two things when you'd use capitalization in java or c# 18:15:02 ah :) 18:15:13 so, for example 18:15:54 type direction = ( NN, NE, NW, WW, SW, SS, SE, EE, NE ); type sprite = ( direction array of sprite ); 18:16:26 the ( ) indicates an enumerated type, so you use it on the direction type. 18:16:29 ehh, array[direction] of sprite; 18:16:33 yes 18:16:37 no 18:16:43 you can't say sprite = array of sprite 18:16:49 you have to name it something else 18:16:56 ooh, so i'd need to define sprite first? 18:17:05 yes 18:17:30 type direction = ( NN, NE, NW, WW, SW, SS, SE, EE, NE ); type spriteDirections = ( array[direction] of sprite ); type sprite = ( SDLBITMAPwhatever ); 18:18:31 probably have sprite hold a pos vec and vel vec too, along with possible paralax code 18:18:33 how about "scene" for spriteDirections? 18:19:08 and you ONLY use the parentheses on the direction one 18:19:09 was going to have it say: player.lookat(spritedirections[NN]); 18:19:35 well, right now you're just defining a type 18:19:48 in your example code there it would be a variable that's an instance of that type 18:20:16 you can use NN directly because that's a number just like 2 or $AF or whatever 18:20:18 oh.. so it's still normal array iteration? 18:20:44 spriteDirections[0] would hold all kinds of direction? 18:21:17 if you say VAR dir : spriteDirections ; 18:21:28 then you'll have an array with 8 elements 18:21:53 but instead of dir[ 0 ] you would say dir[ SW ] 18:22:08 or NN or NE? 18:22:11 0 would give you a type error 18:22:12 yes 18:22:14 like, wouldn't matter? 18:22:21 as long as it's of type direction ? 18:22:29 the full syntax would be 18:22:39 array[ NN .. NE ] of xxx 18:22:50 aaah 18:22:51 now i see 18:22:53 if you wanted 256 you could say 18:22:56 that makes sense 18:22:57 array[ byte ] of xxx 18:23:02 or array[ char ] of xxx 18:23:20 array[ 'a' ...'z' ] 18:23:21 etc 18:23:32 that's really cool 18:23:36 has to be a simple type though with fixed boundaries. can't be a string or anything 18:23:46 'a'..'z' to be syntactically correct? 18:24:08 you can make types like that, and you can override the [ ] operator for indexing though, so you can get python-like syntax 18:24:24 yes, i added one too many '.' :) 18:24:33 :D i'd love to have python's way of dealing w/ strings in pascal 18:24:49 varname[6:] 18:24:57 you can do that 18:25:04 cuts off first 6 (or last, been too long since i've done python) 18:25:07 varname[0..5] 18:25:09 i loved that 18:25:17 not quite the same, but you can get the same effect 18:25:20 awesome! :D 18:25:28 i'll have a blast w/ pascal 18:25:34 yeah, it's cool :) 18:25:59 also when you say ch : char ..... if ch in 'a'..'z' then whatever... 18:26:10 'a'..'z' will be treated as a set 18:26:25 so it doesn't do ch >= 'a' AND ch <='z' 18:27:10 it does: 1 SHL ord(ch) AND some long constant where the a'th through z'th bits are set to 1 18:27:31 meaning it turns it into a bitmask 18:28:02 you can say d : direction; IF d IN [ N, S, E, W ] THEN... 18:28:23 that's easier to see because it'll just use a single 32-bit cell in the cpu. 18:28:44 whereas with the char type you need 256 characters, and it may not actually be as efficient 18:28:46 so like 18:28:51 so to store pSDL_SURFACES in the direction stuff: type sprite = ( pSDL_SURFACE ) type direction = ( NN, NE, NW, WW, SW, SS, SE, EE, NE ) type spriteDirections = ( array[NN..NE] of sprite ); 18:29:23 1 SHL ord(ch) < wut? 18:29:25 type sprite = PSDL_SURFACE; direction = ( ... ); spriteDIrections = array[direction] of sprite; 18:29:46 ah, ( ) denote enums when used with type? 18:29:48 yes 18:29:53 otherwise it's a syntax error 18:30:01 and... you don't have to keep saying type over and over 18:30:17 and to add more to sprite? 18:30:45 type sprite = record x, y : int32; img : psdl_surface end; 18:30:45 type sprite = PSDL_SURFACE, vector, vector ? 18:30:49 ah 18:30:51 awesome 18:30:52 or class 18:31:02 what's the difference between record and class? 18:31:07 record is like struct? 18:31:22 mostly yeah 18:31:46 struct and also union, but with cleaner rules 18:32:18 and you can have a file of a record type and just read and write them directly, which is handy... so they're fixed width 18:32:31 i barely know what a union is, also don't know alot about struct.. tend to use 'class' in C#/C++ 18:33:00 just use class everywhere, and you'll be fine :) 18:33:01 ahh, that's why you sometimes use structs 18:33:13 no need for proper instantiation? 18:33:18 right 18:33:19 proper being actually 'new'ing it 18:33:24 right 18:33:31 awesome :D 18:33:44 so a vector (math vector) should be a struct? 18:33:52 no it should be an array 18:34:20 oh, w/ 3 (or 4 if you're into vector4) elements? 18:34:37 yeah 18:34:38 and then use the same trick as with the directions 18:35:08 so you could have, for funsies, a vector[x][x][x]? 18:35:15 ehh 18:35:24 array of array of array of whatever. 18:35:34 well, that wasn't what i meant 18:35:45 vector[1..4] 18:36:07 array[ 1..5 ] of array[ -5..10 ] of array[ 12 .. 15 ] of char; 18:36:12 no 18:36:37 only string and array can have dimensions, as far as i know 18:37:02 i'm really liking what i'm reading 18:37:32 gonna read a bit more about pascal, specifically look at how to write the syntax, and i'll get going w/ the sprites 18:37:38 yeah, it's pretty clean and mathematical, and lets you think about your algorithm rather than the computer 18:37:49 but you can actually also add asm blocks with pure assembly language 18:38:20 if you don't mind, i'm going to implement some simple routines to show the surfaces 18:38:27 go ahead 18:38:33 but i well leave the directional stuff to you 18:38:40 i just want to get something on the screen :) 18:38:49 cool 18:38:55 i'll just make it when i think i understand the syntax well enough 18:39:18 ok :) 18:39:34 feel free to post work in progress to pastebin or gist or something if you want some help 18:39:41 sure :) 18:40:52 --- join: intothev01d_m (~intothev0@unaffiliated/intothev01d) joined #retro 18:42:21 oh wow, if/else is so easy to read :D 18:44:00 a float in C++ is a Single in pascal? 18:44:24 ... 18:44:42 erm 18:44:48 maybe? :) 18:44:55 so.. retro has no floating point numbers 18:45:15 forth in general uses fixedpoint. 18:46:06 back in my day we used the type "real" which *should* be a floating point number at your processor's native size just like integer should be and cardinal should be 18:46:21 but freepascal is delphi-compatible, and delphi is tp compatible and tp was 16 bits 18:46:29 so... 18:46:33 that's all i know :) 18:47:06 ususally if you use the word "freepascal whatever" in google, you can find the right page in the docs or the wiki though 19:01:08 oh so that's what the T is for, so you know it's not a variable 19:01:36 so there isn't an IDE that tells you what it is if your cursor hovers over it? (text cursor or mouse pointer) 19:04:43 carefish: lazarus has a bunch of code analysis tools but the user interface doesn't really expose them like that :/ 19:08:19 aww, that's too bad :( 19:12:18 agreed. i'm kind of working up to making an IDE that does that kind of stuff, probably as a semi-commercial product 19:12:34 lazarus is cool but i make games and web pages, not GUI apps. 19:13:24 also i want something that's more aimed at personal computing... things you would do as a hobbyist or in your own small business or something 19:13:35 or in a classroom 19:14:21 that's what the compiler is all about 19:14:48 i'm making a language that cleans up some of the junk that's accumulated in delphi and borrows some nice stuff from python and haskell and prolog and smalltalk 19:15:09 and of course retro :) 19:16:06 and between the portability of retro/ngaro and free pascal itself, it'll run pretty close to everywhere. :) 19:30:45 hey tangentstorm, so I have the node module thing working with a simple hello world. I'm going to push it so you can see what I'm thinking about for the rest of the functions 19:30:55 ok 19:36:24 https://github.com/intothev01d/ngaro-js 19:36:29 that's my fork 19:36:58 anyway, i just put a function at the top and then call it in retro.js once it's been set up as a module. I think I should be able to do that with any of the other functions as well 19:37:30 that way you can just run "node retro.js" like you were talking about and have it do whatever 19:37:56 that works for me 19:38:17 but for the functions that already exist, just put exports.rxWhatever = rxWhatever 19:38:23 yea 19:38:32 wait... 19:38:35 does that compile? 19:38:45 ? 19:38:46 exports.hello = function.hello() { } 19:38:47 + 19:38:49 ? 19:39:00 er function hello() i mean 19:39:02 it worked 19:39:06 !! 19:39:36 it's not function.hello 19:39:43 it's function hello() 19:39:45 yeah 19:39:55 i didn't know you could use a named function that way 19:39:57 cool 19:40:06 yea i didn't either :D 19:40:09 I just tried it 19:40:09 in that case, as long as it works in the browser, go for it 19:40:22 --- quit: carefish (Ping timeout: 252 seconds) 19:40:34 well i don't know about browser, all that does is make it print hello in the console 19:40:42 like you said about ssh and all and not using the server 19:40:47 right 19:40:49 hmm 19:41:37 well... no big deal if it doesn't work. 19:41:47 in the browser? 19:41:50 or in general 19:41:51 lol 19:41:54 we can always just break it into 2 statements if the browsers complain i mean 19:42:16 function hello(){ } ; exports.hello = hello; 19:42:18 hmm 19:42:40 that might be the correct way there, put them at the bottom like that? 19:43:00 I've seem them do it inline as well with the function, just not with a named function 19:43:09 yeah 19:43:11 so like exports.hello = function() {} 19:43:16 right 19:44:06 well, how about put it at the bottom for now, since we know that works, and then if/when we find out the way die hard javascripters do it, we'll do what they do :) 19:44:35 yea i think that might be the best way anyway 19:45:01 also in the browser, there won't be an "exports" 19:45:06 so it'll raise an error 19:45:17 so you need a test like on line 6 19:45:55 you could say if (typeof exports == "undefined") { exports = {}; } or something 19:46:16 new Object(); if you prefer... pretty sure that's the same thing 19:46:26 exports = new Object(); i mean 19:46:43 then it would just be silently ignored 19:46:46 so at the top just do exports = new Object(); so it won't throw errors 19:47:03 yeah but only if it's not already defined 19:47:35 either that or we make the browser side use modules too :) 19:48:07 but that's scope creep, so let's just ignore it for now and use the dummy object :) 19:48:30 sounds good 19:49:16 thanks for doing this, btw :) 19:50:25 np. i don't know if I'm doing it right or can get it working but I'll try 19:51:33 so i need to create a setImage, then expose the existing ProcessImage, then make a imageDump right? 19:51:44 yep 19:52:44 it might be easier just to create those two functions to do nothing or set the image to [] for starters 19:53:01 then you can focus just on retro.js and not worry about the ngaro internals yet 19:53:29 hopefully you'll get 30 failing tests 19:55:08 where would they go in the current ngaro.js code? 19:55:12 line #'s 19:55:24 I'll just put them in as placeholders like you said 19:57:51 intothev01d_m: doesn't matter to me 19:57:57 k 19:58:26 there is some amount of logic to the layout though... maybe with the other loaders? 19:58:49 i say it doesn't really matter because i probably *will* break this into modules later and so it'll all get re-arranged :) 20:01:48 so I'm looking at retro.py. Am I porting all of that over to retro.js? 20:04:04 sorry, still a bit confused as to what the role of retro.js is 20:10:15 ok :) 20:10:23 one sec 20:11:51 ok so if you look under http://bazaar.launchpad.net/~crc-x/retro-language/retro/files/head:/vm/ 20:12:06 ( or in github or whatever .. .they're all mostly in sync ) 20:12:18 you'll see there are a BUNCH of implementations of retro/ngaro 20:12:25 they all do pretty much the same thing 20:13:03 under complete/ you can see it implemented in go, lisp, several versions in c, c#, f#, php, py, ruby, retro itself, and scheme 20:13:29 under embedded, there are implementations for microcontrollers like arduino or rasberry pi or whatever 20:13:41 the original js one lives under web 20:13:48 gotcha 20:14:06 experimental has like a bunch of variations on the complete ones... sockets, sdl, etc 20:14:24 partial has whatver fs is... 20:14:42 looks like some kind of forth dialectß 20:14:58 java, lua, perl, scheme 20:15:05 i guess the .s file i called scheme was actually assembly 20:15:24 anyway.... who knows if these things all actually work the same way? 20:15:32 they're all made by different people 20:15:40 lol 20:15:52 and like... we figured out that one of the opcodes ( WAIT ) is redundant 20:16:00 at least... it appears to be 20:16:08 IN and OUT are sufficient for what it does 20:16:25 so it would be nice to actually drop it from all the machines, provided it doesn't break them 20:16:50 you can't make sweeping changes like that in a project without test coverage 20:17:06 now there's a test suite inside retro itself 20:17:16 but if your vm's messed up you can't trust retro :) 20:17:41 so... 20:18:04 to augment the tests in retro, i wrote that python file which tests the vm itself 20:18:22 so... the role of retro.js is to do what all the other retro.xxx does, but in javascript 20:19:02 which has the nice benefit of porting retro to node and rhino and all the various web browsers, and every app that runs javascript everywhere :) 20:19:11 yea 20:19:20 so that's the point of ngaro.js 20:19:54 and so retro just handles the interface between the user and the vm? 20:20:06 i'm almost positive i broke something in it while i was refactoring 20:20:07 plust it's higher level language too right? 20:20:12 yeah 20:20:46 retro is both the repl (the ok prompt) and the set of words that have been predefined 20:21:25 i really don't have an easy way to explain what forth is... you just have to play with it and you'll see it 20:21:30 retro is a forth :) 20:22:13 a forth is a set of words and a loop that evaluates words as you enter them, and two stacks 20:22:27 that's pretty much it 20:23:13 gotcha 20:23:13 but... it's also enough that you can make pretty much any language you want out of it 20:23:24 it's sort of like lisp without all the syntax :) 20:23:42 interesting 20:23:44 and the order is different 20:24:14 so like if you don't like ":" you can say ": def : ;" 20:24:16 hmm 20:24:29 you may need a quoting operator in there because ":" is an immediate word 20:24:34 i'd have to experiment 20:24:44 but in principle you can rename that word 20:24:52 or make an alias or whatever 20:25:26 immediate words write stuff to ram that become part of the dictionary 20:25:37 there's no one compiler or interpreter in forth 20:25:42 but any little word can be a compiler 20:26:06 ":" is a compiler that waits for you to type the next word and then makes a new dictionary header with that name and leaves the compiler on 20:26:25 by "the compiler" i really just mean a switch in the listener 20:26:41 when it's on, what you type gets compiled to instructions immediately 20:26:51 when it's off, what you type gets executed immediately 20:27:30 but in both cases it's just looking up each word in the dictionary and then either making a call to that address or writing that address as the next instruction 20:27:50 ( in ngaro, if you enter a number above 30, it's treated as a call to a function at that address) 20:28:16 so you really have as many instructions as you have addresses 20:28:39 nice 20:28:55 and if you execute opcode 555, the instruction pointer gets pushed onto the address stack and then set to 555 20:29:50 then when you execute the RETURN instruction (written ; or ;; in forth (the shorter one also turns off the compiler)) then when that executes, it pops the old address off the address stack 20:30:20 most languages use one stack where everything is mixed together, but in forth they're separate and it makes things very simple and direct 20:31:12 you can picture the dictionary as if it were the following python structure: 20:32:04 [ ("word", "docs for word", SomeWordClass, [ instructions ]) .... ] 20:32:04 is that the idea of the seperate arrays then? for data and instructions 20:32:32 well i should clarify that... the "image" contains data too. 20:32:58 because you can define strings and constants and whatever you want 20:33:05 and that all lives in the heap 20:33:22 historically "heap" was a kind of tree structure but it has come to mean "dynamic memory" 20:34:02 meaning you can just allocate some ram for whatever you want and then it's "in the heap" 20:34:08 and thats' where the dictionary lives 20:34:30 which is what's in the retroImage file too 20:34:40 in fact that's all the image is 20:35:10 the first two cells hold 0. a JUMP instruction 2. the location of the main routine 20:35:17 er that would be cell 1 20:35:25 then 2 is a pointer to the last defined word 20:36:07 so you can look at that pointer and from there it's a linked list that you can walk to see all the words that have been publically defined 20:36:13 so what the heck does divmod actually do in python? 20:36:21 in fact that's what happens if you type "words" in retro 20:36:22 just divide numbers then mod first by second? 20:36:35 forth has no floating point numbers 20:36:51 so for division, it returns two results 20:37:18 the integer division sort of like python does (but i'm not sure if python rounds to 0 or negative infinity) 20:37:22 retro rounds toward 0 20:37:30 and then mod 20:37:38 which is the remainder 20:37:57 ( i think you were around for a long talk about modulo on lpmc a while back, right? ) 20:38:09 so that's what it's doing in the python version 20:38:22 and all the versions, hopefully :) 20:38:25 it's just moding a with b? 20:38:35 let me look at the actual code 20:38:39 ok 20:38:46 I'm looking at retro.py 20:38:57 rxDivMod function 20:39:37 help(divmod) 20:39:49 i never knew that was there :) 20:39:59 i always just used / and % :) 20:40:54 so divide a / b and then what? mod that value by b or? 20:41:14 divmod(x, y) -> (div, mod) 20:41:22 Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x. 20:41:55 the first value there (x-x%y)/y is going to be an integer 20:42:04 because x%y is the remainder 20:42:21 oh i see what it's doing now 20:42:22 so if you have 26%5 the remainder is 1 20:42:42 and 26-1/5 is going to be an integer because the remainder is removed 20:42:44 cool 20:43:15 -26/5 is -6 in python 20:43:24 but +26/5 is 5 20:43:34 so python rounds toward negative infinity 20:45:01 in retro, -26 5 /mod .s prints -1 -5 20:45:34 crc told me this is called "symmetric division" and what python does is assymmetric division 20:45:45 asymmetric 20:46:28 so that's what the extra stuff in rxDivMod is doing 20:49:39 intothev01d_m: http://bazaar.launchpad.net/~tangentstorm/retro-language/docwork/revision/399.2.3#vm/complete/retro.py 20:49:57 these are the changes i made to retro.py to implement what you're now doing for the js version 20:50:48 it's mixed in with some other stuff that's not relevant though ( like the termio stuff, which is for direct keyboard access ) 20:53:10 in that divmod function in python it returns 2 values there, how would I do that in js 20:53:32 return an array 20:53:50 but all that logic is already implemented 20:54:22 https://github.com/intothev01d/ngaro-js/blob/master/src/ngaro.js#L802 20:54:26 divmod in js 20:55:54 but since this is ngaro, instead of returning things, it adds the values to the data stack 20:57:24 i suspect the pascal version probably mis-implements this opcode, btw. the -26/5 example would be a good thing to add to the test suite. :) 21:00:29 yea 21:00:31 it would 21:01:39 okay... well, i've been at this all day, and need some sleep... hopefully tomorrow i'll actually write some code 21:02:35 alright 21:02:36 cya 21:03:15 *** Mat2 / carefish *** if you're reading the logfile : i've been looking through the sdl stuff but haven't added any code... whoever shows up first tomorrow feel free to take the lead and run with the sdl stuff. 21:03:51 i guess i have their email addresses from the doc... okay, well... will do that next time :) 21:04:04 see you guys 21:04:10 --- nick: tangentstorm -> tangentsleep 21:38:31 --- quit: intothev01d_m (Quit: intothev01d_m) 21:43:29 --- quit: intothev01d (Quit: intothev01d) 22:44:51 --- quit: kumul (Quit: WeeChat 0.3.9.2) 23:59:59 --- log: ended retro/12.12.15