Acorn Arcade forums: 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) gerph (22:43 30/11/2020)
|
|
John O'Meara |
Message #124987, posted by Cauchy at 21:24, 9/11/2020 |
Member
Posts: 43
|
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%+ = 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%+;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 "", that is !(in_blk%+ = 149 and addr_scrh_w% = !(out_blk% = .
[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 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
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: 43
|
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: 43
|
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 ] |
|
Charles Justin Ferguson |
Message #125015, posted by gerph at 22:43, 30/11/2020, in reply to message #125007 |
Member
Posts: 48
|
You should not be trying to manipulate the display memory address. The video driver may not have any memory mapped in anywhere but the places where it expects the system to be displaying/rendering to.
There is no guarantee that you can position the start of screen anywhere but where the video driver wishes to put it.
The only guarantees that you have through the OS interfaces are that you can switch between screen banks. You can switch banks with OS_Byte 112/113, after which the VDU variables for the VDU base and display base will be updated. Also be aware that these values may be 0 if there is no frame buffer. |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: Asigning and displaying memory on screen. Help please. |