Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
spotlessmind1975 committed Dec 7, 2024
2 parents 1ee466b + 3272460 commit 421d18b
Show file tree
Hide file tree
Showing 47 changed files with 251 additions and 16 deletions.
3 changes: 2 additions & 1 deletion ugbc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ LIBXML2=../modules/libxml2/.libs/libxml2.a
LIBXML2PATH=../modules/libxml2
endif

REVISION := "$(shell git describe --abbrev=9 --always)"
FLEX_VERSION=$(shell flex --version)
FLEX_OPTIONS=--8bit
BISON_OPTIONS=--locations -d
CFLAGS=-O3 -fomit-frame-pointer -I $(LIBXML2PATH)/include -D LIBXML_STATIC
CFLAGS=-O3 -fomit-frame-pointer -I $(LIBXML2PATH)/include -D LIBXML_STATIC -DUGBASIC_REVISION=\"$(REVISION)\"
LFLAGS=
LIBS=-lm $(LIBXML2)
BETA=$(shell cat ../.git/HEAD | grep beta)
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/6847.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,10 @@ void c6847_initialization( Environment * _environment ) {

void c6847_finalization( Environment * _environment ) {

if (_environment->vestigialConfig.clsImplicit ) {
deploy( clsText, src_hw_6847_cls_text_asm );
}

}

void c6847_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/cpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,10 @@ void cpc_initialization( Environment * _environment ) {

void cpc_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsGraphic, src_hw_cpc_cls_graphic_asm );
}

}

void cpc_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/cpc/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ SYSCALLDONE:
EXX
EI

@IF vestigialConfig.clsImplicit
CALL CLSG
@ENDIF

RET

@IF sysCallUsed
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/ef9345.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,10 @@ void ef9345_initialization( Environment * _environment ) {

void ef9345_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsText, src_hw_ef9345_cls_asm );
}

}

void ef9345_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/ef9345/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ EF9345STARTUP:
; Re-enable interrupts.
EI

@IF vestigialConfig.clsImplicit
CALL CLS
@ENDIF

RET

EF9345CONFIG:
Expand Down
9 changes: 7 additions & 2 deletions ugbc/src/hw/ef936x.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ void ef936x_text( Environment * _environment, char * _text, char * _text_size, i
void ef936x_initialization( Environment * _environment ) {

deploy_preferred( ef936xvars, src_hw_ef936x_vars_asm );
deploy( ef936xstartup, src_hw_ef936x_startup_asm );
deploy_preferred( ef936xstartup, src_hw_ef936x_startup_asm );

variable_import( _environment, "CURRENTMODE", VT_BYTE, 0 );
variable_global( _environment, "CURRENTMODE" );
Expand Down Expand Up @@ -888,7 +888,12 @@ void ef936x_finalization( Environment * _environment ) {
}
}
outline4("$%1.1x%1.1x%1.1x%1.1x", 0, EF936X_COMPONENT_BITMASK * 0x10 | ( ( palette[15].blue >> 4 ) & 0x0f ) , ( ( palette[15].green >> 4 ) & 0x0f ) , ( ( palette[15].red >> 4 ) & 0x0f ) );


if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsGraphic, src_hw_ef936x_cls_asm );

}

}

void ef936x_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
5 changes: 5 additions & 0 deletions ugbc/src/hw/ef936x/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ EF936XSTARTUPL1
STA ,Y
LEAX -1,X
BNE EF936XSTARTUPL1

@IF vestigialConfig.clsImplicit
JSR CLS
@ENDIF

RTS

; ===========[ VERTICAL BLANK ]===========
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/gime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,10 @@ void gime_initialization( Environment * _environment ) {

void gime_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy_preferred( clsText, src_hw_gime_cls_text_asm );
}

}

void gime_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/gime/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ GIMESTARTUP
; Turn on ROM/RAM
JSR GIMEBANKROM

@IF vestigialConfig.clsImplicit
JSR CLST
@ENDIF

RTS

; Look for a specific (pen) color into the palette.
Expand Down
14 changes: 10 additions & 4 deletions ugbc/src/hw/gtia.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,9 +1632,7 @@ int gtia_screen_mode_enable( Environment * _environment, ScreenMode * _screen_mo
outline0("STA LASTCOLOR");
}

if (_environment->vestigialConfig.clsImplicit ) {
gtia_cls( _environment );
}
outline0("JSR GTIAAFTERINIT");

}

Expand Down Expand Up @@ -2076,10 +2074,18 @@ void gtia_initialization( Environment * _environment ) {

gtia_tilemap_enable( _environment, 40, 24, 1, 8, 8 );

if (_environment->vestigialConfig.clsImplicit ) {
gtia_cls( _environment );
}

}

void gtia_finalization( Environment * _environment ) {


if (_environment->vestigialConfig.clsImplicit ) {
deploy( cls, src_hw_gtia_cls_asm );
}

}

void gtia_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
5 changes: 5 additions & 0 deletions ugbc/src/hw/gtia/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@ GTIASTARTUPDONE:
SEI
RTS

GTIAAFTERINIT:
@IF vestigialConfig.clsImplicit
JSR CLS
@ENDIF
RTS
4 changes: 4 additions & 0 deletions ugbc/src/hw/pc1403.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ void pc1403_initialization( Environment * _environment ) {

void pc1403_finalization( Environment * _environment ) {

// if (_environment->vestigialConfig.clsImplicit ) {
// pc1403_cls( _environment, NULL, NULL );
// }

}

void pc1403_screen_rows( Environment * _environment, char * _rows ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/ted.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,10 @@ void ted_finalization( Environment * _environment ) {
outline0( "RTS" );
}

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsText, src_hw_ted_cls_text_asm );
}

}

void ted_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/ted/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ TEDSTARTUP:
STA $0315
CLI

@IF vestigialConfig.clsImplicit
JSR CLST
@ENDIF

RTS

IMF_TOKEN_WAIT1 = $ff
Expand Down
8 changes: 7 additions & 1 deletion ugbc/src/hw/tms9918.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ void tms9918_text( Environment * _environment, char * _text, char * _text_size,
void tms9918_initialization( Environment * _environment ) {

deploy( tms9918vars, src_hw_tms9918_vars_asm );
deploy( tms9918startup, src_hw_tms9918_startup_asm );
deploy_preferred( tms9918startup, src_hw_tms9918_startup_asm );

variable_import( _environment, "CURRENTWIDTH", VT_POSITION, 256 );
variable_global( _environment, "CURRENTWIDTH" );
Expand Down Expand Up @@ -1633,10 +1633,16 @@ void tms9918_initialization( Environment * _environment ) {
_environment->currentRgbConverterFunction = rgbConverterFunction;
_environment->screenShades = 16;

outline0("CALL TMS9918AFTERINIT");

}

void tms9918_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsText, src_hw_tms9918_cls_text_asm );
}

}

void tms9918_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
6 changes: 6 additions & 0 deletions ugbc/src/hw/tms9918/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,12 @@ TMS9918STARTUPL1:

RET

TMS9918AFTERINIT:
@IF vestigialConfig.clsImplicit
CALL CLST
@ENDIF
RET

TMS9918SPRITEINIT:
PUSH HL
LD HL, (SPRITEAADDRESS)
Expand Down
6 changes: 5 additions & 1 deletion ugbc/src/hw/vdcz.c
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ void vdcz_text( Environment * _environment, char * _text, char * _text_size, int
void vdcz_initialization( Environment * _environment ) {

deploy( vdczvars, src_hw_vdcz_vars_asm );
deploy( vdczstartup, src_hw_vdcz_startup_asm );
deploy_preferred( vdczstartup, src_hw_vdcz_startup_asm );

variable_import( _environment, "CURRENTWIDTH", VT_POSITION, 256 );
variable_global( _environment, "CURRENTWIDTH" );
Expand Down Expand Up @@ -2521,6 +2521,10 @@ static RGBi * multicolorSpritePalette[2];

void vdcz_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( clsText, src_hw_vdcz_cls_text_asm );
}

}

void vdcz_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
3 changes: 3 additions & 0 deletions ugbc/src/hw/vdcz/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ VDCZGETCHAR:
RET

VDCZSTARTUP:
@IF vestigialConfig.clsImplicit
CALL CLST
@ENDIF
RET

VDCZVIDEOSTARTUP:
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/vic1.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ void vic1_finalization( Environment * _environment ) {
outline0( "RTS" );
}

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( cls, src_hw_vic1_cls_asm );
}

}

void vic1_hscroll_line( Environment * _environment, int _direction ) {
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/vic1/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ VIC1STARTUP:
LDA #$0
STA YCURSYS

@IF vestigialConfig.clsImplicit
JSR CLST
@ENDIF

RTS

IMF_TOKEN_WAIT1 = $ff
Expand Down
28 changes: 28 additions & 0 deletions ugbc/src/hw/vic2/cls_graphic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,34 @@ CLSGY2:
DEX
BNE CLSGY2

LDA COLORMAPADDRESS
STA COPYOFCOLORMAPADDRESS
LDA COLORMAPADDRESS+1
STA COPYOFCOLORMAPADDRESS+1
LDX #3
LDY #0
LDA _PEN
ASL A
ASL A
ASL A
ASL A
ORA _PAPER
CLGC:
STA (COPYOFCOLORMAPADDRESS),Y
INY
BNE CLGC
INC COPYOFCOLORMAPADDRESS+1
CPX #1
BNE CLGCNB
CLGC2:
STA (COPYOFCOLORMAPADDRESS),Y
INY
CPY #232
BNE CLGC2
CLGCNB:
DEX
BNE CLGC

@IF !vestigialConfig.screenModeUnique
LDA CURRENTMODE
CMP #3
Expand Down
4 changes: 4 additions & 0 deletions ugbc/src/hw/vic2/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ VIC2STARTUPL1:

CLI

@IF vestigialConfig.clsImplicit
JSR CLST
@ENDIF

RTS

@IF vestigialConfig.doubleBufferSelected || vestigialConfig.doubleBuffer
Expand Down
5 changes: 5 additions & 0 deletions ugbc/src/hw/zx.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void zx_text( Environment * _environment, char * _text, char * _text_size, int _
deploy( vars,src_hw_zx_vars_asm);
deploy( vScroll, src_hw_zx_vscroll_asm );
deploy( textEncodedAt, src_hw_zx_text_at_asm );
deploy( cls, src_hw_zx_cls_asm );

// z80_move_8bit( _environment, _tab, "TABCOUNT");

Expand Down Expand Up @@ -427,6 +428,10 @@ void zx_initialization( Environment * _environment ) {

void zx_finalization( Environment * _environment ) {

if ( _environment->vestigialConfig.clsImplicit ) {
deploy( cls, src_hw_zx_cls_asm );
}

}

void zx_screen_rows( Environment * _environment, char * _rows ) {
Expand Down
5 changes: 5 additions & 0 deletions ugbc/src/hw/zx/startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ ZXNTSC:
JP ZXSTARTUPDONE

ZXSTARTUPDONE:

@IF vestigialConfig.clsImplicit
CALL CLS
@ENDIF

RET
WAITTIMER:
Expand Down
2 changes: 2 additions & 0 deletions ugbc/src/targets/atari/_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static void variable_cleanup_entry( Environment * _environment, Variable * _firs
break;
case VT_TILE:
case VT_SPRITE:
case VT_MSPRITE:
case VT_TILESET:
if ( variable->memoryArea ) {
// outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
Expand Down Expand Up @@ -314,6 +315,7 @@ static void variable_cleanup_memory_mapped( Environment * _environment, Variable
case VT_STRING:
break;
case VT_DSTRING:
case VT_MSPRITE:
case VT_SPRITE:
case VT_TILE:
case VT_TILESET:
Expand Down
6 changes: 3 additions & 3 deletions ugbc/src/targets/atari/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ Variable * random_value( Environment * _environment, VariableType _type ) {

switch( VT_BITWIDTH( _type ) ) {
case 8:
cpu6502_random_8bit( _environment, "$14", result->realName );
cpu6502_random_8bit( _environment, "$D20A", result->realName );
break;
case 16:
cpu6502_random_16bit( _environment, "$14", result->realName );
cpu6502_random_16bit( _environment, "$D20A", result->realName );
break;
case 32:
cpu6502_random_32bit( _environment, "$14", result->realName );
cpu6502_random_32bit( _environment, "$D20A", result->realName );
break;
}

Expand Down
Loading

0 comments on commit 421d18b

Please sign in to comment.