CPCWiki forum

General Category => Programming => Topic started by: arnoldemu on 11:47, 31 December 24

Title: Interrupt positions with various sized screens
Post by: arnoldemu on 11:47, 31 December 24
For fun and reference is attached a disk which shows the CPCs interrupt positions on-screen in relation to the pixels. 

It is meant as a reference for designers, artists and for anyone starting coding on the CPC.

With this you can for example decide where to switch modes or palettes. The interrupt positions here are the defaults where they've not been delayed.

For example in the attached image changing the mode to 1 at the start of the bright cyan region and then to mode 0 at the start of the black region would allow an easy mode 1 hud of 4 chars in height with the remainder as mode 0. 

If for example we wanted to have a mode 1 screen with a mode 1 hud starting at 'T' we would use the interrupt starting with the dark green region but then we'd need to 'burn' cycles to get to the T position.

The interrupt positions in relation to the pixels can be adjusted by moving the screen up and down.

The following screen sizes are shown:
* normal (40 x 25)
* tall (32x32)
* Spectrum (32x24)
* overscan '32kb method' 48x34.


Title: Re: Interrupt positions with various sized screens
Post by: McArti0 on 21:59, 31 December 24
macro LD_BC_HL
   ld b,h:ld c,l
mend

org #B941

jp custom_int


org #BE80
.pushbc
dw 0
.color
db #54

org #8000
.start
ld hl,return_INT-start
add hl,de
LD_BC_HL ; return_int offset
ld hl,reloc-start
add hl,de ;reloc offset


ld (hl),c
inc hl
ld (hl),b

di

ld hl,custom_int-start
add hl,de
LD A,#c3
ld (#b941),A
LD (#b942),HL

ret

.custom_int ;***********
ld (pushbc),bc

reloc equ $+1
ld bc,return_INT
push bc

ld bc,&7f10
out (c),c

intcolor equ $+1
ld c,&5F
out (c),c

ld bc,(pushbc)

.end_custom_int
EX AF,AF'
JP C,#B978
JP #B945

.return_INT
push bc

ld bc,&7f10
out (c),c

push af
;color equ $+1
ld a,(color)
out (c),a

ld a,(&b7f6)
inc a
jr z,aa
ld a,(&b7d4)
set 6,a
ld (color),a
pop af
pop bc
ret
.aa
ld a,(&b7e5)
set 6,a
ld (color),a
pop af
pop bc
ret

print "CUSTOM_INT:$custom_int INTCOLOR:$intcolor"

interrupt bars
Title: Re: Interrupt positions with various sized screens
Post by: McArti0 on 23:35, 31 December 24
Real CPC like in WinAPE.
Title: Re: Interrupt positions with various sized screens
Post by: GUNHED on 18:22, 03 January 25
Using real cooperative multitasking it all looks a bit different...
Title: Re: Interrupt positions with various sized screens
Post by: arnoldemu on 19:09, 03 January 25
Quote from: McArti0 on 23:35, 31 December 24Real CPC like in WinAPE.
Nice and it shows a method to keep firmware interrupts running but be the first to handle the interrupt. I think the thicker bar shows where the keyboard is being read.

Another example which allows us to get in ahead of the firmware ints: https://www.cpcwiki.eu/forum/programming/asm-source-code/msg13478/#msg13478
Powered by SMFPacks Menu Editor Mod