(Comp.sys.hp48) Item: 1347 by mheiskan@hut.fi [Mika Heiskanen] Subj: GX RAM variables Date: 19 Jul 1993 with additions by Joe Horn on 4/15/95 [Note: GX owners keep bellyaching about the fact that the niftiest SX goodies on Goodies Disks 1-8 crash the GX. So, fix them yourself! All you need is Jazz, and the following file. Just DIS the program (using Jazz), search the machine language sections for the old #7xxxx SX addresses as listed below, and replace them with the new #8xxxx GX addresses. It's a quick 'n' dirty fix, but it works. If you want to write REAL code that runs on both the SX and GX, there are ways; see RAMPTRS.DOC in this HACKER directory. -jkh-] Here are some of the GX RAM variable addresses. The names are from HP but most are unsupported. (The entries on the right column marked with '=' were supported) Changes to note: - There are new RAM variables just before ROMPTAB (not listed) - There's new stuff before WSLOG data (work names, I haven't studied what exactly is in those locations) - Card related variables have changed, no detailed stuff yet (PORT1STATUS, PORT1SIZE, PORT1ADDR...PORT2END) These should be sufficient for compiling GX versions of many games since ScanKeys etc often used entries have not moved. However I suggest compiling a version that works on both SX and GX. The nibble at 0011F (IRAM@) could be used for testing which calc the game is in. (8 for GX, 7 for SX). [Note: I changed the names from non-HP hackers' lingo to the real HP names, and I added the third column for your edification. The addresses with two asterisks (**) between them should not be used as-is; see RAMPTRS.DOC on this disk for details from HP as to how to write code that gets these addresses regardless of which HP48 you're using. -jkh-] GX (**) SX NIB LENGTH: PURPOSE 80000 70000:RAMSTART 5: Cmos test word = F3C5A 80005 70005:IRAMMASK 5: 32K=0000F; 128K=0000C 80010 7000A:FAILSTK1 18: most recent WSLOG event 80022 7001C:FAILSTK2 18: 2nd WSLOG event 80034 7002E:FAILSTK3 18: 3rd WSLOG event 80046 70040:FAILSTK4 18: oldest WSLOG event 80058 70052:NEXTIRQ 13: next TIMER2 interrupt 80065 7005F:TIMECRC 4: NEXTIRQ's checksum 80069 70063:TIMEOUT 13: 10-min turn-off time 80076**70070=TIMEOUTCLK 1: timeout disabled if nonzero 80077 70071:LoBatTime 1: flag ((*)) updates 800E1 700DB:PortStat 1: copy of CARDSTAT nib 800E2 700DC:Port1CRC 4: port 1 checksum 800E8 700E4:COVERstate 3: IRAM state before uncovering 800F5 700F1=IRAMBUFF 256: code under IRAM 80319 701FC:uart_buffer 512: I/O buffer 80519 703FC:uart_buf_end 2: ? 8051B 703FE:uart_error 1: I/O error flag ? 8051E**70401=uart_handshk 1: XON/XOFF handshaking info 805DB 7045C:INTRAM 16: CPU save by int sys 805F5 70476:SAVE_A 16: saves A[W] 80605 70486:SAVE_ST 3: saves S0-S11 80608 70489:SAVE_B 16: saves B 80642**704C3=ORghost 3: saves OR reg (ghost) 80645 704C6:DRSTART 5: disp refresh lo bound 8064A 704CB:DREND 5: disp refresh hi bound 80654 704D5:IOSAVE 1: saves hi nib of ANNCTRL 80655 704D6:CSPEED 5: CPU speed (16Hz units) 8065A 704DB:INITEN 1: warmstart enable flag 8065B**704DC=DISABLE_KBD 1: disables kbd if nonzero 8065C**704DD=KEYSTATE 13: keyboard state 80669**704EA=KEYBUFFER 34: key buffer (max 15 keys) 8068B 7050C:POPPEDKEY 2: last key from POPKEY 8068D 7050E:DISP1CTLg 5: ghost for DISP1CTL 80692 70513:LINENIBSg 3: ghost for LINENIBS 80695 70516:DISP2CTLg 5: ghost for DISP2CTL 8069A**7051B=LINECOUNTg 2: ghost for LINECOUNT 8069C 7051D:Stk0save 5: saves hdwr rtn stk lvl 0 806BA 7053B:R2[A]save 5: saves R2[A] 806C5 70546:SAVE_BO 1: saves BitOffset 806C6 70547:SAVE_LC 2: saves LineCount 806C8 70549:SAVE_LN 3: saves LineNibs 806CB 7054C:SAVE_OFFSET 5: saves Window Offset 806D0**70551=VDISP2 5: SoftKey (menu) grob addr 806D5**70556=ADISP 5: stack grob addr 806DA**7055B=VDISP 5: display grob addr 806DF 70560:VDISP3 5: non-displayed grob addr 806E4 70565:GDISP 5: blackboard grob addr 806E9 7056A:TEMPOB 5: ptr to TempOb area 806EE**7056F=TEMPTOP 5: ptr to top of TempOb 806F3 70574:RSKTOP 5: ptr to RPL return stk 806F8**70579=DSKTOP 5: ptr to level 1 of RPL data stack 806FD 7057E:EDITLINE 5: ptr to command line 80702**70583=TEMPENV 5: ptr to temp environments 80707 70588:DOLPENV 5: ptr to DoLoop environments 8070C 7058D=TOUCHTAB 5: ptr to Touch Table (menu defs) 80711 70592:USEROB 5: ptr to HOME user object area 80716 70597:ROMPARTS 5: ptr to Romparts (Port 0) 8071B 7059C:CONTEXT 5: ptr to current dir 80720 705A1:STOPSIGN 5: ptr to end of CONTEXT (stop keyword search here) 80725 705A6:UserKeys 5: ptr to user key assignments 8072A 705AB:ALARMS 5: ptr to system alarm list 8072F 705B0:INTRPPTR 5: RPL pointer 80734 705B5:OSAVE 5: RPL object save ?? 80739 705BA:LASTARG1 5: CK saves 1st arg here 8073E 705BF:LASTARG2 5: CK saves 2nd arg here 80743 705C4:LASTARG3 5: CK saves 3rd arg here 80748 705C9:LASTARG4 5: CK saves 4th arg here 8074D 705CE:LASTARG5 5: CK5 saves level 5 arg here 80752 705D3:leeway 5: HXS which is GC'd if very low mem 8075C 705DD:HISTORY1 5: ptr to most recent LAST CMD 80761 705E2:HISTORY2 5: ptr to 2nd LAST CMD 80766 705E7:HISTORY3 5: ptr to 3rd LAST CMD 8076B 705EC:HISTORY4 5: ptr to oldest LAST CMD 80775 705F6:KERMERRM 5: ptr to last Kermit error msg 8077F 70600:EXITMSG 5: ptr to user-defined DOERR msg$ 80784 70605:AppDisplay 5: ptr to app display object 80789 7060A:AppKeys 5: ptr to app key assignments 8078E 7060F:AppExitCond 5: ptr to app exit condition 80793 70614:AppError 5: ptr to app error handler 80798 70619:CtlAlarm 5: ptr to control alarm data 8079D 7061E:MenuDef 5: ptr to current menu definition 807A2 70623:LastMenuDef 5: ptr to last menu 807A7 70628:MenuData 5: menu data for touch table 807AC 7062D:MenuRowAct 5: ptr to PREV/NXT action definition 807B1 70632:LabelDef 5: ptr to menu-label maker 807B6 70637:MenuKeyNS 5: ptr to no-shift menu key handler 807BB 7063C:MenuKeyLS 5: ptr to left-shift menu key handler 807C0 70641:MenuKeyRS 5: ptr to right-shift menu key handler 807C5 70646=ReviewKey 5: ptr to REVIEW (INFO) key handler 807CA 7064B:LastContext 5: ptr to dir saved for CheckContext 807CF 70650:TrackAct 5: ptr to action when CONTEXT changes 807D4 70655:MenuExitAct 5: ptr to action when menu changes 807D9 7065A:LASTROMWDOB 5: ptr to last usr-level ROM-WD eval'd 807DE 7065F:KeyOb 5: ptr to pending key-object 807E8 70669:RAMEND 5: ptr to end of RAM 807ED 7066E:AVMEM 5: amount of free mem (nibs) w/o GC 807F2 70673:ERROR 5: ptr to last error-causing prog? 807F7**70679=ATTNFLG 5: ATTN flag; ON (CANCEL) was pressed 807FC 7067E=FIRSTPROC 5: ptr to StartupProc secondary 8081D 7069F:DEPTHSAVE 5: saved user-stack depth 80822 706A4:RNSEED 15: RAND seed 80831 706B3:SAVECLK 1: save CLKON state 80832 706B4:ALARMSDUE 1: due alarm flag 80833 706B5:PASTDUE 1: past due alarm flag 80834 706B6:DOUSEALARM 1: deactivate current alarm flag 80836 706B8:ALARM# 5: current alarm# 8083B 706BD:PASTDUE# 5: 1st past-due alarm# 80840 706C2:LPD_HIST 1: Low-Power-Detect History 80841 706C3:ANNUNCIATORS 2: six top-of-display annunciators 80843 706C5=SystemFlags 16: system flags (as follows) 80843 706C5 1: SysFlags 1-4 80844 706C6 1: SysFlags 5-8 80845 706C7 1: SysFlags 9-12 80846 706C8 1: SysFlags 13-16 80847 706C9 1: SysFlags 17-20 80848 706CA 1: SysFlags 21-24 80849 706CB 1: SysFlags 25-28 8084A 706CC 1: SysFlags 29-32 8084B 706CD 1: SysFlags 33-36 8084C 706CE 1: SysFlags 37-40 8084D 706CF 1: SysFlags 41-44 8084E 706D0 1: SysFlags 45-48 8084F 706D1 1: SysFlags 49-52 80850 706D2 1: SysFlags 53-56 80851 706D3 1: SysFlags 57-60 80852 706D4 1: SysFlags 61-64 80853 706D5=UserFlags 16: user flags (as follows) 80853 706D5 1: UserFlags 1-4 80854 706D6 1: UserFlags 5-8 80855 706D7 1: UserFlags 9-12 80856 706D8 1: UserFlags 13-16 80857 706D9 1: UserFlags 17-20 80858 706DA 1: UserFlags 21-24 80859 706DB 1: UserFlags 25-28 8085A 706DC 1: UserFlags 29-32 8085B 706DD 1: UserFlags 33-36 8085C 706DE 1: UserFlags 37-40 8085D 706DF 1: UserFlags 41-44 8085E 706E0 1: UserFlags 45-48 8085F 706E1 1: UserFlags 49-52 80860 706E2 1: UserFlags 53-56 80861 706E3 1: UserFlags 57-60 80862 706E4 1: UserFlags 61-64 80865 706E7:FIRSTCHAR 5: offset to 1st visible editline char 8086A 706EC:CR_COUNT 5: number of newline chars in editline 80874 706F6:TOPLINE 5: editline segment shown 1st on screen 8087A 706FC:HISTORYLEVEL 1: which LAST CMD level is next 8087B 706FD:LASTARGCOUNT 1: # of args saved by most recent CK 8087D 706FF:LASTERROR 5: ERRN 80882 70704:CURSOR 5: cursor pos from beginning of editline 80887 70709:CURSORROW 5: display row containing cursor 8088C 7070E:CURSORPOSN 2: cursor pos from left of disp (0-21) 8088E 70710:CURSORSTATE 1: show char (0) or show cursor (non-0) 8088F 70711:CURSORCHR 2: char under cursor 80891 70713:CURSORGROB 40: grob for char under cursor 808B9 7073B:CURSORX 5: cursor's pixel x-coordinate 808BE 70740:CURSORY 5: cursor's pixel y-coordinate 808CC 7074E:T1COUNT 1: cursor blink counter 808CD 7074F:PADCOUNT 1: decompiler's structure indent counter 808CE 70750:GARBSCRATCH1 5: saves 1 RSTK level in GC 808D3 70755:GARBSCRATCH2 5: saves counter in GC 808E2 70764:PADJSAVE1 1: status save in PTRADJUST 808E3 70765:PADJSAVE2 10: RSTK save in PTRADJUST 808EE 70770:DcompWidth 2: string decomp width 80911 70793:KEYLOCK 1: ??? 80912 70794:ACCUM 1: Program entry flag 80914 70796:COLWIDTH 2: MatrixWriter column width 80916 70798:ENTRWISE 1: MatrixWriter GO (ENTER) direction 8091B**7079D=ClkOnNib 1: Ticking clock is displayed if nonzero 80924 707A6:PrtStatus 3: 12 printing status flags 80947 707C9:MenuRow 5: menu item # in left-most softkey 80951 707D3:LastMenuRow 5: for LAST MENU (used with LastMenuDef) 809A3 707D9=ROMPTAB ?: RomPart Table -- ---> Mika Heiskanen, mheiskan@delta.hut.fi