Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bigsofty

Pages: 1 2 [3] 4 5 ... 20
31
Off Topic / Man builds CPU, plays Tetris
« on: 2016-Nov-18 »
This tickles my geek interest, took him two years and an amazing amount of insight into CPU design.  :nw:

https://m.youtube.com/watch?time_continue=301&v=z71h9XZbAWY&ebc=ANyPxKqSWv23XK_DPLScPLUfVpadKGbNZJjOkLcCP-hlZohvMX8WZpz2cT9Ppgmg5YGnsjFc2PD0

32
GLBasic - en / Ugh so dumb!
« on: 2016-Nov-16 »
I just wasted two hours looking for a bug. I have a sample loaded into memory when the game runs and it wasn't playing, it did earlier today. I spent the last two hours, checking and rechecking the loading, player code adding stubs etc... to no avail. Then I finally realised what the problem was. I use VLC Media Player to browse the samples and choose the ones I need. I have one paused, as I have the sample play on repeat. It also had been minimised. My game refused to play one sample(no error just silence) and I had forgotten that it was open in VLC. To cut a long story short... VLC had the file locked down for it's own use when I paused it and my app carried on regardless in blissful silence, not being able to use the sample... arg, lesson learnt!  :giveup:

33
Off Topic / Raspberry Pi Mag Back Issues Free
« on: 2016-Nov-15 »
Not sure how long this has been but last time I looked you had to purchase digital back issues of MagPi, so being able to download them for free now was a pleasant surprise.

https://www.raspberrypi.org/magpi/issues/

34
GLBasic - en / FLOOR()
« on: 2016-Nov-09 »
Undocumented? Seems to be present but not in the docs?

Handy to have all the same.  ;)

35
Akeytsu



This is a 3D animation and rigging utility. The reason I mention it is, that's its currently half-price (and is available on Steam too) and 1 month trial is available on the website. But mainly, it's so damn good at what it does. Motionbuilder is the best that you can get IMHO(but it's way too expensive!) but this is a very close second. One thing though, it deals with FBXs, so you will need a method for converting them into a usable format for GLB. I've wasted a lot of cash on various animation utilities, it's a breath of fresh air to actually recommend one.

https://www.nukeygara.com

36
Off Topic / CPC 464 Wifi
« on: 2016-Oct-18 »
I'm continuously amazed at what comes out of the CPC scene. Wifi on a CPC, internet access, rom emulation and floppy drive emulation all by one guy.  :O

http://www.spinpoint.org

37
Code Snippets / Quick code summaries
« on: 2016-Sep-15 »
I document the old fashioned way, that is, via text files.

This little program extracts the bits I document for a directory of GBAS files and writes them to a new subdir within that directory when its done.

It extracts from each GBAS file...

Constants
Globals
Global Functions
Types
Type Properties
Type Methods

Sorts them and writes them to a .TXT file.

See end for an example.

Code: (glbasic) [Select]
// --------------------------------- //
// Project: GLBDocumenter
// Start: Wednesday, August 24, 2016
// IDE Version: 14.371


GLOBAL dir$ = "C:/Coding Folder/Projects/GLBasic/plasma/" // Scan dir
GLOBAL docsDir$ = "GLBDocs" // Where to store generated text files
GLOBAL sorting% = TRUE // Use alphabetic sorting

GLOBAL files[] AS TFile // Holds all the file data

TYPE TFile
filename$
dir$
globals$[]
constants$[]
functions$[]
types[] AS TType
text$[]
ENDTYPE

TYPE TType
name$
properties$[]
methods$[]
ENDTYPE

// Do it

ReadInFiles( files[], dir$ )
ProcessFiles( files[] )
WriteFileData( files[] )

END


INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                     READ A Dir                                        |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE
// Scan a dir reading in all the samples
FUNCTION ReadDir: dir$ = "", ext$ = "GBAS"
LOCAL aFile AS TFile, gbasFileList$[]
aFile.dir$ = dir$
IF dir$="" THEN dir$ = GETCURRENTDIR$()
LOCAL saveCurrentDir$ = GETCURRENTDIR$()
SETCURRENTDIR( dir$ )
GETFILELIST( "*.*", gbasFileList$[] )
FOREACH filename$ IN gbasFileList$[]
IF UCASE$ ( RIGHT$( filename$, 4) ) = UCASE$( ext$ )
aFile.filename$ = filename$
DIMPUSH files[], aFile
DEBUG "File: " + aFile.filename$ + "\n"
ENDIF
NEXT
SETCURRENTDIR( saveCurrentDir$ )
ENDFUNCTION



INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                     Read In Text                                      |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE
// Scan a dir reading in all the samples
FUNCTION ReadInFiles: files[] AS TFile, dir$
LOCAL f = GENFILE(), a$, t$[], n%, rv#
ReadDir( dir$ )
IF dir$="" THEN dir$=GETCURRENTDIR$()
LOCAL saveCurrentDir$=GETCURRENTDIR$()
SETCURRENTDIR(dir$)
IF NOT ( DOESDIREXIST( docsDir$ ) ) THEN SHELLCMD("cmd.exe /c mkdir " + docsDir$, FALSE, FALSE, rv#)
FOREACH file IN files[]
OPENFILE(f, file.dir$ + file.filename$, TRUE)
WHILE NOT ( ENDOFFILE( f ) )
READLINE f, a$
// Cheack and split ";"
IF SPLITSTR( a$, t$[], ";" ) > 0
FOREACH a$ IN t$[]
DIMPUSH file.text$[], a$
NEXT
ELSE
DIMPUSH file.text$[], a$
ENDIF
WEND
CLOSEFILE f
NEXT
SETCURRENTDIR( saveCurrentDir$ )
ENDFUNCTION



INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                     Process Files                                     |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE
// Scan a dir reading in all the samples
FUNCTION ProcessFiles: files[] AS TFile
LOCAL n%, t$[], inType%, inFunc%,typeStart%, inInline%, typ AS TType
FOREACH f IN files[]
//DEBUG "\n\nFILE: \"" + f.filename$ + "\"\n"
inType% = FALSE; inFunc% = FALSE
FOREACH a$ IN f.text$[]
n% = SPLITSTR( a$, t$[], ", \t" )
IF LEN( t$[] ) = 0 THEN CONTINUE
IF LEFT$( t$[0], 2 ) = "//" THEN CONTINUE
SELECT t$[0]

CASE "TYPE"
inType% = TRUE
typeStart% = TRUE
DIMPUSH f.types[], typ
f.types[ -1 ].name$ = t$[1]
//DEBUG "\n TYPE: "+f.types[ -1 ].name$ + "\n"

CASE "ENDTYPE"
inType% = FALSE
typeStart% = FALSE

CASE "FUNCTION"
inFunc% = TRUE
typeStart% = FALSE
IF inType%
DIMPUSH f.types[ -1 ].methods$[], Func$( a$ )
//DEBUG " m:"+f.types[ -1 ].methods$[-1]+"\n"
ELSE
DIMPUSH f.functions$[], Func$( a$ )
//DEBUG " f:"+f.functions$[-1]+"\n"
ENDIF

CASE "ENDFUNCTION"
inFunc% = FALSE

CASE "GLOBAL"
DIMPUSH f.globals$[], LTRIM$( MID$( a$, INSTR( a$, "GLOBAL" ) + 6, -1 ) , " \t" )
//DEBUG " G:"+f.globals$[-1]+"\n"

CASE "CONSTANT"
DIMPUSH f.constants$[], LTRIM$( MID$( a$, INSTR( a$, "CONSTANT" ) + 8, -1 ) , " \t" )
//DEBUG " C:"+f.constants$[-1]+"\n"

CASE "//"

CASE "INLINE"
inInline% = TRUE

CASE "ENDINLINE"
inInline% = FALSE

DEFAULT
IF inType% AND typeStart% AND NOT ( inInline% )
DIMPUSH f.types[ -1 ].properties$[], LTRIM$( a$ , " \t" )
//DEBUG " P:" + f.types[ -1 ].properties$[ -1 ] + "\n"
ENDIF
ENDSELECT
NEXT
//
NEXT
ENDFUNCTION



INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                Process a Function Call                                |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE
// Scan a dir reading in all the samples
FUNCTION Func$: a$
LOCAL b$ = LTRIM$( MID$( a$, INSTR( a$, "FUNCTION" ) + 8, -1 ) , " \t" )
b$ = REPLACE$ (b$, ":"," ( " )
IF INSTR( b$, "//" ) = -1
b$ = b$ + " )"
ELSE
b$ = REPLACE$ (b$, "//"," )  //" )
ENDIF
b$ = REPLACE$( b$, " (  )", "()" )
b$ = REPLACE$( b$, "(  ", "( " )
b$ = REPLACE$( b$, "  )", " )" )
RETURN b$
ENDFUNCTION


INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                Process File Data                                      |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE

// Scan a dir reading in all the samples
FUNCTION WriteFileData: files[] AS TFile
LOCAL n%, f%, r
FOREACH file IN files[]
// Open file
OPENFILE( f%, file.dir$ + docsDir$ + "/" + file.filename$ + ".txt", FALSE)
WRITELINE f%, "FILENAME: " + file.dir$ + file.filename$
// Constants
WRITELINE f%,""; WRITELINE f%, "CONSTANTS:"
IF sorting% THEN SORTARRAY file.constants$[], ADDRESSOF(compare)
FOREACH c$ IN file.constants$[]
WRITELINE f%, "\t" + c$
NEXT
// Globals
WRITELINE f%,""; WRITELINE f%, "GLOBALS:"
IF sorting% THEN SORTARRAY file.globals$[], ADDRESSOF(compare)
FOREACH g$ IN file.globals$[]
WRITELINE f%, "\t" + g$
NEXT
// Global Functions
WRITELINE f%,""; WRITELINE f%, "GLOBAL FUNCTIONS:"
IF sorting% THEN SORTARRAY file.functions$[], ADDRESSOF(compare)
FOREACH f$ IN file.functions$[]
WRITELINE f%, "\t" + f$
NEXT
// Types
WRITELINE f%,""; WRITELINE f%, "TYPES:"
FOREACH t IN file.types[]
WRITELINE f%, "\t" + t.name$ + ":"
// Properties
WRITELINE f%, "\t\tPROPERTIES:"
IF sorting% THEN SORTARRAY t.properties$[], ADDRESSOF(compare)
FOREACH p$ IN t.properties$[]
WRITELINE f%, "\t\t\t." + p$
NEXT
// Methods
WRITELINE f%, "\t\tMETHODS:"
IF sorting% THEN SORTARRAY t.methods$[], ADDRESSOF(compare)
FOREACH m$ IN t.methods$[]
WRITELINE f%, "\t\t\t." + m$
NEXT
NEXT
WRITELINE f%,""
CLOSEFILE f%
NEXT
ENDFUNCTION


INLINE
/*-------------------------------------------------------------------------------------*\
| |
|                                     Sort Function                                     |
| |
\*-------------------------------------------------------------------------------------*/
ENDINLINE

FUNCTION compare: BYREF a$, BYREF b$
   IF ASC( LCASE$( a$ ) ) < ASC( LCASE$( b$ ) ) THEN RETURN -1
   IF ASC( LCASE$( a$ ) ) > ASC( LCASE$( b$ ) ) THEN RETURN 1
   RETURN 0
ENDFUNCTION


An example of the output.

Code: (glbasic) [Select]
FILENAME: C:/Coding Folder/Projects/GLBasic/plasma/2Dmesh.gbas

CONSTANTS:
ANITYPE_2D_ROTATE = 0
RENDERFX_2D_QUICK = 2
RENDERFX_2D_NORMAL = 0
RENDERFX_2D_COLOURED = 1

GLOBALS:
meshes2D AS T2DMeshes

GLOBAL FUNCTIONS:

TYPES:
T2DMeshes:
PROPERTIES:
.batch AS TVBeam
.models AS T2DModels
.m[] AS T2DMesh
.total2DMeshes%
METHODS:
.Add ( m AS T2DMesh )
.Destroy()
.Del ( mNum% )
.New()
.Render ( batch AS TVBeam, useModels AS TModels )
.SetUp()
.Update()
T2DMesh:
PROPERTIES:
.aniRotSpd#
.aniType%
.baseRadius# // Radius of unscaled Mesh
.drawFlag% = TRUE
.isInterpolatedFlag% = TRUE
.isRotatededFlag% = TRUE
.isScaledFlag% = TRUE
.lineAlpha% = 255
.lineColour% = 0xffffff
.lineWidth# = 8
.lineCombined% = 0xffffff00
.matrix#[]
.mdlNum%
.oldScl AS TVec2
.oldPos AS TVec2
.oldRot AS TVec2
.pos AS TVec2
.rot AS TVec2
.radius# // Radius of scaled 2DMesh(based on baseRadius)
.realTimeScalingFlag% = FALSE
.renderFX%
.scl AS TVec2
.vAniRotDir AS TVec2
METHODS:
.Animate()
.AniRotate()
.CacheTransform()
.CalcRadius ( )  // TODO ( Wrong!
.Destroy()
.Hide()
.RenderColoured ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.RenderColouredOLD ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.RenderNormal ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.Render ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.RenderColoured2 ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.RenderQuick ( batch AS TVBeam, use2DModels AS T2DModels = models2D )
.sRotateX ( x# )
.sRotateY ( y# )
.sMove ( x#, y# )
.SetUp ( use2DModels AS T2DModels = models2D )
.sRotate ( x#, y# )
.sScale ( x#, y# )
.SetRadius ( baseRadius# )
.Show()
.Set()
.sMoveTo ( x#, y# )
.sTurn ( x#, y# )
.sScaleRel ( x#, y# )
.Update()
.vMoveTo ( pos AS TVec2 )
.vRotate ( rot AS TVec2 )
.vTurn ( rot AS TVec2 )
.vMove ( pos AS TVec2 )
.vScaleRel ( scl AS TVec2 )
.vScale ( scl AS TVec2 )

38
Off Topic / iPad as a 2nd monitor
« on: 2016-Jul-09 »
I just picked up this from the App Store as it was recommended to me. I already have had various VNC clients but they were always laggy through the WIFI network.

This little app is different though, it basically uses the lightning connector as the method to transfer the picture from your PC to the iPad screen. On the PC your iPad is detected as a 2nd monitor. And it works, without lag and very little compression artefacts. Once set up, you really can use your iPad as a 2nd little monitor on your PC, allowing you to drag windows onto to it and use your mouse cursor as usual. Great stuff!

For GLBasic, you can drag the debug window onto it or even keep the help constantly open. CPU use is almost zero too, pretty impressive.

See... http://www.duetdisplay.com/

39
Off Topic / 8bit Simpsons
« on: 2016-Jun-27 »
Love the pixel art in this. This guy should do a full cartoon!


40
Off Topic / Steam Summer Sale
« on: 2016-Jun-25 »
Lots of good stuff to be had but here is my personal pick, it's old but for RTS style games it simply did not get any better...

Total Annihilation (Only 99p!)- http://store.steampowered.com/app/298030/?snr=1_7_7_ut2_150_7

I thoroughly recommend it to anyone who hasn't tried it before.

41
https://www.indiegogo.com/projects/the-sinclair-zx-spectrum-vega-plus-console#/

Last chance to buy a limited (coloured) edition tonight. Grabbed a white one for myself.  :-*

42
Off Topic / 2000 Marbles
« on: 2016-Mar-03 »

43
Off Topic / Pi 3 - Model B
« on: 2016-Mar-01 »
New Pi just wen't on sale, Quad core, 64bit, wifi... pretty powerful.

Here's the full specs.

Quote
DESCRIPTION
The Raspberry Pi just got juicer! Now with a Quad-Core 64bit CPU, WiFi & Bluetooth!

The Raspberry Pi 3 Model B is the third generation Raspberry Pi. This powerful credit-card sized single board computer can be used for many applications and supersedes the original Raspberry Pi Model B+ and Raspberry Pi 2 Model B.

Whilst maintaining the popular board format the Raspberry Pi 3 Model B brings you a more powerful processor, 10x faster than the first generation Raspberry Pi.

Additionally it adds wireless LAN & Bluetooth connectivity making it the ideal solution for powerful connected designs.

Raspberry Pi 3 - Model B Technical Specification
  • Broadcom BCM2387 chipset
  • 1.2GHz Quad-Core ARM Cortex-A53
  • 802.11 bgn Wireless LAN and Bluetooth 4.1 (Bluetooth Classic and LE)
  • 1GB RAM
  • 64 Bit CPU
  • 4 x USB ports
  • 4 pole Stereo output and Composite video port
  • Full size HDMI
  • 10/100 BaseT Ethernet socketbr
  • CSI camera port for connecting the Raspberry Pi camera
  • DSI display port for connecting the Raspberry Pi touch screen display
  • Micro SD port for loading your operating system and storing data
  • Micro USB power source
Raspberry Pi 3 - Model B Features

Now 10x Faster - Broadcom BCM2387 ARM Cortex-A53 Quad Core Processor powered Single Board Computer running at 1.2GHz!
1GB RAM so you can now run bigger and more powerful applications
Fully HAT compatible
40pin extended GPIO to enhance your “real world” projects.
Connect a Raspberry Pi camera and touch screen display (each sold separately)
Stream and watch Hi-definition video output at 1080
Micro SD slot for storing information and loading your operating systems.
10/100 BaseT Ethernet socket to quickly connect the Raspberry Pi to the Internet

44
GLBasic - en / INTEGER64
« on: 2016-Feb-29 »
INTEGER64(num#)

Seems to be undocumented(also not in the logs)?  :blink:

Converts a number to a 64bit integer.


45
Seems to be a problem with GETNUMJOYSTICKS() if you turn the gamepad on (I'm using a wireless 360 gamepad) after your app has started, it's always zero. I could tell people that it will require a restart if their gamepad is not recognised but this feels a bit clumsy.

Any tips on how to avoid this?

Pages: 1 2 [3] 4 5 ... 20