[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ghetto Image Converter for HGR modes



On Thursday, December 23, 2010 1:24:18 AM UTC-6, Osgeld wrote:
> I entered ludum dare last weekend, which is a 48 hour from scratch
> game development compo, and I decided I was going to make an Apple II
> "battleship" clone (since the theme was discovery) currently its 4
> days past deadline and I am still fighting with it lol
> 
> anyway a half hour before the competition started, I decided I needed
> a way to draw highres graphics and export them to the II, so I whipped
> up this little ghetto system to do just that
> 
> Requirements:
> PC running The Gimp
> PC with lua 5.1 installed (older versions of the lua interpreter will
> not work)
> The Gimp palette file I made for the Apple II HGR colors
> The Lua conversion script I made
> 
> Basic Rundown: you make a 280x192 or 280x160 graphic using the gimp
> and the pallet, save it as a ppm file, edit the convert.lua file to
> change what image file your working on, that spits out a ginormous
> list of HPLOT and HCOLOR commands that you copy n paste (hopefully in
> a emulator running as fast as it will go, otherwise prepare to be
> bored ... for a long while)
> 
> Gimp pallet:
> Apple-II.gpl  (save as)
> open The Gimp, right click in the main window, choose Windows >
> Dockable Dialogs > Palettes, this will open a pallets window, right
> click on that window, and choose Import Palette, choose Palette file
> and select the Apple-II.gpl file to install
> 
> Lua 5.1
> debian based systems do sudo apt-get install lua5.1
> MS windows download from http://luabinaries.sourceforge.net/download.html
> and unzip to c:\lua
> 
> Graphics:
> Make an image or convert an image using the supplied palette at
> 280x192 or 280x160 and save as a *.ppm file
> 
> Script:
> convert.lua (save as)
> edit the convert.lua file to point to the *.ppm file you are currently
> wanting to convert, and save
> 
> The convert.lua script as posted needs to be in the same directory as
> your ppm files !!
> If your using windows, AND unzipped to the suggested location above
> there is a "click n go" cmd file for you, everyone else will need to
> run lua convert.lua OR lua5.1 convert.lua from the command line. This
> reads the ppm file and produces a *.ppm_out file, which is just a
> bucket-ton of basic statements
> 
> You can then copy and paste them into an Apple II system, BSAVE them
> and recall them
> 
> BE WARNED!!
> this produces tens of thousands of HPLOT and HCOLOR statements, I
> strongly recommend you paste them into an emulator running at full
> tilt warp speed, Apple II win can do it in a matter of seconds, but
> needles in eyes speed at 1MHz, ALSO this does not account for any of
> the funnier aspects of the Apple II video system, what you see in the
> gimp is NOT what you get on the apple, but its close
> 
> Links:
> 
> Download here http://www.cheesefactory.us/apple2/gfxcv/
> Screenshots here (apple IIc) http://www.cheesefactory.us/apple2/gfxcv/screenshots/
> 
> enjoy

Okay, the lua script is giving me some interesting errors here:

Saving the PPM as ASCII gives me this error:

convert.lua:66: attempt to concatenate field '?' (a nil value)
stack traceback:
        convert.lua:66: in main chunk
        [C]: ?

Saving it in RAW gives me this error:

convert.lua:23: attempt to perform arithmetic on field '?' (a string value)
stack traceback:
        convert.lua:23: in main chunk
        [C]: in ?

I'm fairly certain this will require an ASCII PPM file as it seems to analyse text, but doing it either way doesn't work.

I've also tried this script using both Lua 5.1 and 5.2 x64

My setup
OS: Windows 8 Pro with Media Center x64
Lua: 5.1 x64 and 5.2 x64
GIMP: 2.8.2