zooxo / IV42

A Powerful Programable RPN Calculator for the DM42 Hardware based on FORTH
BSD 3-Clause "New" or "Revised" License
26 stars 2 forks source link

BMP display offset #3

Open diemheych opened 10 months ago

diemheych commented 10 months ago

I borrowed your BMP display code and noticed the image was slightly offset. I had to change (50-j) to (49-j) in the line below. Reviewing the code, this looks like it is what it should be (to me anyway :-).

for(byte j=0; j<50; j++) d[j]=~bmp[(129+i*52)+(50-j)]; // INvert and flip

zooxo commented 10 months ago

Glad that I could provide something useful. That's definitely a bug - thank's for this. May I ask: Which application do you make?

diemheych commented 10 months ago

I ported FORTH to the DM41X, I haven't setup a repository yet but you can see it at: https://youtu.be/jUzSyXVy9bo

BTW, I had to tweak the BMP code further as although it's monochrome it still uses a colour table so you can't invert all BMP files and you need to check the colour table first as the index into the colour table could point to white then black or black then white. Hope that makes sense. Doesn't affect your program as I believe you only load your own BMP files that have the table the same way.

zooxo commented 10 months ago

Looks great - you solved the need of a keyboard very good - I'm a FORTH fan too.

Right now I'm programming some kind of application suite (calculator, spreadsheet, 'powerpoint', text editor,...). Maybe you want to take a look at https://github.com/zooxo/desk42 If I may ask directly: Do you want to share your code to embed a forth app to desk42? If you are interested I can upload a pgm for you. I also programmed an aviation app (e6b) for desk42 with big help of Jim Williams - a dedicated pilot in the US.

Btw - when programming my 'powerpoint' I made some documentation to implement BMP files (size: 200x104) - maybe you can use this:

// BMP-FILESIZE = HEADER+INFOHEADER+COLORTABLE+IMAGE = 14+40+8+2912 = 2974 = b9e // // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 ... 14 bytes HEADER // B, M, -filesize-- -reserved-- -datoffset- // 42 4d 9e 0b 00 00 00 00 00 00 3e 00 00 00 // // 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 40 bytes INFOHEADER // --IH_size-- ---width--- --height--- plans -bpp- // 28 00 00 00 c8 00 00 00 68 00 00 00 01 00 01 00 - width=200=c8h, height=104=68h // // 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 // compression --img_size- -xpixelspm- -ypixelspm- colors_used importantcol // 00 00 00 00 60 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // // 54 55 56 57 58 59 60 61 - 8 bytes COLORTABLE // -R_G_B-- -R_G_B-- // 00 00 00 00 df f5 cc 00 ... black white/lightgreen // // 62 - 2973 ... 2912 bytes IMAGE PIXEL MATRIX (104 lines á 28 bytes = 2912 bytes = b60h) // ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff 0f00 0000 ... linepixel+pads (to nearest 4-byte boundary)

diemheych commented 10 months ago

I don't have a DM42 so would be difficult to use your programs as they keycodes and labels are different unfortunately.

So desk42 isn't available yet? I assume it's a single pgm with it all in one? You mention games but I can't see any in the readme, what games are you looking at?

I plan to put up a repository for DM-FORTH when I get some time.

Is your 35 an emulator or simulator?

Thank you for the BMP info, I think mine is working ok so far, I have tested with several of the standard and additional off images available with colour maps around both ways.

zooxo commented 10 months ago

Hi!

I tried your FORTH on my DM42. Despite warnings (wrong system) it runs properly and stable (good work) - only other keytable. Does it support float calculation? I tried "22 7 / ." - but I got 3 (instead of 3.14). Floating variable support might be essential to run on a calculator.

Did you implement an existing FORTH - which one?

I uploaded the recent version of DESK42 to github.com/zooxo/desk42/diemheych.pgm - if you want to try? Most apps are running (STAX calculator, RAX spreadsheet, E6B aviation, MERGE 2048game, ARENA 3dshooter, HP-35 simulator, CAL calendar, SCORE scoretable).

I programmed 2 games: MERGE ... a 2048 like puzzle game and ARENA ... a simple 3d shooter (just to see what the DM is capable in graphics and when it goes to FPS limits. ARENA runs well at 20 FPS (when on power grid) or 10 FPS (running on battery).

I'm working on DESK42 for almost one year - and need some months for PIC, TXT and FLEX ... and testing.

Regards

diemheych commented 10 months ago

I receive "not found" for the pgm link above.

The Forth I ported is integer only and a number with a decimal point represents a double. Floating point would be good, I'll have to see how difficult it would be to add.

zooxo commented 10 months ago

It's too bad that your FORTH doesn't support floating number operations.

Which FORTH did you use (gforth, amforth)?

Sorry, the (hopefully) working link is: https://github.com/zooxo/desk42/diemheych.pgm

If it's still not working please try the link "per hand" - it's there (github zooxo - the desk42 directory). Strange - but as I tried the above link didn't work (but the file is there).

Regards

diemheych commented 9 months ago

Hi, the link didn't work and it looks like the other copy has now been deleted.

I'm not sure how I will go with the keyboard differences. I might be able to borrow a DM42 though.

The FORTH is a simple, portable C implementation of Jones FORTH from https://gist.github.com/lbruder/10007431. I started with this for the HP 50G and was confident it would work on the DM41X. Maybe I'll look at different FORTH implementations instead of implementing floating point myself.

diemheych commented 9 months ago

BTW, how did you create your BMP help files?

zooxo commented 9 months ago

I'm using GIMP - but my version is a bit tricky to save the right black/white-BPM format. I had very bad experiences with Windows/Paint.

Btw I like the clear structure of Leif Bruder's FORTH - unfortunately it doesn't run with float variables. I'll try to stick with zFORTH (when there is time) - hopefully it will fit to the DM's memory restrictions.

diemheych commented 9 months ago

Which zFORTH repo? I searched and several came up. If it's small with FP I will have a look - thanks

diemheych commented 8 months ago

BTW, how did you design your font for this? Is there any particular software you used to do this?

zooxo commented 8 months ago

Actually I'm very fast with GIMP (copy, paste) and 'painted' all characters. At this small size it's hard to find a font that gives a good readability. You might have a look at the long post in the DM forum (googling "useful content for the ultimative offimg"). There you can find an ascii table to copy/paste characters. Finally I developed/painted a complete periodic table of elements on one screen.