Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1533

Re: Applesoft LoRes BMP Viewer

Newsgroups comp.sys.apple2.programmer
Date 2015-02-27 17:21 -0800
References <aa794e08-f716-4923-bfcf-8e0dbcf13461@googlegroups.com>
Message-ID <2aaeb50f-2e54-4120-92fa-c30c933db76c@googlegroups.com> (permalink)
Subject Re: Applesoft LoRes BMP Viewer
From laseractiveguy@gmail.com

Show all headers | View raw


You ever port that song... get ahold of me at the LaserActiveGuy channel... I'll hook you up with some great Apple II music!


On Thursday, February 20, 2014 at 4:11:04 PM UTC-5, cybernesto wrote:
> Looking at the flappy bird post from mmphosis made me think if it was possible to write a simple viewer for bmp files in Applesoft. After some hours fiddling with soft switches I managed to write a version able to display 16 color bmp files with following resolutions:
> 40 x 40 px (Lo res mixed mode)
> 40 x 48 px (Lo res full screen)
> 80 x 40 px (Double lo res mixed mode)
> 80 x 48 px (Double lo res full screen)
> 
> -----LORESBMP.BAS------
> 10 ST = 16384: GR 
> 15 OFFS = PEEK(ST +6) -4
> 20 XS = PEEK(ST +14) -1
> 25 YS = PEEK(ST +18) -1
> 30 ST = ST +OFFS
> 40 IF XS <40 THEN GOTO 50
> 45 POKE -16371,0: POKE -16383,0: POKE -16290,0
> 50 IF YS <40 THEN GOTO 60
> 55 POKE -16302,0
> 60 FOR Y = YS TO 0 STEP -1
> 70 FOR X = 0 TO XS STEP 2
> 80 CL = PEEK(ST +I)
> 90 C1 = INT(CL/16)
> 100 C2 = CL -C1 *16
> 110 COLOR= C1: PLOT X,Y
> 120 COLOR= C2: PLOT X +1,Y
> 130 I = I +1
> 140 NEXT X
> 150 NEXT Y
> 160 P = PEEK(49152)
> 170 IF P <127 THEN GOTO 160
> 180 POKE -16289,0: POKE -16372,0: POKE -16384,0
> 190 TEXT 
> 200 HOME
> ------------
> 
> BMP files can be transferred as binary files using AppleCommander or CiderPress to a disk image. Then it should be loaded with
> ] BLOAD PICTURE.BMP, A$4000
> before running the viewer. 
> The code takes into account the 4 bytes offset in DOS3.3 binary files. If you want to run it using ProDos you should remove '-4' from line 15 and add 4 to the offsets in lines 20 and 25.
> To convert the palette of the original files into something the Apple II displays correctly you can use this palette file.
> 
> -----LORES.PAL------
> JASC-PAL
> 0100
> 16  
> 0 0 0
> 227 30 96
> 96 78 189
> 255 68 253
> 0 163 96
> 156 156 156
> 20 207 253
> 208 195 255
> 96 114 3
> 255 106 60
> 156 156 156
> 255 160 208
> 20 245 60
> 208 221 141
> 114 255 208
> 255 255 255
> ------------
> 
> This can be used for example with the GIMP or Irfanview. The RGB values are based on the "exact" ntsc color calculations found in http://mrob.com/pub/xapple2/colors.html
> 
> Here are some samples 
> http://flic.kr/s/aHsjSX7i3C
> I always wondered why there wasn't an Apple II Version of the nyan cat. Maybe someone can help me porting the song to stitch or Electric Duet?
> 
>  Anyway, have fun with it. If you want to use a similar approach but with HGR or DHGR pictures, you might want to take a look at this project https://github.com/cybernesto/VBMP

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Applesoft LoRes BMP Viewer cybernesto <cybernesto@gmail.com> - 2014-02-20 13:11 -0800
  Re: Applesoft LoRes BMP Viewer laseractiveguy@gmail.com - 2015-02-27 17:21 -0800
  Re: Applesoft LoRes BMP Viewer laseractiveguy@gmail.com - 2015-02-27 17:22 -0800
  Re: Applesoft LoRes BMP Viewer David Schmidt <schmidtd@my-deja.com> - 2015-02-27 21:09 -0500
    Re: Applesoft LoRes BMP Viewer "Bill Buckels" <bbuckels@mts.net> - 2015-02-28 19:05 -0600

csiph-web