RISC OS Arm assembly

Discuss all aspects of programming here. From 8-bit through to modern architectures.
Post Reply
zolbatar
Posts: 36
Joined: Sat Sep 22, 2018 12:12 pm
Location: Nottingham, UK
Contact:

RISC OS Arm assembly

Post by zolbatar » Thu Jul 18, 2019 6:29 pm

After failing to get my poorly A4000 working well enough to use I've decided to use my Pi instead for my pet project.

I learnt ARM assembly in a few days and refreshed my BBC BASIC skills after a 20 year break.

I have a vector based idea I want to play around with and spent the last week or so writing benchmarks and then coding up ARM assembly equivalents for clearing the screen, drawing horizontal lines, loading in a custom 64 colour palette and today finished off regular line drawing using bresenham's algorithm including clipping. Next task is polygon fill by breaking up convex polygons into straight sided triangles and using a variance on bresenham's again.

It might seem pointless but I'm getting around a 40% speed up in some cases against the regular OS_Plot equivalents. Besides...it's fun!

It all runs very quick at 640x480 but even at my screen res of 1920x1080 it's not too bad.

I plan to have a main loop doing rendering and stuff like animations in assembly then the update logic in BASIC.

I plan to use vectors for all rendering including text to create a specific visual style.

I'll keep the details of my project to another post when I have something to show :-)
Master 128 with DataCentre and RPi co-pro.
RPi B+ & 3B+ both running RISC OS.
Poorly A4000 (battery damage, partially repaired).

User avatar
eisdielenbiker
Posts: 32
Joined: Wed Aug 08, 2018 8:38 am
Location: East Germany
Contact:

Re: RISC OS Arm assembly

Post by eisdielenbiker » Thu Oct 03, 2019 11:27 am

This is very interesting to me. Is there anything new you achieved meanwhile ? I also would like to start ARM assembler coding , close to the hardware however. I used to program demos on 680x0 in the 90s. Okay I got the ARM2 machine code instructions here. But where is a memory map and hardware description of the Archimedes architecture in general, including sound and gfx etc. ? Any recommendations in books or PDF ?
I dont want to start reengineering some tiny intro programs using a monitor and disassembler. I just want a little action on screen commemorating the old times.
Mark
A3010 4MB , A7000, A420

User avatar
SarahWalker
Posts: 1206
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

Re: RISC OS Arm assembly

Post by SarahWalker » Thu Oct 03, 2019 5:12 pm

'Close to the hardware' coding is generally frowned upon, however if you absolutely must then the ARM2/MEMC/IOC/VIDC datasheets are at http://www.home.marutan.net/arcemdocs/ (under 'Archimedes Level Hardware'), and one of the Technical Reference manuals from http://chrisacorns.computinghistory.org ... s.html#TRM. However, note that any such coding will be basically guaranteed to not work on RiscPC/A7000 or later hardware, and is likely to run into compatibility issues with hardware on the older machines as well.

For OS legal stuff you'll want the PRMs - http://www.4corn.co.uk/articles/docs/#dev. Most of the basic graphics stuff is similar to the 8-bit machines - mode setting via VDU 22, wait for vsync with OS_Byte 19, set video bank with OS_Bytes 112 and 113, write palette with OS_Word 12. The address of screen memory is retrieved with OS_ReadVduVariables.

Sound is more complicated, there's a PRM chapter on the subject, and you'll want to pay attention to the Channel Handler.

User avatar
eisdielenbiker
Posts: 32
Joined: Wed Aug 08, 2018 8:38 am
Location: East Germany
Contact:

Re: RISC OS Arm assembly

Post by eisdielenbiker » Thu Oct 03, 2019 7:32 pm

Thanks for the information. I guess I have already seen the effects of this style of programming on my A7000:
quadrupled screen output, wrong aspect ratios, interrupt sound routines left behind working if you return from the 'demo' and so on.
I just like to get familiar with what is feasible and what's not just as you did on Amiga in ancient days now using cute little ARM code.
A3010 4MB , A7000, A420

Post Reply