log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Messenger Pro hotmail settings (Gen:8)
- November News round-up (News:3)
- Jason Tribbeck talks sound to ROUGOL (News:4)
- Updating RPCEmu to 5.28 (News:)
- Asigning and displaying memory on screen. Help please. (Prog:4)
- Upgrading your RISC OS system to 5.28 (News:4)
- Gerph talks to Rougol online (News:2)
- Free online build service for RISC OS (News:1)
- PiHard 4.0 reviewed (News:2)
- Aemulor (Gen:39)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
The Icon Bar: Programming: Asigning and displaying memory on screen. Help please.
 
  Asigning and displaying memory on screen. Help please.
  Cauchy (21:24 9/11/2020)
  Phlamethrower (18:03 12/11/2020)
    Cauchy (21:55 12/11/2020)
    Cauchy (16:42 26/11/2020)
 
John O'Meara Message #124987, posted by Cauchy at 21:24, 9/11/2020
Member
Posts: 42
I try to asign and then display memory on the screen using this program. The screen appears the same after running this program as it does just before.If anyone could help please, it would be great. Thank you.
DIM in_blk% 19 :REM 20 bytes assigned
DIM out_blk% 15 :REM 16 bytes allocated
!in_blk% =7 :REM Amount needed by a single screen
!(in_blk%+4) = 148 :REM Addr of start of vdu REM drivers
!(in_blk%+cool = 149 :REM Addr' of start of
REM screen used by the display h/w
!(in_blk%+12) = 150 :REM Amount set aside for REM screen
!(in_blk%+16) = -1:REM Terminator
SYS "ReadVduVariables", in_blk%, out_blk%
addr_vdu%=!(out_blk%+4)
addr_scrh_w%=!(out_blk%+cool;REM Addr of start of REM screen used by display h/w
total_scr% = !(out_blk%+12) :REM Amount set
REM aside for the screen
byte_num% = !out_blk%
P."No of bytes for assigning memory : ";byte_num%
DIM scr_mem1% !out_blk% :REM Allocate size of my screen memory
offset% = addr_scrh_w% - scr_mem1% :REM offset REM of new base address = (start of screen display) - (base of screen buffer)
REM
PROCwritescraddr1(2, offset%) :REM Display new screen
END
DEF PROCwritescraddr1(type%, os%)
DIM param_blk% 4 :REM allocate 5 bytes
?param_blk% = type%
!(param_blk%+1) = os% :REM assign offset to
REM last four bytes
R0% = 22
R1% = param_blk%
SYS "OS_Word", R0%, R1%
REM OS_Word 22 assigns my memory to be displayed!
ENDPROC

[Edited by Cauchy at 21:26, 9/11/2020]
Not I do not know how to get rid of the smileys, but in both cases, you should view them as covering "cool", that is !(in_blk%+cool = 149
and addr_scrh_w% = !(out_blk% = cool.

[Edited by Cauchy at 21:42, 9/11/2020]Still a problem. So + eight closing parenthesis. The number eight on my keyboard seems to cause a smiley to be displayed instead.

[Edited by Cauchy at 21:47, 9/11/2020]
  ^[ Log in to reply ]
 
Jeffrey Lee Message #124989, posted by Phlamethrower at 18:03, 12/11/2020, in reply to message #124987
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15095
OS_Word 22 only works if the offset is within screen memory, e.g. between 0 and !(out_blk%+12) - !out_blk%. On Arc & RiscPC I think you can go right up to !(out_blk%+12), because the address space should wrap around.

Not I do not know how to get rid of the smileys, but in both cases, you should view them as covering "8)", that is !(in_blk%+8) = 149
and addr_scrh_w% = !(out_blk% = 8).
There should be a check box below the text box which will allow you to disable smileys.
  ^[ Log in to reply ]
 
John O'Meara Message #124990, posted by Cauchy at 21:55, 12/11/2020, in reply to message #124989
Member
Posts: 42
Thanks very much for your reply. I forgot to mention that I am trying the program out on an A7000 using riscos 4.02, and an ARMX6 from Rcomp
,RISCOS 5.25. On both these computers the variable offset% is something huge. For example, on the A7000, offset% = 835517716 on a 132Mb machine. And somethin similar for the ARMX6. So, how do I over come the limitation of the OS_Word 22, if it only works if the offset must be within screen memory? Thanks again.
  ^[ Log in to reply ]
 
John O'Meara Message #125007, posted by Cauchy at 16:42, 26/11/2020, in reply to message #124989
Member
Posts: 42
I got distracted by other things lately. So I have slightly altered the code to the following now.
DIM in_blk% 11
DIM out_blk% 7
!in_blk% = 7
!(in_blk% + 4) = 149
!(in_blk% + 8 ) = -1

and the outpot is changed to
byte_num% = !out_blk%
addr_scrh_w% = !(out_blk% + 4)
!(out_blk% + 4) is well below !(out_blk% + !2), but still gives a huge value for the offset% variable on my ARMX6; my A7000 is not working any longer. I have to fix it. Anyone with any ideas with what I may be doing wrong please advice. Thanks.
  ^[ Log in to reply ]
 

The Icon Bar: Programming: Asigning and displaying memory on screen. Help please.