mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 17:30:50 +00:00
Merge branch 'cc65:master' into fix-adc-sbc
This commit is contained in:
commit
dfc88d5796
@ -1059,7 +1059,7 @@ The namespace token (<tt/::/) is used to access other scopes:
|
||||
.endscope
|
||||
|
||||
...
|
||||
lda foo::bar ; Access foo in scope bar
|
||||
lda #foo::bar ; Access bar in scope foo
|
||||
</verb></tscreen>
|
||||
|
||||
The only way to deny access to a scope from the outside is to declare a scope
|
||||
@ -3897,7 +3897,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
|
||||
|
||||
Reserve storage. The command is followed by one or two constant
|
||||
expressions. The first one is mandatory and defines, how many bytes of
|
||||
storage should be defined. The second, optional expression must by a
|
||||
storage should be defined. The second, optional expression must be a
|
||||
constant byte value that will be used as value of the data. If there
|
||||
is no fill value given, the linker will use the value defined in the
|
||||
linker configuration file (default: zero).
|
||||
|
@ -1370,7 +1370,7 @@ sequences of the input.
|
||||
Example:
|
||||
<tscreen><verb>
|
||||
/* Use a space wherever an 'a' occurs in ISO-8859-1 source */
|
||||
#pragma charmap (0x61, 0x20);
|
||||
#pragma charmap (0x61, 0x20)
|
||||
</verb></tscreen>
|
||||
|
||||
|
||||
|
@ -155,6 +155,7 @@ next: inc ptr1+1
|
||||
; Disable interrupts now because setting the slot number makes
|
||||
; the IRQ handler (maybe called due to some non-mouse IRQ) try
|
||||
; calling the firmware which isn't correctly set up yet
|
||||
php
|
||||
sei
|
||||
|
||||
; Convert to and save slot number
|
||||
@ -211,7 +212,7 @@ next: inc ptr1+1
|
||||
common: jsr firmware
|
||||
|
||||
; Enable interrupts and return success
|
||||
cli
|
||||
plp
|
||||
lda #<MOUSE_ERR_OK
|
||||
ldx #>MOUSE_ERR_OK
|
||||
rts
|
||||
@ -220,6 +221,7 @@ common: jsr firmware
|
||||
; No return code required (the driver is removed from memory on return).
|
||||
UNINSTALL:
|
||||
; Hide cursor
|
||||
php
|
||||
sei
|
||||
jsr CHIDE
|
||||
|
||||
@ -249,7 +251,8 @@ SETBOX:
|
||||
; Apple II Mouse TechNote #1, Interrupt Environment with the Mouse:
|
||||
; "Disable interrupts before placing position information in the
|
||||
; screen holes."
|
||||
: sei
|
||||
: php
|
||||
sei
|
||||
|
||||
; Set low clamp
|
||||
lda (ptr1),y
|
||||
@ -298,6 +301,7 @@ GETBOX:
|
||||
; the screen). No return code required.
|
||||
MOVE:
|
||||
ldy slot
|
||||
php
|
||||
sei
|
||||
|
||||
; Set y
|
||||
@ -328,9 +332,10 @@ MOVE:
|
||||
; no special action is required besides hiding the mouse cursor.
|
||||
; No return code required.
|
||||
HIDE:
|
||||
php
|
||||
sei
|
||||
jsr CHIDE
|
||||
cli
|
||||
plp
|
||||
rts
|
||||
|
||||
; SHOW: Is called to show the mouse cursor. The mouse kernel manages a
|
||||
@ -339,9 +344,10 @@ HIDE:
|
||||
; no special action is required besides enabling the mouse cursor.
|
||||
; No return code required.
|
||||
SHOW:
|
||||
php
|
||||
sei
|
||||
jsr CSHOW
|
||||
cli
|
||||
plp
|
||||
rts
|
||||
|
||||
; BUTTONS: Return the button mask in A/X.
|
||||
@ -360,12 +366,13 @@ POS:
|
||||
; struct pointed to by ptr1. No return code required.
|
||||
INFO:
|
||||
ldy #.sizeof(MOUSE_INFO)-1
|
||||
copy: sei
|
||||
copy: php
|
||||
sei
|
||||
: lda info,y
|
||||
sta (ptr1),y
|
||||
dey
|
||||
bpl :-
|
||||
cli
|
||||
plp
|
||||
rts
|
||||
|
||||
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
|
||||
|
@ -304,8 +304,9 @@ IIgs:
|
||||
|
||||
ldx Channel
|
||||
|
||||
; Deactivate interrupts
|
||||
sei
|
||||
php ; Deactivate interrupts
|
||||
sei ; if enabled
|
||||
|
||||
ldy #WR_MASTER_IRQ_RST
|
||||
lda #MASTER_IRQ_SHUTDOWN
|
||||
jsr writeSCCReg
|
||||
@ -334,7 +335,7 @@ IIgs:
|
||||
ldx #$00
|
||||
stx Opened ; Mark port as closed
|
||||
|
||||
cli
|
||||
plp ; Reenable interrupts if needed
|
||||
: txa ; Promote char return value
|
||||
rts
|
||||
|
||||
@ -352,7 +353,8 @@ getClockSource:
|
||||
; Must return an SER_ERR_xx code in a/x.
|
||||
|
||||
SER_OPEN:
|
||||
sei
|
||||
php ; Deactivate interrupts
|
||||
sei ; if enabled
|
||||
|
||||
; Check if the handshake setting is valid
|
||||
ldy #SER_PARAMS::HANDSHAKE ; Handshake
|
||||
@ -497,9 +499,9 @@ BaudOK:
|
||||
lda #SER_ERR_OK
|
||||
|
||||
SetupOut:
|
||||
plp ; Reenable interrupts if needed
|
||||
ldx #$00 ; Promote char return value
|
||||
sty Opened
|
||||
cli
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
|
@ -29,7 +29,8 @@ iigs: bit RDVBLBAR
|
||||
rts
|
||||
|
||||
; Apple IIc TechNote #9, Detecting VBL
|
||||
iic: sei
|
||||
iic: php
|
||||
sei
|
||||
sta IOUDISOFF
|
||||
lda RDVBLMSK
|
||||
bit ENVBL
|
||||
@ -40,7 +41,7 @@ iic: sei
|
||||
bcs :+ ; VBL interrupts were already enabled
|
||||
bit DISVBL
|
||||
: sta IOUDISON ; IIc Tech Ref Man: The firmware normally leaves IOUDIS on.
|
||||
cli
|
||||
plp
|
||||
rts
|
||||
|
||||
.endif ; __APPLE2ENH__
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
|
||||
/* Use static local variables for speed */
|
||||
#pragma static-locals (on);
|
||||
#pragma static-locals (on)
|
||||
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
|
||||
/* Use static local variables for speed */
|
||||
#pragma static-locals (1);
|
||||
#pragma static-locals (1)
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
/* Use static local variables for speed */
|
||||
#pragma static-locals (1);
|
||||
#pragma static-locals (1)
|
||||
|
||||
|
||||
static const unsigned char sinustable[0x100] = {
|
||||
|
@ -27,7 +27,7 @@ void show(char *name)
|
||||
** rather place the all the code of certain source files into the overlay by
|
||||
** compiling them with --code-name OVERLAY1.
|
||||
*/
|
||||
#pragma code-name(push, "OVERLAY1");
|
||||
#pragma code-name(push, "OVERLAY1")
|
||||
|
||||
void foo(void)
|
||||
{
|
||||
@ -39,27 +39,27 @@ void foo(void)
|
||||
show("One");
|
||||
}
|
||||
|
||||
#pragma code-name(pop);
|
||||
#pragma code-name(pop)
|
||||
|
||||
|
||||
#pragma code-name(push, "OVERLAY2");
|
||||
#pragma code-name(push, "OVERLAY2")
|
||||
|
||||
void bar(void)
|
||||
{
|
||||
show("Two");
|
||||
}
|
||||
|
||||
#pragma code-name(pop);
|
||||
#pragma code-name(pop)
|
||||
|
||||
|
||||
#pragma code-name(push, "OVERLAY3");
|
||||
#pragma code-name(push, "OVERLAY3")
|
||||
|
||||
void foobar (void)
|
||||
{
|
||||
show("Three");
|
||||
}
|
||||
|
||||
#pragma code-name(pop);
|
||||
#pragma code-name(pop)
|
||||
|
||||
|
||||
void main(int /*argc*/, char *argv[])
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define divfp(_a,_b) ((((signed long)_a)<<fpshift)/(_b))
|
||||
|
||||
/* Use static local variables for speed */
|
||||
#pragma static-locals (1);
|
||||
#pragma static-locals (1)
|
||||
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#endif
|
||||
|
||||
/* Use static local variables for speed */
|
||||
#pragma static-locals (1);
|
||||
#pragma static-locals (1)
|
||||
|
||||
|
||||
|
||||
|
@ -64,34 +64,34 @@ void log (char *msg)
|
||||
** rather place all the code of certain source files into the overlay by
|
||||
** compiling them with --code-name OVERLAY1.
|
||||
*/
|
||||
#pragma code-name (push, "OVERLAY1");
|
||||
#pragma code-name (push, "OVERLAY1")
|
||||
|
||||
void foo (void)
|
||||
{
|
||||
log ("Calling main from overlay 1");
|
||||
}
|
||||
|
||||
#pragma code-name (pop);
|
||||
#pragma code-name (pop)
|
||||
|
||||
|
||||
#pragma code-name (push, "OVERLAY2");
|
||||
#pragma code-name (push, "OVERLAY2")
|
||||
|
||||
void bar (void)
|
||||
{
|
||||
log ("Calling main from overlay 2");
|
||||
}
|
||||
|
||||
#pragma code-name (pop);
|
||||
#pragma code-name (pop)
|
||||
|
||||
|
||||
#pragma code-name (push, "OVERLAY3");
|
||||
#pragma code-name (push, "OVERLAY3")
|
||||
|
||||
void foobar (void)
|
||||
{
|
||||
log ("Calling main from overlay 3");
|
||||
}
|
||||
|
||||
#pragma code-name(pop);
|
||||
#pragma code-name(pop)
|
||||
|
||||
|
||||
unsigned char loademdriver (void)
|
||||
|
@ -39,7 +39,7 @@ void log (char *msg)
|
||||
** rather place all the code of certain source files into the overlay by
|
||||
** compiling them with --code-name OVERLAY1.
|
||||
*/
|
||||
#pragma code-name (push, "OVERLAY1");
|
||||
#pragma code-name (push, "OVERLAY1")
|
||||
|
||||
void foo (void)
|
||||
{
|
||||
@ -51,27 +51,27 @@ void foo (void)
|
||||
log ("Calling main from overlay 1");
|
||||
}
|
||||
|
||||
#pragma code-name (pop);
|
||||
#pragma code-name (pop)
|
||||
|
||||
|
||||
#pragma code-name (push, "OVERLAY2");
|
||||
#pragma code-name (push, "OVERLAY2")
|
||||
|
||||
void bar (void)
|
||||
{
|
||||
log ("Calling main from overlay 2");
|
||||
}
|
||||
|
||||
#pragma code-name (pop);
|
||||
#pragma code-name (pop)
|
||||
|
||||
|
||||
#pragma code-name (push, "OVERLAY3");
|
||||
#pragma code-name (push, "OVERLAY3")
|
||||
|
||||
void foobar (void)
|
||||
{
|
||||
log ("Calling main from overlay 3");
|
||||
}
|
||||
|
||||
#pragma code-name(pop);
|
||||
#pragma code-name(pop)
|
||||
|
||||
|
||||
unsigned char loadfile (char *name, void *addr, void *size)
|
||||
|
@ -38,7 +38,7 @@ static unsigned char Sieve[COUNT];
|
||||
|
||||
|
||||
|
||||
#pragma static-locals(1);
|
||||
#pragma static-locals(1)
|
||||
|
||||
|
||||
|
||||
|
@ -45,8 +45,8 @@
|
||||
|
||||
|
||||
|
||||
/* THE memory */
|
||||
unsigned char Mem[0x10000];
|
||||
/* The memory */
|
||||
uint8_t Mem[0x10000];
|
||||
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ unsigned char Mem[0x10000];
|
||||
|
||||
|
||||
|
||||
void MemWriteByte (unsigned Addr, unsigned char Val)
|
||||
void MemWriteByte (uint16_t Addr, uint8_t Val)
|
||||
/* Write a byte to a memory location */
|
||||
{
|
||||
Mem[Addr] = Val;
|
||||
@ -64,7 +64,7 @@ void MemWriteByte (unsigned Addr, unsigned char Val)
|
||||
|
||||
|
||||
|
||||
void MemWriteWord (unsigned Addr, unsigned Val)
|
||||
void MemWriteWord (uint16_t Addr, uint16_t Val)
|
||||
/* Write a word to a memory location */
|
||||
{
|
||||
MemWriteByte (Addr, Val & 0xFF);
|
||||
@ -73,22 +73,30 @@ void MemWriteWord (unsigned Addr, unsigned Val)
|
||||
|
||||
|
||||
|
||||
unsigned MemReadWord (unsigned Addr)
|
||||
uint8_t MemReadByte (uint16_t Addr)
|
||||
/* Read a byte from a memory location */
|
||||
{
|
||||
return Mem[Addr];
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint16_t MemReadWord (uint16_t Addr)
|
||||
/* Read a word from a memory location */
|
||||
{
|
||||
unsigned W = MemReadByte (Addr++);
|
||||
uint8_t W = MemReadByte (Addr++);
|
||||
return (W | (MemReadByte (Addr) << 8));
|
||||
}
|
||||
|
||||
|
||||
|
||||
unsigned MemReadZPWord (unsigned char Addr)
|
||||
uint16_t MemReadZPWord (uint8_t Addr)
|
||||
/* Read a word from the zero page. This function differs from MemReadWord in that
|
||||
** the read will always be in the zero page, even in case of an address
|
||||
** overflow.
|
||||
*/
|
||||
{
|
||||
unsigned W = MemReadByte (Addr++);
|
||||
uint8_t W = MemReadByte (Addr++);
|
||||
return (W | (MemReadByte (Addr) << 8));
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,9 @@
|
||||
#ifndef MEMORY_H
|
||||
#define MEMORY_H
|
||||
|
||||
#include "inline.h"
|
||||
#include <stdint.h>
|
||||
|
||||
extern unsigned char Mem[0x10000];
|
||||
extern uint8_t Mem[0x10000];
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
@ -46,26 +46,19 @@ extern unsigned char Mem[0x10000];
|
||||
|
||||
|
||||
|
||||
void MemWriteByte (unsigned Addr, unsigned char Val);
|
||||
void MemWriteByte (uint16_t Addr, uint8_t Val);
|
||||
/* Write a byte to a memory location */
|
||||
|
||||
void MemWriteWord (unsigned Addr, unsigned Val);
|
||||
void MemWriteWord (uint16_t Addr, uint16_t Val);
|
||||
/* Write a word to a memory location */
|
||||
|
||||
#if defined(HAVE_INLINE)
|
||||
INLINE unsigned char MemReadByte (unsigned Addr)
|
||||
uint8_t MemReadByte (uint16_t Addr);
|
||||
/* Read a byte from a memory location */
|
||||
{
|
||||
return Mem[Addr];
|
||||
}
|
||||
#else
|
||||
#define MemReadByte(Addr) Mem[Addr]
|
||||
#endif
|
||||
|
||||
unsigned MemReadWord (unsigned Addr);
|
||||
uint16_t MemReadWord (uint16_t Addr);
|
||||
/* Read a word from a memory location */
|
||||
|
||||
unsigned MemReadZPWord (unsigned char Addr);
|
||||
uint16_t MemReadZPWord (uint8_t Addr);
|
||||
/* Read a word from the zero page. This function differs from MemReadWord in that
|
||||
** the read will always be in the zero page, even in case of an address
|
||||
** overflow.
|
||||
|
Loading…
x
Reference in New Issue
Block a user