PMFS 136, the Master Compact pointer and mouse driver Memory Map

← Acorn Master Compact Mouse Driver (PMFS)

Addresses outside PMFS 136, the Master Compact pointer and mouse driver's own code that it uses at run time — zero-page workspace, RAM buffers, and memory-mapped I/O. For the code itself (&8000–&9FFF), see the disassembly listing.

Access: R read, W write, B indexing base — the address is named as base,X/,Y, so the byte actually touched is base + index and the literal byte at this address is never itself accessed.

Zero page

Address Name Access Description
&0084–&0085 zp_image_ptr R/W/B

Pointer to the pointer image being drawn (the mask is the page above it). Also the source when building the pointer images, and the stored-workspace address in exchange_workspace.

&0086–&0087 zp_under_ptr R/W

Pointer to the buffer holding the screen bytes under the pointer (&9400). Also the destination when building the pointer images.

&0088 zp_temp R/W

Scratch: the high byte of a byte offset in calc_pointer_screen_address; the fill bit pattern (&00 for an image, &FF for a mask) when building shifted pointer images.

&0089 zp_row_in_cell R/W

Offset of the current pixel row from the start of the current screen address, while drawing or removing the pointer. Also the destination index when copying the pointer images.

&008A zp_image_index R/W

Index into the 64-byte pointer image, mask and under-pointer buffer: 16 rows for each of 4 byte columns. Also the column offset when building shifted pointer images.

&008B zp_skip_rows R/W

Scratch: rows to skip above the top of the screen in restore_screen_under_pointer.

&008C–&008D zp_screen_ptr R/W

Screen address being drawn to. Also the destination when copying the pointer images into the bank.

&008E–&008F zp_drawn_ptr R/W

Screen address at which the pointer is drawn; bit 7 of the high byte set means nothing is drawn. Kept in saved_drawn_ptr between calls.

&00A8–&00A9 cmd_ptr R/W

Pointer to the star command being decoded, and then to its arguments. Also the extended vector table address while the driver is turned on. In the MOS's command workspace (&A8-&AF).

&00AA–&00AB cmd_handler_ptr R/W

Address of the star command handler, for the indirect jump through jump_to_command_handler.

&00EF osbyte_a R

The A register of the current OSBYTE call, kept by the MOS for service call 7 (unrecognised OSBYTE).

&00F0 osbyte_x R

The X register of the current OSBYTE call, kept by the MOS for service call 7 (unrecognised OSBYTE).

MOS vectors

Address Name Access Description
&0204–&0205 irq1v R/W

Primary interrupt vector. While the driver is on, it points at the trampoline at irq1v_trampoline (&0D99); the previous value is kept in saved_irq1v.

&020A–&020B bytev R/W

OSBYTE vector. While the driver is on, it points at bytev_extended_entry (&FF0F), so that OSBYTE calls reach bytev_handler; the previous value is kept in saved_bytev.

MOS workspace

Address Name Access Description
&034E vdu_screen_start_hi R

VDU variable: high byte of the address of the first byte of screen memory. The pointer drawing routines do not draw rows whose address is below it, which are above the top of the screen.

&0D97–&0D98 saved_bytev R/W

The value BYTEV had before the driver was turned on. OSBYTE calls the driver does not handle are passed on through it, and it is put back in BYTEV when the driver is turned off. Page &0D below the extended vector table, used by PMFS without any claim.

&0D99–&0D9E irq1v_trampoline W

Six bytes of code built by the driver when it is turned on: JSR irq1v_extended_entry : JMP old_irq1v_handler, where the JMP's operand is saved_irq1v. IRQ1V points here, so each interrupt first pages in PMFS and runs irq_handler, then continues to the previous IRQ1V handler.

&0D9D–&0D9E saved_irq1v R/W

The value IRQ1V had before the driver was turned on. It is also the operand of the JMP that ends irq1v_trampoline, and it is put back in IRQ1V when the driver is turned off.

&0DF0–&0DFF rom_workspace_table W/B

The MOS's table of sideways ROM private workspace pages, one byte per ROM. On every service call PMFS writes &91 into its own entry, then uses that entry to find the pages it keeps in its own bank: &9200 (pointer images), &9300 (pointer masks), &9400 (the screen under the pointer) and &9440 (the stored workspace).

MOS entry points

Address Name Access Description
&FF06 irq1v_extended_entry

Extended vector entry point for vector 2 (IRQ1V). Calling it pages in the ROM recorded in entry 2 of the extended vector table, calls the address held there, and pages the previous ROM back in. PMFS's IRQ1V trampoline calls it to run irq_handler.

&FF0F bytev_extended_entry

Extended vector entry point for vector 5 (BYTEV). PMFS points BYTEV here, and puts its OSBYTE handler in entry 5 of the extended vector table.

&FFEE oswrch

Write a character to the VDU stream. PMFS uses it only for the VDU 19 palette commands sent by *SETPAL.

&FFF4 osbyte

OSBYTE. PMFS reads the ADC and digital joystick (&80), the keyboard (&81), the screen mode (&87), the extended vector table address (&A8) and the TAB key's code (&DB); it sets the cursor-key behaviour (&04, &E2), the ROM polling semaphore (&16, &17) and inserts keys into the keyboard buffer (&99).