mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-12 09:22:02 +00:00
Updates to calling C
This commit is contained in:
@@ -14,7 +14,8 @@ PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned
|
||||
|
||||
static unsigned short _copperData;
|
||||
static unsigned char _bitplaneData;
|
||||
static void
|
||||
|
||||
void
|
||||
TestCall()
|
||||
{
|
||||
PokeBitplanePointers(&_copperData, &_bitplaneData, 3, 4, 5);
|
||||
|
||||
@@ -28,7 +28,9 @@ Entry:
|
||||
|
||||
;===========================================================
|
||||
if 0
|
||||
PokeBitplanePointers: ; d0 = frame offset in bytes, a0 = BPLP copper list address
|
||||
PokeBitplanePointers:
|
||||
; d0 = frame offset in bytes;
|
||||
; a0 = BPLP copper list address
|
||||
movem.l d0-a6,-(sp)
|
||||
move.l bitplanes,a1
|
||||
add.l d0,a1 ; Offset for odd/even frames
|
||||
|
||||
@@ -19,14 +19,15 @@ Init:
|
||||
jsr PokeBitplanePointers
|
||||
endif
|
||||
|
||||
;; void PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes)
|
||||
move.l #SCREEN_WIDTH_BYTES,-(sp)
|
||||
move.l #SCREEN_BIT_DEPTH,-(sp)
|
||||
move.l #0,-(sp)
|
||||
pea bitplanes
|
||||
pea copperList
|
||||
jsr _PokeBitplanePointers
|
||||
add.l #20,sp
|
||||
;; Make a call to a C function with the following prototype:
|
||||
;; void PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes)
|
||||
move.l #SCREEN_WIDTH_BYTES,-(sp) ; arguments are pushed onto the stack...
|
||||
move.l #SCREEN_BIT_DEPTH,-(sp) ; in reverse order
|
||||
move.l #0,-(sp) ; offset == 0
|
||||
pea bitplanes ; make sure you push the address...
|
||||
pea copperList ; of variables, not the value
|
||||
jsr _PokeBitplanePointers ; C adds an _ to all global symbols
|
||||
add.l #20,sp ; Need to pop the arguments from the stack
|
||||
|
||||
;; set up playfield
|
||||
move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6)
|
||||
|
||||
@@ -93,6 +93,7 @@ out/%.o: %.s
|
||||
out/%.o: %.c
|
||||
vc -O3 -c $< -o $@
|
||||
-@vc -O3 -S $< -o out/$*.s > /dev/null 2> /dev/null
|
||||
-@vc -O0 -S $< -o out/$*-noopt.s > /dev/null 2> /dev/null
|
||||
|
||||
out/main.bin: out/main.o $(OBJS)
|
||||
@#-T ../link.script
|
||||
|
||||
Reference in New Issue
Block a user