Post Reply 
HP50 Grayscale programming (Updated)
03-24-2017, 09:16 PM (This post was last modified: 03-26-2017 05:02 AM by sunhp.)
Post: #1
HP50 Grayscale programming (Updated)
Hello

Grayscale demo for HP49/50 written in MASD with Debug4x

Source : https://github.com/brizzly/sunhpgames/bl...ayscales.s

Working fine on Emu50
[Image: grayscale.png?raw=true]

Flicker a lot on a real 50g calc
[Image: realcalc50.jpg?raw=true]

Hardware grayscale are not possible in HP50 / Saturn ASM.

Whoever knows how to mix Hardware Grayscale in ARM code into Debug4X listing I will be happy to upgrade this code sample.

sunhp.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-25-2017, 05:10 AM (This post was last modified: 03-25-2017 05:11 AM by sunhp.)
Post: #2
RE: HP50 Grayscale programming ?
Well well.. SATURN emulation layer that is run by the HP 50g ARM CPU so poorly render grayscale based on a old trick V-sync / interruption handler. And voila it seems to my eyes that only a native ARM display code could render "hardware" grayscale without flickering etc. Any code snippet or any help is welcome. Thanks.
sunhp.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-25-2017, 05:35 AM
Post: #3
RE: HP50 Grayscale programming ?
(03-25-2017 05:10 AM)sunhp Wrote:  Well well.. SATURN emulation layer that is run by the HP 50g ARM CPU so poorly render grayscale based on a old trick V-sync / interruption handler. And voila it seems to my eyes that only a native ARM display code could render "hardware" grayscale without flickering etc. Any code snippet or any help is welcome. Thanks.
sunhp.

Nice to see you back you make great games!

Not sure if this utility would help you, but it does a good job with greyscale on the hp50G. http://www.hpcalc.org/details/6134
Find all posts by this user
Quote this message in a reply
03-26-2017, 01:11 AM (This post was last modified: 03-26-2017 01:12 AM by sunhp.)
Post: #4
RE: HP50 Grayscale programming (Updated)
(03-25-2017 05:35 AM)snrowe Wrote:  
(03-25-2017 05:10 AM)sunhp Wrote:  Well well.. SATURN emulation layer that is run by the HP 50g ARM CPU so poorly render grayscale based on a old trick V-sync / interruption handler. And voila it seems to my eyes that only a native ARM display code could render "hardware" grayscale without flickering etc. Any code snippet or any help is welcome. Thanks.
sunhp.

Nice to see you back you make great games!

Not sure if this utility would help you, but it does a good job with greyscale on the hp50G. http://www.hpcalc.org/details/6134

Thanks for your kind message!
OpenFire By Mario Lohajner (manjo) is really impressive. We don't know if an external lib is mandatory. Let's hope Mario see this thread and accept to share with us code sample and ideas.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2017, 10:46 AM
Post: #5
RE: HP50 Grayscale programming (Updated)
Hi :-)

-the idea is to make PICT (your framebuffer) big enough to fit the grayscale buffer
-then setup the ARM LCD controller to use the PICT as framebuffer
-there are a couple of tricks and things to take care when doing this
-ofcourse OPENFIRE does all this for you and more

as far as I know almost all HP50G users put OPENFIRE in their calcs to be able to browse GRO4 and GRO2 images so...
at this point it's not a big deal if you expect/require Openfire to be installed.

Install openfire to Flash (there is a lot of space) it's location is not critical for gamespeed, but the location of the game itself runs fastest in port0, somewat slower in port1 and slowest from flash.

If I had enough time I would go for a adventure engine in port0 with TONS of levels graphics even sound in SD card. Loaded on demand.

best regards,
manjo
Find all posts by this user
Quote this message in a reply
03-26-2017, 02:25 PM (This post was last modified: 03-26-2017 02:33 PM by sunhp.)
Post: #6
RE: HP50 Grayscale programming (Updated)
Hey Mario thank you very much for sharing infos. Would you share sources or docs about the ARM LCD controller ?
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2017, 11:10 PM
Post: #7
RE: HP50 Grayscale programming (Updated)
Well my sources are in the archive somewhere please note "open" in open fire doesn't mean open source it rather means like... "fire away" :-)
for documentation:
-there is a detailed PDF from Samsung, just google for:
samsung S3C2410X pdf

once again, if your game is in "Saturn domain" and if it works right on older 48 series I very much recommend using OpenFire to initialize the REALPF (read readme.txt for detailed instructions) grayscale mode, if the game is in "ARM domain" HPGCC has all the things you need C style ofcourse.
There is really no need to "reinvent the wheel"

If your game already works page-flipping, properly handling page timing and everything. All you need to do is initialize PF (page flipping mode) and when flipping frame buffers just call appropriate OpenFire routine and you'll get flicker free page-flipped grayscale. (this is meant for porting of older games, 32 gray scale image viewers and so on...)

OpenFire supports page-flipping grayscale it fixes some bugs (in fact emulates the "bugs") exactly as they were on the 48 series.

Check out the hpcalc.org for Lilian's games ported to HP50G using OpenFire.
These games are originally made for 48S and G series, Lilian ported these to 50G by modifying a couple of jumps/calls so these work as intended in 50G gray scale.
most gray scale classics like: ice cube, dune, cyclo, dr.barjo
If I remember right some of them he modified actually without the proper source code (just adding/modifying opcodes in binary). just added a far jump (GOSBVL) to page-flipping routine.

keep up the good work,
manjo
Find all posts by this user
Quote this message in a reply
03-27-2017, 12:50 AM (This post was last modified: 03-28-2017 05:52 AM by sunhp.)
Post: #8
RE: HP50 Grayscale programming (Updated)
Found a detailed PDF from Samsung CPU: http://pdf.datasheetcatalog.com/datashee...yztxrx.pdf
Do you have a simple asm code sample (GOSBVL ****) using OpenFire to initialize the REALPF ?
Also, your website is broken : http://fly.srk.fer.hr/~manjo/openfire/
Thanks!
Visit this user's website Find all posts by this user
Quote this message in a reply
03-28-2017, 06:29 PM
Post: #9
RE: HP50 Grayscale programming (Updated)
Yes I'm aware, sadly the student organization at faculty used to maintain this server doesn't have the resources anymore :-( so I'll probably upload all my stuff to hpcalc.org or build a new site somewhere.

openfire has a readme.txt included in zip, REALPF is described there,
from readme:

REALPF
------
doesn't need palette to be set since it uses flipping in monochrome mode

-compatible with INITPF, it uses monochrome mode to display gray shades using
page-flipping technique
-game is responsible for the accurate page-timing
-works similar to the way how 48 series and 49G used to produce shades

It expects 2 arguments
2: #822C0 -memory location to be used as LCD hardware buffer
1: #83BC0 -address where compatibility routines will be installed to

call page flipping routine when #120 register is set to your screen
example:
D0= 00120
LA address
DAT0=A A
GOSBVL 83BC0

manjo
Find all posts by this user
Quote this message in a reply
03-29-2017, 07:11 PM
Post: #10
RE: HP50 Grayscale programming (Updated)
(03-28-2017 06:29 PM)manjo Wrote:  Yes I'm aware, sadly the student organization at faculty used to maintain this server doesn't have the resources anymore :-( so I'll probably upload all my stuff to hpcalc.org or build a new site somewhere.

Github perhaps?
Find all posts by this user
Quote this message in a reply
04-04-2017, 07:27 PM
Post: #11
RE: HP50 Grayscale programming (Updated)
The Open Fire website can still be accessed via the Wayback Machine.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
09-19-2017, 08:48 AM
Post: #12
RE: HP50 Grayscale programming (Updated)
Hello,

@manjo : Would you release source code with us please ?

I still need the code sample for native HP50 grayscale within Saturn ASM..

Cyrille maybe ? Smile

Thanks,
Julien (SunHp)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)