From HEPAX to ROM or MOD ?

Discussion around the SwissMicros DM41X calculator
User avatar
pcscote
Posts: 169
Joined: Tue May 02, 2017 12:12 pm
Location: Québec/Canada

Re: From HEPAX to ROM or MOD ?

Post by pcscote »

MeinKuipers wrote:
Fri Jan 13, 2023 2:13 pm
This is good stuff, thanks Silvain. Did not know that you could extract a ROM from the NoVRAM with the programmer!
Hello Meindert,
Several years ago, I had decided to learn every features available in Diego modules.
While trying things, I bugged him with several emails asking all kind of information that was not clear to me.
So he patiently answers my emails and in one of these, he told me about that feature.
Sylvain
[DM1x/DM1xL/DM41/DM41L/DM41X/DM42]
User avatar
pcscote
Posts: 169
Joined: Tue May 02, 2017 12:12 pm
Location: Québec/Canada

Re: From HEPAX to ROM or MOD ?

Post by pcscote »

I have created a 4K RPN application ROM on the DM41X and I was able to export it as a ROM file on a PC.
I will post the step-by-step procedure later this week.
Sylvain
[DM1x/DM1xL/DM41/DM41L/DM41X/DM42]
User avatar
pcscote
Posts: 169
Joined: Tue May 02, 2017 12:12 pm
Location: Québec/Canada

Re: From HEPAX to ROM or MOD ?

Post by pcscote »

How to create a custom RPN application ROM on a DM41X with the HEPAX module.

To symplify things, I have create a custom HEPAX module that contains only 1 page of RAM.

References: Win-PC: download files from the web
  • create a DM41X folder under your home folder that will serve as a work folder → [home]/DM41X
  • download HEPAX custom module image to the work folder → HEPAX-1D-4K.mod
  • download ROM Handler zip file to the work folder → ROMHandler-main.zip
  • unzip ROMHandler-main.zip file in the work folder, zip file content ...
    • ROMHandler.exe
    • ROMHandler.INI
    • README.TXT
    • SYSTEMLABELS.TXT
    • XROM.TXT
Win-PC: copy the HEPAX custom module image to the DM41X (part 1)
  • plug the DM41X to the computer with the appropriate USB cable
DM41X: activating the USB disk

Code: Select all

[SETUP]                     // enter in the setup menu
1. File >                   // select file sub-menu
5. Activating USB Disk      // activating USB file sharing
... you should see ...

Code: Select all

    USB disk mode ...

    WARNING: ...

    Press ON key to end
Win-PC: copy the HEPAX custom module image to the DM41X (part 2)
  • mount the DM41X flash drive (if not done automatically)
  • copy HEPAX-1D-4K.mod file from the work folder to the [DM41X_flash_drive]/MODS folder
  • eject/unmount the [DM41X_flash_drive] from the computer
  • unplug the DM41X from the computer
DM41X: leaving menu

Code: Select all

[←]                         // leave the file menu
[←]                         // leave the menu system
DM41X: import custom HEPAX module

Code: Select all

[SETUP]                     // enter in the setup menu
2. Module >                 // select module sub-menu
2. Manage Modules in Flash  // enter module management screen
[Imprt]                     // import a new module
HEPAX-1D-4K...              // select HEPAX module from the list
[ENTER]                     // import the file
[←]                         // leave Manage Modules in Flash screen

Code: Select all

1. Active Modules           // enter module activation screen
[Plug]                      // plug a new virtual module
HEPAX-1D-4K                 // select HEPAX module from the list
[Add]                       // add the selected module
[ENTER]                     // activate configuration and leave menu system
DM41X: validate setup

Code: Select all

                  // power cycle the calculator (off then on)
CAT 2             // you should see "-HEPAX 1D" appears
DM41X: clear HEPAX RAM

Code: Select all

"OK"              // CLRAM confirmation message
9
CLRAM             // clear page  9
                  // power cycle: OFF then ON
HEPDIR            // should display: H:DIR EMPTY
[<-]              // clear message & display available HEPAX RAM registers
                  // should display: 651.0000  // 1 page (#9) of 4K 10-bit word
DM41X: add your programs to HEPAX RAM

Code: Select all

"FIRST"           // program name in ALPHA
HSAVEP            // copy program from main memory to HEPAX RAM
"SECOND"          // program name in ALPHA
HSAVEP            // copy program from main memory to HEPAX RAM
...
"LAST"            // program name in ALPHA
HSAVEP            // copy program from main memory to HEPAX RAM
HEPDIR            // list programs in HEPAX RAM
DM41X: remove page 9 from HEPAX RAM chain

Code: Select all

HEXEDIT
  ADR: ____       // enter: 9FF3  // HEPAX RAM page state
  9FF3 200 ___    // enter: 300   // change page state from 200 (use page) to 300 (exclude page)
  9FF4 xxx ___    // press [gold] then [SST] keys to do a [BST]
  9FF3 300 ___    // value should be 300
  [←]             // leave edit mode, display: ADR: ____
  [←]             // leave hexedit,   display: 0.0000

Code: Select all

                  // power cycle: OFF then ON
HEPDIR            // should display: H:NO FILESYS which is normal here
[←]               // clear message & display available HEPAX RAM registers
                  // should display: 0
DM41X: validate page 9 QROM content

Code: Select all

CAT 2             // catalog ROMs
[R/S]             // to pause the running catalog
[SST]             // until you see: -EXT FNC 2X
[ENTER]           // to enter that catalog
[R/S]             // to pause the running catalog
[gold] [BST]      // until you see your last program
[gold] [BST]      // until you see your first program
[←]               // to exit catalog
DM41X: validate/set XROM value

Code: Select all

HEXEDIT           // ROM Editor
  ADR: ____       // enter: 9000  // XROM ID address for page 9
  9000 00B ___    // keep the same XROM ID (11) or enter a value between 001 (1) and 01F (31)
  [←]             // leave edit mode, display: ADR: ____
  [←]             // leave hexedit,   display: 0.0000
                  // power cycle: OFF then ON
DM41X: save QROM to the DM41X Flash file system

Code: Select all

[SETUP]                     // enter in the setup menu
2. Module >                 // select module sub-menu
7. Save RAM Pages           // enter RAM Pages saving screen
<New File>                  // select this option
myrom.ram                   // choose a name for your RAM page
[R/S]                       // save the file and leave menu system
Win-PC: copy RAM file from the DM41X to your Windows PC (part 1)
  • plug the DM41X to the computer with the appropriate USB cable
DM41X: activating the USB disk

Code: Select all

[SETUP]                     // enter in the setup menu
1. File >                   // select file sub-menu
5. Activating USB Disk      // activating USB file sharing
... you should see ...

Code: Select all

    USB disk mode ...

    WARNING: ...

    Press ON key to end
Win-PC: copy RAM file from the DM41X to your Windows PC (part 2)
  • mount the DM41X flash drive (if not done automatically)
  • copy [DM41X_flash_drive]/RAM/myrom.ram file to the work folder
  • eject/unmount the DM41X flash drive from the computer
  • unplug the DM41X from the computer
Win-PC: extract ROM image from DM41X RAM image file
  • go to the work folder
  • run the ROM handler application → ROMHandler.exe
  • press the Open button
  • go to the work folder → [home]/DM41X
  • in the drop down list box located at the window bottom right, select DM41X RAM (*.ram) option
  • select the ram file → myrom.ram
  • press the Open button
  • you should see the following ...

    Code: Select all

    Reading RAM File: [work folder]/myrom.ram
           File size: 5120bytes
           RAM pages: 1
      File Size OK, start reading
      writing file: [work folder]/myrom_0.rom
    
  • exit the ROM handler application
Win-PC: validating ROM image
  • go to the work folder
  • run the ROM handler application → ROMHandler.exe
  • press the Open button
  • go to the work folder → [home]/DM41X
  • select the rom file → myrom_0.rom
  • press the Open button
    you should see something like the following ...

    Code: Select all

    ROM Filename    : [work folder]/myrom_0.rom
    ------------------hex---dec----------------
      XROM          : $00B  011
      # Functions   : $005  005
      ROM Name      : LBL "FIRST" (User Code) (first function name)  (first function name)
      Pause Entry   : $000
      Program Entry : $000
      Sleep Entry   : $000
      OFF Entry     : $000
      Service Entry : $000
      ON Entry      : $000
      MemLost Entry : $000
      ROM Revision  : @@-@@
      Checksum      : $000  CHECKSUM NOT GOOD, should be $0D5
      NOPs Counted  : 3947
      41CL YCRC     : $244326FF
    
  • press the List FAT button
    you should see something like the following ...

    Code: Select all

    -XROM----ADDR--FUNCTION --------------
    011.00   A0A0  "FIRST"     UCode XROM 11.00  "FIRST"      // your first program name
    011.01   A0BE  "SECOND"    UCode XROM 11.01  "SECOND"     // your second program name
    011.02   A0DD  "THIRD"     UCode XROM 11.02  "THIRD"      // ...
    011.03   A0FB  "FOURTH"    UCode XROM 11.03  "FOURTH"
    011.04   A11A  "LAST"      UCode XROM 11.04  "LAST"
    
  • exit the ROM handler application
Thank you very much Meindert for creating the ROM Handler application and also for having added the RAM extraction part, it saved me to write my own application. ;)

Sylvain

edit: typos
[DM1x/DM1xL/DM41/DM41L/DM41X/DM42]
rprosperi
Posts: 1710
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: From HEPAX to ROM or MOD ?

Post by rprosperi »

Epic post Sylvain, Bravo!!!

The hex-edits to un-link the HEPAX page and the RAM extraction details are real gold in here, but the extraordinary effort to document this entire process is significant and much appreciated, THANK YOU!!
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
User avatar
akaTB
Posts: 794
Joined: Tue May 02, 2017 1:56 pm
Location: Milan, Italy

Re: From HEPAX to ROM or MOD ?

Post by akaTB »

Yes, thank you Sylvain, really!
Greetings,
    Massimo
ajcaton
-+×÷ left is right and right is wrong :twisted: Casted in gold
Boub65
Posts: 231
Joined: Tue Sep 12, 2017 4:34 pm
Location: Rabat, Morocco

Re: From HEPAX to ROM or MOD ?

Post by Boub65 »

OMG!
This is a great tutorial @Sylvain!

Merci beaucoup mon ami... je l'essaye ce week-end sans faute!
Sincèrement, Sincerely, 73,
Boubker

DM15L, DM41L, DM42 #00855 (domes upgraded), DM41X #00707
HP48SX (with dark screen), HP42s, HP32SII (1990 with fraction bug), HP41C/CV
TI-89 titanium, CASIO fx-cg50 and Numworks (to play with micropython)
MeinKuipers
Posts: 58
Joined: Mon Jan 13, 2020 4:49 pm
Location: Netherlands

Re: From HEPAX to ROM or MOD ?

Post by MeinKuipers »

Thanks Silvain for starting to document my software :D . A task long overdue. I will put it high on my list of things do do. Just to let you know I already started to write some kind of DM41X guide like I have done for the 41CL, and it will inlcude topics like this.
Regards from NL,
Meindert Kuipers DM41X #48
Post Reply