Skip to content

Commit

Permalink
Merge pull request #27 from michaelsternberg/master
Browse files Browse the repository at this point in the history
Added dist.apple2enh
  • Loading branch information
tschak909 authored Jan 20, 2019
2 parents d14cde0 + e0ed8f9 commit 52000e5
Show file tree
Hide file tree
Showing 29 changed files with 2,698 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf

.vimrc
.Virtual*.po
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Space or comma separated list of cc65 supported target platforms to build for.
# Default: c64 (lowercase!)
TARGETS := c64,c128,atari,apple2
TARGETS := c64,c128,atari,apple2,apple2enh

# Name of the final, single-file executable.
# Default: name of the current dir with target name appended
Expand Down Expand Up @@ -372,6 +372,16 @@ dist-apple2: $(PROGRAM).apple2
java -jar dist.apple2/ac.jar -p dist.apple2/dist.po a2.stdmou.mou rel 0 <dist.apple2/a2.stdmou.mou
java -jar dist.apple2/ac.jar -p dist.apple2/dist.po splash.bin rel 0 <dist.apple2/splash.bin

dist-apple2enh: $(PROGRAM).apple2enh
cp dist.apple2enh/bootable.po dist.apple2enh/dist.po
java -jar dist.apple2enh/ac.jar -p dist.apple2enh/dist.po plato.system sys <dist.apple2enh/plato.system
java -jar dist.apple2enh/ac.jar -p dist.apple2enh/dist.po license.system sys <dist.apple2enh/license.system
java -jar dist.apple2enh/ac.jar -as dist.apple2enh/dist.po plato <plato.apple2enh
java -jar dist.apple2enh/ac.jar -as dist.apple2enh/dist.po license <dist.apple2enh/license
java -jar dist.apple2enh/ac.jar -p dist.apple2enh/dist.po a2.ssc.ser rel 0 <dist.apple2enh/a2.ssc.ser
java -jar dist.apple2enh/ac.jar -p dist.apple2enh/dist.po a2.stdmou.mou rel 0 <dist.apple2enh/a2.stdmou.mou
java -jar dist.apple2enh/ac.jar -p dist.apple2enh/dist.po splash.bin rel 0 <dist.apple2enh/splash.bin

dist-atari: $(PROGRAM).atari
cp plato.atari dist.atari/files/plato.com
dir2atr -b Dos25 1040 dist.atari/plato.atr dist.atari/files
Expand Down
1 change: 1 addition & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PATH=$PATH:/cygdrive/d/VICE
make -j5 clean
make -j5
make dist-apple2
make dist-apple2enh
make dist-atari
make dist-c64
make dist-c128
Binary file added dist.apple2enh/a2.ssc.ser
Binary file not shown.
Binary file added dist.apple2enh/a2.stdmou.mou
Binary file not shown.
Binary file added dist.apple2enh/ac.jar
Binary file not shown.
Binary file added dist.apple2enh/bootable.po
Binary file not shown.
Binary file added dist.apple2enh/license
Binary file not shown.
Binary file added dist.apple2enh/license.system
Binary file not shown.
Binary file added dist.apple2enh/plato.system
Binary file not shown.
Binary file added dist.apple2enh/splash.bin
Binary file not shown.
47 changes: 44 additions & 3 deletions src/apple2/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,14 @@ void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count)
goto chardraw_with_fries;
}

if (CurMode==ModeRewrite)
{
goto chardraw_rewrite;
}

/* the diet chardraw routine - fast text output. */

tgi_setcolor(mainColor);
for (i=0;i<count;++i)
{
a=*ch;
Expand All @@ -257,10 +263,7 @@ void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count)
for (k=0;k<FONT_SIZE_X;++k)
{
if (b<0) /* check sign bit. */
{
tgi_setcolor(mainColor);
tgi_setpixel(x,y);
}

++x;
b<<=1;
Expand All @@ -277,6 +280,44 @@ void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count)

return;

chardraw_rewrite:

/* the diet chardraw routine - fast text output. */

for (i=0;i<count;++i)
{
a=*ch;
++ch;
a+=offset;
p=&curfont[FONTPTR(a)];

for (j=0;j<FONT_SIZE_Y;++j)
{
b=*p;

for (k=0;k<FONT_SIZE_X;++k)
{
if (b<0) /* check sign bit. */
tgi_setcolor(mainColor);
else
tgi_setcolor(altColor);

tgi_setpixel(x,y);
++x;
b<<=1;
}

++y;
x-=width;
++p;
}

x+=width;
y-=height;
}

return;

chardraw_with_fries:
if (Rotate)
{
Expand Down
48 changes: 48 additions & 0 deletions src/apple2enh/apple2enh.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Default configuration (allowing for 3KB in LC)

FEATURES {
STARTADDRESS: default = $4000;
}
SYMBOLS {
__EXEHDR__: type = import;
__FILETYPE__: type = weak, value = $0006; # ProDOS file type
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__HIMEM__: type = weak, value = $BF00; # Presumed RAM end
__LCADDR__: type = weak, value = $D400; # Behind quit code
__LCSIZE__: type = weak, value = $0C00; # Rest of bank two
}
MEMORY {
ZP: file = "", define = yes, start = $0080, size = $001A;
HEADER: file = %O, start = %S - $003A, size = $003A;
MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - %S;
BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __STACKSIZE__ - __ONCE_RUN__;
LC: file = "", define = yes, start = __LCADDR__, size = __LCSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = ONCE;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}
90 changes: 90 additions & 0 deletions src/apple2enh/apple2enh.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

;-----------------------------------------------------------------------------
; Zero page stuff

WNDLFT := $20 ; Text window left
WNDWDTH := $21 ; Text window width
WNDTOP := $22 ; Text window top
WNDBTM := $23 ; Text window bottom+1
CH := $24 ; Cursor horizontal position
CV := $25 ; Cursor vertical position
BASL := $28 ; Text base address low
BASH := $29 ; Text base address high
INVFLG := $32 ; Normal/inverse(/flash)
PROMPT := $33 ; Used by GETLN
RNDL := $4E ; Random counter low
RNDH := $4F ; Random counter high
HIMEM := $73 ; Highest available memory address+1

;-----------------------------------------------------------------------------
; Vectors

DOSWARM := $03D0 ; DOS warmstart vector
BRKVec := $03F0 ; Break vector
SOFTEV := $03F2 ; Vector for warm start
PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1

;-----------------------------------------------------------------------------
; Hardware

; Keyboard input
KBD := $C000 ; Read keyboard
KBDSTRB := $C010 ; Clear keyboard strobe

; 80 column video switches
CLR80COL:= $C000 ; Disable 80 column store
SET80COL:= $C001 ; Enable 80 column store
RAMRDOFF:= $C002 ; 48K RAM read off
RAMWTOFF:= $C004 ; 48K RAM write off
W80OFF := $C00C ; Write for single display
W80COL := $C00D ; Write for double display
RD80COL := $C018 ; >127 if 80 column store enabled
VBL := $C019 ; Vertical Blanking
READPAGE:= $C01C ; $80 = aux page
RD80VID := $C01F ; >127 if 80 column video enabled

; Character set switches
CLRALTCHAR := $C00E ; Normal Apple II char set
SETALTCHAR := $C00F ; Norm/inv LC, no flash
ALTCHARSET := $C01E ; >127 if alt charset switched in

; Language card switches
RDLCBNK2:= $C011 ; >127 if LC bank 2 in use
RDLCRAM := $C012 ; >127 if LC is read enabled
ROMIN := $C081 ; Swap in D000-FFFF ROM
LCBANK2 := $C083 ; Swap in LC bank 2
LCBANK1 := $C08B ; Swap in LC bank 1

; Video mode switches
TXTCLR := $C050 ; Display graphics
TXTSET := $C051 ; Display text
MIXCLR := $C052 ; Disable 4 lines of text
MIXSET := $C053 ; Enable 4 lines of text
LOWSCR := $C054 ; Page 1
HISCR := $C055 ; Page 2
LORES := $C056 ; Lores graphics
HIRES := $C057 ; Hires graphics
AN3 := $C05E ; Annunciator enables DHGR
AN3OFF := $C05F ; For lo-res display

; Game controller
BUTN0 := $C061 ; Open-Apple Key
BUTN1 := $C062 ; Closed-Apple Key

; DHGR Stuff
;HBASL := $26 ;
;HBASH := $27 ;
;HCOLOR1 := $1C ; Running color byte
;AUXFLAG := $19 ; (7)=main
;HNDX := $1E ; Horizontal offset

;X0L := $E0 ; X-coord save
;X0H := $E1 ; after DHPSN, DHPLT
;Y0 := $E2 ; Y-coord save

;HCOLOR := $E4 ; Color byte on entry
;HPAG := $E6 ; Hi-res page ($20 normal)
;HDFLAG := $EB ; (7)=2 colors, (6)=EOR
;HWIDE := $ED ; (7)=use 4-bit mask
;HMASK := $EE ; Hi-res color byte
;HMASKE := $EF ; Exten. byte of HMASK
34 changes: 34 additions & 0 deletions src/apple2enh/config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* PLATOTerm64 - A PLATO Terminal for the Commodore 64
* Based on Steve Peltz's PAD
*
* Author: Thomas Cherryhomes <thom.cherryhomes at gmail dot com>
*
* config.c - Configuration routines
*/

#include <apple2enh.h>
#include <serial.h>
#include <stdbool.h>
#include <string.h>
#include "../config.h"

extern ConfigInfo config;

#define CONFIG_DEFAULT_SERIAL_DRIVER CONFIG_SERIAL_DRIVER_SSC
#define CONFIG_DEFAULT_MOUSE_DRIVER CONFIG_MOUSE_DRIVER_STDMOU

/**
* config_set_defaults()
* Set default values for config file
*/
void config_set_defaults(void)
{
config.baud = SER_BAUD_2400;
config.xon_threshold=XON_THRESHOLD;
config.xoff_threshold=XOFF_THRESHOLD;
config.fill=false;
config.driver_ser=CONFIG_DEFAULT_SERIAL_DRIVER;
config.driver_mou=CONFIG_DEFAULT_MOUSE_DRIVER;
config_save();
}
12 changes: 12 additions & 0 deletions src/apple2enh/dhgr_subs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extern void __fastcall__ dg (void); /* Initial DHGR */
extern void __fastcall__ dhclr(void); /* Clear DHGR screen */
extern void __fastcall__ bkgnd(void); /* Change background color */
extern void __fastcall__ pen(void); /* Set brush to 1-bit mask (monochrome) */
extern void __fastcall__ hue(unsigned char c);
extern void __fastcall__ brush(void); /* Set brush to 4-bit mask */
extern void __fastcall__ dot_at(unsigned x, unsigned char y); /* Plot pixel at x, y */
extern void __fastcall__ line_to(unsigned x, unsigned char y); /* Draw line */
extern void dhbar(int x1, int y1, int x2, int y2);

#define DHGR_COLOR_BLACK 0x00
#define DHGR_COLOR_WHITE 0x0F
Loading

0 comments on commit 52000e5

Please sign in to comment.