Re: who

2017-12-08 Thread Marcos Cruz
En/Je/On 2017-11-25 23:41, Frode Tennebø escribió / skribis / wrote :
> who

Hello,

No SAM activity here at the moment...

My last project (2011 and 2014) for SAM Coupé was an improved remake of
Barry Jones' _Jolly Roger_ (1984), written in Sinclar BASIC for ZX
Spectrum, an old but nice simulation/strategy/adventure game with some
touches of arcade, which I liked.  The port to MasterBASIC worked fine
and looked promising
(http://programandala.net/es.programa.bandera_negra.mbim.html). I used
my MBim preprocessor for MasterBASIC
(http://programandala.net/en.program.mbim.html), which makes things much
easier and lets a cross-development of sorts.  But the bugs in SAM
BASIC's `KEYIN` ruined MBimport
(http://programandala.net/en.program.mbimport.html) the final step of
the toolchain, i.e. importing the final source into SimCoupe.

In 2015 I rewrote the program in Forth with my Solo Forth for ZX
Spectrum 128 (http://programandala.net/en.program.solo_forth.html).
It's called _Black Flag_ and progresses very well
(http://programandala.net/en.program.black_flag.html).

By the way, Solo Forth runs on several ZX Spectrum models and clones
with G+DOS, +3DOS and TR-DOS, and I've considered supporting also the
SAM Coupé with MasterDOS in a future version...  but I think ZX Spectrum
Next (http://specnext.com) will be the _next_ target...

Regards,

-- 
Marcos Cruz
http://programandala.net


Re: ZEsarUX emulates the SAM Coupé

2016-08-04 Thread Marcos Cruz
En/Je/On 2016-08-03 15:48, Balor Price escribió / skribis / wrote :

> Have you had a chance to have a play with yet Marcos?  All my disk
> images are in a format it doesn't recognise, any shortcuts you know
> of?

Unfortunately I cannot try it, until I get a better internet connection.

I have contacted César, the author. In the past I have helped him with
bugs and suggestions for the ZX Spectrum and Z88 emulations. Beside, he
kindly solves the doubts of the users.

He has told me the SAM emulation is still experimental, and some things
are missing. For example, disk drive is not supported (yet)! He has
tried some of the few tapes available, and they seem to work fine.

-- 
Marcos Cruz
http://programandala.net


ZEsarUX emulates the SAM Coupé

2016-08-02 Thread Marcos Cruz
ZEsarUX is a multi-emulator written by César Hernández. It's under
active development and runs on Linux and Windows.

I've used ZEsarUX to emulate several models of the ZX Spectrum (though I
use Fuse for my development projects) and especially the Z88. It works
great and has interesting features.

Now version 4.1 of ZEsarUX emulates also the SAM Coupé. I can not try it
at the moment because these months I'm temporarily in a place where my
only internet connection is a slow GPRS, and downloading the 22-MiB
source archive is beyond my imagination :) But I'll try it ASAP.

Here you are:

http://sourceforge.net/projects/zesarux/

-- 
Marcos Cruz
http://programandala.net


How to manipulate data files in assembler on G+DOS?

2016-02-26 Thread Marcos Cruz
Sorry if this is a bit off topic, but I think there are SAM users who
have experience with MGT's GDOS and G+DOS for ZX Spectrum.

I need to implement (in assembler) two file operations:

- Read and overwrite any 1-KiB block of a file.
- Read and write text lines sequentally.

G+DOS does not provide hooks or routines for these operations, so they
have to be implemented ad hoc.  I know Andy Wright's Beta DOS included
support for serial and random access files, but there's no disassembly
available.  I've searched the Microhobby magazine, which included many
articles on GDOS and G+DOS, but there's nothing about this issue. I
still have to finish searching the Format magazine.

At the moment I'm studying the G+DOS disassembly, trying to identify the
required low-level routines.

I wonder if anybody has tinkered with this before and could help with an
example code or any information.

Thank you.

-- 
Marcos Cruz
http://programandala.net


Re: OT: Email list about Forth on Sinclair (and Z80) computers

2015-11-03 Thread Marcos Cruz
En/Je/On 2015-11-03 02:53, Stuart Brady escribió / skribis / wrote :

> OT too, but I've been wanting to emulate the Hobbit (ZX Spectrum clone)
> in Fuse for a while, as this has a Forth mode.

I never heard of that Spectrum clone. I've just read some links from
Wikipedia and it sounds interesting. Unfortunately, I'm not familiar
with such a project, implementing new hardware on an emulator. Certainly
it is a good idea. I use Fuse a lot, and as you know it already emulates
other ZX Spectrum russian clones, Pentagon and Scorpion.

> I'm just not sure if you're more focussed on Forth itself and perhaps my
> attempts to emulate the hardware might be off-topic there.

Yes, the group is focussed on Forth itself: learning, using,
programming, or implementing it. But if you ever have a Forth-related
doubt during the implementation on the emulated Hobbit, you'll find some
help there.


-- 
Marcos Cruz
http://programandala.net


OT: Email list about Forth on Sinclair (and Z80) computers

2015-11-02 Thread Marcos Cruz
Sorry if this is a bit off-topic.

An email list has just been created to discuss the Forth programming
language on Sinclair (and Z80) computers:

http://programandala.net/en.forth-sinclair.html

Anybody with an interest in Forth and any Sinclair or Z80 based computer
is welcome.

By the way, there's also a new email list to discuss Forth in Spanish:

http://programandala.net/es.forth-es.html

Regards.

-- 
Marcos Cruz
http://programandala.net


command line tools to create MGT disk images for SAM and Spectrum

2015-08-09 Thread Marcos Cruz
Three years ago I wrote a wrapper for Andrew Collier's pyz80, in order
to make it easier to create MGT disk images with it, because most of the
times I needed to create a SAM MGT image with many files, but not
assemble something:

http://programandala.net/en.program.mgtize.html

In April I wrote a new tool that creates MGT disk images for Spectrum
(based on the disk algorithms of pyz80), recognizes and extracts TAP
files:

http://programandala.net/en.program.mkmgt.html

I hope they will be useful to someone.

-- 
Marcos Cruz
http://programandala.net


Re: Hi All Sam Users From Italy!

2014-08-31 Thread Marcos Cruz
En/Je/On 2014-08-28 23:10, Simone Voltolini escribió / skribis / wrote :

 Last year I start to preserve All of My Speccy, Ql and Now Sam
 material 

Nice to see you here, Simone! I didn't know you are interested also in
the SAM Coupé.

For the list: Simone contacted me some months ago, because he was
interested in the QL original software and manuals I offered for sale in
my website. I sold him all the stuff. You can trust him ;)

-- 
Marcos Cruz
http://programandala.net


KEYIN doesn't find procedures and functions?

2014-07-01 Thread Marcos Cruz
I sent this message some days ago, but it didn't appear.

- Forwarded message 

Date: Sat, 28 Jun 2014 02:33:39 +0200

I've found KEYIN fails this way:

  10 let p$=myProc
  20 keyin p$
  30 stop
  40 defproc myProc
  50   print myProc!
  60 endproc

Error: Missing DEF PROC.

The goal was to execute a procedure whose name is stored in an array,
without ON or IF structures. The solution I've found is to make the code
self-modifing:

  10 let p$=myProc
  20 keyin str$(callProc+10)+p$
  30 label callProc
  40 rem *line to be modified by keyin*
  50 stop
  60 defproc myProc
  70   print myProc!
  80 endproc

Functions have the same problem:

  10 deffn myFunc()=100
  20 keyin print fn myFunc()

Error: FN without DEF FN.

No difference between SAM BASIC and MasterBASIC.

Is it a known feature? Is there any logic behind that behaviour or is
it a bug? The docs (User, Technical, MasterBASIC, TCGTSB) say nothing
about that limitation.

Thank you.

-- 
Marcos Cruz
http://programandala.net


how to know the current PRINT position in BASIC?

2014-07-01 Thread Marcos Cruz
This message was rejected by the list filters some days ago. I try
again.

- Forwarded message 

Date: Sat, 28 Jun 2014 21:00:28 +0200

I'm writing, in MasterBASIC, a procedure that prints a text left
justified, starting at the current printing position and leaving the
printing position at the end of the text (there are other similar
procedures I've found, but they print the text as a whole paragraph, not
what I need).

In order to calculate how many columns are left on the current line, I
need to know what the current column is.  I've searched the system
variables, and finally found 

SPOSNU  5A6CH   (2) Upper window position as column/row.

It seems what I need, but I've done many tries with the code, showing
debug info at every step, and two strange things happen:

- Sometimes bits 7, 6 and 5 are set together, I still don't know why.
  They have to be masked, no problem.
- The variable updates as expected after printing something, but not
  after a simple PRINT, what ruins the algorithm.

Does anybody know something about this variable? Is there any other way
to know the current PRINT position?

Thank you.

-- 
Marcos Cruz
http://programandala.net


Re: Pro-DOS 8-bit charset?

2014-06-11 Thread Marcos Cruz
En/Je/On 2014-06-09 15:22, Chris Pile escribió / skribis / wrote :
 Hope that info gives you something to experiment with?

Indeed. Thank you so much for all the needed details. It's not trivial,
as you said. I would rather that poor 7th bit untouched and some X*8
free bytes at the end of the character set! :)

-- 
Marcos Cruz
http://programandala.net


Pro-DOS 8-bit charset?

2014-06-01 Thread Marcos Cruz

[For Chris Pile]

I see chars 128-255 are printed like chars 0-127; it seems bit 7 is
reset before printing on the screen.

AFAIK CP/M used 7-bit ASCII, and only certain versions of CP/M 3 (e.g.
the one by Amstrad) used a kind of CP/M standard 8-bit charset.

Is there any way to configure or hack Pro-DOS in order to use an 8-bit
charset (and define the chars above 127)? This would let to write
programs in other languages than English, with a modern encoding.

Thank you.

-- 
Marcos Cruz
http://programandala.net


Re: Pro-DOS v2.0 (CP/M 2.2) released

2014-05-29 Thread Marcos Cruz
En/Je/On 2014-05-28 21:29, Chris Pile escribió / skribis / wrote :

I've tried to make v2.0 look and feel more professional and
polished than its older relative, 

I have used v1.9 several times in order to try CP/M programs.  I've just
tried v2.0 with SimCoupe, following the manual step by step (except the
hardware interfaces), and it works great. The feeling is it's a
different system than v1.9, more powerful and comfortable. I find it
very impressive. Congratulations.

Apologies if the user manual is a little difficult to read or
grammatically awkward.

I find the manual clear and detailed. But anyway I'm not a native
speaker :)

Thank you for all this work.

-- 
Marcos Cruz
http://programandala.net


Re: SimCoupe running in the Raspberry Pi

2014-02-02 Thread Marcos Cruz
En/Je/On 2014-02-02 13:02, Simon Owen escribió / skribis / wrote :

 I've built an updated Pi version using SDL 2.0, which has vsync
 enabled.  Beta testers welcome!
 
 For details see: http://simonowen.com/blog/2014/02/02/simcoupe-raspi-sdl20/

The executable does nothing visible here. No error, no message, no
background process:

$ time ./simcoupe
real0m0.818s
user0m0.170s
sys 0m0.040s
$

My Raspbian is updated. What can be wrong?

-- 
Marcos Cruz
http://programandala.net


Pro-DOS v2.0 (Re: missing ProDos games)

2013-11-10 Thread Marcos Cruz
En/Je/On 2013-11-09 21:42, Chris Pile escribió / skribis / wrote :

 So, basically v2.0 is a brand new version, sharing pretty much none of
 v1.9's code base.

All the improvements sound great, Chris. I've used Pro-DOS with SimCoupe
in order to try CP/M Forth systems and text adventures. I look forward
to the new version.

-- 
Marcos Cruz
http://programandala.net


Re: Sim Coupe - Pi Version

2013-10-31 Thread Marcos Cruz
En/Je/On 2013-10-30 23:20, da...@properbastard.co.uk escribió / skribis / wrote 
:
 I'm fairly sure I read something about as Rasp-Pi version of Sim Coupe?
 Is this pretty much straightforward to use? I'm going to be getting
 one pretty soon - and I'd certainly like to try this :-)

I use a Raspberry Pi as my main computer, with Raspbian. No problem
compiling and using SimCoupe. But the full screen mode doesn't work yet.

Marcos

-- 
http://programandala.net



Re: SimCoupe / Trinity

2013-05-03 Thread Marcos Cruz
En/Je/On 2013-05-02 23:09, Stefan Drissen escribió / skribis / wrote :

  Sorry Stefan, I'm still against my hardware being emulated in
  SimCoupe.

 That's a pity, it's your right of course, but I think you are preventing
 your work from flourishing in a larger (emulated) audience. 

 Allowing emulation may get some odd sods, myself included, wanting to write
 something for it, resulting in enough momentum for it to become interesting
 for a real SAM user, resulting in a sale for you. Sounds like egg and
 chicken basics to me.

I agree with you, Stefan.

Creating software and hardware for the real SAM is great and desirable,
but emulation is the way most people can use, program or even meet a
SAM.

In my opinion, emulating a good interface is an avail for its seller and
for the real machine users, because the interface becomes potentially
more useful, and more desirable.

Marcos

-- 
http://programandala.set


Re: SimCoupe running in the Raspberry Pi

2013-02-17 Thread Marcos Cruz
En/Je/On 2013-02-16 21:07, da...@properbastard.co.uk escribió / skribis / wrote 
:

 Is this still working well - as I'm really tempted to get a Pi

It works fine. Only the full-screen mode does not work on X Window.
Simon explained there's no solution yet.

SimCoupe makes the Pi's CPU to work a lot (70%-90%) but the maximum
SAM's speed is good enough (200%-250%). (I have overclocked the Pi to
800 MHz).

My Pi has 256 MiB; I've ordered a 512 MiB one because 256 is not enough
for some working sessions, even if my working environment is very
austere and efficient (Ratpoison + GNU Screen + keynav).  Anyway I'm
considering a Hackberry A10, similar to the Pi but much more powerful:
https://www.miniand.com/products/Hackberry%20A10%20Developer%20Board.
I'm not interested on Android, but it can run Debian too.

Marcos

-- 
http://programandala.net


doubt about bit 5 of LMPR

2013-01-01 Thread Marcos Cruz
Hi,

I don't understand what's the actual effect of LMPR's 6th bit, called
RAM0. It's explained on page 18 of the technical manual.

For example, what' the difference between this:

8--
  ld a,023h ; bits 0-4: RAM page 3; bit 5: RAM0 
  out (0fah),a  ; allocate pages 3  4 to section A
8--

and this?:

8--
  ld a,003h ; bits 0-4: RAM page 3;
  out (0fah),a  ; allocate pages 3  4 to section A
8--

Is the bit needed in order to make the system know ROM0 is paged out?
Does it have to be set always for allocating a RAM page to section A?

Thank you
Marcos

-- 
http://programandala.net


Retro-X (Re: Convert an Atari Neochrome to SAM with KEdisk)

2012-12-31 Thread Marcos Cruz
En/Je/On 2012-12-25 23:49, Sergey Sharov escribió / skribis / wrote :
 You can easily convert to all four SAM modes with Retro-X:
 http://members.inode.at/838331/retrox/RetroX(Alpha8).zip

I've tried it on a Windows machine. It's really impressive, even
unfinished.

I'd rather use a tool that lets me automate the work the Unix way, but
the Retro-X image conversions are so good and its features so powerful
that I will try it in order to prepare some graphics.


Thank you.

Marcos

-- 
http://programandala.net


Forth (Re: disassembling SamForth)

2012-12-31 Thread Marcos Cruz
En/Je/On 2012-12-31 13:13, Thomas Harte escribió / skribis / wrote :

 Would it be fair to describe Forth as the procedural analogue of Smalltalk?

I don't know Smalltalk. I think I read a comparation some time ago.
AFAIK they internally work quite differently.

 I'm thinking specifically about strict left-to-right evaluation,

Right. Forth has no syntax. That's one of its strongest features.  Words
are executed in the order they are received (from a keyboard, a file, a
serial line or whatever). 

 words having meaning only by definition

Right. 

 and runtime components doing the things that are usually specialised
 syntax like branches and loops. 

Words that create control structures are ordinary words in Forth. They
compile lower-level words and branch information on the word currently
compiled. Thus you can write your own special control structures on the
fly if you need, anywhere in a Forth program,  and use them right on the
next word you create.  In fact, actually you don't write a Forth
program at all -- you write your own dialect of the language suitable
for resolving your particular problem. 

I think the following online/downloadable books by Leo Brodie could be
helpful in order to solve your doubts:

The Forth way to solve problems (no Forth knowledge required, useful
also for programmers of other languages):

http://thinking-forth.sourceforge.net

(The simple Forth compiler is caricatured on Figure 4-7, page 103, and
explained on page 102).

A good classic tutorial for beginners:

http://forth.com/starting-forth/


Marcos

-- 
http://programandala.net


Re: disassembling SamForth

2012-12-26 Thread Marcos Cruz
En/Je/On 2012-12-23 16:46, Marcos Cruz escribió / skribis / wrote :

 I'll inform again only when
 the first dissasambled code is available.

The first results:

http://programandala.net/en.program.samforth
http://programandala.net/en.program.samforth2z80dasm

Marcos

-- 
http://programandala.net


Convert an Atari Neochrome to SAM with KEdisk

2012-12-25 Thread Marcos Cruz
Hi all,

I've found KEdisk in Fred 36, a program by Geoff Winkless.  Among other
things, it converts Atari Neochrome .neo images to SAM screens.  This
opens a new way to import images: .ppm  ppmtoneo (a Netpbm command) 
.neo  KEedit. At the moment I have problems to get a Neochrome image
--ppmtoneo fails, I still don't know why.

Anyway, has anyone tried KEdisk for this?

Marcos

-- 
http://programandala.net


Re: Convert an Atari Neochrome to SAM with KEdisk

2012-12-25 Thread Marcos Cruz
En/Je/On 2012-12-25 15:57, Colin Piggot escribió / skribis / wrote :

 If you are after an easy way to convert images to the SAM,

Yes, I'm seeking and trying different alternatives in order to make the
conversion as automate as possible.

 (http://members.inode.at/838331/index.html) 

Thank you Colin. I already knew LCD's website, but didn't remember
BMP2SCR.  It seems it converts only to ZX Spectrum screen, SAM mode 1.
It could be useful in some cases, but I need to convert also to mode 4.
Anyway, I would need to convert the code from those BASIC dialects (they
are commercial or non-Linux or Linux x86) to X11-Basic or other free
dialect that can run on Linux ARM. I'll think about it. It would not be
difficult.

Marcos

-- 
http://programandala.net


Re: Convert an Atari Neochrome to SAM with KEdisk

2012-12-25 Thread Marcos Cruz
En/Je/On 2012-12-25 18:23, Colin Piggot escribió / skribis / wrote :

 is BMP2SCR EXP 2.10d and that does MODE 3 and MODE 4 for SAM,

You're right, thank you. My mistake. I've explored the sources of EXP
2.11 and the modes 3 and 4 stuff is there.

Marcos

-- 
http://programandala.net


Re: Convert an Atari Neochrome to SAM with KEdisk

2012-12-25 Thread Marcos Cruz
En/Je/On 2012-12-25 23:49, Sergey Sharov escribió / skribis / wrote :

 You can easily convert to all four SAM modes with Retro-X:
 http://members.inode.at/838331/retrox/RetroX(Alpha8).zip

Thank you. The features and screenshots are impressive. I didn't see it
the first time because it's not on the downloads page.

I will try it on a Windows as soon as possible.

Marcos

-- 
http://programandala.net


Re: disassembling SamForth

2012-12-24 Thread Marcos Cruz
En/Je/On 2012-12-24 14:48, da...@properbastard.co.uk escribió / skribis / wrote 
:

 I don't even remember a SAM version of FORTH!

Forth isn't main stream, and SAM Coupé isn't popular neither.  Logically
their intersection has to be almost invisible [:-)].

http://www.worldofsam.org/node/597

The first time I heard about SamForth was thanks to Steve Parry-Thomas
in the Jupiter Ace forum, some time ago. It was a nice surprise, because
Forth is by far my favourite programming language.

Marcos

-- 
http://programandala.net


RST with arguments, beside RST 28?

2012-12-24 Thread Marcos Cruz
Hi all,

I've completed the first SamForth disassembling. It includes all Forth
word headers, the system variables and the data stack. It's not
finished --it can not be reassembled yet, but it's interesting. I'll
publish it on my website and return to my MasterBASIC projects for some
days.

Well, the next step in the disassembling process will be to mark the RST
arguments as data zones.  I'll try to to automate the task as much as
possible. I think the only RST routine that uses data arguments is RST
28, the floating point calculator (Technical Manual, pages 32 and 49).
Am I right? 

Thank you.
Marcos

-- 
http://programandala.net


Re: Which colors for a grayscale?

2012-12-24 Thread Marcos Cruz
En/Je/On 2012-12-20 05:00, Stefan Drissen escribió / skribis / wrote :

I wrote the greyscale ditherer - see
[1]http://www.worldofsam.org/node/40

Stefan, do you keep the Z80 source?  If so, would you share it? I'd like
to adapt your routine to work on any region of the current screen. I'd
publish the modified version with the original credits and a link to its
page on World of Sam. Probably changing some values will be enough, but
I didn't try to disassemble it yet.

Marcos

-- 
http://programandala.net


Re: disassembling SamForth

2012-12-23 Thread Marcos Cruz
En/Je/On 2012-12-23 00:50, Marcos Cruz escribió / skribis / wrote :
 Then I wondered where the immediate and smudge bits
 were stored... 

I found out the immediate bit: it's the 7th bit of the byte that holds
the name length.

The task progresses faster than expected. I'll inform again only when
the first dissasambled code is available.

Marcos

-- 
http://programandala.net


Re: disassembling SamForth

2012-12-22 Thread Marcos Cruz
En/Je/On 2012-12-22 00:30, Marcos Cruz escribió / skribis / wrote :

 For John Avis:
 
 Do you remember the meaning of the two bytes before the name length in
 the word header

I found out: It's the address of the previous word's name in the
dictionary.  Then I wondered where the immediate and smudge bits
were stored... There's no space left in the word header. In fact the
word 'IMMEDIATE' is not defined.

A tool programmed in Gforth is almost finished: It takes the whole
SamForth code and almost instantaneously creates the blocks and labels
files needed by the disassembler.  Much faster (and funnier) than by
hand :)

Marcos

-- 
http://programandala.net


SamForth documentation published

2012-12-21 Thread Marcos Cruz
Hi all,

Some time ago I edited and published the original SamForth
documentation. I recently updated the intro, added some links and the
original disk images:

http://programandala.net/en.article.2011.09.04.samforth_documentation

Marcos

-- 
http://programandala.net


disassembling SamForth

2012-12-21 Thread Marcos Cruz
Hi all,

SamForth seems a clever implementation of the language.  Forth words are
direct Z80 rutines (contrary to many other 8-bit implementations, the
Z80 stack is used as Forth return stack and the Forth data stack is
handled apart), thus Z80 code can be easily mixed with Forth code.
Unfortunately its sources are lost.  With some changes (e.g the way
handling the Forth sources) and updates (e.g. some missing features
already present in most modern Forth systems), SamForth would be very
interesting for cross-development: the easy of MasterBASIC combined with
machine code speed.

I've started to disassemble SamForth, as a background slow project.
It will take a lot of time because of course the disassembler needs to
know what is Z80 code and what is data.  Every Forth word in the
dictionary has a header before its code, as usual in most Forth systems.
Therefore all those data address ranges must be marked by hand first.
For example:

  drop_header: start 0x921b end 0x9221 type bytedata
  interpret_header: start 0x9224 end 0x922f type bytedata
  bracket_find_header: start 0x92e0 end 0x92eb type bytedata
  number_header: start 0x93cc end 0x93d4 type bytedata

Has anyone tried this before and maybe has some information to share?

For John Avis:

Do you remember the meaning of the two bytes before the name length in
the word header, or any other relevant information not included in the
docs?  Everything can be eventually found out from the Z80 code, but any
information would be helpful and will save time.

Thank you.

Marcos

-- 
http://programandala.net


Re: Which colors for a grayscale?

2012-12-20 Thread Marcos Cruz
En/Je/On 2012-12-20 05:00, Stefan Drissen escribió / skribis / wrote :

I wrote the greyscale ditherer - see
[1]http://www.worldofsam.org/node/40 - it only uses the real greys
and dithers the in between a.

Thank you Stefan.

My first try sprite is 54x28, only few pixels got cyan using the
colorscale suggested by Simon, and of course it's an alien spacesship on
black background, so it looks nice with some cyanish touches :)

But your code does an impresive job. I'll use it to create alternative
gray-only sprites.

Marcos

-- 
http://programandala.net



Which colors for a grayscale?

2012-12-19 Thread Marcos Cruz
Hi all,

In order to automate and simplify as much as possible the process of
importing images into the SAM and avoid the palette conversion problems,
I'm tinkering with the Netpbm raster formats
(http://en.wikipedia.org/wiki/Netpbm_format).  BMP and others could be
used too, but Netpbm files have two encoding variants (ASCII and binary)
for every type (PBM, PGM and PPM), what makes them very versatile in
this case.

The Netpbm images are created with Linux tools and the SAM does the
final conversion, PLOTing the image pixels with the desired equivalent
colors and GRABbing it.

The first tries with a grayscale image look promising, but I need to
choose 16 grays from the SAM palette (0, 7, 8, 15, 112, 120, 127...?)
I'm afraid there are less than 16 gray tones, and blue must be used to
complete the set. Am I right? Does anyboy know which are the best 16 SAM
original colors for a grayscale?

Thank you.

Marcos

-- 
http://programandala.net


Re: Which colors for a grayscale?

2012-12-19 Thread Marcos Cruz
En/Je/On 2012-12-19 21:54, Simon Owen escribió / skribis / wrote :

 bitwise is:  xGRBigrb.  For pure greys you'd use:
 
  = 00 = 0
 0111 = 07 = 7
 1000 = 08 = 8
  = 0f = 15
 0111 = 70 = 112
 01110111 = 77 = 119
 0000 = 78 = 120
 0111 = 7f = 127

I already knew the format but didn't have the idea to confirm which
colors are actually gray just by looking its code. I see my eyes worked
fine anyway :)

   0, 0, 8, 5, 7, 13, 15, 82, 112, 90, 120, 117, 119, 125, 127, 127

That's what I needed. It looks great. I'll try a 14-gray variant; the
two duplicates can be useful for some color effect.

Thank you.

Marcos

-- 
http://programandala.net



Re: 'BMP to SAM' by P. Crompton, in Fred 46

2012-12-13 Thread Marcos Cruz
En/Je/On 2012-12-12 15:19, Simon Owen escribió / skribis / wrote :

It scales the source image to 256x192 and converts to SAM
palette, then picks the top 16 colours to use for a final
conversion.  Script is here:
[1]http://obo.homeip.net/img2sam.py

Thank you, It will be useful!

-- 
http://programandala.net


SimCoupe running in the Raspberry Pi

2012-11-25 Thread Marcos Cruz
Hi,

These days I compiled SimCoupe in the little Raspberry Pi on Raspbian (a
Debian optimized for the Pi). It works great. Here you are a picture:

http://programandala.net/en.picture.2012.11.25.raspberry_pi

Marcos

-- 
http://programandala.net


text spooling

2012-11-16 Thread Marcos Cruz
En/Je/On 2012-11-16 14:41, Simon Owen escribió / skribis / wrote :

 I'll add file spooling for non-Windows platforms, and clipboard paste
 once SDL 2.0 is supported.  

Great! It will be possible to code in MasterBASIC with a modern editor. Cannot 
wait to try it :)

 The Windows version will likely remain
 clipboard only, since sniffing the encoding from text files is just
 too unreliable.

I don't use Windows, but your comment about file encoding makes me think
the text is converted before auto-typing it. Isn't it? I mean
non-ASCII characters.

When I wrote my MBim toolkit I considered how to write SAM-specific
characters in the source (e.g. block graphics and UDG) and non-ASCII
charers whose code is different from the current 8-bit standards like
ISO-8859-1. I solved the first problem with the simple notation used by
BASin (the old ZX Spectrum IDE for Windows). For the second, I simply
used ISO-8859-1 in the source. Then my Vim converter translated
everything, the BASin notation and the ISO-8859-1 non-ASCII characters,
to the actual SAM characters. The text was ready to be KEYIN-ed.  So far
so good.

But I think automatic translation during spooling has some drawbacks:
first, it would be useful only for non-ASCII characters (mainly, foreign
language letters) provided by the SAM (mainly, by MasterBASIC) --or for
all characters, in case the file is encoded in any ASCII-incompatible
format, e.g. UTF-16, what is not common; second, it could ruin an ad hoc
character translation done by the programmer in the source.

Example: The charset provided by MasterBASIC lacks four Spanish letters
(uppercase Á, Í, Ó and Ú). If I use them in the source (I mean, in the
texts managed by the program; the comments are irrelevant), I'd have to
choose what character codes must represent them, how to translate them
before spooling and finally how to design those missing chars as UDG.
Automatic translation doesn't help because those characters are not part
of the SAM charset, and my own characters codes could be misunderstood
by the file spooler as part of an UTF-8 multibyte character. 

Therefore, in my opinion, a simple and versatile option could be: first,
assuming the spool file is encoded in an 8-bit ASCII-compatible charset
(the actual encoding is irrelevant); and second, feeding it as is to
the SAM, without translation (of course beside end of line and maybe
other control characters).

Marcos

-- 
http://programandala.net


Re: text spooling

2012-11-16 Thread Marcos Cruz
En/Je/On 2012-11-16 18:38, Simon Owen escribió / skribis / wrote :

 I'll probably add options for no translation, minimal translation, and
 full transliteration.  

That would be great.

Marcos

-- 
http://programandala.net


Re: New Game: Dave Infuriators

2012-11-15 Thread Marcos Cruz
En/Je/On 2012-11-14 16:08, Andrew Gillen escribió / skribis / wrote :

 Hi, just to let you know I have finally finished writing Dave
 Infuriators. Simple platform game against the clock.

Nice game!  It's great to see new projects for the SAM.

Marcos

-- 
http://programandala.net


Re: remove

2012-11-15 Thread Marcos Cruz
Hi Jukka,

In order to remove yourself from the mailing list, send the following
command in email to sam-users-requ...@nvg.ntnu.no:

unsubscribe

Marcos

-- 
http://programandala.net


buggy KEYIN; MasterBASIC's tokenized format; buggy RENUM

2012-11-15 Thread Marcos Cruz
Hi all,

Some time ago I wrote a toolkit to write MasterBASIC programs with the
Vim editor (http://vim.org) and import them into SimCoupe (see
http://programandala.net/en.program.mbim). It didn't work because the
KEYIN command has bugs (in SAM BASIC, but MasterBASIC didn't fix them).
In fact, a similar tool for ZX Spectrum's Beta BASIC (see, in Spanish:
http://programandala.net/es.programa.bbim) works like a charm: I can
write Beta BASIC code (in an improved format with new features) with
Vim, and then, with a keypress, convert it to real Beta BASIC and
create a fake disk image ready to be imported into the Beta BASIC
interpreter. It would be nice to work the same way with the more
powerful MasterBASIC...

Is there any patch to fix SAM Coupé's KEYIN? I'm afraid not.

I thought an alternative: I could write a program to convert the source
code into tokenized MasterBASIC and copy it into a SAM disk image. But
the tokenized format is not fully described in the Technical Manual or
the MasterBASIC User Manual (though many details can be found there and
others are similar to the ZX Spectrum format). In
theory this approach is feasible, but much more complex.

Any other idea?

I'd like to develop some project in MasterBASIC, but its own editor
would be a pain compared with the features of a modern editor. Beside,
also the RENUM command is buggy, what is a serious limitation.

Marcos

-- 
http://programandala.net


Re: buggy KEYIN; MasterBASIC's tokenized format; buggy RENUM

2012-11-15 Thread Marcos Cruz
En/Je/On 2012-11-15 20:37, Simon Owen escribió / skribis / wrote :

 To rule out a problem with KEYIN, I used LLIST to write the program to a
 text file using the SimCoupe printer option.  I then auto-typed the
 contents back in to a freshly reset SimCoupe, 

What do you mean auto-typed? Text spooling? AFAIK SimCoupe lacks a
file spooling option (in fact it is what I need: SimCoupe to type the
content of a text file of the host machine).

 I noticed your program also uses labels, though not as many.  It might
 be worth trying to remove the labels, to see if that magically fixes it?

I think I tried everything I could imagine when I developed the several
versions of MBimport one year ago. Nevertheless I've just written a new
label-less version of MBimport. It's easy to remove the two or three
labels of the importer, but it makes no difference because there are
many labels in the imported KEYIN-ed code. I'll remove them too --just
to see what happens.

Thank you
Marcos

-- 
http://programandala.net