Skip to content

Commit

Permalink
Ver 1.0.1B, (Beta)
Browse files Browse the repository at this point in the history
- Added rect clear to 'CLS', e.g. 'CLS <address>, <width>, <height>'
- Added [Comms]:Enable to 'loader_config.ini', this toggle enables/disables communications to a suitably configured Arduino connected to real Gigatron hardware.
- Fixed the 'LSL' '<<', command not emitting correct instructions in some cases.
- Fixed 'CLS <address>', <address> was not being parsed correctly.
- Refactored the Loader module's opening and closing of COM ports to a global scope rather than locally around each section of comms traffic. This was causing BabelFish to resend version info each time the comms port was opened.
- Refactored the Loader module's error handling for COM ports; the result is less comms timeouts and erroneous behaviours for misconfigured or non function COM ports.
- Optimised 'CLS <address>, <width>, <height>' for ROMv1.
  • Loading branch information
Ari Tsironis committed Jun 28, 2020
1 parent a0aa4c8 commit 27015f0
Show file tree
Hide file tree
Showing 56 changed files with 852 additions and 671 deletions.
4 changes: 1 addition & 3 deletions Contrib/at67/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ else()
add_executable(gtemuAT67 inih/INIReader.h rs232/rs232.h ${headers} rs232/rs232-linux.c ${sources})
endif()

target_link_libraries(gtemuAT67 ${SDL2_LIBRARY} ${SDL2MAIN_LIBRARY})

set_target_properties(gtemuAT67 PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE .)
target_link_libraries(gtemuAT67 ${SDL2_LIBRARY} ${SDL2MAIN_LIBRARY})
5 changes: 5 additions & 0 deletions Contrib/at67/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ namespace Cpu
}
}

Loader::closeComPort();

SDL_Quit();
}

Expand Down Expand Up @@ -698,6 +700,9 @@ namespace Cpu
fprintf(stderr, "Cpu::initialise() : failed to initialise SDL.\n");
_EXIT_(EXIT_FAILURE);
}

// Initialise COM port here so that we can see error messages
Loader::openComPort();
}

void cycle(const State& S, State& T)
Expand Down
2 changes: 1 addition & 1 deletion Contrib/at67/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


#define MAJOR_VERSION "1.0"
#define MINOR_VERSION "0B"
#define MINOR_VERSION "1B"
#define VERSION_STR "gtemuAT67 v" MAJOR_VERSION "." MINOR_VERSION

#define ROM_INST 0
Expand Down
30 changes: 15 additions & 15 deletions Contrib/at67/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,25 +1069,25 @@ namespace Editor
{
if(_keyboardMode == Giga)
{
if(_sdlKeyScanCode == _keyboard["Left"]._scanCode && _sdlKeyModifier == _keyboard["Left"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_LEFT); return true;}
else if(_sdlKeyScanCode == _keyboard["Right"]._scanCode && _sdlKeyModifier == _keyboard["Right"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_RIGHT); return true;}
else if(_sdlKeyScanCode == _keyboard["Up"]._scanCode && _sdlKeyModifier == _keyboard["Up"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_UP); return true;}
else if(_sdlKeyScanCode == _keyboard["Down"]._scanCode && _sdlKeyModifier == _keyboard["Down"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_DOWN); return true;}
else if(_sdlKeyScanCode == _keyboard["Start"]._scanCode && _sdlKeyModifier == _keyboard["Start"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_START); return true;}
if(_sdlKeyScanCode == _keyboard["Left"]._scanCode && _sdlKeyModifier == _keyboard["Left"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_LEFT); return true;}
else if(_sdlKeyScanCode == _keyboard["Right"]._scanCode && _sdlKeyModifier == _keyboard["Right"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_RIGHT); return true;}
else if(_sdlKeyScanCode == _keyboard["Up"]._scanCode && _sdlKeyModifier == _keyboard["Up"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_UP); return true;}
else if(_sdlKeyScanCode == _keyboard["Down"]._scanCode && _sdlKeyModifier == _keyboard["Down"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_DOWN); return true;}
else if(_sdlKeyScanCode == _keyboard["Start"]._scanCode && _sdlKeyModifier == _keyboard["Start"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_START); return true;}
else if(_sdlKeyScanCode == _keyboard["Select"]._scanCode && _sdlKeyModifier == _keyboard["Select"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_SELECT); return true;}
else if(_sdlKeyScanCode == _keyboard["A"]._scanCode && _sdlKeyModifier == _keyboard["A"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_A); return true;}
else if(_sdlKeyScanCode == _keyboard["B"]._scanCode && _sdlKeyModifier == _keyboard["B"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_B); return true;}
else if(_sdlKeyScanCode == _keyboard["A"]._scanCode && _sdlKeyModifier == _keyboard["A"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_A); return true;}
else if(_sdlKeyScanCode == _keyboard["B"]._scanCode && _sdlKeyModifier == _keyboard["B"]._keyMod) {Cpu::setIN(Cpu::getIN() & ~INPUT_B); return true;}
}
else if(_keyboardMode == HwGiga)
{
if(_sdlKeyScanCode == _keyboard["Left"]._scanCode && _sdlKeyModifier == _keyboard["Left"]._keyMod) {Loader::sendCommandToGiga('A', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Right"]._scanCode && _sdlKeyModifier == _keyboard["Right"]._keyMod) {Loader::sendCommandToGiga('D', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Up"]._scanCode && _sdlKeyModifier == _keyboard["Up"]._keyMod) {Loader::sendCommandToGiga('W', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Down"]._scanCode && _sdlKeyModifier == _keyboard["Down"]._keyMod) {Loader::sendCommandToGiga('S', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Start"]._scanCode && _sdlKeyModifier == _keyboard["Start"]._keyMod) {Loader::sendCommandToGiga('E', true); return true;}
if(_sdlKeyScanCode == _keyboard["Left"]._scanCode && _sdlKeyModifier == _keyboard["Left"]._keyMod) {Loader::sendCommandToGiga('A', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Right"]._scanCode && _sdlKeyModifier == _keyboard["Right"]._keyMod) {Loader::sendCommandToGiga('D', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Up"]._scanCode && _sdlKeyModifier == _keyboard["Up"]._keyMod) {Loader::sendCommandToGiga('W', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Down"]._scanCode && _sdlKeyModifier == _keyboard["Down"]._keyMod) {Loader::sendCommandToGiga('S', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Start"]._scanCode && _sdlKeyModifier == _keyboard["Start"]._keyMod) {Loader::sendCommandToGiga('E', true); return true;}
else if(_sdlKeyScanCode == _keyboard["Select"]._scanCode && _sdlKeyModifier == _keyboard["Select"]._keyMod) {Loader::sendCommandToGiga('Q', true); return true;}
else if(_sdlKeyScanCode == _keyboard["A"]._scanCode && _sdlKeyModifier == _keyboard["A"]._keyMod) {Loader::sendCommandToGiga('Z', true); return true;}
else if(_sdlKeyScanCode == _keyboard["B"]._scanCode && _sdlKeyModifier == _keyboard["B"]._keyMod) {Loader::sendCommandToGiga('X', true); return true;}
else if(_sdlKeyScanCode == _keyboard["A"]._scanCode && _sdlKeyModifier == _keyboard["A"]._keyMod) {Loader::sendCommandToGiga('Z', true); return true;}
else if(_sdlKeyScanCode == _keyboard["B"]._scanCode && _sdlKeyModifier == _keyboard["B"]._keyMod) {Loader::sendCommandToGiga('X', true); return true;}
}

return false;
Expand Down Expand Up @@ -1177,7 +1177,7 @@ namespace Editor

// Gigatron Keyboard emulation mode
else if(handleGigaKeyDown()) return;
#if 1
#if 0
else if(_sdlKeyScanCode == SDLK_PAGEUP)
{
double gamma = Image::getGammaInput();
Expand Down
45 changes: 22 additions & 23 deletions Contrib/at67/gbas/classic/bowling.gasm
Original file line number Diff line number Diff line change
Expand Up @@ -1036,36 +1036,36 @@ _end_0x0833 BRA _end_0x0833
romCheck EQU 0x58b1
realTimeStub EQU 0x56da
convertEqOp EQU 0x6ea3
convertNeOp EQU 0x5aa2
convertGeOp EQU 0x59a7
convertLtOp EQU 0x58a8
convertNeOp EQU 0x5fa7
convertGeOp EQU 0x5ba0
convertLtOp EQU 0x5aa2
convert16Arr2d EQU 0x71a0
multiply16bit EQU 0x5acd
divide16bit EQU 0x61a8
randMod16bit EQU 0x56ec
scanlineMode EQU 0x6fa2
resetVideoFlags EQU 0x70a0
initClearFuncs EQU 0x60a1
clearVertBlinds EQU 0x5dc5
initClearFuncs EQU 0x58a0
clearVertBlinds EQU 0x5cc9
clearCursorRow EQU 0x59cf
input EQU 0x5ba4
input EQU 0x5ca2
inputExt1 EQU 0x5fb0
inputExt2 EQU 0x58e1
inputCursor EQU 0x5ca4
inputCursor EQU 0x5ba9
inputKeys EQU 0x64a4
inputIntVar EQU 0x57a9
inputStrVar EQU 0x57e8
inputReturn EQU 0x5cc6
inputReturn EQU 0x5dc6
inputDelete EQU 0x66a0
inputPrint EQU 0x5ea1
inputNewline EQU 0x57bd
printInit EQU 0x57d2
printText EQU 0x58c8
printDigit EQU 0x5aab
printInt16 EQU 0x60ae
printChr EQU 0x5fa3
printChr EQU 0x60a1
printChar EQU 0x62a7
atTextCursor EQU 0x5da0
atTextCursor EQU 0x5da1
newLineScroll EQU 0x63a4
integerStr EQU 0x5ec0
stringCmp EQU 0x59b0
Expand Down Expand Up @@ -1383,21 +1383,22 @@ clrLines EQU register14
clrWidth EQU register15


resetVideoFlags LDI giga_CursorX ; cursor x start
resetVideoFlags LDI giga_CursorX ; cursor x start
STW cursorXY
LDWI ON_BOTTOM_ROW_MSK
ANDW miscFlags
STW miscFlags ; reset on bottom row flag
STW miscFlags ; reset on bottom row flag
RET



initClearFuncs PUSH
LDWI resetVideoFlags
CALL giga_vAC

LDWI SYS_SetMemory_v2_54 ; setup fill memory SYS routine
LDWI SYS_SetMemory_v2_54 ; setup fill memory SYS routine
STW giga_sysFn
LD fgbgColour
ST giga_sysArg1 ; fill value
POP
RET

Expand All @@ -1406,28 +1407,26 @@ initClearFuncs PUSH
clearVertBlinds PUSH
LDWI initClearFuncs
CALL giga_vAC
LD fgbgColour
ST giga_sysArg1 ; fill value
LDI giga_vram >> 8
STW top

clearVB_loopy LDI giga_xres
ST giga_sysArg0
LDI 0
ST giga_sysArg2 ; low start address
ST giga_sysArg2 ; low start address
LD top
ST giga_sysArg3 ; top line
SYS 54 ; fill memory
ST giga_sysArg3 ; top line
SYS 54 ; fill memory

LDI giga_xres
ST giga_sysArg0
LDI 0
ST giga_sysArg2 ; low start address
ST giga_sysArg2 ; low start address
LDWI giga_yres - 1 + 16
SUBW top
ST giga_sysArg3 ; bottom line
SYS 54 ; fill memory
INC top ; next top line
ST giga_sysArg3 ; bottom line
SYS 54 ; fill memory
INC top ; next top line
CALL realTimeStubAddr
LD top
SUBI giga_yres / 2 + 8
Expand Down
Binary file modified Contrib/at67/gbas/classic/bowling.gt1
Binary file not shown.
31 changes: 15 additions & 16 deletions Contrib/at67/gbas/demos/Boing64k.gasm
Original file line number Diff line number Diff line change
Expand Up @@ -1436,12 +1436,12 @@ romCheck EQU 0xfe09
realTimeStub EQU 0xfb02
scanlineMode EQU 0xf81c
resetVideoFlags EQU 0xf908
initClearFuncs EQU 0xfc02
clearVertBlinds EQU 0xfd02
initClearFuncs EQU 0xfa03
clearVertBlinds EQU 0xfd06
drawHLine EQU 0xfc0f
drawRectF EQU 0xfb14
draw_sprite EQU 0xfa14
drawSprite EQU 0xfa07
drawSprite EQU 0xfc02
soundAllOff EQU 0xf826
soundOnV EQU 0xf914
convertEqOpAddr EQU 0x00c2
Expand Down Expand Up @@ -1605,21 +1605,22 @@ clrLines EQU register14
clrWidth EQU register15


resetVideoFlags LDI giga_CursorX ; cursor x start
resetVideoFlags LDI giga_CursorX ; cursor x start
STW cursorXY
LDWI ON_BOTTOM_ROW_MSK
ANDW miscFlags
STW miscFlags ; reset on bottom row flag
STW miscFlags ; reset on bottom row flag
RET



initClearFuncs PUSH
LDWI resetVideoFlags
CALL giga_vAC

LDWI SYS_SetMemory_v2_54 ; setup fill memory SYS routine
LDWI SYS_SetMemory_v2_54 ; setup fill memory SYS routine
STW giga_sysFn
LD fgbgColour
ST giga_sysArg1 ; fill value
POP
RET

Expand All @@ -1628,28 +1629,26 @@ initClearFuncs PUSH
clearVertBlinds PUSH
LDWI initClearFuncs
CALL giga_vAC
LD fgbgColour
ST giga_sysArg1 ; fill value
LDI giga_vram >> 8
STW top

clearVB_loopy LDI giga_xres
ST giga_sysArg0
LDI 0
ST giga_sysArg2 ; low start address
ST giga_sysArg2 ; low start address
LD top
ST giga_sysArg3 ; top line
SYS 54 ; fill memory
ST giga_sysArg3 ; top line
SYS 54 ; fill memory

LDI giga_xres
ST giga_sysArg0
LDI 0
ST giga_sysArg2 ; low start address
ST giga_sysArg2 ; low start address
LDWI giga_yres - 1 + 16
SUBW top
ST giga_sysArg3 ; bottom line
SYS 54 ; fill memory
INC top ; next top line
ST giga_sysArg3 ; bottom line
SYS 54 ; fill memory
INC top ; next top line
CALL realTimeStubAddr
LD top
SUBI giga_yres / 2 + 8
Expand Down
Binary file modified Contrib/at67/gbas/demos/Boing64k.gt1
Binary file not shown.
Loading

0 comments on commit 27015f0

Please sign in to comment.