Archive for the ‘dev’ Category

IDE dla cc65 zainstalowane

Friday, January 12th, 2018

Tegoroczny plan jest prosty – zakłada bowiem tylko rzeczy realne. Nie będę robił już planu pt. nauczę się assemblera – bo jest to mało realne w stopniu w jakim potrzebuję go, aby napisać rzeczy, które mam w planach. Po prostu – jest za trudny i ilość czasu do poświęcenia na niego jest za duża, poza tym są lepsi na tym polu i najzwyczajniej w świecie jak będę potrzebował to na szczęście mam do kogo uderzyć 🙂

cc65 to pakiet cross kompilera C na procesor 65(C)02. Lista systemów i komputerów jest długa – dla mnie będzie istotne na ile da się przenosić kod na poziomie C (z dostosowaniem rzecz jasna do bibliotek i realiów głównie dźwiękowo-graficznych plus I/O) pomięczy z88dk i właśnie cc65.

Dla pamięci i dla zainteresowanych – instalkę wbiłem do Mac OSX 10.9.5, wgrywając wcześniej XCode 6.2 i Command Line Tools już z Terminala:

$ xcode-select --install

parę klików dalej miałem to w systemie. Potem pozostało już tylko dorzucić cc65:

$ git clone

$ cd cc65

$ make

plis dorzucenie linkowania do binarek do /usr/local/bin poleceniem:

$ sudo make avail

Dalej już tylko knucie logiki i programowanie. Do usłyszenia!


single line programs in Sinclair BASIC pt.1

Thursday, October 5th, 2017

10 POKE 23692,255: PRINT CHR$(132.2+RND*1);:GO TO 10

Forgive me small inconsequence – the post screenshot you see is not what you will get after running this small program.

The whole cherry on the cake is POKE 23692,255 which one disables SCROLL? prompt on bottom on the screen for… 254 next filled screens.

But to keep you updated, below is GIF containing above typed program*.

* if you are not ‘typing’ fan of BASIC, just copy the code to editor and run zmakebas as mentioned here.

converting binary to ASCII decimal data list on Mac OSX

Tuesday, September 19th, 2017

Personally I use it to include already compiled assembler binary data or to convert i.e. small portion of bitmap like sprite or tiles to simple ASCII source to be included as DEF… or DATA… either in Assembler or BASIC source.

Above 32x32pixels graphics – to do it just in binary it’s simple but time consuming. 01000000, 00111111, 11100000, 00001111 – this is binary for just first row of above graphics.

On ZX Spectrum BASIC (or text file to be coverted by zmakebas) you need to write it down as 999 DATA BIN 01000000, BIN 00111111, BIN 11100000, BIN 00001111 then in loop of FOR… READ… POKE… NEXT… commands. So to be honest – it’s easy to do by pen on paper, but time consuming to write it down without stupid mistakes in data. And we have computers, you know, to simply stuff like that. So let’s them working.

How to do it with Mac OSX? Of course we need AppleScript.

Let’s do it with converting graphics, in our example 32×32 pixels, monochrome. I will be using Photoshop, pretty old version as CS5.1 but you can easy find relevant options in other software to replicate my moves.

To convert to bitmap (so zero-one data – no colour, no grayscale) it needs to be 8bit (just tip if you convert from 16bit and stuck with greyed bitmap mode in Photoshop).

step 1: save as .pbm

step 2: use my read pbm and extract raw data.scpt Applescript. Adobe Photoshop saves not fully text version of .pbm as described around in the internet. First 9 bytes are text – in our example:


Three tags, between all of them we have $0A handler. One important to note – we have 32×32 bitmap and… bingo – it’s noted in the header, right?

So we can ommit first 9 bytes (as in my Applescript code) and read the rest.

step 3: select and copy everything between { }

step 4: paste do your editor (BBEdit in my example) add code (BASIC or Assembler) and you have it. 30 seconds max 🙂

I will be sharing here more simple code and workflow solutions so – until next time.

Let me know if it works for you, or if you have a problem using this. Cheers!

Assembling Z80 Assembler source files with BBEdit and Pasmo Z80 Assembler

Wednesday, September 13th, 2017

Inspired and with help from Derek Bolli I have made today two scripts for use with Pasmo and BBEdit.

Script #1 making .tap file with BASIC loader (option –tapbas) :

and script #2 making .tzx (option –tzxbas) like above with BASIC loader:

Both scripts are .scpt (Apple Script) files to be put into:

~/Library/Application Support/BBEdit/Scripts/

And from that point they will appear in BBEdit under scipts icon drop down menu.

Files are easy to modify, aspecially if you donot want them to open compiled filed in emulator. I have marked port of code to mark down if you want to turn it off. If any – ask.

Z80 IDE – placing our tools within MacOSX catalog structure (step 2)

Wednesday, September 13th, 2017

Step two for me with setting up IDE for Z80 for use in Mac OSX was placing our tools within MacOSX catalog structure. Why bother with it? The point is to have access to our tools like pasmo or zasm, zmakebas from any folder on the computer without playing with disk/path to them, so it should be “within” system path as other system tools.

For me, under MacOSX 10.11.6 worked copying in terminal to  /usr/local/bin by typing (i.e. copying pasmo) after changing path to folder containing pasmo file:

sudo cp pasmo /usr/local/bin

then enter the root (administrator) password after being asked.

From this point pasmo can be envoked from any disk location. I did it installing all command tools like pasmo, zasm, zmakebas etc.


I started to learn assembler for Z80 and ZX Spectrum (step 1)

Monday, April 3rd, 2017

A few months ago I decided to do something crazy – from the point where I am by profession and age – and start to learn Z80 assembler to start coding in small form for ZX Spectrum.

Biggest problem – as always is to have simple but effective IDE* – the problem is I’m Apple Mac user. I didn’t wanted to setup Windows on Mac just for that (well – I had to try ZX Spin under Windows and I like it, but overall – Pasmo was my target compiler so decided to try setup all under MacOSX).

So three programs: editor – my is Textmate I just have installed additional budle (actually for ZASM but also works fine . pasmo is my assebler – I managed to compile and install it on my old Macbookpro and the last part of IDE for this moment is emulator with debugger – ZX SP.

Step by step – reading books, analysing code, hitting walls, finding solutions. Stay tuned!

* An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger.